@thebase/ui 0.0.11 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +21 -2
- package/dist/baseui.esm.js +12 -12
- package/dist/baseui.icons.esm.js +1 -1
- package/dist/baseui.min.css +1 -1
- package/dist/baseui.min.js +12 -12
- package/dist/baseui.registry.json +8 -7
- package/dist/baseui.templates.xml +204 -222
- package/docs/blocks.md +1 -1
- package/docs/components/button.md +4 -1
- package/docs/components/sidebar.md +2 -0
- package/docs/components/tabs.md +34 -1
- package/docs/components/toast.md +23 -7
- package/docs/icons.md +1 -1
- package/docs/installation.md +2 -2
- package/docs/owl-components.md +26 -3
- package/docs/runtime-api.md +1 -1
- package/docs/theming.md +1 -1
- package/docs/usage-guide.md +4 -4
- package/package.json +1 -1
package/dist/baseui.esm.js
CHANGED
|
@@ -7,16 +7,16 @@
|
|
|
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)):([["&","&"],["<","<"],[">",">"],["'","'"],['"',"""],["`","`"]].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 fi=Object.defineProperty;var Lp=(t,e,o)=>e in t?fi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var m=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(r){throw o=[r],r}};var ka=(t,e)=>{for(var o in e)fi(t,o,{get:e[o],enumerable:!0})};var s=(t,e,o)=>Lp(t,typeof e!="symbol"?e+"":e,o);function Op(t){return typeof t=="string"?document.querySelector(t):t instanceof Element?t:null}function Oa(t,e,o={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:o}))}function Bp(t,e={}){return t.hasAttribute("b-icon")?"icon":e.name||t.getAttribute("b-ui")}function Ip(t,e){return e===document||e===t||e.contains(t)}function jp(t,e={}){return!e.allowBootstrapControl&&t.matches(Np)}function vi(t){return c.version=t,c}function yi(){if(typeof MutationObserver>"u")return;let t=new MutationObserver(e=>{for(let o of e)for(let r of o.addedNodes)r instanceof Element&&c.mountAll(r)});return t.observe(document.documentElement,{childList:!0,subtree:!0}),t}function Si(){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{c.mountAll(),yi()},{once:!0}):(c.mountAll(),yi()))}var kp,Na,_r,ta,Np,Rp,c,v=m(()=>{kp="__BASEUI_VERSION__",Na=new Map,_r=new WeakMap,ta="[b-ui], [b-icon]",Np="[data-bs-toggle], [data-bs-target], [data-bs-dismiss]";Rp=typeof window<"u"?window.BaseUI:void 0,c=Rp||{version:kp,register(t,e){if(!t||!e)throw new Error("BaseUI.register requires a name and component definition.");return Na.set(t,e),this},component(t){return Na.get(t)},mount(t,e={}){let o=Op(t);if(!o||jp(o,e))return null;let r=Bp(o,e),i=Na.get(r);if(!i)return null;let a=_r.get(o);if(a?.name===r)return a;a&&(a.destroy?.(),_r.delete(o),Oa(o,"baseui:destroyed",{name:a.name}));let p=i.mount?.(o,this,e)||{},l={name:r,element:o,destroy:p.destroy};return _r.set(o,l),Oa(o,"baseui:mounted",{name:r,instance:l}),l},mountAll(t=document){let e=t||document,o=[...e.querySelectorAll?.(ta)||[]];return e instanceof Element&&e.matches(ta)&&o.unshift(e),o.map(r=>this.mount(r)).filter(Boolean)},destroy(t=document){let e=t||document,o=[...e.querySelectorAll?.(ta)||[]];e instanceof Element&&e.matches(ta)&&o.unshift(e);for(let r of o){let i=_r.get(r);i&&Ip(r,e)&&(i.destroy?.(),_r.delete(r),Oa(r,"baseui:destroyed",{name:i.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 i=o==="radius"||o==="--b-radius"?"--base-radius":o.startsWith("--")?o:`--b-${o}`;e.style.setProperty(i,r)}}}};typeof window<"u"&&(window.BaseUI=c)});function d(...t){let e=[];for(let o of t)if(o){if(typeof o=="string")e.push(o);else if(Array.isArray(o)){let r=d(...o);r&&e.push(r)}else if(typeof o=="object")for(let[r,i]of Object.entries(o))i&&e.push(r)}return e.join(" ")}function Z(t,e,o){return t[e]??(o?t[o]:void 0)}function F(t){return t===!0||t==="open"||t==="on"||t==="active"}function G(...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,i]of Object.entries(o)){if(i==null||i==="")continue;let a=r.replace(/[A-Z]/g,p=>"-"+p.toLowerCase());e.push(`${a}:${i}`)}}return e.join(";")}function T(t){return t.state!==void 0?F(t.state):t.open!==void 0?t.open:t["default-open"]!==void 0?t["default-open"]:t.defaultOpen??!1}function U(t){return t.state!==void 0||t.open!==void 0}var S=m(()=>{});var O,Tp,n,Up,qp,Mp,zp,Pp,Dp,Hr,Fp,Ba,Ia,_p,I,_,Hp,Wr,Wp,Kp,Qt,j,q,Vp,Zp,Xp,C,Gp,Y,Yp,Br,w,f,Jp,Qp,tl,el,ea,ja=m(()=>{O=globalThis.owl;if(!O)throw new Error("BaseUI: load dist/baseui.min.js or dist/baseui.esm.js before this script (globalThis.owl is not set).");Tp=O.App,n=O.Component,Up=O.EventBus,qp=O.OwlError,Mp=O.__info__,zp=O.batched,Pp=O.blockDom,Dp=O.htmlEscape,Hr=O.loadFile,Fp=O.markRaw,Ba=O.markup,Ia=O.mount,_p=O.onError,I=O.onMounted,_=O.onPatched,Hp=O.onRendered,Wr=O.onWillDestroy,Wp=O.onWillPatch,Kp=O.onWillRender,Qt=O.onWillStart,j=O.onWillUnmount,q=O.onWillUpdateProps,Vp=O.reactive,Zp=O.status,Xp=O.toRaw,C=O.useChildSubEnv,Gp=O.useComponent,Y=O.useEffect,Yp=O.useEnv,Br=O.useExternalListener,w=O.useRef,f=O.useState,Jp=O.useSubEnv,Qp=O.validate,tl=O.validateType,el=O.whenReady,ea=O.xml});function oa(t){Object.assign(wi,t)}function Ai(t){return typeof t!="string"||!/\st-(att|attf|model)([.\s=-]|$)/.test(t)?t:t.replace(/<([A-Z][\w.:-]*)(\s[^<>]*?)?(\/?)>/g,(e,o,r="",i="")=>`<${o}${ol(o,r)}${i}>`)}function ol(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,(i,a,p,l,u)=>`${a}${p}=${l}${il(u)}${l}`);return r=r.replace(/(\s)t-model((?:\.[\w-]+)*)\s*=\s*(["'])(.*?)\3/g,(i,a,p,l,u)=>nl(t,a,p,l,u,r)),o?sl(r):r}function sl(t){return t.replace(/(\s)([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(e,o,r,i,a)=>r.startsWith("t-")||r==="t-props"||al(a)?e:`${o}${r}=${i}${rl(a)}${i}`)}function rl(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function al(t){let e=t.trim();return!e||/^(['"`[{(]|-?\d+(?:\.\d+)?$)/.test(e)||/[?.()[\]+*/]|=>|===|!==|&&|\|\|/.test(e)||/^(true|false|null|undefined)$/.test(e)}function il(t){return`\`${t.replace(/`/g,"\\`").replace(/{{\s*([\s\S]*?)\s*}}|#\{\s*([\s\S]*?)\s*\}/g,(e,o,r)=>`\${${o||r}}`)}\``}function nl(t,e,o,r,i,a){let p=/^(Checkbox|Switch)$/.test(t),l=pl(t,o),u=p?"checked":"value",b=new RegExp(`\\s${u}\\s*=`).test(a)?"":`${e}${u}=${r}${i}${r}`,h=new RegExp(`\\s${l}\\s*=`).test(a)?"":`${e}${l}=${r}${ll(i,o,p)}${r}`;return`${b}${h}`}function pl(t,e){return e.includes(".lazy")?"onChange":/^(Input|Textarea|InputGroupInput|InputGroupTextarea)$/.test(t)?"onInput":"onChange"}function ll(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 Ei(t,...e){return Array.isArray(t?.raw)?ea({raw:t.raw.map(Ai)},...e):ea(t,...e)}function sa(t,e,o={}){let r=Ai(o.templates);return t.components={...wi,...t.components||{}},Ia(t,e,r===o.templates?o:{...o,templates:r})}async function xd(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 vd,Sd,wi,g=m(()=>{ja();ja();vd=Ia,Sd=ea,wi={}});function dl(t){return typeof Image>"u"?Promise.resolve(!0):(Ra.has(t)||Ra.set(t,new Promise(e=>{let o=new Image;o.onload=()=>e(!0),o.onerror=()=>e(!1),o.src=t})),Ra.get(t))}function ra(t){return String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Kr(t,e={}){let o=ra(t);if(!ul.test(o))throw new Error(`BaseUI icon name is invalid: ${t}`);return`${String(e.baseUrl||c.icons.lucide.cdnBaseUrl).replace(/\/+$/,"")}/${o}.svg`}function z(t,e,o={}){let r=o.url||Kr(e,o),i=o.label??t.getAttribute("aria-label")??"";t.classList.add("bu-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")),i?(t.setAttribute("role","img"),t.setAttribute("aria-label",i)):t.setAttribute("aria-hidden","true");let a=o.fallback===!1?null:o.fallback||aa;return a&&!o.url&&ra(e)!==ra(a)&&dl(r).then(p=>{if(p||!t.isConnected)return;let l=Kr(a,o);t.style.setProperty("--b-icon-url",`url("${l.replace(/"/g,"%22")}")`)}),t}var Ci,cl,aa,ul,Ra,ot=m(()=>{v();Ci="1.31.0",cl=`https://cdn.jsdelivr.net/npm/lucide-static@${Ci}/icons`,aa="file",ul=/^[a-z0-9][a-z0-9-]*$/,Ra=new Map;c.icons={...c.icons||{},lucide:{version:Ci,cdnBaseUrl:cl,normalizeName:ra,url:Kr,render:z}}});function $a(t){return class extends B{get name(){return Z(this.props,"icon","name")||t}}}var B,J=m(()=>{g();ot();S();B=class extends n{setup(){this.state=f({failed:!1}),Y(e=>{if(this.state.failed=!1,typeof Image>"u"||!e||e===aa)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 Kr(e,{baseUrl:Z(this.props,"base-url","baseUrl")})}get name(){return Z(this.props,"icon","name")}get url(){return this.buildUrl(this.state.failed?aa: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}`),G(e.join(";"),this.props.style)}get classNames(){return d("bu-icon",this.props.className)}};s(B,"template","baseui.Icon"),s(B,"props",{icon:{type:String,optional:!0},name:{type:String,optional:!0},label:{type:String,optional:!0},title:{type:String,optional:!0},size:{type:String,optional:!0},"base-url":{type:String,optional:!0},baseUrl:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}})});var P,W,te=m(()=>{P={default:"btn-primary",secondary:"btn-secondary",destructive:"btn-danger",outline:"btn-outline-secondary",ghost:"btn-light",link:"btn-link"},W={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 K,ee=m(()=>{g();S();J();te();K=class extends n{get classNames(){return d("btn","bu-button",P[this.props.variant]||P.default,W[this.props.size],this.isIconOnly&&"bu-button-icon",this.props.className)}get iconPosition(){return Z(this.props,"icon-position","iconPosition")==="end"?"end":"start"}get ariaLabel(){return Z(this.props,"aria-label","ariaLabel")}get ariaPressed(){return Z(this.props,"aria-pressed","ariaPressed")}get ariaInvalid(){let e=Z(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)}};s(K,"template","baseui.Button"),s(K,"components",{Icon:B}),s(K,"props",{variant:{type:String,optional:!0},size:{type:String,optional:!0},type:{type:String,optional:!0},href:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},label:{type:String,optional:!0},icon:{type:String,optional:!0},"icon-position":{type:String,optional:!0},iconPosition:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},id:{type:String,optional:!0},title:{type:String,optional:!0},"aria-label":{type:String,optional:!0},ariaLabel:{type:String,optional:!0},"aria-pressed":{type:String,optional:!0},ariaPressed:{type:String,optional:!0},"aria-invalid":{type:[String,Boolean],optional:!0},ariaInvalid:{type:[String,Boolean],optional:!0},onClick:{type:Function,optional:!0},slots:{type:Object,optional:!0}})});function ia({variant:t="default",size:e,className:o}={}){return d("btn","bu-button","bu-clipboard-button",P[t]||P.default,W[e],o)}async function Ir(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("BaseUI 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("BaseUI ClipboardButton: clipboard copy is unavailable in this browser/context.")}var Ta,na=m(()=>{S();te();Ta=["btn","bu-button","bu-clipboard-button",...Object.values(P),...Object.values(W)]});var Bt,Li=m(()=>{g();S();J();na();Bt=class extends n{setup(){this.state=f({copied:!1}),this.resetTimer=null,j(()=>window.clearTimeout(this.resetTimer))}get classNames(){return ia(this.props)}get resetDelay(){return Z(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 Z(this.props,"aria-label","ariaLabel")||this.label}get isIconOnly(){return!this.props.label&&!this.props.slots?.default}async onClick(e){if(this.props.disabled)return;let o=this.props.getValue?this.props.getValue():this.props.value??"";try{await Ir(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})}}};s(Bt,"template","baseui.ClipboardButton"),s(Bt,"components",{Icon:B}),s(Bt,"props",{variant:{type:String,optional:!0},size:{type:String,optional:!0},value:{type:String,optional:!0},getValue:{type:Function,optional:!0},label:{type:String,optional:!0},copiedLabel:{type:String,optional:!0},icon:{type:String,optional:!0},copiedIcon:{type:String,optional:!0},"reset-delay":{type:Number,optional:!0},resetDelay:{type:Number,optional:!0},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},"aria-label":{type:String,optional:!0},ariaLabel:{type:String,optional:!0},onCopy:{type:Function,optional:!0},onCopyError:{type:Function,optional:!0},slots:{type:Object,optional:!0}})});var oe,Ua=m(()=>{oe={primary:"bu-badge-primary",secondary:"bu-badge-secondary",success:"bu-badge-success",warning:"bu-badge-warning",danger:"bu-badge-danger",info:"bu-badge-info",muted:"bu-badge-muted"}});var lt,qa=m(()=>{g();S();Ua();lt=class extends n{get classNames(){return d("badge",oe[this.props.variant]||oe.secondary,this.props.pill&&"rounded-pill",this.props.className)}};s(lt,"template","baseui.Badge"),s(lt,"props",{variant:{type:String,optional:!0},pill:{type:Boolean,optional:!0},label:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var jr,ct,se,ut,re,ae,ie,Ma=m(()=>{g();jr={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},ct=class extends n{get tag(){return this.props.tag||"div"}};s(ct,"template","baseui.Card"),s(ct,"props",{...jr,tag:{type:String,optional:!0}});se=class extends n{};s(se,"template","baseui.CardHeader"),s(se,"props",jr);ut=class extends n{};s(ut,"template","baseui.CardBody"),s(ut,"props",jr);re=class extends n{};s(re,"template","baseui.CardFooter"),s(re,"props",jr);ae=class extends n{};s(ae,"template","baseui.CardTitle"),s(ae,"props",jr);ie=class extends n{};s(ie,"template","baseui.CardDescription"),s(ie,"props",jr)});function pa({tag:t="input",type:e}={}){return t==="select"?"form-select":e==="checkbox"||e==="radio"?"form-check-input":"form-control"}var za=m(()=>{});var ne,ki=m(()=>{g();S();za();ne=class extends n{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return d("bu-input",pa({tag:"input",type:this.props.type}),this.props.invalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};s(ne,"template","baseui.Input"),s(ne,"props",{value:{type:String,optional:!0},placeholder:{type:String,optional:!0},type:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},readonly:{type:Boolean,optional:!0},invalid:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},id:{type:String,optional:!0},list:{type:String,optional:!0},autocomplete:{type:String,optional:!0},"aria-label":{type:String,optional:!0},ariaLabel:{type:String,optional:!0},min:{type:[String,Number],optional:!0},max:{type:[String,Number],optional:!0},step:{type:[String,Number],optional:!0},onInput:{type:Function,optional:!0},onChange:{type:Function,optional:!0}})});function E(){let t=globalThis.bootstrap;if(!t)throw new Error("BaseUI: load dist/bootstrap.bundle.min.js before this script (globalThis.bootstrap is not set).");return t}var M=m(()=>{});function la(t,e,o){let r=t==="ArrowRight"?1:t==="ArrowLeft"?-1:0;return!r||o===0?-1:(e+r+o)%o}var Pa=m(()=>{});function Ni(t){return String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}var bl,pe,le,ce,ue,It,Oi=m(()=>{g();M();Ma();S();Pa();bl=0;pe=class extends n{setup(){this.tabsState=f({active:this.props.value??this.props.defaultValue??""}),this.instanceId=`t${++bl}`,C({tabs:this.tabsState,selectTab:e=>this.select(e),tabsId:this.instanceId}),q(e=>{e.value!==void 0&&(this.tabsState.active=e.value)})}select(e){this.props.value===void 0&&(this.tabsState.active=e),this.props.onChange?.(e)}};s(pe,"template","baseui.Tabs"),s(pe,"props",{value:{type:String,optional:!0},defaultValue:{type:String,optional:!0},onChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});le=class extends n{};s(le,"template","baseui.TabsContainer"),s(le,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});ce=class extends n{setup(){this.listRef=w("list")}onKeyDown(e){let o=[...this.listRef.el.querySelectorAll("[role='tab']")],r=o.indexOf(e.target),i=la(e.key,r,o.length);i!==-1&&(e.preventDefault(),o[i].focus(),o[i].click())}};s(ce,"template","baseui.TabsList"),s(ce,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});ue=class extends n{setup(){this.rootRef=w("root"),this.tabInstance=null,this.onShown=()=>this.env.selectTab(this.props.value),I(()=>{this.tabInstance=E().Tab.getOrCreateInstance(this.rootRef.el),this.rootRef.el.addEventListener("shown.bs.tab",this.onShown)}),j(()=>{this.rootRef.el.removeEventListener("shown.bs.tab",this.onShown),this.tabInstance?.dispose()})}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`bu-tabs-panel-${this.env.tabsId}-${Ni(this.props.value)}`}get classNames(){return d("nav-link",this.isActive&&"active",this.props.className)}onClick(){this.props.disabled||this.tabInstance?.show()}};s(ue,"template","baseui.TabTrigger"),s(ue,"props",{value:{type:String},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});It=class extends n{setup(){this.initialActive=this.isActive}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`bu-tabs-panel-${this.env.tabsId}-${Ni(this.props.value)}`}};s(It,"template","baseui.TabContent"),s(It,"components",{Card:ct,CardBody:ut}),s(It,"props",{value:{type:String},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var Rr,de,be,jt,me,he,ge,fe,ye,Bi=m(()=>{g();M();J();S();Rr={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},de=class extends n{setup(){this.dialogState=f({open:T(this.props)}),this.control={instance:null},C({dialog:this.dialogState,dialogControl:this.control,setDialogOpen:e=>this.setOpen(e)}),q(e=>{if(U(e)){let o=T(e);this.dialogState.open=o,o?this.control.instance?.show():this.control.instance?.hide()}})}setOpen(e){U(this.props)||(this.dialogState.open=e),this.props.onOpenChange?.(e)}};s(de,"template","baseui.Dialog"),s(de,"props",{open:{type:Boolean,optional:!0},state:{type:String,optional:!0},"default-open":{type:Boolean,optional:!0},defaultOpen:{type:Boolean,optional:!0},onOpenChange:{type:Function,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});be=class extends n{onClick(){this.env.dialogControl.instance?.show()}};s(be,"template","baseui.DialogTrigger"),s(be,"props",Rr);jt=class extends n{setup(){this.rootRef=w("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},I(()=>{this.env.dialogControl.instance=E().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()}),j(()=>{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}};s(jt,"template","baseui.DialogContent"),s(jt,"components",{Icon:B}),s(jt,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},showCloseButton:{type:Boolean,optional:!0},"show-close-button":{type:Boolean,optional:!0},slots:{type:Object,optional:!0}});me=class extends n{};s(me,"template","baseui.DialogHeader"),s(me,"props",Rr);he=class extends n{};s(he,"template","baseui.DialogFooter"),s(he,"props",Rr);ge=class extends n{};s(ge,"template","baseui.DialogTitle"),s(ge,"props",Rr);fe=class extends n{};s(fe,"template","baseui.DialogDescription"),s(fe,"props",Rr);ye=class extends n{};s(ye,"template","baseui.DialogClose"),s(ye,"props",Rr)});var Ii,Da,ve,Se,xe,we,ji=m(()=>{g();M();S();Ii={default:"bu-alert-default",destructive:"bu-alert-destructive",info:"bu-alert-default",success:"alert-success",warning:"alert-warning",danger:"bu-alert-destructive"},Da={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},ve=class extends n{setup(){this.rootRef=w("root"),this.bootstrapAlert=null,this.props.dismissible&&(I(()=>{this.bootstrapAlert=new(E()).Alert(this.rootRef.el)}),j(()=>{this.bootstrapAlert?.dispose()}))}get classNames(){return d("alert","bu-alert",Ii[this.props.variant]||Ii.default,this.props.dismissible&&"alert-dismissible",this.props.dismissible&&"fade",this.props.dismissible&&"show",this.props.className)}};s(ve,"template","baseui.Alert"),s(ve,"props",{variant:{type:String,optional:!0},dismissible:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Se=class extends n{};s(Se,"template","baseui.AlertTitle"),s(Se,"props",Da);xe=class extends n{};s(xe,"template","baseui.AlertDescription"),s(xe,"props",Da);we=class extends n{};s(we,"template","baseui.AlertAction"),s(we,"props",Da)});var ca,Ri,ml,Ae,Ee,Ce,Le,ke,Ne,$i=m(()=>{g();S();ca={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Ri={default:"bu-empty-default",outline:"bu-empty-outline",background:"bu-empty-background"},ml={default:"bu-empty-media-default",icon:"bu-empty-media-icon"},Ae=class extends n{get classNames(){return d("bu-empty",Ri[this.props.variant]||Ri.default,this.props.className)}};s(Ae,"template","baseui.Empty"),s(Ae,"props",{variant:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Ee=class extends n{};s(Ee,"template","baseui.EmptyHeader"),s(Ee,"props",ca);Ce=class extends n{get variant(){return this.props.variant==="icon"?"icon":"default"}get classNames(){return d("bu-empty-media",ml[this.variant],this.props.className)}};s(Ce,"template","baseui.EmptyMedia"),s(Ce,"props",{variant:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Le=class extends n{};s(Le,"template","baseui.EmptyTitle"),s(Le,"props",ca);ke=class extends n{};s(ke,"template","baseui.EmptyDescription"),s(ke,"props",ca);Ne=class extends n{};s(Ne,"template","baseui.EmptyContent"),s(Ne,"props",ca)});var Oe,Ti=m(()=>{g();S();Oe=class extends n{get vertical(){return this.props.orientation==="vertical"}get classNames(){return d("bu-separator",this.vertical?"bu-separator-vertical":"bu-separator-horizontal",this.props.className)}};s(Oe,"template","baseui.Separator"),s(Oe,"props",{orientation:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}})});var dt,Fa=m(()=>{g();S();dt=class extends n{get classNames(){return d("bu-skeleton",this.props.shape==="circle"?"bu-skeleton-circle":"bu-skeleton-block",this.props.className)}};s(dt,"template","baseui.Skeleton"),s(dt,"props",{shape:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}})});var Be,Ui=m(()=>{g();S();Be=class extends n{get classNames(){return d("bu-spinner",this.props.type==="grow"?"spinner-grow":"spinner-border",this.props.className)}get label(){return this.props.label||"Loading"}};s(Be,"template","baseui.Spinner"),s(Be,"props",{type:{type:String,optional:!0},label:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}})});var hl,Ie,qi=m(()=>{g();S();hl={lead:"lead",muted:"text-body-secondary",code:"bu-code",kbd:"bu-kbd"},Ie=class extends n{get classNames(){return d("bu-typography",hl[this.props.variant],this.props.className)}};s(Ie,"template","baseui.Typography"),s(Ie,"props",{variant:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var je,Mi=m(()=>{g();S();je=class extends n{get classNames(){return d("bu-kbd",this.props.className)}};s(je,"template","baseui.Kbd"),s(je,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var Re,zi=m(()=>{g();S();Re=class extends n{get classNames(){return d("bu-marker",this.props.className)}get variant(){return this.props.variant}};s(Re,"template","baseui.Marker"),s(Re,"props",{variant:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var $e,Pi=m(()=>{g();S();$e=class extends n{get classNames(){return d("form-control",this.props.resize==="none"&&"bu-textarea-no-resize",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};s($e,"template","baseui.Textarea"),s($e,"props",{value:{type:String,optional:!0},placeholder:{type:String,optional:!0},rows:{type:Number,optional:!0},disabled:{type:Boolean,optional:!0},readonly:{type:Boolean,optional:!0},resize:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},id:{type:String,optional:!0},onInput:{type:Function,optional:!0},onChange:{type:Function,optional:!0}})});var Te,Di=m(()=>{g();S();Te=class extends n{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return d("bu-native-select","form-select",(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)}};s(Te,"template","baseui.NativeSelect"),s(Te,"props",{value:{type:String,optional:!0},size:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},"aria-label":{type:String,optional:!0},ariaLabel:{type:String,optional:!0},id:{type:String,optional:!0},onChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}})});var Ue,Fi=m(()=>{g();Ue=class extends n{onChange(e){this.props.onChange?.(e.target.checked,e)}};s(Ue,"template","baseui.Checkbox"),s(Ue,"props",{checked:{type:Boolean,optional:!0},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},id:{type:String,optional:!0},onChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}})});var qe,Me,_i=m(()=>{g();S();qe=class extends n{setup(){C({radioGroupValue:()=>this.props.value,radioGroupDisabled:()=>this.props.disabled,radioGroupName:()=>this.props.name||"bu-radio-group",selectRadio:e=>this.props.onChange?.(e)})}get classNames(){return d("bu-radio-group",this.props.className)}};s(qe,"template","baseui.RadioGroup"),s(qe,"props",{value:{type:String,optional:!0},name:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}});Me=class extends n{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)}};s(Me,"template","baseui.RadioGroupItem"),s(Me,"props",{value:{type:String},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var ze,Hi=m(()=>{g();ze=class extends n{onChange(e){this.props.onChange?.(e.target.checked,e)}};s(ze,"template","baseui.Switch"),s(ze,"props",{checked:{type:Boolean,optional:!0},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}})});var Pe,Wi=m(()=>{g();S();Pe=class extends n{get classNames(){return d("bu-slider",this.props.className)}onInput(e){e.target.style.setProperty("--b-slider-value",`${e.target.value}%`),this.props.onChange?.(e.target.value,e)}};s(Pe,"template","baseui.Slider"),s(Pe,"props",{value:{type:[Number,String],optional:!0},min:{type:[Number,String],optional:!0},max:{type:[Number,String],optional:!0},step:{type:[Number,String],optional:!0},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onChange:{type:Function,optional:!0}})});function ua(t){t.parentElement?.querySelector("[data-slot='input-group-control'], input, textarea")?.focus()}var De,Fe,_e,_a=m(()=>{De={"inline-start":"bu-input-group-addon-inline-start","inline-end":"bu-input-group-addon-inline-end","block-start":"bu-input-group-addon-block-start","block-end":"bu-input-group-addon-block-end"},Fe={default:"btn-primary",primary:"btn-primary",destructive:"btn-danger",danger:"btn-danger",outline:"btn-outline-secondary",secondary:"btn-secondary",ghost:"btn-light",link:"btn-link"},_e={xs:"bu-input-group-button-xs",sm:"bu-input-group-button-sm","icon-xs":"bu-input-group-button-icon-xs","icon-sm":"bu-input-group-button-icon-sm"}});var He,We,Ke,Ve,Ze,Xe,Ki=m(()=>{g();S();_a();He=class extends n{get classNames(){return d("bu-input-group",this.props.className)}};s(He,"template","baseui.InputGroup"),s(He,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});We=class extends n{get align(){return De[this.props.align]?this.props.align:"inline-start"}get classNames(){return d("bu-input-group-addon",De[this.align],this.props.className)}onClick(e){this.props.onClick?.(e),e.target.closest("button")||ua(e.currentTarget)}};s(We,"template","baseui.InputGroupAddon"),s(We,"props",{align:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onClick:{type:Function,optional:!0},slots:{type:Object,optional:!0}});Ke=class extends n{get size(){return _e[this.props.size]?this.props.size:"xs"}get classNames(){return d("btn","bu-button","bu-input-group-button",Fe[this.props.variant]||Fe.ghost,_e[this.size],this.props.className||this.props.class)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};s(Ke,"template","baseui.InputGroupButton"),s(Ke,"props",{variant:{type:String,optional:!0},size:{type:String,optional:!0},type:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},label:{type:String,optional:!0},class:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},"aria-label":{type:String,optional:!0},ariaLabel:{type:String,optional:!0},onClick:{type:Function,optional:!0},slots:{type:Object,optional:!0}});Ve=class extends n{get classNames(){return d("bu-input-group-text",this.props.className)}};s(Ve,"template","baseui.InputGroupText"),s(Ve,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Ze=class extends n{get classNames(){return d("form-control","bu-input-group-control","bu-input-group-input",this.props.invalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};s(Ze,"template","baseui.InputGroupInput"),s(Ze,"props",{value:{type:String,optional:!0},id:{type:String,optional:!0},name:{type:String,optional:!0},autocomplete:{type:String,optional:!0},placeholder:{type:String,optional:!0},type:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},readonly:{type:Boolean,optional:!0},invalid:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onInput:{type:Function,optional:!0},onChange:{type:Function,optional:!0}});Xe=class extends n{get classNames(){return d("form-control","bu-input-group-control","bu-input-group-textarea",this.props.resize==="none"&&"bu-textarea-no-resize",this.props.invalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};s(Xe,"template","baseui.InputGroupTextarea"),s(Xe,"props",{value:{type:String,optional:!0},placeholder:{type:String,optional:!0},rows:{type:Number,optional:!0},disabled:{type:Boolean,optional:!0},readonly:{type:Boolean,optional:!0},invalid:{type:Boolean,optional:!0},resize:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onInput:{type:Function,optional:!0},onChange:{type:Function,optional:!0}})});var Ge,Vi=m(()=>{g();S();Ge=class extends n{setup(){this.length=this.props.length||6;let e=(this.props.value||"").split("");this.state=f({digits:Array.from({length:this.length},(o,r)=>e[r]||"")}),this.rootRef=w("root")}get classNames(){return d("bu-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()}}};s(Ge,"template","baseui.InputOtp"),s(Ge,"props",{length:{type:Number,optional:!0},value:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onChange:{type:Function,optional:!0}})});function $r(t,{defaultOpen:e=!1,onOpenChange:o}={}){let r=f({open:e}),i=u=>{r.open!==u&&(r.open=u,o?.(u))},a=()=>i(!r.open),p=u=>{t.el&&!t.el.contains(u.target)&&i(!1)},l=u=>{u.key==="Escape"&&i(!1)};return Y(u=>{if(u)return document.addEventListener("click",p),document.addEventListener("keydown",l),()=>{document.removeEventListener("click",p),document.removeEventListener("keydown",l)}},()=>[r.open]),j(()=>{document.removeEventListener("click",p),document.removeEventListener("keydown",l)}),{state:r,setOpen:i,toggle:a}}var da=m(()=>{g()});var Ha,Ye,Je,Qe,to,Zi=m(()=>{g();da();S();Ha={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Ye=class extends n{setup(){this.rootRef=w("root");let{state:e,setOpen:o,toggle:r}=$r(this.rootRef,{defaultOpen:F(this.props.state)});this.disclosure=e,C({select:this.disclosure,selectValue:()=>this.props.value,selectToggle:r,selectClose:()=>o(!1),selectChoose:i=>{this.props.onChange?.(i),o(!1)}})}get classNames(){return d("bu-select",this.props.className)}};s(Ye,"template","baseui.Select"),s(Ye,"props",{value:{type:String,optional:!0},state:{type:String,optional:!0},onChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Je=class extends n{onClick(){this.env.selectToggle()}};s(Je,"template","baseui.SelectTrigger"),s(Je,"props",Ha);Qe=class extends n{get open(){return this.env.select.open}};s(Qe,"template","baseui.SelectContent"),s(Qe,"props",Ha);to=class extends n{get selected(){return this.env.selectValue()===this.props.value}onClick(){this.env.selectChoose(this.props.value)}};s(to,"template","baseui.SelectItem"),s(to,"props",{value:{type:String},...Ha})});function Tr(t){return[...t.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")].filter(e=>!e.disabled&&!e.hidden)}function Wa(t,e){if(t.key!=="Tab")return;let o=Tr(e);if(!o.length){t.preventDefault();return}let r=o[0],i=o[o.length-1];t.shiftKey&&document.activeElement===r?(t.preventDefault(),i.focus()):!t.shiftKey&&document.activeElement===i&&(t.preventDefault(),r.focus())}function ba(t,{closeSelector:e,trapFocus:o=!1}={}){let r=t.getAttribute("b-att-trigger"),i=r?document.querySelector(r):null,a=[...t.querySelectorAll(e)],p=null,l=()=>Tr(t),u=()=>{p=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("baseui:open",{bubbles:!0}))},b=()=>{t.hidden=!0,t.setAttribute("b-att-state","closed"),p?.focus?.(),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))},h=x=>{if(x.key==="Escape"){b();return}!o||t.hidden||Wa(x,t)},y=x=>{x.target===t&&b()};return i?.addEventListener("click",u),a.forEach(x=>x.addEventListener("click",b)),t.addEventListener("keydown",h),t.addEventListener("click",y),(!t.getAttribute("b-att-state")||t.getAttribute("b-att-state")==="closed")&&(t.hidden=!0),{open:u,close:b,destroy:()=>{i?.removeEventListener("click",u),a.forEach(x=>x.removeEventListener("click",b)),t.removeEventListener("keydown",h),t.removeEventListener("click",y)}}}var Vr=m(()=>{});var bt,eo,oo,so,ro,ao,io,no,po,lo,co,Xi=m(()=>{g();Vr();S();bt={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},eo=class extends n{setup(){this.alertDialogState=f({open:T(this.props)}),C({alertDialog:this.alertDialogState,setAlertDialogOpen:e=>this.setOpen(e)}),q(e=>{U(e)&&(this.alertDialogState.open=T(e))})}setOpen(e){U(this.props)||(this.alertDialogState.open=e),this.props.onOpenChange?.(e)}};s(eo,"template","baseui.AlertDialog"),s(eo,"props",{open:{type:Boolean,optional:!0},state:{type:String,optional:!0},"default-open":{type:Boolean,optional:!0},defaultOpen:{type:Boolean,optional:!0},onOpenChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}});oo=class extends n{onClick(){this.env.setAlertDialogOpen(!0)}};s(oo,"template","baseui.AlertDialogTrigger"),s(oo,"props",bt);so=class extends n{get size(){return this.props.size==="sm"?"sm":"default"}setup(){this.rootRef=w("root"),Y(e=>{if(!e)return;let o=document.activeElement;return Tr(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}Wa(e,this.rootRef.el)}};s(so,"template","baseui.AlertDialogContent"),s(so,"props",{...bt,size:{type:String,optional:!0}});ro=class extends n{};s(ro,"template","baseui.AlertDialogHeader"),s(ro,"props",bt);ao=class extends n{};s(ao,"template","baseui.AlertDialogFooter"),s(ao,"props",bt);io=class extends n{};s(io,"template","baseui.AlertDialogMedia"),s(io,"props",bt);no=class extends n{};s(no,"template","baseui.AlertDialogTitle"),s(no,"props",bt);po=class extends n{};s(po,"template","baseui.AlertDialogDescription"),s(po,"props",bt);lo=class extends n{onClick(){this.env.setAlertDialogOpen(!1)}};s(lo,"template","baseui.AlertDialogCancel"),s(lo,"props",bt);co=class extends n{onClick(){this.props.onClick?.(),this.env.setAlertDialogOpen(!1)}};s(co,"template","baseui.AlertDialogAction"),s(co,"props",{...bt,onClick:{type:Function,optional:!0}})});var So,uo,bo,mo,ho,go,fo,yo,vo,Gi=m(()=>{g();M();S();So={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},uo=class extends n{setup(){this.drawerState=f({open:T(this.props)}),this.control={instance:null},C({drawer:this.drawerState,drawerControl:this.control,setDrawerOpen:e=>this.setOpen(e)}),q(e=>{if(U(e)){let o=T(e);this.drawerState.open=o,o?this.control.instance?.show():this.control.instance?.hide()}})}setOpen(e){U(this.props)||(this.drawerState.open=e),this.props.onOpenChange?.(e)}};s(uo,"template","baseui.Drawer"),s(uo,"props",{open:{type:Boolean,optional:!0},state:{type:String,optional:!0},"default-open":{type:Boolean,optional:!0},defaultOpen:{type:Boolean,optional:!0},onOpenChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}});bo=class extends n{onClick(){this.env.drawerControl.instance?.show()}};s(bo,"template","baseui.DrawerTrigger"),s(bo,"props",So);mo=class extends n{setup(){this.rootRef=w("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},I(()=>{this.env.drawerControl.instance=E().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()}),j(()=>{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}};s(mo,"template","baseui.DrawerContent"),s(mo,"props",So);ho=class extends n{};s(ho,"template","baseui.DrawerHeader"),s(ho,"props",So);go=class extends n{};s(go,"template","baseui.DrawerFooter"),s(go,"props",So);fo=class extends n{};s(fo,"template","baseui.DrawerTitle"),s(fo,"props",So);yo=class extends n{};s(yo,"template","baseui.DrawerDescription"),s(yo,"props",So);vo=class extends n{};s(vo,"template","baseui.DrawerClose"),s(vo,"props",So)});var Oo,xo,wo,Ao,Eo,Co,Lo,ko,No,Yi=m(()=>{g();M();S();Oo={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},xo=class extends n{setup(){this.sheetState=f({open:T(this.props),side:this.props.side}),this.control={instance:null},C({sheet:this.sheetState,sheetControl:this.control,setSheetOpen:e=>this.setOpen(e)}),q(e=>{if(U(e)){let o=T(e);this.sheetState.open=o,o?this.control.instance?.show():this.control.instance?.hide()}this.sheetState.side=e.side})}setOpen(e){U(this.props)||(this.sheetState.open=e),this.props.onOpenChange?.(e)}};s(xo,"template","baseui.Sheet"),s(xo,"props",{open:{type:Boolean,optional:!0},state:{type:String,optional:!0},side:{type:String,optional:!0},"default-open":{type:Boolean,optional:!0},defaultOpen:{type:Boolean,optional:!0},onOpenChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}});wo=class extends n{onClick(){this.env.sheetControl.instance?.show()}};s(wo,"template","baseui.SheetTrigger"),s(wo,"props",Oo);Ao=class extends n{setup(){this.rootRef=w("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},I(()=>{this.env.sheetControl.instance=E().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()}),j(()=>{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"}};s(Ao,"template","baseui.SheetContent"),s(Ao,"props",{...Oo,side:{type:String,optional:!0}});Eo=class extends n{};s(Eo,"template","baseui.SheetHeader"),s(Eo,"props",Oo);Co=class extends n{};s(Co,"template","baseui.SheetFooter"),s(Co,"props",Oo);Lo=class extends n{};s(Lo,"template","baseui.SheetTitle"),s(Lo,"props",Oo);ko=class extends n{};s(ko,"template","baseui.SheetDescription"),s(ko,"props",Oo);No=class extends n{};s(No,"template","baseui.SheetClose"),s(No,"props",Oo)});var Ji,Bo,Io,jo,Qi=m(()=>{g();M();S();Ji={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Bo=class extends n{setup(){let e=f({open:F(this.props.state)});this.control={instance:null,bufferEl:null,lastContentHtml:null};let o=r=>{e.open!==r&&(e.open=r,this.props.onOpenChange?.(r))};C({popover:e,popoverControl:this.control,popoverSetOpen:o,popoverToggle:()=>this.control.instance?.toggle(),popoverClose:()=>this.control.instance?.hide()})}};s(Bo,"template","baseui.Popover"),s(Bo,"props",{state:{type:String,optional:!0},onOpenChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Io=class extends n{setup(){this.rootRef=w("root"),this.onShown=()=>this.env.popoverSetOpen(!0),this.onHidden=()=>this.env.popoverSetOpen(!1),I(()=>{let e=this.env.popoverControl,o=e.bufferEl?.innerHTML??"";e.lastContentHtml=o,e.instance=new(E()).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)}),j(()=>{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})}onClick(){this.env.popoverControl.instance?.toggle()}};s(Io,"template","baseui.PopoverTrigger"),s(Io,"props",Ji);jo=class extends n{get style(){return G("display:none",this.props.style)}setup(){this.bufferRef=w("buffer"),I(()=>{this.env.popoverControl.bufferEl=this.bufferRef.el}),_(()=>{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??""}};s(jo,"template","baseui.PopoverContent"),s(jo,"props",{...Ji,content:{type:String,optional:!0}})});var tn,Ro,$o,To,en=m(()=>{g();tn={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Ro=class extends n{setup(){this.state=f({open:!1}),C({hoverCard:this.state})}open(){this.state.open=!0}close(){this.state.open=!1}onKeyDown(e){e.key==="Escape"&&this.close()}};s(Ro,"template","baseui.HoverCard"),s(Ro,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});$o=class extends n{};s($o,"template","baseui.HoverCardTrigger"),s($o,"props",tn);To=class extends n{get open(){return this.env.hoverCard.open}};s(To,"template","baseui.HoverCardContent"),s(To,"props",tn)});var Uo,on=m(()=>{g();M();S();Uo=class extends n{setup(){this.state=f({open:F(this.props.state)}),this.triggerRef=w("trigger"),this.bufferRef=w("buffer"),this.bootstrapTooltip=null,this.lastContentHtml=null,this.onShown=()=>{this.state.open=!0},this.onHidden=()=>{this.state.open=!1},I(()=>{this.lastContentHtml=this.currentContentHtml();let e=this.triggerElement();this.bootstrapTooltip=new(E()).Tooltip(e,{title:this.lastContentHtml,html:!0,trigger:"hover focus"}),e.addEventListener("shown.bs.tooltip",this.onShown),e.addEventListener("hidden.bs.tooltip",this.onHidden),F(this.props.state)&&this.bootstrapTooltip.show()}),_(()=>{let e=this.currentContentHtml();e!==this.lastContentHtml&&(this.lastContentHtml=e,this.bootstrapTooltip?.setContent({".tooltip-inner":e}))}),j(()=>{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()}};s(Uo,"template","baseui.Tooltip"),s(Uo,"props",{content:{type:String,optional:!0},state:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var et,Ka,mt,ht,gt,qo,Mo,ft,Rt,zo,$t,Po,Do,yt,st,vt,Va=m(()=>{g();da();M();S();J();et={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Ka={...et,disabled:{type:Boolean,optional:!0},inset:{type:Boolean,optional:!0},onClick:{type:Function,optional:!0},onSelect:{type:Function,optional:!0},variant:{type:String,optional:!0}},mt=class extends n{setup(){this.rootRef=w("root");let e=f({open:F(this.props.state)});this.control={instance:null};let o=a=>{e.open!==a&&(e.open=a,this.props.onOpenChange?.(a))};C({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()},i=a=>{a.key==="Escape"&&this.control.instance?.hide()};Y(a=>{if(a)return document.addEventListener("click",r),document.addEventListener("keydown",i),()=>{document.removeEventListener("click",r),document.removeEventListener("keydown",i)}},()=>[e.open]),j(()=>{document.removeEventListener("click",r),document.removeEventListener("keydown",i)})}};s(mt,"template","baseui.DropdownMenu"),s(mt,"props",{state:{type:String,optional:!0},onOpenChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});ht=class extends n{setup(){this.rootRef=w("root"),this.onShown=()=>this.env.dropdownSetOpen(!0),this.onHidden=()=>this.env.dropdownSetOpen(!1),I(()=>{this.env.dropdownControl.instance=E().Dropdown.getOrCreateInstance(this.rootRef.el),this.rootRef.el.addEventListener("shown.bs.dropdown",this.onShown),this.rootRef.el.addEventListener("hidden.bs.dropdown",this.onHidden)}),j(()=>{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})}get classNames(){return d("btn","bu-button","btn-outline-secondary","bu-dropdown-menu-trigger",this.props.className)}onClick(){this.env.dropdownToggle()}};s(ht,"template","baseui.DropdownMenuTrigger"),s(ht,"props",et);gt=class extends n{get open(){return this.env.dropdownMenu.open}get classNames(){return d("bu-dropdown-menu-content","dropdown-menu",this.open?"show":"",this.props.className)}};s(gt,"template","baseui.DropdownMenuContent"),s(gt,"props",{...et,align:{type:String,optional:!0},alignOffset:{type:Number,optional:!0},side:{type:String,optional:!0},sideOffset:{type:Number,optional:!0}});qo=class extends n{};s(qo,"template","baseui.DropdownMenuGroup"),s(qo,"props",et);Mo=class extends n{};s(Mo,"template","baseui.DropdownMenuLabel"),s(Mo,"props",{...et,inset:{type:Boolean,optional:!0}});ft=class extends n{get variant(){return this.props.variant||"default"}onClick(e){this.props.disabled||(this.props.onClick?.(e),this.props.onSelect?.(e),this.env.dropdownClose())}};s(ft,"template","baseui.DropdownMenuItem"),s(ft,"props",Ka);Rt=class extends n{onClick(e){this.props.disabled||(this.props.onCheckedChange?.(!this.props.checked,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};s(Rt,"template","baseui.DropdownMenuCheckboxItem"),s(Rt,"components",{Icon:B}),s(Rt,"props",{...Ka,checked:{type:Boolean,optional:!0},onCheckedChange:{type:Function,optional:!0}});zo=class extends n{setup(){C({dropdownRadio:{value:this.props.value,onValueChange:this.props.onValueChange}})}};s(zo,"template","baseui.DropdownMenuRadioGroup"),s(zo,"props",{...et,value:{type:String,optional:!0},onValueChange:{type:Function,optional:!0}});$t=class extends n{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))}};s($t,"template","baseui.DropdownMenuRadioItem"),s($t,"components",{Icon:B}),s($t,"props",{...Ka,value:{type:String,optional:!0}});Po=class extends n{};s(Po,"template","baseui.DropdownMenuSeparator"),s(Po,"props",et);Do=class extends n{};s(Do,"template","baseui.DropdownMenuShortcut"),s(Do,"props",et);yt=class extends n{setup(){this.rootRef=w("root");let{state:e,setOpen:o,toggle:r}=$r(this.rootRef);C({dropdownSub:e,dropdownSubToggle:r,dropdownSubOpen:()=>o(!0),dropdownSubClose:()=>o(!1)})}};s(yt,"template","baseui.DropdownMenuSub"),s(yt,"props",et);st=class extends n{onMouseEnter(){this.props.disabled||this.env.dropdownSubOpen()}onClick(){this.props.disabled||this.env.dropdownSubToggle()}};s(st,"template","baseui.DropdownMenuSubTrigger"),s(st,"components",{Icon:B}),s(st,"props",{...et,disabled:{type:Boolean,optional:!0},inset:{type:Boolean,optional:!0}});vt=class extends n{get open(){return this.env.dropdownSub.open}};s(vt,"template","baseui.DropdownMenuSubContent"),s(vt,"props",et)});var Za,Fo,_o,Ho,Wo,sn=m(()=>{g();S();Za={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Fo=class extends n{setup(){this.state=f({open:!1,x:0,y:0});let e=()=>{this.state.open=!1};this.close=e,C({contextMenu:this.state,contextMenuOpenAt:(o,r)=>{this.state.open=!0,this.state.x=o,this.state.y=r},contextMenuClose:e}),document.addEventListener("click",e),j(()=>document.removeEventListener("click",e))}};s(Fo,"template","baseui.ContextMenu"),s(Fo,"props",{className:{type:String,optional:!0},slots:{type:Object,optional:!0}});_o=class extends n{onContextMenu(e){e.preventDefault(),this.env.contextMenuOpenAt(e.clientX,e.clientY)}};s(_o,"template","baseui.ContextMenuTrigger"),s(_o,"props",Za);Ho=class extends n{setup(){this.rootRef=w("root")}get open(){return this.env.contextMenu.open}get style(){return G(`left:${this.env.contextMenu.x}px;top:${this.env.contextMenu.y}px`,this.props.style)}};s(Ho,"template","baseui.ContextMenuContent"),s(Ho,"props",Za);Wo=class extends n{onClick(){this.props.onClick?.(),this.env.contextMenuClose()}};s(Wo,"template","baseui.ContextMenuItem"),s(Wo,"props",{...Za,onClick:{type:Function,optional:!0}})});function ma(t){let e=gl[t];return e?["toast-container","position-fixed","p-3","pe-auto",...e]:null}var gl,Xa=m(()=>{gl={"top-left":["top-0","start-0"],"top-right":["top-0","end-0"],"bottom-left":["bottom-0","start-0"],"bottom-right":["bottom-0","end-0"]}});var rt,Ga=m(()=>{g();M();S();Xa();ee();rt=class extends n{setup(){this.state=f({open:T(this.props)}),this.rootRef=w("root"),this.bootstrapToast=null,this.handleShown=()=>{this.state.open=!0},this.handleHidden=()=>{this.state.open=!1,this.props.onOpenChange?.(!1)},I(()=>{this.mountBootstrapToast(this.props.delay),this.state.open&&this.bootstrapToast.show()}),q(e=>{let o=U(e)?T(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())}),j(()=>{this.bootstrapToast?.dispose()})}mountBootstrapToast(e){let o=this.rootRef.el,r=e??3e3;this.bootstrapToast=new(E()).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 d("toast","fade","bu-toast",ma(this.props.position),this.props.className)}get role(){return this.props.variant==="danger"?"alert":"status"}close(){this.bootstrapToast?.hide()}};s(rt,"template","baseui.Toast"),s(rt,"components",{Button:K}),s(rt,"props",{open:{type:Boolean,optional:!0},state:{type:String,optional:!0},variant:{type:String,optional:!0},delay:{type:Number,optional:!0},position:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onOpenChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}})});var Ya,Ko,Vo,Tt,Zo,rn=m(()=>{g();M();S();J();Ya={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Ko=class extends n{setup(){this.state=f({open:new Set}),C({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)}};s(Ko,"template","baseui.Accordion"),s(Ko,"props",{multiple:{type:Boolean,optional:!0},onChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Vo=class extends n{setup(){C({accordionItemState:this.props.state,accordionItemValue:this.props.value})}};s(Vo,"template","baseui.AccordionItem"),s(Vo,"props",{value:{type:String},state:{type:String,optional:!0},...Ya});Tt=class extends n{get open(){return this.env.accordionItemState!==void 0?F(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}onClick(){this.env.accordionToggle(this.env.accordionItemValue)}};s(Tt,"template","baseui.AccordionTrigger"),s(Tt,"components",{Icon:B}),s(Tt,"props",Ya);Zo=class extends n{setup(){this.rootRef=w("root"),this.initialOpen=this.open,this.bootstrapCollapse=null,I(()=>{this.bootstrapCollapse=new(E()).Collapse(this.rootRef.el,{toggle:!1})}),_(()=>{if(!this.bootstrapCollapse)return;let e=this.rootRef.el.classList.contains("show");this.open&&!e?this.bootstrapCollapse.show():!this.open&&e&&this.bootstrapCollapse.hide()}),j(()=>{this.bootstrapCollapse?.dispose()})}get open(){return this.env.accordionItemState!==void 0?F(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}};s(Zo,"template","baseui.AccordionContent"),s(Zo,"props",Ya)});var an,Xo,Go,Yo,nn=m(()=>{g();M();S();an={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Xo=class extends n{setup(){this.state=f({open:T(this.props)}),C({collapsible:this.state,collapsibleToggle:()=>this.toggle()}),q(e=>{U(e)&&(this.state.open=T(e))})}toggle(){let e=!this.state.open;U(this.props)||(this.state.open=e),this.props.onOpenChange?.(e)}};s(Xo,"template","baseui.Collapsible"),s(Xo,"props",{open:{type:Boolean,optional:!0},state:{type:String,optional:!0},"default-open":{type:Boolean,optional:!0},defaultOpen:{type:Boolean,optional:!0},onOpenChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Go=class extends n{onClick(){this.env.collapsibleToggle()}};s(Go,"template","baseui.CollapsibleTrigger"),s(Go,"props",an);Yo=class extends n{setup(){this.rootRef=w("root"),this.initialOpen=this.open,this.bootstrapCollapse=null,I(()=>{this.bootstrapCollapse=new(E()).Collapse(this.rootRef.el,{toggle:!1})}),_(()=>{if(!this.bootstrapCollapse)return;let e=this.rootRef.el.classList.contains("show");this.open&&!e?this.bootstrapCollapse.show():!this.open&&e&&this.bootstrapCollapse.hide()}),j(()=>{this.bootstrapCollapse?.dispose()})}get open(){return this.env.collapsible.open}};s(Yo,"template","baseui.CollapsibleContent"),s(Yo,"props",an)});var Jo,Qo,ts,es,os,Ut,qt,pn=m(()=>{g();S();J();Jo=class extends n{};s(Jo,"template","baseui.Breadcrumb"),s(Jo,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Qo=class extends n{};s(Qo,"template","baseui.BreadcrumbList"),s(Qo,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});ts=class extends n{get classNames(){return d("bu-breadcrumb-item",this.props.current&&"bu-breadcrumb-page",this.props.className)}};s(ts,"template","baseui.BreadcrumbItem"),s(ts,"props",{current:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});es=class extends n{get classNames(){return d("bu-breadcrumb-link",this.props.className)}onClick(e){this.props.onClick?.(e)}};s(es,"template","baseui.BreadcrumbLink"),s(es,"props",{href:{type:String,optional:!0},target:{type:String,optional:!0},rel:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onClick:{type:Function,optional:!0},slots:{type:Object,optional:!0}});os=class extends n{get classNames(){return d("bu-breadcrumb-page",this.props.className)}};s(os,"template","baseui.BreadcrumbPage"),s(os,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Ut=class extends n{get classNames(){return d("bu-breadcrumb-separator",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};s(Ut,"template","baseui.BreadcrumbSeparator"),s(Ut,"components",{Icon:B}),s(Ut,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});qt=class extends n{get classNames(){return d("bu-breadcrumb-ellipsis",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};s(qt,"template","baseui.BreadcrumbEllipsis"),s(qt,"components",{Icon:B}),s(qt,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var ss,rs,ln=m(()=>{g();S();ss=class extends n{get classNames(){return d("bu-pagination",this.props.className)}};s(ss,"template","baseui.Pagination"),s(ss,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});rs=class extends n{get classNames(){return d("page-item",this.props.current&&"active",this.props.disabled&&"disabled")}onClick(){this.props.disabled||this.props.onClick?.()}};s(rs,"template","baseui.PaginationItem"),s(rs,"props",{current:{type:Boolean,optional:!0},disabled:{type:Boolean,optional:!0},style:{type:[String,Object],optional:!0},onClick:{type:Function,optional:!0},slots:{type:Object,optional:!0}})});var as,is,cn=m(()=>{g();as=class extends n{setup(){this.rootRef=w("root")}onKeyDown(e){let o=[...this.rootRef.el.querySelectorAll("a, button")].filter(a=>!a.disabled),r=o.indexOf(e.target),i=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;!i||r<0||(e.preventDefault(),o[(r+i+o.length)%o.length]?.focus())}};s(as,"template","baseui.NavigationMenu"),s(as,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});is=class extends n{};s(is,"template","baseui.NavigationMenuItem"),s(is,"props",{href:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var ns,un=m(()=>{g();S();ns=class extends n{get classNames(){return d("bu-menubar",this.props.className)}};s(ns,"template","baseui.Menubar"),s(ns,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});function bn(t){globalThis.matchMedia?.("(max-width: 767.98px)").matches&&t.setSidebarOpen?.(!1)}var V,dn,it,Ur,Mt,St,ps,ls,cs,us,ds,bs,zt,xt,wt,Pt,ms,Dt,nt,At,at,Ft,hs,gs,fs,ys,vs,ha=m(()=>{g();S();J();V={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},dn={...V,href:{type:String,optional:!0}};it=class extends n{setup(){this.state=f({open:T(this.props)}),C({sidebar:this.state,setSidebarOpen:e=>this.setOpen(e)}),q(e=>{U(e)&&(this.state.open=T(e))})}setOpen(e){U(this.props)||(this.state.open=e),this.props.onOpenChange?.(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 d("bu-sidebar-root",this.props.className)}onKeyDown(e){e.key==="Escape"&&this.setOpen(!1)}};s(it,"template","baseui.Sidebar"),s(it,"props",{open:{type:Boolean,optional:!0},state:{type:String,optional:!0},"default-open":{type:Boolean,optional:!0},defaultOpen:{type:Boolean,optional:!0},onOpenChange:{type:Function,optional:!0},side:{type:String,optional:!0},variant:{type:String,optional:!0},collapsible:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Ur=class extends it{};s(Ur,"template","baseui.Sidebar");Mt=class extends n{onClick(){if(this.env.setShellCollapsed&&!globalThis.matchMedia?.("(max-width: 767.98px)").matches){this.env.setShellCollapsed(!this.env.shell.collapsed);return}this.env.setSidebarOpen(!this.env.sidebar.open)}};s(Mt,"template","baseui.SidebarTrigger"),s(Mt,"components",{Icon:B}),s(Mt,"props",{...V,icon:{type:String,optional:!0},label:{type:String,optional:!0}});St=class extends n{get open(){return this.env.sidebar.open}};s(St,"template","baseui.SidebarContent"),s(St,"props",V);ps=class extends n{};s(ps,"template","baseui.SidebarHeader"),s(ps,"props",V);ls=class extends n{};s(ls,"template","baseui.SidebarFooter"),s(ls,"props",V);cs=class extends n{};s(cs,"template","baseui.SidebarInset"),s(cs,"props",V);us=class extends n{onClick(){this.env.setSidebarOpen(!this.env.sidebar.open)}};s(us,"template","baseui.SidebarRail"),s(us,"props",V);ds=class extends n{};s(ds,"template","baseui.SidebarInput"),s(ds,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},placeholder:{type:String,optional:!0},value:{type:String,optional:!0},type:{type:String,optional:!0}});bs=class extends n{};s(bs,"template","baseui.SidebarSeparator"),s(bs,"props",V);zt=class extends n{onClick(){this.env.setSidebarOpen(!1)}};s(zt,"template","baseui.SidebarClose"),s(zt,"components",{Icon:B}),s(zt,"props",{...V,icon:{type:String,optional:!0},label:{type:String,optional:!0}});xt=class extends n{};s(xt,"template","baseui.SidebarGroup"),s(xt,"props",{muted:{type:Boolean,optional:!0},...V});wt=class extends n{};s(wt,"template","baseui.SidebarGroupLabel"),s(wt,"props",dn);Pt=class extends n{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};s(Pt,"template","baseui.SidebarGroupAction"),s(Pt,"components",{Icon:B}),s(Pt,"props",{icon:{type:String,optional:!0},"aria-label":{type:String,optional:!0},ariaLabel:{type:String,optional:!0},onClick:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});ms=class extends n{};s(ms,"template","baseui.SidebarGroupContent"),s(ms,"props",V);Dt=class extends n{setup(){let e=this.props["default-open"]!==void 0||this.props.defaultOpen!==void 0;this.state=f({open:U(this.props)||e?T(this.props):!0}),q(o=>{U(o)&&(this.state.open=T(o))})}get open(){return this.state.open}toggle(){let e=!this.state.open;U(this.props)||(this.state.open=e),this.props.onOpenChange?.(e)}};s(Dt,"template","baseui.SidebarGroupCollapsible"),s(Dt,"components",{Icon:B}),s(Dt,"props",{label:{type:String},open:{type:Boolean,optional:!0},state:{type:String,optional:!0},"default-open":{type:Boolean,optional:!0},defaultOpen:{type:Boolean,optional:!0},onOpenChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});nt=class extends n{};s(nt,"template","baseui.SidebarMenu"),s(nt,"props",V);At=class extends n{};s(At,"template","baseui.SidebarMenuItem"),s(At,"props",V);at=class extends n{get classNames(){return d("bu-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),bn(this.env)}};s(at,"template","baseui.SidebarMenuButton"),s(at,"components",{Icon:B}),s(at,"props",{href:{type:String,optional:!0},icon:{type:String,optional:!0},active:{type:Boolean,optional:!0},isActive:{type:Boolean,optional:!0},variant:{type:String,optional:!0},size:{type:String,optional:!0},tooltip:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},onClick:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Ft=class extends n{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};s(Ft,"template","baseui.SidebarMenuAction"),s(Ft,"components",{Icon:B}),s(Ft,"props",{icon:{type:String,optional:!0},"aria-label":{type:String,optional:!0},ariaLabel:{type:String,optional:!0},showOnHover:{type:Boolean,optional:!0},onClick:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});hs=class extends n{};s(hs,"template","baseui.SidebarMenuSub"),s(hs,"props",V);gs=class extends n{};s(gs,"template","baseui.SidebarMenuBadge"),s(gs,"props",V);fs=class extends n{setup(){this.state=f({width:this.props.width||`${Math.floor(Math.random()*40)+50}%`})}get style(){return G(`--b-sidebar-skeleton-width:${this.state.width}`,this.props.style)}};s(fs,"template","baseui.SidebarMenuSkeleton"),s(fs,"props",{showIcon:{type:Boolean,optional:!0},width:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}});ys=class extends n{};s(ys,"template","baseui.SidebarMenuSubItem"),s(ys,"props",V);vs=class extends n{get classNames(){return d("bu-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),bn(this.env)}};s(vs,"template","baseui.SidebarMenuSubButton"),s(vs,"props",{...dn,active:{type:Boolean,optional:!0},isActive:{type:Boolean,optional:!0},size:{type:String,optional:!0},onClick:{type:Function,optional:!0}})});var qr,_t,Ht,Ss,xs,ws,As,Wt,Es,mn=m(()=>{g();ha();Fa();Ga();ee();qr={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},_t=class extends n{setup(){this.state=f({collapsed:this.props.collapsed??this.props.defaultCollapsed??!1,authState:this.props.authState??null}),C({shell:this.state,setShellCollapsed:e=>this.setCollapsed(e)}),q(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?.()}};s(_t,"template","baseui.Shell"),s(_t,"components",{Sidebar:it,Toast:rt,Button:K}),s(_t,"props",{open:{type:Boolean,optional:!0},defaultOpen:{type:Boolean,optional:!0},onOpenChange:{type:Function,optional:!0},collapsed:{type:Boolean,optional:!0},defaultCollapsed:{type:Boolean,optional:!0},onCollapsedChange:{type:Function,optional:!0},authState:{type:Object,optional:!0},toast:{type:Object,optional:!0},onToastOpenChange:{type:Function,optional:!0},notificationPage:{type:Function,optional:!0},pwa:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Ht=class extends n{};s(Ht,"template","baseui.ShellSidebar"),s(Ht,"components",{SidebarContent:St}),s(Ht,"props",qr);Ss=class extends n{};s(Ss,"template","baseui.ShellSidebarHeader"),s(Ss,"props",qr);xs=class extends n{};s(xs,"template","baseui.ShellNav"),s(xs,"props",qr);ws=class extends n{};s(ws,"template","baseui.ShellMain"),s(ws,"props",qr);As=class extends n{};s(As,"template","baseui.ShellHeader"),s(As,"props",qr);Wt=class extends n{};s(Wt,"template","baseui.ShellContent"),s(Wt,"components",{Skeleton:dt}),s(Wt,"props",{loading:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Es=class extends n{get authState(){return this.env.shell.authState}logout(){this.authState?.onLogout?.()}};s(Es,"template","baseui.ShellUserMenu"),s(Es,"props",qr)});var Cs,hn=m(()=>{g();S();Cs=class extends n{get classNames(){return d("table","bu-table",this.props.striped!==!1&&"table-striped",this.props.hover!==!1&&"table-hover",this.props.className)}};s(Cs,"template","baseui.Table"),s(Cs,"props",{striped:{type:Boolean,optional:!0},hover:{type:Boolean,optional:!0},responsive:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var fl,yl,vl,Ls,ks,Sl,Kt,gn=m(()=>{g();ee();J();S();fl=[{key:"status",label:"Status",format:"capitalize"},{key:"email",label:"Email",sortable:!0,filterable:!0},{key:"amount",label:"Amount",align:"right",format:"currency"}],yl=[{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}],vl=[{label:"Copy payment ID"},{label:"View customer"},{label:"View payment details"}],Ls=4,ks=8,Sl=32,Kt=class extends n{setup(){this.state=f({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=w("actionsMenu"),this.actionsMenuTriggerEl=null,Br(window,"click",this.onWindowClick,!0),Br(window,"keydown",this.onWindowKeydown),Br(window,"resize",this.closeRowActions),Br(window,"scroll",this.closeRowActions,!0),_(()=>this.refreshActionsMenuPosition())}get columns(){return this.props.columns?.length?this.props.columns:fl}get rows(){return this.props.rows?.length?this.props.rows:yl}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?vl:[])}get variant(){return this.props.variant||"default"}get classNames(){return d("bu-data-table",`bu-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(),o=this.columns.filter(a=>a.filterable===!0),r=(o.length?o:this.columns).map(a=>a.key),i=this.rows.filter(a=>!e||r.some(p=>String(a[p]).toLowerCase().includes(e)));return this.state.sortKey&&(i=[...i].sort((a,p)=>String(a[this.state.sortKey]).localeCompare(String(p[this.state.sortKey]))*this.state.sortDir)),i}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 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,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 i=this.rowKey(e,o);if(this.state.actionRowKey===i){this.closeRowActions();return}this.actionsMenuTriggerEl=r.currentTarget,this.state.actionRowKey=i,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*Sl+Ls*2,i=window.innerHeight-o.bottom,p=i<r+Ls&&o.top>i?Math.max(ks,o.top-Ls-r):o.bottom+Ls,l=Math.min(Math.max(ks,o.right-160),window.innerWidth-160-ks);return`position: fixed; top: ${Math.round(p)}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(),i=window.innerHeight-o.bottom,a=o.top,l=i<r.height+Ls&&a>i?Math.max(ks,o.top-Ls-r.height):Math.min(o.bottom+Ls,window.innerHeight-r.height-ks),u=Math.min(Math.max(ks,o.right-r.width),window.innerWidth-r.width-ks),b=`position: fixed; top: ${Math.round(l)}px; left: ${Math.round(u)}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,o,r){let i=this.rowKey(e,o);this.state.selectedKeys=r?[...new Set([...this.state.selectedKeys,i])]:this.state.selectedKeys.filter(a=>a!==i),this.props.onSelectionChange?.(this.state.selectedKeys)}toggleAllVisible(e){let o=this.pageRows.map((r,i)=>this.rowKey(r,i));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 i=Number(r);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(Number.isFinite(i)?i:0)}if(o.format==="capitalize"){let i=String(r??"");return i.charAt(0).toUpperCase()+i.slice(1)}return r??""}cellComponentProps(e,o){return o.componentProps?o.componentProps(e,o):{row:e,column:o,value:e[o.key]}}};s(Kt,"template","baseui.DataTable"),s(Kt,"components",{Button:K,Icon:B}),s(Kt,"props",{columns:{type:Array,optional:!0},rows:{type:Array,optional:!0},variant:{type:String,optional:!0},searchable:{type:Boolean,optional:!0},sortable:{type:Boolean,optional:!0},pagination:{type:Boolean,optional:!0},selectable:{type:Boolean,optional:!0},"column-toggle":{type:Boolean,optional:!0},columnToggle:{type:Boolean,optional:!0},"row-actions":{type:Array,optional:!0},rowActions:{type:Array,optional:!0},"page-size":{type:Number,optional:!0},pageSize:{type:Number,optional:!0},"page-size-options":{type:Array,optional:!0},pageSizeOptions:{type:Array,optional:!0},"filter-placeholder":{type:String,optional:!0},filterPlaceholder:{type:String,optional:!0},"empty-label":{type:String,optional:!0},emptyLabel:{type:String,optional:!0},onRowAction:{type:Function,optional:!0},onSelectionChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},"max-height":{type:[String,Number],optional:!0},maxHeight:{type:[String,Number],optional:!0},slots:{type:Object,optional:!0}})});var xl,wl,Ns,fn=m(()=>{g();xl=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),wl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ns=class extends n{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 xl.format(new Date(this.year,this.month0,1))}get weekdays(){return wl}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 i=0;i<o;i++)r.push(null);for(let i=1;i<=e;i++){let a=`${this.year}-${String(this.month0+1).padStart(2,"0")}-${String(i).padStart(2,"0")}`;r.push({day:i,value:a,selected:a===this.props.selected})}return r}onSelect(e){this.props.onChange?.(e)}};s(Ns,"template","baseui.Calendar"),s(Ns,"props",{selected:{type:String,optional:!0},month:{type:Number,optional:!0},year:{type:Number,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onChange:{type:Function,optional:!0}})});var Os,yn=m(()=>{g();S();Os=class extends n{get classNames(){return d("bu-date-picker","form-control",this.props.className)}onInput(e){this.props.onChange?.(e.target.value,e)}};s(Os,"template","baseui.DatePicker"),s(Os,"props",{value:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onChange:{type:Function,optional:!0}})});var Bs,vn=m(()=>{g();da();Bs=class extends n{setup(){this.rootRef=w("root");let{state:e}=$r(this.rootRef);this.disclosure=e,this.state=f({query:this.selectedLabel})}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)}};s(Bs,"template","baseui.Combobox"),s(Bs,"props",{options:{type:Array},value:{type:String,optional:!0},placeholder:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},id:{type:String,optional:!0},onChange:{type:Function,optional:!0}})});var Is,Sn=m(()=>{g();Is=class extends n{setup(){this.state=f({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)}};s(Is,"template","baseui.Command"),s(Is,"props",{items:{type:Array},placeholder:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onSelect:{type:Function,optional:!0}})});var js,xn=m(()=>{g();S();js=class extends n{get classNames(){return d("bu-chart",this.props.type&&`bu-chart-${this.props.type}`,this.props.variant&&`bu-chart-${this.props.variant}`,this.props.className)}};s(js,"template","baseui.Chart"),s(js,"props",{config:{type:[String,Object],optional:!0},label:{type:String,optional:!0},type:{type:String,optional:!0},value:{type:[String,Number],optional:!0},variant:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var Ja,Rs,$s,Ts,Us,wn=m(()=>{g();M();S();Ja={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Rs=class extends n{setup(){this.state=f({index:this.props.defaultIndex??0}),this.rootRef=w("root"),this.bootstrapCarousel=null,this.onSlid=e=>{this.state.index=e.to,this.props.onChange?.(this.state.index)},C({carousel:this.state,carouselInstance:()=>this.bootstrapCarousel}),I(()=>{this.bootstrapCarousel=new(E()).Carousel(this.rootRef.el,{interval:!1,wrap:!0,touch:!0}),this.rootRef.el.addEventListener("slid.bs.carousel",this.onSlid)}),j(()=>{this.rootRef.el.removeEventListener("slid.bs.carousel",this.onSlid),this.bootstrapCarousel?.dispose()})}};s(Rs,"template","baseui.Carousel"),s(Rs,"props",{slideCount:{type:Number},defaultIndex:{type:Number,optional:!0},onChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});$s=class extends n{setup(){this.rootRef=w("root"),this.initialActive=this.active,_(()=>{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?F(this.props.state):this.env.carousel.index===this.props.index}};s($s,"template","baseui.CarouselSlide"),s($s,"props",{index:{type:Number},state:{type:String,optional:!0},...Ja});Ts=class extends n{onClick(){this.env.carouselInstance()?.prev()}};s(Ts,"template","baseui.CarouselPrevious"),s(Ts,"props",Ja);Us=class extends n{onClick(){this.env.carouselInstance()?.next()}};s(Us,"template","baseui.CarouselNext"),s(Us,"props",Ja)});var qs,An=m(()=>{g();qs=class extends n{setup(){this.panelRef=w("panel"),this.state=f({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,i=this.props.min||160,a=this.props.max||720,p=u=>{this.state.width=Math.min(a,Math.max(i,r+u.clientX-o))},l=()=>{document.removeEventListener("pointermove",p),document.removeEventListener("pointerup",l),this.props.onChange?.(this.state.width)};document.addEventListener("pointermove",p),document.addEventListener("pointerup",l)}};s(qs,"template","baseui.Resizable"),s(qs,"props",{min:{type:Number,optional:!0},max:{type:Number,optional:!0},onChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var Ms,En=m(()=>{g();S();Ms=class extends n{get classNames(){return d("bu-scroll-area",this.props.className)}};s(Ms,"template","baseui.ScrollArea"),s(Ms,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var Cn,Ln,ga,zs,Ps,Ds,Fs,_s,Hs,Ws,Ks,Vs,Zs,kn=m(()=>{g();S();te();Cn={idle:"bu-attachment-idle",uploading:"bu-attachment-uploading",processing:"bu-attachment-processing",error:"bu-attachment-error",done:"bu-attachment-done"},Ln={default:"bu-attachment-default",sm:"bu-attachment-sm",xs:"bu-attachment-xs"},ga={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},zs=class extends n{get state(){return Cn[this.props.state]?this.props.state:"done"}get size(){return Ln[this.props.size]?this.props.size:"default"}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return d("bu-attachment",Cn[this.state],Ln[this.size],`bu-attachment-${this.orientation}`,!this.hasContent&&"bu-attachment-picker",this.props.className)}get hasContent(){return!!this.props.slots?.default}onChange(e){this.props.onChange?.([...e.target.files])}};s(zs,"template","baseui.Attachment"),s(zs,"props",{state:{type:String,optional:!0},size:{type:String,optional:!0},orientation:{type:String,optional:!0},multiple:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}});Ps=class extends n{get variant(){return this.props.variant==="image"?"image":"icon"}get classNames(){return d("bu-attachment-media",`bu-attachment-media-${this.variant}`,this.props.className)}};s(Ps,"template","baseui.AttachmentMedia"),s(Ps,"props",{variant:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Ds=class extends n{};s(Ds,"template","baseui.AttachmentContent"),s(Ds,"props",ga);Fs=class extends n{};s(Fs,"template","baseui.AttachmentTitle"),s(Fs,"props",ga);_s=class extends n{};s(_s,"template","baseui.AttachmentDescription"),s(_s,"props",ga);Hs=class extends n{};s(Hs,"template","baseui.AttachmentActions"),s(Hs,"props",ga);Ws=class extends n{get classNames(){let e=this.props.size||"icon-xs";return d("btn","bu-button",P[this.props.variant]||P.ghost,W[e]||W["icon-xs"],"bu-button-icon","bu-attachment-action",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};s(Ws,"template","baseui.AttachmentAction"),s(Ws,"props",{type:{type:String,optional:!0},variant:{type:String,optional:!0},size:{type:String,optional:!0},disabled:{type:Boolean,optional:!0},label:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},"aria-label":{type:String,optional:!0},ariaLabel:{type:String,optional:!0},onClick:{type:Function,optional:!0},slots:{type:Object,optional:!0}});Ks=class extends n{get classNames(){return d("bu-attachment-trigger",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};s(Ks,"template","baseui.AttachmentTrigger"),s(Ks,"props",{href:{type:String,optional:!0},target:{type:String,optional:!0},rel:{type:String,optional:!0},type:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},"aria-label":{type:String,optional:!0},ariaLabel:{type:String,optional:!0},onClick:{type:Function,optional:!0}});Vs=class extends n{get classNames(){return d("bu-attachment-group",this.props.className)}};s(Vs,"template","baseui.AttachmentGroup"),s(Vs,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Zs=class extends n{setup(){this.state=f({dragging:!1}),this.fileInput=w("fileInput")}get hasContent(){return!!this.props.slots?.default}get classNames(){return d("bu-attachment-dropzone",this.state.dragging&&"bu-attachment-dropzone-dragging",this.props.disabled&&"bu-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)}};s(Zs,"template","baseui.AttachmentDropzone"),s(Zs,"props",{multiple:{type:Boolean,optional:!0},disabled:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onFilesSelected:{type:Function,optional:!0},slots:{type:Object,optional:!0}})});var Xs,Nn=m(()=>{g();Xs=class extends n{setup(){this.state=f({errored:!1})}get showImage(){return!!this.props.src&&!this.state.errored}onError(){this.state.errored=!0}};s(Xs,"template","baseui.Avatar"),s(Xs,"props",{src:{type:String,optional:!0},alt:{type:String,optional:!0},title:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var Gs,On=m(()=>{g();S();Gs=class extends n{get classNames(){return d("bu-message",this.props.className)}get side(){return this.props.side||"incoming"}};s(Gs,"template","baseui.Message"),s(Gs,"props",{side:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var Ys,Bn=m(()=>{g();Ys=class extends n{setup(){this.rootRef=w("root"),Y(()=>{this.props.autoscroll!==!1&&this.rootRef.el&&(this.rootRef.el.scrollTop=this.rootRef.el.scrollHeight)})}};s(Ys,"template","baseui.MessageScroller"),s(Ys,"props",{autoscroll:{type:Boolean,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var Qa,Js,Qs,tr,er,In=m(()=>{g();S();Qa={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},Js=class extends n{setup(){this.state=f({index:0}),C({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)}};s(Js,"template","baseui.Questionnaire"),s(Js,"props",{stepCount:{type:Number},onChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Qs=class extends n{get active(){return this.props.state!==void 0?F(this.props.state):this.env.questionnaire.index===this.props.index}};s(Qs,"template","baseui.QuestionnaireStep"),s(Qs,"props",{index:{type:Number},state:{type:String,optional:!0},...Qa});tr=class extends n{get disabled(){return this.env.questionnaire.index===0}onClick(){this.env.questionnaireShow(this.env.questionnaire.index-1)}};s(tr,"template","baseui.QuestionnairePrevious"),s(tr,"props",Qa);er=class extends n{onClick(){this.env.questionnaireShow(this.env.questionnaire.index+1)}};s(er,"template","baseui.QuestionnaireNext"),s(er,"props",{...Qa,stepCount:{type:Number,optional:!0}})});var or,jn=m(()=>{g();S();or=class extends n{get max(){return this.props.max||100}get value(){return Math.min(this.max,Math.max(0,this.props.value||0))}get style(){return G(`--b-progress-value:${this.value/this.max*100}%`,this.props.style)}get classNames(){return d("bu-progress",this.props.className)}};s(or,"template","baseui.Progress"),s(or,"props",{value:{type:Number,optional:!0},max:{type:Number,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}})});var sr,Rn=m(()=>{g();S();sr=class extends n{get classNames(){return d("bu-aspect-ratio",this.props.className)}get style(){let e=this.props.ratio||`${this.props.width||16} / ${this.props.height||9}`;return G(`--b-aspect-ratio:${e}`,this.props.style)}};s(sr,"template","baseui.AspectRatio"),s(sr,"props",{ratio:{type:String,optional:!0},width:{type:Number,optional:!0},height:{type:Number,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var rr,$n=m(()=>{g();S();rr=class extends n{get classNames(){return d("bu-bubble",this.props.className)}get side(){return this.props.side}};s(rr,"template","baseui.Bubble"),s(rr,"props",{side:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var ar,Tn=m(()=>{g();ar=class extends n{get dir(){return this.props.dir==="rtl"?"rtl":"ltr"}};s(ar,"template","baseui.Direction"),s(ar,"props",{dir:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var ir,Un=m(()=>{g();S();ir=class extends n{get classNames(){return d("bu-item",this.props.className)}get variant(){return this.props.variant}};s(ir,"template","baseui.Item"),s(ir,"props",{variant:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var nr,pr,lr,qn=m(()=>{g();S();nr=class extends n{get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return d("bu-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"]}};s(nr,"template","baseui.ButtonGroup"),s(nr,"props",{orientation:{type:String,optional:!0},size:{type:String,optional:!0},"aria-label":{type:String,optional:!0},"aria-labelledby":{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});pr=class extends n{get orientation(){return this.props.orientation==="horizontal"?"horizontal":"vertical"}get classNames(){return d("bu-button-group-separator",`bu-button-group-separator-${this.orientation}`,this.props.className)}};s(pr,"template","baseui.ButtonGroupSeparator"),s(pr,"props",{orientation:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}});lr=class extends n{get classNames(){return d("bu-button-group-text",this.props.className)}};s(lr,"template","baseui.ButtonGroupText"),s(lr,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});var cr,ur,Et,Ct,dr,Lt,br,kt,mr,Nt,ti=m(()=>{g();S();cr=class extends n{get classNames(){return d("bu-field-set",this.props.className)}};s(cr,"template","baseui.FieldSet"),s(cr,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});ur=class extends n{get variant(){return this.props.variant||"legend"}get classNames(){return d("bu-field-legend",this.props.className)}};s(ur,"template","baseui.FieldLegend"),s(ur,"props",{variant:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Et=class extends n{get classNames(){return d("bu-field-group",this.props.className)}};s(Et,"template","baseui.FieldGroup"),s(Et,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Ct=class extends n{get orientation(){return this.props.orientation||"vertical"}get classNames(){return d("bu-field",`bu-field-orientation-${this.orientation}`,this.props.className)}};s(Ct,"template","baseui.Field"),s(Ct,"props",{orientation:{type:String,optional:!0},invalid:{type:Boolean,optional:!0},label:{type:String,optional:!0},error:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});dr=class extends n{get classNames(){return d("bu-field-content",this.props.className)}};s(dr,"template","baseui.FieldContent"),s(dr,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Lt=class extends n{get classNames(){return d("bu-field-label",this.props.className)}};s(Lt,"template","baseui.FieldLabel"),s(Lt,"props",{for:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});br=class extends n{get classNames(){return d("bu-field-title",this.props.className)}};s(br,"template","baseui.FieldTitle"),s(br,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});kt=class extends n{get classNames(){return d("bu-field-description",this.props.className)}};s(kt,"template","baseui.FieldDescription"),s(kt,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});mr=class extends n{get hasContent(){return!!this.props.slots?.default}get classNames(){return d("bu-field-separator",this.props.className)}};s(mr,"template","baseui.FieldSeparator"),s(mr,"props",{className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});Nt=class extends n{get classNames(){return d("bu-field-error",this.props.className)}};s(Nt,"template","baseui.FieldError"),s(Nt,"props",{message:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});function ei(t){return`Icon${String(t).split("-").filter(Boolean).map(o=>o[0].toUpperCase()+o.slice(1)).join("")}`}var Mn=m(()=>{});var hr,zn=m(()=>{g();S();hr=class extends n{get classNames(){return d("form-label","b-label","bu-label",this.props.className)}get state(){return this.props.state||(this.props.required?"required":void 0)}};s(hr,"template","baseui.Label"),s(hr,"props",{for:{type:String,optional:!0},required:{type:Boolean,optional:!0},state:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}})});function oi(t){return t==="dark"?"dark":"light"}function kl(t){return typeof globalThis.location>"u"?null:new URLSearchParams(globalThis.location.search).get(t)}function Nl(t,e=document.documentElement){let o=oi(t);return globalThis.BaseUI?.theme?.set?globalThis.BaseUI.theme.set(o):e&&(e.setAttribute("b-theme",o),e.setAttribute("data-bs-theme",o)),o}function Pn(t,e,o){try{t.contentWindow?.BaseUI?.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 Ol(t){typeof document>"u"||typeof CustomEvent>"u"||document.dispatchEvent(new CustomEvent("baseui:theme-change",{detail:{theme:t}}))}function Vt(t={}){let e=t.storageKey||Al,o=t.queryKey||El,r=t.toggleSelector??Cl,i=t.labelSelector??Ll,a=t.root||(typeof document>"u"?null:document.documentElement);function p(){return kl(o)}function l(){return oi(p()||globalThis.localStorage?.getItem(e)||a?.getAttribute("b-theme")||"light")}function u(L){typeof document>"u"||!r||document.querySelectorAll(r).forEach(N=>{N.setAttribute("aria-pressed",L==="dark"?"true":"false");let A=i?N.querySelector(i):null;A&&(A.textContent=L==="dark"?"Light theme":"Dark theme")})}function b(L){typeof document>"u"||document.querySelectorAll("iframe").forEach(N=>Pn(N,L,o))}function h(L,N={}){let A=Nl(L,a);return!N.skipStorage&&!p()&&globalThis.localStorage?.setItem(e,A),u(A),b(A),Ol(A),A}function y(){return h(a?.getAttribute("b-theme")==="dark"?"light":"dark")}function x(){if(typeof document>"u")return l();let L=l();return h(L,{skipStorage:!!p()}),r&&document.addEventListener("click",N=>{N.target.closest?.(r)&&y()}),document.querySelectorAll("iframe").forEach(N=>{N.addEventListener("load",()=>Pn(N,a?.getAttribute("b-theme")||L,o))}),L}return{current:l,set:h,toggle:y,syncFrames:b,init:x}}var Al,El,Cl,Ll,Dn,Zr=m(()=>{Al="bu-theme",El="theme",Cl="[b-theme-toggle]",Ll="[b-theme-label]";Dn=Vt();typeof window<"u"&&(window.BaseUITheme=Dn)});function Mr(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 fa({variant:t="outline",size:e,className:o}={}){return d("btn","bu-theme-button",P[t]||P.outline,W[e],o)}var Fn,si=m(()=>{S();te();Fn=["btn","bu-theme-button",...Object.values(P),...Object.values(W)]});var pt,ri=m(()=>{g();Zr();J();S();si();pt=class extends n{setup(){this.theme=Vt({storageKey:Z(this.props,"storage-key","storageKey")}),this.state=f({theme:this.theme.current()}),this.onThemeChange=e=>{this.state.theme=e.detail?.theme||this.theme.current()},I(()=>{this.state.theme=this.theme.set(this.theme.current(),{skipStorage:!0}),document.addEventListener("baseui:theme-change",this.onThemeChange)}),j(()=>document.removeEventListener("baseui:theme-change",this.onThemeChange))}get iconName(){return Mr(this.state.theme).icon}get baseUrl(){return Z(this.props,"base-url")}get label(){return Mr(this.state.theme).label}get pressed(){return Mr(this.state.theme).pressed}get classNames(){return fa(this.props)}onClick(){let e=this.theme.toggle();this.state.theme=e,this.props.onChange?.(e)}};s(pt,"template","baseui.ThemeButton"),s(pt,"components",{Icon:B}),s(pt,"props",{variant:{type:String,optional:!0},size:{type:String,optional:!0},"base-url":{type:String,optional:!0},"storage-key":{type:String,optional:!0},storageKey:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onChange:{type:Function,optional:!0}})});var gr,_n=m(()=>{g();S();gr=class extends n{get classNames(){return d("bu-toggle","btn",this.props.variant==="outline"?"btn-outline-secondary":"btn-light",this.props.className)}get pressed(){return this.props.state!==void 0?F(this.props.state):!!this.props.pressed}onClick(){this.props.onChange?.(!this.pressed)}};s(gr,"template","baseui.Toggle"),s(gr,"props",{pressed:{type:Boolean,optional:!0},state:{type:String,optional:!0},variant:{type:String,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}})});var Bl,fr,yr,Hn=m(()=>{g();Bl={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},fr=class extends n{setup(){this.state=f({selected:new Set}),C({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)}};s(fr,"template","baseui.ToggleGroup"),s(fr,"props",{multiple:{type:Boolean,optional:!0},onChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}});yr=class extends n{get pressed(){return this.env.toggleGroup.selected.has(this.props.value)}onClick(){this.env.toggleGroupSelect(this.props.value)}};s(yr,"template","baseui.ToggleGroupItem"),s(yr,"props",{value:{type:String},...Bl})});var Jn={};ka(Jn,{destroyBaseUiPreviews:()=>zr,enhanceMarkdownDiagrams:()=>Gr,expandSelfClosingTags:()=>Jl,extractTagCaseMap:()=>ql,mountMarkdownEditor:()=>Yr,normalizeOwlPreviewMarkup:()=>tc,parseMarkdown:()=>Xr,primeBaseUiTemplates:()=>ec,renderBaseUiBlocks:()=>Yn,renderMermaidBlocks:()=>Xn});function jl(){return ai??(ai=import("./runtime/marked/marked.min.js").then(t=>{let e=t.marked||t.default?.marked||globalThis.marked;if(!e?.parse)throw new Error("BaseUI markdown: failed to load src/runtime/marked/marked.min.js");return e})),ai}function Rl(){return ii??(ii=import("./runtime/mermaid/mermaid.esm.min.mjs").then(t=>{let e=t.default||t;return e.initialize({startOnLoad:!1,securityLevel:"strict"}),e})),ii}function $l(){return ni??(ni=import("./runtime/milkdown/milkdown-editor.js")),ni}async function Xr(t,e={}){return(await jl()).parse(String(t??""),{gfm:!0,breaks:!1,...e})}function li(t,e,o,r=""){t.classList.add("bu-markdown-diagram-error"),t.replaceChildren();let i=document.createElement("p");if(i.className="bu-markdown-diagram-error-message",i.textContent=`Unable to render ${e} diagram: ${o?.message||o}`,t.append(i),r){let a=document.createElement("pre"),p=document.createElement("code");p.textContent=r,a.append(p),t.append(a)}}async function Xn(t){let e=[...t.querySelectorAll("pre > code.language-mermaid")];if(!e.length)return;let o;try{o=await Rl()}catch(r){e.forEach(i=>{let a=i.closest("pre");a.replaceChildren(),a.className="bu-markdown-diagram bu-markdown-mermaid",li(a,"mermaid",r,i.textContent)});return}for(let r of e){let i=r.textContent,a=r.closest("pre");a.replaceChildren(),a.className="bu-markdown-diagram bu-markdown-mermaid";try{let{svg:p}=await o.render(`bu-mermaid-${++Il}`,i);a.innerHTML=p}catch(p){li(a,"mermaid",p,i)}}}function Tl(t){let e=globalThis.BaseUI;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="bu-markdown-bu-copy-toast",o.textContent=t,document.body.append(o),e.mountAll(o),o.addEventListener("baseui:close",()=>o.remove(),{once:!0})}function Ul(t){let e=document.createElement("div");e.className="bu-markdown-bu-code";let o=document.createElement("button");o.type="button",o.className="bu-markdown-bu-copy";let r=document.createElement("span");z(r,"copy",{label:"Copy code"}),o.append(r),o.addEventListener("click",async()=>{try{await Ir(t),o.dispatchEvent(new CustomEvent("baseui:markdown-copy",{bubbles:!0,detail:{source:t}})),Tl("Copied to clipboard")}catch(p){o.dispatchEvent(new CustomEvent("baseui:markdown-copy-error",{bubbles:!0,detail:{error:p}}))}}),e.append(o);let i=document.createElement("pre"),a=document.createElement("code");a.className="bu-markdown-bu-code-lines";for(let p of t.replace(/\n$/,"").split(`
|
|
11
|
-
`)){let l=document.createElement("span");l.className="bu-markdown-bu-code-line",l.textContent=p,a.append(l)}return i.append(a),e.append(i),e}function Wn(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function ql(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 Ml(t){return e=>{if(e.hasAttribute("b-ui"))return e;let o=globalThis.BaseUI,r=t.get(e.localName)||e.localName,i=Wn(r),a=!!o?.component?.(i),p=$(e.getAttribute("className")||e.getAttribute("class"));if(!a){let l=`bu-${i}`;return e.className=p?`${l} ${p}`:l,e}e.setAttribute("b-ui",i),p&&(e.className=p);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 u=$(l.value);e.removeAttribute(l.name),!(u===""||u==="false")&&e.setAttribute(`b-att-${Wn(l.name)}`,u==="true"?"true":u)}return e}}function $(t){if(!t)return"";let e=t.trim();return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function va(t,e){for(;t.firstChild;)e.append(t.firstChild)}function tt(t,e){return va(t,e),t.replaceWith(e),e}function zl(t){let e=document.createElement("div");e.setAttribute("b-field-group","");let o=$(t.getAttribute("className")||t.getAttribute("class"));return o&&(e.className=o),tt(t,e)}function Pl(t){let e=document.createElement("div");e.setAttribute("b-ui","field");let o=$(t.getAttribute("orientation")||""),r=$(t.getAttribute("className")||t.getAttribute("class"));return o&&e.setAttribute("b-att-orientation",o),r&&(e.className=r),tt(t,e)}function Dl(t){let e=document.createElement("label");e.setAttribute("b-field-label","");let o=$(t.getAttribute("for")||""),r=$(t.getAttribute("className")||t.getAttribute("class"));return o&&e.setAttribute("for",o),r&&(e.className=r),tt(t,e)}function Kn(t,e,o){let r=document.createElement(e);r.setAttribute(o,"");let i=$(t.getAttribute("className")||t.getAttribute("class"));return i&&(r.className=i),tt(t,r)}function Fl(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 i=$(e||"button"),a=$(t.getAttribute("variant")||""),p=$(t.getAttribute("size")||""),l=$(t.getAttribute("className")||t.getAttribute("class")),u=$(t.getAttribute("label")||"");return r.type=i||"button",a&&r.setAttribute("b-att-variant",a),p&&r.setAttribute("b-att-size",p),l&&(r.className=l),u&&!t.childNodes.length&&(r.textContent=u),tt(t,r)}function _l(t){if(t.hasAttribute("b-ui")||t.hasAttribute("b-icon"))return t;let e=$(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=$(t.getAttribute("size")||""),i=$(t.getAttribute("label")||""),a=$(t.getAttribute("className")||t.getAttribute("class"));return r&&o.setAttribute("b-att-size",r),i&&o.setAttribute("b-att-label",i),a&&(o.className=a),tt(t,o)}function Hl(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","alert");let o=$(t.getAttribute("variant")||""),r=$(t.getAttribute("className")||t.getAttribute("class"));return o&&e.setAttribute("b-att-variant",o),r&&(e.className=r),tt(t,e)}function pi(t){return e=>{if(e.hasAttribute("b-ui"))return e;let o=document.createElement("div"),r=$(e.getAttribute("className")||e.getAttribute("class"));return o.className=r?`${t} ${r}`:t,tt(e,o)}}function Wl(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","accordion"),$(t.getAttribute("multiple"))==="true"&&e.setAttribute("b-att-multiple","true");let o=$(t.getAttribute("className")||t.getAttribute("class"));return o&&(e.className=o),tt(t,e)}function Kl(t){if(t.hasAttribute("b-accordion-item"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-item",""),$(t.getAttribute("state"))==="open"&&e.setAttribute("b-att-state","open");let o=$(t.getAttribute("className")||t.getAttribute("class"));return o&&(e.className=o),tt(t,e)}function Vl(t){if(t.hasAttribute("b-accordion-trigger"))return t;let e=document.createElement("button");e.type="button",e.setAttribute("b-accordion-trigger","");let o=$(t.getAttribute("className")||t.getAttribute("class"));o&&(e.className=o),va(t,e);let r=document.createElement("span");return r.setAttribute("b-icon","chevron-down"),r.className="bu-accordion-trigger-icon",e.append(r),t.replaceWith(e),e}function Zl(t){if(t.hasAttribute("b-accordion-panel"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-panel","");let o=$(t.getAttribute("className")||t.getAttribute("class"));return o&&(e.className=o),tt(t,e)}function Xl(t){return Vn+=1,`${t}-${Vn}`}function Q(t,e,o){return r=>{if(r.hasAttribute("b-ui"))return r;let i=document.createElement(t);t==="button"&&(i.type="button"),o&&i.setAttribute(o,"");let a=$(r.getAttribute("className")||r.getAttribute("class"));return i.className=a?`${e} ${a}`:e,tt(r,i)}}function Gl(){let t=document.createElement("button");t.type="button",t.className="btn bu-button btn-light btn-icon-sm bu-dialog-close bu-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 Zn({tagPrefix:t,componentName:e,triggerTag:o,triggerClassName:r,panelClassName:i,closeButton:a}){return p=>{if(p.hasAttribute("b-ui"))return p;let l=p.querySelector(`:scope > ${t}trigger`),u=p.querySelector(`:scope > ${t}content`);if(!u)return p;let b=Xl(`bu-preview-${e}`),h=document.createElement(o);o==="button"&&(h.type="button"),h.className=r,h.setAttribute("b-att-trigger",`#${b}`),l&&va(l,h);let y=document.createElement("div");y.setAttribute("b-ui",e),y.id=b,y.setAttribute("b-att-trigger",`[b-att-trigger='#${b}']`);let x=document.createElement("div");x.className=i;let L=$(u.getAttribute("size")||"");return L&&x.setAttribute("data-size",L),va(u,x),a&&x.append(a()),y.append(x),p.before(h,y),p.remove(),y}}function Jl(t){return t.replace(/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,(e,o,r)=>Yl.has(o.toLowerCase())?e:`<${o}${r}></${o}>`)}function Ql(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 tc(t,e){Ql(t);let o={fieldgroup:zl,field:Pl,fieldlabel:Dl,fielddescription:i=>Kn(i,"p","b-field-description"),fielderror:i=>Kn(i,"p","b-field-error"),button:Fl,icon:_l,alert:Hl,alerttitle:pi("bu-alert-title"),alertdescription:pi("bu-alert-description"),alertaction:pi("bu-alert-action"),accordion:Wl,accordionitem:Kl,accordiontrigger:Vl,accordioncontent:Zl,dialog:Zn({tagPrefix:"dialog",componentName:"dialog",triggerTag:"span",triggerClassName:"bu-dialog-trigger",panelClassName:"bu-dialog-panel",closeButton:Gl}),dialogheader:Q("div","bu-dialog-header"),dialogfooter:Q("div","bu-dialog-footer"),dialogtitle:Q("h2","bu-dialog-title"),dialogdescription:Q("p","bu-dialog-description"),dialogclose:Q("button","btn bu-button btn-outline-secondary bu-dialog-close","b-dialog-close"),alertdialog:Zn({tagPrefix:"alertdialog",componentName:"alert-dialog",triggerTag:"button",triggerClassName:"btn bu-button btn-outline-secondary bu-alert-dialog-trigger",panelClassName:"bu-dialog-panel bu-alert-dialog-panel"}),alertdialogheader:Q("div","bu-dialog-header bu-alert-dialog-header"),alertdialogfooter:Q("div","bu-dialog-footer bu-alert-dialog-footer"),alertdialogmedia:Q("div","bu-alert-dialog-media"),alertdialogtitle:Q("h2","bu-dialog-title bu-alert-dialog-title"),alertdialogdescription:Q("p","bu-dialog-description bu-alert-dialog-description"),alertdialogcancel:Q("button","btn bu-button btn-outline-secondary bu-alert-dialog-cancel","b-alert-dialog-cancel"),alertdialogaction:Q("button","btn bu-button btn-primary bu-alert-dialog-action","b-alert-dialog-action")},r=Ml(e);for(let i of[...t.querySelectorAll("*")]){let a=i.localName.toLowerCase();o[a]?o[a](i):e.has(a)&&r(i)}}function ec(t){ya=Promise.resolve(t)}function oc(){return ya??(ya=Hr("/dist/baseui.templates.xml")),ya}function zr(t){let e=ci.get(t);if(e){ci.delete(t);for(let o of e)try{o.destroy()}catch{}}}function rc(t){return new Set([...t.matchAll(sc)].map(e=>e[1]))}function nc(t){let e=new Set;for(let o of t.matchAll(ac))e.add(o[1]);for(let o of t.matchAll(ic))e.add(o[2]);return e}function pc(t){let e=Ei({raw:[t]}),o=rc(t);class r extends n{setup(){this.state=f(Object.fromEntries([...o].map(a=>[a,""])))}}s(r,"template",e);for(let i of nc(t))r.prototype[i]=function(){};return r}function Gn(t){t.querySelector("[data-slot='dropdown-menu'], .bu-dropdown-menu, [b-ui='dropdown-menu'], [b-dropdown-menu]")&&t.classList.add("bu-markdown-bu-preview-overlay")}async function lc(t,e){let[o,r]=await Promise.all([oc(),pc(e)]),i=await sa(r,t,{templates:o});return Gn(t),i}function cc(t,e){let o=globalThis.BaseUI;if(!o?.mountAll)throw new Error("BaseUI runtime not found on the page \u2014 load dist/baseui.min.js before mounting Markdown.");t.innerHTML=e,Gn(t),o.mountAll(t)}async function Yn(t){zr(t);let e=[...t.querySelectorAll("pre > code.language-base-ui")];if(!e.length)return;let o=new Set;for(let r of e){let i=r.textContent,a=r.closest("pre");a.replaceChildren(),a.className="bu-markdown-live bu-markdown-baseui";let p=document.createElement("div");p.className="bu-markdown-bu-preview",a.append(p,Ul(i));try{/<[A-Z]/.test(i)?o.add(await lc(p,i)):cc(p,i)}catch(l){li(a,"BaseUI component",l,i)}}o.size&&ci.set(t,o)}async function Gr(t,{mermaid:e=!0,baseUi:o=!0}={}){e&&await Xn(t),o&&await Yn(t)}async function Yr(t){return(await $l()).createMilkdownMarkdownEditor(t)}var ai,ii,ni,Il,Vn,Yl,ya,ci,sc,ac,ic,Sa=m(()=>{g();ot();na();Il=0;Vn=0;Yl=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);ci=new WeakMap;sc=/\bstate\.([A-Za-z_$][\w$]*)/g;ac=/\bthis\.([A-Za-z_$][\w$]*)\s*\(/g,ic=/\bt-on-[\w:-]+\s*=\s*(["'])([A-Za-z_$][\w$]*)\1/g});function xa(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 i of o[1].split(/\r?\n/)){let a=i.trim();if(!a||a.startsWith("#"))continue;let p=a.indexOf(":");if(p===-1)continue;let l=a.slice(0,p).trim();l&&(r[l]=uc(a.slice(p+1).trim()))}return{data:r,content:e.slice(o[0].length)}}function Qn(t){return t.length>=2&&(t[0]==='"'&&t.at(-1)==='"'||t[0]==="'"&&t.at(-1)==="'")?t.slice(1,-1):t}function uc(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=>Qn(o.trim())):[]}return Qn(t)}var ui=m(()=>{});var Zt,tp=m(()=>{g();qa();S();Sa();ui();Zt=class extends n{setup(){this.rootRef=w("root"),this.editorRef=w("editor"),this.editorHandle=null,this.state=f({html:"",source:"",status:"loading",error:"",frontmatter:{}}),Qt(()=>this.load(this.props)),q(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),I(()=>this.afterRender()),_(()=>this.afterRender()),Wr(()=>{this.destroyEditor(),this.rootRef.el&&zr(this.rootRef.el)})}get classNames(){return d("bu-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 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}try{this.state.source=o;let{data:r,content:i}=xa(o);this.state.frontmatter=r,this.state.html=Ba(await Xr(i)),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"||Gr(e,{mermaid:this.props.mermaid!==!1,baseUi:this.props.baseUi!==!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 Yr({root:e,value:this.state.source,collaborative:!!this.props.collaborative,room:this.props.room||"bu-markdown",password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(o,r,i)=>{this.state.source=o,this.props.onChange?.(o,r,i)}})}catch(o){this.state.status="error",this.state.error=o.message||String(o)}}destroyEditor(){this.editorHandle?.destroy?.(),this.editorHandle=null}};s(Zt,"template","baseui.Markdown"),s(Zt,"components",{Badge:lt}),s(Zt,"props",{content:{type:String,optional:!0},src:{type:String,optional:!0},mermaid:{type:Boolean,optional:!0},baseUi:{type:Boolean,optional:!0},editable:{type:Boolean,optional:!0},collaborative:{type:Boolean,optional:!0},room:{type:String,optional:!0},password:{type:String,optional:!0},signaling:{type:Array,optional:!0},user:{type:Object,optional:!0},onChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}})});function wa(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=wa(o,e);if(r)return r}return null}function dc(t){return t.replace(/\.[^./]+$/,"").replace(/[_-]+/g," ").trim().split(/\s+/).map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" ")}var Pr,Dr,Xt,ep=m(()=>{g();J();ha();Va();Pr=class Pr extends n{get label(){let e=this.props.node.meta;return e?.sidebar_label||e?.title||dc(this.props.node.name)}get hasSubfolders(){return(this.props.node.children||[]).some(e=>e.type==="dir")}select(e){this.props.onSelect(e)}};s(Pr,"template","baseui.MarkdownTreeNode"),s(Pr,"components",{MarkdownTreeNode:Pr,Icon:B,SidebarGroupLabel:wt,SidebarMenu:nt,SidebarMenuItem:At,SidebarMenuButton:at,DropdownMenu:mt,DropdownMenuTrigger:ht,DropdownMenuContent:gt,DropdownMenuItem:ft,DropdownMenuSub:yt,DropdownMenuSubTrigger:st,DropdownMenuSubContent:vt}),s(Pr,"props",{node:{type:Object},activePath:{type:String,optional:!0},onSelect:{type:Function},nested:{type:Boolean,optional:!0}});Dr=Pr,Xt=class extends n{setup(){this.state=f({tree:null,status:"loading",error:""}),Qt(()=>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)}}};s(Xt,"template","baseui.MarkdownTree"),s(Xt,"components",{MarkdownTreeNode:Dr,SidebarGroup:xt,SidebarMenu:nt}),s(Xt,"props",{src:{type:String},activePath:{type:String,optional:!0},onSelect:{type:Function},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}})});function op(t=document.querySelector("[b-block-code-template]")){let r=((t?.tagName==="SCRIPT"?t.textContent:t?.innerHTML)?.replace(/^\n/,"").replace(/\s+$/,"")||"").split(`
|
|
12
|
-
`),
|
|
13
|
-
`)}function
|
|
14
|
-
`)}function
|
|
15
|
-
`);await sa(i,e,{templates:`<templates>${a}</templates>`}),Aa.set(Aa.current(),{skipStorage:!0})}mountStaticBaseUI(e=document){yc(e),globalThis.BaseUI?.mountAll(e),Aa.set(Aa.current(),{skipStorage:!0})}};s(Gt,"template","baseui.BlockViewer"),s(Gt,"components",{Button:K,Icon:B,ThemeButton:pt}),s(Gt,"props",{navItems:{type:Array,optional:!0}})});var Ot,vr,Sr,xr,wr,Ar,Er,Cr,Lr,kr,Nr,cp=m(()=>{g();Vr();S();Ot={className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},slots:{type:Object,optional:!0}},vr=class extends n{setup(){this.pwaState=f({open:T(this.props)}),C({pwa:this.pwaState,setPwaOpen:e=>this.setOpen(e)}),q(e=>{U(e)&&(this.pwaState.open=T(e))})}setOpen(e){U(this.props)||(this.pwaState.open=e),this.props.onOpenChange?.(e)}};s(vr,"template","baseui.Pwa"),s(vr,"props",{open:{type:Boolean,optional:!0},"default-open":{type:Boolean,optional:!0},defaultOpen:{type:Boolean,optional:!0},onOpenChange:{type:Function,optional:!0},slots:{type:Object,optional:!0}});Sr=class extends n{onClick(){this.env.setPwaOpen(!0)}};s(Sr,"template","baseui.PwaTrigger"),s(Sr,"props",Ot);xr=class extends n{setup(){this.rootRef=w("root"),Y(e=>{if(!e)return;let o=document.activeElement;return Tr(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)}};s(xr,"template","baseui.PwaContent"),s(xr,"props",Ot);wr=class extends n{};s(wr,"template","baseui.PwaHeader"),s(wr,"props",Ot);Ar=class extends n{};s(Ar,"template","baseui.PwaTitle"),s(Ar,"props",Ot);Er=class extends n{};s(Er,"template","baseui.PwaDescription"),s(Er,"props",Ot);Cr=class extends n{};s(Cr,"template","baseui.PwaBody"),s(Cr,"props",Ot);Lr=class extends n{get steps(){return Array.isArray(this.props.steps)?this.props.steps:[]}};s(Lr,"template","baseui.PwaSteps"),s(Lr,"props",{...Ot,steps:{type:Array,optional:!0}});kr=class extends n{};s(kr,"template","baseui.PwaFooter"),s(kr,"props",Ot);Nr=class extends n{onClick(){this.env.setPwaOpen(!1)}};s(Nr,"template","baseui.PwaClose"),s(Nr,"props",Ot)});function bp(t,e){return typeof t=="string"?t:e}function vc(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 up,dp,Yt,mp=m(()=>{g();ee();S();ti();up="",dp="";Yt=class extends n{setup(){this.state=f({title:bp(this.props.title,up),description:bp(this.props.description,dp),submitted:!1})}get classNames(){return d("bu-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 vc(this.state)}get titleInvalid(){return!!this.errors.title}get descriptionInvalid(){return!!this.errors.description}reset(){this.state.title=up,this.state.description=dp,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})}};s(Yt,"template","baseui.Form"),s(Yt,"components",{Button:K,Field:Ct,FieldDescription:kt,FieldError:Nt,FieldGroup:Et,FieldLabel:Lt}),s(Yt,"props",{title:{type:String,optional:!0},description:{type:String,optional:!0},titlePlaceholder:{type:String,optional:!0},descriptionPlaceholder:{type:String,optional:!0},maxDescriptionLength:{type:Number,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0},onSubmit:{type:Function,optional:!0}})});function Sc(){return di??(di=import("./runtime/milkdown/milkdown-text-editor.js")),di}async function Ea(t){return(await Sc()).createMilkdownTextEditor(t)}function Ca({collaborative:t,providerType:e,url:o}={}){return!!t||!!(e&&o)}var di,bi=m(()=>{});var Or,hp=m(()=>{g();S();bi();Or=class extends n{setup(){this.editorRef=w("editor"),this.editorHandle=null,this.mountPromise=null,this.mountToken=0,this.isDestroyed=!1,this.state=f({content:"",status:"loading",error:""}),Qt(()=>this.load(this.props)),q(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),I(()=>this.mountEditor()),_(()=>this.mountEditor()),Wr(()=>{this.isDestroyed=!0,this.destroyEditor()})}get classNames(){return d("bu-text-editor",this.props.className)}get isCollaborative(){return Ca({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 Ea({root:e,value:this.state.content,placeholder:this.props.placeholder,collaborative:this.isCollaborative,providerType:this.props.provider,room:this.props.room||"bu-text-editor",url:this.props.url,password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(i,a,p)=>{this.state.content=i,this.props.onChange?.(i,a,p)}});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}};s(Or,"template","baseui.TextEditor"),s(Or,"props",{content:{type:String,optional:!0},src:{type:String,optional:!0},placeholder:{type:String,optional:!0},collaborative:{type:Boolean,optional:!0},provider:{type:String,optional:!0},room:{type:String,optional:!0},url:{type:String,optional:!0},password:{type:String,optional:!0},signaling:{type:Array,optional:!0},user:{type:Object,optional:!0},onChange:{type:Function,optional:!0},className:{type:String,optional:!0},style:{type:[String,Object],optional:!0}})});var Fr={};ka(Fr,{Accordion:()=>Ko,AccordionContent:()=>Zo,AccordionItem:()=>Vo,AccordionTrigger:()=>Tt,Alert:()=>ve,AlertAction:()=>we,AlertDescription:()=>xe,AlertDialog:()=>eo,AlertDialogAction:()=>co,AlertDialogCancel:()=>lo,AlertDialogContent:()=>so,AlertDialogDescription:()=>po,AlertDialogFooter:()=>ao,AlertDialogHeader:()=>ro,AlertDialogMedia:()=>io,AlertDialogTitle:()=>no,AlertDialogTrigger:()=>oo,AlertTitle:()=>Se,AspectRatio:()=>sr,Attachment:()=>zs,AttachmentAction:()=>Ws,AttachmentActions:()=>Hs,AttachmentContent:()=>Ds,AttachmentDescription:()=>_s,AttachmentDropzone:()=>Zs,AttachmentGroup:()=>Vs,AttachmentMedia:()=>Ps,AttachmentTitle:()=>Fs,AttachmentTrigger:()=>Ks,Avatar:()=>Xs,Badge:()=>lt,BlockViewer:()=>Gt,Breadcrumb:()=>Jo,BreadcrumbEllipsis:()=>qt,BreadcrumbItem:()=>ts,BreadcrumbLink:()=>es,BreadcrumbList:()=>Qo,BreadcrumbPage:()=>os,BreadcrumbSeparator:()=>Ut,Bubble:()=>rr,Button:()=>K,ButtonGroup:()=>nr,ButtonGroupSeparator:()=>pr,ButtonGroupText:()=>lr,Calendar:()=>Ns,Card:()=>ct,CardBody:()=>ut,CardDescription:()=>ie,CardFooter:()=>re,CardHeader:()=>se,CardTitle:()=>ae,Carousel:()=>Rs,CarouselNext:()=>Us,CarouselPrevious:()=>Ts,CarouselSlide:()=>$s,Chart:()=>js,Checkbox:()=>Ue,ClipboardButton:()=>Bt,Collapsible:()=>Xo,CollapsibleContent:()=>Yo,CollapsibleTrigger:()=>Go,Combobox:()=>Bs,Command:()=>Is,ContextMenu:()=>Fo,ContextMenuContent:()=>Ho,ContextMenuItem:()=>Wo,ContextMenuTrigger:()=>_o,DataTable:()=>Kt,DatePicker:()=>Os,Dialog:()=>de,DialogClose:()=>ye,DialogContent:()=>jt,DialogDescription:()=>fe,DialogFooter:()=>he,DialogHeader:()=>me,DialogTitle:()=>ge,DialogTrigger:()=>be,Direction:()=>ar,Drawer:()=>uo,DrawerClose:()=>vo,DrawerContent:()=>mo,DrawerDescription:()=>yo,DrawerFooter:()=>go,DrawerHeader:()=>ho,DrawerTitle:()=>fo,DrawerTrigger:()=>bo,DropdownMenu:()=>mt,DropdownMenuCheckboxItem:()=>Rt,DropdownMenuContent:()=>gt,DropdownMenuGroup:()=>qo,DropdownMenuItem:()=>ft,DropdownMenuLabel:()=>Mo,DropdownMenuRadioGroup:()=>zo,DropdownMenuRadioItem:()=>$t,DropdownMenuSeparator:()=>Po,DropdownMenuShortcut:()=>Do,DropdownMenuSub:()=>yt,DropdownMenuSubContent:()=>vt,DropdownMenuSubTrigger:()=>st,DropdownMenuTrigger:()=>ht,Empty:()=>Ae,EmptyContent:()=>Ne,EmptyDescription:()=>ke,EmptyHeader:()=>Ee,EmptyMedia:()=>Ce,EmptyTitle:()=>Le,Field:()=>Ct,FieldContent:()=>dr,FieldDescription:()=>kt,FieldError:()=>Nt,FieldGroup:()=>Et,FieldLabel:()=>Lt,FieldLegend:()=>ur,FieldSeparator:()=>mr,FieldSet:()=>cr,FieldTitle:()=>br,Form:()=>Yt,HoverCard:()=>Ro,HoverCardContent:()=>To,HoverCardTrigger:()=>$o,Icon:()=>B,Input:()=>ne,InputGroup:()=>He,InputGroupAddon:()=>We,InputGroupButton:()=>Ke,InputGroupInput:()=>Ze,InputGroupText:()=>Ve,InputGroupTextarea:()=>Xe,InputOtp:()=>Ge,Item:()=>ir,Kbd:()=>je,Label:()=>hr,Markdown:()=>Zt,MarkdownTree:()=>Xt,MarkdownTreeNode:()=>Dr,Marker:()=>Re,Menubar:()=>ns,Message:()=>Gs,MessageScroller:()=>Ys,NativeSelect:()=>Te,NavigationMenu:()=>as,NavigationMenuItem:()=>is,Pagination:()=>ss,PaginationItem:()=>rs,Popover:()=>Bo,PopoverContent:()=>jo,PopoverTrigger:()=>Io,Progress:()=>or,Pwa:()=>vr,PwaBody:()=>Cr,PwaClose:()=>Nr,PwaContent:()=>xr,PwaDescription:()=>Er,PwaFooter:()=>kr,PwaHeader:()=>wr,PwaSteps:()=>Lr,PwaTitle:()=>Ar,PwaTrigger:()=>Sr,Questionnaire:()=>Js,QuestionnaireNext:()=>er,QuestionnairePrevious:()=>tr,QuestionnaireStep:()=>Qs,RadioGroup:()=>qe,RadioGroupItem:()=>Me,Resizable:()=>qs,ScrollArea:()=>Ms,Select:()=>Ye,SelectContent:()=>Qe,SelectItem:()=>to,SelectTrigger:()=>Je,Separator:()=>Oe,Sheet:()=>xo,SheetClose:()=>No,SheetContent:()=>Ao,SheetDescription:()=>ko,SheetFooter:()=>Co,SheetHeader:()=>Eo,SheetTitle:()=>Lo,SheetTrigger:()=>wo,Shell:()=>_t,ShellContent:()=>Wt,ShellHeader:()=>As,ShellMain:()=>ws,ShellNav:()=>xs,ShellSidebar:()=>Ht,ShellSidebarHeader:()=>Ss,ShellUserMenu:()=>Es,Sidebar:()=>it,SidebarClose:()=>zt,SidebarContent:()=>St,SidebarFooter:()=>ls,SidebarGroup:()=>xt,SidebarGroupAction:()=>Pt,SidebarGroupCollapsible:()=>Dt,SidebarGroupContent:()=>ms,SidebarGroupLabel:()=>wt,SidebarHeader:()=>ps,SidebarInput:()=>ds,SidebarInset:()=>cs,SidebarMenu:()=>nt,SidebarMenuAction:()=>Ft,SidebarMenuBadge:()=>gs,SidebarMenuButton:()=>at,SidebarMenuItem:()=>At,SidebarMenuSkeleton:()=>fs,SidebarMenuSub:()=>hs,SidebarMenuSubButton:()=>vs,SidebarMenuSubItem:()=>ys,SidebarProvider:()=>Ur,SidebarRail:()=>us,SidebarSeparator:()=>bs,SidebarTrigger:()=>Mt,Skeleton:()=>dt,Slider:()=>Pe,Spinner:()=>Be,Switch:()=>ze,TabContent:()=>It,TabTrigger:()=>ue,Table:()=>Cs,Tabs:()=>pe,TabsContainer:()=>le,TabsList:()=>ce,TextEditor:()=>Or,Textarea:()=>$e,ThemeButton:()=>pt,Toast:()=>rt,Toggle:()=>gr,ToggleGroup:()=>fr,ToggleGroupItem:()=>yr,Tooltip:()=>Uo,Typography:()=>Ie,createNamedIcon:()=>$a,findMarkdownTreeNode:()=>wa,iconComponentName:()=>ei});var Jr=m(()=>{ee();Li();qa();Ma();ki();Oi();Bi();ji();$i();Ti();Fa();Ui();qi();Mi();zi();Pi();Di();Fi();_i();Hi();Wi();Ki();Vi();Zi();Xi();Gi();Yi();Qi();en();on();Va();sn();Ga();rn();nn();pn();ln();cn();un();ha();mn();hn();gn();fn();yn();vn();Sn();xn();wn();An();En();kn();Nn();On();Bn();In();jn();Rn();$n();Tn();Un();qn();ti();J();Mn();zn();ri();_n();Hn();tp();ep();lp();cp();mp();hp()});v();S();var xi="0.0.11";g();Jr();v();Vr();function xc(t){let{open:e,close:o,destroy:r}=ba(t,{closeSelector:"[b-alert-dialog-cancel], [b-alert-dialog-action], [b-alert-dialog-close]",trapFocus:!0});return t.setAttribute("role","alertdialog"),t.BaseUIAlertDialog={open:e,close:o},{destroy:()=>{r(),delete t.BaseUIAlertDialog}}}c.register("alert-dialog",{type:"owl",mount:xc});v();M();var mi={default:"bu-alert-default",destructive:"bu-alert-destructive",info:"bu-alert-default",success:"alert-success",warning:"alert-warning",danger:"bu-alert-destructive"};function wc(t){t.classList.add("alert","bu-alert",mi[t.getAttribute("b-att-variant")||"default"]||mi.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(E()).Alert(t)}return{destroy:()=>{e?.dispose(),t.classList.remove("alert","bu-alert","alert-dismissible","fade","show",...Object.values(mi))}}}c.register("alert",{type:"static",mount:wc});v();M();function Ac(t){let e=[...t.querySelectorAll("[b-accordion-item]")],o=t.getAttribute("b-att-multiple")==="true",r=new Map,i=new Map,a=new Map,p=(l,u)=>{let b=l.querySelector("[b-accordion-trigger]");l.setAttribute("b-att-state",u?"open":"closed"),b?.setAttribute("aria-expanded",String(u)),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{open:u}}))};return t.setAttribute("role","presentation"),e.forEach((l,u)=>{let b=l.querySelector("[b-accordion-trigger]"),h=l.querySelector("[b-accordion-panel]");if(!h)return;let y=h.id||`bu-accordion-panel-${u}`;h.id=y;let x=l.getAttribute("b-att-state")==="open";h.classList.add("collapse"),x&&h.classList.add("show");let L=new(E()).Collapse(h,{toggle:!1});a.set(l,L);let N=()=>p(l,!0),A=()=>p(l,!1);h.addEventListener("shown.bs.collapse",N),h.addEventListener("hidden.bs.collapse",A),i.set(l,{onShown:N,onHidden:A}),b?.setAttribute("aria-expanded",String(x)),b?.setAttribute("aria-controls",y);let R=()=>{let D=h.classList.contains("show");!o&&!D&&e.forEach(k=>{if(k===l)return;let H=a.get(k),X=k.querySelector("[b-accordion-panel]");H&&X?.classList.contains("show")&&H.hide()}),D?L.hide():L.show()};r.set(l,R),b?.addEventListener("click",R)}),{destroy:()=>{e.forEach(l=>{let u=l.querySelector("[b-accordion-trigger]"),b=l.querySelector("[b-accordion-panel]");u?.removeEventListener("click",r.get(l));let h=i.get(l);b&&h&&(b.removeEventListener("shown.bs.collapse",h.onShown),b.removeEventListener("hidden.bs.collapse",h.onHidden)),a.get(l)?.dispose()}),r.clear(),i.clear(),a.clear()}}}c.register("accordion",{type:"owl",mount:Ac});v();function Ec(t){let e=t.getAttribute("b-att-ratio")||`${t.getAttribute("b-att-width")||16} / ${t.getAttribute("b-att-height")||9}`;return t.classList.add("bu-aspect-ratio"),t.style.setProperty("--b-aspect-ratio",e),{destroy:()=>t.classList.remove("bu-aspect-ratio")}}c.register("aspect-ratio",{type:"static",mount:Ec});v();te();var Cc=["idle","uploading","processing","error","done"],Lc=["default","sm","xs"],kc=["content","title","description","actions"];function gp(t,e){t.classList.add(`bu-attachment-${e}`),t.setAttribute("data-slot",`attachment-${e}`)}function Nc(t){let e=t.querySelector("input[type='file']"),o=t.querySelector("[b-attachment-list]"),r=Cc.includes(t.getAttribute("b-att-state"))?t.getAttribute("b-att-state"):"done",i=Lc.includes(t.getAttribute("b-att-size"))?t.getAttribute("b-att-size"):"default",a=t.getAttribute("b-att-orientation")==="vertical"?"vertical":"horizontal";t.classList.add("bu-attachment"),t.classList.add(`bu-attachment-${r}`,`bu-attachment-${i}`,`bu-attachment-${a}`),t.setAttribute("data-state",r),t.setAttribute("data-size",i),t.setAttribute("data-orientation",a),t.setAttribute("data-slot","attachment"),e&&t.classList.add("bu-attachment-picker"),t.querySelectorAll("[b-attachment-media]").forEach(l=>{let u=l.getAttribute("b-att-variant")==="image"?"image":"icon";gp(l,"media"),l.classList.add(`bu-attachment-media-${u}`),l.setAttribute("data-variant",u)}),kc.forEach(l=>t.querySelectorAll(`[b-attachment-${l}]`).forEach(u=>gp(u,l))),t.querySelectorAll("[b-attachment-action]").forEach(l=>{let u=P[l.getAttribute("b-att-variant")]||P.ghost,b=W[l.getAttribute("b-att-size")]||W["icon-xs"];l.classList.add("btn","bu-button",u,b,"bu-button-icon","bu-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("bu-attachment-trigger"),l.setAttribute("data-slot","attachment-trigger"),!l.getAttribute("type")&&l.tagName==="BUTTON"&&l.setAttribute("type","button")}),e?.classList.add("form-control");let p=()=>{o&&(o.innerHTML=[...e.files].map(l=>`<li>${l.name}</li>`).join("")),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{files:[...e.files]}}))};return e?.addEventListener("change",p),{destroy:()=>e?.removeEventListener("change",p)}}function Oc(t){return t.classList.add("bu-attachment-group"),t.setAttribute("data-slot","attachment-group"),{destroy:()=>t.classList.remove("bu-attachment-group")}}function Bc(t){let e=t.querySelector("input[type='file']");t.classList.add("bu-attachment-dropzone"),t.setAttribute("data-slot","attachment-dropzone");let o=()=>e?.click(),r=u=>{u.preventDefault(),t.classList.add("bu-attachment-dropzone-dragging")},i=()=>t.classList.remove("bu-attachment-dropzone-dragging"),a=u=>{u.length&&t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{files:u}}))},p=u=>{u.preventDefault(),t.classList.remove("bu-attachment-dropzone-dragging"),a([...u.dataTransfer?.files??[]])},l=()=>{a([...e?.files??[]]),e&&(e.value="")};return t.addEventListener("click",o),t.addEventListener("dragover",r),t.addEventListener("dragleave",i),t.addEventListener("drop",p),e?.addEventListener("change",l),{destroy:()=>{t.removeEventListener("click",o),t.removeEventListener("dragover",r),t.removeEventListener("dragleave",i),t.removeEventListener("drop",p),e?.removeEventListener("change",l)}}}c.register("attachment",{type:"owl",mount:Nc});c.register("attachment-group",{type:"static",mount:Oc});c.register("attachment-dropzone",{type:"static",mount:Bc});v();function Ic(t){t.classList.add("bu-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{}}c.register("avatar",{type:"static",mount:Ic});v();Ua();function jc(t){let e=oe[t.getAttribute("b-att-variant")||"secondary"]||oe.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(oe))}}c.register("badge",{type:"static",mount:jc});v();ot();function fp(t){return[...t.children].filter(e=>!e.matches("[b-breadcrumb-separator], .bu-breadcrumb-separator"))}function vp(t,e,o){return z(t,e,{size:o}),t}function Rc(){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="bu-breadcrumb-separator",e.className="bu-breadcrumb-separator-icon",t.append(vp(e,"chevron-right","var(--b3_5)")),t}function $c(t){t.classList.add("bu-breadcrumb-separator"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true")}function Tc(t){if(t.classList.add("bu-breadcrumb-ellipsis"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-ellipsis"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),!t.querySelector(".bu-icon")){let e=document.createElement("span");e.className="bu-breadcrumb-ellipsis-icon",t.prepend(vp(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 yp(t){t.classList.add("bu-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 Uc(t){let e=t.querySelector("ol, ul")||t;t.classList.add("bu-breadcrumb"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb"),t.setAttribute("aria-label",t.getAttribute("aria-label")||"breadcrumb"),e.classList.add("breadcrumb","bu-breadcrumb-list"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"breadcrumb-list");for(let r of e.querySelectorAll("[b-breadcrumb-separator], .bu-breadcrumb-separator"))$c(r);for(let r of e.querySelectorAll("[b-breadcrumb-ellipsis], .bu-breadcrumb-ellipsis"))Tc(r);for(let r of e.querySelectorAll("[b-breadcrumb-page], .bu-breadcrumb-page"))yp(r);e.querySelector("[b-breadcrumb-separator], .bu-breadcrumb-separator")||fp(e).slice(0,-1).forEach(i=>i.after(Rc()));let o=fp(e);return o.forEach((r,i)=>{r.classList.add("bu-breadcrumb-item"),r.setAttribute("data-slot",r.getAttribute("data-slot")||"breadcrumb-item");for(let a of r.querySelectorAll("a"))a.classList.add("bu-breadcrumb-link"),a.setAttribute("data-slot",a.getAttribute("data-slot")||"breadcrumb-link");if(i===o.length-1){let a=r.querySelector("[b-breadcrumb-page], .bu-breadcrumb-page");a?yp(a):(r.classList.add("bu-breadcrumb-page"),r.setAttribute("aria-current",r.getAttribute("aria-current")||"page"))}}),{destroy:()=>{t.classList.remove("bu-breadcrumb"),e.classList.remove("breadcrumb","bu-breadcrumb-list");for(let r of e.querySelectorAll("[b-breadcrumb-separator]"))r.remove()}}}c.register("breadcrumb",{type:"owl",mount:Uc});v();function qc(t){return t.classList.add("bu-bubble"),t.getAttribute("role")||t.setAttribute("role","listitem"),{destroy:()=>t.classList.remove("bu-bubble")}}c.register("bubble",{type:"static",mount:qc});v();ot();te();function Mc(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 zc(t){let e=t.getAttribute("b-att-icon"),o=t.getAttribute("b-att-icon-position")==="end"?"end":"start",r=!!t.textContent.trim(),i=e&&r?Mc(t):[],a=null;return t.classList.add("btn","bu-button",P[t.getAttribute("b-att-variant")||"default"]||"btn-primary"),W[t.getAttribute("b-att-size")]&&t.classList.add(W[t.getAttribute("b-att-size")]),t.dataset.slot="button",e&&(a=document.createElement("span"),a.setAttribute("b-icon",e),a.dataset.icon=`inline-${o}`,z(a,e,{label:""}),t.insertBefore(a,o==="end"?null:t.firstChild),t.dataset.icon=`inline-${o}`,r||(t.dataset.iconOnly="true",t.classList.add("bu-button-icon"))),{destroy:()=>{a?.remove();for(let p of i)p.replaceWith(document.createTextNode(p.textContent));t.classList.remove("btn","bu-button","bu-button-icon",...Object.values(P),...Object.values(W)),t.removeAttribute("data-slot"),t.removeAttribute("data-icon"),t.removeAttribute("data-icon-only")}}}c.register("button",{type:"static",mount:zc});v();function Pc(t){let e=t.getAttribute("b-att-orientation")==="vertical",o=t.getAttribute("b-att-size"),r=[...t.querySelectorAll("[b-button-group-separator]")],i=[...t.querySelectorAll("[b-button-group-text]")];return t.classList.add("bu-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 p=a.getAttribute("b-att-orientation")==="horizontal"?"horizontal":"vertical";a.classList.add("bu-button-group-separator",`bu-button-group-separator-${p}`),a.setAttribute("data-orientation",p),a.setAttribute("role","separator")}),i.forEach(a=>{a.classList.add("bu-button-group-text")}),{destroy:()=>{t.classList.remove("bu-button-group","btn-group","btn-group-vertical","btn-group-sm","btn-group-lg")}}}c.register("button-group",{type:"static",mount:Pc});v();var Dc=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"});function Fc(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()),i=new Date(r,o,1),a=new Date(r,o+1,0).getDate(),p=i.getDay();t.classList.add("bu-calendar"),t.querySelector("[b-calendar-grid]")||(t.innerHTML=`
|
|
16
|
-
<div class="bu-calendar__header">${
|
|
17
|
-
<div class="bu-calendar__weekdays">${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(
|
|
10
|
+
var Ua=Object.defineProperty;var Oi=(t,e,s)=>e in t?Ua(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var ct=(t,e,s)=>()=>{if(s)throw s[0];try{return t&&(e=t(t=0)),e}catch(a){throw s=[a],a}};var Ma=(t,e)=>{for(var s in e)Ua(t,s,{get:e[s],enumerable:!0})};var o=(t,e,s)=>Oi(t,typeof e!="symbol"?e+"":e,s);function Ti(t){return typeof t=="string"?document.querySelector(t):t instanceof Element?t:null}function ma(t,e,s={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}function qi(t,e={}){return t.hasAttribute("b-icon")?"icon":e.name||t.getAttribute("b-ui")}function Ui(t,e){return e===document||e===t||e.contains(t)}function Mi(t,e={}){return!e.allowBootstrapControl&&t.matches($i)}function za(t){return d.version=t,d}function Pa(){if(typeof MutationObserver>"u")return;let t=new MutationObserver(e=>{for(let s of e)for(let a of s.addedNodes)a instanceof Element&&d.mountAll(a)});return t.observe(document.documentElement,{childList:!0,subtree:!0}),t}function Fa(){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{d.mountAll(),Pa()},{once:!0}):(d.mountAll(),Pa()))}var Ri,ba,$r,Hr,$i,Pi,d,w=ct(()=>{Ri="__BASEUI_VERSION__",ba=new Map,$r=new WeakMap,Hr="[b-ui], [b-icon]",$i="[data-bs-toggle], [data-bs-target], [data-bs-dismiss]";Pi=typeof window<"u"?window.BaseUI:void 0,d=Pi||{version:Ri,register(t,e){if(!t||!e)throw new Error("BaseUI.register requires a name and component definition.");return ba.set(t,e),this},component(t){return ba.get(t)},mount(t,e={}){let s=Ti(t);if(!s||Mi(s,e))return null;let a=qi(s,e),n=ba.get(a);if(!n)return null;let i=$r.get(s);if(i?.name===a)return i;i&&(i.destroy?.(),$r.delete(s),ma(s,"baseui:destroyed",{name:i.name}));let u=n.mount?.(s,this,e)||{},p={name:a,element:s,destroy:u.destroy};return $r.set(s,p),ma(s,"baseui:mounted",{name:a,instance:p}),p},mountAll(t=document){let e=t||document,s=[...e.querySelectorAll?.(Hr)||[]];return e instanceof Element&&e.matches(Hr)&&s.unshift(e),s.map(a=>this.mount(a)).filter(Boolean)},destroy(t=document){let e=t||document,s=[...e.querySelectorAll?.(Hr)||[]];e instanceof Element&&e.matches(Hr)&&s.unshift(e);for(let a of s){let n=$r.get(a);n&&Ui(a,e)&&(n.destroy?.(),$r.delete(a),ma(a,"baseui:destroyed",{name:n.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,a]of Object.entries(t||{})){let n=s==="radius"||s==="--b-radius"?"--base-radius":s.startsWith("--")?s:`--b-${s}`;e.style.setProperty(n,a)}}}};typeof window<"u"&&(window.BaseUI=d)});function m(...t){let e=[];for(let s of t)if(s){if(typeof s=="string")e.push(s);else if(Array.isArray(s)){let a=m(...s);a&&e.push(a)}else if(typeof s=="object")for(let[a,n]of Object.entries(s))n&&e.push(a)}return e.join(" ")}function r(t){return{type:t,optional:!0}}function H(t,e,s){return t[e]??(s?t[s]:void 0)}function F(t){return t===!0||t==="open"||t==="on"||t==="active"}function G(...t){let e=[];for(let s of t)if(s){if(typeof s=="string"){let a=s.trim().replace(/;$/,"");a&&e.push(a)}else if(typeof s=="object")for(let[a,n]of Object.entries(s)){if(n==null||n==="")continue;let i=a.replace(/[A-Z]/g,u=>"-"+u.toLowerCase());e.push(`${i}:${n}`)}}return e.join(";")}function M(t){return t.state!==void 0?F(t.state):t.open!==void 0?t.open:t["default-open"]!==void 0?t["default-open"]:t.defaultOpen??!1}function kt(t){return t.state!==void 0||t.open!==void 0}var l,f=ct(()=>{l={className:r(String),style:r([String,Object]),slots:r(Object)}});var I,Fi,_a,Di,_i,ji,Hi,Ki,Wi,Tr,Vi,ha,ga,Zi,q,_,Xi,qr,Gi,Yi,Nt,$,K,Ji,Qi,tn,k,en,Y,sn,Be,A,x,on,rn,an,nn,Kr,fa=ct(()=>{I=globalThis.owl;if(!I)throw new Error("BaseUI: load dist/baseui.min.js or dist/baseui.esm.js before this script (globalThis.owl is not set).");Fi=I.App,_a=I.Component,Di=I.EventBus,_i=I.OwlError,ji=I.__info__,Hi=I.batched,Ki=I.blockDom,Wi=I.htmlEscape,Tr=I.loadFile,Vi=I.markRaw,ha=I.markup,ga=I.mount,Zi=I.onError,q=I.onMounted,_=I.onPatched,Xi=I.onRendered,qr=I.onWillDestroy,Gi=I.onWillPatch,Yi=I.onWillRender,Nt=I.onWillStart,$=I.onWillUnmount,K=I.onWillUpdateProps,Ji=I.reactive,Qi=I.status,tn=I.toRaw,k=I.useChildSubEnv,en=I.useComponent,Y=I.useEffect,sn=I.useEnv,Be=I.useExternalListener,A=I.useRef,x=I.useState,on=I.useSubEnv,rn=I.validate,an=I.validateType,nn=I.whenReady,Kr=I.xml});function ja(t){Object.assign(Ur,t)}function cn(t){let e=t.components;e?e!==Ur&&Object.getPrototypeOf(e)===Object.prototype&&Object.setPrototypeOf(e,Ur):t.components=Object.create(Ur)}function Ha(t){return typeof t!="string"||!/\st-(att|attf|model)([.\s=-]|$)/.test(t)?t:t.replace(/<([A-Z][\w.:-]*)(\s[^<>]*?)?(\/?)>/g,(e,s,a="",n="")=>`<${s}${ln(s,a)}${n}>`)}function ln(t,e){let s=/\st-(att|attf|model|on)([.\s=-]|$)/.test(e),a=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,(n,i,u,p,b)=>`${i}${u}=${p}${bn(b)}${p}`);return a=a.replace(/(\s)t-model((?:\.[\w-]+)*)\s*=\s*(["'])(.*?)\3/g,(n,i,u,p,b)=>mn(t,i,u,p,b,a)),s?un(a):a}function un(t){return t.replace(/(\s)([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(e,s,a,n,i)=>a.startsWith("t-")||a==="t-props"||dn(i)?e:`${s}${a}=${n}${pn(i)}${n}`)}function pn(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function dn(t){let e=t.trim();return!e||/^(['"`[{(]|-?\d+(?:\.\d+)?$)/.test(e)||/[?.()[\]+*/]|=>|===|!==|&&|\|\|/.test(e)||/^(true|false|null|undefined)$/.test(e)}function bn(t){return`\`${t.replace(/`/g,"\\`").replace(/{{\s*([\s\S]*?)\s*}}|#\{\s*([\s\S]*?)\s*\}/g,(e,s,a)=>`\${${s||a}}`)}\``}function mn(t,e,s,a,n,i){let u=/^(Checkbox|Switch)$/.test(t),p=hn(t,s),b=u?"checked":"value",h=new RegExp(`\\s${b}\\s*=`).test(i)?"":`${e}${b}=${a}${n}${a}`,g=new RegExp(`\\s${p}\\s*=`).test(i)?"":`${e}${p}=${a}${gn(n,s,u)}${a}`;return`${h}${g}`}function hn(t,e){return e.includes(".lazy")?"onChange":/^(Input|Textarea|InputGroupInput|InputGroupTextarea)$/.test(t)?"onInput":"onChange"}function gn(t,e,s){if(s)return`(value) => { ${t} = value; }`;let a="value";return e.includes(".trim")&&(a=`(typeof ${a} === 'string' ? ${a}.trim() : ${a})`),e.includes(".number")&&(a=`Number.isNaN(Number(${a})) ? ${a} : Number(${a})`),`(value) => { ${t} = ${a}; }`}function Ka(t,...e){return Array.isArray(t?.raw)?Kr({raw:t.raw.map(Ha)},...e):Kr(t,...e)}function Wr(t,e,s={}){let a=Ha(s.templates);return t.components={...Ur,...t.components||{}},ga(t,e,a===s.templates?s:{...s,templates:a})}async function Eu(t){let e=await(await fetch(t,{cache:"reload"})).text(),a=new DOMParser().parseFromString(e,"application/xml").querySelector("templates > t[t-name]");return a?a.innerHTML:e}var Su,Au,Ur,c,v=ct(()=>{fa();fa();Su=ga,Au=Kr,Ur={};c=class extends _a{constructor(...e){super(...e),cn(this.constructor)}}});function yn(t){return typeof Image>"u"?Promise.resolve(!0):(va.has(t)||va.set(t,new Promise(e=>{let s=new Image;s.onload=()=>e(!0),s.onerror=()=>e(!1),s.src=t})),va.get(t))}function Vr(t){return String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Mr(t,e={}){let s=Vr(t);if(!vn.test(s))throw new Error(`BaseUI icon name is invalid: ${t}`);return`${String(e.baseUrl||d.icons.lucide.cdnBaseUrl).replace(/\/+$/,"")}/${s}.svg`}function P(t,e,s={}){let a=s.url||Mr(e,s),n=s.label??t.getAttribute("aria-label")??"";t.classList.add("bu-icon"),t.style.setProperty("--b-icon-url",`url("${a.replace(/"/g,"%22")}")`),(s.size||t.getAttribute("b-att-size"))&&t.style.setProperty("--b-icon-size",s.size||t.getAttribute("b-att-size")),n?(t.setAttribute("role","img"),t.setAttribute("aria-label",n)):t.setAttribute("aria-hidden","true");let i=s.fallback===!1?null:s.fallback||Zr;return i&&!s.url&&Vr(e)!==Vr(i)&&yn(a).then(u=>{if(u||!t.isConnected)return;let p=Mr(i,s);t.style.setProperty("--b-icon-url",`url("${p.replace(/"/g,"%22")}")`)}),t}var Wa,fn,Zr,vn,va,tt=ct(()=>{w();Wa="1.31.0",fn=`https://cdn.jsdelivr.net/npm/lucide-static@${Wa}/icons`,Zr="file",vn=/^[a-z0-9][a-z0-9-]*$/,va=new Map;d.icons={...d.icons||{},lucide:{version:Wa,cdnBaseUrl:fn,normalizeName:Vr,url:Mr,render:P}}});var j,W,Ie=ct(()=>{j={default:"btn-primary",secondary:"btn-secondary",destructive:"btn-danger",outline:"btn-outline-secondary",ghost:"btn-light",link:"btn-link"},W={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 Xr({variant:t="default",size:e,className:s}={}){return m("btn","bu-button","bu-clipboard-button",j[t]||j.default,W[e],s)}async function Oe(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("BaseUI 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 a;try{a=document.execCommand("copy")}catch{a=!1}if(s.remove(),!a)throw new Error("BaseUI ClipboardButton: clipboard copy is unavailable in this browser/context.")}var ya,Gr=ct(()=>{f();Ie();ya=["btn","bu-button","bu-clipboard-button",...Object.values(j),...Object.values(W)]});var di={};Ma(di,{destroyBaseUiPreviews:()=>Sr,enhanceMarkdownDiagrams:()=>Fr,expandSelfClosingTags:()=>rc,extractTagCaseMap:()=>jn,mountMarkdownEditor:()=>Dr,normalizeOwlPreviewMarkup:()=>ic,parseMarkdown:()=>zr,primeBaseUiTemplates:()=>nc,renderBaseUiBlocks:()=>pi,renderMermaidBlocks:()=>li});function Pn(){return Ea??(Ea=import("./runtime/marked/marked.min.js").then(t=>{let e=t.marked||t.default?.marked||globalThis.marked;if(!e?.parse)throw new Error("BaseUI markdown: failed to load src/runtime/marked/marked.min.js");return e})),Ea}function zn(){return Ca??(Ca=import("./runtime/mermaid/mermaid.esm.min.mjs").then(t=>{let e=t.default||t;return e.initialize({startOnLoad:!1,securityLevel:"strict"}),e})),Ca}function Fn(){return La??(La=import("./runtime/milkdown/milkdown-editor.js")),La}async function zr(t,e={}){return(await Pn()).parse(String(t??""),{gfm:!0,breaks:!1,...e})}function Na(t,e,s,a=""){t.classList.add("bu-markdown-diagram-error"),t.replaceChildren();let n=document.createElement("p");if(n.className="bu-markdown-diagram-error-message",n.textContent=`Unable to render ${e} diagram: ${s?.message||s}`,t.append(n),a){let i=document.createElement("pre"),u=document.createElement("code");u.textContent=a,i.append(u),t.append(i)}}async function li(t){let e=[...t.querySelectorAll("pre > code.language-mermaid")];if(!e.length)return;let s;try{s=await zn()}catch(a){e.forEach(n=>{let i=n.closest("pre");i.replaceChildren(),i.className="bu-markdown-diagram bu-markdown-mermaid",Na(i,"mermaid",a,n.textContent)});return}for(let a of e){let n=a.textContent,i=a.closest("pre");i.replaceChildren(),i.className="bu-markdown-diagram bu-markdown-mermaid";try{let{svg:u}=await s.render(`bu-mermaid-${++Mn}`,n);i.innerHTML=u}catch(u){Na(i,"mermaid",u,n)}}}function Dn(t){let e=globalThis.BaseUI;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="bu-markdown-bu-copy-toast",s.textContent=t,document.body.append(s),e.mountAll(s),s.addEventListener("baseui:close",()=>s.remove(),{once:!0})}function _n(t){let e=document.createElement("div");e.className="bu-markdown-bu-code";let s=document.createElement("button");s.type="button",s.className="bu-markdown-bu-copy";let a=document.createElement("span");P(a,"copy",{label:"Copy code"}),s.append(a),s.addEventListener("click",async()=>{try{await Oe(t),s.dispatchEvent(new CustomEvent("baseui:markdown-copy",{bubbles:!0,detail:{source:t}})),Dn("Copied to clipboard")}catch(u){s.dispatchEvent(new CustomEvent("baseui:markdown-copy-error",{bubbles:!0,detail:{error:u}}))}}),e.append(s);let n=document.createElement("pre"),i=document.createElement("code");i.className="bu-markdown-bu-code-lines";for(let u of t.replace(/\n$/,"").split(`
|
|
11
|
+
`)){let p=document.createElement("span");p.className="bu-markdown-bu-code-line",p.textContent=u,i.append(p)}return n.append(i),e.append(n),e}function ai(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function jn(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 Hn(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=globalThis.BaseUI,a=t.get(e.localName)||e.localName,n=ai(a),i=!!s?.component?.(n),u=U(e.getAttribute("className")||e.getAttribute("class"));if(!i){let p=`bu-${n}`;return e.className=u?`${p} ${u}`:p,e}e.setAttribute("b-ui",n),u&&(e.className=u);for(let p of[...e.attributes]){if(p.name==="class"||p.name==="className"||p.name==="b-ui"||/^on[A-Z]/.test(p.name))continue;let b=U(p.value);e.removeAttribute(p.name),!(b===""||b==="false")&&e.setAttribute(`b-att-${ai(p.name)}`,b==="true"?"true":b)}return e}}function U(t){if(!t)return"";let e=t.trim();return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function aa(t,e){for(;t.firstChild;)e.append(t.firstChild)}function Q(t,e){return aa(t,e),t.replaceWith(e),e}function Kn(t){let e=document.createElement("div");e.setAttribute("b-field-group","");let s=U(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Q(t,e)}function Wn(t){let e=document.createElement("div");e.setAttribute("b-ui","field");let s=U(t.getAttribute("orientation")||""),a=U(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-orientation",s),a&&(e.className=a),Q(t,e)}function Vn(t){let e=document.createElement("label");e.setAttribute("b-field-label","");let s=U(t.getAttribute("for")||""),a=U(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("for",s),a&&(e.className=a),Q(t,e)}function ii(t,e,s){let a=document.createElement(e);a.setAttribute(s,"");let n=U(t.getAttribute("className")||t.getAttribute("class"));return n&&(a.className=n),Q(t,a)}function Zn(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 a=document.createElement("button");a.setAttribute("b-ui","button");let n=U(e||"button"),i=U(t.getAttribute("variant")||""),u=U(t.getAttribute("size")||""),p=U(t.getAttribute("className")||t.getAttribute("class")),b=U(t.getAttribute("label")||"");return a.type=n||"button",i&&a.setAttribute("b-att-variant",i),u&&a.setAttribute("b-att-size",u),p&&(a.className=p),b&&!t.childNodes.length&&(a.textContent=b),Q(t,a)}function Xn(t){if(t.hasAttribute("b-ui")||t.hasAttribute("b-icon"))return t;let e=U(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 a=U(t.getAttribute("size")||""),n=U(t.getAttribute("label")||""),i=U(t.getAttribute("className")||t.getAttribute("class"));return a&&s.setAttribute("b-att-size",a),n&&s.setAttribute("b-att-label",n),i&&(s.className=i),Q(t,s)}function Gn(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","alert");let s=U(t.getAttribute("variant")||""),a=U(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-variant",s),a&&(e.className=a),Q(t,e)}function ka(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=document.createElement("div"),a=U(e.getAttribute("className")||e.getAttribute("class"));return s.className=a?`${t} ${a}`:t,Q(e,s)}}function Yn(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","accordion"),U(t.getAttribute("multiple"))==="true"&&e.setAttribute("b-att-multiple","true");let s=U(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Q(t,e)}function Jn(t){if(t.hasAttribute("b-accordion-item"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-item",""),U(t.getAttribute("state"))==="open"&&e.setAttribute("b-att-state","open");let s=U(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Q(t,e)}function Qn(t){if(t.hasAttribute("b-accordion-trigger"))return t;let e=document.createElement("button");e.type="button",e.setAttribute("b-accordion-trigger","");let s=U(t.getAttribute("className")||t.getAttribute("class"));s&&(e.className=s),aa(t,e);let a=document.createElement("span");return a.setAttribute("b-icon","chevron-down"),a.className="bu-accordion-trigger-icon",e.append(a),t.replaceWith(e),e}function tc(t){if(t.hasAttribute("b-accordion-panel"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-panel","");let s=U(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Q(t,e)}function ec(t){return ni+=1,`${t}-${ni}`}function J(t,e,s){return a=>{if(a.hasAttribute("b-ui"))return a;let n=document.createElement(t);t==="button"&&(n.type="button"),s&&n.setAttribute(s,"");let i=U(a.getAttribute("className")||a.getAttribute("class"));return n.className=i?`${e} ${i}`:e,Q(a,n)}}function sc(){let t=document.createElement("button");t.type="button",t.className="btn bu-button btn-light btn-icon-sm bu-dialog-close bu-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 ci({tagPrefix:t,componentName:e,triggerTag:s,triggerClassName:a,panelClassName:n,closeButton:i}){return u=>{if(u.hasAttribute("b-ui"))return u;let p=u.querySelector(`:scope > ${t}trigger`),b=u.querySelector(`:scope > ${t}content`);if(!b)return u;let h=ec(`bu-preview-${e}`),g=document.createElement(s);s==="button"&&(g.type="button"),g.className=a,g.setAttribute("b-att-trigger",`#${h}`),p&&aa(p,g);let S=document.createElement("div");S.setAttribute("b-ui",e),S.id=h,S.setAttribute("b-att-trigger",`[b-att-trigger='#${h}']`);let E=document.createElement("div");E.className=n;let N=U(b.getAttribute("size")||"");return N&&E.setAttribute("data-size",N),aa(b,E),i&&E.append(i()),S.append(E),u.before(g,S),u.remove(),S}}function rc(t){return t.replace(/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,(e,s,a)=>oc.has(s.toLowerCase())?e:`<${s}${a}></${s}>`)}function ac(t){t.querySelectorAll("t[t-esc]").forEach(e=>{let a=e.getAttribute("t-esc")?.includes(".length")?"0":"";e.replaceWith(document.createTextNode(`${a}${e.textContent||""}`))})}function ic(t,e){ac(t);let s={fieldgroup:Kn,field:Wn,fieldlabel:Vn,fielddescription:n=>ii(n,"p","b-field-description"),fielderror:n=>ii(n,"p","b-field-error"),button:Zn,icon:Xn,alert:Gn,alerttitle:ka("bu-alert-title"),alertdescription:ka("bu-alert-description"),alertaction:ka("bu-alert-action"),accordion:Yn,accordionitem:Jn,accordiontrigger:Qn,accordioncontent:tc,dialog:ci({tagPrefix:"dialog",componentName:"dialog",triggerTag:"span",triggerClassName:"bu-dialog-trigger",panelClassName:"bu-dialog-panel",closeButton:sc}),dialogheader:J("div","bu-dialog-header"),dialogfooter:J("div","bu-dialog-footer"),dialogtitle:J("h2","bu-dialog-title"),dialogdescription:J("p","bu-dialog-description"),dialogclose:J("button","btn bu-button btn-outline-secondary bu-dialog-close","b-dialog-close"),alertdialog:ci({tagPrefix:"alertdialog",componentName:"alert-dialog",triggerTag:"button",triggerClassName:"btn bu-button btn-outline-secondary bu-alert-dialog-trigger",panelClassName:"bu-dialog-panel bu-alert-dialog-panel"}),alertdialogheader:J("div","bu-dialog-header bu-alert-dialog-header"),alertdialogfooter:J("div","bu-dialog-footer bu-alert-dialog-footer"),alertdialogmedia:J("div","bu-alert-dialog-media"),alertdialogtitle:J("h2","bu-dialog-title bu-alert-dialog-title"),alertdialogdescription:J("p","bu-dialog-description bu-alert-dialog-description"),alertdialogcancel:J("button","btn bu-button btn-outline-secondary bu-alert-dialog-cancel","b-alert-dialog-cancel"),alertdialogaction:J("button","btn bu-button btn-primary bu-alert-dialog-action","b-alert-dialog-action")},a=Hn(e);for(let n of[...t.querySelectorAll("*")]){let i=n.localName.toLowerCase();s[i]?s[i](n):e.has(i)&&a(n)}}function nc(t){ra=Promise.resolve(t)}function cc(){return ra??(ra=Tr("/dist/baseui.templates.xml")),ra}function Sr(t){let e=Ba.get(t);if(e){Ba.delete(t);for(let s of e)try{s.destroy()}catch{}}}function uc(t){return new Set([...t.matchAll(lc)].map(e=>e[1]))}function bc(t){let e=new Set;for(let s of t.matchAll(pc))e.add(s[1]);for(let s of t.matchAll(dc))e.add(s[2]);return e}function mc(t){let e=Ka({raw:[t]}),s=uc(t);class a extends c{setup(){this.state=x(Object.fromEntries([...s].map(i=>[i,""])))}}o(a,"template",e);for(let n of bc(t))a.prototype[n]=function(){};return a}function ui(t){t.querySelector("[data-slot='dropdown-menu'], .bu-dropdown-menu, [b-ui='dropdown-menu'], [b-dropdown-menu]")&&t.classList.add("bu-markdown-bu-preview-overlay")}async function hc(t,e){let[s,a]=await Promise.all([cc(),mc(e)]),n=await Wr(a,t,{templates:s});return ui(t),n}function gc(t,e){let s=globalThis.BaseUI;if(!s?.mountAll)throw new Error("BaseUI runtime not found on the page \u2014 load dist/baseui.min.js before mounting Markdown.");t.innerHTML=e,ui(t),s.mountAll(t)}async function pi(t){Sr(t);let e=[...t.querySelectorAll("pre > code.language-base-ui")];if(!e.length)return;let s=new Set;for(let a of e){let n=a.textContent,i=a.closest("pre");i.replaceChildren(),i.className="bu-markdown-live bu-markdown-baseui";let u=document.createElement("div");u.className="bu-markdown-bu-preview",i.append(u,_n(n));try{/<[A-Z]/.test(n)?s.add(await hc(u,n)):gc(u,n)}catch(p){Na(i,"BaseUI component",p,n)}}s.size&&Ba.set(t,s)}async function Fr(t,{mermaid:e=!0,baseUi:s=!0}={}){e&&await li(t),s&&await pi(t)}async function Dr(t){return(await Fn()).createMilkdownMarkdownEditor(t)}var Ea,Ca,La,Mn,ni,oc,ra,Ba,lc,pc,dc,ia=ct(()=>{v();tt();Gr();Mn=0;ni=0;oc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);Ba=new WeakMap;lc=/\bstate\.([A-Za-z_$][\w$]*)/g;pc=/\bthis\.([A-Za-z_$][\w$]*)\s*\(/g,dc=/\bt-on-[\w:-]+\s*=\s*(["'])([A-Za-z_$][\w$]*)\1/g});w();f();var Da="1.0.0";v();var Ra={};Ma(Ra,{Accordion:()=>co,AccordionContent:()=>uo,AccordionItem:()=>lo,AccordionTrigger:()=>Gt,Alert:()=>Tt,AlertAction:()=>Ye,AlertDescription:()=>Ge,AlertDialog:()=>Ns,AlertDialogAction:()=>_t,AlertDialogCancel:()=>Dt,AlertDialogContent:()=>Bs,AlertDialogDescription:()=>Ts,AlertDialogFooter:()=>Os,AlertDialogHeader:()=>Is,AlertDialogMedia:()=>Rs,AlertDialogTitle:()=>$s,AlertDialogTrigger:()=>Ft,AlertTitle:()=>Xe,AspectRatio:()=>nr,Attachment:()=>Vo,AttachmentAction:()=>fe,AttachmentActions:()=>Jo,AttachmentContent:()=>Xo,AttachmentDescription:()=>Yo,AttachmentDropzone:()=>tr,AttachmentGroup:()=>Qo,AttachmentMedia:()=>Zo,AttachmentTitle:()=>Go,AttachmentTrigger:()=>ve,Avatar:()=>er,Badge:()=>lt,BlockViewer:()=>Ce,Breadcrumb:()=>mo,BreadcrumbEllipsis:()=>Qt,BreadcrumbItem:()=>go,BreadcrumbLink:()=>fo,BreadcrumbList:()=>ho,BreadcrumbPage:()=>vo,BreadcrumbSeparator:()=>Jt,Bubble:()=>cr,Button:()=>y,ButtonGroup:()=>pr,ButtonGroupSeparator:()=>dr,ButtonGroupText:()=>br,Calendar:()=>me,Card:()=>Re,CardBody:()=>Te,CardDescription:()=>Me,CardFooter:()=>qe,CardHeader:()=>$e,CardTitle:()=>Ue,Carousel:()=>jo,CarouselNext:()=>ge,CarouselPrevious:()=>he,CarouselSlide:()=>Ho,Chart:()=>_o,Checkbox:()=>ps,ClipboardButton:()=>Bt,Collapsible:()=>po,CollapsibleContent:()=>bo,CollapsibleTrigger:()=>Yt,Combobox:()=>Fo,Command:()=>Do,ContextMenu:()=>ro,ContextMenuContent:()=>io,ContextMenuItem:()=>no,ContextMenuTrigger:()=>ao,DataTable:()=>be,DatePicker:()=>zo,Dialog:()=>je,DialogClose:()=>$t,DialogContent:()=>Rt,DialogDescription:()=>Ze,DialogFooter:()=>We,DialogHeader:()=>Ke,DialogTitle:()=>Ve,DialogTrigger:()=>He,Direction:()=>lr,Drawer:()=>qs,DrawerClose:()=>Ht,DrawerContent:()=>Us,DrawerDescription:()=>Fs,DrawerFooter:()=>Ps,DrawerHeader:()=>Ms,DrawerTitle:()=>zs,DrawerTrigger:()=>jt,DropdownMenu:()=>pt,DropdownMenuCheckboxItem:()=>Zt,DropdownMenuContent:()=>dt,DropdownMenuGroup:()=>Qs,DropdownMenuItem:()=>bt,DropdownMenuLabel:()=>to,DropdownMenuRadioGroup:()=>eo,DropdownMenuRadioItem:()=>Xt,DropdownMenuSeparator:()=>so,DropdownMenuShortcut:()=>oo,DropdownMenuSub:()=>mt,DropdownMenuSubContent:()=>ht,DropdownMenuSubTrigger:()=>st,DropdownMenuTrigger:()=>et,Empty:()=>Je,EmptyContent:()=>os,EmptyDescription:()=>ss,EmptyHeader:()=>Qe,EmptyMedia:()=>ts,EmptyTitle:()=>es,Field:()=>wt,FieldContent:()=>gr,FieldDescription:()=>At,FieldError:()=>Et,FieldGroup:()=>xt,FieldLabel:()=>St,FieldLegend:()=>hr,FieldSeparator:()=>vr,FieldSet:()=>mr,FieldTitle:()=>fr,Form:()=>Ne,HoverCard:()=>Xs,HoverCardContent:()=>Ys,HoverCardTrigger:()=>Gs,Icon:()=>T,Input:()=>Pe,InputGroup:()=>gs,InputGroupAddon:()=>fs,InputGroupButton:()=>Pt,InputGroupInput:()=>ys,InputGroupText:()=>vs,InputGroupTextarea:()=>xs,InputOtp:()=>ws,Item:()=>ur,Kbd:()=>ns,Label:()=>yr,Markdown:()=>Ae,MarkdownTree:()=>Ee,MarkdownTreeNode:()=>_r,Marker:()=>cs,Menubar:()=>Ao,Message:()=>sr,MessageScroller:()=>or,NativeSelect:()=>us,NavigationMenu:()=>wo,NavigationMenuItem:()=>So,Pagination:()=>yo,PaginationItem:()=>xo,Popover:()=>Vs,PopoverContent:()=>Zs,PopoverTrigger:()=>Vt,Progress:()=>ir,Pwa:()=>Er,PwaBody:()=>Br,PwaClose:()=>ke,PwaContent:()=>Cr,PwaDescription:()=>Nr,PwaFooter:()=>Or,PwaHeader:()=>Lr,PwaSteps:()=>Ir,PwaTitle:()=>kr,PwaTrigger:()=>Le,Questionnaire:()=>rr,QuestionnaireNext:()=>xe,QuestionnairePrevious:()=>ye,QuestionnaireStep:()=>ar,RadioGroup:()=>ds,RadioGroupItem:()=>bs,Resizable:()=>Ko,ScrollArea:()=>Wo,Select:()=>As,SelectContent:()=>Es,SelectItem:()=>Cs,SelectTrigger:()=>zt,Separator:()=>rs,Sheet:()=>Ds,SheetClose:()=>Wt,SheetContent:()=>_s,SheetDescription:()=>Ws,SheetFooter:()=>Hs,SheetHeader:()=>js,SheetTitle:()=>Ks,SheetTrigger:()=>Kt,Shell:()=>ne,ShellContent:()=>le,ShellHeader:()=>Mo,ShellMain:()=>Uo,ShellNav:()=>qo,ShellSidebar:()=>ce,ShellSidebarHeader:()=>To,ShellUserMenu:()=>ue,Sidebar:()=>at,SidebarClose:()=>se,SidebarContent:()=>gt,SidebarFooter:()=>Co,SidebarGroup:()=>ft,SidebarGroupAction:()=>oe,SidebarGroupCollapsible:()=>re,SidebarGroupContent:()=>Bo,SidebarGroupLabel:()=>vt,SidebarHeader:()=>Eo,SidebarInput:()=>ko,SidebarInset:()=>Lo,SidebarMenu:()=>it,SidebarMenuAction:()=>ae,SidebarMenuBadge:()=>Oo,SidebarMenuButton:()=>rt,SidebarMenuItem:()=>yt,SidebarMenuSkeleton:()=>Ro,SidebarMenuSub:()=>Io,SidebarMenuSubButton:()=>ie,SidebarMenuSubItem:()=>$o,SidebarProvider:()=>Pr,SidebarRail:()=>ee,SidebarSeparator:()=>No,SidebarTrigger:()=>te,Skeleton:()=>ut,Slider:()=>hs,Spinner:()=>as,Switch:()=>ms,TabContent:()=>_e,TabTrigger:()=>Ot,Table:()=>Po,Tabs:()=>ze,TabsContainer:()=>Fe,TabsList:()=>De,TextEditor:()=>Rr,Textarea:()=>ls,ThemeButton:()=>nt,Toast:()=>ot,Toggle:()=>we,ToggleGroup:()=>wr,ToggleGroupItem:()=>Se,Tooltip:()=>Js,Typography:()=>is,createNamedIcon:()=>Va,findMarkdownTreeNode:()=>Ia,iconComponentName:()=>ei});v();f();v();tt();f();var T=class extends c{setup(){this.state=x({failed:!1}),Y(e=>{if(this.state.failed=!1,typeof Image>"u"||!e||e===Zr)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 Mr(e,{baseUrl:H(this.props,"base-url","baseUrl")})}get name(){return H(this.props,"icon","name")}get url(){return this.buildUrl(this.state.failed?Zr: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}`),G(e.join(";"),this.props.style)}get classNames(){return m("bu-icon",this.props.className)}};o(T,"template","baseui.Icon"),o(T,"props",{icon:r(String),name:r(String),label:r(String),title:r(String),size:r(String),"base-url":r(String),baseUrl:r(String),className:r(String),style:r([String,Object])});function Va(t){return class extends T{get name(){return H(this.props,"icon","name")||t}}}Ie();var y=class extends c{setup(){this.rootRef=A("root"),this.props.getRef&&(q(()=>this.props.getRef(this.rootRef.el)),$(()=>this.props.getRef(null)))}get classNames(){return this.props.unstyled?m(this.props.className):m("btn","bu-button",j[this.props.variant]||j.default,W[this.props.size],this.isIconOnly&&"bu-button-icon",this.props.className)}get iconPosition(){return H(this.props,"icon-position","iconPosition")==="end"?"end":"start"}get ariaLabel(){return H(this.props,"aria-label","ariaLabel")}get ariaPressed(){return H(this.props,"aria-pressed","ariaPressed")}get ariaInvalid(){let e=H(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)}};o(y,"template","baseui.Button"),o(y,"components",{Icon:T}),o(y,"props",{variant:r(String),size:r(String),type:r(String),href:r(String),disabled:r(Boolean),label:r(String),icon:r(String),"icon-position":r(String),iconPosition:r(String),unstyled:r(Boolean),attrs:r(Object),getRef:r(Function),...l,id:r(String),title:r(String),"aria-label":r(String),ariaLabel:r(String),"aria-pressed":r(String),ariaPressed:r(String),"aria-invalid":r([String,Boolean]),ariaInvalid:r([String,Boolean]),onClick:r(Function)});v();f();Gr();var Bt=class extends c{setup(){this.state=x({copied:!1}),this.resetTimer=null,$(()=>window.clearTimeout(this.resetTimer))}get classNames(){return Xr(this.props)}get resetDelay(){return H(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 H(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 Oe(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(a){this.props.onCopyError?.({error:a,event:e})}}};o(Bt,"template","baseui.ClipboardButton"),o(Bt,"components",{Button:y}),o(Bt,"props",{variant:r(String),size:r(String),value:r(String),getValue:r(Function),label:r(String),copiedLabel:r(String),icon:r(String),copiedIcon:r(String),"reset-delay":r(Number),resetDelay:r(Number),disabled:r(Boolean),...l,"aria-label":r(String),ariaLabel:r(String),onCopy:r(Function),onCopyError:r(Function)});v();f();var It={primary:"bu-badge-primary",secondary:"bu-badge-secondary",success:"bu-badge-success",warning:"bu-badge-warning",danger:"bu-badge-danger",info:"bu-badge-info",muted:"bu-badge-muted"};var lt=class extends c{get classNames(){return m("badge",It[this.props.variant]||It.secondary,this.props.pill&&"rounded-pill",this.props.className)}};o(lt,"template","baseui.Badge"),o(lt,"props",{variant:r(String),pill:r(Boolean),label:r(String),...l});v();f();var Re=class extends c{get tag(){return this.props.tag||"div"}};o(Re,"template","baseui.Card"),o(Re,"props",{...l,tag:r(String)});var $e=class extends c{};o($e,"template","baseui.CardHeader"),o($e,"props",l);var Te=class extends c{};o(Te,"template","baseui.CardBody"),o(Te,"props",l);var qe=class extends c{};o(qe,"template","baseui.CardFooter"),o(qe,"props",l);var Ue=class extends c{};o(Ue,"template","baseui.CardTitle"),o(Ue,"props",l);var Me=class extends c{};o(Me,"template","baseui.CardDescription"),o(Me,"props",l);v();f();function Yr({tag:t="input",type:e}={}){return t==="select"?"form-select":e==="checkbox"||e==="radio"?"form-check-input":"form-control"}var Pe=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return m("bu-input",Yr({tag:"input",type:this.props.type}),this.props.invalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};o(Pe,"template","baseui.Input"),o(Pe,"props",{value:r(String),placeholder:r(String),type:r(String),disabled:r(Boolean),readonly:r(Boolean),invalid:r(Boolean),className:r(String),style:r([String,Object]),id:r(String),list:r(String),autocomplete:r(String),"aria-label":r(String),ariaLabel:r(String),min:r([String,Number]),max:r([String,Number]),step:r([String,Number]),onInput:r(Function),onChange:r(Function)});v();function L(){let t=globalThis.bootstrap;if(!t)throw new Error("BaseUI: load dist/bootstrap.bundle.min.js before this script (globalThis.bootstrap is not set).");return t}f();var xa={default:"bu-tabs-list-default",line:"bu-tabs-list-line"};function Jr(t,e,s,a="horizontal"){let n=a==="vertical",p=t===(n?"ArrowDown":"ArrowRight")?1:t===(n?"ArrowUp":"ArrowLeft")?-1:0;return!p||s===0?-1:(e+p+s)%s}var xn=0;function Za(t){return String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}var ze=class extends c{setup(){this.tabsState=x({active:this.props.value??this.props.defaultValue??""}),this.instanceId=`t${++xn}`,k({tabs:this.tabsState,selectTab:e=>this.select(e),tabsId:this.instanceId,orientation:this.orientation}),K(e=>{e.value!==void 0&&(this.tabsState.active=e.value)})}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return m("bu-tabs",this.props.className)}select(e){this.props.value===void 0&&(this.tabsState.active=e),this.props.onChange?.(e)}};o(ze,"template","baseui.Tabs"),o(ze,"props",{value:r(String),defaultValue:r(String),orientation:r(String),onChange:r(Function),...l});var Fe=class extends c{};o(Fe,"template","baseui.TabsContainer"),o(Fe,"props",{...l});var De=class extends c{setup(){this.listRef=A("list")}get classNames(){return m("bu-tabs-list",xa[this.props.variant]||xa.default,this.props.className)}onKeyDown(e){let s=[...this.listRef.el.querySelectorAll("[role='tab']")],a=s.indexOf(e.target),n=Jr(e.key,a,s.length,this.env.orientation);n!==-1&&(e.preventDefault(),s[n].focus(),s[n].click())}};o(De,"template","baseui.TabsList"),o(De,"props",{variant:r(String),...l});var Ot=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=L().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`bu-tabs-panel-${this.env.tabsId}-${Za(this.props.value)}`}get classNames(){return m("bu-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()}};o(Ot,"template","baseui.TabTrigger"),o(Ot,"components",{Button:y}),o(Ot,"props",{value:{type:String},disabled:r(Boolean),...l});var _e=class extends c{setup(){this.initialActive=this.isActive}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`bu-tabs-panel-${this.env.tabsId}-${Za(this.props.value)}`}};o(_e,"template","baseui.TabContent"),o(_e,"props",{value:{type:String},...l});v();f();v();f();function V(t,e){K(s=>{kt(s)&&(t.open=M(s),t.open?e?.instance?.show():e?.instance?.hide())})}function Z(t,e,s){kt(t)||(e.open=s),t.onOpenChange?.(s)}function Qr(t,e){let s=null;q(()=>{s=new(L()).Collapse(t.el,{toggle:!1})}),_(()=>{if(!s)return;let a=t.el.classList.contains("show");e()&&!a?s.show():!e()&&a&&s.hide()}),$(()=>s?.dispose())}var je=class extends c{setup(){this.dialogState=x({open:M(this.props)}),this.control={instance:null},k({dialog:this.dialogState,dialogControl:this.control,setDialogOpen:e=>this.setOpen(e)}),V(this.dialogState,this.control)}setOpen(e){Z(this.props,this.dialogState,e)}};o(je,"template","baseui.Dialog"),o(je,"props",{open:r(Boolean),state:r(String),"default-open":r(Boolean),defaultOpen:r(Boolean),onOpenChange:r(Function),style:r([String,Object]),slots:r(Object)});var He=class extends c{onClick(){this.env.dialogControl.instance?.show()}};o(He,"template","baseui.DialogTrigger"),o(He,"props",l);var Rt=class extends c{setup(){this.rootRef=A("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},q(()=>{this.env.dialogControl.instance=L().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()}),$(()=>{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}};o(Rt,"template","baseui.DialogContent"),o(Rt,"components",{Button:y}),o(Rt,"props",{...l,showCloseButton:r(Boolean),"show-close-button":r(Boolean)});var Ke=class extends c{};o(Ke,"template","baseui.DialogHeader"),o(Ke,"props",l);var We=class extends c{};o(We,"template","baseui.DialogFooter"),o(We,"props",l);var Ve=class extends c{};o(Ve,"template","baseui.DialogTitle"),o(Ve,"props",l);var Ze=class extends c{};o(Ze,"template","baseui.DialogDescription"),o(Ze,"props",l);var $t=class extends c{};o($t,"template","baseui.DialogClose"),o($t,"components",{Button:y}),o($t,"props",l);v();f();var Xa={default:"bu-alert-default",destructive:"bu-alert-destructive",info:"bu-alert-default",success:"alert-success",warning:"alert-warning",danger:"bu-alert-destructive"},Tt=class extends c{setup(){this.rootRef=A("root"),this.bootstrapAlert=null,this.props.dismissible&&(q(()=>{this.bootstrapAlert=new(L()).Alert(this.rootRef.el)}),$(()=>{this.bootstrapAlert?.dispose()}))}get classNames(){return m("alert","bu-alert",Xa[this.props.variant]||Xa.default,this.props.dismissible&&"alert-dismissible",this.props.dismissible&&"fade",this.props.dismissible&&"show",this.props.className)}};o(Tt,"template","baseui.Alert"),o(Tt,"components",{Button:y}),o(Tt,"props",{variant:r(String),dismissible:r(Boolean),...l});var Xe=class extends c{};o(Xe,"template","baseui.AlertTitle"),o(Xe,"props",l);var Ge=class extends c{};o(Ge,"template","baseui.AlertDescription"),o(Ge,"props",l);var Ye=class extends c{};o(Ye,"template","baseui.AlertAction"),o(Ye,"props",l);v();f();var Ga={default:"bu-empty-default",outline:"bu-empty-outline",background:"bu-empty-background"},wn={default:"bu-empty-media-default",icon:"bu-empty-media-icon"},Je=class extends c{get classNames(){return m("bu-empty",Ga[this.props.variant]||Ga.default,this.props.className)}};o(Je,"template","baseui.Empty"),o(Je,"props",{variant:r(String),...l});var Qe=class extends c{};o(Qe,"template","baseui.EmptyHeader"),o(Qe,"props",l);var ts=class extends c{get variant(){return this.props.variant==="icon"?"icon":"default"}get classNames(){return m("bu-empty-media",wn[this.variant],this.props.className)}};o(ts,"template","baseui.EmptyMedia"),o(ts,"props",{variant:r(String),...l});var es=class extends c{};o(es,"template","baseui.EmptyTitle"),o(es,"props",l);var ss=class extends c{};o(ss,"template","baseui.EmptyDescription"),o(ss,"props",l);var os=class extends c{};o(os,"template","baseui.EmptyContent"),o(os,"props",l);v();f();var rs=class extends c{get vertical(){return this.props.orientation==="vertical"}get classNames(){return m("bu-separator",this.vertical?"bu-separator-vertical":"bu-separator-horizontal",this.props.className)}};o(rs,"template","baseui.Separator"),o(rs,"props",{orientation:r(String),className:r(String),style:r([String,Object])});v();f();var ut=class extends c{get classNames(){return m("bu-skeleton",this.props.shape==="circle"?"bu-skeleton-circle":"bu-skeleton-block",this.props.className)}};o(ut,"template","baseui.Skeleton"),o(ut,"props",{shape:r(String),className:r(String),style:r([String,Object])});v();f();var as=class extends c{get classNames(){return m("bu-spinner",this.props.type==="grow"?"spinner-grow":"spinner-border",this.props.className)}get label(){return this.props.label||"Loading"}};o(as,"template","baseui.Spinner"),o(as,"props",{type:r(String),label:r(String),className:r(String),style:r([String,Object])});v();f();var Sn={lead:"lead",muted:"text-body-secondary",code:"bu-code",kbd:"bu-kbd"},is=class extends c{get classNames(){return m("bu-typography",Sn[this.props.variant],this.props.className)}};o(is,"template","baseui.Typography"),o(is,"props",{variant:r(String),...l});v();f();var ns=class extends c{get classNames(){return m("bu-kbd",this.props.className)}};o(ns,"template","baseui.Kbd"),o(ns,"props",{...l});v();f();var cs=class extends c{get classNames(){return m("bu-marker",this.props.className)}get variant(){return this.props.variant}};o(cs,"template","baseui.Marker"),o(cs,"props",{variant:r(String),...l});v();f();var ls=class extends c{get classNames(){return m("form-control",this.props.resize==="none"&&"bu-textarea-no-resize",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};o(ls,"template","baseui.Textarea"),o(ls,"props",{value:r(String),placeholder:r(String),rows:r(Number),disabled:r(Boolean),readonly:r(Boolean),resize:r(String),className:r(String),style:r([String,Object]),id:r(String),onInput:r(Function),onChange:r(Function)});v();f();var us=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return m("bu-native-select","form-select",(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)}};o(us,"template","baseui.NativeSelect"),o(us,"props",{value:r(String),size:r(String),disabled:r(Boolean),...l,"aria-label":r(String),ariaLabel:r(String),id:r(String),onChange:r(Function)});v();f();var ps=class extends c{onChange(e){this.props.onChange?.(e.target.checked,e)}};o(ps,"template","baseui.Checkbox"),o(ps,"props",{checked:r(Boolean),disabled:r(Boolean),...l,id:r(String),onChange:r(Function)});v();f();var ds=class extends c{setup(){k({radioGroupValue:()=>this.props.value,radioGroupDisabled:()=>this.props.disabled,radioGroupName:()=>this.props.name||"bu-radio-group",selectRadio:e=>this.props.onChange?.(e)})}get classNames(){return m("bu-radio-group",this.props.className)}};o(ds,"template","baseui.RadioGroup"),o(ds,"props",{value:r(String),name:r(String),disabled:r(Boolean),...l,onChange:r(Function)});var bs=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)}};o(bs,"template","baseui.RadioGroupItem"),o(bs,"props",{value:{type:String},disabled:r(Boolean),...l});v();f();var ms=class extends c{onChange(e){this.props.onChange?.(e.target.checked,e)}};o(ms,"template","baseui.Switch"),o(ms,"props",{checked:r(Boolean),disabled:r(Boolean),...l,onChange:r(Function)});v();f();var hs=class extends c{get classNames(){return m("bu-slider",this.props.className)}onInput(e){e.target.style.setProperty("--b-slider-value",`${e.target.value}%`),this.props.onChange?.(e.target.value,e)}};o(hs,"template","baseui.Slider"),o(hs,"props",{value:r([Number,String]),min:r([Number,String]),max:r([Number,String]),step:r([Number,String]),disabled:r(Boolean),className:r(String),style:r([String,Object]),onChange:r(Function)});v();f();var qt={"inline-start":"bu-input-group-addon-inline-start","inline-end":"bu-input-group-addon-inline-end","block-start":"bu-input-group-addon-block-start","block-end":"bu-input-group-addon-block-end"},Ut={default:"btn-primary",primary:"btn-primary",destructive:"btn-danger",danger:"btn-danger",outline:"btn-outline-secondary",secondary:"btn-secondary",ghost:"btn-light",link:"btn-link"},Mt={xs:"bu-input-group-button-xs",sm:"bu-input-group-button-sm","icon-xs":"bu-input-group-button-icon-xs","icon-sm":"bu-input-group-button-icon-sm"};function ta(t){t.parentElement?.querySelector("[data-slot='input-group-control'], input, textarea")?.focus()}var gs=class extends c{get classNames(){return m("bu-input-group",this.props.className)}};o(gs,"template","baseui.InputGroup"),o(gs,"props",{...l});var fs=class extends c{get align(){return qt[this.props.align]?this.props.align:"inline-start"}get classNames(){return m("bu-input-group-addon",qt[this.align],this.props.className)}onClick(e){this.props.onClick?.(e),e.target.closest("button")||ta(e.currentTarget)}};o(fs,"template","baseui.InputGroupAddon"),o(fs,"props",{align:r(String),...l,onClick:r(Function)});var Pt=class extends c{get size(){return Mt[this.props.size]?this.props.size:"xs"}get classNames(){return m("btn","bu-button","bu-input-group-button",Ut[this.props.variant]||Ut.ghost,Mt[this.size],this.props.className||this.props.class)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get buttonAttrs(){return{"data-size":this.size,"aria-label":this.ariaLabel,"data-slot":"input-group-button"}}onClick(e){this.props.onClick?.(e)}};o(Pt,"template","baseui.InputGroupButton"),o(Pt,"components",{Button:y}),o(Pt,"props",{variant:r(String),size:r(String),type:r(String),disabled:r(Boolean),label:r(String),class:r(String),...l,"aria-label":r(String),ariaLabel:r(String),onClick:r(Function)});var vs=class extends c{get classNames(){return m("bu-input-group-text",this.props.className)}};o(vs,"template","baseui.InputGroupText"),o(vs,"props",{...l});var ys=class extends c{get classNames(){return m("form-control","bu-input-group-control","bu-input-group-input",this.props.invalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};o(ys,"template","baseui.InputGroupInput"),o(ys,"props",{value:r(String),id:r(String),name:r(String),autocomplete:r(String),placeholder:r(String),type:r(String),disabled:r(Boolean),readonly:r(Boolean),invalid:r(Boolean),className:r(String),style:r([String,Object]),onInput:r(Function),onChange:r(Function)});var xs=class extends c{get classNames(){return m("form-control","bu-input-group-control","bu-input-group-textarea",this.props.resize==="none"&&"bu-textarea-no-resize",this.props.invalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};o(xs,"template","baseui.InputGroupTextarea"),o(xs,"props",{value:r(String),placeholder:r(String),rows:r(Number),disabled:r(Boolean),readonly:r(Boolean),invalid:r(Boolean),resize:r(String),className:r(String),style:r([String,Object]),onInput:r(Function),onChange:r(Function)});v();f();var ws=class extends c{setup(){this.length=this.props.length||6;let e=(this.props.value||"").split("");this.state=x({digits:Array.from({length:this.length},(s,a)=>e[a]||"")}),this.rootRef=A("root")}get classNames(){return m("bu-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 a=s.target.value.slice(-1);this.state.digits[e]=a,a&&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 a=0;a<this.length;a++)this.state.digits[a]=s[a]||"";this.emit()}}};o(ws,"template","baseui.InputOtp"),o(ws,"props",{length:r(Number),value:r(String),disabled:r(Boolean),className:r(String),style:r([String,Object]),onChange:r(Function)});v();v();function Ss(t,{defaultOpen:e=!1,onOpenChange:s}={}){let a=x({open:e}),n=b=>{a.open!==b&&(a.open=b,s?.(b))},i=()=>n(!a.open),u=b=>{t.el&&!t.el.contains(b.target)&&n(!1)},p=b=>{b.key==="Escape"&&n(!1)};return Y(b=>{if(b)return document.addEventListener("click",u),document.addEventListener("keydown",p),()=>{document.removeEventListener("click",u),document.removeEventListener("keydown",p)}},()=>[a.open]),$(()=>{document.removeEventListener("click",u),document.removeEventListener("keydown",p)}),{state:a,setOpen:n,toggle:i}}f();var As=class extends c{setup(){this.rootRef=A("root");let{state:e,setOpen:s,toggle:a}=Ss(this.rootRef,{defaultOpen:F(this.props.state)});this.disclosure=e,k({select:this.disclosure,selectValue:()=>this.props.value,selectToggle:a,selectClose:()=>s(!1),selectChoose:n=>{this.props.onChange?.(n),s(!1)}})}get classNames(){return m("bu-select",this.props.className)}};o(As,"template","baseui.Select"),o(As,"props",{value:r(String),state:r(String),onChange:r(Function),...l});var zt=class extends c{get attrs(){return{"aria-haspopup":"listbox","aria-expanded":this.env.select.open?"true":"false"}}onClick(){this.env.selectToggle()}};o(zt,"template","baseui.SelectTrigger"),o(zt,"components",{Button:y}),o(zt,"props",l);var Es=class extends c{get open(){return this.env.select.open}};o(Es,"template","baseui.SelectContent"),o(Es,"props",l);var Cs=class extends c{get selected(){return this.env.selectValue()===this.props.value}onClick(){this.env.selectChoose(this.props.value)}};o(Cs,"template","baseui.SelectItem"),o(Cs,"props",{value:{type:String},...l});v();function Ls(t){return[...t.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")].filter(e=>!e.disabled&&!e.hidden)}function wa(t,e){if(t.key!=="Tab")return;let s=Ls(e);if(!s.length){t.preventDefault();return}let a=s[0],n=s[s.length-1];t.shiftKey&&document.activeElement===a?(t.preventDefault(),n.focus()):!t.shiftKey&&document.activeElement===n&&(t.preventDefault(),a.focus())}function ea(t,{closeSelector:e,trapFocus:s=!1}={}){let a=t.getAttribute("b-att-trigger"),n=a?document.querySelector(a):null,i=[...t.querySelectorAll(e)],u=null,p=()=>Ls(t),b=()=>{u=document.activeElement,t.hidden=!1,t.setAttribute("b-att-state","open"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),p()[0]?.focus(),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},h=()=>{t.hidden=!0,t.setAttribute("b-att-state","closed"),u?.focus?.(),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))},g=E=>{if(E.key==="Escape"){h();return}!s||t.hidden||wa(E,t)},S=E=>{E.target===t&&h()};return n?.addEventListener("click",b),i.forEach(E=>E.addEventListener("click",h)),t.addEventListener("keydown",g),t.addEventListener("click",S),(!t.getAttribute("b-att-state")||t.getAttribute("b-att-state")==="closed")&&(t.hidden=!0),{open:b,close:h,destroy:()=>{n?.removeEventListener("click",b),i.forEach(E=>E.removeEventListener("click",h)),t.removeEventListener("keydown",g),t.removeEventListener("click",S)}}}function ks(t,e,s,a){let n=t.getAttribute("b-att-trigger"),i=n?document.querySelector(n):null,u=null,p=()=>{u=document.activeElement},b=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},h=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0})),u?.focus?.(),u=null},g=()=>e.show(),S=()=>e.hide();return t.addEventListener(`show.bs.${s}`,p),t.addEventListener(`shown.bs.${s}`,b),t.addEventListener(`hidden.bs.${s}`,h),i?.addEventListener("click",g),t.setAttribute("b-att-state","closed"),t[a]={open:g,close:S},{destroy:()=>{i?.removeEventListener("click",g),t.removeEventListener(`show.bs.${s}`,p),t.removeEventListener(`shown.bs.${s}`,b),t.removeEventListener(`hidden.bs.${s}`,h),e.dispose(),delete t[a]}}}f();var Ns=class extends c{setup(){this.alertDialogState=x({open:M(this.props)}),k({alertDialog:this.alertDialogState,setAlertDialogOpen:e=>this.setOpen(e)}),V(this.alertDialogState)}setOpen(e){Z(this.props,this.alertDialogState,e)}};o(Ns,"template","baseui.AlertDialog"),o(Ns,"props",{open:r(Boolean),state:r(String),"default-open":r(Boolean),defaultOpen:r(Boolean),onOpenChange:r(Function),slots:r(Object)});var Ft=class extends c{get attrs(){return{"data-slot":"alert-dialog-trigger"}}onClick(){this.env.setAlertDialogOpen(!0)}};o(Ft,"template","baseui.AlertDialogTrigger"),o(Ft,"components",{Button:y}),o(Ft,"props",l);var Bs=class extends c{get size(){return this.props.size==="sm"?"sm":"default"}setup(){this.rootRef=A("root"),Y(e=>{if(!e)return;let s=document.activeElement;return Ls(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}wa(e,this.rootRef.el)}};o(Bs,"template","baseui.AlertDialogContent"),o(Bs,"props",{...l,size:r(String)});var Is=class extends c{};o(Is,"template","baseui.AlertDialogHeader"),o(Is,"props",l);var Os=class extends c{};o(Os,"template","baseui.AlertDialogFooter"),o(Os,"props",l);var Rs=class extends c{};o(Rs,"template","baseui.AlertDialogMedia"),o(Rs,"props",l);var $s=class extends c{};o($s,"template","baseui.AlertDialogTitle"),o($s,"props",l);var Ts=class extends c{};o(Ts,"template","baseui.AlertDialogDescription"),o(Ts,"props",l);var Dt=class extends c{get attrs(){return{"data-slot":"alert-dialog-cancel"}}onClick(){this.env.setAlertDialogOpen(!1)}};o(Dt,"template","baseui.AlertDialogCancel"),o(Dt,"components",{Button:y}),o(Dt,"props",l);var _t=class extends c{get attrs(){return{"data-slot":"alert-dialog-action"}}onClick(){this.props.onClick?.(),this.env.setAlertDialogOpen(!1)}};o(_t,"template","baseui.AlertDialogAction"),o(_t,"components",{Button:y}),o(_t,"props",{...l,onClick:r(Function)});v();f();var qs=class extends c{setup(){this.drawerState=x({open:M(this.props)}),this.control={instance:null},k({drawer:this.drawerState,drawerControl:this.control,setDrawerOpen:e=>this.setOpen(e)}),V(this.drawerState,this.control)}setOpen(e){Z(this.props,this.drawerState,e)}};o(qs,"template","baseui.Drawer"),o(qs,"props",{open:r(Boolean),state:r(String),"default-open":r(Boolean),defaultOpen:r(Boolean),onOpenChange:r(Function),slots:r(Object)});var jt=class extends c{onClick(){this.env.drawerControl.instance?.show()}};o(jt,"template","baseui.DrawerTrigger"),o(jt,"components",{Button:y}),o(jt,"props",l);var Us=class extends c{setup(){this.rootRef=A("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},q(()=>{this.env.drawerControl.instance=L().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()}),$(()=>{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}};o(Us,"template","baseui.DrawerContent"),o(Us,"props",l);var Ms=class extends c{};o(Ms,"template","baseui.DrawerHeader"),o(Ms,"props",l);var Ps=class extends c{};o(Ps,"template","baseui.DrawerFooter"),o(Ps,"props",l);var zs=class extends c{};o(zs,"template","baseui.DrawerTitle"),o(zs,"props",l);var Fs=class extends c{};o(Fs,"template","baseui.DrawerDescription"),o(Fs,"props",l);var Ht=class extends c{get attrs(){return{"data-bs-dismiss":"offcanvas"}}};o(Ht,"template","baseui.DrawerClose"),o(Ht,"components",{Button:y}),o(Ht,"props",l);v();f();var Ds=class extends c{setup(){this.sheetState=x({open:M(this.props),side:this.props.side}),this.control={instance:null},k({sheet:this.sheetState,sheetControl:this.control,setSheetOpen:e=>this.setOpen(e)}),V(this.sheetState,this.control),K(e=>{this.sheetState.side=e.side})}setOpen(e){Z(this.props,this.sheetState,e)}};o(Ds,"template","baseui.Sheet"),o(Ds,"props",{open:r(Boolean),state:r(String),side:r(String),"default-open":r(Boolean),defaultOpen:r(Boolean),onOpenChange:r(Function),slots:r(Object)});var Kt=class extends c{onClick(){this.env.sheetControl.instance?.show()}};o(Kt,"template","baseui.SheetTrigger"),o(Kt,"components",{Button:y}),o(Kt,"props",l);var _s=class extends c{setup(){this.rootRef=A("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},q(()=>{this.env.sheetControl.instance=L().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()}),$(()=>{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"}};o(_s,"template","baseui.SheetContent"),o(_s,"props",{...l,side:r(String)});var js=class extends c{};o(js,"template","baseui.SheetHeader"),o(js,"props",l);var Hs=class extends c{};o(Hs,"template","baseui.SheetFooter"),o(Hs,"props",l);var Ks=class extends c{};o(Ks,"template","baseui.SheetTitle"),o(Ks,"props",l);var Ws=class extends c{};o(Ws,"template","baseui.SheetDescription"),o(Ws,"props",l);var Wt=class extends c{};o(Wt,"template","baseui.SheetClose"),o(Wt,"components",{Button:y}),o(Wt,"props",l);v();f();var Vs=class extends c{setup(){let e=x({open:F(this.props.state)});this.control={instance:null,bufferEl:null,lastContentHtml:null};let s=a=>{e.open!==a&&(e.open=a,this.props.onOpenChange?.(a))};k({popover:e,popoverControl:this.control,popoverSetOpen:s,popoverToggle:()=>this.control.instance?.toggle(),popoverClose:()=>this.control.instance?.hide()})}};o(Vs,"template","baseui.Popover"),o(Vs,"props",{state:r(String),onOpenChange:r(Function),...l});var Vt=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),q(()=>{let e=this.env.popoverControl,s=e.bufferEl?.innerHTML??"";e.lastContentHtml=s,e.instance=new(L()).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)}),$(()=>{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()}};o(Vt,"template","baseui.PopoverTrigger"),o(Vt,"components",{Button:y}),o(Vt,"props",l);var Zs=class extends c{get style(){return G("display:none",this.props.style)}setup(){this.bufferRef=A("buffer"),q(()=>{this.env.popoverControl.bufferEl=this.bufferRef.el}),_(()=>{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??""}};o(Zs,"template","baseui.PopoverContent"),o(Zs,"props",{...l,content:r(String)});v();f();var Xs=class extends c{setup(){this.state=x({open:!1}),k({hoverCard:this.state})}open(){this.state.open=!0}close(){this.state.open=!1}onKeyDown(e){e.key==="Escape"&&this.close()}};o(Xs,"template","baseui.HoverCard"),o(Xs,"props",{...l});var Gs=class extends c{};o(Gs,"template","baseui.HoverCardTrigger"),o(Gs,"props",l);var Ys=class extends c{get open(){return this.env.hoverCard.open}};o(Ys,"template","baseui.HoverCardContent"),o(Ys,"props",l);v();f();var Js=class extends c{setup(){this.state=x({open:F(this.props.state)}),this.triggerRef=A("trigger"),this.bufferRef=A("buffer"),this.bootstrapTooltip=null,this.lastContentHtml=null,this.onShown=()=>{this.state.open=!0},this.onHidden=()=>{this.state.open=!1},q(()=>{this.lastContentHtml=this.currentContentHtml();let e=this.triggerElement();this.bootstrapTooltip=new(L()).Tooltip(e,{title:this.lastContentHtml,html:!0,trigger:"hover focus"}),e.addEventListener("shown.bs.tooltip",this.onShown),e.addEventListener("hidden.bs.tooltip",this.onHidden),F(this.props.state)&&this.bootstrapTooltip.show()}),_(()=>{let e=this.currentContentHtml();e!==this.lastContentHtml&&(this.lastContentHtml=e,this.bootstrapTooltip?.setContent({".tooltip-inner":e}))}),$(()=>{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()}};o(Js,"template","baseui.Tooltip"),o(Js,"props",{content:r(String),state:r(String),...l});v();f();var Sa={...l,disabled:r(Boolean),inset:r(Boolean),onClick:r(Function),onSelect:r(Function),variant:r(String)},pt=class extends c{setup(){this.rootRef=A("root");let e=x({open:F(this.props.state)});this.control={instance:null};let s=i=>{e.open!==i&&(e.open=i,this.props.onOpenChange?.(i))};k({dropdownMenu:e,dropdownControl:this.control,dropdownSetOpen:s,dropdownToggle:()=>this.control.instance?.toggle(),dropdownClose:()=>this.control.instance?.hide()});let a=i=>{this.rootRef.el&&!this.rootRef.el.contains(i.target)&&this.control.instance?.hide()},n=i=>{i.key==="Escape"&&this.control.instance?.hide()};Y(i=>{if(i)return document.addEventListener("click",a),document.addEventListener("keydown",n),()=>{document.removeEventListener("click",a),document.removeEventListener("keydown",n)}},()=>[e.open]),$(()=>{document.removeEventListener("click",a),document.removeEventListener("keydown",n)})}};o(pt,"template","baseui.DropdownMenu"),o(pt,"props",{state:r(String),onOpenChange:r(Function),...l});var et=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=L().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 m("btn","bu-button","btn-outline-secondary","bu-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()}};o(et,"template","baseui.DropdownMenuTrigger"),o(et,"components",{Button:y}),o(et,"props",l);var dt=class extends c{get open(){return this.env.dropdownMenu.open}get classNames(){return m("bu-dropdown-menu-content","dropdown-menu",this.open?"show":"",this.props.className)}};o(dt,"template","baseui.DropdownMenuContent"),o(dt,"props",{...l,align:r(String),alignOffset:r(Number),side:r(String),sideOffset:r(Number)});var Qs=class extends c{};o(Qs,"template","baseui.DropdownMenuGroup"),o(Qs,"props",l);var to=class extends c{};o(to,"template","baseui.DropdownMenuLabel"),o(to,"props",{...l,inset:r(Boolean)});var bt=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())}};o(bt,"template","baseui.DropdownMenuItem"),o(bt,"props",Sa);var Zt=class extends c{onClick(e){this.props.disabled||(this.props.onCheckedChange?.(!this.props.checked,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};o(Zt,"template","baseui.DropdownMenuCheckboxItem"),o(Zt,"components",{Icon:T}),o(Zt,"props",{...Sa,checked:r(Boolean),onCheckedChange:r(Function)});var eo=class extends c{setup(){k({dropdownRadio:{value:this.props.value,onValueChange:this.props.onValueChange}})}};o(eo,"template","baseui.DropdownMenuRadioGroup"),o(eo,"props",{...l,value:r(String),onValueChange:r(Function)});var Xt=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))}};o(Xt,"template","baseui.DropdownMenuRadioItem"),o(Xt,"components",{Icon:T}),o(Xt,"props",{...Sa,value:r(String)});var so=class extends c{};o(so,"template","baseui.DropdownMenuSeparator"),o(so,"props",l);var oo=class extends c{};o(oo,"template","baseui.DropdownMenuShortcut"),o(oo,"props",l);var mt=class extends c{setup(){this.rootRef=A("root");let{state:e,setOpen:s,toggle:a}=Ss(this.rootRef);k({dropdownSub:e,dropdownSubToggle:a,dropdownSubOpen:()=>s(!0),dropdownSubClose:()=>s(!1)})}};o(mt,"template","baseui.DropdownMenuSub"),o(mt,"props",l);var st=class extends c{onMouseEnter(){this.props.disabled||this.env.dropdownSubOpen()}onClick(){this.props.disabled||this.env.dropdownSubToggle()}};o(st,"template","baseui.DropdownMenuSubTrigger"),o(st,"components",{Icon:T}),o(st,"props",{...l,disabled:r(Boolean),inset:r(Boolean)});var ht=class extends c{get open(){return this.env.dropdownSub.open}};o(ht,"template","baseui.DropdownMenuSubContent"),o(ht,"props",l);v();f();var ro=class extends c{setup(){this.state=x({open:!1,x:0,y:0});let e=()=>{this.state.open=!1};this.close=e,k({contextMenu:this.state,contextMenuOpenAt:(s,a)=>{this.state.open=!0,this.state.x=s,this.state.y=a},contextMenuClose:e}),document.addEventListener("click",e),$(()=>document.removeEventListener("click",e))}};o(ro,"template","baseui.ContextMenu"),o(ro,"props",{className:r(String),slots:r(Object)});var ao=class extends c{onContextMenu(e){e.preventDefault(),this.env.contextMenuOpenAt(e.clientX,e.clientY)}};o(ao,"template","baseui.ContextMenuTrigger"),o(ao,"props",l);var io=class extends c{setup(){this.rootRef=A("root")}get open(){return this.env.contextMenu.open}get style(){return G(`left:${this.env.contextMenu.x}px;top:${this.env.contextMenu.y}px`,this.props.style)}};o(io,"template","baseui.ContextMenuContent"),o(io,"props",l);var no=class extends c{onClick(){this.props.onClick?.(),this.env.contextMenuClose()}};o(no,"template","baseui.ContextMenuItem"),o(no,"props",{...l,onClick:r(Function)});v();f();var An={"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 sa(t){let e=An[t];return e?["toast-container","position-fixed","p-3","pe-auto",...e]:null}var ot=class extends c{setup(){this.state=x({open:M(this.props)}),this.rootRef=A("root"),this.bootstrapToast=null,this.handleShown=()=>{this.state.open=!0},this.handleHidden=()=>{this.state.open=!1,this.props.onOpenChange?.(!1)},q(()=>{this.mountBootstrapToast(this.props.delay),this.state.open&&this.bootstrapToast.show()}),K(e=>{let s=kt(e)?M(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())}),$(()=>{this.bootstrapToast?.dispose()})}mountBootstrapToast(e){let s=this.rootRef.el,a=e??3e3;this.bootstrapToast=new(L()).Toast(s,{autohide:a>0,delay:a||3e3}),s.addEventListener("shown.bs.toast",this.handleShown),s.addEventListener("hidden.bs.toast",this.handleHidden)}get classNames(){return m("toast","fade","bu-toast",sa(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()}};o(ot,"template","baseui.Toast"),o(ot,"components",{Button:y}),o(ot,"props",{open:r(Boolean),state:r(String),variant:r(String),delay:r(Number),position:r(String),...l,onOpenChange:r(Function)});v();f();var co=class extends c{setup(){this.state=x({open:new Set}),k({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)}};o(co,"template","baseui.Accordion"),o(co,"props",{multiple:r(Boolean),onChange:r(Function),...l});var lo=class extends c{setup(){k({accordionItemState:this.props.state,accordionItemValue:this.props.value})}};o(lo,"template","baseui.AccordionItem"),o(lo,"props",{value:{type:String},state:r(String),...l});var Gt=class extends c{get open(){return this.env.accordionItemState!==void 0?F(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)}};o(Gt,"template","baseui.AccordionTrigger"),o(Gt,"components",{Icon:T,Button:y}),o(Gt,"props",l);var uo=class extends c{setup(){this.rootRef=A("root"),this.initialOpen=this.open,Qr(this.rootRef,()=>this.open)}get open(){return this.env.accordionItemState!==void 0?F(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}};o(uo,"template","baseui.AccordionContent"),o(uo,"props",l);v();f();var po=class extends c{setup(){this.state=x({open:M(this.props)}),k({collapsible:this.state,collapsibleToggle:()=>this.toggle()}),V(this.state)}toggle(){let e=!this.state.open;Z(this.props,this.state,e)}};o(po,"template","baseui.Collapsible"),o(po,"props",{open:r(Boolean),state:r(String),"default-open":r(Boolean),defaultOpen:r(Boolean),onOpenChange:r(Function),...l});var Yt=class extends c{get attrs(){return{"aria-expanded":this.env.collapsible.open?"true":"false"}}onClick(){this.env.collapsibleToggle()}};o(Yt,"template","baseui.CollapsibleTrigger"),o(Yt,"components",{Button:y}),o(Yt,"props",l);var bo=class extends c{setup(){this.rootRef=A("root"),this.initialOpen=this.open,Qr(this.rootRef,()=>this.open)}get open(){return this.env.collapsible.open}};o(bo,"template","baseui.CollapsibleContent"),o(bo,"props",l);v();f();var mo=class extends c{};o(mo,"template","baseui.Breadcrumb"),o(mo,"props",{...l});var ho=class extends c{};o(ho,"template","baseui.BreadcrumbList"),o(ho,"props",{...l});var go=class extends c{get classNames(){return m("bu-breadcrumb-item",this.props.current&&"bu-breadcrumb-page",this.props.className)}};o(go,"template","baseui.BreadcrumbItem"),o(go,"props",{current:r(Boolean),...l});var fo=class extends c{get classNames(){return m("bu-breadcrumb-link",this.props.className)}onClick(e){this.props.onClick?.(e)}};o(fo,"template","baseui.BreadcrumbLink"),o(fo,"props",{href:r(String),target:r(String),rel:r(String),...l,onClick:r(Function)});var vo=class extends c{get classNames(){return m("bu-breadcrumb-page",this.props.className)}};o(vo,"template","baseui.BreadcrumbPage"),o(vo,"props",{...l});var Jt=class extends c{get classNames(){return m("bu-breadcrumb-separator",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};o(Jt,"template","baseui.BreadcrumbSeparator"),o(Jt,"components",{Icon:T}),o(Jt,"props",{...l});var Qt=class extends c{get classNames(){return m("bu-breadcrumb-ellipsis",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};o(Qt,"template","baseui.BreadcrumbEllipsis"),o(Qt,"components",{Icon:T}),o(Qt,"props",{...l});v();f();var yo=class extends c{get classNames(){return m("bu-pagination",this.props.className)}};o(yo,"template","baseui.Pagination"),o(yo,"props",{...l});var xo=class extends c{get classNames(){return m("page-item",this.props.current&&"active",this.props.disabled&&"disabled")}onClick(){this.props.disabled||this.props.onClick?.()}};o(xo,"template","baseui.PaginationItem"),o(xo,"props",{current:r(Boolean),disabled:r(Boolean),style:r([String,Object]),onClick:r(Function),slots:r(Object)});v();f();var wo=class extends c{setup(){this.rootRef=A("root")}onKeyDown(e){let s=[...this.rootRef.el.querySelectorAll("a, button")].filter(i=>!i.disabled),a=s.indexOf(e.target),n=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;!n||a<0||(e.preventDefault(),s[(a+n+s.length)%s.length]?.focus())}};o(wo,"template","baseui.NavigationMenu"),o(wo,"props",{...l});var So=class extends c{};o(So,"template","baseui.NavigationMenuItem"),o(So,"props",{href:r(String),...l});v();f();var Ao=class extends c{get classNames(){return m("bu-menubar",this.props.className)}};o(Ao,"template","baseui.Menubar"),o(Ao,"props",{...l});v();f();var Ya={...l,href:r(String)};function Ja(t){globalThis.matchMedia?.("(max-width: 767.98px)").matches&&t.setSidebarOpen?.(!1)}var at=class extends c{setup(){this.state=x({open:M(this.props)}),k({sidebar:this.state,setSidebarOpen:e=>this.setOpen(e)}),V(this.state)}setOpen(e){Z(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 m("bu-sidebar-root",this.props.className)}onKeyDown(e){e.key==="Escape"&&this.setOpen(!1)}};o(at,"template","baseui.Sidebar"),o(at,"props",{open:r(Boolean),state:r(String),"default-open":r(Boolean),defaultOpen:r(Boolean),onOpenChange:r(Function),side:r(String),variant:r(String),collapsible:r(String),...l});var Pr=class extends at{};o(Pr,"template","baseui.Sidebar");var te=class extends c{onClick(){if(this.env.setShellCollapsed&&!globalThis.matchMedia?.("(max-width: 767.98px)").matches){this.env.setShellCollapsed(!this.env.shell.collapsed);return}this.env.setSidebarOpen(!this.env.sidebar.open)}};o(te,"template","baseui.SidebarTrigger"),o(te,"components",{Icon:T,Button:y}),o(te,"props",{...l,icon:r(String),label:r(String)});var gt=class extends c{get open(){return this.env.sidebar.open}};o(gt,"template","baseui.SidebarContent"),o(gt,"props",l);var Eo=class extends c{};o(Eo,"template","baseui.SidebarHeader"),o(Eo,"props",l);var Co=class extends c{};o(Co,"template","baseui.SidebarFooter"),o(Co,"props",l);var Lo=class extends c{};o(Lo,"template","baseui.SidebarInset"),o(Lo,"props",l);var ee=class extends c{onClick(){this.env.setSidebarOpen(!this.env.sidebar.open)}};o(ee,"template","baseui.SidebarRail"),o(ee,"components",{Button:y}),o(ee,"props",l);var ko=class extends c{};o(ko,"template","baseui.SidebarInput"),o(ko,"props",{className:r(String),style:r([String,Object]),placeholder:r(String),value:r(String),type:r(String)});var No=class extends c{};o(No,"template","baseui.SidebarSeparator"),o(No,"props",l);var se=class extends c{onClick(){this.env.setSidebarOpen(!1)}};o(se,"template","baseui.SidebarClose"),o(se,"components",{Icon:T,Button:y}),o(se,"props",{...l,icon:r(String),label:r(String)});var ft=class extends c{};o(ft,"template","baseui.SidebarGroup"),o(ft,"props",{muted:r(Boolean),...l});var vt=class extends c{};o(vt,"template","baseui.SidebarGroupLabel"),o(vt,"props",Ya);var oe=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};o(oe,"template","baseui.SidebarGroupAction"),o(oe,"components",{Button:y}),o(oe,"props",{icon:r(String),"aria-label":r(String),ariaLabel:r(String),onClick:r(Function),...l});var Bo=class extends c{};o(Bo,"template","baseui.SidebarGroupContent"),o(Bo,"props",l);var re=class extends c{setup(){let e=this.props["default-open"]!==void 0||this.props.defaultOpen!==void 0;this.state=x({open:kt(this.props)||e?M(this.props):!0}),V(this.state)}get open(){return this.state.open}toggle(){let e=!this.state.open;Z(this.props,this.state,e)}};o(re,"template","baseui.SidebarGroupCollapsible"),o(re,"components",{Icon:T,Button:y}),o(re,"props",{label:{type:String},open:r(Boolean),state:r(String),"default-open":r(Boolean),defaultOpen:r(Boolean),onOpenChange:r(Function),...l});var it=class extends c{};o(it,"template","baseui.SidebarMenu"),o(it,"props",l);var yt=class extends c{};o(yt,"template","baseui.SidebarMenuItem"),o(yt,"props",l);var rt=class extends c{get classNames(){return m("bu-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),Ja(this.env)}};o(rt,"template","baseui.SidebarMenuButton"),o(rt,"components",{Icon:T,Button:y}),o(rt,"props",{href:r(String),icon:r(String),active:r(Boolean),isActive:r(Boolean),variant:r(String),size:r(String),tooltip:r(String),disabled:r(Boolean),onClick:r(Function),...l});var ae=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};o(ae,"template","baseui.SidebarMenuAction"),o(ae,"components",{Button:y}),o(ae,"props",{icon:r(String),"aria-label":r(String),ariaLabel:r(String),showOnHover:r(Boolean),onClick:r(Function),...l});var Io=class extends c{};o(Io,"template","baseui.SidebarMenuSub"),o(Io,"props",l);var Oo=class extends c{};o(Oo,"template","baseui.SidebarMenuBadge"),o(Oo,"props",l);var Ro=class extends c{setup(){this.state=x({width:this.props.width||`${Math.floor(Math.random()*40)+50}%`})}get style(){return G(`--b-sidebar-skeleton-width:${this.state.width}`,this.props.style)}};o(Ro,"template","baseui.SidebarMenuSkeleton"),o(Ro,"props",{showIcon:r(Boolean),width:r(String),className:r(String),style:r([String,Object])});var $o=class extends c{};o($o,"template","baseui.SidebarMenuSubItem"),o($o,"props",l);var ie=class extends c{get classNames(){return m("bu-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),Ja(this.env)}};o(ie,"template","baseui.SidebarMenuSubButton"),o(ie,"components",{Button:y}),o(ie,"props",{...Ya,active:r(Boolean),isActive:r(Boolean),size:r(String),onClick:r(Function)});v();f();var ne=class extends c{setup(){this.state=x({collapsed:this.props.collapsed??this.props.defaultCollapsed??!1,authState:this.props.authState??null}),k({shell:this.state,setShellCollapsed:e=>this.setCollapsed(e)}),K(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?.()}};o(ne,"template","baseui.Shell"),o(ne,"components",{Sidebar:at,Toast:ot,Button:y}),o(ne,"props",{open:r(Boolean),defaultOpen:r(Boolean),onOpenChange:r(Function),collapsed:r(Boolean),defaultCollapsed:r(Boolean),onCollapsedChange:r(Function),authState:r(Object),toast:r(Object),onToastOpenChange:r(Function),notificationPage:r(Function),pwa:r(Function),...l});var ce=class extends c{};o(ce,"template","baseui.ShellSidebar"),o(ce,"components",{SidebarContent:gt}),o(ce,"props",l);var To=class extends c{};o(To,"template","baseui.ShellSidebarHeader"),o(To,"props",l);var qo=class extends c{};o(qo,"template","baseui.ShellNav"),o(qo,"props",l);var Uo=class extends c{};o(Uo,"template","baseui.ShellMain"),o(Uo,"props",l);var Mo=class extends c{};o(Mo,"template","baseui.ShellHeader"),o(Mo,"props",l);var le=class extends c{};o(le,"template","baseui.ShellContent"),o(le,"components",{Skeleton:ut}),o(le,"props",{loading:r(Boolean),...l});var ue=class extends c{get authState(){return this.env.shell.authState}logout(){this.authState?.onLogout?.()}};o(ue,"template","baseui.ShellUserMenu"),o(ue,"components",{Button:y}),o(ue,"props",l);v();f();var Po=class extends c{get classNames(){return m("table","bu-table",this.props.striped!==!1&&"table-striped",this.props.hover!==!1&&"table-hover",this.props.className)}};o(Po,"template","baseui.Table"),o(Po,"props",{striped:r(Boolean),hover:r(Boolean),responsive:r(Boolean),...l});v();f();var En=[{key:"status",label:"Status",format:"capitalize"},{key:"email",label:"Email",sortable:!0,filterable:!0},{key:"amount",label:"Amount",align:"right",format:"currency"}],Cn=[{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}],Ln=[{label:"Copy payment ID"},{label:"View customer"},{label:"View payment details"}],pe=4,de=8,kn=32,be=class extends c{setup(){this.state=x({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=A("actionsMenu"),this.actionsMenuTriggerEl=null,Be(window,"click",this.onWindowClick,!0),Be(window,"keydown",this.onWindowKeydown),Be(window,"resize",this.closeRowActions),Be(window,"scroll",this.closeRowActions,!0),_(()=>this.refreshActionsMenuPosition())}get columns(){return this.props.columns?.length?this.props.columns:En}get rows(){return this.props.rows?.length?this.props.rows:Cn}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?Ln:[])}get variant(){return this.props.variant||"default"}get classNames(){return m("bu-data-table",`bu-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(i=>i.filterable===!0),a=(s.length?s:this.columns).map(i=>i.key),n=this.rows.filter(i=>!e||a.some(u=>String(i[u]).toLowerCase().includes(e)));return this.state.sortKey&&(n=[...n].sort((i,u)=>String(i[this.state.sortKey]).localeCompare(String(u[this.state.sortKey]))*this.state.sortDir)),n}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(a=>a.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,a){let n=this.rowKey(e,s);if(this.state.actionRowKey===n){this.closeRowActions();return}this.actionsMenuTriggerEl=a.currentTarget,this.state.actionRowKey=n,this.state.actionMenuStyle=this.estimateActionMenuStyle(a.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,a)=>this.rowKey(s,a)===this.state.actionRowKey);return e===-1?null:{row:this.pageRows[e],index:e}}estimateActionMenuStyle(e){let s=e.getBoundingClientRect(),a=this.rowActions.length*kn+pe*2,n=window.innerHeight-s.bottom,u=n<a+pe&&s.top>n?Math.max(de,s.top-pe-a):s.bottom+pe,p=Math.min(Math.max(de,s.right-160),window.innerWidth-160-de);return`position: fixed; top: ${Math.round(u)}px; left: ${Math.round(p)}px;`}refreshActionsMenuPosition(){if(this.state.actionRowKey===null||!this.actionsMenuTriggerEl)return;let e=this.actionsMenuRef.el;if(!e)return;let s=this.actionsMenuTriggerEl.getBoundingClientRect(),a=e.getBoundingClientRect(),n=window.innerHeight-s.bottom,i=s.top,p=n<a.height+pe&&i>n?Math.max(de,s.top-pe-a.height):Math.min(s.bottom+pe,window.innerHeight-a.height-de),b=Math.min(Math.max(de,s.right-a.width),window.innerWidth-a.width-de),h=`position: fixed; top: ${Math.round(p)}px; left: ${Math.round(b)}px;`;this.state.actionMenuStyle!==h&&(this.state.actionMenuStyle=h)}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,a){let n=this.rowKey(e,s);this.state.selectedKeys=a?[...new Set([...this.state.selectedKeys,n])]:this.state.selectedKeys.filter(i=>i!==n),this.props.onSelectionChange?.(this.state.selectedKeys)}toggleAllVisible(e){let s=this.pageRows.map((a,n)=>this.rowKey(a,n));this.state.selectedKeys=e?[...new Set([...this.state.selectedKeys,...s])]:this.state.selectedKeys.filter(a=>!s.includes(a)),this.props.onSelectionChange?.(this.state.selectedKeys)}onAction(e,s,a){e.onSelect?.(s,a),this.props.onRowAction?.(e,s,a),this.closeRowActions()}columnLabel(e){return e.label??e.key}cellValue(e,s){let a=e[s.key];if(s.format==="currency"){let n=Number(a);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(Number.isFinite(n)?n:0)}if(s.format==="capitalize"){let n=String(a??"");return n.charAt(0).toUpperCase()+n.slice(1)}return a??""}cellComponentProps(e,s){return s.componentProps?s.componentProps(e,s):{row:e,column:s,value:e[s.key]}}};o(be,"template","baseui.DataTable"),o(be,"components",{Button:y,Icon:T}),o(be,"props",{columns:r(Array),rows:r(Array),variant:r(String),searchable:r(Boolean),sortable:r(Boolean),pagination:r(Boolean),selectable:r(Boolean),"column-toggle":r(Boolean),columnToggle:r(Boolean),"row-actions":r(Array),rowActions:r(Array),"page-size":r(Number),pageSize:r(Number),"page-size-options":r(Array),pageSizeOptions:r(Array),"filter-placeholder":r(String),filterPlaceholder:r(String),"empty-label":r(String),emptyLabel:r(String),onRowAction:r(Function),onSelectionChange:r(Function),...l,"max-height":r([String,Number]),maxHeight:r([String,Number])});v();f();var Nn=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),Bn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],me=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 Nn.format(new Date(this.year,this.month0,1))}get weekdays(){return Bn}get days(){let e=new Date(this.year,this.month0+1,0).getDate(),s=new Date(this.year,this.month0,1).getDay(),a=[];for(let n=0;n<s;n++)a.push(null);for(let n=1;n<=e;n++){let i=`${this.year}-${String(this.month0+1).padStart(2,"0")}-${String(n).padStart(2,"0")}`;a.push({day:n,value:i,selected:i===this.props.selected})}return a}onSelect(e){this.props.onChange?.(e)}};o(me,"template","baseui.Calendar"),o(me,"components",{Button:y}),o(me,"props",{selected:r(String),month:r(Number),year:r(Number),className:r(String),style:r([String,Object]),onChange:r(Function)});v();f();var zo=class extends c{get classNames(){return m("bu-date-picker","form-control",this.props.className)}onInput(e){this.props.onChange?.(e.target.value,e)}};o(zo,"template","baseui.DatePicker"),o(zo,"props",{value:r(String),disabled:r(Boolean),className:r(String),style:r([String,Object]),onChange:r(Function)});v();f();var Fo=class extends c{setup(){this.rootRef=A("root");let{state:e}=Ss(this.rootRef);this.disclosure=e,this.state=x({query:this.selectedLabel})}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)}};o(Fo,"template","baseui.Combobox"),o(Fo,"props",{options:{type:Array},value:r(String),placeholder:r(String),className:r(String),style:r([String,Object]),id:r(String),onChange:r(Function)});v();f();var Do=class extends c{setup(){this.state=x({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)}};o(Do,"template","baseui.Command"),o(Do,"props",{items:{type:Array},placeholder:r(String),className:r(String),style:r([String,Object]),onSelect:r(Function)});v();f();var _o=class extends c{get classNames(){return m("bu-chart",this.props.type&&`bu-chart-${this.props.type}`,this.props.variant&&`bu-chart-${this.props.variant}`,this.props.className)}};o(_o,"template","baseui.Chart"),o(_o,"props",{config:r([String,Object]),label:r(String),type:r(String),value:r([String,Number]),variant:r(String),...l});v();f();var jo=class extends c{setup(){this.state=x({index:this.props.defaultIndex??0}),this.rootRef=A("root"),this.bootstrapCarousel=null,this.onSlid=e=>{this.state.index=e.to,this.props.onChange?.(this.state.index)},k({carousel:this.state,carouselInstance:()=>this.bootstrapCarousel}),q(()=>{this.bootstrapCarousel=new(L()).Carousel(this.rootRef.el,{interval:!1,wrap:!0,touch:!0}),this.rootRef.el.addEventListener("slid.bs.carousel",this.onSlid)}),$(()=>{this.rootRef.el.removeEventListener("slid.bs.carousel",this.onSlid),this.bootstrapCarousel?.dispose()})}};o(jo,"template","baseui.Carousel"),o(jo,"props",{slideCount:{type:Number},defaultIndex:r(Number),onChange:r(Function),...l});var Ho=class extends c{setup(){this.rootRef=A("root"),this.initialActive=this.active,_(()=>{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?F(this.props.state):this.env.carousel.index===this.props.index}};o(Ho,"template","baseui.CarouselSlide"),o(Ho,"props",{index:{type:Number},state:r(String),...l});var he=class extends c{onClick(){this.env.carouselInstance()?.prev()}};o(he,"template","baseui.CarouselPrevious"),o(he,"components",{Button:y}),o(he,"props",l);var ge=class extends c{onClick(){this.env.carouselInstance()?.next()}};o(ge,"template","baseui.CarouselNext"),o(ge,"components",{Button:y}),o(ge,"props",l);v();f();var Ko=class extends c{setup(){this.panelRef=A("panel"),this.state=x({width:null})}get panelStyle(){return this.state.width?`width:${this.state.width}px`:""}onPointerDown(e){let s=e.clientX,a=this.panelRef.el.getBoundingClientRect().width,n=this.props.min||160,i=this.props.max||720,u=b=>{this.state.width=Math.min(i,Math.max(n,a+b.clientX-s))},p=()=>{document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",p),this.props.onChange?.(this.state.width)};document.addEventListener("pointermove",u),document.addEventListener("pointerup",p)}};o(Ko,"template","baseui.Resizable"),o(Ko,"props",{min:r(Number),max:r(Number),onChange:r(Function),...l});v();f();var Wo=class extends c{get classNames(){return m("bu-scroll-area",this.props.className)}};o(Wo,"template","baseui.ScrollArea"),o(Wo,"props",l);v();f();var Qa={idle:"bu-attachment-idle",uploading:"bu-attachment-uploading",processing:"bu-attachment-processing",error:"bu-attachment-error",done:"bu-attachment-done"},ti={default:"bu-attachment-default",sm:"bu-attachment-sm",xs:"bu-attachment-xs"},Vo=class extends c{get state(){return Qa[this.props.state]?this.props.state:"done"}get size(){return ti[this.props.size]?this.props.size:"default"}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return m("bu-attachment",Qa[this.state],ti[this.size],`bu-attachment-${this.orientation}`,!this.hasContent&&"bu-attachment-picker",this.props.className)}get hasContent(){return!!this.props.slots?.default}onChange(e){this.props.onChange?.([...e.target.files])}};o(Vo,"template","baseui.Attachment"),o(Vo,"props",{state:r(String),size:r(String),orientation:r(String),multiple:r(Boolean),...l,onChange:r(Function)});var Zo=class extends c{get variant(){return this.props.variant==="image"?"image":"icon"}get classNames(){return m("bu-attachment-media",`bu-attachment-media-${this.variant}`,this.props.className)}};o(Zo,"template","baseui.AttachmentMedia"),o(Zo,"props",{variant:r(String),...l});var Xo=class extends c{};o(Xo,"template","baseui.AttachmentContent"),o(Xo,"props",l);var Go=class extends c{};o(Go,"template","baseui.AttachmentTitle"),o(Go,"props",l);var Yo=class extends c{};o(Yo,"template","baseui.AttachmentDescription"),o(Yo,"props",l);var Jo=class extends c{};o(Jo,"template","baseui.AttachmentActions"),o(Jo,"props",l);var fe=class extends c{get variant(){return this.props.variant||"ghost"}get size(){return this.props.size||"icon-xs"}get className(){return m("bu-button-icon","bu-attachment-action",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};o(fe,"template","baseui.AttachmentAction"),o(fe,"components",{Button:y}),o(fe,"props",{type:r(String),variant:r(String),size:r(String),disabled:r(Boolean),label:r(String),...l,"aria-label":r(String),ariaLabel:r(String),onClick:r(Function)});var ve=class extends c{get classNames(){return m("bu-attachment-trigger",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};o(ve,"template","baseui.AttachmentTrigger"),o(ve,"components",{Button:y}),o(ve,"props",{href:r(String),target:r(String),rel:r(String),type:r(String),className:r(String),style:r([String,Object]),"aria-label":r(String),ariaLabel:r(String),onClick:r(Function)});var Qo=class extends c{get classNames(){return m("bu-attachment-group",this.props.className)}};o(Qo,"template","baseui.AttachmentGroup"),o(Qo,"props",{...l});var tr=class extends c{setup(){this.state=x({dragging:!1}),this.fileInput=A("fileInput")}get hasContent(){return!!this.props.slots?.default}get classNames(){return m("bu-attachment-dropzone",this.state.dragging&&"bu-attachment-dropzone-dragging",this.props.disabled&&"bu-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)}};o(tr,"template","baseui.AttachmentDropzone"),o(tr,"props",{multiple:r(Boolean),disabled:r(Boolean),...l,onFilesSelected:r(Function)});v();f();var er=class extends c{setup(){this.state=x({errored:!1})}get showImage(){return!!this.props.src&&!this.state.errored}onError(){this.state.errored=!0}};o(er,"template","baseui.Avatar"),o(er,"props",{src:r(String),alt:r(String),title:r(String),...l});v();f();var sr=class extends c{get classNames(){return m("bu-message",this.props.className)}get side(){return this.props.side||"incoming"}};o(sr,"template","baseui.Message"),o(sr,"props",{side:r(String),...l});v();f();var or=class extends c{setup(){this.rootRef=A("root"),Y(()=>{this.props.autoscroll!==!1&&this.rootRef.el&&(this.rootRef.el.scrollTop=this.rootRef.el.scrollHeight)})}};o(or,"template","baseui.MessageScroller"),o(or,"props",{autoscroll:r(Boolean),...l});v();f();var rr=class extends c{setup(){this.state=x({index:0}),k({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)}};o(rr,"template","baseui.Questionnaire"),o(rr,"props",{stepCount:{type:Number},onChange:r(Function),...l});var ar=class extends c{get active(){return this.props.state!==void 0?F(this.props.state):this.env.questionnaire.index===this.props.index}};o(ar,"template","baseui.QuestionnaireStep"),o(ar,"props",{index:{type:Number},state:r(String),...l});var ye=class extends c{get disabled(){return this.env.questionnaire.index===0}onClick(){this.env.questionnaireShow(this.env.questionnaire.index-1)}};o(ye,"template","baseui.QuestionnairePrevious"),o(ye,"components",{Button:y}),o(ye,"props",l);var xe=class extends c{onClick(){this.env.questionnaireShow(this.env.questionnaire.index+1)}};o(xe,"template","baseui.QuestionnaireNext"),o(xe,"components",{Button:y}),o(xe,"props",{...l,stepCount:r(Number)});v();f();var ir=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 G(`--b-progress-value:${this.value/this.max*100}%`,this.props.style)}get classNames(){return m("bu-progress",this.props.className)}};o(ir,"template","baseui.Progress"),o(ir,"props",{value:r(Number),max:r(Number),className:r(String),style:r([String,Object])});v();f();var nr=class extends c{get classNames(){return m("bu-aspect-ratio",this.props.className)}get style(){let e=this.props.ratio||`${this.props.width||16} / ${this.props.height||9}`;return G(`--b-aspect-ratio:${e}`,this.props.style)}};o(nr,"template","baseui.AspectRatio"),o(nr,"props",{ratio:r(String),width:r(Number),height:r(Number),...l});v();f();var cr=class extends c{get classNames(){return m("bu-bubble",this.props.className)}get side(){return this.props.side}};o(cr,"template","baseui.Bubble"),o(cr,"props",{side:r(String),...l});v();f();var lr=class extends c{get dir(){return this.props.dir==="rtl"?"rtl":"ltr"}};o(lr,"template","baseui.Direction"),o(lr,"props",{dir:r(String),...l});v();f();var ur=class extends c{get classNames(){return m("bu-item",this.props.className)}get variant(){return this.props.variant}};o(ur,"template","baseui.Item"),o(ur,"props",{variant:r(String),...l});v();f();var pr=class extends c{get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return m("bu-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"]}};o(pr,"template","baseui.ButtonGroup"),o(pr,"props",{orientation:r(String),size:r(String),"aria-label":r(String),"aria-labelledby":r(String),...l});var dr=class extends c{get orientation(){return this.props.orientation==="horizontal"?"horizontal":"vertical"}get classNames(){return m("bu-button-group-separator",`bu-button-group-separator-${this.orientation}`,this.props.className)}};o(dr,"template","baseui.ButtonGroupSeparator"),o(dr,"props",{orientation:r(String),className:r(String),style:r([String,Object])});var br=class extends c{get classNames(){return m("bu-button-group-text",this.props.className)}};o(br,"template","baseui.ButtonGroupText"),o(br,"props",{...l});v();f();var mr=class extends c{get classNames(){return m("bu-field-set",this.props.className)}};o(mr,"template","baseui.FieldSet"),o(mr,"props",{...l});var hr=class extends c{get variant(){return this.props.variant||"legend"}get classNames(){return m("bu-field-legend",this.props.className)}};o(hr,"template","baseui.FieldLegend"),o(hr,"props",{variant:r(String),...l});var xt=class extends c{get classNames(){return m("bu-field-group",this.props.className)}};o(xt,"template","baseui.FieldGroup"),o(xt,"props",{...l});var wt=class extends c{get orientation(){return this.props.orientation||"vertical"}get classNames(){return m("bu-field",`bu-field-orientation-${this.orientation}`,this.props.className)}};o(wt,"template","baseui.Field"),o(wt,"props",{orientation:r(String),invalid:r(Boolean),label:r(String),error:r(String),...l});var gr=class extends c{get classNames(){return m("bu-field-content",this.props.className)}};o(gr,"template","baseui.FieldContent"),o(gr,"props",{...l});var St=class extends c{get classNames(){return m("bu-field-label",this.props.className)}};o(St,"template","baseui.FieldLabel"),o(St,"props",{for:r(String),...l});var fr=class extends c{get classNames(){return m("bu-field-title",this.props.className)}};o(fr,"template","baseui.FieldTitle"),o(fr,"props",{...l});var At=class extends c{get classNames(){return m("bu-field-description",this.props.className)}};o(At,"template","baseui.FieldDescription"),o(At,"props",{...l});var vr=class extends c{get hasContent(){return!!this.props.slots?.default}get classNames(){return m("bu-field-separator",this.props.className)}};o(vr,"template","baseui.FieldSeparator"),o(vr,"props",{...l});var Et=class extends c{get classNames(){return m("bu-field-error",this.props.className)}};o(Et,"template","baseui.FieldError"),o(Et,"props",{message:r(String),...l});function ei(t){return`Icon${String(t).split("-").filter(Boolean).map(s=>s[0].toUpperCase()+s.slice(1)).join("")}`}v();f();var yr=class extends c{get classNames(){return m("form-label","b-label","bu-label",this.props.className)}get state(){return this.props.state||(this.props.required?"required":void 0)}};o(yr,"template","baseui.Label"),o(yr,"props",{for:r(String),required:r(Boolean),state:r(String),...l});v();var In="bu-theme",On="theme",Rn="[b-theme-toggle]",$n="[b-theme-label]";function Aa(t){return t==="dark"?"dark":"light"}function Tn(t){return typeof globalThis.location>"u"?null:new URLSearchParams(globalThis.location.search).get(t)}function qn(t,e=document.documentElement){let s=Aa(t);return globalThis.BaseUI?.theme?.set?globalThis.BaseUI.theme.set(s):e&&(e.setAttribute("b-theme",s),e.setAttribute("data-bs-theme",s)),s}function si(t,e,s){try{t.contentWindow?.BaseUI?.theme.set(e),t.contentDocument?.documentElement.setAttribute("b-theme",e),t.contentDocument?.documentElement.setAttribute("data-bs-theme",e)}catch{let a=new URL(t.getAttribute("src"),globalThis.location.href);a.searchParams.set(s,e),t.setAttribute("src",a.pathname+a.search+a.hash)}}function Un(t){typeof document>"u"||typeof CustomEvent>"u"||document.dispatchEvent(new CustomEvent("baseui:theme-change",{detail:{theme:t}}))}function Ct(t={}){let e=t.storageKey||In,s=t.queryKey||On,a=t.toggleSelector??Rn,n=t.labelSelector??$n,i=t.root||(typeof document>"u"?null:document.documentElement);function u(){return Tn(s)}function p(){return Aa(u()||globalThis.localStorage?.getItem(e)||i?.getAttribute("b-theme")||"light")}function b(N){typeof document>"u"||!a||document.querySelectorAll(a).forEach(O=>{O.setAttribute("aria-pressed",N==="dark"?"true":"false");let C=n?O.querySelector(n):null;C&&(C.textContent=N==="dark"?"Light theme":"Dark theme")})}function h(N){typeof document>"u"||document.querySelectorAll("iframe").forEach(O=>si(O,N,s))}function g(N,O={}){let C=qn(N,i);return!O.skipStorage&&!u()&&globalThis.localStorage?.setItem(e,C),b(C),h(C),Un(C),C}function S(){return g(i?.getAttribute("b-theme")==="dark"?"light":"dark")}function E(){if(typeof document>"u")return p();let N=p();return g(N,{skipStorage:!!u()}),a&&document.addEventListener("click",O=>{O.target.closest?.(a)&&S()}),document.querySelectorAll("iframe").forEach(O=>{O.addEventListener("load",()=>si(O,i?.getAttribute("b-theme")||N,s))}),N}return{current:p,set:g,toggle:S,syncFrames:h,init:E}}var oi=Ct();typeof window<"u"&&(window.BaseUITheme=oi);f();f();Ie();var ri=["btn","bu-theme-button",...Object.values(j),...Object.values(W)];function xr(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 oa({variant:t="outline",size:e,className:s}={}){return m("btn","bu-theme-button",j[t]||j.outline,W[e],s)}var nt=class extends c{setup(){this.theme=Ct({storageKey:H(this.props,"storage-key","storageKey")}),this.state=x({theme:this.theme.current()}),this.onThemeChange=e=>{this.state.theme=e.detail?.theme||this.theme.current()},q(()=>{this.state.theme=this.theme.set(this.theme.current(),{skipStorage:!0}),document.addEventListener("baseui:theme-change",this.onThemeChange)}),$(()=>document.removeEventListener("baseui:theme-change",this.onThemeChange))}get iconName(){return xr(this.state.theme).icon}get baseUrl(){return H(this.props,"base-url")}get label(){return xr(this.state.theme).label}get pressed(){return xr(this.state.theme).pressed}get classNames(){return oa(this.props)}get attrs(){return{"b-theme-button":""}}onClick(){let e=this.theme.toggle();this.state.theme=e,this.props.onChange?.(e)}};o(nt,"template","baseui.ThemeButton"),o(nt,"components",{Icon:T,Button:y}),o(nt,"props",{variant:r(String),size:r(String),"base-url":r(String),"storage-key":r(String),storageKey:r(String),className:r(String),style:r([String,Object]),onChange:r(Function)});v();f();var we=class extends c{get classNames(){return m("bu-toggle","btn",this.props.variant==="outline"?"btn-outline-secondary":"btn-light",this.props.className)}get pressed(){return this.props.state!==void 0?F(this.props.state):!!this.props.pressed}onClick(){this.props.onChange?.(!this.pressed)}};o(we,"template","baseui.Toggle"),o(we,"components",{Button:y}),o(we,"props",{pressed:r(Boolean),state:r(String),variant:r(String),...l,onChange:r(Function)});v();f();var wr=class extends c{setup(){this.state=x({selected:new Set}),k({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)}};o(wr,"template","baseui.ToggleGroup"),o(wr,"props",{multiple:r(Boolean),onChange:r(Function),...l});var Se=class extends c{get pressed(){return this.env.toggleGroup.selected.has(this.props.value)}onClick(){this.env.toggleGroupSelect(this.props.value)}};o(Se,"template","baseui.ToggleGroupItem"),o(Se,"components",{Button:y}),o(Se,"props",{value:{type:String},...l});v();f();ia();function na(t){let e=String(t??""),s=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e);if(!s)return{data:{},content:e};let a={};for(let n of s[1].split(/\r?\n/)){let i=n.trim();if(!i||i.startsWith("#"))continue;let u=i.indexOf(":");if(u===-1)continue;let p=i.slice(0,u).trim();p&&(a[p]=fc(i.slice(u+1).trim()))}return{data:a,content:e.slice(s[0].length)}}function bi(t){return t.length>=2&&(t[0]==='"'&&t.at(-1)==='"'||t[0]==="'"&&t.at(-1)==="'")?t.slice(1,-1):t}function fc(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=>bi(s.trim())):[]}return bi(t)}var Ae=class extends c{setup(){this.rootRef=A("root"),this.editorRef=A("editor"),this.editorHandle=null,this.state=x({html:"",source:"",status:"loading",error:"",frontmatter:{}}),Nt(()=>this.load(this.props)),K(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),q(()=>this.afterRender()),_(()=>this.afterRender()),qr(()=>{this.destroyEditor(),this.rootRef.el&&Sr(this.rootRef.el)})}get classNames(){return m("bu-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 a=await fetch(e.src);if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);s=await a.text()}catch(a){this.state.status="error",this.state.error=a.message||String(a);return}try{this.state.source=s;let{data:a,content:n}=na(s);this.state.frontmatter=a,this.state.html=ha(await zr(n)),this.state.status="ready"}catch(a){this.state.status="error",this.state.error=a.message||String(a)}}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"||Fr(e,{mermaid:this.props.mermaid!==!1,baseUi:this.props.baseUi!==!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 Dr({root:e,value:this.state.source,collaborative:!!this.props.collaborative,room:this.props.room||"bu-markdown",password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(s,a,n)=>{this.state.source=s,this.props.onChange?.(s,a,n)}})}catch(s){this.state.status="error",this.state.error=s.message||String(s)}}destroyEditor(){this.editorHandle?.destroy?.(),this.editorHandle=null}};o(Ae,"template","baseui.Markdown"),o(Ae,"components",{Badge:lt}),o(Ae,"props",{content:r(String),src:r(String),mermaid:r(Boolean),baseUi:r(Boolean),editable:r(Boolean),collaborative:r(Boolean),room:r(String),password:r(String),signaling:r(Array),user:r(Object),onChange:r(Function),className:r(String),style:r([String,Object])});v();f();function Ia(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 a=Ia(s,e);if(a)return a}return null}function vc(t){return t.replace(/\.[^./]+$/,"").replace(/[_-]+/g," ").trim().split(/\s+/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}var Ar=class Ar extends c{get label(){let e=this.props.node.meta;return e?.sidebar_label||e?.title||vc(this.props.node.name)}get hasSubfolders(){return(this.props.node.children||[]).some(e=>e.type==="dir")}select(e){this.props.onSelect(e)}};o(Ar,"template","baseui.MarkdownTreeNode"),o(Ar,"components",{MarkdownTreeNode:Ar,Icon:T,SidebarGroupLabel:vt,SidebarMenu:it,SidebarMenuItem:yt,SidebarMenuButton:rt,DropdownMenu:pt,DropdownMenuTrigger:et,DropdownMenuContent:dt,DropdownMenuItem:bt,DropdownMenuSub:mt,DropdownMenuSubTrigger:st,DropdownMenuSubContent:ht}),o(Ar,"props",{node:{type:Object},activePath:r(String),onSelect:{type:Function},nested:r(Boolean)});var _r=Ar,Ee=class extends c{setup(){this.state=x({tree:null,status:"loading",error:""}),Nt(()=>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)}}};o(Ee,"template","baseui.MarkdownTree"),o(Ee,"components",{MarkdownTreeNode:_r,SidebarGroup:ft,SidebarMenu:it}),o(Ee,"props",{src:{type:String},activePath:r(String),onSelect:{type:Function},className:r(String),style:r([String,Object])});v();function mi(t=document.querySelector("[b-block-code-template]")){let a=((t?.tagName==="SCRIPT"?t.textContent:t?.innerHTML)?.replace(/^\n/,"").replace(/\s+$/,"")||"").split(`
|
|
12
|
+
`),n=a.filter(u=>u.trim()).map(u=>u.match(/^\s*/)?.[0].length||0),i=n.length?Math.min(...n):0;return a.map(u=>u.slice(i)).join(`
|
|
13
|
+
`)}function hi(t,e=0){let s=" ".repeat(e),a=[];for(let n of t.childNodes){if(n.nodeType===Node.TEXT_NODE){let p=n.textContent.trim();p&&a.push(`${s}${p}`);continue}if(n.nodeType!==Node.ELEMENT_NODE)continue;let i=[...n.attributes].map(p=>` ${p.name}="${p.value}"`).join("");if(![...n.childNodes].some(p=>p.nodeType===Node.ELEMENT_NODE||p.nodeType===Node.TEXT_NODE&&p.textContent.trim())){a.push(`${s}<${n.localName}${i}>${n.textContent.trim()}</${n.localName}>`);continue}a.push(`${s}<${n.localName}${i}>`),a.push(...hi(n,e+1)),a.push(`${s}</${n.localName}>`)}return a}async function gi(t){if(!t?.trim())return"";let{expandSelfClosingTags:e,extractTagCaseMap:s,normalizeOwlPreviewMarkup:a}=await Promise.resolve().then(()=>(ia(),di)),n=document.createElement("div");return n.innerHTML=e(t),a(n,s(t)),hi(n).join(`
|
|
14
|
+
`)}function fi(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']"),a=e.querySelector("[b-block-sidebar]");!s||!a||(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 n=e.getAttribute("b-att-sidebar")!=="open";e.setAttribute("b-att-sidebar",n?"open":"collapsed"),s.setAttribute("aria-expanded",n?"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",a=>{a.preventDefault();let n=e.getAttribute("b-att-state")!=="open";e.setAttribute("b-att-state",n?"open":"collapsed"),s.setAttribute("aria-expanded",n?"true":"false")}))})}f();var ca=Ct({storageKey:"bu-example-theme",toggleSelector:"",labelSelector:""}),yc=[{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"}],xc={desktop:"",tablet:"768px",mobile:"390px"},wc="/dist/icons/lucide";function Sc(){return document.querySelector("[b-block-code-template]")}function Ac(t){return t.match(/<templates[^>]*>([\s\S]*)<\/templates>/)?.[1]||t}function Ec(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",wc)}var Ce=class extends c{setup(){this.navItems=this.props.navItems||yc,this.previewFrame=A("previewFrame"),this.embedRoot=A("embedRoot"),this.code=mi(),this.state=x({mode:"preview",viewport:"desktop",copyLabel:"Copy code",embed:new URLSearchParams(globalThis.location.search).get("embed")==="1",codeVariant:"owl",staticTemplate:"",staticTemplateStatus:"idle"}),q(()=>this.mountPreview()),_(()=>this.mountStaticBaseUI())}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 gi(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 BaseUI block."}get previewStyle(){let e=xc[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=Sc();if(!(!e||!s)){if(s.tagName==="SCRIPT"){this.mountOwlPreview(e,s);return}e.replaceChildren(s.content.cloneNode(!0)),this.mountStaticBaseUI(e),fi(e)}}async mountOwlPreview(e,s){e.replaceChildren();class a extends c{setup(){this.state=x({collapsed:!1})}}o(a,"template","examples.SidebarBlock");let n=[await Tr("/dist/baseui.templates.xml"),s.textContent].map(Ac).join(`
|
|
15
|
+
`);await Wr(a,e,{templates:`<templates>${n}</templates>`}),ca.set(ca.current(),{skipStorage:!0})}mountStaticBaseUI(e=document){Ec(e),globalThis.BaseUI?.mountAll(e),ca.set(ca.current(),{skipStorage:!0})}};o(Ce,"template","baseui.BlockViewer"),o(Ce,"components",{Button:y,Icon:T,ThemeButton:nt}),o(Ce,"props",{navItems:r(Array)});v();f();var Er=class extends c{setup(){this.pwaState=x({open:M(this.props)}),k({pwa:this.pwaState,setPwaOpen:e=>this.setOpen(e)}),V(this.pwaState)}setOpen(e){Z(this.props,this.pwaState,e)}};o(Er,"template","baseui.Pwa"),o(Er,"props",{open:r(Boolean),"default-open":r(Boolean),defaultOpen:r(Boolean),onOpenChange:r(Function),slots:r(Object)});var Le=class extends c{onClick(){this.env.setPwaOpen(!0)}};o(Le,"template","baseui.PwaTrigger"),o(Le,"components",{Button:y}),o(Le,"props",l);var Cr=class extends c{setup(){this.rootRef=A("root"),Y(e=>{if(!e)return;let s=document.activeElement;return Ls(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)}};o(Cr,"template","baseui.PwaContent"),o(Cr,"props",l);var Lr=class extends c{};o(Lr,"template","baseui.PwaHeader"),o(Lr,"props",l);var kr=class extends c{};o(kr,"template","baseui.PwaTitle"),o(kr,"props",l);var Nr=class extends c{};o(Nr,"template","baseui.PwaDescription"),o(Nr,"props",l);var Br=class extends c{};o(Br,"template","baseui.PwaBody"),o(Br,"props",l);var Ir=class extends c{get steps(){return Array.isArray(this.props.steps)?this.props.steps:[]}};o(Ir,"template","baseui.PwaSteps"),o(Ir,"props",{...l,steps:r(Array)});var Or=class extends c{};o(Or,"template","baseui.PwaFooter"),o(Or,"props",l);var ke=class extends c{onClick(){this.env.setPwaOpen(!1)}};o(ke,"template","baseui.PwaClose"),o(ke,"components",{Button:y}),o(ke,"props",l);v();f();var vi="",yi="";function xi(t,e){return typeof t=="string"?t:e}function Cc(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 Ne=class extends c{setup(){this.state=x({title:xi(this.props.title,vi),description:xi(this.props.description,yi),submitted:!1})}get classNames(){return m("bu-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 Cc(this.state)}get titleInvalid(){return!!this.errors.title}get descriptionInvalid(){return!!this.errors.description}reset(){this.state.title=vi,this.state.description=yi,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})}};o(Ne,"template","baseui.Form"),o(Ne,"components",{Button:y,Field:wt,FieldDescription:At,FieldError:Et,FieldGroup:xt,FieldLabel:St}),o(Ne,"props",{title:r(String),description:r(String),titlePlaceholder:r(String),descriptionPlaceholder:r(String),maxDescriptionLength:r(Number),className:r(String),style:r([String,Object]),onSubmit:r(Function)});v();f();var Oa;function Lc(){return Oa??(Oa=import("./runtime/milkdown/milkdown-text-editor.js")),Oa}async function la(t){return(await Lc()).createMilkdownTextEditor(t)}function ua({collaborative:t,providerType:e,url:s}={}){return!!t||!!(e&&s)}var Rr=class extends c{setup(){this.editorRef=A("editor"),this.editorHandle=null,this.mountPromise=null,this.mountToken=0,this.isDestroyed=!1,this.state=x({content:"",status:"loading",error:""}),Nt(()=>this.load(this.props)),K(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),q(()=>this.mountEditor()),_(()=>this.mountEditor()),qr(()=>{this.isDestroyed=!0,this.destroyEditor()})}get classNames(){return m("bu-text-editor",this.props.className)}get isCollaborative(){return ua({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 a=await fetch(e.src);if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);s=await a.text()}catch(a){this.state.status="error",this.state.error=a.message||String(a);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 a=await la({root:e,value:this.state.content,placeholder:this.props.placeholder,collaborative:this.isCollaborative,providerType:this.props.provider,room:this.props.room||"bu-text-editor",url:this.props.url,password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(n,i,u)=>{this.state.content=n,this.props.onChange?.(n,i,u)}});if(s!==this.mountToken){a.destroy?.();return}this.editorHandle=a}catch(a){s===this.mountToken&&(this.state.status="error",this.state.error=a.message||String(a))}finally{this.mountPromise=null,this.isDestroyed||this.mountEditor()}})(),this.mountPromise}destroyEditor(){this.mountToken++,this.editorHandle?.destroy?.(),this.editorHandle=null}};o(Rr,"template","baseui.TextEditor"),o(Rr,"props",{content:r(String),src:r(String),placeholder:r(String),collaborative:r(Boolean),provider:r(String),room:r(String),url:r(String),password:r(String),signaling:r(Array),user:r(Object),onChange:r(Function),className:r(String),style:r([String,Object])});w();function kc(t){let{open:e,close:s,destroy:a}=ea(t,{closeSelector:"[b-alert-dialog-cancel], [b-alert-dialog-action], [b-alert-dialog-close]",trapFocus:!0});return t.setAttribute("role","alertdialog"),t.BaseUIAlertDialog={open:e,close:s},{destroy:()=>{a(),delete t.BaseUIAlertDialog}}}d.register("alert-dialog",{type:"owl",mount:kc});w();var $a={default:"bu-alert-default",destructive:"bu-alert-destructive",info:"bu-alert-default",success:"alert-success",warning:"alert-warning",danger:"bu-alert-destructive"};function Nc(t){t.classList.add("alert","bu-alert",$a[t.getAttribute("b-att-variant")||"default"]||$a.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 a=document.createElement("button");a.type="button",a.className="btn-close",a.setAttribute("data-bs-dismiss","alert"),a.setAttribute("aria-label","Close"),t.appendChild(a)}e=new(L()).Alert(t)}return{destroy:()=>{e?.dispose(),t.classList.remove("alert","bu-alert","alert-dismissible","fade","show",...Object.values($a))}}}d.register("alert",{type:"static",mount:Nc});w();function Bc(t){let e=[...t.querySelectorAll("[b-accordion-item]")],s=t.getAttribute("b-att-multiple")==="true",a=new Map,n=new Map,i=new Map,u=(p,b)=>{let h=p.querySelector("[b-accordion-trigger]");p.setAttribute("b-att-state",b?"open":"closed"),h?.setAttribute("aria-expanded",String(b)),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{open:b}}))};return t.setAttribute("role","presentation"),e.forEach((p,b)=>{let h=p.querySelector("[b-accordion-trigger]"),g=p.querySelector("[b-accordion-panel]");if(!g)return;let S=g.id||`bu-accordion-panel-${b}`;g.id=S;let E=p.getAttribute("b-att-state")==="open";g.classList.add("collapse"),E&&g.classList.add("show");let N=new(L()).Collapse(g,{toggle:!1});i.set(p,N);let O=()=>u(p,!0),C=()=>u(p,!1);g.addEventListener("shown.bs.collapse",O),g.addEventListener("hidden.bs.collapse",C),n.set(p,{onShown:O,onHidden:C}),h?.setAttribute("aria-expanded",String(E)),h?.setAttribute("aria-controls",S);let R=()=>{let z=g.classList.contains("show");!s&&!z&&e.forEach(B=>{if(B===p)return;let D=i.get(B),X=B.querySelector("[b-accordion-panel]");D&&X?.classList.contains("show")&&D.hide()}),z?N.hide():N.show()};a.set(p,R),h?.addEventListener("click",R)}),{destroy:()=>{e.forEach(p=>{let b=p.querySelector("[b-accordion-trigger]"),h=p.querySelector("[b-accordion-panel]");b?.removeEventListener("click",a.get(p));let g=n.get(p);h&&g&&(h.removeEventListener("shown.bs.collapse",g.onShown),h.removeEventListener("hidden.bs.collapse",g.onHidden)),i.get(p)?.dispose()}),a.clear(),n.clear(),i.clear()}}}d.register("accordion",{type:"owl",mount:Bc});w();function Ic(t){let e=t.getAttribute("b-att-ratio")||`${t.getAttribute("b-att-width")||16} / ${t.getAttribute("b-att-height")||9}`;return t.classList.add("bu-aspect-ratio"),t.style.setProperty("--b-aspect-ratio",e),{destroy:()=>t.classList.remove("bu-aspect-ratio")}}d.register("aspect-ratio",{type:"static",mount:Ic});w();Ie();var Oc=["idle","uploading","processing","error","done"],Rc=["default","sm","xs"],$c=["content","title","description","actions"];function wi(t,e){t.classList.add(`bu-attachment-${e}`),t.setAttribute("data-slot",`attachment-${e}`)}function Tc(t){let e=t.querySelector("input[type='file']"),s=t.querySelector("[b-attachment-list]"),a=Oc.includes(t.getAttribute("b-att-state"))?t.getAttribute("b-att-state"):"done",n=Rc.includes(t.getAttribute("b-att-size"))?t.getAttribute("b-att-size"):"default",i=t.getAttribute("b-att-orientation")==="vertical"?"vertical":"horizontal";t.classList.add("bu-attachment"),t.classList.add(`bu-attachment-${a}`,`bu-attachment-${n}`,`bu-attachment-${i}`),t.setAttribute("data-state",a),t.setAttribute("data-size",n),t.setAttribute("data-orientation",i),t.setAttribute("data-slot","attachment"),e&&t.classList.add("bu-attachment-picker"),t.querySelectorAll("[b-attachment-media]").forEach(p=>{let b=p.getAttribute("b-att-variant")==="image"?"image":"icon";wi(p,"media"),p.classList.add(`bu-attachment-media-${b}`),p.setAttribute("data-variant",b)}),$c.forEach(p=>t.querySelectorAll(`[b-attachment-${p}]`).forEach(b=>wi(b,p))),t.querySelectorAll("[b-attachment-action]").forEach(p=>{let b=j[p.getAttribute("b-att-variant")]||j.ghost,h=W[p.getAttribute("b-att-size")]||W["icon-xs"];p.classList.add("btn","bu-button",b,h,"bu-button-icon","bu-attachment-action"),p.setAttribute("data-slot","attachment-action"),!p.getAttribute("type")&&p.tagName==="BUTTON"&&p.setAttribute("type","button")}),t.querySelectorAll("[b-attachment-trigger]").forEach(p=>{p.classList.add("bu-attachment-trigger"),p.setAttribute("data-slot","attachment-trigger"),!p.getAttribute("type")&&p.tagName==="BUTTON"&&p.setAttribute("type","button")}),e?.classList.add("form-control");let u=()=>{s&&(s.innerHTML=[...e.files].map(p=>`<li>${p.name}</li>`).join("")),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{files:[...e.files]}}))};return e?.addEventListener("change",u),{destroy:()=>e?.removeEventListener("change",u)}}function qc(t){return t.classList.add("bu-attachment-group"),t.setAttribute("data-slot","attachment-group"),{destroy:()=>t.classList.remove("bu-attachment-group")}}function Uc(t){let e=t.querySelector("input[type='file']");t.classList.add("bu-attachment-dropzone"),t.setAttribute("data-slot","attachment-dropzone");let s=()=>e?.click(),a=b=>{b.preventDefault(),t.classList.add("bu-attachment-dropzone-dragging")},n=()=>t.classList.remove("bu-attachment-dropzone-dragging"),i=b=>{b.length&&t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{files:b}}))},u=b=>{b.preventDefault(),t.classList.remove("bu-attachment-dropzone-dragging"),i([...b.dataTransfer?.files??[]])},p=()=>{i([...e?.files??[]]),e&&(e.value="")};return t.addEventListener("click",s),t.addEventListener("dragover",a),t.addEventListener("dragleave",n),t.addEventListener("drop",u),e?.addEventListener("change",p),{destroy:()=>{t.removeEventListener("click",s),t.removeEventListener("dragover",a),t.removeEventListener("dragleave",n),t.removeEventListener("drop",u),e?.removeEventListener("change",p)}}}d.register("attachment",{type:"owl",mount:Tc});d.register("attachment-group",{type:"static",mount:qc});d.register("attachment-dropzone",{type:"static",mount:Uc});w();function Mc(t){t.classList.add("bu-avatar");let e=t.querySelector("img"),s=t.querySelector("[b-avatar-fallback]");if(e&&s){let a=()=>{e.hidden=!0,s.hidden=!1};return s.hidden=!!e.getAttribute("src"),e.addEventListener("error",a),{destroy:()=>e.removeEventListener("error",a)}}return{}}d.register("avatar",{type:"static",mount:Mc});w();function Pc(t){let e=It[t.getAttribute("b-att-variant")||"secondary"]||It.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(It))}}d.register("badge",{type:"static",mount:Pc});w();tt();function Si(t){return[...t.children].filter(e=>!e.matches("[b-breadcrumb-separator], .bu-breadcrumb-separator"))}function Ei(t,e,s){return P(t,e,{size:s}),t}function zc(){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="bu-breadcrumb-separator",e.className="bu-breadcrumb-separator-icon",t.append(Ei(e,"chevron-right","var(--b3_5)")),t}function Fc(t){t.classList.add("bu-breadcrumb-separator"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true")}function Dc(t){if(t.classList.add("bu-breadcrumb-ellipsis"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-ellipsis"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),!t.querySelector(".bu-icon")){let e=document.createElement("span");e.className="bu-breadcrumb-ellipsis-icon",t.prepend(Ei(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 Ai(t){t.classList.add("bu-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 _c(t){let e=t.querySelector("ol, ul")||t;t.classList.add("bu-breadcrumb"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb"),t.setAttribute("aria-label",t.getAttribute("aria-label")||"breadcrumb"),e.classList.add("breadcrumb","bu-breadcrumb-list"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"breadcrumb-list");for(let a of e.querySelectorAll("[b-breadcrumb-separator], .bu-breadcrumb-separator"))Fc(a);for(let a of e.querySelectorAll("[b-breadcrumb-ellipsis], .bu-breadcrumb-ellipsis"))Dc(a);for(let a of e.querySelectorAll("[b-breadcrumb-page], .bu-breadcrumb-page"))Ai(a);e.querySelector("[b-breadcrumb-separator], .bu-breadcrumb-separator")||Si(e).slice(0,-1).forEach(n=>n.after(zc()));let s=Si(e);return s.forEach((a,n)=>{a.classList.add("bu-breadcrumb-item"),a.setAttribute("data-slot",a.getAttribute("data-slot")||"breadcrumb-item");for(let i of a.querySelectorAll("a"))i.classList.add("bu-breadcrumb-link"),i.setAttribute("data-slot",i.getAttribute("data-slot")||"breadcrumb-link");if(n===s.length-1){let i=a.querySelector("[b-breadcrumb-page], .bu-breadcrumb-page");i?Ai(i):(a.classList.add("bu-breadcrumb-page"),a.setAttribute("aria-current",a.getAttribute("aria-current")||"page"))}}),{destroy:()=>{t.classList.remove("bu-breadcrumb"),e.classList.remove("breadcrumb","bu-breadcrumb-list");for(let a of e.querySelectorAll("[b-breadcrumb-separator]"))a.remove()}}}d.register("breadcrumb",{type:"owl",mount:_c});w();function jc(t){return t.classList.add("bu-bubble"),t.getAttribute("role")||t.setAttribute("role","listitem"),{destroy:()=>t.classList.remove("bu-bubble")}}d.register("bubble",{type:"static",mount:jc});w();tt();Ie();function Hc(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 Kc(t){let e=t.getAttribute("b-att-icon"),s=t.getAttribute("b-att-icon-position")==="end"?"end":"start",a=!!t.textContent.trim(),n=e&&a?Hc(t):[],i=null;return t.classList.add("btn","bu-button",j[t.getAttribute("b-att-variant")||"default"]||"btn-primary"),W[t.getAttribute("b-att-size")]&&t.classList.add(W[t.getAttribute("b-att-size")]),t.dataset.slot="button",e&&(i=document.createElement("span"),i.setAttribute("b-icon",e),i.dataset.icon=`inline-${s}`,P(i,e,{label:""}),t.insertBefore(i,s==="end"?null:t.firstChild),t.dataset.icon=`inline-${s}`,a||(t.dataset.iconOnly="true",t.classList.add("bu-button-icon"))),{destroy:()=>{i?.remove();for(let u of n)u.replaceWith(document.createTextNode(u.textContent));t.classList.remove("btn","bu-button","bu-button-icon",...Object.values(j),...Object.values(W)),t.removeAttribute("data-slot"),t.removeAttribute("data-icon"),t.removeAttribute("data-icon-only")}}}d.register("button",{type:"static",mount:Kc});w();function Wc(t){let e=t.getAttribute("b-att-orientation")==="vertical",s=t.getAttribute("b-att-size"),a=[...t.querySelectorAll("[b-button-group-separator]")],n=[...t.querySelectorAll("[b-button-group-text]")];return t.classList.add("bu-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"),a.forEach(i=>{let u=i.getAttribute("b-att-orientation")==="horizontal"?"horizontal":"vertical";i.classList.add("bu-button-group-separator",`bu-button-group-separator-${u}`),i.setAttribute("data-orientation",u),i.setAttribute("role","separator")}),n.forEach(i=>{i.classList.add("bu-button-group-text")}),{destroy:()=>{t.classList.remove("bu-button-group","btn-group","btn-group-vertical","btn-group-sm","btn-group-lg")}}}d.register("button-group",{type:"static",mount:Wc});w();var Vc=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"});function Zc(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,a=Number(t.getAttribute("b-att-year")??e.getFullYear()),n=new Date(a,s,1),i=new Date(a,s+1,0).getDate(),u=n.getDay();t.classList.add("bu-calendar"),t.querySelector("[b-calendar-grid]")||(t.innerHTML=`
|
|
16
|
+
<div class="bu-calendar__header">${Vc.format(n)}</div>
|
|
17
|
+
<div class="bu-calendar__weekdays">${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(h=>`<span>${h}</span>`).join("")}</div>
|
|
18
18
|
<div b-calendar-grid class="bu-calendar__grid"></div>
|
|
19
|
-
`);let l=t.querySelector("[b-calendar-grid]");l.innerHTML="";for(let b=0;b<p;b+=1)l.append(document.createElement("span"));for(let b=1;b<=a;b+=1){let h=document.createElement("button"),y=`${r}-${String(o+1).padStart(2,"0")}-${String(b).padStart(2,"0")}`;h.type="button",h.textContent=String(b),h.setAttribute("b-att-value",y),h.setAttribute("aria-pressed",String(y===t.getAttribute("b-att-selected"))),l.append(h)}let u=b=>{let h=b.target.closest("button[b-att-value]");h&&(t.setAttribute("b-att-selected",h.getAttribute("b-att-value")),l.querySelectorAll("button").forEach(y=>y.setAttribute("aria-pressed",String(y===h))),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:h.getAttribute("b-att-value")}})))};return l.addEventListener("click",u),{destroy:()=>l.removeEventListener("click",u)}}c.register("calendar",{type:"owl",mount:Fc});v();function _c(t){return t.classList.add("card","bu-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","bu-card")}}c.register("card",{type:"static",mount:_c});v();M();function Hc(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 b=document.createElement("div");b.classList.add("carousel-inner"),e[0].before(b),e.forEach(h=>b.appendChild(h))}let i=Math.max(0,e.findIndex(b=>b.getAttribute("b-att-state")==="active"));e.forEach((b,h)=>{b.classList.add("carousel-item"),h===i&&b.classList.add("active"),b.setAttribute("b-att-state",h===i?"active":"inactive")});let a=e.length?new(E()).Carousel(t,{interval:!1,wrap:!0,touch:!0}):null,p=b=>{e.forEach((h,y)=>{h.setAttribute("b-att-state",y===b.to?"active":"inactive")}),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{index:b.to}}))};t.addEventListener("slid.bs.carousel",p);let l=()=>a?.prev(),u=()=>a?.next();return o?.addEventListener("click",l),r?.addEventListener("click",u),{destroy:()=>{o?.removeEventListener("click",l),r?.removeEventListener("click",u),t.removeEventListener("slid.bs.carousel",p),a?.dispose()}}}c.register("carousel",{type:"owl",mount:Hc});v();function Sp(t,e,o=0){let r=Number(t.getAttribute(e));return Number.isFinite(r)?r:o}function Wc(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 Kc(t,e){let o=globalThis.getComputedStyle(t),r=[1,2,3,4,5].map(p=>o.getPropertyValue(`--b-chart-${p}`).trim()),i=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:i,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:i,font:{size:12}}},y:{border:{display:!1},grid:{color:a},ticks:{color:i,font:{size:12}}},...e.options?.scales||{}},...e.options},e.data?.datasets?.forEach((p,l)=>{p.backgroundColor||(p.backgroundColor=r[l%r.length]),p.borderColor||(p.borderColor=r[l%r.length]),p.borderRadius??(p.borderRadius=4)}),e}function Vc(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 Zc(t){t.classList.add("bu-chart"),t.setAttribute("role",t.getAttribute("role")||"figure");let e=t.querySelector("canvas"),o=null;if(e&&globalThis.Chart){let a=Wc(t);a&&(o=new globalThis.Chart(e,Kc(t,a)))}let r=[...t.querySelectorAll("[b-att-value]")],i=Math.max(1,...r.map(a=>Sp(a,"b-att-value")));return r.forEach((a,p)=>{let l=Sp(a,"b-att-value"),u=a.getAttribute("b-att-label")||a.textContent.trim()||`Series ${p+1}`,b=Math.max(0,Math.min(100,l/i*100));a.style.setProperty("--b-chart-value",`${b}%`),a.style.setProperty("--b-chart-index",String(p%5+1)),a.style.setProperty("--b-chart-color",`var(--b-chart-${p%5+1})`),a.setAttribute("role",a.getAttribute("role")||"listitem"),a.setAttribute("aria-label",a.getAttribute("aria-label")||`${u} ${l}`),Vc(a,u,l)}),[...t.querySelectorAll("[b-chart-series], [b-chart-legend] > *")].forEach((a,p)=>{a.style.setProperty("--b-chart-color",a.style.getPropertyValue("--b-chart-color")||`var(--b-chart-${p%5+1})`)}),{destroy:()=>{o?.destroy?.(),t.classList.remove("bu-chart")}}}c.register("chart",{type:"static",mount:Zc});v();function Xc(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"),o?.classList.add("form-check","bu-check"),{destroy:()=>{e?.classList.remove("form-check-input"),o?.classList.remove("form-check","bu-check")}}}c.register("checkbox",{type:"static",mount:Xc});v();ot();na();function Gc(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 Yc(t){t.classList.remove(...Ta),t.className=`${t.className} ${ia({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";z(e,o,{label:""});let i=null,a=async()=>{if(t.disabled)return;let p=Gc(t);try{await Ir(p),z(e,r,{label:""}),t.setAttribute("data-copied","true"),t.dispatchEvent(new CustomEvent("baseui:clipboard-copy",{bubbles:!0,detail:{value:p}})),window.clearTimeout(i),i=window.setTimeout(()=>{z(e,o,{label:""}),t.removeAttribute("data-copied")},Number(t.getAttribute("b-att-reset-delay"))||2e3)}catch(l){t.dispatchEvent(new CustomEvent("baseui:clipboard-copy-error",{bubbles:!0,detail:{error:l}}))}};return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),window.clearTimeout(i),e.remove(),t.classList.remove(...Ta),t.removeAttribute("data-copied")}}}c.register("clipboard-button",{type:"static",mount:Yc});v();M();function Jc(t){let e=t.querySelector("[b-collapsible-trigger]"),o=t.querySelector("[b-collapsible-panel]"),r=b=>{t.setAttribute("b-att-state",b?"open":"closed"),e?.setAttribute("aria-expanded",String(b)),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{open:b}}))};if(!o){let b=()=>r(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 i=t.getAttribute("b-att-state")==="open";o.classList.add("collapse"),i&&o.classList.add("show");let a=new(E()).Collapse(o,{toggle:!1}),p=()=>r(!0),l=()=>r(!1);o.addEventListener("shown.bs.collapse",p),o.addEventListener("hidden.bs.collapse",l),e?.setAttribute("aria-expanded",String(i));let u=()=>{o.classList.contains("show")?a.hide():a.show()};return e?.addEventListener("click",u),{destroy:()=>{e?.removeEventListener("click",u),o.removeEventListener("shown.bs.collapse",p),o.removeEventListener("hidden.bs.collapse",l),a.dispose()}}}c.register("collapsible",{type:"owl",mount:Jc});v();function Qc(t){let e=t.querySelector("input"),o=t.querySelector("[b-combobox-list]"),r=()=>[...o?.querySelectorAll("[b-att-value]")||[]];t.classList.add("bu-combobox"),e?.setAttribute("role","combobox"),e?.setAttribute("aria-expanded","false"),o?.setAttribute("role","listbox"),o&&(o.hidden=!0);let i=l=>{o&&(o.hidden=!l),e?.setAttribute("aria-expanded",String(l))},a=()=>{let l=e.value.toLowerCase();r().forEach(u=>{u.hidden=!u.textContent.toLowerCase().includes(l)}),i(!0)},p=l=>{let u=l.target.closest("[b-att-value]");u&&(e.value=u.textContent.trim(),t.setAttribute("b-att-value",u.getAttribute("b-att-value")),i(!1),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:u.getAttribute("b-att-value")}})))};return e?.addEventListener("input",a),e?.addEventListener("focus",()=>i(!0)),o?.addEventListener("click",p),{destroy:()=>{e?.removeEventListener("input",a),o?.removeEventListener("click",p)}}}c.register("combobox",{type:"owl",mount:Qc});v();function tu(t){let e=t.querySelector("input"),o=()=>[...t.querySelectorAll("[b-command-item]")];t.classList.add("bu-command"),t.setAttribute("role",t.getAttribute("role")||"dialog"),e?.classList.add("form-control");let r=()=>{let a=(e?.value||"").toLowerCase();o().forEach(p=>{p.hidden=!p.textContent.toLowerCase().includes(a)})},i=a=>{let p=a.target.closest("[b-command-item]");p&&t.dispatchEvent(new CustomEvent("baseui:select",{bubbles:!0,detail:{value:p.getAttribute("b-att-value")||p.textContent.trim()}}))};return e?.addEventListener("input",r),t.addEventListener("click",i),{destroy:()=>{e?.removeEventListener("input",r),t.removeEventListener("click",i)}}}c.register("command",{type:"owl",mount:tu});v();function eu(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("baseui:open",{bubbles:!0}))},r=()=>{e.hidden=!0,t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))},i=a=>{a.key==="Escape"&&r()};return t.addEventListener("contextmenu",o),document.addEventListener("click",r),t.addEventListener("keydown",i),{destroy:()=>{t.removeEventListener("contextmenu",o),document.removeEventListener("click",r),t.removeEventListener("keydown",i)}}}c.register("context-menu",{type:"owl",mount:eu});v();ot();var xp=[["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 ou(t){t.querySelector("table")||(t.innerHTML=`
|
|
19
|
+
`);let p=t.querySelector("[b-calendar-grid]");p.innerHTML="";for(let h=0;h<u;h+=1)p.append(document.createElement("span"));for(let h=1;h<=i;h+=1){let g=document.createElement("button"),S=`${a}-${String(s+1).padStart(2,"0")}-${String(h).padStart(2,"0")}`;g.type="button",g.textContent=String(h),g.setAttribute("b-att-value",S),g.setAttribute("aria-pressed",String(S===t.getAttribute("b-att-selected"))),p.append(g)}let b=h=>{let g=h.target.closest("button[b-att-value]");g&&(t.setAttribute("b-att-selected",g.getAttribute("b-att-value")),p.querySelectorAll("button").forEach(S=>S.setAttribute("aria-pressed",String(S===g))),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:g.getAttribute("b-att-value")}})))};return p.addEventListener("click",b),{destroy:()=>p.removeEventListener("click",b)}}d.register("calendar",{type:"owl",mount:Zc});w();function Xc(t){return t.classList.add("card","bu-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","bu-card")}}d.register("card",{type:"static",mount:Xc});w();function Gc(t){let e=[...t.querySelectorAll("[b-carousel-slide]")],s=t.querySelector("[b-carousel-prev]"),a=t.querySelector("[b-carousel-next]");if(t.classList.add("carousel","slide"),e.length&&!e[0].parentElement.classList.contains("carousel-inner")){let h=document.createElement("div");h.classList.add("carousel-inner"),e[0].before(h),e.forEach(g=>h.appendChild(g))}let n=Math.max(0,e.findIndex(h=>h.getAttribute("b-att-state")==="active"));e.forEach((h,g)=>{h.classList.add("carousel-item"),g===n&&h.classList.add("active"),h.setAttribute("b-att-state",g===n?"active":"inactive")});let i=e.length?new(L()).Carousel(t,{interval:!1,wrap:!0,touch:!0}):null,u=h=>{e.forEach((g,S)=>{g.setAttribute("b-att-state",S===h.to?"active":"inactive")}),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{index:h.to}}))};t.addEventListener("slid.bs.carousel",u);let p=()=>i?.prev(),b=()=>i?.next();return s?.addEventListener("click",p),a?.addEventListener("click",b),{destroy:()=>{s?.removeEventListener("click",p),a?.removeEventListener("click",b),t.removeEventListener("slid.bs.carousel",u),i?.dispose()}}}d.register("carousel",{type:"owl",mount:Gc});w();function Ci(t,e,s=0){let a=Number(t.getAttribute(e));return Number.isFinite(a)?a:s}function Yc(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 Jc(t,e){let s=globalThis.getComputedStyle(t),a=[1,2,3,4,5].map(u=>s.getPropertyValue(`--b-chart-${u}`).trim()),n=s.getPropertyValue("--b-muted-foreground").trim(),i=s.getPropertyValue("--b-chart-grid").trim()||s.getPropertyValue("--b-border").trim();return e.options={maintainAspectRatio:!1,plugins:{legend:{labels:{boxWidth:8,boxHeight:8,color:n,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:n,font:{size:12}}},y:{border:{display:!1},grid:{color:i},ticks:{color:n,font:{size:12}}},...e.options?.scales||{}},...e.options},e.data?.datasets?.forEach((u,p)=>{u.backgroundColor||(u.backgroundColor=a[p%a.length]),u.borderColor||(u.borderColor=a[p%a.length]),u.borderRadius??(u.borderRadius=4)}),e}function Qc(t,e,s){if(t.querySelector("[b-chart-tooltip]"))return;let a=document.createElement("span");a.setAttribute("b-chart-tooltip",""),a.textContent=`${e}: ${s}`,t.append(a)}function tl(t){t.classList.add("bu-chart"),t.setAttribute("role",t.getAttribute("role")||"figure");let e=t.querySelector("canvas"),s=null;if(e&&globalThis.Chart){let i=Yc(t);i&&(s=new globalThis.Chart(e,Jc(t,i)))}let a=[...t.querySelectorAll("[b-att-value]")],n=Math.max(1,...a.map(i=>Ci(i,"b-att-value")));return a.forEach((i,u)=>{let p=Ci(i,"b-att-value"),b=i.getAttribute("b-att-label")||i.textContent.trim()||`Series ${u+1}`,h=Math.max(0,Math.min(100,p/n*100));i.style.setProperty("--b-chart-value",`${h}%`),i.style.setProperty("--b-chart-index",String(u%5+1)),i.style.setProperty("--b-chart-color",`var(--b-chart-${u%5+1})`),i.setAttribute("role",i.getAttribute("role")||"listitem"),i.setAttribute("aria-label",i.getAttribute("aria-label")||`${b} ${p}`),Qc(i,b,p)}),[...t.querySelectorAll("[b-chart-series], [b-chart-legend] > *")].forEach((i,u)=>{i.style.setProperty("--b-chart-color",i.style.getPropertyValue("--b-chart-color")||`var(--b-chart-${u%5+1})`)}),{destroy:()=>{s?.destroy?.(),t.classList.remove("bu-chart")}}}d.register("chart",{type:"static",mount:tl});w();function pa(t,e){let s=t.matches("input")?t:t.querySelector(`input[type='${e}']`),a=t.matches("input")?t.closest("label, .form-check"):t;return s?.classList.add("form-check-input"),a?.classList.add("form-check","bu-check"),{destroy:()=>{s?.classList.remove("form-check-input"),a?.classList.remove("form-check","bu-check")}}}d.register("checkbox",{type:"static",mount:t=>pa(t,"checkbox")});w();tt();Gr();function el(t){let e=t.getAttribute("b-att-value");if(e!==null)return e;let s=t.getAttribute("b-att-target");if(s){let a=document.querySelector(s);if(a)return a.textContent??""}return t.textContent??""}function sl(t){t.classList.remove(...ya),t.className=`${t.className} ${Xr({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",a=t.getAttribute("b-att-copied-icon")||"check";P(e,s,{label:""});let n=null,i=async()=>{if(t.disabled)return;let u=el(t);try{await Oe(u),P(e,a,{label:""}),t.setAttribute("data-copied","true"),t.dispatchEvent(new CustomEvent("baseui:clipboard-copy",{bubbles:!0,detail:{value:u}})),window.clearTimeout(n),n=window.setTimeout(()=>{P(e,s,{label:""}),t.removeAttribute("data-copied")},Number(t.getAttribute("b-att-reset-delay"))||2e3)}catch(p){t.dispatchEvent(new CustomEvent("baseui:clipboard-copy-error",{bubbles:!0,detail:{error:p}}))}};return t.addEventListener("click",i),{destroy:()=>{t.removeEventListener("click",i),window.clearTimeout(n),e.remove(),t.classList.remove(...ya),t.removeAttribute("data-copied")}}}d.register("clipboard-button",{type:"static",mount:sl});w();function ol(t){let e=t.querySelector("[b-collapsible-trigger]"),s=t.querySelector("[b-collapsible-panel]"),a=h=>{t.setAttribute("b-att-state",h?"open":"closed"),e?.setAttribute("aria-expanded",String(h)),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{open:h}}))};if(!s){let h=()=>a(t.getAttribute("b-att-state")!=="open");return e?.setAttribute("aria-expanded",String(t.getAttribute("b-att-state")==="open")),e?.addEventListener("click",h),{destroy:()=>e?.removeEventListener("click",h)}}let n=t.getAttribute("b-att-state")==="open";s.classList.add("collapse"),n&&s.classList.add("show");let i=new(L()).Collapse(s,{toggle:!1}),u=()=>a(!0),p=()=>a(!1);s.addEventListener("shown.bs.collapse",u),s.addEventListener("hidden.bs.collapse",p),e?.setAttribute("aria-expanded",String(n));let b=()=>{s.classList.contains("show")?i.hide():i.show()};return e?.addEventListener("click",b),{destroy:()=>{e?.removeEventListener("click",b),s.removeEventListener("shown.bs.collapse",u),s.removeEventListener("hidden.bs.collapse",p),i.dispose()}}}d.register("collapsible",{type:"owl",mount:ol});w();function rl(t){let e=t.querySelector("input"),s=t.querySelector("[b-combobox-list]"),a=()=>[...s?.querySelectorAll("[b-att-value]")||[]];t.classList.add("bu-combobox"),e?.setAttribute("role","combobox"),e?.setAttribute("aria-expanded","false"),s?.setAttribute("role","listbox"),s&&(s.hidden=!0);let n=p=>{s&&(s.hidden=!p),e?.setAttribute("aria-expanded",String(p))},i=()=>{let p=e.value.toLowerCase();a().forEach(b=>{b.hidden=!b.textContent.toLowerCase().includes(p)}),n(!0)},u=p=>{let b=p.target.closest("[b-att-value]");b&&(e.value=b.textContent.trim(),t.setAttribute("b-att-value",b.getAttribute("b-att-value")),n(!1),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:b.getAttribute("b-att-value")}})))};return e?.addEventListener("input",i),e?.addEventListener("focus",()=>n(!0)),s?.addEventListener("click",u),{destroy:()=>{e?.removeEventListener("input",i),s?.removeEventListener("click",u)}}}d.register("combobox",{type:"owl",mount:rl});w();function al(t){let e=t.querySelector("input"),s=()=>[...t.querySelectorAll("[b-command-item]")];t.classList.add("bu-command"),t.setAttribute("role",t.getAttribute("role")||"dialog"),e?.classList.add("form-control");let a=()=>{let i=(e?.value||"").toLowerCase();s().forEach(u=>{u.hidden=!u.textContent.toLowerCase().includes(i)})},n=i=>{let u=i.target.closest("[b-command-item]");u&&t.dispatchEvent(new CustomEvent("baseui:select",{bubbles:!0,detail:{value:u.getAttribute("b-att-value")||u.textContent.trim()}}))};return e?.addEventListener("input",a),t.addEventListener("click",n),{destroy:()=>{e?.removeEventListener("input",a),t.removeEventListener("click",n)}}}d.register("command",{type:"owl",mount:al});w();function il(t){let e=t.querySelector("[b-context-menu-content]");if(!e)return{};e.hidden=!0,e.setAttribute("role","menu");let s=i=>{i.preventDefault(),e.hidden=!1,e.style.left=`${i.clientX}px`,e.style.top=`${i.clientY}px`,t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},a=()=>{e.hidden=!0,t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))},n=i=>{i.key==="Escape"&&a()};return t.addEventListener("contextmenu",s),document.addEventListener("click",a),t.addEventListener("keydown",n),{destroy:()=>{t.removeEventListener("contextmenu",s),document.removeEventListener("click",a),t.removeEventListener("keydown",n)}}}d.register("context-menu",{type:"owl",mount:il});w();tt();var Li=[["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 nl(t){t.querySelector("table")||(t.innerHTML=`
|
|
20
20
|
<div class="bu-data-table__toolbar">
|
|
21
21
|
<input b-table-search type="search" class="form-control bu-data-table__search" placeholder="Filter emails...">
|
|
22
22
|
<div class="bu-data-table__columns"><button type="button" class="btn bu-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>
|
|
@@ -24,11 +24,11 @@ var fi=Object.defineProperty;var Lp=(t,e,o)=>e in t?fi(t,e,{enumerable:!0,config
|
|
|
24
24
|
<div class="bu-data-table__viewport">
|
|
25
25
|
<table class="table bu-data-table__table">
|
|
26
26
|
<thead><tr><th class="bu-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="bu-data-table__sort-icon" data-icon="arrow-up-down" aria-hidden="true"></span></th><th class="text-end">Amount</th><th class="bu-data-table__actions-cell"><span class="visually-hidden">Actions</span></th></tr></thead>
|
|
27
|
-
<tbody>${
|
|
27
|
+
<tbody>${Li.map(e=>`<tr data-row-key="${e[0]}"><td class="bu-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="bu-data-table__money">${e[3]}</span></td><td class="bu-data-table__actions-cell"><button type="button" class="btn bu-button btn-ghost bu-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>
|
|
28
28
|
</table>
|
|
29
29
|
</div>
|
|
30
30
|
<div class="bu-data-table__cards">
|
|
31
|
-
${
|
|
31
|
+
${Li.map(e=>`<div class="bu-data-table__card" data-row-key="${e[0]}">
|
|
32
32
|
<div class="bu-data-table__card-header"><input type="checkbox" class="form-check-input" aria-label="Select row"><div class="bu-data-table__actions"><button type="button" class="btn bu-button btn-ghost bu-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>
|
|
33
33
|
<div class="bu-data-table__card-field"><span class="bu-data-table__card-label">Status</span><span class="bu-data-table__card-value">${e[1]}</span></div>
|
|
34
34
|
<div class="bu-data-table__card-field"><span class="bu-data-table__card-label">Email</span><span class="bu-data-table__card-value">${e[2]}</span></div>
|
|
@@ -36,4 +36,4 @@ var fi=Object.defineProperty;var Lp=(t,e,o)=>e in t?fi(t,e,{enumerable:!0,config
|
|
|
36
36
|
</div>`).join("")}
|
|
37
37
|
</div>
|
|
38
38
|
<div class="bu-data-table__pagination"><div class="bu-data-table__selection-summary">0 of 5 row(s) selected.</div><div class="bu-data-table__pager"><button type="button" class="btn bu-button btn-outline-secondary btn-sm" disabled>Previous</button><button type="button" class="btn bu-button btn-outline-secondary btn-sm" disabled>Next</button></div></div>
|
|
39
|
-
`)}function su(t){ou(t),t.querySelectorAll("[b-icon]").forEach(A=>z(A,A.getAttribute("b-icon"),{label:""}));let e=t.querySelector("table")||t,o=t.querySelector("[b-table-search]"),r=t.querySelector(".bu-data-table__selection-summary"),i=t.getAttribute("b-att-variant");t.classList.add("bu-data-table"),i&&t.classList.add(`bu-data-table-${i}`),e.classList.add("table");let a=t.querySelector(".bu-data-table__cards"),p=()=>[...e.querySelectorAll("tbody tr")],l=A=>a?.querySelector(`[data-row-key="${A.dataset.rowKey}"]`),u=()=>[...e.querySelectorAll("tbody input[type='checkbox']")],b=()=>{r&&(r.textContent=`${u().filter(A=>A.checked).length} of ${p().filter(A=>!A.hidden).length} row(s) selected.`)},h=()=>{let A=(o?.value||"").toLowerCase();p().forEach(R=>{let k=!(R.cells[2]||R.cells[1]||R.cells[0]).textContent.toLowerCase().includes(A);R.hidden=k;let H=l(R);H&&(H.hidden=k)}),b()},y=(A,R)=>{let D=e.tBodies[0];p().sort((k,H)=>k.cells[A].textContent.localeCompare(H.cells[A].textContent)*R).forEach(k=>{D.append(k);let H=l(k);H&&a.append(H)})},x=A=>{let R=A.target.closest("th");if(!R)return;let D=R.getAttribute("b-att-sort")==="asc"?-1:1;e.querySelectorAll("th").forEach(k=>k.removeAttribute("b-att-sort")),R.setAttribute("b-att-sort",D===1?"asc":"desc"),y([...R.parentElement.children].indexOf(R),D)},L=(A,R)=>{let k=l(A)?.querySelector("input[type='checkbox']");k&&k.checked!==R&&(k.checked=R)},N=A=>{let R=A.target;if(R?.matches("input[type='checkbox']")){let D=R.closest("tr"),k=R.closest(".bu-data-table__card");if(D)L(D,R.checked);else if(k){let X=p().find(Qr=>Qr.dataset.rowKey===k.dataset.rowKey)?.querySelector("input[type='checkbox']");X&&X.checked!==R.checked&&(X.checked=R.checked)}}b()};return o?.addEventListener("input",h),e.tHead?.addEventListener("click",x),e.addEventListener("change",N),a?.addEventListener("change",N),b(),{destroy:()=>{o?.removeEventListener("input",h),e.tHead?.removeEventListener("click",x),e.removeEventListener("change",N),a?.removeEventListener("change",N)}}}c.register("data-table",{type:"owl",mount:su});v();function ru(t){let e=t.matches("input")?t:t.querySelector("input[type='date'], input");t.classList.add("bu-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("baseui:change",{bubbles:!0,detail:{value:e.value}}))};return e?.addEventListener("input",o),{destroy:()=>e?.removeEventListener("input",o)}}c.register("date-picker",{type:"owl",mount:ru});v();M();function au(t){let e=t.getAttribute("b-att-trigger"),o=e?document.querySelector(e):null,r=t.querySelector("[b-dialog-panel]");if(t.classList.add("modal","fade","bu-dialog-backdrop"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),r){let x=document.createElement("div");x.className="modal-dialog modal-dialog-centered",r.replaceWith(x),x.append(r),r.classList.add("modal-content")}[...t.querySelectorAll("[b-dialog-close]")].forEach(x=>x.setAttribute("data-bs-dismiss","modal"));let a=E().Modal.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,focus:!0}),p=null,l=()=>{p=document.activeElement},u=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},b=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0})),p?.focus?.(),p=null};t.addEventListener("show.bs.modal",l),t.addEventListener("shown.bs.modal",u),t.addEventListener("hidden.bs.modal",b);let h=()=>a.show(),y=()=>a.hide();return o?.addEventListener("click",h),t.setAttribute("b-att-state","closed"),t.BaseUIDialog={open:h,close:y},{destroy:()=>{o?.removeEventListener("click",h),t.removeEventListener("show.bs.modal",l),t.removeEventListener("shown.bs.modal",u),t.removeEventListener("hidden.bs.modal",b),a.dispose(),delete t.BaseUIDialog}}}c.register("dialog",{type:"owl",mount:au});v();function iu(t){let e=t.getAttribute("b-att-dir")||t.getAttribute("dir")||"ltr";return t.setAttribute("dir",e==="rtl"?"rtl":"ltr"),{}}c.register("direction",{type:"static",mount:iu});v();M();function nu(t){let e=t.getAttribute("b-att-trigger"),o=e?document.querySelector(e):null;t.classList.add("offcanvas","offcanvas-bottom","bu-drawer-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-drawer-close]")].forEach(y=>y.setAttribute("data-bs-dismiss","offcanvas"));let i=E().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1}),a=null,p=()=>{a=document.activeElement},l=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},u=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0})),a?.focus?.(),a=null};t.addEventListener("show.bs.offcanvas",p),t.addEventListener("shown.bs.offcanvas",l),t.addEventListener("hidden.bs.offcanvas",u);let b=()=>i.show(),h=()=>i.hide();return o?.addEventListener("click",b),t.setAttribute("b-att-state","closed"),t.BaseUIDrawer={open:b,close:h},{destroy:()=>{o?.removeEventListener("click",b),t.removeEventListener("show.bs.offcanvas",p),t.removeEventListener("shown.bs.offcanvas",l),t.removeEventListener("hidden.bs.offcanvas",u),i.dispose(),delete t.BaseUIDrawer}}}c.register("drawer",{type:"owl",mount:nu});v();M();ot();var Ap="a, button, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']";function wp(t,e){t?.classList.add(e)}function pu(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(z(document.createElement("span"),"check")),t.prepend(o)}function lu(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")}),t.querySelectorAll("[b-dropdown-separator]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-separator"),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.setAttribute("aria-checked",e.hasAttribute("checked")||e.getAttribute("aria-checked")==="true"?"true":"false"),pu(e,e.getAttribute("aria-checked")==="true")}),t.querySelectorAll(Ap).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")})}function cu(t){let e=[];return t.querySelectorAll("[b-dropdown-sub]").forEach(o=>{let r=o.querySelector("[b-dropdown-sub-trigger]"),i=o.querySelector("[b-dropdown-sub-content]");if(!r||!i)return;if(wp(r,"bu-dropdown-menu-sub-trigger"),wp(i,"bu-dropdown-menu-sub-content"),r.setAttribute("data-slot","dropdown-menu-sub-trigger"),r.setAttribute("role","menuitem"),r.setAttribute("aria-haspopup","menu"),i.setAttribute("data-slot","dropdown-menu-sub-content"),i.setAttribute("role","menu"),i.hidden=!0,!r.querySelector(".bu-dropdown-menu-sub-trigger-icon")){let b=z(document.createElement("span"),"chevron-right");b.classList.add("bu-dropdown-menu-sub-trigger-icon"),r.append(b)}let a=b=>{i.hidden=!b,r.setAttribute("data-state",b?"open":"closed"),r.setAttribute("aria-expanded",String(b))},p=()=>a(!0),l=()=>a(!1),u=b=>{b.preventDefault(),a(i.hidden)};o.addEventListener("mouseenter",p),o.addEventListener("mouseleave",l),r.addEventListener("focus",p),r.addEventListener("click",u),e.push(()=>{o.removeEventListener("mouseenter",p),o.removeEventListener("mouseleave",l),r.removeEventListener("focus",p),r.removeEventListener("click",u)})}),()=>e.forEach(o=>o())}function uu(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=E().Dropdown.getOrCreateInstance(e),i=x=>{t.setAttribute("b-att-state",x?"open":"closed"),e.setAttribute("aria-expanded",String(x)),t.dispatchEvent(new CustomEvent(x?"baseui:open":"baseui:close",{bubbles:!0}))},a=()=>i(!0),p=()=>i(!1);e.addEventListener("shown.bs.dropdown",a),e.addEventListener("hidden.bs.dropdown",p);let l=()=>r.toggle();e.addEventListener("click",l);let u=x=>{x.key==="Escape"?(r.hide(),e.focus()):x.key==="ArrowDown"&&!o.classList.contains("show")&&(x.preventDefault(),r.show(),[...o.querySelectorAll("a, button, [tabindex]:not([tabindex='-1'])")][0]?.focus())};t.addEventListener("keydown",u);let b=x=>{t.contains(x.target)||r.hide()};document.addEventListener("click",b),lu(o);let h=cu(o),y=x=>{let L=x.target.closest(Ap);!L||L.closest("[b-dropdown-sub]")||r.hide()};return o.addEventListener("click",y),{destroy:()=>{h(),o.removeEventListener("click",y),document.removeEventListener("click",b),t.removeEventListener("keydown",u),e.removeEventListener("click",l),e.removeEventListener("shown.bs.dropdown",a),e.removeEventListener("hidden.bs.dropdown",p),r.dispose()}}}c.register("dropdown-menu",{type:"owl",mount:uu});v();var hi={default:"bu-empty-default",outline:"bu-empty-outline",background:"bu-empty-background"};function du(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("bu-empty",hi[e]||hi.default),t.querySelectorAll("[b-empty-header]").forEach(r=>r.classList.add("bu-empty-header")),t.querySelectorAll("[b-empty-title]").forEach(r=>r.classList.add("bu-empty-title")),t.querySelectorAll("[b-empty-description]").forEach(r=>r.classList.add("bu-empty-description")),t.querySelectorAll("[b-empty-content]").forEach(r=>r.classList.add("bu-empty-content")),o.forEach(r=>{let i=r.getAttribute("b-att-variant")==="icon"?"icon":"default";r.classList.add("bu-empty-media",`bu-empty-media-${i}`),r.setAttribute("data-variant",i)}),{destroy:()=>{t.classList.remove("bu-empty",...Object.values(hi))}}}c.register("empty",{type:"owl",mount:du});v();function La(t,e){t?.classList.add(...e.filter(Boolean))}function Jt(t,e,o,r){t.querySelectorAll(e).forEach(i=>{i.setAttribute("data-slot",o),La(i,[r])})}function bu(t){return t.querySelector("input, textarea, select, [role='checkbox'], [role='radio'], [role='switch']")}function mu(t,e){return e.id?e.id:`${t?.id||"bu-field"}-error`}function hu(t){let e=t.getAttribute("b-att-slot")||t.getAttribute("data-slot")||"field",o=[];if(e==="field-set")t.setAttribute("data-slot","field-set"),La(t,["bu-field-set"]),o.push("bu-field-set");else if(e==="field-group")t.setAttribute("data-slot","field-group"),La(t,["bu-field-group"]),o.push("bu-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),La(t,["bu-field",`bu-field-orientation-${a}`]),o.push("bu-field",`bu-field-orientation-${a}`)}Jt(t,"legend[b-field-legend], [b-field-legend]","field-legend","bu-field-legend"),Jt(t,"[b-field-group]","field-group","bu-field-group"),Jt(t,"[b-field-content]","field-content","bu-field-content"),Jt(t,"label[b-field-label], [b-field-label], [b-label]","field-label","bu-field-label"),Jt(t,"[b-field-title]","field-label","bu-field-title"),Jt(t,"[b-field-description]","field-description","bu-field-description"),Jt(t,"[b-field-separator]","field-separator","bu-field-separator"),Jt(t,"[b-field-error], [b-error]","field-error","bu-field-error"),t.querySelectorAll("[b-field-separator]").forEach(a=>{if(!a.querySelector(".bu-field-separator-line")){let p=document.createElement("span");p.className="bu-field-separator-line",p.setAttribute("aria-hidden","true"),a.prepend(p)}a.textContent.trim()&&a.setAttribute("data-content","true")});let r=bu(t),i=t.querySelector("[b-field-error], [b-error], [data-slot='field-error']");if(r&&i){i.setAttribute("role",i.getAttribute("role")||"alert");let a=mu(r,i);i.id=a,r.setAttribute("aria-describedby",a),r.setAttribute("aria-invalid","true"),t.setAttribute("data-invalid","true")}return{destroy:()=>t.classList.remove(...o)}}c.register("field",{type:"static",mount:hu});v();function gu(t){t.classList.add("bu-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], .bu-form-counter-text"),i=Number(o?.getAttribute("maxlength")||100),a=()=>{r&&o&&(r.textContent=`${o.value.length}/${i} characters`)},p=()=>{e&&(e.value=""),o&&(o.value=""),a()},l=t.querySelector("[b-form-reset]");return l?.addEventListener("click",p),o?.addEventListener("input",a),a(),{destroy(){l?.removeEventListener("click",p),o?.removeEventListener("input",a)}}}c.register("form",{type:"static",mount:gu});v();function fu(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")},i=()=>{o.hidden=!0,e.setAttribute("aria-expanded","false")},a=p=>{p.key==="Escape"&&i()};return e.setAttribute("aria-haspopup","dialog"),o.setAttribute("role","dialog"),i(),t.addEventListener("mouseenter",r),t.addEventListener("mouseleave",i),t.addEventListener("focusin",r),t.addEventListener("focusout",i),t.addEventListener("keydown",a),{destroy:()=>{t.removeEventListener("mouseenter",r),t.removeEventListener("mouseleave",i),t.removeEventListener("focusin",r),t.removeEventListener("focusout",i),t.removeEventListener("keydown",a)}}}c.register("hover-card",{type:"owl",mount:fu});v();ot();function yu(t){let e=t.getAttribute("b-icon")||t.getAttribute("b-att-icon")||t.getAttribute("aria-label");return e?(z(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("bu-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")}}):{}}c.register("icon",{type:"static",mount:yu});v();za();function vu(t){let e=pa({tag:t.tagName.toLowerCase(),type:t.getAttribute("type")});return t.classList.add(e),{destroy:()=>t.classList.remove(e)}}c.register("input",{type:"static",mount:vu});v();_a();function Su(t){t.classList.add("bu-input-group"),t.setAttribute("role",t.getAttribute("role")||"group"),t.setAttribute("data-slot","input-group");let e=[...t.querySelectorAll("[b-input-group-addon], [b-input-group-text], [b-input-group-button]")],o=[...t.querySelectorAll("[b-input-group-button]")],r=[...t.querySelectorAll("input, textarea, [data-slot='input-group-control']")],i=a=>{a.target.closest("button")||ua(a.currentTarget)};return e.forEach(a=>{if(a.matches("[b-input-group-addon]")){let p=De[a.getAttribute("b-att-align")]?a.getAttribute("b-att-align"):"inline-start";a.classList.add("bu-input-group-addon",De[p]),a.setAttribute("data-align",p),a.setAttribute("data-slot","input-group-addon"),a.setAttribute("role",a.getAttribute("role")||"group"),a.addEventListener("click",i)}a.matches("[b-input-group-text]")&&(a.classList.add("bu-input-group-text"),a.setAttribute("data-slot","input-group-text"))}),o.forEach(a=>{let p=_e[a.getAttribute("b-att-size")]?a.getAttribute("b-att-size"):"xs",l=Fe[a.getAttribute("b-att-variant")]||Fe.ghost;a.classList.add("btn","bu-button","bu-input-group-button",l,_e[p]),a.setAttribute("data-size",p),a.setAttribute("data-slot","input-group-button"),a.getAttribute("type")||a.setAttribute("type","button")}),r.forEach(a=>{a.classList.add("bu-input-group-control"),a.setAttribute("data-slot","input-group-control"),a.matches("input")&&a.classList.add("bu-input-group-input"),a.matches("textarea")&&a.classList.add("bu-input-group-textarea")}),{destroy:()=>{t.classList.remove("bu-input-group"),t.removeAttribute("data-slot"),e.forEach(a=>{a.removeEventListener("click",i),a.classList.remove("bu-input-group-addon","bu-input-group-text",...Object.values(De)),a.removeAttribute("data-align"),a.removeAttribute("data-slot")}),o.forEach(a=>{a.classList.remove("btn","bu-button","bu-input-group-button",...Object.values(Fe),...Object.values(_e)),a.removeAttribute("data-size"),a.removeAttribute("data-slot")}),r.forEach(a=>{a.classList.remove("bu-input-group-control","bu-input-group-input","bu-input-group-textarea"),a.removeAttribute("data-slot")})}}}c.register("input-group",{type:"static",mount:Su});v();function xu(t){let e=[...t.querySelectorAll("input")];t.classList.add("bu-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(p=>p.value).join("");t.setAttribute("b-att-value",a),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:a}}))},r=a=>{let p=e.indexOf(a.target);a.target.value&&e[p+1]&&e[p+1].focus(),o()},i=a=>{let p=a.clipboardData.getData("text").trim();p&&(a.preventDefault(),e.forEach((l,u)=>{l.value=p[u]||""}),o())};return e.forEach(a=>a.addEventListener("input",r)),t.addEventListener("paste",i),{destroy:()=>{e.forEach(a=>a.removeEventListener("input",r)),t.removeEventListener("paste",i)}}}c.register("input-otp",{type:"owl",mount:xu});v();function wu(t){return t.classList.add("bu-item"),{destroy:()=>t.classList.remove("bu-item")}}c.register("item",{type:"static",mount:wu});v();function Au(t){return t.classList.add("bu-kbd"),{destroy:()=>t.classList.remove("bu-kbd")}}c.register("kbd",{type:"static",mount:Au});v();function Eu(t){return t.classList.add("form-label","b-label","bu-label"),t.getAttribute("b-att-required")==="true"&&t.setAttribute("b-att-state","required"),{destroy:()=>t.classList.remove("form-label","b-label","bu-label")}}c.register("label",{type:"static",mount:Eu});v();function Cu(t){return t.classList.add("bu-marker"),{destroy:()=>t.classList.remove("bu-marker")}}c.register("marker",{type:"static",mount:Cu});v();Sa();ui();function Lu(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 ku(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function Nu(t){t.classList.add("bu-markdown");let e=t.getAttribute("b-att-src"),o=t.getAttribute("b-att-mermaid")!=="false",r=t.getAttribute("b-att-base-ui")!=="false",i=t.getAttribute("b-att-editable")==="true",a=t.getAttribute("b-att-collaborative")==="true",p=t.getAttribute("b-att-room")||"bu-markdown",l=t.getAttribute("b-att-password")||void 0,u=ku(t.getAttribute("b-att-signaling")),b=!1,h=null;function y(L){b||(t.setAttribute("data-status","error"),t.textContent=`Unable to render Markdown: ${L?.message||L}`,t.dispatchEvent(new CustomEvent("baseui:markdown-error",{bubbles:!0,detail:{error:L}})))}async function x(){let L=Lu(t);t.setAttribute("data-status","loading");let N=L;if(e)try{let k=await fetch(e);if(!k.ok)throw new Error(`${k.status} ${k.statusText}`);N=await k.text()}catch(k){y(k);return}if(i){t.replaceChildren(),t.classList.add("bu-markdown-editable"),t.setAttribute("data-status","ready");let k=document.createElement("div");k.className="bu-markdown-editor",k.setAttribute("data-slot","markdown-editor"),k.setAttribute("role","group"),k.setAttribute("aria-label",a?"Collaborative Markdown editor":"Markdown editor"),t.append(k);try{if(h=await Yr({root:k,value:N,collaborative:a,room:p,password:l,signaling:u,onChange:(H,X)=>{t.dispatchEvent(new CustomEvent("baseui:markdown-change",{bubbles:!0,detail:{markdown:H,previousMarkdown:X}}))}}),b){h?.destroy?.(),h=null;return}}catch(H){y(H);return}t.dispatchEvent(new CustomEvent("baseui:markdown-editor-ready",{bubbles:!0,detail:{collaborative:a,room:p}}));return}let{data:A,content:R}=xa(N),D;try{D=await Xr(R)}catch(k){y(k);return}b||(t.innerHTML=D,t.setAttribute("data-status","ready"),await Gr(t,{mermaid:o,baseUi:r}),b||t.dispatchEvent(new CustomEvent("baseui:markdown-render",{bubbles:!0,detail:{html:D,frontmatter:A}})))}return x(),{destroy:()=>{b=!0,h?.destroy?.(),h=null,zr(t),t.classList.remove("bu-markdown"),t.classList.remove("bu-markdown-editable"),t.removeAttribute("data-status")}}}c.register("markdown",{type:"static",mount:Nu});v();function Ou(t){return t.classList.add("bu-message"),t.setAttribute("b-att-side",t.getAttribute("b-att-side")||"incoming"),t.setAttribute("role",t.getAttribute("role")||"listitem"),{}}c.register("message",{type:"static",mount:Ou});v();function Bu(t){t.classList.add("bu-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()}}c.register("message-scroller",{type:"owl",mount:Bu});v();function Iu(t){t.setAttribute("role","menubar"),t.classList.add("bu-menubar");for(let e of t.querySelectorAll("a, button"))e.setAttribute("role","menuitem");return{destroy:()=>t.classList.remove("bu-menubar")}}c.register("menubar",{type:"static",mount:Iu});v();function ju(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")}}c.register("native-select",{type:"static",mount:ju});v();function Ru(t){let e=[...t.querySelectorAll("a, button")].filter(r=>!r.disabled),o=r=>{let i=e.indexOf(r.target),a=r.key==="ArrowRight"?1:r.key==="ArrowLeft"?-1:0;!a||i<0||(r.preventDefault(),e[(i+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)}}c.register("navigation-menu",{type:"owl",mount:Ru});v();function $u(t){let e=t.querySelector("ol, ul")||t,o=[...e.children];return t.classList.add("bu-pagination"),e.classList.add("pagination"),o.forEach(r=>{let i=r.querySelector("a, button");r.classList.add("page-item"),i?.classList.add("page-link"),i?.getAttribute("aria-current")==="page"&&r.classList.add("active"),(i?.hasAttribute("disabled")||i?.getAttribute("aria-disabled")==="true")&&r.classList.add("disabled")}),t.setAttribute("aria-label",t.getAttribute("aria-label")||"Pagination"),{destroy:()=>{t.classList.remove("bu-pagination"),e.classList.remove("pagination")}}}c.register("pagination",{type:"owl",mount:$u});v();M();function Tu(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 i=new(E()).Popover(e,{content:r,html:!0,trigger:"click"}),a=()=>{t.setAttribute("b-att-state","open"),e.setAttribute("aria-expanded","true"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},p=()=>{t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))};return e.addEventListener("shown.bs.popover",a),e.addEventListener("hidden.bs.popover",p),t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),{destroy:()=>{e.removeEventListener("shown.bs.popover",a),e.removeEventListener("hidden.bs.popover",p),i.dispose()}}}c.register("popover",{type:"owl",mount:Tu});v();function Uu(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("bu-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.setAttribute("b-progress-indicator",""),t.append(r)}return{destroy:()=>t.classList.remove("bu-progress")}}c.register("progress",{type:"static",mount:Uu});v();Vr();function qu(t){let{open:e,close:o,destroy:r}=ba(t,{closeSelector:"[b-pwa-close]"});return t.BaseUIPwa={open:e,close:o},{destroy:()=>{r(),delete t.BaseUIPwa}}}c.register("pwa",{type:"owl",mount:qu});v();function Mu(t){let e=[...t.querySelectorAll("[b-question]")],o=t.querySelector("[b-question-prev]"),r=t.querySelector("[b-question-next]"),i=0,a=u=>{i=Math.min(e.length-1,Math.max(0,u)),e.forEach((b,h)=>{b.hidden=h!==i,b.setAttribute("b-att-state",h===i?"active":"inactive")}),o&&(o.disabled=i===0),r&&(r.disabled=i===e.length-1),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{index:i}}))},p=()=>a(i-1),l=()=>a(i+1);return o?.addEventListener("click",p),r?.addEventListener("click",l),e.length&&a(0),{destroy:()=>{o?.removeEventListener("click",p),r?.removeEventListener("click",l)}}}c.register("questionnaire",{type:"owl",mount:Mu});v();function zu(t){let e=t.matches("input")?t:t.querySelector("input[type='radio']"),o=t.matches("input")?t.closest("label, .form-check"):t;return e?.classList.add("form-check-input"),o?.classList.add("form-check","bu-check"),{destroy:()=>{e?.classList.remove("form-check-input"),o?.classList.remove("form-check","bu-check")}}}c.register("radio-group",{type:"static",mount:zu});v();function Pu(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),i=Number(t.getAttribute("b-att-max")||720),a=p=>{let l=p.clientX,u=e.getBoundingClientRect().width,b=y=>{e.style.width=`${Math.min(i,Math.max(r,u+y.clientX-l))}px`},h=()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",h),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{width:e.style.width}}))};document.addEventListener("pointermove",b),document.addEventListener("pointerup",h)};return o.addEventListener("pointerdown",a),{destroy:()=>o.removeEventListener("pointerdown",a)}}c.register("resizable",{type:"owl",mount:Pu});v();function Du(t){return t.classList.add("bu-scroll-area"),t.tabIndex=t.tabIndex>=0?t.tabIndex:0,t.setAttribute("role",t.getAttribute("role")||"region"),{}}c.register("scroll-area",{type:"static",mount:Du});v();function Fu(t){let e=t.getAttribute("b-att-orientation")==="vertical";return t.classList.add("bu-separator",e?"bu-separator-vertical":"bu-separator-horizontal"),t.setAttribute("role",t.getAttribute("role")||"separator"),t.setAttribute("aria-orientation",e?"vertical":"horizontal"),{destroy:()=>t.classList.remove("bu-separator","bu-separator-vertical","bu-separator-horizontal")}}c.register("separator",{type:"static",mount:Fu});v();function Ep(t,{triggerSelector:e,panelSelector:o,ariaHaspopup:r,panelRole:i,onKeyDown:a}={}){let p=t.querySelector(e),l=t.querySelector(o),u=x=>{!l||!p||(l.hidden=!x,t.setAttribute("b-att-state",x?"open":"closed"),p.setAttribute("aria-expanded",String(x)),t.dispatchEvent(new CustomEvent(x?"baseui:open":"baseui:close",{bubbles:!0})))},b=()=>u(l?.hidden!==!1),h=x=>{x.key==="Escape"&&(u(!1),p?.focus()),a?.(x,{setOpen:u,panel:l,trigger:p})},y=x=>{t.contains(x.target)||u(!1)};return p?.setAttribute("aria-haspopup",r),l?.setAttribute("role",i),l&&(l.hidden=!0),p?.addEventListener("click",b),t.addEventListener("keydown",h),document.addEventListener("click",y),{trigger:p,panel:l,setOpen:u,destroy:()=>{p?.removeEventListener("click",b),t.removeEventListener("keydown",h),document.removeEventListener("click",y)}}}function _u(t){let{setOpen:e,destroy:o}=Ep(t,{triggerSelector:"[b-select-trigger]",panelSelector:"[b-select-content]",ariaHaspopup:"listbox",panelRole:"listbox"}),r=t.querySelector("[b-select-trigger]"),i=t.querySelector("[b-select-value]"),a=p=>{let l=p.target.closest("[b-select-item]");if(!(!l||!t.contains(l))){for(let u of t.querySelectorAll("[b-select-item]"))u.setAttribute("aria-selected",String(u===l));i&&(i.textContent=l.textContent.trim()),t.setAttribute("b-att-value",l.getAttribute("b-att-value")||l.textContent.trim()),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:t.getAttribute("b-att-value")}})),e(!1),r?.focus()}};for(let p of t.querySelectorAll("[b-select-item]"))p.setAttribute("role","option");return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),o()}}}c.register("select",{type:"owl",mount:_u});v();function Hu(t){let e=[...t.querySelectorAll("[b-shell-collapse-trigger]")],o=i=>{t.setAttribute("b-att-collapsed",i?"true":"false"),t.dispatchEvent(new CustomEvent(i?"baseui:collapse":"baseui:expand",{bubbles:!0}))},r=()=>o(t.getAttribute("b-att-collapsed")!=="true");return e.forEach(i=>i.addEventListener("click",r)),o(t.getAttribute("b-att-collapsed")==="true"),t.BaseUIShell={collapse:()=>o(!0),expand:()=>o(!1),toggle:r},{destroy:()=>{e.forEach(i=>i.removeEventListener("click",r)),delete t.BaseUIShell}}}c.register("shell",{type:"owl",mount:Hu});v();M();function Wu(t){let e=t.getAttribute("b-att-trigger"),o=e?document.querySelector(e):null,r=t.getAttribute("b-att-side")==="left"?"offcanvas-start":"offcanvas-end";t.classList.add("offcanvas",r,"bu-sheet-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-sheet-close]")].forEach(x=>x.setAttribute("data-bs-dismiss","offcanvas"));let a=E().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1}),p=null,l=()=>{p=document.activeElement},u=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},b=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0})),p?.focus?.(),p=null};t.addEventListener("show.bs.offcanvas",l),t.addEventListener("shown.bs.offcanvas",u),t.addEventListener("hidden.bs.offcanvas",b);let h=()=>a.show(),y=()=>a.hide();return o?.addEventListener("click",h),t.setAttribute("b-att-state","closed"),t.BaseUISheet={open:h,close:y},{destroy:()=>{o?.removeEventListener("click",h),t.removeEventListener("show.bs.offcanvas",l),t.removeEventListener("shown.bs.offcanvas",u),t.removeEventListener("hidden.bs.offcanvas",b),a.dispose(),delete t.BaseUISheet}}}c.register("sheet",{type:"owl",mount:Wu});v();var Ku={"[b-sidebar-header]":["bu-sidebar-header","sidebar-header","header"],"[b-sidebar-content]":["bu-sidebar-content","sidebar-content","content"],"[b-sidebar-footer]":["bu-sidebar-footer","sidebar-footer","footer"],"[b-sidebar-group]":["bu-sidebar-group","sidebar-group","group"],"[b-sidebar-group-label]":["bu-sidebar-group-label","sidebar-group-label","group-label"],"[b-sidebar-group-action]":["bu-sidebar-group-action","sidebar-group-action","group-action"],"[b-sidebar-group-content]":["bu-sidebar-group-content","sidebar-group-content","group-content"],"[b-sidebar-menu]":["bu-sidebar-menu","sidebar-menu","menu"],"[b-sidebar-menu-item]":["bu-sidebar-menu-item","sidebar-menu-item","menu-item"],"[b-sidebar-menu-button]":["bu-sidebar-menu-button","sidebar-menu-button","menu-button"],"[b-sidebar-menu-action]":["bu-sidebar-menu-action","sidebar-menu-action","menu-action"],"[b-sidebar-menu-badge]":["bu-sidebar-menu-badge","sidebar-menu-badge","menu-badge"],"[b-sidebar-menu-sub]":["bu-sidebar-menu-sub","sidebar-menu-sub","menu-sub"],"[b-sidebar-menu-sub-item]":["bu-sidebar-menu-sub-item","sidebar-menu-sub-item","menu-sub-item"],"[b-sidebar-menu-sub-button]":["bu-sidebar-menu-sub-button","sidebar-menu-sub-button","menu-sub-button"],"[b-sidebar-separator]":["bu-sidebar-separator","sidebar-separator","separator"]};function Vu(t){let e=[];for(let[o,[r,i,a]]of Object.entries(Ku))for(let p of t.querySelectorAll(o))p.classList.add(r),p.dataset.slot=i,p.dataset.sidebar=a,(p.hasAttribute("b-att-active")||p.getAttribute("aria-current")==="page")&&(p.classList.add("is-active"),p.dataset.active="true"),e.push([p,r]);return e}function Zu(t){let e=t.getAttribute("b-att-trigger")?document.querySelector(t.getAttribute("b-att-trigger")):null,o=[...t.querySelectorAll("[b-sidebar-close]")],r=Vu(t),i=u=>{t.setAttribute("b-att-state",u?"open":"closed"),t.classList.toggle("is-open",u),t.dataset.state=u?"expanded":"collapsed",t.dispatchEvent(new CustomEvent(u?"baseui:open":"baseui:close",{bubbles:!0}))},a=()=>i(!0),p=()=>i(!1),l=u=>{u.key==="Escape"&&p()};return e?.addEventListener("click",a),o.forEach(u=>u.addEventListener("click",p)),t.addEventListener("keydown",l),t.dataset.sidebar="sidebar",t.dataset.slot="sidebar",i(t.getAttribute("b-att-state")==="open"),t.BaseUISidebar={open:a,close:p},{destroy:()=>{e?.removeEventListener("click",a),o.forEach(u=>u.removeEventListener("click",p)),t.removeEventListener("keydown",l);for(let[u,b]of r)u.classList.remove(b,"is-active"),u.removeAttribute("data-slot"),u.removeAttribute("data-sidebar"),u.removeAttribute("data-active");t.removeAttribute("data-sidebar"),t.removeAttribute("data-slot"),t.removeAttribute("data-state"),delete t.BaseUISidebar}}}c.register("sidebar",{type:"owl",mount:Zu});v();function Xu(t){t.classList.add("bu-slider");let e=()=>{t.style.setProperty("--b-slider-value",`${t.value}%`),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:t.value}}))};return e(),t.addEventListener("input",e),{destroy:()=>{t.removeEventListener("input",e),t.classList.remove("bu-slider")}}}c.register("slider",{type:"static",mount:Xu});v();function Gu(t){let e=t.getAttribute("b-att-shape")==="circle"?"bu-skeleton-circle":"bu-skeleton-block";return t.classList.add("bu-skeleton",e),t.setAttribute("aria-hidden",t.getAttribute("aria-hidden")||"true"),{destroy:()=>t.classList.remove("bu-skeleton","bu-skeleton-circle","bu-skeleton-block")}}c.register("skeleton",{type:"static",mount:Gu});v();function Yu(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")}}c.register("spinner",{type:"static",mount:Yu});v();function Ju(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","bu-switch"),{destroy:()=>{e?.classList.remove("form-check-input"),o?.classList.remove("form-check","form-switch","bu-switch")}}}c.register("switch",{type:"static",mount:Ju});v();function Qu(t){if(t.classList.add("table","bu-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","bu-table","table-striped","table-hover")}}}return{destroy:()=>t.classList.remove("table","bu-table","table-striped","table-hover")}}c.register("table",{type:"static",mount:Qu});v();M();Pa();function td(t){if(t.querySelector(":scope > .bu-tabs-panel-card"))return;let e=document.createElement("div");e.className="card bu-card bu-tabs-panel-card rounded-0",e.style.cssText="border-end-start-radius: 8px !important; border-end-end-radius: 4px !important;";let o=document.createElement("div");for(o.className="card-body";t.firstChild;)o.appendChild(t.firstChild);e.appendChild(o),t.appendChild(e)}function ed(t){t.classList.add("bu-tabs-host");let e=[...t.querySelectorAll("[b-tab]")],o=[...t.querySelectorAll("[b-panel]")],r=new Map(o.map(y=>[y.getAttribute("b-panel"),y])),i=new Map,a=new Map,p=new Map,l=new Map,u=e[0]?.parentElement;u&&!u.hasAttribute("role")&&u.setAttribute("role","tablist");let b=t.getAttribute("b-att-value")||e[0]?.getAttribute("b-tab")||"",h=y=>{t.setAttribute("b-att-value",y),e.forEach(x=>{x.tabIndex=x.getAttribute("b-tab")===y?0:-1}),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:y}}))};return e.forEach((y,x)=>{let L=y.getAttribute("b-tab"),N=r.get(L),A=L===b;if(y.setAttribute("role","tab"),y.tabIndex=A?0:-1,A&&y.classList.add("active"),N){let X=N.id||`bu-tabs-panel-${L}`;N.id=X,N.setAttribute("role","tabpanel"),N.classList.add("tab-pane","fade"),A&&N.classList.add("show","active"),td(N),y.setAttribute("data-bs-target",`#${X}`)}let R=E().Tab.getOrCreateInstance(y);i.set(y,R);let D=()=>R.show();y.addEventListener("click",D),a.set(y,D);let k=()=>h(L);y.addEventListener("shown.bs.tab",k),l.set(y,k);let H=X=>{let Qr=la(X.key,x,e.length);if(Qr===-1)return;X.preventDefault();let gi=e[Qr];gi.focus(),i.get(gi)?.show()};y.addEventListener("keydown",H),p.set(y,H)}),b&&t.setAttribute("b-att-value",b),{destroy:()=>{e.forEach(y=>{y.removeEventListener("click",a.get(y)),y.removeEventListener("keydown",p.get(y)),y.removeEventListener("shown.bs.tab",l.get(y)),i.get(y)?.dispose()}),a.clear(),p.clear(),l.clear(),i.clear()}}}c.register("tabs",{type:"owl",mount:ed});v();function od(t){return t.classList.add("form-control"),t.getAttribute("b-att-resize")==="none"&&t.classList.add("bu-textarea-no-resize"),{destroy:()=>t.classList.remove("form-control","bu-textarea-no-resize")}}c.register("textarea",{type:"static",mount:od});v();bi();function sd(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 rd(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function ad(t){t.classList.add("bu-text-editor");let e=t.getAttribute("b-att-src"),o=t.getAttribute("b-att-provider")||void 0,r=t.getAttribute("b-att-room")||"bu-text-editor",i=t.getAttribute("b-att-url")||void 0,a=Ca({collaborative:t.getAttribute("b-att-collaborative")==="true",providerType:o,url:i}),p=t.getAttribute("b-att-password")||void 0,l=rd(t.getAttribute("b-att-signaling")),u=t.getAttribute("b-att-placeholder")||void 0,b=!1,h=null;function y(L){b||(t.setAttribute("data-status","error"),t.textContent=`Unable to mount text editor: ${L?.message||L}`,t.dispatchEvent(new CustomEvent("baseui:text-editor-error",{bubbles:!0,detail:{error:L}})))}async function x(){t.setAttribute("data-status","loading");let L=sd(t);if(e)try{let A=await fetch(e);if(!A.ok)throw new Error(`${A.status} ${A.statusText}`);L=await A.text()}catch(A){y(A);return}t.replaceChildren();let N=document.createElement("div");N.className="bu-text-editor-shell",N.setAttribute("data-slot","text-editor-shell"),N.setAttribute("role","group"),N.setAttribute("aria-label",a?"Collaborative rich text editor":"Rich text editor"),t.append(N);try{if(h=await Ea({root:N,value:L,placeholder:u,collaborative:a,providerType:o,room:r,url:i,password:p,signaling:l,onChange:(A,R)=>{t.dispatchEvent(new CustomEvent("baseui:text-editor-change",{bubbles:!0,detail:{html:A,previousHtml:R}}))}}),b){h?.destroy?.(),h=null;return}}catch(A){y(A);return}t.setAttribute("data-status","ready"),t.dispatchEvent(new CustomEvent("baseui:text-editor-ready",{bubbles:!0,detail:{collaborative:a,room:r}}))}return x(),{destroy:()=>{b=!0,h?.destroy?.(),h=null,t.classList.remove("bu-text-editor"),t.removeAttribute("data-status")}}}c.register("text-editor",{type:"static",mount:ad});ot();v();Zr();si();function id(t,e){let o=Mr(e);t.classList.remove(...Fn),t.className=`${t.className} ${fa({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),z(r,o.icon,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url")});let i=t.querySelector("[b-theme-button-label]");i||(i=document.createElement("span"),i.className="visually-hidden",i.setAttribute("b-theme-button-label",""),t.append(i)),i.textContent=o.label}function nd(t){let e=Vt({storageKey:t.getAttribute("b-att-storage-key")||void 0,toggleSelector:"[b-theme-toggle]",labelSelector:"[b-theme-label]"}),o=(a=e.current())=>id(t,a),r=()=>o(e.toggle()),i=a=>o(a.detail?.theme);return o(e.set(e.current(),{skipStorage:!0})),t.addEventListener("click",r),document.addEventListener("baseui:theme-change",i),{destroy:()=>{t.removeEventListener("click",r),document.removeEventListener("baseui:theme-change",i)}}}c.register("theme-button",{type:"static",mount:nd});v();M();S();Xa();function pd(t){let e=[...t.querySelectorAll("[b-toast-close]")],o=t.getAttribute("b-att-delay"),r=o===null?3e3:Number(o),i=ma(t.getAttribute("b-att-position"));t.className=d(t.className,"toast","fade",i),t.setAttribute("role",t.getAttribute("b-att-variant")==="danger"?"alert":"status"),e.forEach(h=>h.setAttribute("data-bs-dismiss","toast"));let a=new(E()).Toast(t,{autohide:r>0,delay:r||3e3}),p=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},l=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))};t.addEventListener("shown.bs.toast",p),t.addEventListener("hidden.bs.toast",l);let u=()=>a.show(),b=()=>a.hide();return t.getAttribute("b-att-state")==="open"&&u(),t.BaseUIToast={show:u,hide:b},{destroy:()=>{t.removeEventListener("shown.bs.toast",p),t.removeEventListener("hidden.bs.toast",l),a.dispose(),delete t.BaseUIToast}}}c.register("toast",{type:"owl",mount:pd});v();M();function ld(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 i=new(E()).Tooltip(e,{title:r,html:!0,trigger:"hover focus"}),a=()=>t.setAttribute("b-att-state","open"),p=()=>t.setAttribute("b-att-state","closed");return e.addEventListener("shown.bs.tooltip",a),e.addEventListener("hidden.bs.tooltip",p),t.setAttribute("b-att-state","closed"),{destroy:()=>{e.removeEventListener("shown.bs.tooltip",a),e.removeEventListener("hidden.bs.tooltip",p),i.dispose()}}}c.register("tooltip",{type:"owl",mount:ld});v();function cd(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("baseui:change",{bubbles:!0,detail:{pressed:o}}))};return t.addEventListener("click",e),{destroy:()=>t.removeEventListener("click",e)}}c.register("toggle",{type:"owl",mount:cd});v();function ud(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(i=>{i.classList.add("btn","btn-outline-secondary"),i.setAttribute("aria-pressed",i.getAttribute("aria-pressed")||"false")});let r=i=>{let a=i.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 p=e.filter(l=>l.getAttribute("aria-pressed")==="true").map(l=>l.getAttribute("b-att-value")||l.textContent.trim());t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:o?p:p[0]}}))};return t.addEventListener("click",r),{destroy:()=>t.removeEventListener("click",r)}}c.register("toggle-group",{type:"owl",mount:ud});v();var Cp={lead:"lead",muted:"text-body-secondary",code:"bu-code",kbd:"bu-kbd"};function dd(t){let e=Cp[t.getAttribute("b-att-variant")||"body"];return t.classList.add("bu-typography"),e&&t.classList.add(e),{destroy:()=>t.classList.remove("bu-typography",...Object.values(Cp))}}c.register("typography",{type:"static",mount:dd});Jr();g();Zr();oa(Fr);vi(xi);Si();var aE=c;export{Ko as Accordion,Zo as AccordionContent,Vo as AccordionItem,Tt as AccordionTrigger,ve as Alert,we as AlertAction,xe as AlertDescription,eo as AlertDialog,co as AlertDialogAction,lo as AlertDialogCancel,so as AlertDialogContent,po as AlertDialogDescription,ao as AlertDialogFooter,ro as AlertDialogHeader,io as AlertDialogMedia,no as AlertDialogTitle,oo as AlertDialogTrigger,Se as AlertTitle,Tp as App,sr as AspectRatio,zs as Attachment,Ws as AttachmentAction,Hs as AttachmentActions,Ds as AttachmentContent,_s as AttachmentDescription,Zs as AttachmentDropzone,Vs as AttachmentGroup,Ps as AttachmentMedia,Fs as AttachmentTitle,Ks as AttachmentTrigger,Xs as Avatar,lt as Badge,c as BaseUI,Fr as BaseUIComponents,Dn as BaseUITheme,Gt as BlockViewer,Jo as Breadcrumb,qt as BreadcrumbEllipsis,ts as BreadcrumbItem,es as BreadcrumbLink,Qo as BreadcrumbList,os as BreadcrumbPage,Ut as BreadcrumbSeparator,rr as Bubble,K as Button,nr as ButtonGroup,pr as ButtonGroupSeparator,lr as ButtonGroupText,Ns as Calendar,ct as Card,ut as CardBody,ie as CardDescription,re as CardFooter,se as CardHeader,ae as CardTitle,Rs as Carousel,Us as CarouselNext,Ts as CarouselPrevious,$s as CarouselSlide,js as Chart,Ue as Checkbox,Bt as ClipboardButton,Xo as Collapsible,Yo as CollapsibleContent,Go as CollapsibleTrigger,Bs as Combobox,Is as Command,n as Component,Fo as ContextMenu,Ho as ContextMenuContent,Wo as ContextMenuItem,_o as ContextMenuTrigger,Kt as DataTable,Os as DatePicker,de as Dialog,ye as DialogClose,jt as DialogContent,fe as DialogDescription,he as DialogFooter,me as DialogHeader,ge as DialogTitle,be as DialogTrigger,ar as Direction,uo as Drawer,vo as DrawerClose,mo as DrawerContent,yo as DrawerDescription,go as DrawerFooter,ho as DrawerHeader,fo as DrawerTitle,bo as DrawerTrigger,mt as DropdownMenu,Rt as DropdownMenuCheckboxItem,gt as DropdownMenuContent,qo as DropdownMenuGroup,ft as DropdownMenuItem,Mo as DropdownMenuLabel,zo as DropdownMenuRadioGroup,$t as DropdownMenuRadioItem,Po as DropdownMenuSeparator,Do as DropdownMenuShortcut,yt as DropdownMenuSub,vt as DropdownMenuSubContent,st as DropdownMenuSubTrigger,ht as DropdownMenuTrigger,Ae as Empty,Ne as EmptyContent,ke as EmptyDescription,Ee as EmptyHeader,Ce as EmptyMedia,Le as EmptyTitle,Up as EventBus,Ct as Field,dr as FieldContent,kt as FieldDescription,Nt as FieldError,Et as FieldGroup,Lt as FieldLabel,ur as FieldLegend,mr as FieldSeparator,cr as FieldSet,br as FieldTitle,Yt as Form,Ro as HoverCard,To as HoverCardContent,$o as HoverCardTrigger,B as Icon,ne as Input,He as InputGroup,We as InputGroupAddon,Ke as InputGroupButton,Ze as InputGroupInput,Ve as InputGroupText,Xe as InputGroupTextarea,Ge as InputOtp,ir as Item,je as Kbd,hr as Label,Zt as Markdown,Xt as MarkdownTree,Dr as MarkdownTreeNode,Re as Marker,ns as Menubar,Gs as Message,Ys as MessageScroller,Te as NativeSelect,as as NavigationMenu,is as NavigationMenuItem,qp as OwlError,ss as Pagination,rs as PaginationItem,Bo as Popover,jo as PopoverContent,Io as PopoverTrigger,or as Progress,vr as Pwa,Cr as PwaBody,Nr as PwaClose,xr as PwaContent,Er as PwaDescription,kr as PwaFooter,wr as PwaHeader,Lr as PwaSteps,Ar as PwaTitle,Sr as PwaTrigger,Js as Questionnaire,er as QuestionnaireNext,tr as QuestionnairePrevious,Qs as QuestionnaireStep,qe as RadioGroup,Me as RadioGroupItem,qs as Resizable,Ms as ScrollArea,Ye as Select,Qe as SelectContent,to as SelectItem,Je as SelectTrigger,Oe as Separator,xo as Sheet,No as SheetClose,Ao as SheetContent,ko as SheetDescription,Co as SheetFooter,Eo as SheetHeader,Lo as SheetTitle,wo as SheetTrigger,_t as Shell,Wt as ShellContent,As as ShellHeader,ws as ShellMain,xs as ShellNav,Ht as ShellSidebar,Ss as ShellSidebarHeader,Es as ShellUserMenu,it as Sidebar,zt as SidebarClose,St as SidebarContent,ls as SidebarFooter,xt as SidebarGroup,Pt as SidebarGroupAction,Dt as SidebarGroupCollapsible,ms as SidebarGroupContent,wt as SidebarGroupLabel,ps as SidebarHeader,ds as SidebarInput,cs as SidebarInset,nt as SidebarMenu,Ft as SidebarMenuAction,gs as SidebarMenuBadge,at as SidebarMenuButton,At as SidebarMenuItem,fs as SidebarMenuSkeleton,hs as SidebarMenuSub,vs as SidebarMenuSubButton,ys as SidebarMenuSubItem,Ur as SidebarProvider,us as SidebarRail,bs as SidebarSeparator,Mt as SidebarTrigger,dt as Skeleton,Pe as Slider,Be as Spinner,ze as Switch,It as TabContent,ue as TabTrigger,Cs as Table,pe as Tabs,le as TabsContainer,ce as TabsList,Or as TextEditor,$e as Textarea,pt as ThemeButton,rt as Toast,gr as Toggle,fr as ToggleGroup,yr as ToggleGroupItem,Uo as Tooltip,Ie as Typography,Mp as __info__,zp as batched,Pp as blockDom,d as cn,$a as createNamedIcon,Vt as createThemeController,aE as default,wa as findMarkdownTreeNode,Dp as htmlEscape,ei as iconComponentName,Hr as loadFile,xd as loadTemplate,Fp as markRaw,Ba as markup,G as mergeStyle,sa as mount,oi as normalizeTheme,_p as onError,I as onMounted,_ as onPatched,Hp as onRendered,Wr as onWillDestroy,Wp as onWillPatch,Kp as onWillRender,Qt as onWillStart,j as onWillUnmount,q as onWillUpdateProps,vd as rawMount,Sd as rawXml,Vp as reactive,oa as registerGlobalComponents,Zp as status,Xp as toRaw,C as useChildSubEnv,Gp as useComponent,Y as useEffect,Yp as useEnv,Br as useExternalListener,w as useRef,f as useState,Jp as useSubEnv,Qp as validate,tl as validateType,el as whenReady,Ei as xml};
|
|
39
|
+
`)}function cl(t){nl(t),t.querySelectorAll("[b-icon]").forEach(C=>P(C,C.getAttribute("b-icon"),{label:""}));let e=t.querySelector("table")||t,s=t.querySelector("[b-table-search]"),a=t.querySelector(".bu-data-table__selection-summary"),n=t.getAttribute("b-att-variant");t.classList.add("bu-data-table"),n&&t.classList.add(`bu-data-table-${n}`),e.classList.add("table");let i=t.querySelector(".bu-data-table__cards"),u=()=>[...e.querySelectorAll("tbody tr")],p=C=>i?.querySelector(`[data-row-key="${C.dataset.rowKey}"]`),b=()=>[...e.querySelectorAll("tbody input[type='checkbox']")],h=()=>{a&&(a.textContent=`${b().filter(C=>C.checked).length} of ${u().filter(C=>!C.hidden).length} row(s) selected.`)},g=()=>{let C=(s?.value||"").toLowerCase();u().forEach(R=>{let B=!(R.cells[2]||R.cells[1]||R.cells[0]).textContent.toLowerCase().includes(C);R.hidden=B;let D=p(R);D&&(D.hidden=B)}),h()},S=(C,R)=>{let z=e.tBodies[0];u().sort((B,D)=>B.cells[C].textContent.localeCompare(D.cells[C].textContent)*R).forEach(B=>{z.append(B);let D=p(B);D&&i.append(D)})},E=C=>{let R=C.target.closest("th");if(!R)return;let z=R.getAttribute("b-att-sort")==="asc"?-1:1;e.querySelectorAll("th").forEach(B=>B.removeAttribute("b-att-sort")),R.setAttribute("b-att-sort",z===1?"asc":"desc"),S([...R.parentElement.children].indexOf(R),z)},N=(C,R)=>{let B=p(C)?.querySelector("input[type='checkbox']");B&&B.checked!==R&&(B.checked=R)},O=C=>{let R=C.target;if(R?.matches("input[type='checkbox']")){let z=R.closest("tr"),B=R.closest(".bu-data-table__card");if(z)N(z,R.checked);else if(B){let X=u().find(jr=>jr.dataset.rowKey===B.dataset.rowKey)?.querySelector("input[type='checkbox']");X&&X.checked!==R.checked&&(X.checked=R.checked)}}h()};return s?.addEventListener("input",g),e.tHead?.addEventListener("click",E),e.addEventListener("change",O),i?.addEventListener("change",O),h(),{destroy:()=>{s?.removeEventListener("input",g),e.tHead?.removeEventListener("click",E),e.removeEventListener("change",O),i?.removeEventListener("change",O)}}}d.register("data-table",{type:"owl",mount:cl});w();function ll(t){let e=t.matches("input")?t:t.querySelector("input[type='date'], input");t.classList.add("bu-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("baseui:change",{bubbles:!0,detail:{value:e.value}}))};return e?.addEventListener("input",s),{destroy:()=>e?.removeEventListener("input",s)}}d.register("date-picker",{type:"owl",mount:ll});w();function ul(t){let e=t.querySelector("[b-dialog-panel]");if(t.classList.add("modal","fade","bu-dialog-backdrop"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),e){let n=document.createElement("div");n.className="modal-dialog modal-dialog-centered",e.replaceWith(n),n.append(e),e.classList.add("modal-content")}[...t.querySelectorAll("[b-dialog-close]")].forEach(n=>n.setAttribute("data-bs-dismiss","modal"));let a=L().Modal.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,focus:!0});return ks(t,a,"modal","BaseUIDialog")}d.register("dialog",{type:"owl",mount:ul});w();function pl(t){let e=t.getAttribute("b-att-dir")||t.getAttribute("dir")||"ltr";return t.setAttribute("dir",e==="rtl"?"rtl":"ltr"),{}}d.register("direction",{type:"static",mount:pl});w();function dl(t){t.classList.add("offcanvas","offcanvas-bottom","bu-drawer-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-drawer-close]")].forEach(a=>a.setAttribute("data-bs-dismiss","offcanvas"));let s=L().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return ks(t,s,"offcanvas","BaseUIDrawer")}d.register("drawer",{type:"owl",mount:dl});w();tt();var Ni="a, button, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']";function ki(t,e){t?.classList.add(e)}function bl(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(P(document.createElement("span"),"check")),t.prepend(s)}function ml(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")}),t.querySelectorAll("[b-dropdown-separator]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-separator"),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.setAttribute("aria-checked",e.hasAttribute("checked")||e.getAttribute("aria-checked")==="true"?"true":"false"),bl(e,e.getAttribute("aria-checked")==="true")}),t.querySelectorAll(Ni).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")})}function hl(t){let e=[];return t.querySelectorAll("[b-dropdown-sub]").forEach(s=>{let a=s.querySelector("[b-dropdown-sub-trigger]"),n=s.querySelector("[b-dropdown-sub-content]");if(!a||!n)return;if(ki(a,"bu-dropdown-menu-sub-trigger"),ki(n,"bu-dropdown-menu-sub-content"),a.setAttribute("data-slot","dropdown-menu-sub-trigger"),a.setAttribute("role","menuitem"),a.setAttribute("aria-haspopup","menu"),n.setAttribute("data-slot","dropdown-menu-sub-content"),n.setAttribute("role","menu"),n.hidden=!0,!a.querySelector(".bu-dropdown-menu-sub-trigger-icon")){let h=P(document.createElement("span"),"chevron-right");h.classList.add("bu-dropdown-menu-sub-trigger-icon"),a.append(h)}let i=h=>{n.hidden=!h,a.setAttribute("data-state",h?"open":"closed"),a.setAttribute("aria-expanded",String(h))},u=()=>i(!0),p=()=>i(!1),b=h=>{h.preventDefault(),i(n.hidden)};s.addEventListener("mouseenter",u),s.addEventListener("mouseleave",p),a.addEventListener("focus",u),a.addEventListener("click",b),e.push(()=>{s.removeEventListener("mouseenter",u),s.removeEventListener("mouseleave",p),a.removeEventListener("focus",u),a.removeEventListener("click",b)})}),()=>e.forEach(s=>s())}function gl(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 a=L().Dropdown.getOrCreateInstance(e),n=E=>{t.setAttribute("b-att-state",E?"open":"closed"),e.setAttribute("aria-expanded",String(E)),t.dispatchEvent(new CustomEvent(E?"baseui:open":"baseui:close",{bubbles:!0}))},i=()=>n(!0),u=()=>n(!1);e.addEventListener("shown.bs.dropdown",i),e.addEventListener("hidden.bs.dropdown",u);let p=()=>a.toggle();e.addEventListener("click",p);let b=E=>{E.key==="Escape"?(a.hide(),e.focus()):E.key==="ArrowDown"&&!s.classList.contains("show")&&(E.preventDefault(),a.show(),[...s.querySelectorAll("a, button, [tabindex]:not([tabindex='-1'])")][0]?.focus())};t.addEventListener("keydown",b);let h=E=>{t.contains(E.target)||a.hide()};document.addEventListener("click",h),ml(s);let g=hl(s),S=E=>{let N=E.target.closest(Ni);!N||N.closest("[b-dropdown-sub]")||a.hide()};return s.addEventListener("click",S),{destroy:()=>{g(),s.removeEventListener("click",S),document.removeEventListener("click",h),t.removeEventListener("keydown",b),e.removeEventListener("click",p),e.removeEventListener("shown.bs.dropdown",i),e.removeEventListener("hidden.bs.dropdown",u),a.dispose()}}}d.register("dropdown-menu",{type:"owl",mount:gl});w();var Ta={default:"bu-empty-default",outline:"bu-empty-outline",background:"bu-empty-background"};function fl(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("bu-empty",Ta[e]||Ta.default),t.querySelectorAll("[b-empty-header]").forEach(a=>a.classList.add("bu-empty-header")),t.querySelectorAll("[b-empty-title]").forEach(a=>a.classList.add("bu-empty-title")),t.querySelectorAll("[b-empty-description]").forEach(a=>a.classList.add("bu-empty-description")),t.querySelectorAll("[b-empty-content]").forEach(a=>a.classList.add("bu-empty-content")),s.forEach(a=>{let n=a.getAttribute("b-att-variant")==="icon"?"icon":"default";a.classList.add("bu-empty-media",`bu-empty-media-${n}`),a.setAttribute("data-variant",n)}),{destroy:()=>{t.classList.remove("bu-empty",...Object.values(Ta))}}}d.register("empty",{type:"owl",mount:fl});w();function da(t,e){t?.classList.add(...e.filter(Boolean))}function Lt(t,e,s,a){t.querySelectorAll(e).forEach(n=>{n.setAttribute("data-slot",s),da(n,[a])})}function vl(t){return t.querySelector("input, textarea, select, [role='checkbox'], [role='radio'], [role='switch']")}function yl(t,e){return e.id?e.id:`${t?.id||"bu-field"}-error`}function xl(t){let e=t.getAttribute("b-att-slot")||t.getAttribute("data-slot")||"field",s=[];if(e==="field-set")t.setAttribute("data-slot","field-set"),da(t,["bu-field-set"]),s.push("bu-field-set");else if(e==="field-group")t.setAttribute("data-slot","field-group"),da(t,["bu-field-group"]),s.push("bu-field-group");else{let i=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",i),da(t,["bu-field",`bu-field-orientation-${i}`]),s.push("bu-field",`bu-field-orientation-${i}`)}Lt(t,"legend[b-field-legend], [b-field-legend]","field-legend","bu-field-legend"),Lt(t,"[b-field-group]","field-group","bu-field-group"),Lt(t,"[b-field-content]","field-content","bu-field-content"),Lt(t,"label[b-field-label], [b-field-label], [b-label]","field-label","bu-field-label"),Lt(t,"[b-field-title]","field-label","bu-field-title"),Lt(t,"[b-field-description]","field-description","bu-field-description"),Lt(t,"[b-field-separator]","field-separator","bu-field-separator"),Lt(t,"[b-field-error], [b-error]","field-error","bu-field-error"),t.querySelectorAll("[b-field-separator]").forEach(i=>{if(!i.querySelector(".bu-field-separator-line")){let u=document.createElement("span");u.className="bu-field-separator-line",u.setAttribute("aria-hidden","true"),i.prepend(u)}i.textContent.trim()&&i.setAttribute("data-content","true")});let a=vl(t),n=t.querySelector("[b-field-error], [b-error], [data-slot='field-error']");if(a&&n){n.setAttribute("role",n.getAttribute("role")||"alert");let i=yl(a,n);n.id=i,a.setAttribute("aria-describedby",i),a.setAttribute("aria-invalid","true"),t.setAttribute("data-invalid","true")}return{destroy:()=>t.classList.remove(...s)}}d.register("field",{type:"static",mount:xl});w();function wl(t){t.classList.add("bu-form"),t.setAttribute("data-slot","form"),t.setAttribute("novalidate","");let e=t.querySelector("[name='title']"),s=t.querySelector("[name='description']"),a=t.querySelector("[b-form-counter], .bu-form-counter-text"),n=Number(s?.getAttribute("maxlength")||100),i=()=>{a&&s&&(a.textContent=`${s.value.length}/${n} characters`)},u=()=>{e&&(e.value=""),s&&(s.value=""),i()},p=t.querySelector("[b-form-reset]");return p?.addEventListener("click",u),s?.addEventListener("input",i),i(),{destroy(){p?.removeEventListener("click",u),s?.removeEventListener("input",i)}}}d.register("form",{type:"static",mount:wl});w();function Sl(t){let e=t.querySelector("[b-hover-card-trigger]"),s=t.querySelector("[b-hover-card-content]");if(!e||!s)return{};let a=()=>{s.hidden=!1,e.setAttribute("aria-expanded","true")},n=()=>{s.hidden=!0,e.setAttribute("aria-expanded","false")},i=u=>{u.key==="Escape"&&n()};return e.setAttribute("aria-haspopup","dialog"),s.setAttribute("role","dialog"),n(),t.addEventListener("mouseenter",a),t.addEventListener("mouseleave",n),t.addEventListener("focusin",a),t.addEventListener("focusout",n),t.addEventListener("keydown",i),{destroy:()=>{t.removeEventListener("mouseenter",a),t.removeEventListener("mouseleave",n),t.removeEventListener("focusin",a),t.removeEventListener("focusout",n),t.removeEventListener("keydown",i)}}}d.register("hover-card",{type:"owl",mount:Sl});w();tt();function Al(t){let e=t.getAttribute("b-icon")||t.getAttribute("b-att-icon")||t.getAttribute("aria-label");return e?(P(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("bu-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")}}):{}}d.register("icon",{type:"static",mount:Al});w();function El(t){let e=Yr({tag:t.tagName.toLowerCase(),type:t.getAttribute("type")});return t.classList.add(e),{destroy:()=>t.classList.remove(e)}}d.register("input",{type:"static",mount:El});w();function Cl(t){t.classList.add("bu-input-group"),t.setAttribute("role",t.getAttribute("role")||"group"),t.setAttribute("data-slot","input-group");let e=[...t.querySelectorAll("[b-input-group-addon], [b-input-group-text], [b-input-group-button]")],s=[...t.querySelectorAll("[b-input-group-button]")],a=[...t.querySelectorAll("input, textarea, [data-slot='input-group-control']")],n=i=>{i.target.closest("button")||ta(i.currentTarget)};return e.forEach(i=>{if(i.matches("[b-input-group-addon]")){let u=qt[i.getAttribute("b-att-align")]?i.getAttribute("b-att-align"):"inline-start";i.classList.add("bu-input-group-addon",qt[u]),i.setAttribute("data-align",u),i.setAttribute("data-slot","input-group-addon"),i.setAttribute("role",i.getAttribute("role")||"group"),i.addEventListener("click",n)}i.matches("[b-input-group-text]")&&(i.classList.add("bu-input-group-text"),i.setAttribute("data-slot","input-group-text"))}),s.forEach(i=>{let u=Mt[i.getAttribute("b-att-size")]?i.getAttribute("b-att-size"):"xs",p=Ut[i.getAttribute("b-att-variant")]||Ut.ghost;i.classList.add("btn","bu-button","bu-input-group-button",p,Mt[u]),i.setAttribute("data-size",u),i.setAttribute("data-slot","input-group-button"),i.getAttribute("type")||i.setAttribute("type","button")}),a.forEach(i=>{i.classList.add("bu-input-group-control"),i.setAttribute("data-slot","input-group-control"),i.matches("input")&&i.classList.add("bu-input-group-input"),i.matches("textarea")&&i.classList.add("bu-input-group-textarea")}),{destroy:()=>{t.classList.remove("bu-input-group"),t.removeAttribute("data-slot"),e.forEach(i=>{i.removeEventListener("click",n),i.classList.remove("bu-input-group-addon","bu-input-group-text",...Object.values(qt)),i.removeAttribute("data-align"),i.removeAttribute("data-slot")}),s.forEach(i=>{i.classList.remove("btn","bu-button","bu-input-group-button",...Object.values(Ut),...Object.values(Mt)),i.removeAttribute("data-size"),i.removeAttribute("data-slot")}),a.forEach(i=>{i.classList.remove("bu-input-group-control","bu-input-group-input","bu-input-group-textarea"),i.removeAttribute("data-slot")})}}}d.register("input-group",{type:"static",mount:Cl});w();function Ll(t){let e=[...t.querySelectorAll("input")];t.classList.add("bu-input-otp"),e.forEach(i=>{i.classList.add("form-control"),i.inputMode=i.inputMode||"numeric",i.maxLength=i.maxLength>0?i.maxLength:1});let s=()=>{let i=e.map(u=>u.value).join("");t.setAttribute("b-att-value",i),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:i}}))},a=i=>{let u=e.indexOf(i.target);i.target.value&&e[u+1]&&e[u+1].focus(),s()},n=i=>{let u=i.clipboardData.getData("text").trim();u&&(i.preventDefault(),e.forEach((p,b)=>{p.value=u[b]||""}),s())};return e.forEach(i=>i.addEventListener("input",a)),t.addEventListener("paste",n),{destroy:()=>{e.forEach(i=>i.removeEventListener("input",a)),t.removeEventListener("paste",n)}}}d.register("input-otp",{type:"owl",mount:Ll});w();function kl(t){return t.classList.add("bu-item"),{destroy:()=>t.classList.remove("bu-item")}}d.register("item",{type:"static",mount:kl});w();function Nl(t){return t.classList.add("bu-kbd"),{destroy:()=>t.classList.remove("bu-kbd")}}d.register("kbd",{type:"static",mount:Nl});w();function Bl(t){return t.classList.add("form-label","b-label","bu-label"),t.getAttribute("b-att-required")==="true"&&t.setAttribute("b-att-state","required"),{destroy:()=>t.classList.remove("form-label","b-label","bu-label")}}d.register("label",{type:"static",mount:Bl});w();function Il(t){return t.classList.add("bu-marker"),{destroy:()=>t.classList.remove("bu-marker")}}d.register("marker",{type:"static",mount:Il});w();ia();function Ol(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 Rl(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function $l(t){t.classList.add("bu-markdown");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-mermaid")!=="false",a=t.getAttribute("b-att-base-ui")!=="false",n=t.getAttribute("b-att-editable")==="true",i=t.getAttribute("b-att-collaborative")==="true",u=t.getAttribute("b-att-room")||"bu-markdown",p=t.getAttribute("b-att-password")||void 0,b=Rl(t.getAttribute("b-att-signaling")),h=!1,g=null;function S(N){h||(t.setAttribute("data-status","error"),t.textContent=`Unable to render Markdown: ${N?.message||N}`,t.dispatchEvent(new CustomEvent("baseui:markdown-error",{bubbles:!0,detail:{error:N}})))}async function E(){let N=Ol(t);t.setAttribute("data-status","loading");let O=N;if(e)try{let B=await fetch(e);if(!B.ok)throw new Error(`${B.status} ${B.statusText}`);O=await B.text()}catch(B){S(B);return}if(n){t.replaceChildren(),t.classList.add("bu-markdown-editable"),t.setAttribute("data-status","ready");let B=document.createElement("div");B.className="bu-markdown-editor",B.setAttribute("data-slot","markdown-editor"),B.setAttribute("role","group"),B.setAttribute("aria-label",i?"Collaborative Markdown editor":"Markdown editor"),t.append(B);try{if(g=await Dr({root:B,value:O,collaborative:i,room:u,password:p,signaling:b,onChange:(D,X)=>{t.dispatchEvent(new CustomEvent("baseui:markdown-change",{bubbles:!0,detail:{markdown:D,previousMarkdown:X}}))}}),h){g?.destroy?.(),g=null;return}}catch(D){S(D);return}t.dispatchEvent(new CustomEvent("baseui:markdown-editor-ready",{bubbles:!0,detail:{collaborative:i,room:u}}));return}let{data:C,content:R}=na(O),z;try{z=await zr(R)}catch(B){S(B);return}h||(t.innerHTML=z,t.setAttribute("data-status","ready"),await Fr(t,{mermaid:s,baseUi:a}),h||t.dispatchEvent(new CustomEvent("baseui:markdown-render",{bubbles:!0,detail:{html:z,frontmatter:C}})))}return E(),{destroy:()=>{h=!0,g?.destroy?.(),g=null,Sr(t),t.classList.remove("bu-markdown"),t.classList.remove("bu-markdown-editable"),t.removeAttribute("data-status")}}}d.register("markdown",{type:"static",mount:$l});w();function Tl(t){return t.classList.add("bu-message"),t.setAttribute("b-att-side",t.getAttribute("b-att-side")||"incoming"),t.setAttribute("role",t.getAttribute("role")||"listitem"),{}}d.register("message",{type:"static",mount:Tl});w();function ql(t){t.classList.add("bu-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()}}d.register("message-scroller",{type:"owl",mount:ql});w();function Ul(t){t.setAttribute("role","menubar"),t.classList.add("bu-menubar");for(let e of t.querySelectorAll("a, button"))e.setAttribute("role","menuitem");return{destroy:()=>t.classList.remove("bu-menubar")}}d.register("menubar",{type:"static",mount:Ul});w();function Ml(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")}}d.register("native-select",{type:"static",mount:Ml});w();function Pl(t){let e=[...t.querySelectorAll("a, button")].filter(a=>!a.disabled),s=a=>{let n=e.indexOf(a.target),i=a.key==="ArrowRight"?1:a.key==="ArrowLeft"?-1:0;!i||n<0||(a.preventDefault(),e[(n+i+e.length)%e.length]?.focus())};return t.setAttribute("role",t.getAttribute("role")||"menubar"),e.forEach(a=>a.setAttribute("role","menuitem")),t.addEventListener("keydown",s),{destroy:()=>t.removeEventListener("keydown",s)}}d.register("navigation-menu",{type:"owl",mount:Pl});w();function zl(t){let e=t.querySelector("ol, ul")||t,s=[...e.children];return t.classList.add("bu-pagination"),e.classList.add("pagination"),s.forEach(a=>{let n=a.querySelector("a, button");a.classList.add("page-item"),n?.classList.add("page-link"),n?.getAttribute("aria-current")==="page"&&a.classList.add("active"),(n?.hasAttribute("disabled")||n?.getAttribute("aria-disabled")==="true")&&a.classList.add("disabled")}),t.setAttribute("aria-label",t.getAttribute("aria-label")||"Pagination"),{destroy:()=>{t.classList.remove("bu-pagination"),e.classList.remove("pagination")}}}d.register("pagination",{type:"owl",mount:zl});w();function Fl(t){let e=t.querySelector("[b-popover-trigger]")||t,s=t.querySelector("[b-popover-content]"),a=s?s.innerHTML:"";s?.remove(),e.setAttribute("aria-haspopup","dialog");let n=new(L()).Popover(e,{content:a,html:!0,trigger:"click"}),i=()=>{t.setAttribute("b-att-state","open"),e.setAttribute("aria-expanded","true"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},u=()=>{t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))};return e.addEventListener("shown.bs.popover",i),e.addEventListener("hidden.bs.popover",u),t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),{destroy:()=>{e.removeEventListener("shown.bs.popover",i),e.removeEventListener("hidden.bs.popover",u),n.dispose()}}}d.register("popover",{type:"owl",mount:Fl});w();function Dl(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("bu-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 a=document.createElement("span");a.setAttribute("b-progress-indicator",""),t.append(a)}return{destroy:()=>t.classList.remove("bu-progress")}}d.register("progress",{type:"static",mount:Dl});w();function _l(t){let{open:e,close:s,destroy:a}=ea(t,{closeSelector:"[b-pwa-close]"});return t.BaseUIPwa={open:e,close:s},{destroy:()=>{a(),delete t.BaseUIPwa}}}d.register("pwa",{type:"owl",mount:_l});w();function jl(t){let e=[...t.querySelectorAll("[b-question]")],s=t.querySelector("[b-question-prev]"),a=t.querySelector("[b-question-next]"),n=0,i=b=>{n=Math.min(e.length-1,Math.max(0,b)),e.forEach((h,g)=>{h.hidden=g!==n,h.setAttribute("b-att-state",g===n?"active":"inactive")}),s&&(s.disabled=n===0),a&&(a.disabled=n===e.length-1),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{index:n}}))},u=()=>i(n-1),p=()=>i(n+1);return s?.addEventListener("click",u),a?.addEventListener("click",p),e.length&&i(0),{destroy:()=>{s?.removeEventListener("click",u),a?.removeEventListener("click",p)}}}d.register("questionnaire",{type:"owl",mount:jl});w();d.register("radio-group",{type:"static",mount:t=>pa(t,"radio")});w();function Hl(t){let e=t.querySelector("[b-resizable-panel]")||t,s=t.querySelector("[b-resizable-handle]");if(!s)return{};let a=Number(t.getAttribute("b-att-min")||160),n=Number(t.getAttribute("b-att-max")||720),i=u=>{let p=u.clientX,b=e.getBoundingClientRect().width,h=S=>{e.style.width=`${Math.min(n,Math.max(a,b+S.clientX-p))}px`},g=()=>{document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",g),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{width:e.style.width}}))};document.addEventListener("pointermove",h),document.addEventListener("pointerup",g)};return s.addEventListener("pointerdown",i),{destroy:()=>s.removeEventListener("pointerdown",i)}}d.register("resizable",{type:"owl",mount:Hl});w();function Kl(t){return t.classList.add("bu-scroll-area"),t.tabIndex=t.tabIndex>=0?t.tabIndex:0,t.setAttribute("role",t.getAttribute("role")||"region"),{}}d.register("scroll-area",{type:"static",mount:Kl});w();function Wl(t){let e=t.getAttribute("b-att-orientation")==="vertical";return t.classList.add("bu-separator",e?"bu-separator-vertical":"bu-separator-horizontal"),t.setAttribute("role",t.getAttribute("role")||"separator"),t.setAttribute("aria-orientation",e?"vertical":"horizontal"),{destroy:()=>t.classList.remove("bu-separator","bu-separator-vertical","bu-separator-horizontal")}}d.register("separator",{type:"static",mount:Wl});w();function Bi(t,{triggerSelector:e,panelSelector:s,ariaHaspopup:a,panelRole:n,onKeyDown:i}={}){let u=t.querySelector(e),p=t.querySelector(s),b=E=>{!p||!u||(p.hidden=!E,t.setAttribute("b-att-state",E?"open":"closed"),u.setAttribute("aria-expanded",String(E)),t.dispatchEvent(new CustomEvent(E?"baseui:open":"baseui:close",{bubbles:!0})))},h=()=>b(p?.hidden!==!1),g=E=>{E.key==="Escape"&&(b(!1),u?.focus()),i?.(E,{setOpen:b,panel:p,trigger:u})},S=E=>{t.contains(E.target)||b(!1)};return u?.setAttribute("aria-haspopup",a),p?.setAttribute("role",n),p&&(p.hidden=!0),u?.addEventListener("click",h),t.addEventListener("keydown",g),document.addEventListener("click",S),{trigger:u,panel:p,setOpen:b,destroy:()=>{u?.removeEventListener("click",h),t.removeEventListener("keydown",g),document.removeEventListener("click",S)}}}function Vl(t){let{setOpen:e,destroy:s}=Bi(t,{triggerSelector:"[b-select-trigger]",panelSelector:"[b-select-content]",ariaHaspopup:"listbox",panelRole:"listbox"}),a=t.querySelector("[b-select-trigger]"),n=t.querySelector("[b-select-value]"),i=u=>{let p=u.target.closest("[b-select-item]");if(!(!p||!t.contains(p))){for(let b of t.querySelectorAll("[b-select-item]"))b.setAttribute("aria-selected",String(b===p));n&&(n.textContent=p.textContent.trim()),t.setAttribute("b-att-value",p.getAttribute("b-att-value")||p.textContent.trim()),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:t.getAttribute("b-att-value")}})),e(!1),a?.focus()}};for(let u of t.querySelectorAll("[b-select-item]"))u.setAttribute("role","option");return t.addEventListener("click",i),{destroy:()=>{t.removeEventListener("click",i),s()}}}d.register("select",{type:"owl",mount:Vl});w();function Zl(t){let e=[...t.querySelectorAll("[b-shell-collapse-trigger]")],s=n=>{t.setAttribute("b-att-collapsed",n?"true":"false"),t.dispatchEvent(new CustomEvent(n?"baseui:collapse":"baseui:expand",{bubbles:!0}))},a=()=>s(t.getAttribute("b-att-collapsed")!=="true");return e.forEach(n=>n.addEventListener("click",a)),s(t.getAttribute("b-att-collapsed")==="true"),t.BaseUIShell={collapse:()=>s(!0),expand:()=>s(!1),toggle:a},{destroy:()=>{e.forEach(n=>n.removeEventListener("click",a)),delete t.BaseUIShell}}}d.register("shell",{type:"owl",mount:Zl});w();function Xl(t){let e=t.getAttribute("b-att-side")==="left"?"offcanvas-start":"offcanvas-end";t.classList.add("offcanvas",e,"bu-sheet-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-sheet-close]")].forEach(n=>n.setAttribute("data-bs-dismiss","offcanvas"));let a=L().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return ks(t,a,"offcanvas","BaseUISheet")}d.register("sheet",{type:"owl",mount:Xl});w();var Gl={"[b-sidebar-header]":["bu-sidebar-header","sidebar-header","header"],"[b-sidebar-content]":["bu-sidebar-content","sidebar-content","content"],"[b-sidebar-footer]":["bu-sidebar-footer","sidebar-footer","footer"],"[b-sidebar-group]":["bu-sidebar-group","sidebar-group","group"],"[b-sidebar-group-label]":["bu-sidebar-group-label","sidebar-group-label","group-label"],"[b-sidebar-group-action]":["bu-sidebar-group-action","sidebar-group-action","group-action"],"[b-sidebar-group-content]":["bu-sidebar-group-content","sidebar-group-content","group-content"],"[b-sidebar-menu]":["bu-sidebar-menu","sidebar-menu","menu"],"[b-sidebar-menu-item]":["bu-sidebar-menu-item","sidebar-menu-item","menu-item"],"[b-sidebar-menu-button]":["bu-sidebar-menu-button","sidebar-menu-button","menu-button"],"[b-sidebar-menu-action]":["bu-sidebar-menu-action","sidebar-menu-action","menu-action"],"[b-sidebar-menu-badge]":["bu-sidebar-menu-badge","sidebar-menu-badge","menu-badge"],"[b-sidebar-menu-sub]":["bu-sidebar-menu-sub","sidebar-menu-sub","menu-sub"],"[b-sidebar-menu-sub-item]":["bu-sidebar-menu-sub-item","sidebar-menu-sub-item","menu-sub-item"],"[b-sidebar-menu-sub-button]":["bu-sidebar-menu-sub-button","sidebar-menu-sub-button","menu-sub-button"],"[b-sidebar-separator]":["bu-sidebar-separator","sidebar-separator","separator"]};function Yl(t){let e=[];for(let[s,[a,n,i]]of Object.entries(Gl))for(let u of t.querySelectorAll(s))u.classList.add(a),u.dataset.slot=n,u.dataset.sidebar=i,(u.hasAttribute("b-att-active")||u.getAttribute("aria-current")==="page")&&(u.classList.add("is-active"),u.dataset.active="true"),e.push([u,a]);return e}function Jl(t){let e=t.getAttribute("b-att-trigger")?document.querySelector(t.getAttribute("b-att-trigger")):null,s=[...t.querySelectorAll("[b-sidebar-close]")],a=Yl(t),n=b=>{t.setAttribute("b-att-state",b?"open":"closed"),t.classList.toggle("is-open",b),t.dataset.state=b?"expanded":"collapsed",t.dispatchEvent(new CustomEvent(b?"baseui:open":"baseui:close",{bubbles:!0}))},i=()=>n(!0),u=()=>n(!1),p=b=>{b.key==="Escape"&&u()};return e?.addEventListener("click",i),s.forEach(b=>b.addEventListener("click",u)),t.addEventListener("keydown",p),t.dataset.sidebar="sidebar",t.dataset.slot="sidebar",n(t.getAttribute("b-att-state")==="open"),t.BaseUISidebar={open:i,close:u},{destroy:()=>{e?.removeEventListener("click",i),s.forEach(b=>b.removeEventListener("click",u)),t.removeEventListener("keydown",p);for(let[b,h]of a)b.classList.remove(h,"is-active"),b.removeAttribute("data-slot"),b.removeAttribute("data-sidebar"),b.removeAttribute("data-active");t.removeAttribute("data-sidebar"),t.removeAttribute("data-slot"),t.removeAttribute("data-state"),delete t.BaseUISidebar}}}d.register("sidebar",{type:"owl",mount:Jl});w();function Ql(t){t.classList.add("bu-slider");let e=()=>{t.style.setProperty("--b-slider-value",`${t.value}%`),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:t.value}}))};return e(),t.addEventListener("input",e),{destroy:()=>{t.removeEventListener("input",e),t.classList.remove("bu-slider")}}}d.register("slider",{type:"static",mount:Ql});w();function tu(t){let e=t.getAttribute("b-att-shape")==="circle"?"bu-skeleton-circle":"bu-skeleton-block";return t.classList.add("bu-skeleton",e),t.setAttribute("aria-hidden",t.getAttribute("aria-hidden")||"true"),{destroy:()=>t.classList.remove("bu-skeleton","bu-skeleton-circle","bu-skeleton-block")}}d.register("skeleton",{type:"static",mount:tu});w();function eu(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 a=document.createElement("span");a.className="visually-hidden",a.textContent=s,t.append(a)}return{destroy:()=>t.classList.remove("spinner-border","spinner-grow")}}d.register("spinner",{type:"static",mount:eu});w();function su(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","bu-switch"),{destroy:()=>{e?.classList.remove("form-check-input"),s?.classList.remove("form-check","form-switch","bu-switch")}}}d.register("switch",{type:"static",mount:su});w();function ou(t){if(t.classList.add("table","bu-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","bu-table","table-striped","table-hover")}}}return{destroy:()=>t.classList.remove("table","bu-table","table-striped","table-hover")}}d.register("table",{type:"static",mount:ou});w();function ru(t){t.classList.add("bu-tabs-host");let e=[...t.querySelectorAll("[b-tab]")],s=[...t.querySelectorAll("[b-panel]")],a=new Map(s.map(S=>[S.getAttribute("b-panel"),S])),n=new Map,i=new Map,u=new Map,p=new Map,b=e[0]?.parentElement;b&&!b.hasAttribute("role")&&b.setAttribute("role","tablist");let h=t.getAttribute("b-att-value")||e[0]?.getAttribute("b-tab")||"",g=S=>{t.setAttribute("b-att-value",S),e.forEach(E=>{E.tabIndex=E.getAttribute("b-tab")===S?0:-1}),t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:S}}))};return e.forEach((S,E)=>{let N=S.getAttribute("b-tab"),O=a.get(N),C=N===h;if(S.setAttribute("role","tab"),S.tabIndex=C?0:-1,C&&S.classList.add("active"),O){let X=O.id||`bu-tabs-panel-${N}`;O.id=X,O.setAttribute("role","tabpanel"),O.classList.add("tab-pane","fade"),C&&O.classList.add("show","active"),S.setAttribute("data-bs-target",`#${X}`)}let R=L().Tab.getOrCreateInstance(S);n.set(S,R);let z=()=>R.show();S.addEventListener("click",z),i.set(S,z);let B=()=>g(N);S.addEventListener("shown.bs.tab",B),p.set(S,B);let D=X=>{let jr=Jr(X.key,E,e.length);if(jr===-1)return;X.preventDefault();let qa=e[jr];qa.focus(),n.get(qa)?.show()};S.addEventListener("keydown",D),u.set(S,D)}),h&&t.setAttribute("b-att-value",h),{destroy:()=>{e.forEach(S=>{S.removeEventListener("click",i.get(S)),S.removeEventListener("keydown",u.get(S)),S.removeEventListener("shown.bs.tab",p.get(S)),n.get(S)?.dispose()}),i.clear(),u.clear(),p.clear(),n.clear()}}}d.register("tabs",{type:"owl",mount:ru});w();function au(t){return t.classList.add("form-control"),t.getAttribute("b-att-resize")==="none"&&t.classList.add("bu-textarea-no-resize"),{destroy:()=>t.classList.remove("form-control","bu-textarea-no-resize")}}d.register("textarea",{type:"static",mount:au});w();function iu(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 nu(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function cu(t){t.classList.add("bu-text-editor");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-provider")||void 0,a=t.getAttribute("b-att-room")||"bu-text-editor",n=t.getAttribute("b-att-url")||void 0,i=ua({collaborative:t.getAttribute("b-att-collaborative")==="true",providerType:s,url:n}),u=t.getAttribute("b-att-password")||void 0,p=nu(t.getAttribute("b-att-signaling")),b=t.getAttribute("b-att-placeholder")||void 0,h=!1,g=null;function S(N){h||(t.setAttribute("data-status","error"),t.textContent=`Unable to mount text editor: ${N?.message||N}`,t.dispatchEvent(new CustomEvent("baseui:text-editor-error",{bubbles:!0,detail:{error:N}})))}async function E(){t.setAttribute("data-status","loading");let N=iu(t);if(e)try{let C=await fetch(e);if(!C.ok)throw new Error(`${C.status} ${C.statusText}`);N=await C.text()}catch(C){S(C);return}t.replaceChildren();let O=document.createElement("div");O.className="bu-text-editor-shell",O.setAttribute("data-slot","text-editor-shell"),O.setAttribute("role","group"),O.setAttribute("aria-label",i?"Collaborative rich text editor":"Rich text editor"),t.append(O);try{if(g=await la({root:O,value:N,placeholder:b,collaborative:i,providerType:s,room:a,url:n,password:u,signaling:p,onChange:(C,R)=>{t.dispatchEvent(new CustomEvent("baseui:text-editor-change",{bubbles:!0,detail:{html:C,previousHtml:R}}))}}),h){g?.destroy?.(),g=null;return}}catch(C){S(C);return}t.setAttribute("data-status","ready"),t.dispatchEvent(new CustomEvent("baseui:text-editor-ready",{bubbles:!0,detail:{collaborative:i,room:a}}))}return E(),{destroy:()=>{h=!0,g?.destroy?.(),g=null,t.classList.remove("bu-text-editor"),t.removeAttribute("data-status")}}}d.register("text-editor",{type:"static",mount:cu});tt();w();function lu(t,e){let s=xr(e);t.classList.remove(...ri),t.className=`${t.className} ${oa({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 a=t.querySelector("[b-theme-button-icon]");a||(a=document.createElement("span"),a.setAttribute("b-theme-button-icon",""),t.prepend(a)),a.setAttribute("b-icon",s.icon),P(a,s.icon,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url")});let n=t.querySelector("[b-theme-button-label]");n||(n=document.createElement("span"),n.className="visually-hidden",n.setAttribute("b-theme-button-label",""),t.append(n)),n.textContent=s.label}function uu(t){let e=Ct({storageKey:t.getAttribute("b-att-storage-key")||void 0,toggleSelector:"[b-theme-toggle]",labelSelector:"[b-theme-label]"}),s=(i=e.current())=>lu(t,i),a=()=>s(e.toggle()),n=i=>s(i.detail?.theme);return s(e.set(e.current(),{skipStorage:!0})),t.addEventListener("click",a),document.addEventListener("baseui:theme-change",n),{destroy:()=>{t.removeEventListener("click",a),document.removeEventListener("baseui:theme-change",n)}}}d.register("theme-button",{type:"static",mount:uu});w();f();function pu(t){let e=[...t.querySelectorAll("[b-toast-close]")],s=t.getAttribute("b-att-delay"),a=s===null?3e3:Number(s),n=sa(t.getAttribute("b-att-position"));t.className=m(t.className,"toast","fade",n),t.setAttribute("role",t.getAttribute("b-att-variant")==="danger"?"alert":"status"),e.forEach(g=>g.setAttribute("data-bs-dismiss","toast"));let i=new(L()).Toast(t,{autohide:a>0,delay:a||3e3}),u=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("baseui:open",{bubbles:!0}))},p=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("baseui:close",{bubbles:!0}))};t.addEventListener("shown.bs.toast",u),t.addEventListener("hidden.bs.toast",p);let b=()=>i.show(),h=()=>i.hide();return t.getAttribute("b-att-state")==="open"&&b(),t.BaseUIToast={show:b,hide:h},{destroy:()=>{t.removeEventListener("shown.bs.toast",u),t.removeEventListener("hidden.bs.toast",p),i.dispose(),delete t.BaseUIToast}}}d.register("toast",{type:"owl",mount:pu});w();function du(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 a=s?s.innerHTML:"";s?.remove();let n=new(L()).Tooltip(e,{title:a,html:!0,trigger:"hover focus"}),i=()=>t.setAttribute("b-att-state","open"),u=()=>t.setAttribute("b-att-state","closed");return e.addEventListener("shown.bs.tooltip",i),e.addEventListener("hidden.bs.tooltip",u),t.setAttribute("b-att-state","closed"),{destroy:()=>{e.removeEventListener("shown.bs.tooltip",i),e.removeEventListener("hidden.bs.tooltip",u),n.dispose()}}}d.register("tooltip",{type:"owl",mount:du});w();function bu(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("baseui:change",{bubbles:!0,detail:{pressed:s}}))};return t.addEventListener("click",e),{destroy:()=>t.removeEventListener("click",e)}}d.register("toggle",{type:"owl",mount:bu});w();function mu(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(n=>{n.classList.add("btn","btn-outline-secondary"),n.setAttribute("aria-pressed",n.getAttribute("aria-pressed")||"false")});let a=n=>{let i=n.target.closest("button, [b-att-value]");if(!i||!t.contains(i))return;s||e.forEach(p=>p.setAttribute("aria-pressed","false")),i.setAttribute("aria-pressed",String(i.getAttribute("aria-pressed")!=="true"));let u=e.filter(p=>p.getAttribute("aria-pressed")==="true").map(p=>p.getAttribute("b-att-value")||p.textContent.trim());t.dispatchEvent(new CustomEvent("baseui:change",{bubbles:!0,detail:{value:s?u:u[0]}}))};return t.addEventListener("click",a),{destroy:()=>t.removeEventListener("click",a)}}d.register("toggle-group",{type:"owl",mount:mu});w();var Ii={lead:"lead",muted:"text-body-secondary",code:"bu-code",kbd:"bu-kbd"};function hu(t){let e=Ii[t.getAttribute("b-att-variant")||"body"];return t.classList.add("bu-typography"),e&&t.classList.add(e),{destroy:()=>t.classList.remove("bu-typography",...Object.values(Ii))}}d.register("typography",{type:"static",mount:hu});v();ja(Ra);za(Da);Fa();var sA=d;export{co as Accordion,uo as AccordionContent,lo as AccordionItem,Gt as AccordionTrigger,Tt as Alert,Ye as AlertAction,Ge as AlertDescription,Ns as AlertDialog,_t as AlertDialogAction,Dt as AlertDialogCancel,Bs as AlertDialogContent,Ts as AlertDialogDescription,Os as AlertDialogFooter,Is as AlertDialogHeader,Rs as AlertDialogMedia,$s as AlertDialogTitle,Ft as AlertDialogTrigger,Xe as AlertTitle,Fi as App,nr as AspectRatio,Vo as Attachment,fe as AttachmentAction,Jo as AttachmentActions,Xo as AttachmentContent,Yo as AttachmentDescription,tr as AttachmentDropzone,Qo as AttachmentGroup,Zo as AttachmentMedia,Go as AttachmentTitle,ve as AttachmentTrigger,er as Avatar,lt as Badge,d as BaseUI,Ra as BaseUIComponents,oi as BaseUITheme,Ce as BlockViewer,mo as Breadcrumb,Qt as BreadcrumbEllipsis,go as BreadcrumbItem,fo as BreadcrumbLink,ho as BreadcrumbList,vo as BreadcrumbPage,Jt as BreadcrumbSeparator,cr as Bubble,y as Button,pr as ButtonGroup,dr as ButtonGroupSeparator,br as ButtonGroupText,me as Calendar,Re as Card,Te as CardBody,Me as CardDescription,qe as CardFooter,$e as CardHeader,Ue as CardTitle,jo as Carousel,ge as CarouselNext,he as CarouselPrevious,Ho as CarouselSlide,_o as Chart,ps as Checkbox,Bt as ClipboardButton,po as Collapsible,bo as CollapsibleContent,Yt as CollapsibleTrigger,Fo as Combobox,Do as Command,c as Component,ro as ContextMenu,io as ContextMenuContent,no as ContextMenuItem,ao as ContextMenuTrigger,be as DataTable,zo as DatePicker,je as Dialog,$t as DialogClose,Rt as DialogContent,Ze as DialogDescription,We as DialogFooter,Ke as DialogHeader,Ve as DialogTitle,He as DialogTrigger,lr as Direction,qs as Drawer,Ht as DrawerClose,Us as DrawerContent,Fs as DrawerDescription,Ps as DrawerFooter,Ms as DrawerHeader,zs as DrawerTitle,jt as DrawerTrigger,pt as DropdownMenu,Zt as DropdownMenuCheckboxItem,dt as DropdownMenuContent,Qs as DropdownMenuGroup,bt as DropdownMenuItem,to as DropdownMenuLabel,eo as DropdownMenuRadioGroup,Xt as DropdownMenuRadioItem,so as DropdownMenuSeparator,oo as DropdownMenuShortcut,mt as DropdownMenuSub,ht as DropdownMenuSubContent,st as DropdownMenuSubTrigger,et as DropdownMenuTrigger,Je as Empty,os as EmptyContent,ss as EmptyDescription,Qe as EmptyHeader,ts as EmptyMedia,es as EmptyTitle,Di as EventBus,wt as Field,gr as FieldContent,At as FieldDescription,Et as FieldError,xt as FieldGroup,St as FieldLabel,hr as FieldLegend,vr as FieldSeparator,mr as FieldSet,fr as FieldTitle,Ne as Form,Xs as HoverCard,Ys as HoverCardContent,Gs as HoverCardTrigger,T as Icon,Pe as Input,gs as InputGroup,fs as InputGroupAddon,Pt as InputGroupButton,ys as InputGroupInput,vs as InputGroupText,xs as InputGroupTextarea,ws as InputOtp,ur as Item,ns as Kbd,yr as Label,Ae as Markdown,Ee as MarkdownTree,_r as MarkdownTreeNode,cs as Marker,Ao as Menubar,sr as Message,or as MessageScroller,us as NativeSelect,wo as NavigationMenu,So as NavigationMenuItem,_i as OwlError,yo as Pagination,xo as PaginationItem,Vs as Popover,Zs as PopoverContent,Vt as PopoverTrigger,ir as Progress,Er as Pwa,Br as PwaBody,ke as PwaClose,Cr as PwaContent,Nr as PwaDescription,Or as PwaFooter,Lr as PwaHeader,Ir as PwaSteps,kr as PwaTitle,Le as PwaTrigger,rr as Questionnaire,xe as QuestionnaireNext,ye as QuestionnairePrevious,ar as QuestionnaireStep,ds as RadioGroup,bs as RadioGroupItem,Ko as Resizable,Wo as ScrollArea,As as Select,Es as SelectContent,Cs as SelectItem,zt as SelectTrigger,rs as Separator,Ds as Sheet,Wt as SheetClose,_s as SheetContent,Ws as SheetDescription,Hs as SheetFooter,js as SheetHeader,Ks as SheetTitle,Kt as SheetTrigger,ne as Shell,le as ShellContent,Mo as ShellHeader,Uo as ShellMain,qo as ShellNav,ce as ShellSidebar,To as ShellSidebarHeader,ue as ShellUserMenu,at as Sidebar,se as SidebarClose,gt as SidebarContent,Co as SidebarFooter,ft as SidebarGroup,oe as SidebarGroupAction,re as SidebarGroupCollapsible,Bo as SidebarGroupContent,vt as SidebarGroupLabel,Eo as SidebarHeader,ko as SidebarInput,Lo as SidebarInset,it as SidebarMenu,ae as SidebarMenuAction,Oo as SidebarMenuBadge,rt as SidebarMenuButton,yt as SidebarMenuItem,Ro as SidebarMenuSkeleton,Io as SidebarMenuSub,ie as SidebarMenuSubButton,$o as SidebarMenuSubItem,Pr as SidebarProvider,ee as SidebarRail,No as SidebarSeparator,te as SidebarTrigger,ut as Skeleton,hs as Slider,as as Spinner,ms as Switch,_e as TabContent,Ot as TabTrigger,Po as Table,ze as Tabs,Fe as TabsContainer,De as TabsList,Rr as TextEditor,ls as Textarea,nt as ThemeButton,ot as Toast,we as Toggle,wr as ToggleGroup,Se as ToggleGroupItem,Js as Tooltip,is as Typography,ji as __info__,Hi as batched,Ki as blockDom,m as cn,Va as createNamedIcon,Ct as createThemeController,sA as default,Ia as findMarkdownTreeNode,Wi as htmlEscape,ei as iconComponentName,Tr as loadFile,Eu as loadTemplate,Vi as markRaw,ha as markup,G as mergeStyle,Wr as mount,Aa as normalizeTheme,Zi as onError,q as onMounted,_ as onPatched,Xi as onRendered,qr as onWillDestroy,Gi as onWillPatch,Yi as onWillRender,Nt as onWillStart,$ as onWillUnmount,K as onWillUpdateProps,Su as rawMount,Au as rawXml,Ji as reactive,ja as registerGlobalComponents,Qi as status,tn as toRaw,k as useChildSubEnv,en as useComponent,Y as useEffect,sn as useEnv,Be as useExternalListener,A as useRef,x as useState,on as useSubEnv,rn as validate,an as validateType,nn as whenReady,Ka as xml};
|