diff --git a/dist/flux-lite.min.js b/dist/flux-lite.min.js index 93cd930..3e0f886 100644 --- a/dist/flux-lite.min.js +++ b/dist/flux-lite.min.js @@ -1 +1 @@ -(()=>{function Z(i){let t=i({css:(n,...s)=>n.raw[0]+s.join("")}),e=new CSSStyleSheet;e.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}function Gt(i,t){let e=i;for(;e;){if(t(e))return e;e=e.parentElement}}function j(i,t){let e=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,t?{acceptNode:n=>{let s,o;return t(n,{skip:()=>s=!0,reject:()=>o=!0}),s?NodeFilter.FILTER_SKIP:o?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}:{});return new Pt(e)}var Pt=class{constructor(t){this.walker=t}from(t){return this.walker.currentNode=t,this}first(){return this.walker.firstChild()}last(){return this.walker.lastChild()}next(t){return this.walker.currentNode=t,this.walker.nextSibling()}nextOrFirst(t){let e=this.next(t);return e||(this.walker.currentNode=this.walker.root,this.first())}prev(t){return this.walker.currentNode=t,this.walker.previousSibling()}prevOrLast(t){let e=this.prev(t);return e||(this.walker.currentNode=this.walker.root,this.last())}closest(t,e){}contains(t){return this.find(e=>e===t)}find(t){return this.walk((e,n)=>{t(e)&&n(e)})}findOrFirst(t){return this.find(t)||(this.walker.currentNode=this.walker.root),this.first()}each(t){this.walk(e=>t(e))}some(t){return!!this.find(t)}every(t){let e=!0;return this.walk(n=>{t(n)||(e=!1)}),e}map(t){let e=[];return this.walk(n=>e.push(t(n))),e}filter(t){let e=[];return this.walk(n=>t(n)&&e.push(n)),e}walk(t){let e,n=this.walker,s;for(;n.nextNode()&&(e=n.currentNode,t(e,o=>s=o),s===void 0););return s}};function F(i,t){customElements.define(`ui-${i}`,t)}function S(i,t,e,n={}){return i.addEventListener(t,e,n),{off:()=>i.removeEventListener(t,e),pause:s=>{i.removeEventListener(t,e),s(),i.addEventListener(t,e)}}}function Jt(i){return["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[tabindex]","[contenteditable]"].some(e=>i.matches(e))&&i.tabIndex>=0}function Te(i,t){let e;return function(){let n=this,s=arguments;e||(i.apply(n,s),e=!0,setTimeout(()=>e=!1,t))}}var St="pointer";document.addEventListener("keydown",()=>St="keyboard",{capture:!0});document.addEventListener("pointerdown",i=>{St=i.pointerType==="mouse"?"mouse":"touch"},{capture:!0});function Rt(){return St==="keyboard"}function Pe(){return St==="touch"}function Zt(i,t){i.addEventListener("keydown",e=>{e.key.length===1&&/[a-zA-Z]/.test(e.key)&&(t(e.key),e.stopPropagation())})}function Re(i,t){return"lofi-"+(t?t+"-":"")+Math.random().toString(16).slice(2)}function Y(i,t){let e=i.hasAttribute("id")?i.getAttribute("id"):Re(i,t);return p(i,"id",e),i._x_bindings||(i._x_bindings={}),i._x_bindings.id||(i._x_bindings.id=e),e}function ot(){let i=!1;return t=>(...e)=>{i||(i=!0,t(...e),i=!1)}}function rt(i,t,{gain:e,lose:n,focusable:s,safeArea:o}){let r=!1;s&&document.addEventListener("focusin",u=>{Rt()&&(i.contains(u.target)||t.contains(u.target)?(r=!0,e()):(r=!1,n()))});let a=()=>{},l=()=>{},c=()=>{r=!1,n(),a(),l()},f=()=>{r=!1,a(),l()};return i.addEventListener("pointerenter",u=>{Pe()||r||(r=!0,e(),setTimeout(()=>{let{safeArea:m,redraw:h,remove:b}=Le(i,t,u.clientX,u.clientY);a=b;let g,w=Te(d=>{let v=t.getBoundingClientRect(),x=i.getBoundingClientRect(),y;switch(m.contains(d.target)&&Fe(x,v,d.clientX,d.clientY)?y="safeArea":t.contains(d.target)?y="panel":i.contains(d.target)?y="trigger":y="outside",g&&clearTimeout(g),y){case"outside":c();break;case"trigger":h(d.clientX,d.clientY);break;case"panel":a();break;case"safeArea":h(d.clientX,d.clientY),g=setTimeout(()=>{c()},300);break;default:break}},100);document.addEventListener("pointermove",w),l=()=>document.removeEventListener("pointermove",w)}))}),{clear:f}}function Le(i,t,e,n){let s=document.createElement("div"),o=t.getBoundingClientRect(),r=i.getBoundingClientRect();s.style.position="fixed",p(s,"data-safe-area","");let a=(l,c)=>{if(o.top===0&&o.bottom===0)return;let f;o.leftr.right&&(f="right"),o.topr.bottom&&o.top>c&&(f="down"),f===void 0&&(f="right");let u,m,h,b,g,w,d,v,x=10;switch(f){case"left":u=o.right,m=Math.max(o.right,l)+5,h=m-u,b=Math.min(r.top,o.top)-x,g=Math.max(r.bottom,o.bottom)+x,w=g-b,d=c-b,v=`polygon(0% 0%, 100% ${d}px, 0% 100%)`;break;case"right":u=Math.min(o.left,l)-5,m=o.left,h=m-u,b=Math.min(r.top,o.top)-x,g=Math.max(r.bottom,o.bottom)+x,w=g-b,d=c-b,v=`polygon(0% ${d}px, 100% 0%, 100% 100%)`;break;case"up":u=Math.min(l,o.left)-x,m=Math.max(l,o.right)+x,h=m-u,b=o.bottom,g=Math.max(o.bottom,c)+5,w=g-b,d=l-u,v=`polygon(0% 0%, 100% 0%, ${d}px 100%)`;break;case"down":u=Math.min(l,o.left)-x,m=Math.max(l,o.right)+x,h=m-u,b=Math.min(o.top,c)-5,g=o.top,w=g-b,d=l-u,v=`polygon(${d}px 0%, 100% 100%, 0% 100%)`;break}s.style.left=`${u}px`,s.style.top=`${b}px`,s.style.width=`${h}px`,s.style.height=`${w}px`,s.style.clipPath=v};return{safeArea:s,redraw:(l,c)=>{s.isConnected||i.appendChild(s),a(l,c)},remove:()=>{s.remove()}}}function Fe(i,t,e,n){return!Me(i,e,n)&&!De(t,e,n)}function Me(i,t,e){return i.left<=t&&t<=i.right&&i.top<=e&&e<=i.bottom}function De(i,t,e){return i.left<=t&&t<=i.right&&i.top<=e&&e<=i.bottom}function p(i,t,e){i._durableAttributeObserver===void 0&&(i._durableAttributeObserver=Qt(i,[t])),i._durableAttributeObserver.hasAttribute(t)||i._durableAttributeObserver.addAttribute(t),i._durableAttributeObserver.pause(()=>{i.setAttribute(t,e)})}function T(i,t){i._durableAttributeObserver===void 0&&(i._durableAttributeObserver=Qt(i,[t])),i._durableAttributeObserver.hasAttribute(t)||i._durableAttributeObserver.addAttribute(t),i._durableAttributeObserver.pause(()=>{i.removeAttribute(t)})}function Qt(i,t){let e=s=>{s.forEach(o=>{o.oldValue===null?i._durableAttributeObserver.pause(()=>T(i,o.attributeName)):i._durableAttributeObserver.pause(()=>p(i,o.attributeName,o.oldValue))})},n=new MutationObserver(s=>e(s));return n.observe(i,{attributeFilter:t,attributeOldValue:!0}),{attributes:t,hasAttribute(s){return this.attributes.includes(s)},addAttribute(s){this.attributes.includes(s)||this.attributes.push(s),n.observe(i,{attributeFilter:this.attributes,attributeOldValue:!0})},pause(s){e(n.takeRecords()),n.disconnect(),s(),n.observe(i,{attributeFilter:this.attributes,attributeOldValue:!0})}}}var k=class extends HTMLElement{constructor(){super(),this.boot?.()}connectedCallback(){queueMicrotask(()=>{this.mount?.()})}mixin(t,e={}){return new t(this,e)}appendMixin(t,e={}){return new t(this,e)}use(t){let e;return this.mixins.forEach(n=>{n instanceof t&&(e=n)}),e}uses(t){let e;return this.mixins.forEach(n=>{n instanceof t&&(e=!0)}),!!e}on(t,e){return S(this,t,e)}root(t,e={}){if(t===void 0)return this.__root;let n=document.createElement(t);for(let o in e)setAttribute(n,o,e[o]);let s=this.attachShadow({mode:"open"});return n.appendChild(document.createElement("slot")),s.appendChild(n),this.__root=n,this.__root}};var O=class{constructor(t,e={}){this.el=t,this.grouped=e.grouped===void 0,this.el.mixins=this.el.mixins?this.el.mixins:new Map,this.el.mixins.set(this.constructor.name,this),this.el[this.constructor.name]=!0,this.el.use||(this.el.use=k.prototype.use.bind(this.el)),this.opts=e,this.boot?.({options:n=>{let s=n;Object.entries(this.opts).forEach(([o,r])=>{r!==void 0&&(s[o]=r)}),this.opts=s}}),queueMicrotask(()=>{this.mount?.()})}options(){return this.opts}hasGroup(){return!!this.group()}group(){if(this.grouped!==!1)return Gt(this.el,t=>t[this.groupedByType.name])?.use(this.groupedByType)}on(t,e){return S(this.el,t,e)}},lt=class extends O{constructor(t,e={}){super(t,e)}walker(){return j(this.el,(t,{skip:e,reject:n})=>{if(t[this.constructor.name]&&t!==this.el)return n();if(!t[this.groupOfType.name]||!t.mixins.get(this.groupOfType.name).grouped)return e()})}};var X=class extends O{boot({options:t}){this.initialState=this.el.value,this.getterFunc=()=>{},this.setterFunc=e=>this.initialState=e,Object.defineProperty(this.el,"value",{get:()=>this.getterFunc(),set:e=>{this.setterFunc(e)}})}initial(t){t(this.initialState)}getter(t){this.getterFunc=t}setter(t){this.setterFunc=t}dispatch(){this.el.dispatchEvent(new Event("input",{bubbles:!1,cancelable:!0})),this.el.dispatchEvent(new Event("change",{bubbles:!1,cancelable:!0}))}};var U=class extends O{boot({options:t}){this.exemptFromLightDismissals=new WeakSet,this.onChanges=[],this.state=!1,this.busy=!1,S(this.el,"beforetoggle",e=>{let n=this.state;this.state=e.newState==="open",n!==this.state&&this.onChanges.forEach(s=>s(this.state,n)),this.state||(e.preventDefault(),e.stopPropagation())}),S(this.el,"beforetoggle",()=>this.busy=!0),S(this.el,"toggle",()=>this.busy=!1)}onChange(t){this.onChanges.push(t)}setState(t){this.busy||(t?this.show():this.hide())}getState(){return this.state}show(){this.el.showPopover()}hide(){this.el.hidePopover()}};var N=Math.min,E=Math.max,gt=Math.round,wt=Math.floor,V=i=>({x:i,y:i}),Ne={left:"right",right:"left",bottom:"top",top:"bottom"},Be={start:"end",end:"start"};function Lt(i,t,e){return E(i,N(t,e))}function at(i,t){return typeof i=="function"?i(t):i}function $(i){return i.split("-")[0]}function ct(i){return i.split("-")[1]}function Ft(i){return i==="x"?"y":"x"}function Mt(i){return i==="y"?"height":"width"}function q(i){return["top","bottom"].includes($(i))?"y":"x"}function Dt(i){return Ft(q(i))}function te(i,t,e){e===void 0&&(e=!1);let n=ct(i),s=Dt(i),o=Mt(s),r=s==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=mt(r)),[r,mt(r)]}function ee(i){let t=mt(i);return[_t(i),t,_t(t)]}function _t(i){return i.replace(/start|end/g,t=>Be[t])}function Ve(i,t,e){let n=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(i){case"top":case"bottom":return e?t?s:n:t?n:s;case"left":case"right":return t?o:r;default:return[]}}function ie(i,t,e,n){let s=ct(i),o=Ve($(i),e==="start",n);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(_t)))),o}function mt(i){return i.replace(/left|right|bottom|top/g,t=>Ne[t])}function $e(i){return{top:0,right:0,bottom:0,left:0,...i}}function ne(i){return typeof i!="number"?$e(i):{top:i,right:i,bottom:i,left:i}}function Q(i){let{x:t,y:e,width:n,height:s}=i;return{width:n,height:s,top:e,left:t,right:t+n,bottom:e+s,x:t,y:e}}function se(i,t,e){let{reference:n,floating:s}=i,o=q(t),r=Dt(t),a=Mt(r),l=$(t),c=o==="y",f=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,m=n[a]/2-s[a]/2,h;switch(l){case"top":h={x:f,y:n.y-s.height};break;case"bottom":h={x:f,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:u};break;case"left":h={x:n.x-s.width,y:u};break;default:h={x:n.x,y:n.y}}switch(ct(t)){case"start":h[r]-=m*(e&&c?-1:1);break;case"end":h[r]+=m*(e&&c?-1:1);break}return h}var oe=async(i,t,e)=>{let{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:s}),{x:f,y:u}=se(c,n,l),m=n,h={},b=0;for(let g=0;gJ<=0)){var pt,Ut;let J=(((pt=o.flip)==null?void 0:pt.index)||0)+1,Kt=At[J];if(Kt)return{data:{index:J,overflows:H},reset:{placement:Kt}};let bt=(Ut=H.filter(st=>st.overflows[0]<=0).sort((st,I)=>st.overflows[1]-I.overflows[1])[0])==null?void 0:Ut.placement;if(!bt)switch(h){case"bestFit":{var qt;let st=(qt=H.filter(I=>{if(D){let z=q(I.placement);return z===v||z==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(z=>z>0).reduce((z,Ce)=>z+Ce,0)]).sort((I,z)=>I[1]-z[1])[0])==null?void 0:qt[0];st&&(bt=st);break}case"initialPlacement":bt=a;break}if(s!==bt)return{reset:{placement:bt}}}return{}}}};async function We(i,t){let{placement:e,platform:n,elements:s}=i,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=$(e),a=ct(e),l=q(e)==="y",c=["left","top"].includes(r)?-1:1,f=o&&l?-1:1,u=at(t,i),{mainAxis:m,crossAxis:h,alignmentAxis:b}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof b=="number"&&(h=a==="end"?b*-1:b),l?{x:h*f,y:m*c}:{x:m*c,y:h*f}}var le=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(t){var e,n;let{x:s,y:o,placement:r,middlewareData:a}=t,l=await We(t,i);return r===((e=a.offset)==null?void 0:e.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},ae=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(t){let{x:e,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:w=>{let{x:d,y:v}=w;return{x:d,y:v}}},...l}=at(i,t),c={x:e,y:n},f=await kt(t,l),u=q($(s)),m=Ft(u),h=c[m],b=c[u];if(o){let w=m==="y"?"top":"left",d=m==="y"?"bottom":"right",v=h+f[w],x=h-f[d];h=Lt(v,h,x)}if(r){let w=u==="y"?"top":"left",d=u==="y"?"bottom":"right",v=b+f[w],x=b-f[d];b=Lt(v,b,x)}let g=a.fn({...t,[m]:h,[u]:b});return{...g,data:{x:g.x-e,y:g.y-n}}}}};var ce=function(i){return i===void 0&&(i={}),{name:"size",options:i,async fn(t){let{placement:e,rects:n,platform:s,elements:o}=t,{apply:r=()=>{},...a}=at(i,t),l=await kt(t,a),c=$(e),f=ct(e),u=q(e)==="y",{width:m,height:h}=n.floating,b,g;c==="top"||c==="bottom"?(b=c,g=f===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,b=f==="end"?"top":"bottom");let w=h-l.top-l.bottom,d=m-l.left-l.right,v=N(h-l[b],w),x=N(m-l[g],d),y=!t.middlewareData.shift,A=v,D=x;if(u?D=f||y?N(x,d):d:A=f||y?N(v,w):w,y&&!f){let nt=E(l.left,0),G=E(l.right,0),H=E(l.top,0),pt=E(l.bottom,0);u?D=m-2*(nt!==0||G!==0?nt+G:E(l.left,l.right)):A=h-2*(H!==0||pt!==0?H+pt:E(l.top,l.bottom))}await r({...t,availableWidth:D,availableHeight:A});let At=await s.getDimensions(o.floating);return m!==At.width||h!==At.height?{reset:{rects:!0}}:{}}}};function tt(i){return fe(i)?(i.nodeName||"").toLowerCase():"#document"}function P(i){var t;return(i==null||(t=i.ownerDocument)==null?void 0:t.defaultView)||window}function B(i){var t;return(t=(fe(i)?i.ownerDocument:i.document)||window.document)==null?void 0:t.documentElement}function fe(i){return i instanceof Node||i instanceof P(i).Node}function R(i){return i instanceof Element||i instanceof P(i).Element}function M(i){return i instanceof HTMLElement||i instanceof P(i).HTMLElement}function ue(i){return typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof P(i).ShadowRoot}function ft(i){let{overflow:t,overflowX:e,overflowY:n,display:s}=L(i);return/auto|scroll|overlay|hidden|clip/.test(t+n+e)&&!["inline","contents"].includes(s)}function he(i){return["table","td","th"].includes(tt(i))}function vt(i){return[":popover-open",":modal"].some(t=>{try{return i.matches(t)}catch{return!1}})}function Ot(i){let t=Et(),e=R(i)?L(i):i;return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(e.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(e.contain||"").includes(n))}function de(i){let t=W(i);for(;M(t)&&!et(t);){if(Ot(t))return t;if(vt(t))return null;t=W(t)}return null}function Et(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function et(i){return["html","body","#document"].includes(tt(i))}function L(i){return P(i).getComputedStyle(i)}function xt(i){return R(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function W(i){if(tt(i)==="html")return i;let t=i.assignedSlot||i.parentNode||ue(i)&&i.host||B(i);return ue(t)?t.host:t}function pe(i){let t=W(i);return et(t)?i.ownerDocument?i.ownerDocument.body:i.body:M(t)&&ft(t)?t:pe(t)}function ut(i,t,e){var n;t===void 0&&(t=[]),e===void 0&&(e=!0);let s=pe(i),o=s===((n=i.ownerDocument)==null?void 0:n.body),r=P(s);if(o){let a=Ct(r);return t.concat(r,r.visualViewport||[],ft(s)?s:[],a&&e?ut(a):[])}return t.concat(s,ut(s,[],e))}function Ct(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function ge(i){let t=L(i),e=parseFloat(t.width)||0,n=parseFloat(t.height)||0,s=M(i),o=s?i.offsetWidth:e,r=s?i.offsetHeight:n,a=gt(e)!==o||gt(n)!==r;return a&&(e=o,n=r),{width:e,height:n,$:a}}function Bt(i){return R(i)?i:i.contextElement}function ht(i){let t=Bt(i);if(!M(t))return V(1);let e=t.getBoundingClientRect(),{width:n,height:s,$:o}=ge(t),r=(o?gt(e.width):e.width)/n,a=(o?gt(e.height):e.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var He=V(0);function we(i){let t=P(i);return!Et()||!t.visualViewport?He:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ie(i,t,e){return t===void 0&&(t=!1),!e||t&&e!==P(i)?!1:t}function it(i,t,e,n){t===void 0&&(t=!1),e===void 0&&(e=!1);let s=i.getBoundingClientRect(),o=Bt(i),r=V(1);t&&(n?R(n)&&(r=ht(n)):r=ht(i));let a=Ie(o,e,n)?we(o):V(0),l=(s.left+a.x)/r.x,c=(s.top+a.y)/r.y,f=s.width/r.x,u=s.height/r.y;if(o){let m=P(o),h=n&&R(n)?P(n):n,b=m,g=Ct(b);for(;g&&n&&h!==b;){let w=ht(g),d=g.getBoundingClientRect(),v=L(g),x=d.left+(g.clientLeft+parseFloat(v.paddingLeft))*w.x,y=d.top+(g.clientTop+parseFloat(v.paddingTop))*w.y;l*=w.x,c*=w.y,f*=w.x,u*=w.y,l+=x,c+=y,b=P(g),g=Ct(b)}}return Q({width:f,height:u,x:l,y:c})}function ze(i){let{elements:t,rect:e,offsetParent:n,strategy:s}=i,o=s==="fixed",r=B(n),a=t?vt(t.floating):!1;if(n===r||a&&o)return e;let l={scrollLeft:0,scrollTop:0},c=V(1),f=V(0),u=M(n);if((u||!u&&!o)&&((tt(n)!=="body"||ft(r))&&(l=xt(n)),M(n))){let m=it(n);c=ht(n),f.x=m.x+n.clientLeft,f.y=m.y+n.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+f.x,y:e.y*c.y-l.scrollTop*c.y+f.y}}function je(i){return Array.from(i.getClientRects())}function ve(i){return it(B(i)).left+xt(i).scrollLeft}function Ye(i){let t=B(i),e=xt(i),n=i.ownerDocument.body,s=E(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=E(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),r=-e.scrollLeft+ve(i),a=-e.scrollTop;return L(n).direction==="rtl"&&(r+=E(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:r,y:a}}function Xe(i,t){let e=P(i),n=B(i),s=e.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;let c=Et();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a,y:l}}function Ue(i,t){let e=it(i,!0,t==="fixed"),n=e.top+i.clientTop,s=e.left+i.clientLeft,o=M(i)?ht(i):V(1),r=i.clientWidth*o.x,a=i.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:r,height:a,x:l,y:c}}function be(i,t,e){let n;if(t==="viewport")n=Xe(i,e);else if(t==="document")n=Ye(B(i));else if(R(t))n=Ue(t,e);else{let s=we(i);n={...t,x:t.x-s.x,y:t.y-s.y}}return Q(n)}function xe(i,t){let e=W(i);return e===t||!R(e)||et(e)?!1:L(e).position==="fixed"||xe(e,t)}function qe(i,t){let e=t.get(i);if(e)return e;let n=ut(i,[],!1).filter(a=>R(a)&&tt(a)!=="body"),s=null,o=L(i).position==="fixed",r=o?W(i):i;for(;R(r)&&!et(r);){let a=L(r),l=Ot(r);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||ft(r)&&!l&&xe(i,r))?n=n.filter(f=>f!==r):s=a,r=W(r)}return t.set(i,n),n}function Ke(i){let{element:t,boundary:e,rootBoundary:n,strategy:s}=i,r=[...e==="clippingAncestors"?vt(t)?[]:qe(t,this._c):[].concat(e),n],a=r[0],l=r.reduce((c,f)=>{let u=be(t,f,s);return c.top=E(u.top,c.top),c.right=N(u.right,c.right),c.bottom=N(u.bottom,c.bottom),c.left=E(u.left,c.left),c},be(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ge(i){let{width:t,height:e}=ge(i);return{width:t,height:e}}function Je(i,t,e){let n=M(t),s=B(t),o=e==="fixed",r=it(i,!0,o,t),a={scrollLeft:0,scrollTop:0},l=V(0);if(n||!n&&!o)if((tt(t)!=="body"||ft(s))&&(a=xt(t)),n){let u=it(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else s&&(l.x=ve(s));let c=r.left+a.scrollLeft-l.x,f=r.top+a.scrollTop-l.y;return{x:c,y:f,width:r.width,height:r.height}}function Nt(i){return L(i).position==="static"}function me(i,t){return!M(i)||L(i).position==="fixed"?null:t?t(i):i.offsetParent}function ye(i,t){let e=P(i);if(vt(i))return e;if(!M(i)){let s=W(i);for(;s&&!et(s);){if(R(s)&&!Nt(s))return s;s=W(s)}return e}let n=me(i,t);for(;n&&he(n)&&Nt(n);)n=me(n,t);return n&&et(n)&&Nt(n)&&!Ot(n)?e:n||de(i)||e}var Ze=async function(i){let t=this.getOffsetParent||ye,e=this.getDimensions,n=await e(i.floating);return{reference:Je(i.reference,await t(i.floating),i.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Qe(i){return L(i).direction==="rtl"}var ti={convertOffsetParentRelativeRectToViewportRelativeRect:ze,getDocumentElement:B,getClippingRect:Ke,getOffsetParent:ye,getElementRects:Ze,getClientRects:je,getDimensions:Ge,getScale:ht,isElement:R,isRTL:Qe};function ei(i,t){let e=null,n,s=B(i);function o(){var a;clearTimeout(n),(a=e)==null||a.disconnect(),e=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();let{left:c,top:f,width:u,height:m}=i.getBoundingClientRect();if(a||t(),!u||!m)return;let h=wt(f),b=wt(s.clientWidth-(c+u)),g=wt(s.clientHeight-(f+m)),w=wt(c),v={rootMargin:-h+"px "+-b+"px "+-g+"px "+-w+"px",threshold:E(0,N(1,l))||1},x=!0;function y(A){let D=A[0].intersectionRatio;if(D!==l){if(!x)return r();D?r(!1,D):n=setTimeout(()=>{r(!1,1e-7)},1e3)}x=!1}try{e=new IntersectionObserver(y,{...v,root:s.ownerDocument})}catch{e=new IntersectionObserver(y,v)}e.observe(i)}return r(!0),o}function Ae(i,t,e,n){n===void 0&&(n={});let{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Bt(i),f=s||o?[...c?ut(c):[],...ut(t)]:[];f.forEach(d=>{s&&d.addEventListener("scroll",e,{passive:!0}),o&&d.addEventListener("resize",e)});let u=c&&a?ei(c,e):null,m=-1,h=null;r&&(h=new ResizeObserver(d=>{let[v]=d;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),e()}),c&&!l&&h.observe(c),h.observe(t));let b,g=l?it(i):null;l&&w();function w(){let d=it(i);g&&(d.x!==g.x||d.y!==g.y||d.width!==g.width||d.height!==g.height)&&e(),g=d,b=requestAnimationFrame(w)}return e(),()=>{var d;f.forEach(v=>{s&&v.removeEventListener("scroll",e),o&&v.removeEventListener("resize",e)}),u?.(),(d=h)==null||d.disconnect(),h=null,l&&cancelAnimationFrame(b)}}var Se=le;var _e=ae,ke=re,Oe=ce;var Ee=(i,t,e)=>{let n=new Map,s={platform:ti,...e},o={...s.platform,_c:n};return oe(i,t,{...s,platform:o})};var K=class extends O{boot({options:t}){if(t({reference:null,auto:!0,position:"bottom start",gap:"5",offset:"0",matchWidth:!1}),this.options().reference===null||this.options().position===null)return;let e=ii(this.el,this.options().reference,{position:this.options().position,gap:this.options().gap,offset:this.options().offset,matchWidth:this.options().matchWidth}),n=()=>{};this.reposition=(...s)=>{this.options().auto?n=Ae(this.options().reference,this.el,e,{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0}):e(...s)},this.cleanup=()=>{n()}}};function ii(i,t,{position:e,offset:n,gap:s,matchWidth:o}){let r;return(a=null,l=null)=>{Ee(t,i,{placement:ni(e),middleware:[ke(),_e({padding:5,crossAxis:!0}),Se({mainAxis:Number(s),alignmentAxis:Number(n)}),o?Oe({apply({rects:c,elements:f}){Object.assign(f.floating.style,{width:`${c.reference.width}px`})}}):void 0]}).then(({x:c,y:f})=>{r=i.getAttribute("style"),Object.assign(i.style,{position:"absolute",inset:`${l||f}px auto auto ${a||c}px`})})}}function ni(i){return i.split(" ").join("-")}var Vt=class extends k{boot(){let t=this.trigger(),e=this.overlay();if(t){if(!e)return console.warn("ui-dropdown: no [popover] overlay found",this)}else return console.warn("ui-dropdown: no trigger element found",this);this._disabled=this.hasAttribute("disabled"),this._controllable=new X(this),e._popoverable=new U(e),e._anchorable=new K(e,{reference:t,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),e._popoverable.onChange(()=>{e._popoverable.getState()?e._anchorable.reposition():e._anchorable.cleanup()}),this._controllable.initial(o=>e._popoverable.setState(o)),this._controllable.getter(()=>e._popoverable.getState());let n=ot();this._controllable.setter(o=>e._popoverable.setState(o)),e._popoverable.onChange(n(()=>this._controllable.dispatch())),this.hasAttribute("hover")&&rt(t,e,{gain(){e._popoverable.setState(!0)},lose(){e._popoverable.setState(!1)},focusable:!0}),S(t,"click",()=>e._popoverable.setState(!e._popoverable.getState())),e._popoverable.getState()?(p(this,"data-open",""),p(t,"data-open",""),p(e,"data-open","")):(T(this,"data-open"),T(t,"data-open"),T(e,"data-open")),e._popoverable.onChange(()=>{e._popoverable.getState()?(p(this,"data-open",""),p(t,"data-open",""),p(e,"data-open","")):(T(this,"data-open"),T(t,"data-open"),T(e,"data-open"))});let s=Y(e,"dropdown");p(t,"aria-haspopup","true"),p(t,"aria-controls",s),p(t,"aria-expanded",e._popoverable.getState()?"true":"false"),e._popoverable.onChange(()=>{p(t,"aria-expanded",e._popoverable.getState()?"true":"false")}),e._popoverable.onChange(()=>{e._popoverable.getState()?e.onPopoverShow?.():e.onPopoverHide?.()})}trigger(){return this.querySelector("button")}overlay(){return this.lastElementChild?.matches("[popover]")&&this.lastElementChild}};Z(({css:i})=>i`ui-dropdown { display: contents; }`);F("dropdown",Vt);var $t=class extends k{boot(){let t=this.hasAttribute("label")?"label":"description",e=this.button(),n=this.overlay();if(e){if(!n)return console.warn("ui-tooltip: no [popover] overlay found",this)}else return console.warn("ui-tooltip: no trigger element found",this);this._disabled=this.hasAttribute("disabled"),n._popoverable=new U(n),n._anchorable=new K(n,{reference:e,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),n._popoverable.onChange(()=>n._anchorable.reposition()),this._disabled||rt(e,n,{gain(){n._popoverable.setState(!0)},lose(){n._popoverable.setState(!1)},focusable:!0});let s=Y(n,"tooltip");p(e,"aria-controls",s),p(e,"aria-expanded","false"),n._popoverable.onChange(()=>{n._popoverable.getState()?p(e,"aria-expanded","true"):p(e,"aria-expanded","false")}),t==="label"?p(e,"aria-labelledby",s):p(e,"aria-describedby",s),p(n,"role","tooltip")}button(){return this.firstElementChild}overlay(){return this.lastElementChild}};Z(({css:i})=>i`ui-tooltip { display: contents; }`);F("tooltip",$t);var dt=class extends lt{groupOfType=_;boot({options:t}){t({multiple:!1}),this.state=this.options().multiple?new Set:null,this.onChanges=[]}onChange(t){this.onChanges.push(t)}changed(t){if(t.ungrouped)return;let e=t.value,n=t.isSelected(),s=this.options().multiple;n?s?this.state.add(e):this.state=e:s?this.state.delete(e):this.state=null,this.onChanges.forEach(o=>o())}getState(){return this.options().multiple?Array.from(this.state):this.state}hasValue(t){return this.options().multiple?this.state.has(t):this.state===t}setState(t){this.state=this.options().multiple?new Set(t):t;let e=this.options().multiple?t:[t];this.walker().each(n=>{let s=n.use(_);if(s.ungrouped)return;let o=e.includes(s.value);o&&!s.isSelected()?s.surgicallySelect():!o&&s.isSelected()&&s.surgicallyDeselect()}),this.onChanges.forEach(n=>n())}selected(){return this.walker().find(t=>t.use(_).isSelected()).use(_)}selecteds(){return this.walker().filter(t=>t.use(_).isSelected()).map(t=>t.use(_))}selectFirst(){this.walker().first()?.use(_).select()}selectAll(){this.walker().filter(t=>!t.use(_).isSelected()).map(t=>t.use(_).select())}deselectAll(){this.walker().filter(t=>t.use(_).isSelected()).map(t=>t.use(_).deselect())}allAreSelected(){return this.walker().filter(t=>t.use(_).isSelected()).length===this.walker().filter(t=>!0).length}noneAreSelected(){return this.state===null||this.state?.size===0}selectableByValue(t){return this.walker().find(e=>e.use(_).value===t)?.use(_)}deselectOthers(t){this.walker().each(e=>{e!==t&&e.use(_).surgicallyDeselect()})}selectedTextValue(){return this.options().multiple?Array.from(this.state).map(t=>this.convertValueStringToElementText(t)).join(", "):this.convertValueStringToElementText(this.state)}convertValueStringToElementText(t){let e=this.findByValue(t);return e?e.label||e.value:t}findByValue(t){return this.selecteds().find(e=>e.value===t)}walker(){return j(this.el,(t,{skip:e,reject:n})=>{if(t[this.constructor.name]&&t!==this.el)return n();if(!t[this.groupOfType.name]||t.mixins.get(this.groupOfType.name).ungrouped)return e()})}},_=class extends O{boot({options:t}){this.groupedByType=dt,t({ungrouped:!1,togglable:!1,value:void 0,label:void 0,selectedInitially:!1,dataAttr:"data-selected",ariaAttr:"aria-selected"}),this.ungrouped=this.options().ungrouped,this.value=this.options().value===void 0?this.el.value:this.options().value,this.label=this.options().label;let e=this.options().selectedInitially;this.group()&&this.group().hasValue(this.value)&&(e=!0),this.multiple=this.hasGroup()?this.group().options().multiple:!1,this.toggleable=this.options().toggleable||this.multiple,this.onSelects=[],this.onUnselects=[],this.onChanges=[],e?this.silentlySelect():this.state=e}mount(){this.el.hasAttribute(this.options().ariaAttr)||p(this.el,this.options().ariaAttr,"false")}onChange(t){this.onChanges.push(t)}onSelect(t){this.onSelects.push(t)}onUnselect(t){this.onUnselects.push(t)}setState(t){t?this.select():this.deselect()}getState(){return this.state}press(){this.toggleable?this.toggle():this.select()}trigger(){this.toggleable?this.toggle():this.select()}toggle(){this.isSelected()?this.deselect():this.select()}isSelected(){return this.state}silentlySelect(){this.toggleable||this.group()?.deselectOthers(this.el),this.state=!0,p(this.el,this.options().ariaAttr,"true"),p(this.el,this.options().dataAttr,"")}select(){let t=!this.isSelected();this.toggleable||this.group()?.deselectOthers(this.el),this.state=!0,p(this.el,this.options().ariaAttr,"true"),p(this.el,this.options().dataAttr,""),t&&(this.onSelects.forEach(e=>e()),this.onChanges.forEach(e=>e()),this.group()?.changed(this))}surgicallySelect(){let t=!this.isSelected();this.state=!0,p(this.el,this.options().ariaAttr,"true"),p(this.el,this.options().dataAttr,""),t&&(this.onSelects.forEach(e=>e()),this.onChanges.forEach(e=>e()))}deselect(t=!0){let e=this.isSelected();this.state=!1,p(this.el,this.options().ariaAttr,"false"),T(this.el,this.options().dataAttr),e&&(this.onUnselects.forEach(n=>n()),this.onChanges.forEach(n=>n()),t&&this.group()?.changed(this))}surgicallyDeselect(){let t=this.isSelected();this.state=!1,p(this.el,this.options().ariaAttr,"false"),T(this.el,this.options().dataAttr),t&&(this.onUnselects.forEach(e=>e()),this.onChanges.forEach(e=>e()))}getValue(){return this.value}getLabel(){return this.label}};var yt=class extends lt{groupOfType=C;boot({options:t}){t({wrap:!1,ensureTabbable:!0})}mount(){this.options().ensureTabbable&&this.ensureTabbable()}focusFirst(){let t;t=t||this.walker().find(e=>e.hasAttribute("autofocus")),t=t||this.walker().find(e=>e.getAttribute("tabindex")==="0"),t=t||this.walker().find(e=>e.getAttribute("tabindex")==="-1"),t=t||this.walker().find(e=>Jt(e)),t?.focus()}focusPrev(){this.moveFocus(t=>this.options().wrap?this.walker().prevOrLast(t):this.walker().prev(t))}focusNext(){this.moveFocus(t=>this.options().wrap?this.walker().nextOrFirst(t):this.walker().next(t))}focusBySearch(t){let e=this.walker().find(n=>n.textContent.toLowerCase().trim().startsWith(t.toLowerCase()));e?.use(C).tabbable(),e?.use(C).focus()}moveFocus(t){let e=this.walker().find(s=>s.use(C).isTabbable());t(e)?.use(C).focus()}ensureTabbable(){this.walker().findOrFirst(t=>{t.use(C).isTabbable()})?.use(C).tabbable()}wipeTabbables(){this.walker().each(t=>{t.use(C).untabbable()})}untabbleOthers(t){this.walker().each(e=>{e!==t&&e.use(C).untabbable()})}walker(){return j(this.el,(t,{skip:e,reject:n})=>{if(t[this.constructor.name]&&t!==this.el)return n();if(!t[this.groupOfType.name])return e();if(t.hasAttribute("disabled"))return n()})}},C=class extends O{groupedByType=yt;boot({options:t}){t({hover:!1,tabbable:!1,tabbableAttr:null})}mount(){this.el.hasAttribute("disabled")||(this.el.hasAttribute("tabindex")||(this.options().tabbable?this.tabbable():this.untabbable()),this.pauseFocusListener=this.on("focus",()=>{this.focus(!1)}).pause,this.on("focus",()=>{Rt()&&p(this.el,"data-focus","")}),this.on("blur",()=>{T(this.el,"data-focus")}),this.options().hover&&this.on("pointerenter",()=>{this.group()?.untabbleOthers(this.el),this.tabbable()}),this.options().hover&&this.on("pointerleave",t=>{this.untabbable()}))}focus(t=!0){this.group()?.untabbleOthers(this.el),this.tabbable(),t&&this.pauseFocusListener(()=>{this.el.focus({focusVisible:!1})})}tabbable(){p(this.el,"tabindex","0"),this.options().tabbableAttr&&p(this.el,this.options().tabbableAttr,"")}untabbable(){p(this.el,"tabindex","-1"),this.options().tabbableAttr&&T(this.el,this.options().tabbableAttr)}isTabbable(){return this.el.getAttribute("tabindex")==="0"}};var Tt=class extends O{boot({options:t}){this.onChanges=[],Object.defineProperty(this.el,"disabled",{get:()=>this.el.hasAttribute("disabled"),set:n=>{n?this.el.setAttribute("disabled",""):this.el.removeAttribute("disabled")}}),this.el.hasAttribute("disabled")?this.el.disabled=!0:this.el.closest("[disabled]")&&(this.el.disabled=!0),new MutationObserver(n=>{this.onChanges.forEach(s=>s(this.el.disabled))}).observe(this.el,{attributeFilter:["disabled"]})}onChange(t){this.onChanges.push(t)}onInitAndChange(t){t(this.el.disabled),this.onChanges.push(t)}};var Wt=class i extends k{boot(){if(this._focusable=new yt(this,{wrap:!1,ensureTabbable:!1}),S(this,"keydown",t=>{["ArrowDown"].includes(t.key)?(t.target===this?this._focusable.focusFirst():this._focusable.focusNext(),t.preventDefault(),t.stopPropagation()):["ArrowUp"].includes(t.key)&&(t.target===this?this._focusable.focusFirst():this._focusable.focusPrev(),t.preventDefault(),t.stopPropagation())}),Zt(this,t=>this._focusable.focusBySearch(t)),this.hasAttribute("popover")&&this.addEventListener("lofi-close-popovers",()=>{setTimeout(()=>this.hidePopover(),50)}),this.parentElement.localName==="ui-dropdown"){let t=this.parentElement;S(t.trigger(),"keydown",e=>{e.key==="ArrowDown"&&(this.fromArrowDown=!0,this.showPopover(),e.preventDefault(),e.stopPropagation())})}p(this,"role","menu"),p(this,"tabindex","-1")}mount(){this.initializeMenuItems(),new MutationObserver(e=>{this.initializeMenuItems()}).observe(this,{childList:!0,subtree:!0})}onPopoverShow(){queueMicrotask(()=>{this.fromArrowDown?(this._focusable.focusFirst(),this.fromArrowDown=!1):this.focus()})}onPopoverHide(){this._focusable.wipeTabbables()}initializeMenuItems(){this.walker().each(t=>{t._disableable||si(t)})}walker(){return j(this,(t,{skip:e,reject:n})=>{if(t instanceof i)return n();if(!["a","button"].includes(t.localName))return e()})}},Ht=class extends k{boot(){}},It=class extends k{boot(){this._disabled=this.hasAttribute("disabled");let t=this;this._disabled&&(p(t,"disabled",""),p(t,"aria-disabled","true"));let e=Y(t,"menu-checkbox");if(p(t,"role","menuitemcheckbox"),this._disabled)return;t._focusable=new C(t,{hover:!0,tabbableAttr:"data-active"}),t._selectable=new _(t,{toggleable:!0,value:this.hasAttribute("value")?this.getAttribute("value"):t.textContent.trim(),label:this.hasAttribute("label")?this.getAttribute("label"):t.textContent.trim(),dataAttr:"data-checked",ariaAttr:"aria-checked",selectedInitially:this.hasAttribute("checked")}),this._controllable=new X(this),this._controllable.initial(s=>s&&t._selectable.setState(s)),this._controllable.getter(()=>t._selectable.getState());let n=ot();this._controllable.setter(n(s=>{this._selectable.setState(s)})),this._selectable.onChange(n(()=>{this._controllable.dispatch()})),S(t,"click",()=>{this.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0})),t._selectable.press()}),Xt(t)}},zt=class extends k{boot(){this._disabled=this.hasAttribute("disabled");let t=this;this._disabled&&(p(t,"disabled",""),p(t,"aria-disabled","true"));let e=Y(t,"menu-radio");p(t,"role","menuitemradio"),!this._disabled&&(t._focusable=new C(t,{hover:!0,tabbableAttr:"data-active"}),t._selectable=new _(t,{toggleable:!1,value:this.hasAttribute("value")?this.getAttribute("value"):t.textContent.trim(),label:this.hasAttribute("label")?this.getAttribute("label"):t.textContent.trim(),dataAttr:"data-checked",ariaAttr:"aria-checked",selectedInitially:this.hasAttribute("checked")}),S(t,"click",()=>{this.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0})),t._selectable.press()}),Xt(t))}},jt=class extends k{boot(){this._selectable=new dt(this),this._controllable=new X(this),p(this,"role","group"),this._controllable.initial(e=>e&&this._selectable.setState(e)),this._controllable.getter(()=>this._selectable.getState());let t=ot();this._controllable.setter(t(e=>{this._selectable.setState(e)})),this._selectable.onChange(t(()=>{this._controllable.dispatch()}))}},Yt=class extends k{boot(){this._selectable=new dt(this,{multiple:!0}),this._controllable=new X(this),p(this,"role","group"),this._controllable.initial(e=>e&&this._selectable.setState(e)),this._controllable.getter(()=>this._selectable.getState());let t=ot();this._controllable.setter(t(e=>{this._selectable.setState(e)})),this._selectable.onChange(t(()=>{this._controllable.dispatch()}))}};Z(({css:i})=>i`ui-menu[popover]:popover-open { display: block; }`);Z(({css:i})=>i`ui-item, ui-menu-checkbox, ui-menu-radio { cursor: default; display: contents; }`);F("menu",Wt);F("submenu",Ht);F("menu-checkbox",It);F("menu-radio",zt);F("menu-radio-group",jt);F("menu-checkbox-group",Yt);function Xt(i){S(i,"keydown",t=>{t.key==="Enter"&&(i.click(),t.preventDefault(),t.stopPropagation())}),S(i,"keydown",t=>{t.key===" "&&(t.preventDefault(),t.stopPropagation())}),S(i,"keyup",t=>{t.key===" "&&(i.click(),t.preventDefault(),t.stopPropagation())})}function si(i){i._disableable=new Tt(i),i._disabled=i.hasAttribute("disabled");let t=i.querySelector("a"),e=i,n=i.parentElement.matches("ui-submenu")&&i.parentElement.querySelector("ui-menu[popover]"),s=t||e;i._disabled&&(p(s,"disabled",""),p(s,"aria-disabled","true"));let o=Y(s,"menu-item");if(p(s,"role","menuitem"),!i._disabled)if(s._focusable=new C(s,{hover:!0,tabbableAttr:"data-active"}),!n)i.hasAttribute("disabled")||S(i,"click",()=>{i.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0}))}),Xt(e);else{n._popoverable=new U(n),n._anchorable=new K(n,{reference:e,position:n.hasAttribute("position")?n.getAttribute("position"):"right start",gap:n.hasAttribute("gap")?n.getAttribute("gap"):"-5"}),e.addEventListener("click",a=>{n._popoverable.setState(!0)});let{clear:r}=rt(e,n,{gain(){n._popoverable.setState(!0)},lose(){n._popoverable.setState(!1)},focusable:!1});n._popoverable.onChange(()=>{n._popoverable.getState()||(r(),n._focusable.wipeTabbables()),n._anchorable.reposition()}),S(e,"keydown",a=>{a.key==="Enter"&&(n._popoverable.setState(!0),setTimeout(()=>n._focusable.focusFirst()))}),S(e,"keydown",a=>{a.key==="ArrowRight"&&(n._popoverable.setState(!0),setTimeout(()=>n._focusable.focusFirst()))}),S(n,"keydown",a=>{a.key==="ArrowLeft"&&(n._popoverable.setState(!1),e.focus(),a.stopPropagation())})}}})(); +(()=>{function Z(e){let t=e({css:(s,...n)=>s.raw[0]+n.join("")}),i=new CSSStyleSheet;i.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,i]}function Gt(e,t){let i=e;for(;i;){if(t(i))return i;i=i.parentElement}}function j(e,t){let i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,t?{acceptNode:s=>{let n,o;return t(s,{skip:()=>n=!0,reject:()=>o=!0}),n?NodeFilter.FILTER_SKIP:o?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}:{});return new Pt(i)}var Pt=class{constructor(t){this.walker=t}from(t){return this.walker.currentNode=t,this}first(){return this.walker.firstChild()}last(){return this.walker.lastChild()}next(t){return this.walker.currentNode=t,this.walker.nextSibling()}nextOrFirst(t){let i=this.next(t);return i||(this.walker.currentNode=this.walker.root,this.first())}prev(t){return this.walker.currentNode=t,this.walker.previousSibling()}prevOrLast(t){let i=this.prev(t);return i||(this.walker.currentNode=this.walker.root,this.last())}closest(t,i){}contains(t){return this.find(i=>i===t)}find(t){return this.walk((i,s)=>{t(i)&&s(i)})}findOrFirst(t){return this.find(t)||(this.walker.currentNode=this.walker.root),this.first()}each(t){this.walk(i=>t(i))}some(t){return!!this.find(t)}every(t){let i=!0;return this.walk(s=>{t(s)||(i=!1)}),i}map(t){let i=[];return this.walk(s=>i.push(t(s))),i}filter(t){let i=[];return this.walk(s=>t(s)&&i.push(s)),i}walk(t){let i,s=this.walker,n;for(;s.nextNode()&&(i=s.currentNode,t(i,o=>n=o),n===void 0););return n}};function F(e,t){customElements.define(`ui-${e}`,t)}function S(e,t,i,s={}){return e.addEventListener(t,i,s),{off:()=>e.removeEventListener(t,i),pause:n=>{e.removeEventListener(t,i),n(),e.addEventListener(t,i)}}}function Jt(e){return["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[tabindex]","[contenteditable]"].some(i=>e.matches(i))&&e.tabIndex>=0}function Te(e,t){let i;return function(){let s=this,n=arguments;i||(e.apply(s,n),i=!0,setTimeout(()=>i=!1,t))}}var St="pointer";document.addEventListener("keydown",()=>St="keyboard",{capture:!0});document.addEventListener("pointerdown",e=>{St=e.pointerType==="mouse"?"mouse":"touch"},{capture:!0});function Rt(){return St==="keyboard"}function Pe(){return St==="touch"}function Zt(e,t){e.addEventListener("keydown",i=>{i.key.length===1&&/[a-zA-Z]/.test(i.key)&&(t(i.key),i.stopPropagation())})}function Re(e,t){return"lofi-"+(t?t+"-":"")+Math.random().toString(16).slice(2)}function Y(e,t){let i=e.hasAttribute("id")?e.getAttribute("id"):Re(e,t);return p(e,"id",i),e._x_bindings||(e._x_bindings={}),e._x_bindings.id||(e._x_bindings.id=i),i}function ot(){let e=!1;return t=>(...i)=>{e||(e=!0,t(...i),e=!1)}}function rt(e,t,{gain:i,lose:s,focusable:n,safeArea:o}){let r=!1;n&&document.addEventListener("focusin",u=>{Rt()&&(e.contains(u.target)||t.contains(u.target)?(r=!0,i()):(r=!1,s()))});let a=()=>{},l=()=>{},c=()=>{r=!1,s(),a(),l()},f=()=>{r=!1,a(),l()};return e.addEventListener("pointerenter",u=>{Pe()||r||(r=!0,i(),setTimeout(()=>{let{safeArea:m,redraw:h,remove:b}=Le(e,t,u.clientX,u.clientY);a=b;let g,w=Te(d=>{let v=t.getBoundingClientRect(),x=e.getBoundingClientRect(),y;switch(m.contains(d.target)&&Fe(x,v,d.clientX,d.clientY)?y="safeArea":t.contains(d.target)?y="panel":e.contains(d.target)?y="trigger":y="outside",g&&clearTimeout(g),y){case"outside":c();break;case"trigger":h(d.clientX,d.clientY);break;case"panel":a();break;case"safeArea":h(d.clientX,d.clientY),g=setTimeout(()=>{c()},300);break;default:break}},100);document.addEventListener("pointermove",w),l=()=>document.removeEventListener("pointermove",w)}))}),{clear:f}}function Le(e,t,i,s){let n=document.createElement("div"),o=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.style.position="fixed",p(n,"data-safe-area","");let a=(l,c)=>{if(o.top===0&&o.bottom===0)return;let f;o.leftr.right&&(f="right"),o.topr.bottom&&o.top>c&&(f="down"),f===void 0&&(f="right");let u,m,h,b,g,w,d,v,x=10;switch(f){case"left":u=o.right,m=Math.max(o.right,l)+5,h=m-u,b=Math.min(r.top,o.top)-x,g=Math.max(r.bottom,o.bottom)+x,w=g-b,d=c-b,v=`polygon(0% 0%, 100% ${d}px, 0% 100%)`;break;case"right":u=Math.min(o.left,l)-5,m=o.left,h=m-u,b=Math.min(r.top,o.top)-x,g=Math.max(r.bottom,o.bottom)+x,w=g-b,d=c-b,v=`polygon(0% ${d}px, 100% 0%, 100% 100%)`;break;case"up":u=Math.min(l,o.left)-x,m=Math.max(l,o.right)+x,h=m-u,b=o.bottom,g=Math.max(o.bottom,c)+5,w=g-b,d=l-u,v=`polygon(0% 0%, 100% 0%, ${d}px 100%)`;break;case"down":u=Math.min(l,o.left)-x,m=Math.max(l,o.right)+x,h=m-u,b=Math.min(o.top,c)-5,g=o.top,w=g-b,d=l-u,v=`polygon(${d}px 0%, 100% 100%, 0% 100%)`;break}n.style.left=`${u}px`,n.style.top=`${b}px`,n.style.width=`${h}px`,n.style.height=`${w}px`,n.style.clipPath=v};return{safeArea:n,redraw:(l,c)=>{n.isConnected||e.appendChild(n),a(l,c)},remove:()=>{n.remove()}}}function Fe(e,t,i,s){return!Me(e,i,s)&&!De(t,i,s)}function Me(e,t,i){return e.left<=t&&t<=e.right&&e.top<=i&&i<=e.bottom}function De(e,t,i){return e.left<=t&&t<=e.right&&e.top<=i&&i<=e.bottom}function p(e,t,i){e._durableAttributeObserver===void 0&&(e._durableAttributeObserver=Qt(e,[t])),e._durableAttributeObserver.hasAttribute(t)||e._durableAttributeObserver.addAttribute(t),e._durableAttributeObserver.pause(()=>{e.setAttribute(t,i)})}function T(e,t){e._durableAttributeObserver===void 0&&(e._durableAttributeObserver=Qt(e,[t])),e._durableAttributeObserver.hasAttribute(t)||e._durableAttributeObserver.addAttribute(t),e._durableAttributeObserver.pause(()=>{e.removeAttribute(t)})}function Qt(e,t){let i=n=>{n.forEach(o=>{o.oldValue===null?e._durableAttributeObserver.pause(()=>T(e,o.attributeName)):e._durableAttributeObserver.pause(()=>p(e,o.attributeName,o.oldValue))})},s=new MutationObserver(n=>i(n));return s.observe(e,{attributeFilter:t,attributeOldValue:!0}),{attributes:t,hasAttribute(n){return this.attributes.includes(n)},addAttribute(n){this.attributes.includes(n)||this.attributes.push(n),s.observe(e,{attributeFilter:this.attributes,attributeOldValue:!0})},pause(n){i(s.takeRecords()),s.disconnect(),n(),s.observe(e,{attributeFilter:this.attributes,attributeOldValue:!0})}}}var k=class extends HTMLElement{constructor(){super(),this.boot?.()}connectedCallback(){queueMicrotask(()=>{this.mount?.()})}mixin(t,i={}){return new t(this,i)}appendMixin(t,i={}){return new t(this,i)}use(t){let i;return this.mixins.forEach(s=>{s instanceof t&&(i=s)}),i}uses(t){let i;return this.mixins.forEach(s=>{s instanceof t&&(i=!0)}),!!i}on(t,i){return S(this,t,i)}root(t,i={}){if(t===void 0)return this.__root;let s=document.createElement(t);for(let o in i)setAttribute(s,o,i[o]);let n=this.attachShadow({mode:"open"});return s.appendChild(document.createElement("slot")),n.appendChild(s),this.__root=s,this.__root}};var O=class{constructor(t,i={}){this.el=t,this.grouped=i.grouped===void 0,this.el.mixins=this.el.mixins?this.el.mixins:new Map,this.el.mixins.set(this.constructor.name,this),this.el[this.constructor.name]=!0,this.el.use||(this.el.use=k.prototype.use.bind(this.el)),this.opts=i,this.boot?.({options:s=>{let n=s;Object.entries(this.opts).forEach(([o,r])=>{r!==void 0&&(n[o]=r)}),this.opts=n}}),queueMicrotask(()=>{this.mount?.()})}options(){return this.opts}hasGroup(){return!!this.group()}group(){if(this.grouped!==!1)return Gt(this.el,t=>t[this.groupedByType.name])?.use(this.groupedByType)}on(t,i){return S(this.el,t,i)}},lt=class extends O{constructor(t,i={}){super(t,i)}walker(){return j(this.el,(t,{skip:i,reject:s})=>{if(t[this.constructor.name]&&t!==this.el)return s();if(!t[this.groupOfType.name]||!t.mixins.get(this.groupOfType.name).grouped)return i()})}};var X=class extends O{boot({options:t}){this.initialState=this.el.value,this.getterFunc=()=>{},this.setterFunc=i=>this.initialState=i,Object.defineProperty(this.el,"value",{get:()=>this.getterFunc(),set:i=>{this.setterFunc(i)}})}initial(t){t(this.initialState)}getter(t){this.getterFunc=t}setter(t){this.setterFunc=t}dispatch(){this.el.dispatchEvent(new Event("input",{bubbles:!1,cancelable:!0})),this.el.dispatchEvent(new Event("change",{bubbles:!1,cancelable:!0}))}};var U=class extends O{boot({options:t}){this.exemptFromLightDismissals=new WeakSet,this.onChanges=[],this.state=!1,this.busy=!1,S(this.el,"beforetoggle",i=>{let s=this.state;this.state=i.newState==="open",s!==this.state&&this.onChanges.forEach(n=>n(this.state,s)),this.state||(i.preventDefault(),i.stopPropagation())}),S(this.el,"beforetoggle",()=>this.busy=!0),S(this.el,"toggle",()=>this.busy=!1)}onChange(t){this.onChanges.push(t)}setState(t){this.busy||(t?this.show():this.hide())}getState(){return this.state}toggle(){this.el.togglePopover()}show(){this.el.showPopover()}hide(){this.el.hidePopover()}ensureInternalStateIsSyncedWithActualPopoverState(){if(this.state!==this.el.matches(":popover-open")){let t=this.state;this.state=this.el.matches(":popover-open")}}};var N=Math.min,E=Math.max,gt=Math.round,wt=Math.floor,V=e=>({x:e,y:e}),Ne={left:"right",right:"left",bottom:"top",top:"bottom"},Be={start:"end",end:"start"};function Lt(e,t,i){return E(e,N(t,i))}function at(e,t){return typeof e=="function"?e(t):e}function $(e){return e.split("-")[0]}function ct(e){return e.split("-")[1]}function Ft(e){return e==="x"?"y":"x"}function Mt(e){return e==="y"?"height":"width"}function q(e){return["top","bottom"].includes($(e))?"y":"x"}function Dt(e){return Ft(q(e))}function te(e,t,i){i===void 0&&(i=!1);let s=ct(e),n=Dt(e),o=Mt(n),r=n==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=mt(r)),[r,mt(r)]}function ee(e){let t=mt(e);return[_t(e),t,_t(t)]}function _t(e){return e.replace(/start|end/g,t=>Be[t])}function Ve(e,t,i){let s=["left","right"],n=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?n:s:t?s:n;case"left":case"right":return t?o:r;default:return[]}}function ie(e,t,i,s){let n=ct(e),o=Ve($(e),i==="start",s);return n&&(o=o.map(r=>r+"-"+n),t&&(o=o.concat(o.map(_t)))),o}function mt(e){return e.replace(/left|right|bottom|top/g,t=>Ne[t])}function $e(e){return{top:0,right:0,bottom:0,left:0,...e}}function se(e){return typeof e!="number"?$e(e):{top:e,right:e,bottom:e,left:e}}function Q(e){let{x:t,y:i,width:s,height:n}=e;return{width:s,height:n,top:i,left:t,right:t+s,bottom:i+n,x:t,y:i}}function ne(e,t,i){let{reference:s,floating:n}=e,o=q(t),r=Dt(t),a=Mt(r),l=$(t),c=o==="y",f=s.x+s.width/2-n.width/2,u=s.y+s.height/2-n.height/2,m=s[a]/2-n[a]/2,h;switch(l){case"top":h={x:f,y:s.y-n.height};break;case"bottom":h={x:f,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:u};break;case"left":h={x:s.x-n.width,y:u};break;default:h={x:s.x,y:s.y}}switch(ct(t)){case"start":h[r]-=m*(i&&c?-1:1);break;case"end":h[r]+=m*(i&&c?-1:1);break}return h}var oe=async(e,t,i)=>{let{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:r}=i,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:e,floating:t,strategy:n}),{x:f,y:u}=ne(c,s,l),m=s,h={},b=0;for(let g=0;gJ<=0)){var pt,Ut;let J=(((pt=o.flip)==null?void 0:pt.index)||0)+1,Kt=At[J];if(Kt)return{data:{index:J,overflows:I},reset:{placement:Kt}};let bt=(Ut=I.filter(nt=>nt.overflows[0]<=0).sort((nt,H)=>nt.overflows[1]-H.overflows[1])[0])==null?void 0:Ut.placement;if(!bt)switch(h){case"bestFit":{var qt;let nt=(qt=I.filter(H=>{if(D){let z=q(H.placement);return z===v||z==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(z=>z>0).reduce((z,Ce)=>z+Ce,0)]).sort((H,z)=>H[1]-z[1])[0])==null?void 0:qt[0];nt&&(bt=nt);break}case"initialPlacement":bt=a;break}if(n!==bt)return{reset:{placement:bt}}}return{}}}};async function We(e,t){let{placement:i,platform:s,elements:n}=e,o=await(s.isRTL==null?void 0:s.isRTL(n.floating)),r=$(i),a=ct(i),l=q(i)==="y",c=["left","top"].includes(r)?-1:1,f=o&&l?-1:1,u=at(t,e),{mainAxis:m,crossAxis:h,alignmentAxis:b}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof b=="number"&&(h=a==="end"?b*-1:b),l?{x:h*f,y:m*c}:{x:m*c,y:h*f}}var le=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,s;let{x:n,y:o,placement:r,middlewareData:a}=t,l=await We(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:r}}}}},ae=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:i,y:s,placement:n}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:w=>{let{x:d,y:v}=w;return{x:d,y:v}}},...l}=at(e,t),c={x:i,y:s},f=await kt(t,l),u=q($(n)),m=Ft(u),h=c[m],b=c[u];if(o){let w=m==="y"?"top":"left",d=m==="y"?"bottom":"right",v=h+f[w],x=h-f[d];h=Lt(v,h,x)}if(r){let w=u==="y"?"top":"left",d=u==="y"?"bottom":"right",v=b+f[w],x=b-f[d];b=Lt(v,b,x)}let g=a.fn({...t,[m]:h,[u]:b});return{...g,data:{x:g.x-i,y:g.y-s}}}}};var ce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:i,rects:s,platform:n,elements:o}=t,{apply:r=()=>{},...a}=at(e,t),l=await kt(t,a),c=$(i),f=ct(i),u=q(i)==="y",{width:m,height:h}=s.floating,b,g;c==="top"||c==="bottom"?(b=c,g=f===(await(n.isRTL==null?void 0:n.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,b=f==="end"?"top":"bottom");let w=h-l.top-l.bottom,d=m-l.left-l.right,v=N(h-l[b],w),x=N(m-l[g],d),y=!t.middlewareData.shift,A=v,D=x;if(u?D=f||y?N(x,d):d:A=f||y?N(v,w):w,y&&!f){let st=E(l.left,0),G=E(l.right,0),I=E(l.top,0),pt=E(l.bottom,0);u?D=m-2*(st!==0||G!==0?st+G:E(l.left,l.right)):A=h-2*(I!==0||pt!==0?I+pt:E(l.top,l.bottom))}await r({...t,availableWidth:D,availableHeight:A});let At=await n.getDimensions(o.floating);return m!==At.width||h!==At.height?{reset:{rects:!0}}:{}}}};function tt(e){return fe(e)?(e.nodeName||"").toLowerCase():"#document"}function P(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function B(e){var t;return(t=(fe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fe(e){return e instanceof Node||e instanceof P(e).Node}function R(e){return e instanceof Element||e instanceof P(e).Element}function M(e){return e instanceof HTMLElement||e instanceof P(e).HTMLElement}function ue(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof P(e).ShadowRoot}function ft(e){let{overflow:t,overflowX:i,overflowY:s,display:n}=L(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+i)&&!["inline","contents"].includes(n)}function he(e){return["table","td","th"].includes(tt(e))}function vt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ot(e){let t=Et(),i=R(e)?L(e):e;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(i.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(i.contain||"").includes(s))}function de(e){let t=W(e);for(;M(t)&&!et(t);){if(Ot(t))return t;if(vt(t))return null;t=W(t)}return null}function Et(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function et(e){return["html","body","#document"].includes(tt(e))}function L(e){return P(e).getComputedStyle(e)}function xt(e){return R(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function W(e){if(tt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||ue(e)&&e.host||B(e);return ue(t)?t.host:t}function pe(e){let t=W(e);return et(t)?e.ownerDocument?e.ownerDocument.body:e.body:M(t)&&ft(t)?t:pe(t)}function ut(e,t,i){var s;t===void 0&&(t=[]),i===void 0&&(i=!0);let n=pe(e),o=n===((s=e.ownerDocument)==null?void 0:s.body),r=P(n);if(o){let a=Ct(r);return t.concat(r,r.visualViewport||[],ft(n)?n:[],a&&i?ut(a):[])}return t.concat(n,ut(n,[],i))}function Ct(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ge(e){let t=L(e),i=parseFloat(t.width)||0,s=parseFloat(t.height)||0,n=M(e),o=n?e.offsetWidth:i,r=n?e.offsetHeight:s,a=gt(i)!==o||gt(s)!==r;return a&&(i=o,s=r),{width:i,height:s,$:a}}function Bt(e){return R(e)?e:e.contextElement}function ht(e){let t=Bt(e);if(!M(t))return V(1);let i=t.getBoundingClientRect(),{width:s,height:n,$:o}=ge(t),r=(o?gt(i.width):i.width)/s,a=(o?gt(i.height):i.height)/n;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var Ie=V(0);function we(e){let t=P(e);return!Et()||!t.visualViewport?Ie:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function He(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==P(e)?!1:t}function it(e,t,i,s){t===void 0&&(t=!1),i===void 0&&(i=!1);let n=e.getBoundingClientRect(),o=Bt(e),r=V(1);t&&(s?R(s)&&(r=ht(s)):r=ht(e));let a=He(o,i,s)?we(o):V(0),l=(n.left+a.x)/r.x,c=(n.top+a.y)/r.y,f=n.width/r.x,u=n.height/r.y;if(o){let m=P(o),h=s&&R(s)?P(s):s,b=m,g=Ct(b);for(;g&&s&&h!==b;){let w=ht(g),d=g.getBoundingClientRect(),v=L(g),x=d.left+(g.clientLeft+parseFloat(v.paddingLeft))*w.x,y=d.top+(g.clientTop+parseFloat(v.paddingTop))*w.y;l*=w.x,c*=w.y,f*=w.x,u*=w.y,l+=x,c+=y,b=P(g),g=Ct(b)}}return Q({width:f,height:u,x:l,y:c})}function ze(e){let{elements:t,rect:i,offsetParent:s,strategy:n}=e,o=n==="fixed",r=B(s),a=t?vt(t.floating):!1;if(s===r||a&&o)return i;let l={scrollLeft:0,scrollTop:0},c=V(1),f=V(0),u=M(s);if((u||!u&&!o)&&((tt(s)!=="body"||ft(r))&&(l=xt(s)),M(s))){let m=it(s);c=ht(s),f.x=m.x+s.clientLeft,f.y=m.y+s.clientTop}return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+f.x,y:i.y*c.y-l.scrollTop*c.y+f.y}}function je(e){return Array.from(e.getClientRects())}function ve(e){return it(B(e)).left+xt(e).scrollLeft}function Ye(e){let t=B(e),i=xt(e),s=e.ownerDocument.body,n=E(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=E(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight),r=-i.scrollLeft+ve(e),a=-i.scrollTop;return L(s).direction==="rtl"&&(r+=E(t.clientWidth,s.clientWidth)-n),{width:n,height:o,x:r,y:a}}function Xe(e,t){let i=P(e),s=B(e),n=i.visualViewport,o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(n){o=n.width,r=n.height;let c=Et();(!c||c&&t==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:o,height:r,x:a,y:l}}function Ue(e,t){let i=it(e,!0,t==="fixed"),s=i.top+e.clientTop,n=i.left+e.clientLeft,o=M(e)?ht(e):V(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=n*o.x,c=s*o.y;return{width:r,height:a,x:l,y:c}}function be(e,t,i){let s;if(t==="viewport")s=Xe(e,i);else if(t==="document")s=Ye(B(e));else if(R(t))s=Ue(t,i);else{let n=we(e);s={...t,x:t.x-n.x,y:t.y-n.y}}return Q(s)}function xe(e,t){let i=W(e);return i===t||!R(i)||et(i)?!1:L(i).position==="fixed"||xe(i,t)}function qe(e,t){let i=t.get(e);if(i)return i;let s=ut(e,[],!1).filter(a=>R(a)&&tt(a)!=="body"),n=null,o=L(e).position==="fixed",r=o?W(e):e;for(;R(r)&&!et(r);){let a=L(r),l=Ot(r);!l&&a.position==="fixed"&&(n=null),(o?!l&&!n:!l&&a.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||ft(r)&&!l&&xe(e,r))?s=s.filter(f=>f!==r):n=a,r=W(r)}return t.set(e,s),s}function Ke(e){let{element:t,boundary:i,rootBoundary:s,strategy:n}=e,r=[...i==="clippingAncestors"?vt(t)?[]:qe(t,this._c):[].concat(i),s],a=r[0],l=r.reduce((c,f)=>{let u=be(t,f,n);return c.top=E(u.top,c.top),c.right=N(u.right,c.right),c.bottom=N(u.bottom,c.bottom),c.left=E(u.left,c.left),c},be(t,a,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ge(e){let{width:t,height:i}=ge(e);return{width:t,height:i}}function Je(e,t,i){let s=M(t),n=B(t),o=i==="fixed",r=it(e,!0,o,t),a={scrollLeft:0,scrollTop:0},l=V(0);if(s||!s&&!o)if((tt(t)!=="body"||ft(n))&&(a=xt(t)),s){let u=it(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else n&&(l.x=ve(n));let c=r.left+a.scrollLeft-l.x,f=r.top+a.scrollTop-l.y;return{x:c,y:f,width:r.width,height:r.height}}function Nt(e){return L(e).position==="static"}function me(e,t){return!M(e)||L(e).position==="fixed"?null:t?t(e):e.offsetParent}function ye(e,t){let i=P(e);if(vt(e))return i;if(!M(e)){let n=W(e);for(;n&&!et(n);){if(R(n)&&!Nt(n))return n;n=W(n)}return i}let s=me(e,t);for(;s&&he(s)&&Nt(s);)s=me(s,t);return s&&et(s)&&Nt(s)&&!Ot(s)?i:s||de(e)||i}var Ze=async function(e){let t=this.getOffsetParent||ye,i=this.getDimensions,s=await i(e.floating);return{reference:Je(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Qe(e){return L(e).direction==="rtl"}var ti={convertOffsetParentRelativeRectToViewportRelativeRect:ze,getDocumentElement:B,getClippingRect:Ke,getOffsetParent:ye,getElementRects:Ze,getClientRects:je,getDimensions:Ge,getScale:ht,isElement:R,isRTL:Qe};function ei(e,t){let i=null,s,n=B(e);function o(){var a;clearTimeout(s),(a=i)==null||a.disconnect(),i=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();let{left:c,top:f,width:u,height:m}=e.getBoundingClientRect();if(a||t(),!u||!m)return;let h=wt(f),b=wt(n.clientWidth-(c+u)),g=wt(n.clientHeight-(f+m)),w=wt(c),v={rootMargin:-h+"px "+-b+"px "+-g+"px "+-w+"px",threshold:E(0,N(1,l))||1},x=!0;function y(A){let D=A[0].intersectionRatio;if(D!==l){if(!x)return r();D?r(!1,D):s=setTimeout(()=>{r(!1,1e-7)},1e3)}x=!1}try{i=new IntersectionObserver(y,{...v,root:n.ownerDocument})}catch{i=new IntersectionObserver(y,v)}i.observe(e)}return r(!0),o}function Ae(e,t,i,s){s===void 0&&(s={});let{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=Bt(e),f=n||o?[...c?ut(c):[],...ut(t)]:[];f.forEach(d=>{n&&d.addEventListener("scroll",i,{passive:!0}),o&&d.addEventListener("resize",i)});let u=c&&a?ei(c,i):null,m=-1,h=null;r&&(h=new ResizeObserver(d=>{let[v]=d;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),i()}),c&&!l&&h.observe(c),h.observe(t));let b,g=l?it(e):null;l&&w();function w(){let d=it(e);g&&(d.x!==g.x||d.y!==g.y||d.width!==g.width||d.height!==g.height)&&i(),g=d,b=requestAnimationFrame(w)}return i(),()=>{var d;f.forEach(v=>{n&&v.removeEventListener("scroll",i),o&&v.removeEventListener("resize",i)}),u?.(),(d=h)==null||d.disconnect(),h=null,l&&cancelAnimationFrame(b)}}var Se=le;var _e=ae,ke=re,Oe=ce;var Ee=(e,t,i)=>{let s=new Map,n={platform:ti,...i},o={...n.platform,_c:s};return oe(e,t,{...n,platform:o})};var K=class extends O{boot({options:t}){if(t({reference:null,auto:!0,position:"bottom start",gap:"5",offset:"0",matchWidth:!1}),this.options().reference===null||this.options().position===null)return;let i=ii(this.el,this.options().reference,{position:this.options().position,gap:this.options().gap,offset:this.options().offset,matchWidth:this.options().matchWidth}),s=()=>{};this.reposition=(...n)=>{this.options().auto?s=Ae(this.options().reference,this.el,i,{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0}):i(...n)},this.cleanup=()=>{s()}}};function ii(e,t,{position:i,offset:s,gap:n,matchWidth:o}){let r;return(a=null,l=null)=>{Ee(t,e,{placement:si(i),middleware:[ke(),_e({padding:5,crossAxis:!0}),Se({mainAxis:Number(n),alignmentAxis:Number(s)}),o?Oe({apply({rects:c,elements:f}){Object.assign(f.floating.style,{width:`${c.reference.width}px`})}}):void 0]}).then(({x:c,y:f})=>{r=e.getAttribute("style"),Object.assign(e.style,{position:"absolute",inset:`${l||f}px auto auto ${a||c}px`})})}}function si(e){return e.split(" ").join("-")}var Vt=class extends k{boot(){let t=this.trigger(),i=this.overlay();if(t){if(!i)return console.warn("ui-dropdown: no [popover] overlay found",this)}else return console.warn("ui-dropdown: no trigger element found",this);this._disabled=this.hasAttribute("disabled"),this._controllable=new X(this),i._popoverable=new U(i),i._anchorable=new K(i,{reference:t,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),i._popoverable.onChange(()=>{i._popoverable.getState()?i._anchorable.reposition():i._anchorable.cleanup()}),this._controllable.initial(o=>i._popoverable.setState(o)),this._controllable.getter(()=>i._popoverable.getState());let s=ot();this._controllable.setter(o=>i._popoverable.setState(o)),i._popoverable.onChange(s(()=>this._controllable.dispatch())),this.hasAttribute("hover")&&rt(t,i,{gain(){i._popoverable.setState(!0)},lose(){i._popoverable.setState(!1)},focusable:!0}),S(t,"click",()=>i._popoverable.toggle()),i._popoverable.getState()?(p(this,"data-open",""),p(t,"data-open",""),p(i,"data-open","")):(T(this,"data-open"),T(t,"data-open"),T(i,"data-open")),i._popoverable.onChange(()=>{i._popoverable.getState()?(p(this,"data-open",""),p(t,"data-open",""),p(i,"data-open","")):(T(this,"data-open"),T(t,"data-open"),T(i,"data-open"))});let n=Y(i,"dropdown");p(t,"aria-haspopup","true"),p(t,"aria-controls",n),p(t,"aria-expanded",i._popoverable.getState()?"true":"false"),i._popoverable.onChange(()=>{p(t,"aria-expanded",i._popoverable.getState()?"true":"false")}),i._popoverable.onChange(()=>{i._popoverable.getState()?i.onPopoverShow?.():i.onPopoverHide?.()})}trigger(){return this.querySelector("button")}overlay(){return this.lastElementChild?.matches("[popover]")&&this.lastElementChild}};Z(({css:e})=>e`ui-dropdown { display: contents; }`);F("dropdown",Vt);var $t=class extends k{boot(){let t=this.hasAttribute("label")?"label":"description",i=this.button(),s=this.overlay();if(i){if(!s)return console.warn("ui-tooltip: no [popover] overlay found",this)}else return console.warn("ui-tooltip: no trigger element found",this);this._disabled=this.hasAttribute("disabled"),s._popoverable=new U(s),s._anchorable=new K(s,{reference:i,position:this.hasAttribute("position")?this.getAttribute("position"):void 0,gap:this.hasAttribute("gap")?this.getAttribute("gap"):void 0,offset:this.hasAttribute("offset")?this.getAttribute("offset"):void 0}),s._popoverable.onChange(()=>s._anchorable.reposition()),this._disabled||rt(i,s,{gain(){s._popoverable.setState(!0)},lose(){s._popoverable.setState(!1)},focusable:!0});let n=Y(s,"tooltip");p(i,"aria-controls",n),p(i,"aria-expanded","false"),s._popoverable.onChange(()=>{s._popoverable.getState()?p(i,"aria-expanded","true"):p(i,"aria-expanded","false")}),t==="label"?p(i,"aria-labelledby",n):p(i,"aria-describedby",n),p(s,"role","tooltip")}button(){return this.firstElementChild}overlay(){return this.lastElementChild}};Z(({css:e})=>e`ui-tooltip { display: contents; }`);F("tooltip",$t);var dt=class extends lt{groupOfType=_;boot({options:t}){t({multiple:!1}),this.state=this.options().multiple?new Set:null,this.onChanges=[]}onChange(t){this.onChanges.push(t)}changed(t){if(t.ungrouped)return;let i=t.value,s=t.isSelected(),n=this.options().multiple;s?n?this.state.add(i):this.state=i:n?this.state.delete(i):this.state=null,this.onChanges.forEach(o=>o())}getState(){return this.options().multiple?Array.from(this.state):this.state}hasValue(t){return this.options().multiple?this.state.has(t):this.state===t}setState(t){this.state=this.options().multiple?new Set(t):t;let i=this.options().multiple?t:[t];this.walker().each(s=>{let n=s.use(_);if(n.ungrouped)return;let o=i.includes(n.value);o&&!n.isSelected()?n.surgicallySelect():!o&&n.isSelected()&&n.surgicallyDeselect()}),this.onChanges.forEach(s=>s())}selected(){return this.walker().find(t=>t.use(_).isSelected()).use(_)}selecteds(){return this.walker().filter(t=>t.use(_).isSelected()).map(t=>t.use(_))}selectFirst(){this.walker().first()?.use(_).select()}selectAll(){this.walker().filter(t=>!t.use(_).isSelected()).map(t=>t.use(_).select())}deselectAll(){this.walker().filter(t=>t.use(_).isSelected()).map(t=>t.use(_).deselect())}allAreSelected(){return this.walker().filter(t=>t.use(_).isSelected()).length===this.walker().filter(t=>!0).length}noneAreSelected(){return this.state===null||this.state?.size===0}selectableByValue(t){return this.walker().find(i=>i.use(_).value===t)?.use(_)}deselectOthers(t){this.walker().each(i=>{i!==t&&i.use(_).surgicallyDeselect()})}selectedTextValue(){return this.options().multiple?Array.from(this.state).map(t=>this.convertValueStringToElementText(t)).join(", "):this.convertValueStringToElementText(this.state)}convertValueStringToElementText(t){let i=this.findByValue(t);return i?i.label||i.value:t}findByValue(t){return this.selecteds().find(i=>i.value===t)}walker(){return j(this.el,(t,{skip:i,reject:s})=>{if(t[this.constructor.name]&&t!==this.el)return s();if(!t[this.groupOfType.name]||t.mixins.get(this.groupOfType.name).ungrouped)return i()})}},_=class extends O{boot({options:t}){this.groupedByType=dt,t({ungrouped:!1,togglable:!1,value:void 0,label:void 0,selectedInitially:!1,dataAttr:"data-selected",ariaAttr:"aria-selected"}),this.ungrouped=this.options().ungrouped,this.value=this.options().value===void 0?this.el.value:this.options().value,this.label=this.options().label;let i=this.options().selectedInitially;this.group()&&this.group().hasValue(this.value)&&(i=!0),this.multiple=this.hasGroup()?this.group().options().multiple:!1,this.toggleable=this.options().toggleable||this.multiple,this.onSelects=[],this.onUnselects=[],this.onChanges=[],i?this.silentlySelect():this.state=i}mount(){this.el.hasAttribute(this.options().ariaAttr)||p(this.el,this.options().ariaAttr,"false")}onChange(t){this.onChanges.push(t)}onSelect(t){this.onSelects.push(t)}onUnselect(t){this.onUnselects.push(t)}setState(t){t?this.select():this.deselect()}getState(){return this.state}press(){this.toggleable?this.toggle():this.select()}trigger(){this.toggleable?this.toggle():this.select()}toggle(){this.isSelected()?this.deselect():this.select()}isSelected(){return this.state}silentlySelect(){this.toggleable||this.group()?.deselectOthers(this.el),this.state=!0,p(this.el,this.options().ariaAttr,"true"),p(this.el,this.options().dataAttr,"")}select(){let t=!this.isSelected();this.toggleable||this.group()?.deselectOthers(this.el),this.state=!0,p(this.el,this.options().ariaAttr,"true"),p(this.el,this.options().dataAttr,""),t&&(this.onSelects.forEach(i=>i()),this.onChanges.forEach(i=>i()),this.group()?.changed(this))}surgicallySelect(){let t=!this.isSelected();this.state=!0,p(this.el,this.options().ariaAttr,"true"),p(this.el,this.options().dataAttr,""),t&&(this.onSelects.forEach(i=>i()),this.onChanges.forEach(i=>i()))}deselect(t=!0){let i=this.isSelected();this.state=!1,p(this.el,this.options().ariaAttr,"false"),T(this.el,this.options().dataAttr),i&&(this.onUnselects.forEach(s=>s()),this.onChanges.forEach(s=>s()),t&&this.group()?.changed(this))}surgicallyDeselect(){let t=this.isSelected();this.state=!1,p(this.el,this.options().ariaAttr,"false"),T(this.el,this.options().dataAttr),t&&(this.onUnselects.forEach(i=>i()),this.onChanges.forEach(i=>i()))}getValue(){return this.value}getLabel(){return this.label}};var yt=class extends lt{groupOfType=C;boot({options:t}){t({wrap:!1,ensureTabbable:!0})}mount(){this.options().ensureTabbable&&this.ensureTabbable()}focusFirst(){let t;t=t||this.walker().find(i=>i.hasAttribute("autofocus")),t=t||this.walker().find(i=>i.getAttribute("tabindex")==="0"),t=t||this.walker().find(i=>i.getAttribute("tabindex")==="-1"),t=t||this.walker().find(i=>Jt(i)),t?.focus()}focusPrev(){this.moveFocus(t=>this.options().wrap?this.walker().prevOrLast(t):this.walker().prev(t))}focusNext(){this.moveFocus(t=>this.options().wrap?this.walker().nextOrFirst(t):this.walker().next(t))}focusBySearch(t){let i=this.walker().find(s=>s.textContent.toLowerCase().trim().startsWith(t.toLowerCase()));i?.use(C).tabbable(),i?.use(C).focus()}moveFocus(t){let i=this.walker().find(n=>n.use(C).isTabbable());t(i)?.use(C).focus()}ensureTabbable(){this.walker().findOrFirst(t=>{t.use(C).isTabbable()})?.use(C).tabbable()}wipeTabbables(){this.walker().each(t=>{t.use(C).untabbable()})}untabbleOthers(t){this.walker().each(i=>{i!==t&&i.use(C).untabbable()})}walker(){return j(this.el,(t,{skip:i,reject:s})=>{if(t[this.constructor.name]&&t!==this.el)return s();if(!t[this.groupOfType.name])return i();if(t.hasAttribute("disabled"))return s()})}},C=class extends O{groupedByType=yt;boot({options:t}){t({hover:!1,tabbable:!1,tabbableAttr:null})}mount(){this.el.hasAttribute("disabled")||(this.el.hasAttribute("tabindex")||(this.options().tabbable?this.tabbable():this.untabbable()),this.pauseFocusListener=this.on("focus",()=>{this.focus(!1)}).pause,this.on("focus",()=>{Rt()&&p(this.el,"data-focus","")}),this.on("blur",()=>{T(this.el,"data-focus")}),this.options().hover&&this.on("pointerenter",()=>{this.group()?.untabbleOthers(this.el),this.tabbable()}),this.options().hover&&this.on("pointerleave",t=>{this.untabbable()}))}focus(t=!0){this.group()?.untabbleOthers(this.el),this.tabbable(),t&&this.pauseFocusListener(()=>{this.el.focus({focusVisible:!1})})}tabbable(){p(this.el,"tabindex","0"),this.options().tabbableAttr&&p(this.el,this.options().tabbableAttr,"")}untabbable(){p(this.el,"tabindex","-1"),this.options().tabbableAttr&&T(this.el,this.options().tabbableAttr)}isTabbable(){return this.el.getAttribute("tabindex")==="0"}};var Tt=class extends O{boot({options:t}){this.onChanges=[],Object.defineProperty(this.el,"disabled",{get:()=>this.el.hasAttribute("disabled"),set:s=>{s?this.el.setAttribute("disabled",""):this.el.removeAttribute("disabled")}}),this.el.hasAttribute("disabled")?this.el.disabled=!0:this.el.closest("[disabled]")&&(this.el.disabled=!0),new MutationObserver(s=>{this.onChanges.forEach(n=>n(this.el.disabled))}).observe(this.el,{attributeFilter:["disabled"]})}onChange(t){this.onChanges.push(t)}onInitAndChange(t){t(this.el.disabled),this.onChanges.push(t)}};var Wt=class e extends k{boot(){if(this._focusable=new yt(this,{wrap:!1,ensureTabbable:!1}),S(this,"keydown",t=>{["ArrowDown"].includes(t.key)?(t.target===this?this._focusable.focusFirst():this._focusable.focusNext(),t.preventDefault(),t.stopPropagation()):["ArrowUp"].includes(t.key)&&(t.target===this?this._focusable.focusFirst():this._focusable.focusPrev(),t.preventDefault(),t.stopPropagation())}),Zt(this,t=>this._focusable.focusBySearch(t)),this.hasAttribute("popover")&&this.addEventListener("lofi-close-popovers",()=>{setTimeout(()=>this.hidePopover(),50)}),this.parentElement.localName==="ui-dropdown"){let t=this.parentElement;S(t.trigger(),"keydown",i=>{i.key==="ArrowDown"&&(this.fromArrowDown=!0,this.showPopover(),i.preventDefault(),i.stopPropagation())})}p(this,"role","menu"),p(this,"tabindex","-1")}mount(){this.initializeMenuItems(),new MutationObserver(i=>{this.initializeMenuItems()}).observe(this,{childList:!0,subtree:!0})}onPopoverShow(){queueMicrotask(()=>{this.fromArrowDown?(this._focusable.focusFirst(),this.fromArrowDown=!1):this.focus()})}onPopoverHide(){this._focusable.wipeTabbables()}initializeMenuItems(){this.walker().each(t=>{t._disableable||ni(t)})}walker(){return j(this,(t,{skip:i,reject:s})=>{if(t instanceof e)return s();if(!["a","button"].includes(t.localName))return i()})}},It=class extends k{boot(){}},Ht=class extends k{boot(){this._disabled=this.hasAttribute("disabled");let t=this;this._disabled&&(p(t,"disabled",""),p(t,"aria-disabled","true"));let i=Y(t,"menu-checkbox");if(p(t,"role","menuitemcheckbox"),this._disabled)return;t._focusable=new C(t,{hover:!0,tabbableAttr:"data-active"}),t._selectable=new _(t,{toggleable:!0,value:this.hasAttribute("value")?this.getAttribute("value"):t.textContent.trim(),label:this.hasAttribute("label")?this.getAttribute("label"):t.textContent.trim(),dataAttr:"data-checked",ariaAttr:"aria-checked",selectedInitially:this.hasAttribute("checked")}),this._controllable=new X(this),this._controllable.initial(n=>n&&t._selectable.setState(n)),this._controllable.getter(()=>t._selectable.getState());let s=ot();this._controllable.setter(s(n=>{this._selectable.setState(n)})),this._selectable.onChange(s(()=>{this._controllable.dispatch()})),S(t,"click",()=>{this.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0})),t._selectable.press()}),Xt(t)}},zt=class extends k{boot(){this._disabled=this.hasAttribute("disabled");let t=this;this._disabled&&(p(t,"disabled",""),p(t,"aria-disabled","true"));let i=Y(t,"menu-radio");p(t,"role","menuitemradio"),!this._disabled&&(t._focusable=new C(t,{hover:!0,tabbableAttr:"data-active"}),t._selectable=new _(t,{toggleable:!1,value:this.hasAttribute("value")?this.getAttribute("value"):t.textContent.trim(),label:this.hasAttribute("label")?this.getAttribute("label"):t.textContent.trim(),dataAttr:"data-checked",ariaAttr:"aria-checked",selectedInitially:this.hasAttribute("checked")}),S(t,"click",()=>{this.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0})),t._selectable.press()}),Xt(t))}},jt=class extends k{boot(){this._selectable=new dt(this),this._controllable=new X(this),p(this,"role","group"),this._controllable.initial(i=>i&&this._selectable.setState(i)),this._controllable.getter(()=>this._selectable.getState());let t=ot();this._controllable.setter(t(i=>{this._selectable.setState(i)})),this._selectable.onChange(t(()=>{this._controllable.dispatch()}))}},Yt=class extends k{boot(){this._selectable=new dt(this,{multiple:!0}),this._controllable=new X(this),p(this,"role","group"),this._controllable.initial(i=>i&&this._selectable.setState(i)),this._controllable.getter(()=>this._selectable.getState());let t=ot();this._controllable.setter(t(i=>{this._selectable.setState(i)})),this._selectable.onChange(t(()=>{this._controllable.dispatch()}))}};Z(({css:e})=>e`ui-menu[popover]:popover-open { display: block; }`);Z(({css:e})=>e`ui-item, ui-menu-checkbox, ui-menu-radio { cursor: default; display: contents; }`);F("menu",Wt);F("submenu",It);F("menu-checkbox",Ht);F("menu-radio",zt);F("menu-radio-group",jt);F("menu-checkbox-group",Yt);function Xt(e){S(e,"keydown",t=>{t.key==="Enter"&&(e.click(),t.preventDefault(),t.stopPropagation())}),S(e,"keydown",t=>{t.key===" "&&(t.preventDefault(),t.stopPropagation())}),S(e,"keyup",t=>{t.key===" "&&(e.click(),t.preventDefault(),t.stopPropagation())})}function ni(e){e._disableable=new Tt(e),e._disabled=e.hasAttribute("disabled");let t=e.querySelector("a"),i=e,s=e.parentElement.matches("ui-submenu")&&e.parentElement.querySelector("ui-menu[popover]"),n=t||i;e._disabled&&(p(n,"disabled",""),p(n,"aria-disabled","true"));let o=Y(n,"menu-item");if(p(n,"role","menuitem"),!e._disabled)if(n._focusable=new C(n,{hover:!0,tabbableAttr:"data-active"}),!s)e.hasAttribute("disabled")||S(e,"click",()=>{e.dispatchEvent(new CustomEvent("lofi-close-popovers",{bubbles:!0}))}),Xt(i);else{s._popoverable=new U(s),s._anchorable=new K(s,{reference:i,position:s.hasAttribute("position")?s.getAttribute("position"):"right start",gap:s.hasAttribute("gap")?s.getAttribute("gap"):"-5"}),i.addEventListener("click",a=>{s._popoverable.setState(!0)});let{clear:r}=rt(i,s,{gain(){s._popoverable.setState(!0)},lose(){s._popoverable.setState(!1)},focusable:!1});s._popoverable.onChange(()=>{s._popoverable.getState()||(r(),s._focusable.wipeTabbables()),s._anchorable.reposition()}),S(i,"keydown",a=>{a.key==="Enter"&&(s._popoverable.setState(!0),setTimeout(()=>s._focusable.focusFirst()))}),S(i,"keydown",a=>{a.key==="ArrowRight"&&(s._popoverable.setState(!0),setTimeout(()=>s._focusable.focusFirst()))}),S(s,"keydown",a=>{a.key==="ArrowLeft"&&(s._popoverable.setState(!1),i.focus(),a.stopPropagation())})}}})(); diff --git a/dist/manifest.json b/dist/manifest.json index 35dfedf..931c633 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1,3 +1,3 @@ { - "/flux.js": "186cf72c" + "/flux.js": "7222cbb7" } \ No newline at end of file