@ecopages/radiant-ui 0.2.1 → 0.2.2
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/dist/components/ui/carousel/carousel.script.d.ts +4 -4
- package/dist/components/ui/combobox/combobox.script.d.ts +1 -1
- package/dist/components/ui/date-field/date-field.script.d.ts +1 -1
- package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +1 -1
- package/dist/components/ui/dialog/dialog.script.d.ts +3 -3
- package/dist/components/ui/dialog/index.js +1 -1
- package/dist/components/ui/dialog/index.js.map +2 -2
- package/dist/components/ui/hover-card/hover-card.script.d.ts +1 -1
- package/dist/components/ui/knob/index.js +1 -1
- package/dist/components/ui/knob/index.js.map +2 -2
- package/dist/components/ui/knob/knob.script.d.ts +7 -7
- package/dist/components/ui/menu-button/menu-button.script.d.ts +2 -2
- package/dist/components/ui/popover/popover.script.d.ts +3 -3
- package/dist/components/ui/select/select.script.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar.css +656 -654
- package/dist/components/ui/sidebar/sidebar.script.d.ts +4 -4
- package/dist/components/ui/slider/slider.script.d.ts +8 -8
- package/dist/components/ui/toast/toast.script.d.ts +1 -1
- package/dist/components/ui/toast/toaster.script.d.ts +1 -1
- package/dist/components/ui/tooltip/tooltip.script.d.ts +1 -1
- package/dist/components/ui/window-splitter/index.js +1 -1
- package/dist/components/ui/window-splitter/index.js.map +2 -2
- package/dist/components/ui/window-splitter/window-splitter.script.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/styles/styles.css +582 -582
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function ne(t,e){return e===void 0||t?.label!==void 0?t:{...t,label:e}}function j(...t){return t.filter(Boolean).join(" ")}import{jsx as dr,jsxs as aI}from"@ecopages/jsx/jsx-runtime";function xi({class:t,size:e="sm",...i}){return aI("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[dr("path",{d:"M8 2v4"}),dr("path",{d:"M16 2v4"}),dr("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),dr("path",{d:"M3 10h18"})]})}import{jsx as Aa}from"@ecopages/jsx/jsx-runtime";function wi({class:t,size:e="sm",...i}){return Aa("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Aa("path",{d:"m5 12 4 4L19 6"})})}import{jsx as Ia}from"@ecopages/jsx/jsx-runtime";function Xe({class:t,size:e="sm",...i}){return Ia("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Ia("path",{d:"m6 9 6 6 6-6"})})}import{jsx as Ca}from"@ecopages/jsx/jsx-runtime";function fn({class:t,size:e="sm",...i}){return Ca("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Ca("path",{d:"m15 18-6-6 6-6"})})}import{jsx as Da}from"@ecopages/jsx/jsx-runtime";function mn({class:t,size:e="sm",...i}){return Da("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Da("path",{d:"m9 18 6-6-6-6"})})}import{jsx as Oa,jsxs as sI}from"@ecopages/jsx/jsx-runtime";var Va="http://www.w3.org/2000/svg";function Re({class:t,size:e="sm",...i}){return sI("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[Oa("path",{d:"m18 6-12 12"}),Oa("path",{d:"m6 6 12 12"})]})}function hr(){let t=document.createElementNS(Va,"svg");t.setAttribute("class","rui-icon"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true");for(let e of["m18 6-12 12","m6 6 12 12"]){let i=document.createElementNS(Va,"path");i.setAttribute("d",e),t.append(i)}return t}import{RadiantElement as Wa,bound as hI,customElement as pI,event as fI,onEvent as mI,prop as pr}from"@ecopages/radiant";var ka,Ma,La,Pa,ja,Fa,Ba,Ua,za,qa,Ka,$a;function lI(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Ga(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ga(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:uI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return dI(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function uI(t){var e=cI(t,"string");return typeof e=="symbol"?e:e+""}function cI(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ga(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function dI(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Ya,Ha=class extends Wa{static{({e:[La,Pa,ja,Fa,Ba,Ua,za,qa,Ka,$a,ka],c:[Ya,Ma]}=lI(this,[pI("rui-alert")],[[pr({type:String,reflect:!0,defaultValue:"info"}),0,"variant"],[pr({type:String,reflect:!0,defaultValue:"inline"}),0,"layout"],[pr({type:Boolean,reflect:!0,defaultValue:!1}),0,"dismissible"],[pr({type:String,attribute:"close-label",defaultValue:"Dismiss"}),0,"closeLabel"],[fI({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[hI,2,"dismiss"],[mI({selector:"[data-alert-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Wa))}constructor(...e){super(...e),$a(this)}variant=(ka(this),La(this));layout=(Pa(this),ja(this));dismissible=(Fa(this),Ba(this));closeLabel=(Ua(this),za(this));closeEvent=(qa(this),Ka(this));dismiss(){this.isConnected&&(this.closeEvent.emit({reason:"dismiss"}),this.remove())}onCloseClick(e){e.stopPropagation(),this.dismissible&&this.dismiss()}static{Ma()}};import{jsx as ze,jsxs as Na}from"@ecopages/jsx/jsx-runtime";var gI={info:["M12 16v-4","M12 8h.01","M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z"],success:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","m9 12 2 2 4-4"],warning:["m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3","M12 9v4","M12 17h.01"],error:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","m15 9-6 6","m9 9 6 6"]};function bI({variant:t="info",class:e,children:i,...r}){if(i!=null)return ze("span",{...r,class:j("rui-alert__icon",e),children:i});let s=gI[t],d=Array.isArray(s)?s:[s];return ze("span",{...r,class:j("rui-alert__icon",e),"aria-hidden":"true",children:ze("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:d.map(h=>ze("path",{d:h}))})})}function vI({children:t,class:e,...i}){return ze("p",{...i,class:j("rui-alert__title",e),children:t})}function yI({children:t,class:e,...i}){return ze("div",{...i,class:j("rui-alert__description",e),children:t})}function _I({children:t,variant:e="info",layout:i="inline",dismissible:r=!1,closeLabel:s="Dismiss",class:d,slot:h,...a}){return ze("rui-alert",{slot:h,variant:e,layout:i,dismissible:r,"close-label":s,children:Na("div",{...a,class:j("rui-alert",`rui-alert--${e}`,`rui-alert--${i}`,r&&"rui-alert--dismissible",d),role:"alert",children:[t,r?ze("button",{type:"button",class:"rui-alert__close","data-alert-close":!0,"aria-label":s||"Dismiss",children:Na("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[ze("path",{d:"M18 6 6 18"}),ze("path",{d:"m6 6 12 12"})]})}):null]})})}import{RadiantElement as rs,customElement as EI,onEvent as RI,onUpdated as AI,prop as ns}from"@ecopages/radiant";function fr(t,e,i="base"){if(!e)return!0;if(i==="case")return t.includes(e);let r=new Intl.Collator(void 0,{sensitivity:i==="accent"?"accent":"base",usage:"search"});for(let s=0;s<=t.length-e.length;s+=1){let d=t.slice(s,s+e.length);if(r.compare(d,e)===0)return!0}return!1}var Xa,Qa,Ja,Za,es,ts;function xI(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:is(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||is(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:wI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return SI(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function wI(t){var e=TI(t,"string");return typeof e=="symbol"?e:e+""}function TI(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function is(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function SI(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var as,os=class extends rs{static{({e:[Ja,Za,es,ts,Xa],c:[as,Qa]}=xI(this,[EI("rui-autocomplete")],[[ns({type:String,defaultValue:"base"}),0,"sensitivity"],[ns({type:String,attribute:"input-value",defaultValue:""}),0,"inputValue"],[AI(["sensitivity","inputValue"]),2,"onPropsUpdated"],[RI({selector:"[data-autocomplete-input]",type:"input"}),2,"onInput"]],0,void 0,rs))}sensitivity=(Xa(this),Ja(this));inputValue=(Za(this),es(this));externalInput=(ts(this),null);onExternalInput=()=>{this.applyFilter()};getInput(){let e=this.querySelector("[data-autocomplete-input]");return e||(this.closest("rui-combobox, rui-select")?.querySelector("[data-autocomplete-input]")??null)}bindExternalInput(){this.unbindExternalInput();let e=this.getInput();!e||this.contains(e)||(this.externalInput=e,e.addEventListener("input",this.onExternalInput))}unbindExternalInput(){this.externalInput?.removeEventListener("input",this.onExternalInput),this.externalInput=null}syncFilter(){this.applyFilter()}getCollection(){return this.querySelector("[data-autocomplete-collection]")??this}getFilterableItems(){let e=this.getCollection();return e?Array.from(e.querySelectorAll('[role="option"], [data-tag], [role="menuitem"]')).filter(r=>this.contains(r)||e.contains(r)):[]}getItemText(e){return e.getAttribute("data-label")||e.textContent?.trim()||""}getQuery(){return this.inputValue?this.inputValue:this.getInput()?.value??""}applyFilter(){let e=this.getQuery(),i=this.getFilterableItems(),r=0;for(let d of i){let h=fr(this.getItemText(d),e,this.sensitivity);d.hidden=!h,h&&(r+=1)}let s=this.querySelector("[data-autocomplete-empty]");s&&s.toggleAttribute("hidden",r>0)}initialize(){this.applyFilter()}onConnected(){this.bindExternalInput(),this.initialize()}disconnectedCallback(){this.unbindExternalInput(),super.disconnectedCallback()}onPropsUpdated(){this.applyFilter()}onInput(){this.applyFilter()}static{Qa()}};import{jsx as Ht}from"@ecopages/jsx/jsx-runtime";function II({placeholder:t,class:e,disabled:i,...r}){return Ht("input",{...r,type:"search","data-autocomplete-input":!0,class:j("rui-autocomplete__input",e),placeholder:t,disabled:i,autocomplete:"off"})}function gn({children:t,class:e,...i}){return Ht("div",{...i,"data-autocomplete-collection":!0,class:j("rui-autocomplete__collection",e),children:t})}function bn({children:t,class:e,...i}){return Ht("div",{...i,"data-autocomplete-empty":!0,class:j("rui-autocomplete__empty",e),children:t})}function CI({children:t}){return Ht("div",{class:"rui-autocomplete","data-ref":"root",children:t})}function vn({children:t,...e}){return Ht("rui-autocomplete",{...e,children:Ht(CI,{children:t})})}import{jsx as yn}from"@ecopages/jsx/jsx-runtime";function ke(...t){for(let e of t)if(e!==void 0)return e}function DI(t){let e=t.trim().split(/\s+/).filter(Boolean);return e.length===0?"?":e.length===1?e[0].slice(0,2).toUpperCase():`${e[0][0]??""}${e[1][0]??""}`.toUpperCase()}function OI({src:t,alt:e="",fallback:i,size:r="md",class:s,children:d,role:h,aria:a,...E}){let A=i??(e?DI(e):void 0);return yn("span",{...E,aria:ne(a,t?void 0:e||i),class:j("rui-avatar",`rui-avatar--${r}`,s),role:ke(h,t?void 0:"img"),children:t?yn("img",{class:"rui-avatar__image",src:t,alt:e}):yn("span",{class:"rui-avatar__fallback","aria-hidden":e||i?"true":void 0,children:d??A??"?"})})}import{jsx as VI}from"@ecopages/jsx/jsx-runtime";function kI({children:t,variant:e="filled",class:i,...r}){return VI("span",{...r,class:j("rui-badge",`rui-badge--${e}`,i),children:t})}import{RadiantElement as ps,customElement as FI,prop as fs}from"@ecopages/radiant";var ss,ls,us,cs,ds;function MI(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:hs(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||hs(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:LI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return jI(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function LI(t){var e=PI(t,"string");return typeof e=="symbol"?e:e+""}function PI(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hs(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function jI(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var gs,ms=class extends ps{static{({e:[ls,us,cs,ds],c:[gs,ss]}=MI(this,[FI("rui-breadcrumb")],[[fs({type:String,defaultValue:"Breadcrumb"}),0,"label"],[fs({type:String,defaultValue:"/"}),0,"separator"]],0,void 0,ps))}constructor(...e){super(...e),ds(this)}label=ls(this);separator=(us(this),cs(this));static{ss()}};import{jsx as Qe,jsxs as BI}from"@ecopages/jsx/jsx-runtime";function UI({children:t,label:e,separator:i,...r}){return Qe("rui-breadcrumb",{...r,label:e,separator:i,children:Qe("nav",{class:"rui-breadcrumb","aria-label":e||"Breadcrumb",style:{"--rui-breadcrumb-separator":JSON.stringify(i||"/")},children:t})})}function zI({children:t,class:e,...i}){return Qe("ol",{...i,class:j("rui-breadcrumb__list",e),children:t})}function qI({children:t,class:e,...i}){return Qe("li",{...i,class:j("rui-breadcrumb__item",e),children:t})}function KI({children:t,href:e,class:i,...r}){return Qe("a",{...r,class:j("rui-breadcrumb__link",i),href:e,children:t})}function $I({children:t,class:e,...i}){return Qe("span",{...i,class:j("rui-breadcrumb__page",e),"aria-current":"page",children:t})}function GI({children:t,class:e,...i}){return Qe("li",{...i,class:j("rui-breadcrumb__separator",e),role:"presentation","aria-hidden":"true",children:t})}function WI({label:t="More",class:e,...i}){return BI("span",{...i,class:j("rui-breadcrumb__ellipsis",e),role:"presentation","aria-hidden":"true",children:[Qe("span",{"aria-hidden":"true",children:"\u2026"}),Qe("span",{class:"rui-breadcrumb__ellipsis-label",children:t})]})}import{jsx as bs}from"@ecopages/jsx/jsx-runtime";function HI(t,e,i){if(t!==void 0)return t;if(e)return i}function YI(t,e){if(typeof t=="function"){t(e);return}t!=null&&typeof t=="object"&&"handleEvent"in t&&t.handleEvent(e)}function Je(t){if(t.href!==void 0){let{href:$,target:V,rel:G,download:W,children:O,class:_,variant:H,size:Y,square:n,...g}=t;return bs("a",{...g,href:$,target:V,rel:G,download:W,class:j("rui-button",`rui-button--${H??"filled"}`,`rui-button--${Y??"md"}`,n&&"rui-button--square",_),children:O})}let{variant:e,size:i,square:r,class:s,children:d,type:h="button",disabled:a,pressed:E,defaultPressed:A=!1,toggle:S=!1,"on:click":I,...T}=t,K=$=>{if(S&&E===void 0){let V=$.currentTarget,G=V.getAttribute("aria-pressed")!=="true";V.setAttribute("aria-pressed",String(G))}YI(I,$)};return bs("button",{...T,type:h,class:j("rui-button",`rui-button--${e??"filled"}`,`rui-button--${i??"md"}`,r&&"rui-button--square",s),disabled:a,"aria-pressed":HI(E,S,A),"data-toggle":S&&E===void 0?"":void 0,"on:click":S||I?K:void 0,children:d})}import{jsx as NI}from"@ecopages/jsx/jsx-runtime";function XI({children:t,orientation:e="horizontal",class:i,...r}){return NI("div",{...r,role:"group","aria-orientation":e,class:j("rui-button-group",`rui-button-group--${e}`,i),children:t})}import{jsx as Te,jsxs as zn}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as gl,customElement as xC,event as wC,onEvent as kt,onUpdated as TC,prop as ft,registerSsrPreparationCallback as SC,state as mt}from"@ecopages/radiant";function ht(t){if(!t)return;let e=t.split(",").map(i=>i.trim()).filter(Boolean);return e.length>1?e:e[0]}function Dt(t){if(t==null)return null;let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t.trim());if(!e)return null;let i=Number(e[1]),r=Number(e[2])-1,s=Number(e[3]),d=new Date(i,r,s);return d.getFullYear()!==i||d.getMonth()!==r||d.getDate()!==s?null:d}function Ze(t){let e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${i}-${r}`}function pt(t,e,i){return!(e&&t<e||i&&t>i)}function Ot(t,e){return t.localeCompare(e)}function Yt(t,e){return Ot(t,e)<=0?{start:t,end:e}:{start:e,end:t}}function Me(t){if(!t)return null;let[e,i]=t.split("/");return!e||!i?null:Yt(e,i)}function Nt(t){if(!t)return"";let e=Yt(t.start,t.end);return`${e.start}/${e.end}`}function Xt(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean).sort(Ot):[]}function _n(t){return[...new Set(t)].sort(Ot).join(",")}function xn(t,e){let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),[...i].sort(Ot)}function vs(t,e){let i=Yt(e.start,e.end);return Ot(t,i.start)>=0&&Ot(t,i.end)<=0}function wn(t,e,i){if(e==="single"){let A=i.singleIso===t;return{isSelected:A,isRangeStart:A,isRangeEnd:A,isRangeMiddle:!1}}if(e==="multiple"){let A=i.multipleIsos?.includes(t)??!1;return{isSelected:A,isRangeStart:A,isRangeEnd:A,isRangeMiddle:!1}}let r=i.range;if(!r)return{isSelected:!1,isRangeStart:!1,isRangeEnd:!1,isRangeMiddle:!1};let s=Yt(r.start,r.end),d=vs(t,s),h=t===s.start,a=t===s.end;return{isSelected:d,isRangeStart:h,isRangeEnd:a,isRangeMiddle:d&&!h&&!a}}function Tn(t,e,i){return e.anchor?{committed:Yt(e.anchor,i),draft:{anchor:null,hover:null}}:{committed:t,draft:{anchor:i,hover:i}}}function mr(t){let e=QI(t);try{let r=new Intl.Locale(e).weekInfo;if(r?.firstDay!=null)return r.firstDay===7?0:r.firstDay}catch{}return e.startsWith("en-US")?0:1}function QI(t){return Array.isArray(t)?t[0]??navigator.language:t??navigator.language}function JI(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function ZI(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function eC(t){let e=t.selectionMode??"single",i=t.value??"";if(e==="multiple")return{mode:e,multipleIsos:Xt(i)};if(e==="range"){let r=Me(i);if(t.rangeDraft?.anchor){let s=t.rangeDraft.hover??t.rangeDraft.anchor;return{mode:e,range:tC(t.rangeDraft.anchor,s)}}return{mode:e,range:r}}return{mode:e,singleIso:i||void 0}}function tC(t,e){return t.localeCompare(e)<=0?{start:t,end:e}:{start:e,end:t}}function Sn(t,e,i){let r=mr(i.locale),s=JI(i.today??new Date),d=eC(i),a=(new Date(t,e,1).getDay()-r+7)%7,E=new Date(t,e,1-a),A=[],S=new Date(E);for(let I=0;I<6;I+=1){let T=[];for(let K=0;K<7;K+=1){let $=Ze(S),V=wn($,d.mode,{singleIso:d.singleIso,multipleIsos:d.multipleIsos,range:d.range});T.push({date:new Date(S),iso:$,inMonth:S.getMonth()===e,isToday:ZI(S,s),isSelected:V.isSelected,isDisabled:!pt($,i.min,i.max),isRangeStart:V.isRangeStart,isRangeEnd:V.isRangeEnd,isRangeMiddle:V.isRangeMiddle}),S.setDate(S.getDate()+1)}if(A.push(T),I>=4&&S.getMonth()!==e&&S.getDate()>7)break}return A}function gr(t,e,i){let r=new Date(t,e+i,1);return{year:r.getFullYear(),month:r.getMonth()}}function En(t,e,i){let r=Math.max(1,Math.min(i,12));return Array.from({length:r},(s,d)=>{let h=gr(t,e,d);return{year:h.year,month:h.month,offset:d}})}var ys=new Map;function iC(t,e){return`${JSON.stringify(t??null)}|${JSON.stringify(e)}`}function Vt(t,e){let i=iC(t,e),r=ys.get(i);if(r)return r;let s=new Intl.DateTimeFormat(t,e);return ys.set(i,s),s}function Rn(t,e){return Vt(e,{month:"long",year:"numeric"}).format(t)}function An(t,e){let i=Vt(t,{weekday:"narrow"}),r=[];for(let s=0;s<7;s+=1){let d=(e+s)%7,h=new Date(2024,0,d===0?7:d);r.push(i.format(h))}return r}function In(t){return new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(0,"day")}var rC={0:"digit",a:"letter","*":"any"},nC=/\p{L}/u;function oC(t,e){let i=e?.[t];if(i instanceof RegExp)return{kind:"any",pattern:i};if(i)return{kind:i};let r=rC[t];return r?{kind:r}:null}function _s(t,e,i){return i?i.test(t):e==="digit"?/\d/.test(t):e==="letter"?nC.test(t):t.length>0}function xs(t,e,i=!1){let r=[],s=0;for(;s<t.length;){let d=t[s];if(d==="\\"){let a=t[s+1];a&&r.push({type:"literal",value:a}),s+=2;continue}if(d==="{"){let a=t.indexOf("}",s+1);if(a<0){r.push({type:"literal",value:"{"}),s+=1;continue}r.push({type:"fixed",value:t.slice(s+1,a)}),s=a+1;continue}if(d==="["){let a=aC(t,s+1);if(a<0){r.push({type:"literal",value:"["}),s+=1;continue}let E=xs(t.slice(s+1,a),e,!0);r.push(...E),s=a+1;continue}if(d==="]")break;let h=oC(d,e);if(h){r.push({type:"input",definition:d,kind:h.kind,pattern:h.pattern,optional:i}),s+=1;continue}r.push({type:"literal",value:d}),s+=1}return r}function aC(t,e){let i=1;for(let r=e;r<t.length;r+=1)if(t[r]==="["&&t[r-1]!=="\\"&&(i+=1),t[r]==="]"&&t[r-1]!=="\\"&&(i-=1,i===0))return r;return-1}function Cn(t,e){return xs(t,e)}function ws(t,e={}){return t.filter(i=>i.type==="input"&&(!e.requiredOnly||!i.optional)).length}function Dn(t,e){let i=Cn(t,e),r="";for(let s of i){if(s.type==="literal"||s.type==="fixed"){r+=s.value;continue}r+="_"}return r}function Ts(t,e){let i="",r=0;for(let s of e){if(s.type==="fixed"||s.type==="literal"){t.slice(r,r+s.value.length)===s.value&&(r+=s.value.length);continue}if(r>=t.length)continue;let d=t[r];_s(d,s.kind,s.pattern)&&(i+=d,r+=1)}return i}function Ss(t,e){if(!t)return"";let i=0,r="";for(let s of e){if(s.type==="fixed"||s.type==="literal"){r+=s.value;continue}if(i>=t.length){if(s.optional)continue;break}let d=t[i];if(!_s(d,s.kind,s.pattern)){if(s.optional)continue;break}r+=d,i+=1}return r}function sC(t){return t.every(e=>e.type!=="input"||e.kind==="digit")}function lC(t,e){let i=t.replace(/\D/g,""),r=e.filter(s=>s.type==="fixed").map(s=>s.value.replace(/\D/g,"")).join("");return r&&i.startsWith(r)?i.slice(r.length):i}function On(t,e,i){let r=Cn(e,i),s=ws(r),d=Ts(t,r);return d.length===0&&/\S/.test(t)&&sC(r)&&(d=lC(t,r)),d.length>s&&(d=d.slice(0,s)),Ss(d,r)}var uC=new Date(2e3,0,1);function cC(t,e){return t==="year"?e==="year":t==="month"?e==="year"||e==="month":!0}function dC(t,e){let r=Vt(e,{[t]:t==="year"?"numeric":"2-digit"}).formatToParts(uC).find(s=>s.type===t);return r?r.value.replace(/\d/g,t==="year"?"y":t==="month"?"m":"d"):t==="year"?"yyyy":"mm"}function hC(t,e,i){let r=t==="year"?{year:"numeric"}:{[t]:"2-digit"};return Vt(i,r).formatToParts(e).find(s=>s.type===t)?.value??""}function br(t,e,i={}){let r=i.granularity??"day",s=t??i.placeholderDate??new Date;return Vt(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(s).filter(h=>h.type!=="era").map(h=>{if(h.type==="literal")return{type:"literal",value:h.value,placeholder:h.value,isPlaceholder:!1,editable:!1};let a=h.type;if(!cC(r,a))return null;let E=t!=null;return{type:a,value:E?hC(a,t,e):"",placeholder:dC(a,e),isPlaceholder:!E,editable:!0}}).filter(h=>h!=null)}function pC(t){if(t.isPlaceholder||t.value==="")return null;let e=Number(t.value);return Number.isFinite(e)?e:null}function fC(t){return t>=100?t:t>=69?1900+t:2e3+t}function Es(t){let e={};for(let r of t){if(!r.editable)continue;let s=pC(r);if(s==null)return null;e[r.type]=r.type==="year"?fC(s):s}if(e.year==null||e.month==null||e.day==null)return null;let i=new Date(e.year,e.month-1,e.day);return i.getFullYear()!==e.year||i.getMonth()!==e.month-1||i.getDate()!==e.day?null:i}function Rs(t){return t.every(e=>!e.editable||e.isPlaceholder||e.value==="")}function Vn(t,e={}){let i=t.find(d=>d.editable&&d.type==="year");if(i&&!i.isPlaceholder&&i.value!==""&&i.value.replace(/\D/g,"").length<4)return{kind:"partial-year"};if(Rs(t))return{kind:"empty"};let r=Es(t);if(!r)return{kind:"incomplete"};let s=Ze(r);return pt(s,e.min,e.max)?{kind:"date",iso:s}:{kind:"out-of-range"}}function kn(t){return t==="year"?4:2}function mC(t,e){return t.findIndex(i=>i.editable&&i.type===e)}function gC(t){return t.map(e=>({...e}))}function Ln(t,e,i){let r=gC(t),s=mC(r,e);return s<0||(r[s]={...r[s],...i}),r}function Mn(t){if(t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function vr(t,e){return{min:1,max:Is(t,e)}}function Is(t,e){if(t==="month")return 12;if(t==="day"){let i=As(e,"year"),r=As(e,"month");return i!=null&&r!=null?new Date(i,r,0).getDate():31}return 9999}function As(t,e){let i=t.find(r=>r.editable&&r.type===e);return!i||i.isPlaceholder||i.value===""?null:Number(i.value)}function Cs(t,e){return t==="year"?String(e).padStart(4,"0"):String(e).padStart(2,"0")}function Pn(t,e){try{let r=new Intl.DisplayNames(e,{type:"dateTimeField"}).of(t);if(r)return r}catch{}return t==="month"?"Month":t==="day"?"Day":"Year"}function Ti(t){return t.isPlaceholder||t.value===""?t.placeholder:t.value}function yr(t){return t.isPlaceholder||t.value===""?null:Mn(t.value.replace(/\D/g,""))}function Ds(t,e){return Ln(t,e,{value:"",isPlaceholder:!0})}function Os(t,e,i){return Ln(t,e,{value:Cs(e,i),isPlaceholder:!1})}function jn(t,e,i){let r=t.find(E=>E.editable&&E.type===e);if(!r)return t;let{min:s,max:d}=vr(e,t),a=(yr(r)??(i>0?s-1:d+1))+i;return e==="month"||e==="day"?a<s?a=d:a>d&&(a=s):a=Math.max(s,a),Os(t,e,a)}function Fn(t,e,i,r){let s=i.replace(/\D/g,"");if(!s)return{segments:t,enteredKeys:r,focusNext:!1};let d=r+s,h=Mn(d);if(h==null)return{segments:t,enteredKeys:r,focusNext:!1};let a=Is(e,t),E=h;E>a&&(E=Mn(s)??E);let A=kn(e),S=+`${E}0`>a||d.length>=A||String(E).length>=A,I=S?Cs(e,E):String(E);return{segments:Ln(t,e,{value:I,isPlaceholder:!1}),enteredKeys:S?"":d,focusNext:S}}function Vs(t){return t.filter(e=>e.editable).map(e=>e.type)}function Qt(t,e,i){let r=Vs(t),s=r.indexOf(e);if(s<0)return r[0]??null;let d=s+i;return d<0||d>=r.length?null:r[d]??null}function Bn(t){let e=null;for(let i of t){if(!i.editable)continue;let r=i.type;if(e||(e=r),i.isPlaceholder||i.value==="")return r}return e}function Un(t,e){let i=t.find(d=>d.editable&&d.type===e);if(!i)return{kind:"focus-previous"};if(i.isPlaceholder||i.value==="")return{kind:"focus-previous"};let r=i.value.replace(/\D/g,"");if(r.length<=1)return{kind:"updated",segments:Ds(t,e),enteredKeys:""};let s=r.slice(0,-1);return{kind:"updated",segments:t.map(d=>d.editable&&d.type===e?{...d,value:s,isPlaceholder:!1}:d),enteredKeys:s}}var ks,Ms,Ls,Ps,js,Fs,Bs,Us,zs,qs,Ks,$s,Gs,Ws,Hs,Ys,Ns,Xs,Qs,Js,Zs,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl;function bC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ml(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ml(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:vC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _C(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function vC(t){var e=yC(t,"string");return typeof e=="symbol"?e:e+""}function yC(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ml(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function _C(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var vl,bl=class extends gl{static{({e:[Ls,Ps,js,Fs,Bs,Us,zs,qs,Ks,$s,Gs,Ws,Hs,Ys,Ns,Xs,Qs,Js,Zs,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ks],c:[vl,Ms]}=bC(this,[xC("rui-calendar")],[[ft({type:String,reflect:!0,defaultValue:""}),0,"value"],[ft({type:String,defaultValue:""}),0,"min"],[ft({type:String,defaultValue:""}),0,"max"],[ft({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ft({type:String,defaultValue:""}),0,"locale"],[ft({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[ft({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[ft({type:String,attribute:"page-behavior",defaultValue:"visible"}),0,"pageBehavior"],[wC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[mt,0,"viewYear"],[mt,0,"viewMonth"],[mt,0,"focusedIso"],[mt,0,"weekdayLabels"],[mt,0,"monthPanels"],[mt,0,"todayLabel"],[mt,0,"rangeAnchor"],[mt,0,"rangeHover"],[TC(["value","min","max","disabled","locale","selectionMode","visibleMonths","pageBehavior"]),2,"onPropsUpdated"],[kt({selector:"[data-calendar-prev-month]",type:"click"}),2,"onPrevMonth"],[kt({selector:"[data-calendar-next-month]",type:"click"}),2,"onNextMonth"],[kt({selector:"[data-calendar-today]",type:"click"}),2,"onTodayClick"],[kt({selector:"[data-calendar-day]",type:"click"}),2,"onDayClick"],[kt({selector:"[data-calendar-day]",type:"pointerenter"}),2,"onDayPointerEnter"],[kt({selector:"[data-calendar-grid]",type:"pointerleave"}),2,"onGridPointerLeave"],[kt({selector:"[data-calendar-day]",type:"keydown"}),2,"onDayKeydown"]],0,void 0,gl))}value=(ks(this),Ls(this));min=(Ps(this),js(this));max=(Fs(this),Bs(this));disabled=(Us(this),zs(this));locale=(qs(this),Ks(this));selectionMode=($s(this),Gs(this));visibleMonths=(Ws(this),Hs(this));pageBehavior=(Ys(this),Ns(this));changeEvent=(Xs(this),Qs(this));viewYear=(Js(this),Zs(this,new Date().getFullYear()));viewMonth=(el(this),tl(this,new Date().getMonth()));focusedIso=(il(this),rl(this,""));weekdayLabels=(nl(this),ol(this,[]));monthPanels=(al(this),sl(this,[]));todayLabel=(ll(this),ul(this,""));rangeAnchor=(cl(this),dl(this,null));rangeHover=(hl(this),pl(this,null));get resolvedLocale(){return ht(this.locale)}get pageDelta(){return this.pageBehavior==="single"?1:Math.max(1,Math.min(this.visibleMonths,12))}get monthOptions(){return{locale:this.resolvedLocale,selectionMode:this.selectionMode,value:this.value??"",rangeDraft:{anchor:this.rangeAnchor,hover:this.rangeHover},min:this.min||void 0,max:this.max||void 0}}syncViewFromValue(){let e=this.selectionMode==="range"?Me(this.value)?.start??"":this.selectionMode==="multiple"?Xt(this.value)[0]??"":this.value,i=Dt(e);if(i){this.viewYear=i.getFullYear(),this.viewMonth=i.getMonth(),this.focusedIso=e;return}let r=new Date;this.viewYear=r.getFullYear(),this.viewMonth=r.getMonth(),this.focusedIso=Ze(r)}refreshGrid(){this.weekdayLabels=An(this.resolvedLocale,mr(this.resolvedLocale)),this.monthPanels=En(this.viewYear,this.viewMonth,this.visibleMonths).map(e=>{let i=new Date(e.year,e.month,1);return{year:e.year,month:e.month,label:Rn(i,this.resolvedLocale),weeks:Sn(e.year,e.month,this.monthOptions)}}),this.todayLabel=In(this.resolvedLocale)}moveMonth(e){let i=gr(this.viewYear,this.viewMonth,e);this.viewYear=i.year,this.viewMonth=i.month,this.refreshGrid()}getFlatDays(){return this.monthPanels.flatMap(e=>e.weeks.flat())}moveFocusedDay(e){let i=this.getFlatDays().filter(h=>!h.isDisabled);if(!i.length)return;let r=i.findIndex(h=>h.iso===this.focusedIso),s=r<0?Math.max(0,i.findIndex(h=>h.inMonth)):(r+e+i.length)%i.length,d=i[s];if(d){if(!this.isMonthVisible(d.date)){this.viewYear=d.date.getFullYear(),this.viewMonth=d.date.getMonth(),this.focusedIso=d.iso,this.refreshGrid(),this.focusFocusedDay();return}this.focusedIso=d.iso,this.focusDayInCurrentGrid(d.iso)}}isMonthVisible(e){let i=this.viewYear*12+this.viewMonth,r=i+this.visibleMonths-1,s=e.getFullYear()*12+e.getMonth();return s>=i&&s<=r}focusDayInCurrentGrid(e){let i=this.querySelector('[data-calendar-day][tabindex="0"]'),r=Array.from(this.querySelectorAll(`[data-calendar-day][data-iso="${e}"]:not(:disabled)`)),s=r.find(d=>!d.hasAttribute("data-outside"))??r[0];s&&(i&&i!==s&&(i.tabIndex=-1),s.tabIndex=0,s.focus())}focusFocusedDay(){requestAnimationFrame(()=>{this.focusDayInCurrentGrid(this.focusedIso)})}moveFocusedMonth(e){let i=Dt(this.focusedIso)??new Date(this.viewYear,this.viewMonth,1),r=new Date(i.getFullYear(),i.getMonth()+e,1),s=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),d=new Date(r.getFullYear(),r.getMonth(),Math.min(i.getDate(),s));this.viewYear=d.getFullYear(),this.viewMonth=d.getMonth(),this.focusedIso=Ze(d),this.refreshGrid(),this.focusFocusedDay()}isIsoAllowed(e){return!(this.min&&e<this.min||this.max&&e>this.max)}emitChange(e,i={}){this.changeEvent.emit({value:e,...i})}selectSingle(e){!this.isIsoAllowed(e)||e===this.value||(this.value=e,this.emitChange(e),this.refreshGrid())}selectMultiple(e){if(!this.isIsoAllowed(e))return;let i=_n(xn(Xt(this.value),e));i!==this.value&&(this.value=i,this.emitChange(i),this.refreshGrid())}selectRange(e){if(!this.isIsoAllowed(e))return;let i=Tn(Me(this.value),{anchor:this.rangeAnchor,hover:this.rangeHover},e);if(this.rangeAnchor=i.draft.anchor,this.rangeHover=i.draft.hover,i.committed){let r=Nt(i.committed);r!==this.value&&(this.value=r,this.emitChange(r,{start:i.committed.start,end:i.committed.end}))}this.refreshGrid()}selectIso(e){if(this.selectionMode==="multiple"){this.selectMultiple(e);return}if(this.selectionMode==="range"){this.selectRange(e);return}this.selectSingle(e)}previewRange(e){this.selectionMode!=="range"||!this.rangeAnchor||this.disabled||this.rangeHover!==e&&(this.rangeHover=e,this.refreshGrid())}clearRangePreview(){this.rangeHover&&(this.rangeHover=this.rangeAnchor,this.refreshGrid())}initialize(){this.syncViewFromValue(),this.refreshGrid()}constructor(){super(),fl(this),SC(this,()=>this.initialize())}onConnected(){this.initialize()}onPropsUpdated(){this.selectionMode!=="range"&&(this.rangeAnchor=null,this.rangeHover=null),this.syncViewFromValue(),this.refreshGrid()}onPrevMonth(e){e.preventDefault(),this.moveMonth(-this.pageDelta)}onNextMonth(e){e.preventDefault(),this.moveMonth(this.pageDelta)}onTodayClick(e){e.preventDefault(),this.selectIso(Ze(new Date))}onDayClick(e){let i=e.target.closest("[data-calendar-day]"),r=i?.getAttribute("data-iso");!r||i?.disabled||this.disabled||this.selectIso(r)}onDayPointerEnter(e){let i=e.target.closest("[data-calendar-day]"),r=i?.getAttribute("data-iso");!r||i?.disabled||this.previewRange(r)}onGridPointerLeave(){this.clearRangePreview()}onDayKeydown(e){if(this.disabled)return;let i=e.target.getAttribute("data-iso");if(i&&(this.focusedIso=i),e.key==="ArrowLeft"){e.preventDefault(),this.moveFocusedDay(-1);return}if(e.key==="ArrowRight"){e.preventDefault(),this.moveFocusedDay(1);return}if(e.key==="ArrowUp"){e.preventDefault(),this.moveFocusedDay(-7);return}if(e.key==="ArrowDown"){e.preventDefault(),this.moveFocusedDay(7);return}if(e.key==="PageUp"){e.preventDefault(),this.moveFocusedMonth(e.shiftKey?-12:-this.pageDelta);return}if(e.key==="PageDown"){e.preventDefault(),this.moveFocusedMonth(e.shiftKey?12:this.pageDelta);return}if(e.key==="Enter"||e.key===" "){e.preventDefault();let r=e.target,s=r.getAttribute("data-iso");s&&!r.disabled&&this.selectIso(s)}}dayDataAttributes(e){return{"data-range-start":e.isRangeStart?"true":void 0,"data-range-end":e.isRangeEnd?"true":void 0,"data-range-middle":e.isRangeMiddle?"true":void 0}}render(){let e=this.monthPanels.length,i=e>1;return zn("div",{class:`rui-calendar${i?" rui-calendar--multi":""}`,"data-ref":"root",role:"application","aria-label":"Calendar","aria-multiselectable":this.selectionMode==="multiple"?"true":void 0,children:[Te("div",{class:"rui-calendar__months",children:this.monthPanels.map((r,s)=>zn("div",{class:"rui-calendar__month-panel","data-calendar-month-panel":!0,children:[zn("div",{class:"rui-calendar__header",children:[s===0?Te("button",{type:"button",class:"rui-calendar__nav","data-calendar-prev-month":!0,"aria-label":"Previous month",disabled:this.disabled,children:"\u2039"}):Te("span",{class:"rui-calendar__nav-spacer","aria-hidden":"true"}),Te("div",{class:"rui-calendar__month","aria-live":"polite",children:r.label}),s===e-1?Te("button",{type:"button",class:"rui-calendar__nav","data-calendar-next-month":!0,"aria-label":"Next month",disabled:this.disabled,children:"\u203A"}):Te("span",{class:"rui-calendar__nav-spacer","aria-hidden":"true"})]}),s===0?Te("div",{class:"rui-calendar__weekdays",role:"row",children:this.weekdayLabels.map(d=>Te("div",{class:"rui-calendar__weekday",role:"columnheader","aria-hidden":"true",children:d}))}):null,Te("div",{class:"rui-calendar__grid",role:"grid","data-calendar-grid":!0,children:r.weeks.map(d=>Te("div",{class:"rui-calendar__week",role:"row",children:d.map(h=>Te("button",{type:"button",class:"rui-calendar__day","data-calendar-day":!0,"data-iso":h.iso,role:"gridcell",disabled:this.disabled||h.isDisabled,tabIndex:h.iso===this.focusedIso?0:-1,"aria-selected":h.isSelected?"true":"false","aria-current":h.isToday?"date":void 0,"data-outside":h.inMonth?void 0:"true",...this.dayDataAttributes(h),children:h.date.getDate()}))}))})]}))}),Te("div",{class:"rui-calendar__footer",children:Te("button",{type:"button",class:"rui-calendar__today","data-calendar-today":!0,disabled:this.disabled,children:this.todayLabel})})]})}static{Ms()}};import{jsx as EC}from"@ecopages/jsx/jsx-runtime";function Si({children:t,...e}){return EC("rui-calendar",{...e,children:t})}import{RadiantElement as ou,bindTo as MC,customElement as LC,onEvent as Ae,onUpdated as Wn,prop as Se,query as wr}from"@ecopages/radiant";var RC=/^[A-Za-z][A-Za-z0-9_-]*$/;function yl(t){return RC.test(t)}function AC(t){let e=t.trim();if(yl(e))return e;let i=`rui-${e}`;return e&&yl(i)?i:"rui"}function re(t){let e=typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,""):Array.from(crypto.getRandomValues(new Uint8Array(16)),i=>i.toString(16).padStart(2,"0")).join("");return`${AC(t)}-${e}`}var _r=class{constructor(e){this.config=e}config;timer=null;get isRunning(){return this.timer!==null}start(){if(!this.config.canRotate()){this.stop();return}this.stop();let e=Math.max(0,this.config.getInterval());this.timer=setInterval(()=>{if(!this.config.canRotate()){this.stop();return}this.config.onTick()},e),this.config.onRunningChange()}stop(){this.timer!==null&&(clearInterval(this.timer),this.timer=null,this.config.onRunningChange())}sync(){this.config.canRotate()?this.start():this.stop()}};function IC(t,e,i=48){return Math.abs(t)<i||Math.abs(t)<=Math.abs(e)?null:t<0?"next":"prev"}var xr=class{pointerId=null;startX=0;startY=0;onPointerDown(e,i){e.button!==0||i||(this.pointerId=e.pointerId,this.startX=e.clientX,this.startY=e.clientY)}onPointerUp(e){if(this.pointerId!==e.pointerId)return null;let i=e.clientX-this.startX,r=e.clientY-this.startY;return this.pointerId=null,IC(i,r)}onPointerCancel(e){this.pointerId===e.pointerId&&(this.pointerId=null)}};function Mt(t){return!Number.isFinite(t)||t<1?1:t}function _l(t){return!Number.isFinite(t)||t<1?1:Math.floor(t)}function qn(t,e){return t<=0?0:Math.max(0,t-Math.floor(Mt(e)))}function Kn(t,e,i){if(e<=0||!Number.isFinite(t))return 0;let r=qn(e,i);return Math.min(Math.max(Math.trunc(t),0),r)}function CC(t,e,i){let r=Mt(i),s=Kn(t,e,r);return Math.min(s,Math.max(0,e-r))}function $n(t,e,i,r){let s=Mt(r),d=CC(e,i,s);return t+1>d&&t<d+s}function Ei(t,e){return Mt(e)>1?"window":t==="fade"?"stack":t==="slide"?"window":"swap"}function Ri(t){return Mt(t)>1?"cards":"shell"}function xl(t){let e=Mt(t);return e<=1?0:Math.ceil(e)-1}function Gn(t){let e=Mt(t.slidesPerView),i=_l(t.slidesPerGroup),r=Kn(t.index,t.count,e),s=qn(t.count,e);return{index:r,slidesPerView:e,slidesPerGroup:i,maxStartIndex:s,canGoPrev:t.wrap||r>0,canGoNext:t.wrap||r<s}}function Ai(t,e){let i=_l(t.slidesPerGroup),r=Math.trunc(t.index)+e*i,s=qn(t.count,t.slidesPerView);return t.wrap?s<=0||r>s?0:r<0?s:r:Kn(r,t.count,t.slidesPerView)}var wl,Tl,Sl,El,Rl,Al,Il,Cl,Dl,Ol,Vl,kl,Ml,Ll,Pl,jl,Fl,Bl,Ul,zl,ql,Kl,$l,Gl,Wl,Hl,Yl,Nl,Xl,Ql,Jl,Zl,eu,tu,iu,ru;function DC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:nu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||nu(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:OC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return kC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function OC(t){var e=VC(t,"string");return typeof e=="symbol"?e:e+""}function VC(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nu(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function kC(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Le={label:"Carousel",transition:"none",controlsVariant:"toolbar",slidesPerView:1,slidesPerGroup:1},su,au=class extends ou{static{({e:[Sl,El,Rl,Al,Il,Cl,Dl,Ol,Vl,kl,Ml,Ll,Pl,jl,Fl,Bl,Ul,zl,ql,Kl,$l,Gl,Wl,Hl,Yl,Nl,Xl,Ql,Jl,Zl,eu,tu,iu,ru,wl],c:[su,Tl]}=DC(this,[LC("rui-carousel")],[[Se({type:String,defaultValue:Le.label}),0,"label"],[Se({type:Number,reflect:!0,defaultValue:0}),0,"index"],[Se({type:Boolean,reflect:!0,defaultValue:!1}),0,"autoplay"],[Se({type:Number,defaultValue:4e3}),0,"interval"],[Se({type:String,defaultValue:Le.transition}),0,"transition"],[Se({type:String,defaultValue:Le.controlsVariant,attribute:"controls-variant"}),0,"controlsVariant"],[Se({type:Boolean,defaultValue:!1}),0,"showIndicators"],[Se({type:Boolean,defaultValue:!1}),0,"showRotationControl"],[Se({type:Boolean,defaultValue:!0}),0,"loop"],[Se({type:Boolean,defaultValue:!0}),0,"wrap"],[[Se({type:Number,defaultValue:Le.slidesPerView,attribute:"slides-per-view"}),MC({ref:"root",attr:"data-carousel-surface",map:e=>Ri(e)})],0,"slidesPerView"],[Se({type:Number,defaultValue:Le.slidesPerGroup,attribute:"slides-per-group"}),0,"slidesPerGroup"],[Se({type:Number,defaultValue:0}),0,"slideCount"],[wr({ref:"root"}),0,"rootTarget"],[wr({ref:"track"}),0,"trackTarget"],[wr({ref:"indicators"}),0,"indicatorsTarget"],[wr({ref:"viewport"}),0,"viewportTarget"],[Wn(["index","transition","loop","wrap","controlsVariant","slidesPerView","slidesPerGroup"]),2,"onSlideStateUpdated"],[Wn(["autoplay","showRotationControl","interval"]),2,"onAutoplayUpdated"],[Wn(["showIndicators"]),2,"onIndicatorsUpdated"],[Ae({selector:'[data-carousel-action="prev"]',type:"click"}),2,"prev"],[Ae({selector:'[data-carousel-action="next"]',type:"click"}),2,"next"],[Ae({selector:'[data-carousel-action="rotation"]',type:"click"}),2,"toggleRotation"],[Ae({selector:"[data-carousel-indicator]",type:"click"}),2,"onIndicatorClick"],[Ae({selector:"[data-carousel-indicator]",type:"keydown"}),2,"onIndicatorKeydown"],[Ae({ref:"root",type:"pointerenter"}),2,"onRootPointerEnter"],[Ae({ref:"root",type:"pointerleave"}),2,"onRootPointerLeave"],[Ae({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[Ae({ref:"root",type:"focusout"}),2,"onRootFocusOut"],[Ae({ref:"viewport",type:"pointerdown"}),2,"onViewportPointerDown"],[Ae({ref:"viewport",type:"pointerup"}),2,"onViewportPointerUp"],[Ae({ref:"viewport",type:"pointercancel"}),2,"onViewportPointerCancel"]],0,void 0,ou))}label=(wl(this),Sl(this));index=(El(this),Rl(this));autoplay=(Al(this),Il(this));interval=(Cl(this),Dl(this));transition=(Ol(this),Vl(this));controlsVariant=(kl(this),Ml(this));showIndicators=(Ll(this),Pl(this));showRotationControl=(jl(this),Fl(this));loop=(Bl(this),Ul(this));wrap=(zl(this),ql(this));slidesPerView=(Kl(this),$l(this));slidesPerGroup=(Gl(this),Wl(this));slideCount=(Hl(this),Yl(this));rootTarget=(Nl(this),Xl(this));trackTarget=(Ql(this),Jl(this));indicatorsTarget=(Zl(this),eu(this));viewportTarget=(tu(this),iu(this));paused=(ru(this),!1);uid=re("rui-carousel");userOverrideReducedMotion=!1;swipe=new xr;autoplayController=new _r({getInterval:()=>this.interval,canRotate:()=>this.canAutoplayRotate(),onTick:()=>this.onAutoplayTick(),onRunningChange:()=>this.syncAriaLive()});onConnected(){this.autoplay&&this.prefersReducedMotion()&&(this.paused=!0),this.sync(),this.syncAutoplay(),this.syncIndicators(),this.syncAriaLive()}disconnectedCallback(){this.autoplayController.stop(),super.disconnectedCallback()}onSlideStateUpdated(){this.sync(),this.syncIndicators(),this.syncAutoplay()}onAutoplayUpdated(){this.syncAutoplay(),this.syncRotationControl()}onIndicatorsUpdated(){this.sync(),this.syncIndicators()}prefersReducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}slidePanelId(e,i){let r=e.getAttribute("data-slide")??String(i),s=`${this.uid}-panel-${r}`;return e.id=s,s}tabId(e){return`${this.uid}-tab-${e}`}getSlides(){return Array.from(this.querySelectorAll("[data-slide]"))}get shouldWrap(){return this.wrap&&this.loop}windowParams(e,i=this.index){return{index:i,count:e,slidesPerView:this.slidesPerView,slidesPerGroup:this.slidesPerGroup,wrap:this.shouldWrap}}windowFor(e){return Gn(this.windowParams(e))}trackMode(){return Ei(this.transition,this.slidesPerView)}syncSlideAccessibility(e,i,r){let s=e.length,d=this.trackMode();e.forEach((h,a)=>{let E=a===i,A=$n(a,i,s,r),S=`${a+1} of ${s}`;this.showIndicators&&r===1?(this.slidePanelId(h,a),h.setAttribute("role","tabpanel"),h.setAttribute("aria-labelledby",this.tabId(a)),h.setAttribute("aria-label",S),h.removeAttribute("aria-roledescription")):(h.setAttribute("role","group"),h.setAttribute("aria-roledescription","slide"),h.setAttribute("aria-label",S),h.removeAttribute("aria-labelledby"),h.removeAttribute("tabindex")),h.hidden=d==="swap"&&!E,h.setAttribute("aria-hidden",String(!A)),h.setAttribute("data-active",E?"true":"false")})}sync(){let e=this.getSlides();if(!e.length)return;let i=this.windowFor(e.length);i.index!==this.index&&(this.index=i.index);let r=this.rootTarget;r&&r.setAttribute("data-carousel-track",this.trackMode());let s=this.trackTarget;s&&(s.style.setProperty("--rui-carousel-index",String(i.index)),s.style.setProperty("--rui-carousel-slides-per-view",String(i.slidesPerView)),s.style.setProperty("--rui-carousel-gap-count",String(xl(i.slidesPerView))),s.style.setProperty("--rui-carousel-slide-count",String(e.length))),this.syncSlideAccessibility(e,i.index,i.slidesPerView),this.syncPrevNextDisabled(i)}syncPrevNextDisabled(e){let i=!this.shouldWrap&&!e.canGoPrev,r=!this.shouldWrap&&!e.canGoNext;for(let s of this.querySelectorAll('[data-carousel-action="prev"]'))this.shouldWrap?s.removeAttribute("disabled"):s.disabled=i;for(let s of this.querySelectorAll('[data-carousel-action="next"]'))this.shouldWrap?s.removeAttribute("disabled"):s.disabled=r}syncIndicators(){let e=this.indicatorsTarget;if(!e)return;let i=this.getSlides(),r=this.windowFor(i.length),s=r.slidesPerView===1,d=i.slice(0,r.maxStartIndex+1);e.setAttribute("role",s?"tablist":"group"),e.setAttribute("aria-label",s?"Choose slide to display":"Choose slide window"),Array.from(e.querySelectorAll("[data-carousel-indicator]")).length!==d.length&&e.replaceChildren(...d.map((A,S)=>{let I=document.createElement("button");return I.type="button",I.className="rui-carousel__indicator",I.id=this.tabId(S),I.setAttribute("data-carousel-indicator",String(S)),I}));let a=Array.from(e.querySelectorAll("[data-carousel-indicator]")),E=i.map((A,S)=>this.slidePanelId(A,S));a.forEach((A,S)=>{let I=S===r.index;A.id=this.tabId(S),A.setAttribute("aria-label",s?`Slide ${S+1}`:`Slide window ${S+1}`),A.setAttribute("aria-controls",E.filter((T,K)=>$n(K,S,i.length,r.slidesPerView)).join(" ")),s?(A.setAttribute("role","tab"),A.setAttribute("aria-selected",String(I)),A.removeAttribute("aria-current")):(A.removeAttribute("role"),A.removeAttribute("aria-selected"),I?A.setAttribute("aria-current","true"):A.removeAttribute("aria-current")),A.tabIndex=I?0:-1})}syncRotationControl(){for(let e of this.querySelectorAll('[data-carousel-action="rotation"]')){let i=this.autoplay&&!this.paused;e.setAttribute("aria-pressed",String(i)),e.setAttribute("aria-label",i?"Pause rotation":"Start rotation")}}syncAriaLive(){let e=this.viewportTarget;if(!e)return;let i=this.autoplay&&!this.paused&&this.autoplayController.isRunning;e.setAttribute("aria-live",i?"off":"polite"),e.setAttribute("aria-atomic","false")}canAutoplayRotate(){if(!this.autoplay||this.paused||this.prefersReducedMotion()&&!this.userOverrideReducedMotion)return!1;let e=this.getSlides();return e.length?this.windowFor(e.length).canGoNext:!1}onAutoplayTick(){let e=this.getSlides();if(!e.length)return;if(!this.windowFor(e.length).canGoNext){this.autoplayController.stop(),this.syncAriaLive();return}this.goTo(Ai(this.windowParams(e.length),1))}syncAutoplay(){this.autoplayController.sync(),this.syncRotationControl(),this.syncAriaLive()}goTo(e){let i=this.getSlides();i.length&&(this.index=Gn(this.windowParams(i.length,e)).index,this.sync(),this.syncIndicators())}userNavigate(e){this.paused=!0,this.autoplayController.stop();let i=this.getSlides();i.length&&this.goTo(Ai(this.windowParams(i.length),e))}isSwipeExcludedTarget(e){return e instanceof Element?!!e.closest("button, a, input, textarea, select, [data-carousel-indicator], [data-carousel-action]"):!1}prev(){this.userNavigate(-1)}next(){this.userNavigate(1)}toggleRotation(){this.autoplay?(this.paused=!this.paused,this.paused||(this.userOverrideReducedMotion=!0)):(this.autoplay=!0,this.paused=!1,this.userOverrideReducedMotion=!0),this.syncAutoplay()}onIndicatorClick(e){let i=e.target.closest("[data-carousel-indicator]");if(!i)return;let r=Number(i.getAttribute("data-carousel-indicator"));Number.isFinite(r)&&(this.paused=!0,this.autoplayController.stop(),this.goTo(r),i.focus())}onIndicatorKeydown(e){let i=this.getSlides();if(!i.length)return;let r=e.target.closest("[data-carousel-indicator]");if(!r)return;let s=Number(r.getAttribute("data-carousel-indicator"));if(!Number.isFinite(s))return;if(e.key==="ArrowRight")s=Ai({...this.windowParams(i.length,s),slidesPerGroup:1},1);else if(e.key==="ArrowLeft")s=Ai({...this.windowParams(i.length,s),slidesPerGroup:1},-1);else if(e.key==="Home")s=0;else if(e.key==="End")s=this.windowFor(i.length).maxStartIndex;else if(e.key===" "||e.key==="Enter"){e.preventDefault(),this.paused=!0,this.autoplayController.stop(),this.goTo(s);return}else return;e.preventDefault(),this.paused=!0,this.autoplayController.stop(),this.goTo(s),Array.from(this.indicatorsTarget?.querySelectorAll("[data-carousel-indicator]")??[])[this.index]?.focus()}onRootPointerEnter(e){this.autoplay&&e.pointerType==="mouse"&&this.autoplayController.stop()}onRootPointerLeave(e){this.autoplay&&!this.paused&&e.pointerType==="mouse"&&this.syncAutoplay()}onRootFocusIn(){this.autoplay&&this.autoplayController.stop()}onRootFocusOut(e){let i=e.relatedTarget;i&&this.contains(i)||this.autoplay&&!this.paused&&this.syncAutoplay()}onViewportPointerDown(e){this.swipe.onPointerDown(e,this.isSwipeExcludedTarget(e.target))}onViewportPointerUp(e){let i=this.swipe.onPointerUp(e);i==="next"?this.next():i==="prev"&&this.prev()}onViewportPointerCancel(e){this.swipe.onPointerCancel(e)}static{Tl()}};import{jsx as oe,jsxs as Lt}from"@ecopages/jsx/jsx-runtime";function lu({id:t,children:e,class:i,...r}){return oe("div",{...r,class:j("rui-carousel__slide",i),"data-slide":t,children:e})}function PC(){return Lt("span",{class:"rui-carousel__nav-label",children:[oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})}function jC(){return Lt("span",{class:"rui-carousel__nav-label",children:["Next",oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})}function uu({children:t,class:e,disabled:i,overlay:r,aria:s,...d}){return oe("button",{...d,aria:ne(s,"Previous slide"),type:"button","data-carousel-action":"prev","data-ref":"prev",class:j("rui-carousel__nav rui-button rui-button--outline rui-button--sm",r?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",e),disabled:i,children:t??(r?oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}):PC())})}function cu({children:t,class:e,disabled:i,overlay:r,aria:s,...d}){return oe("button",{...d,aria:ne(s,"Next slide"),type:"button","data-carousel-action":"next","data-ref":"next",class:j("rui-carousel__nav rui-button rui-button--outline rui-button--sm",r?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",e),disabled:i,children:t??(r?oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"}):jC())})}function du({children:t,class:e,overlay:i,aria:r,...s}){return oe("button",{...s,aria:ne(r,"Start rotation"),type:"button","data-carousel-action":"rotation","data-ref":"rotation",class:j("rui-carousel__rotation rui-button rui-button--ghost rui-button--sm",i&&"rui-carousel__rotation--overlay",e),"aria-pressed":!1,children:t??"Play"})}function FC({autoplay:t,children:e,controlsVariant:i,label:r,next:s,prev:d,rotation:h,showIndicators:a,showRotationControl:E,slidesPerView:A,transition:S}){let I=i==="overlay",T=t||E,K=d??oe(uu,{overlay:I}),$=s??oe(cu,{overlay:I}),V=T?h??oe(du,{overlay:I}):null,G=Ei(S,A),W=Ri(A),O=a?oe("div",{class:j("rui-carousel__indicators",I&&"rui-carousel__indicators--overlay"),"data-ref":"indicators",role:W==="shell"?"tablist":"group","aria-label":W==="shell"?"Choose slide to display":"Choose slide window"}):null,_=Lt("div",{class:"rui-carousel__toolbar",children:[T?oe("div",{class:"rui-carousel__toolbar-rotation",children:V}):null,oe("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--start",children:K}),oe("div",{class:"rui-carousel__toolbar-center",children:O}),oe("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--end",children:$})]}),H=I?Lt("div",{class:"rui-carousel__overlay-chrome",children:[T?oe("div",{class:"rui-carousel__overlay-rotation",children:V}):null,Lt("div",{class:"rui-carousel__controls rui-carousel__controls--overlay",children:[K,$]}),O]}):null;return Lt("section",{class:j("rui-carousel",`rui-carousel--${S}`,`rui-carousel--controls-${i}`),"data-ref":"root","data-carousel-track":G,"data-carousel-surface":W,"aria-roledescription":"carousel","aria-label":r,children:[oe("div",{class:"rui-carousel__stage",children:Lt("div",{class:"rui-carousel__viewport","data-ref":"viewport",children:[oe("div",{class:"rui-carousel__track","data-ref":"track",children:e}),H]})}),I?null:oe("div",{class:"rui-carousel__footer",children:_})]})}function BC({slides:t,children:e,prev:i,next:r,rotation:s,label:d=Le.label,transition:h=Le.transition,controlsVariant:a=Le.controlsVariant,showIndicators:E,showRotationControl:A,autoplay:S,slidesPerView:I=Le.slidesPerView,slidesPerGroup:T=Le.slidesPerGroup,...K}){let $=t??[],V=t!=null?$.map(G=>oe(lu,{id:G.id,children:G.children})):e;return oe("rui-carousel",{...K,label:d,transition:h,controlsVariant:a,showIndicators:E,showRotationControl:A,autoplay:S,slidesPerView:I,slidesPerGroup:T,slideCount:$.length,children:oe(FC,{autoplay:S,controlsVariant:a,label:d,next:r,prev:i,rotation:s,showIndicators:E,showRotationControl:A,slidesPerView:I,transition:h,children:V})})}import{RadiantElement as Au,bindTo as Ii,customElement as $C,event as GC,onEvent as WC,prop as Ci}from"@ecopages/radiant";function gt(t){return t||void 0}var hu,pu,fu,mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su,Eu;function UC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Ru(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ru(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:zC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return KC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function zC(t){var e=qC(t,"string");return typeof e=="symbol"?e:e+""}function qC(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ru(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function KC(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Hn="on",Tr,Iu=class extends Au{static{({e:[fu,mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su,Eu,hu],c:[Tr,pu]}=UC(this,[$C("rui-checkbox")],[[[Ci({type:Boolean,reflect:!0,defaultValue:!1}),Ii({ref:"input",prop:"checked"})],0,"checked"],[[Ci({type:Boolean,reflect:!0,defaultValue:!1}),Ii([{ref:"input",prop:"indeterminate"},{ref:"input",attr:"aria-checked",map:e=>e?"mixed":void 0}])],0,"indeterminate"],[[Ci({type:Boolean,reflect:!0,defaultValue:!1}),Ii({ref:"input",prop:"disabled"})],0,"disabled"],[[Ci({type:String,defaultValue:Hn}),Ii({ref:"input",prop:"value"})],0,"value"],[[Ci({type:String,defaultValue:""}),Ii({ref:"input",attr:"name",map:gt})],0,"name"],[GC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[WC({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,Au))}constructor(...e){super(...e),Eu(this)}checked=(hu(this),fu(this));indeterminate=(mu(this),gu(this));disabled=(bu(this),vu(this));value=(yu(this),_u(this));name=(xu(this),wu(this));changeEvent=(Tu(this),Su(this));onInputChange(e){let i=e.target;this.checked=i.checked,i.indeterminate=this.indeterminate,this.changeEvent.emit({checked:this.checked,indeterminate:this.indeterminate})}static{pu()}};import{jsx as Sr,jsxs as HC}from"@ecopages/jsx/jsx-runtime";function Di({children:t,checked:e,disabled:i,indeterminate:r,name:s,value:d=Hn,...h}){return Sr("rui-checkbox",{...h,checked:e,disabled:i,indeterminate:r,name:s,value:d,"data-disabled":i?"":void 0,children:HC("label",{class:"rui-checkbox",children:[Sr("input",{type:"checkbox","data-ref":"input","data-rui-control":!0,"data-rui-control-type":"boolean",class:"rui-checkbox__input",checked:e,disabled:i,value:d,name:s||void 0,"aria-checked":r?"mixed":void 0}),Sr("span",{class:"rui-checkbox__control","aria-hidden":"true"}),Sr("span",{class:"rui-checkbox__label",children:t})]})})}import{RadiantElement as Hu,bindTo as Yn,customElement as eD,event as tD,onEvent as iD,onUpdated as rD,prop as Oi}from"@ecopages/radiant";function Cu(t){return t?Ou(t.split(",")):[]}function YC(t){return t.join(",")}var Er={fromAttribute:t=>Cu(t),toAttribute:t=>t.length>0?YC(t):null,fromProperty:t=>Array.isArray(t)?Ou(t.map(String)):typeof t=="string"?Cu(t):[]},Ie={type:Array,reflect:!0,transform:Er};function et(t){return Er.fromProperty?.(t)??[]}function Du(t){return t?t.split(",").map(e=>Number(e.trim())).filter(e=>Number.isFinite(e)):[]}function NC(t){return t.join(",")}var Rr={fromAttribute:t=>Du(t),toAttribute:t=>t.length>0?NC(t):null,fromProperty:t=>Array.isArray(t)?t.map(Number).filter(e=>Number.isFinite(e)):typeof t=="number"&&Number.isFinite(t)?[t]:typeof t=="string"?Du(t):[]};function Ou(t){return[...new Set(t.map(e=>e.trim()).filter(Boolean))]}var Vu,ku,Mu,Lu,Pu,ju,Fu,Bu,Uu,zu,qu,Ku,$u,Gu;function XC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Wu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Wu(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:QC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ZC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function QC(t){var e=JC(t,"string");return typeof e=="symbol"?e:e+""}function JC(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wu(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ZC(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Nu,Yu=class extends Hu{static{({e:[Mu,Lu,Pu,ju,Fu,Bu,Uu,zu,qu,Ku,$u,Gu,Vu],c:[Nu,ku]}=XC(this,[eD("rui-checkbox-group")],[[Oi({...Ie,defaultValue:[]}),0,"value"],[Oi({type:String,defaultValue:""}),0,"name"],[[Oi({type:String,defaultValue:""}),Yn({selector:"[data-checkbox-group-root]",attr:"aria-label",map:gt})],0,"label"],[[Oi({type:Boolean,reflect:!0,defaultValue:!1}),Yn({selector:"[data-checkbox-group-root]",attr:"aria-disabled",map:e=>e?"true":void 0})],0,"disabled"],[[Oi({type:String,reflect:!0,defaultValue:"vertical"}),Yn({selector:"[data-checkbox-group-root]",attr:"data-orientation"})],0,"orientation"],[tD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[rD(["value","name","disabled"]),2,"syncCheckboxes"],[iD({selector:"rui-checkbox",type:"rui-change"}),2,"onCheckboxChange"]],0,void 0,Hu))}constructor(...e){super(...e),Gu(this)}value=(Vu(this),Mu(this));name=(Lu(this),Pu(this));label=(ju(this),Fu(this));disabled=(Bu(this),Uu(this));orientation=(zu(this),qu(this));changeEvent=(Ku(this),$u(this));onConnected(){this.syncCheckboxes()}syncCheckboxes(){let e=new Set(this.value),i=this.name||this.getAttribute("name")||"";for(let r of this.getCheckboxes())r.checked=e.has(r.value),r.disabled=this.disabled||r.hasAttribute("data-disabled"),i&&(r.name=i)}onCheckboxChange(e){e.stopImmediatePropagation();let i=this.getCheckboxes().filter(r=>r.checked).map(r=>r.value);this.value=i,this.changeEvent.emit({value:this.value})}getCheckboxes(){return Array.from(this.querySelectorAll("rui-checkbox")).filter(e=>e instanceof Tr)}static{ku()}};import{jsx as Ar}from"@ecopages/jsx/jsx-runtime";function Xu({children:t,class:e,orientation:i="vertical",...r}){return Ar("div",{...r,"data-checkbox-group-root":!0,"data-orientation":i,class:j("rui-checkbox-group",e),role:"group","data-rui-control":!0,"data-rui-control-type":"text",children:t})}function nD({options:t,children:e,value:i,orientation:r="vertical",...s}){let d=et(i),h=new Set(d);return Ar("rui-checkbox-group",{...s,value:d,orientation:r,children:t==null?e:Ar(Xu,{orientation:r,children:t.map(a=>Ar(Di,{value:a.value,disabled:a.disabled,checked:h.has(a.value),children:a.label}))})})}import{jsx as oD}from"@ecopages/jsx/jsx-runtime";function aD({children:t,variant:e="default",class:i,...r}){return oD("span",{...r,class:j("rui-chip",`rui-chip--${e}`,i),children:t})}import{jsx as Qu}from"@ecopages/jsx/jsx-runtime";function sD({children:t,class:e,...i}){return Qu("ul",{...i,class:j("rui-chip-list",e),children:t})}function lD({children:t,class:e,...i}){return Qu("li",{...i,class:j("rui-chip-list__item",e),children:t})}import{RadiantElement as Ac,bindTo as TD,customElement as SD,event as ED,onEvent as Pe,onUpdated as RD,prop as jt,query as AD}from"@ecopages/radiant";function Vi(t){let e=t.previousElementSibling;return e?.tagName.toLowerCase()==="label"?e:t.parentElement?.querySelector("[data-rui-field-label]")??null}function Nn(t,e,i){t.id||(t.id=i.labelId),t.htmlFor||(t.htmlFor=i.controlId),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")}function qe(t,e,i){if(!e||e.hasAttribute("data-rui-field-managed"))return;let r=Vi(t);if(r){Nn(r,e,i);return}if(i.label){e.setAttribute("aria-label",i.label),e.removeAttribute("aria-labelledby");return}e.removeAttribute("aria-label"),e.removeAttribute("aria-labelledby")}var uD="data-listbox-option-indicator";function Pt(t){let e=t.getAttribute("data-label");return e||Ju(t).trim()}function Ce(t){return t.getAttribute("data-value")||Pt(t)}function Ju(t){if(cD(t))return"";if(t.nodeType===Node.TEXT_NODE)return t.textContent??"";let e="";for(let i of t.childNodes)e+=Ju(i);return e}function cD(t){return t instanceof HTMLElement&&t.hasAttribute(uD)}var Jt=class{config;constructor(e){this.config=e}getListboxHost(){return this.config.getRoot()?.querySelector("rui-listbox")??null}getListbox(){let e=this.getListboxHost();return e?e.querySelector('[role="listbox"]')??e:this.config.getPopup?.()??null}getOptions(){let e=this.getListbox();return e?Array.from(e.querySelectorAll('[role="option"]')):[]}getSelectedValues(){return this.config.getValue()}setSelectedValues(e){this.config.setValue(e)}toggleValue(e){if(this.config.getSelectionMode()==="multiple"){let i=new Set(this.getSelectedValues());i.has(e)?i.delete(e):i.add(e),this.setSelectedValues([...i]);return}this.setSelectedValues([e])}removeValue(e){let i=new Set(this.getSelectedValues());return i.delete(e)?(this.setSelectedValues([...i]),!0):!1}clearValues(){return this.getSelectedValues().length===0?!1:(this.setSelectedValues([]),!0)}findOption(e){return e instanceof Element?e.closest('[role="option"]')??null:null}isSelectableOption(e){return e!=null&&e.getAttribute("aria-disabled")!=="true"&&!e.hidden}syncListboxHost(){let e=this.getListboxHost();e&&(e.embedded=!0,e.selectionMode=this.config.getSelectionMode(),e.value=this.config.getValue())}syncOptionSelection(){let e=new Set(this.getSelectedValues());for(let i of this.getOptions())i.setAttribute("aria-selected",String(e.has(Ce(i))))}syncMultiselectable(e){if(e){if(this.config.getSelectionMode()==="multiple"){e.setAttribute("aria-multiselectable","true");return}e.removeAttribute("aria-multiselectable")}}getTagGroup(){let e=this.config.tagGroupSelector;if(!e)return null;let i=this.config.getRoot()?.querySelector(e)??null;return!i||typeof i.setItems!="function"?null:i}syncTagGroup(){let e=this.getTagGroup();if(!e)return;let i=this.getSelectedValues().flatMap(r=>{let s=this.getOptions().find(d=>Ce(d)===r);return s?[{value:r,label:Pt(s)}]:[]});e.embedded=!0,e.setItems(i),e.value=this.config.getValue()}labelForValue(e){let i=this.getOptions().find(r=>Ce(r)===e);return i?Pt(i):e}};var dD={top:"bottom",bottom:"top",left:"right",right:"left"},hD=8,Xn=new WeakMap;function pD(t){Xn.has(t)&&(t.style.width="",t.style.minWidth="",t.style.maxWidth="",t.style.boxSizing="",Xn.delete(t))}function fD(t){let e=t.indexOf("-");if(e===-1)return{side:t,align:"center"};let i=t.slice(0,e),r=t.slice(e+1);return{side:i,align:r==="start"||r==="end"?r:"center"}}function tc(t){return t==="top"||t==="bottom"?"y":"x"}function Zu(t,e,i,r,s){let{width:d,height:h}=e,a=0,E=0;switch(i){case"top":E=t.top-h-s;break;case"bottom":E=t.bottom+s;break;case"left":a=t.left-d-s;break;case"right":a=t.right+s;break}return tc(i)==="y"?r==="start"?a=t.left:r==="end"?a=t.right-d:a=t.left+(t.width-d)/2:r==="start"?E=t.top:r==="end"?E=t.bottom-h:E=t.top+(t.height-h)/2,{x:a,y:E}}function mD(t,e,i,r){let{padding:s,width:d,height:h}=r;return i==="top"?Math.max(0,s-t.y):i==="bottom"?Math.max(0,t.y+e.height-(h-s)):i==="left"?Math.max(0,s-t.x):Math.max(0,t.x+e.width-(d-s))}function ec(t,e,i,r){let{padding:s,width:d,height:h}=r;return i==="top"?t.top-s-e.height:i==="bottom"?h-s-e.height-t.bottom:i==="left"?t.left-s-e.width:d-s-e.width-t.right}function gD(t,e){return e==="center"?t:`${t}-${e}`}function bD(t,e,i,r){let{padding:s,width:d,height:h}=r;if(tc(i)==="y"){let E=Math.max(s,d-s-e.width);return{x:Math.min(Math.max(t.x,s),E),y:Math.max(s,t.y)}}let a=Math.max(s,h-s-e.height);return{x:Math.max(s,t.x),y:Math.min(Math.max(t.y,s),a)}}function vD(t,e,i,r,s={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:hD}){let{side:d,align:h}=fD(i),a=Zu(t,e,d,h,r),E=mD(a,e,d,s),A=d,S=a;if(E>0){let I=dD[d],T=Zu(t,e,I,h,r),K=ec(t,e,d,s);ec(t,e,I,s)>K&&(A=I,S=T)}return{coords:bD(S,e,A,s),placement:gD(A,h)}}function Qn(t,e,i,r,s={}){let d=s.matchAnchorWidth===!0,h=t.offsetWidth,a=d?{width:h,height:e.offsetHeight}:{width:e.offsetWidth,height:e.offsetHeight};d?(e.style.width=`${h}px`,e.style.minWidth=`${h}px`,e.style.maxWidth=`${h}px`,e.style.boxSizing="border-box",Xn.set(e,!0)):pD(e);let{coords:E,placement:A}=vD(t.getBoundingClientRect(),a,i,r);return Object.assign(e.style,{position:"fixed",left:`${E.x}px`,top:`${E.y}px`,right:"auto",bottom:"auto",visibility:"visible"}),e.setAttribute("data-placement",A),A}function Ir({anchor:t,floating:e,getPlacement:i,gap:r,matchAnchorWidth:s}){let d=()=>{e.hidden||Qn(t,e,i(),r,{matchAnchorWidth:s})};d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0);let h=new ResizeObserver(d);return h.observe(t),h.observe(e),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0),h.disconnect()}}function ic(t,e=document.body){let i=t.parentNode;if(!i)return{unmount:()=>{}};let r=document.createComment("rui-portal");return i.insertBefore(r,t),e.appendChild(t),{unmount:()=>{let s=r.parentNode;s&&(s.insertBefore(t,r),r.remove())}}}function Jn(t,e,i){return i?!!(t?.contains(i)||e?.contains(i)):!1}function tt(t,e,i){return i instanceof Node?!Jn(t,e,i):!0}function Ke(t,e,i){return!Jn(t,e,i)}var ce=class{config;cleanupFloating=null;portalHandle=null;floatingElement=null;constructor(e){this.config=e}updateConfig(e){this.config={...this.config,...e}}sync(){let e=this.resolveFloating();if(!e)return;if(!this.config.getOpen()){this.teardown(),e.toggleAttribute("hidden",!0);return}let r=this.config.getAnchor();if(!r)return;e.toggleAttribute("hidden",!1),this.config.portal!==!1?this.portalHandle||(this.portalHandle=ic(e,this.config.portalContainer??document.body)):this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null),this.teardownFloating(),this.cleanupFloating=Ir({anchor:r,floating:e,getPlacement:this.config.getPlacement,gap:this.config.gap??8,matchAnchorWidth:this.config.matchAnchorWidth})}contains(e){return Jn(this.config.getAnchor(),this.resolveFloating(),e)}getFloatingElement(){return this.resolveFloating()}teardown(){this.teardownFloating(),this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null)}destroy(){this.teardown(),this.floatingElement=null}resolveFloating(){let e=this.config.getFloating();return e&&(this.floatingElement=e),e??this.floatingElement}teardownFloating(){this.cleanupFloating?.(),this.cleanupFloating=null}};function rc(t){return t.filter(e=>!e.hidden&&e.getAttribute("aria-disabled")!=="true")}function nc(t,e,i){return i===0?-1:e===1?t>=i-1?0:t+1:t<=0?i-1:t-1}function Zn(t,e){e?.removeAttribute("aria-activedescendant");for(let i of t)i.removeAttribute("data-active")}function oc(t,e,i,r,s){Zn(t,r);let d=e[i];return!d||!r?null:(d.id||(d.id=`${s}-${i}`),d.setAttribute("data-active","true"),r.setAttribute("aria-activedescendant",d.id),d.scrollIntoView({block:"nearest"}),d)}var Zt=class{config;popoverController;activeIndex=-1;visualFocus=!1;constructor(e){this.config=e,this.popoverController=new ce({getAnchor:e.getAnchor,getFloating:e.getFloating,getOpen:e.getOpen,getPlacement:()=>"bottom-start",gap:4,portal:!1,matchAnchorWidth:!0})}get activeOptionIndex(){return this.activeIndex}get hasVisualFocus(){return this.visualFocus}ensureOptionIds(){this.config.getOptions().forEach((e,i)=>{e.id||(e.id=`${this.config.getOptionIdPrefix()}-${i}`)})}getVisibleOptions(){return rc(this.config.getOptions())}clearActiveOption(){this.activeIndex=-1,this.visualFocus=!1,Zn(this.config.getOptions(),this.config.getActiveDescendantHost())}setActiveOption(e){let i=this.getVisibleOptions();if(e<0||e>=i.length){this.clearActiveOption();return}this.activeIndex=e,this.visualFocus=!0,oc(this.config.getOptions(),i,e,this.config.getActiveDescendantHost(),this.config.getOptionIdPrefix())}moveActive(e,i){let r=this.getVisibleOptions();if(r.length){if(!this.config.getOpen()){i(e===1?"first":"last");return}if(this.visualFocus){this.setActiveOption(nc(this.activeIndex,e,r.length));return}this.setActiveOption(e===1?0:r.length-1)}}handleKeydown(e,i){if(e.ctrlKey||e.shiftKey||e.metaKey)return;this.keydownHandlers[e.key]?.call(this,e,i)}keydownHandlers={ArrowDown:this.handleArrowKey,ArrowUp:this.handleArrowKey,Escape:this.handleEscapeKey,Enter:this.handleActivationKey," ":this.handleActivationKey,Tab:this.handleTabKey};handleArrowKey(e,i){e.preventDefault(),e.stopPropagation();let r=e.key==="ArrowDown"?1:-1;if(e.altKey){this.handleModifiedArrow(r,i);return}this.moveActive(r,s=>i.onOpen(s))}handleModifiedArrow(e,i){e===1&&!i.isOpen&&i.onOpen(),e===-1&&i.isOpen&&i.onClose("arrow")}handleEscapeKey(e,i){e.preventDefault(),i.isOpen?i.onClose("escape"):i.onEscapeWhenClosed?.()}handleActivationKey(e,i){if(!(e.key===" "&&!i.canUseSpace)){if(!i.isOpen&&i.enterWhenClosed==="open"){e.preventDefault(),i.onOpen();return}if(i.isOpen){if(this.hasActiveOption()){e.preventDefault(),i.onSelectActive();return}e.key==="Enter"&&i.enterWithoutActive==="close"&&(e.preventDefault(),i.onClose("enter"))}}}handleTabKey(e,i){i.isOpen&&(this.hasActiveOption()&&i.closesOnTab?i.onSelectActive():i.onClose("tab"))}hasActiveOption(){return this.visualFocus&&!!this.getVisibleOptions()[this.activeIndex]}syncPopoverPosition(){this.popoverController.sync()}shouldDismissFocus(e){return tt(this.config.getAnchor(),this.popoverController.getFloatingElement(),e)}shouldDismissPointer(e){return Ke(this.config.getAnchor(),this.popoverController.getFloatingElement(),e)}destroy(){this.popoverController.destroy()}};var ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Tc,Sc,Ec;function yD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Rc(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Rc(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:_D(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function _D(t){var e=xD(t,"string");return typeof e=="symbol"?e:e+""}function xD(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rc(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function wD(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Cc,Ic=class extends Ac{static{({e:[lc,uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Tc,Sc,Ec,ac],c:[Cc,sc]}=yD(this,[SD("rui-combobox")],[[jt({...Ie,defaultValue:[]}),0,"value"],[jt({type:String,defaultValue:""}),0,"label"],[jt({type:String,defaultValue:""}),0,"placeholder"],[[jt({type:Boolean,reflect:!0,defaultValue:!1}),TD({selector:"[data-combobox-clear]",prop:"disabled"})],0,"disabled"],[jt({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[jt({type:Boolean,attribute:"should-close-on-select"}),0,"shouldCloseOnSelect"],[jt({type:String,attribute:"trigger-kind",reflect:!0,defaultValue:"input"}),0,"triggerKind"],[ED({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[AD({ref:"root"}),0,"rootTarget"],[RD(["value","label","placeholder","disabled","triggerKind","selectionMode","shouldCloseOnSelect"]),2,"onPropsUpdated"],[Pe({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[Pe({ref:"root",type:"input"}),2,"onRootInput"],[Pe({ref:"root",type:"keydown",options:{capture:!0}}),2,"onRootKeydown"],[Pe({selector:"[data-combobox-trigger]",type:"click"}),2,"onTriggerClick"],[Pe({selector:'[data-combobox-listbox] [role="option"]',type:"pointerover"}),2,"onOptionPointerOver"],[Pe({selector:'[data-combobox-listbox] [role="option"]',type:"mousedown"}),2,"onOptionMouseDown"],[Pe({selector:'[data-combobox-listbox] [role="option"]',type:"click"}),2,"onOptionClick"],[Pe({selector:"[data-combobox-value] rui-tag-group",type:"rui-remove"}),2,"onTagRemove"],[Pe({selector:"[data-combobox-clear]",type:"click"}),2,"onClearClick"],[Pe({ref:"root",type:"focusout"}),2,"onFocusOut"],[Pe({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"]],0,void 0,Ac))}constructor(...e){super(...e),Ec(this)}value=(ac(this),lc(this));label=(uc(this),cc(this));placeholder=(dc(this),hc(this));disabled=(pc(this),fc(this));selectionMode=(mc(this),gc(this));shouldCloseOnSelect=(bc(this),vc(this));triggerKind=(yc(this),_c(this));changeEvent=(xc(this),wc(this));open=(Tc(this),!1);uid=re("rui-combobox");collection=new Jt({getRoot:()=>this,getSelectionMode:()=>this.selectionMode,getValue:()=>this.value,setValue:e=>{this.value=e},getPopup:()=>this.getListboxPopup(),tagGroupSelector:"[data-combobox-value] rui-tag-group"});listboxBehavior=new Zt({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.collection.getOptions(),getActiveDescendantHost:()=>this.getInput(),getOptionIdPrefix:()=>`${this.uid}-option`});rootTarget=Sc(this);get listboxId(){return`${this.uid}-list`}get inputId(){return`${this.uid}-input`}isMultiple(){return this.selectionMode==="multiple"}closesOnSelect(){return this.shouldCloseOnSelect??!this.isMultiple()}getInput(){return this.querySelector("[data-combobox-input]")}getTrigger(){return this.querySelector("[data-combobox-trigger]")}getClear(){return this.querySelector("[data-combobox-clear]")}getListboxPopup(){return this.querySelector("[data-combobox-listbox]")}ensureOptionIds(){this.listboxBehavior.ensureOptionIds()}getAccessibleName(){return Vi(this)?.textContent?.trim()||this.label||"Suggestions"}isComboboxInput(e){return e instanceof HTMLElement&&e.localName==="input"&&e.hasAttribute("data-combobox-input")}syncLabel(){let e=this.getInput();qe(this,e,{controlId:this.inputId,label:this.label,labelId:`${this.uid}-label`})}syncTrigger(){let e=this.getTrigger(),i=this.collection.getListbox();!e||!i||(e.setAttribute("aria-expanded",String(this.open)),e.setAttribute("aria-controls",i.id||this.listboxId),e.tabIndex=-1,this.disabled&&(e.disabled=!0))}syncInput(){let e=this.getInput(),i=this.collection.getListbox(),r=this.getListboxPopup();!e||!i||(e.id||(e.id=this.inputId),i.id||(i.id=this.listboxId),e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",String(this.open)),e.setAttribute("aria-controls",this.listboxId),i.setAttribute("aria-label",this.getAccessibleName()),this.collection.syncMultiselectable(i),r&&(r.removeAttribute("role"),r.removeAttribute("aria-label")),this.placeholder&&(e.placeholder=this.isMultiple()&&this.collection.getSelectedValues().length?"":this.placeholder),this.disabled&&(e.disabled=!0),this.syncClear(),this.syncTrigger())}syncClear(){let e=this.getClear();e&&(e.hidden=this.collection.getSelectedValues().length===0&&!(this.getInput()?.value??""))}setVisualFocusCombobox(){this.listboxBehavior.clearActiveOption(),this.collection.syncOptionSelection()}setOpen(e,i={}){let r=i.activate??"none";this.open=e;let s=this.getInput(),d=this.getListboxPopup();if(!(!s||!d)){if(s.setAttribute("aria-expanded",String(e)),d.toggleAttribute("hidden",!e),this.syncTrigger(),!e){this.listboxBehavior.clearActiveOption(),this.listboxBehavior.syncPopoverPosition();return}if(this.ensureOptionIds(),this.listboxBehavior.syncPopoverPosition(),r==="first"){let h=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(h.length?0:-1);return}if(r==="last"){let h=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(h.length?h.length-1:-1);return}this.listboxBehavior.clearActiveOption()}}getAutocomplete(){return this.querySelector("rui-autocomplete")}syncAutocompleteFilter(){let e=this.getAutocomplete();if(e){e.syncFilter();return}let i=this.getInput()?.value??"";for(let r of this.collection.getOptions()){let s=fr(Pt(r),i,"base");r.hidden=i.trim()!==""&&!s}}showAllOptions(){for(let e of this.collection.getOptions())e.hidden=!1}syncFilter(){this.syncAutocompleteFilter()}select(e){if(!this.collection.isSelectableOption(e))return;let i=Ce(e),r=Pt(e)||i;this.collection.toggleValue(i);let s=this.getInput();s&&(s.value=this.isMultiple()?"":r),this.collection.syncTagGroup(),this.syncInput(),this.collection.syncOptionSelection(),this.changeEvent.emit({value:this.value}),this.closesOnSelect()&&this.setOpen(!1),this.syncFilter(),s?.focus()}syncFromValue(){let e=this.getInput();if(!e)return;if(this.isMultiple()){e.value="";return}let i=this.collection.getSelectedValues()[0]??"";e.value=i?this.collection.labelForValue(i):""}removeSelectedValue(e){this.collection.removeValue(e)&&(this.collection.syncTagGroup(),this.syncInput(),this.collection.syncOptionSelection(),this.changeEvent.emit({value:this.value}),this.getInput()?.focus())}clearSelection(){let e=this.getInput(),i=this.value.length>0,r=!!e?.value;this.collection.clearValues(),e&&(e.value=""),this.syncFilter(),this.syncInput(),this.collection.syncTagGroup(),this.collection.syncOptionSelection(),i&&this.changeEvent.emit({value:[]}),(r||i)&&e?.focus()}initialize(){this.ensureOptionIds(),this.syncLabel(),this.syncInput(),this.collection.syncListboxHost(),this.syncFromValue(),this.collection.syncOptionSelection(),this.collection.syncTagGroup(),this.setOpen(!1)}onConnected(){this.initialize()}disconnectedCallback(){this.listboxBehavior.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.syncLabel(),this.syncInput(),this.collection.syncListboxHost(),this.syncFromValue(),this.collection.syncOptionSelection(),this.collection.syncTagGroup()}onRootFocusIn(e){this.triggerKind!=="focus"||!this.isComboboxInput(e.target)||e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||(this.syncFilter(),this.setOpen(!0),this.setVisualFocusCombobox())}onRootInput(e){if(!this.isComboboxInput(e.target))return;let i=e.target;this.syncFilter();let r=i.value.trim()!=="",s=this.listboxBehavior.getVisibleOptions().length>0;r&&s&&(this.open||this.triggerKind!=="manual")?this.setOpen(!0):!r&&this.triggerKind==="focus"?this.setOpen(!0):(!r||!s)&&this.setOpen(!1),this.setVisualFocusCombobox()}onRootKeydown(e){this.isComboboxInput(e.target)&&this.handleInputKeydown(e)}handleInputKeydown(e){if(e.key==="Home"){let i=this.getInput();if(!i)return;e.preventDefault(),i.setSelectionRange(0,0),this.setVisualFocusCombobox();return}if(e.key==="End"){let i=this.getInput();if(!i)return;e.preventDefault();let r=i.value.length;i.setSelectionRange(r,r),this.setVisualFocusCombobox();return}(e.key==="ArrowDown"||e.key==="ArrowUp")&&(this.syncFilter(),this.listboxBehavior.getVisibleOptions().length||this.showAllOptions()),this.listboxBehavior.handleKeydown(e,{isOpen:this.open,canUseSpace:!1,closesOnTab:!0,enterWhenClosed:"ignore",enterWithoutActive:"close",onOpen:(i="none")=>{this.syncFilter(),this.setOpen(!0,{activate:i})},onClose:()=>this.setOpen(!1),onSelectActive:()=>{let i=this.listboxBehavior.getVisibleOptions()[this.listboxBehavior.activeOptionIndex];i&&this.select(i)},onEscapeWhenClosed:()=>{let i=this.getInput();i&&i.value&&(i.value="",this.value=[],this.changeEvent.emit({value:[]}),this.syncFilter())}})}onTriggerClick(e){e.preventDefault();let i=this.getInput();!i||i.disabled||(this.open?this.setOpen(!1):(this.syncFilter(),this.setOpen(!0),this.setVisualFocusCombobox()),i.focus())}onOptionPointerOver(e){if(!this.open)return;let i=this.collection.findOption(e.target);if(!this.collection.isSelectableOption(i))return;let s=this.listboxBehavior.getVisibleOptions().indexOf(i);s>=0&&this.listboxBehavior.setActiveOption(s)}onOptionMouseDown(e){e.preventDefault()}onOptionClick(e){let i=this.collection.findOption(e.target);i&&this.select(i)}onTagRemove(e){let i=e.detail;i?.value&&this.removeSelectedValue(i.value)}onClearClick(e){e.preventDefault(),e.stopPropagation(),this.clearSelection()}onFocusOut(e){this.listboxBehavior.shouldDismissFocus(e.relatedTarget)&&this.setOpen(!1)}onDocumentPointerDown(e){this.open&&this.listboxBehavior.shouldDismissPointer(e.target)&&this.setOpen(!1)}static{sc()}};import{jsx as ae,jsxs as io}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Hc,bindTo as kD,customElement as MD,event as LD,onEvent as Yc,onUpdated as PD,prop as ti}from"@ecopages/radiant";function ue(t,e){t.forEach((i,r)=>{let s=r===e?0:-1;i.tabIndex!==s&&(i.tabIndex=s)})}function ei(t,e){if(!t.length)return null;let i=Math.max(0,Math.min(t.length-1,e));return ue(t,i),t[i]?.focus(),t[i]??null}function ID(t,e){return t==="Home"?"first":t==="End"?"last":e==="horizontal"?t==="ArrowRight"?"next":t==="ArrowLeft"?"prev":null:t==="ArrowDown"?"next":t==="ArrowUp"?"prev":null}function de(t){let{items:e,current:i,key:r,orientation:s="horizontal",wrap:d=!0}=t;if(!e.length||!i)return{handled:!1};let h=e.indexOf(i);if(h<0)return{handled:!1};let a=ID(r,s);if(!a)return{handled:!1};let E=h;a==="first"?E=0:a==="last"?E=e.length-1:a==="next"?E=d?(h+1)%e.length:Math.min(e.length-1,h+1):E=d?(h-1+e.length)%e.length:Math.max(0,h-1);let A=ei(e,E);return A?{handled:!0,index:E,item:A}:{handled:!1}}var Dc,Oc,Vc,kc,Mc,Lc,Pc,jc,Fc,Bc,Uc,zc,qc,Kc,$c,Gc;function CD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Wc(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Wc(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:DD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return VD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function DD(t){var e=OD(t,"string");return typeof e=="symbol"?e:e+""}function OD(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wc(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function VD(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Xc,Nc=class extends Hc{static{({e:[Vc,kc,Mc,Lc,Pc,jc,Fc,Bc,Uc,zc,qc,Kc,$c,Gc,Dc],c:[Xc,Oc]}=CD(this,[MD("rui-listbox")],[[ti({...Ie,defaultValue:[]}),0,"value"],[ti({type:String,defaultValue:""}),0,"label"],[ti({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[[ti({type:String,attribute:"selection-mode",defaultValue:"single"}),kD({selector:'[role="listbox"]',attr:"aria-multiselectable",map:e=>e==="multiple"?"true":void 0})],0,"selectionMode"],[ti({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[ti({type:Boolean,reflect:!0}),0,"bordered"],[LD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[PD(["value","label","disabled","embedded","selectionMode"]),2,"onPropsUpdated"],[Yc({selector:'[role="option"]',type:"click"}),2,"onOptionClick"],[Yc({selector:'[role="option"]',type:"keydown"}),2,"onOptionKeydown"]],0,void 0,Hc))}value=(Dc(this),Vc(this));label=(kc(this),Mc(this));disabled=(Lc(this),Pc(this));selectionMode=(jc(this),Fc(this));embedded=(Bc(this),Uc(this));bordered=(zc(this),qc(this));changeEvent=(Kc(this),$c(this));uid=(Gc(this),re("rui-listbox"));onConnected(){this.syncLabel(),this.sync()}onPropsUpdated(){this.syncLabel(),this.sync()}getOptions(){return Array.from(this.querySelectorAll('[role="option"]'))}syncLabel(){if(this.embedded)return;let e=this.querySelector('[role="listbox"]');e&&(e.id||(e.id=`${this.uid}-list`),qe(this,e,{controlId:e.id,label:this.label,labelId:`${this.uid}-label`}))}getSelectedValues(){return this.value}setSelectedValues(e){this.value=e}tabIndexFor(e,i){return this.embedded?-1:e===i?0:-1}sync(){let e=this.getOptions(),i=new Set(this.getSelectedValues()),r=e.find(s=>i.has(Ce(s)))??e[0];for(let s of e){let d=i.has(Ce(s));s.setAttribute("aria-selected",String(d)),s.tabIndex=this.tabIndexFor(s,r)}}select(e){if(this.disabled||e.getAttribute("aria-disabled")==="true")return;let i=Ce(e);if(this.selectionMode==="multiple"){let r=new Set(this.getSelectedValues());r.has(i)?r.delete(i):r.add(i),this.setSelectedValues([...r])}else this.setSelectedValues([i]);this.sync(),this.changeEvent.emit({value:this.value}),e.focus()}onOptionClick(e){if(this.embedded)return;let i=e.target.closest('[role="option"]');i&&this.contains(i)&&this.select(i)}onOptionKeydown(e){if(this.embedded)return;let i=this.getOptions(),r=e.target.closest('[role="option"]');if(!r)return;if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.select(r);return}let s=de({items:i,current:r,key:e.key,orientation:"vertical"});if(s.handled){if(e.preventDefault(),this.selectionMode==="multiple"){s.item.focus();return}this.select(s.item)}}static{Oc()}};import{jsx as Ft,jsxs as jD}from"@ecopages/jsx/jsx-runtime";function eo({value:t,label:e,children:i,class:r,disabled:s,...d}){return Ft("div",{...d,class:j("rui-listbox__option",r),role:"option","data-value":t,"data-label":e,"aria-disabled":s?"true":void 0,tabindex:-1,children:i})}function Qc({children:t,class:e,...i}){return Ft("span",{...i,"data-listbox-option-indicator":!0,"aria-hidden":"true",class:j("rui-listbox__option-indicator",e),children:t??Ft(wi,{})})}function FD(t,e){return e??!t}function BD({bordered:t,children:e,disabled:i,embedded:r,label:s,selectionMode:d="single"}){return Ft("div",{class:j("rui-listbox",t&&"rui-listbox--bordered"),role:"listbox","data-rui-control":r?void 0:!0,"data-rui-control-type":r?void 0:"text","aria-label":s||void 0,"aria-disabled":i?"true":void 0,"aria-multiselectable":d==="multiple"?"true":void 0,children:e})}function ii({options:t,children:e,value:i,embedded:r,bordered:s,label:d,disabled:h,selectionMode:a="single",...E}){let A=FD(r,s),S=et(i),I=new Set(S);return Ft("rui-listbox",{...E,value:S,embedded:r,bordered:s,label:d,disabled:h,selectionMode:a,children:Ft(BD,{bordered:A,disabled:h,embedded:r,label:d,selectionMode:a,children:t!=null?t.map(T=>jD(eo,{value:T.value,label:typeof T.label=="string"?T.label:void 0,disabled:T.disabled,"aria-selected":I.has(T.value)?"true":void 0,children:[T.label,a==="multiple"?Ft(Qc,{}):null]})):e})})}import{RadiantElement as bd,customElement as $D,event as vd,onEvent as to,onUpdated as GD,prop as ki,state as WD}from"@ecopages/radiant";var Jc,Zc,ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md;function UD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:gd(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||gd(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:zD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return KD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function zD(t){var e=qD(t,"string");return typeof e=="symbol"?e:e+""}function qD(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gd(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function KD(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var _d,yd=class extends bd{static{({e:[ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,Jc],c:[_d,Zc]}=UD(this,[$D("rui-tag-group")],[[ki({...Ie,defaultValue:[]}),0,"value"],[ki({type:String,defaultValue:""}),0,"label"],[ki({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ki({type:String,attribute:"selection-mode",defaultValue:"multiple"}),0,"selectionMode"],[ki({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[vd({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[vd({name:"rui-remove",bubbles:!0,composed:!0}),0,"removeEvent"],[WD,0,"derivedItems"],[GD(["value","label","disabled","selectionMode","embedded","derivedItems"]),2,"onPropsUpdated"],[to({selector:"[data-tag]",type:"click"}),2,"onTagClick"],[to({selector:"[data-tag-remove]",type:"click"}),2,"onRemoveClick"],[to({selector:"[data-tag]",type:"keydown"}),2,"onTagKeydown"]],0,void 0,bd))}constructor(...e){super(...e),md(this)}value=(Jc(this),ed(this));label=(td(this),id(this));disabled=(rd(this),nd(this));selectionMode=(od(this),ad(this));embedded=(sd(this),ld(this));changeEvent=(ud(this),cd(this));removeEvent=(dd(this),hd(this));uid=(pd(this),re("rui-tag-group"));derivedItems=fd(this,null);isMultiple(){return this.selectionMode==="multiple"}getSelectedValues(){return this.value}setSelectedValues(e){this.value=e}getList(){let e=this.querySelector("[data-rui-managed-list]");return e||(this.derivedItems!=null?null:this.querySelector("[data-tag-list]"))}getTags(){let e=this.getList();return e?Array.from(e.querySelectorAll("[data-tag]")):[]}getVisibleTags(){return this.getTags().filter(e=>!e.hidden&&e.getAttribute("aria-disabled")!=="true")}getTagValue(e){return e.getAttribute("data-value")||e.textContent?.trim()||""}getTagLabel(e){return e.getAttribute("data-label")||e.textContent?.trim()||""}ensureTagIds(){this.getTags().forEach((e,i)=>{e.id||(e.id=`${this.uid}-tag-${i}`)})}syncList(){let e=this.getList();e&&(e.id||(e.id=`${this.uid}-list`),e.setAttribute("role","list"),e.setAttribute("aria-label",this.label||"Tags"),this.disabled?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled"))}syncTags(){let e=new Set(this.getSelectedValues());this.getTags().forEach((r,s)=>{r.setAttribute("role","listitem");let d=this.getTagValue(r),h=e.has(d);r.setAttribute("aria-selected",String(h)),r.tabIndex=s===0?0:-1;let a=r.querySelector("[data-tag-remove]");a&&(a.type="button",a.tabIndex=-1,a.setAttribute("aria-label",`Remove ${this.getTagLabel(r)}`))})}selectTag(e){if(this.disabled||this.embedded||e.getAttribute("aria-disabled")==="true")return;let i=this.getTagValue(e);if(this.isMultiple()){let r=new Set(this.getSelectedValues());r.has(i)?r.delete(i):r.add(i),this.setSelectedValues([...r])}else this.value=[i];this.syncTags(),this.changeEvent.emit({value:this.value})}removeTag(e){let i=this.getTagValue(e),r=new Set(this.getSelectedValues());r.delete(i),this.setSelectedValues([...r]),this.syncTags(),this.removeEvent.emit({value:i}),this.changeEvent.emit({value:this.value})}initialize(){this.syncManagedList(),this.ensureTagIds(),this.syncList(),this.syncTags()}onConnected(){this.initialize()}onPropsUpdated(){this.syncManagedList(),this.syncList(),this.syncTags()}resync(){this.ensureTagIds(),this.syncList(),this.syncTags()}setItems(e){this.derivedItems=e,this.value=e.map(i=>i.value)}createManagedTag(e){let i=document.createElement("span");i.setAttribute("data-tag",""),i.setAttribute("data-value",e.value),i.setAttribute("data-label",e.label),i.className="rui-tag",i.textContent=e.label,i.setAttribute("aria-label",e.label);let r=document.createElement("button");return r.type="button",r.setAttribute("data-tag-remove",""),r.className="rui-tag__remove",r.setAttribute("aria-label",`Remove ${e.label}`),r.append(hr()),i.append(r),i}syncManagedList(){let e=this.querySelector('[data-ref="root"]');if(!e||this.derivedItems==null)return;e.querySelector("[data-tag-list]:not([data-rui-managed-list])")?.toggleAttribute("hidden",!0);let r=e.querySelector("[data-rui-managed-list]");if(this.derivedItems.length===0){r?.remove();return}r||(r=document.createElement("div"),r.setAttribute("data-tag-list",""),r.setAttribute("data-rui-managed-list",""),r.className="rui-tag-group__list",e.appendChild(r)),r.replaceChildren(...this.derivedItems.map(s=>this.createManagedTag(s))),this.ensureTagIds(),this.syncList(),this.syncTags()}onTagClick(e){let i=e.target;if(i.closest("[data-tag-remove]"))return;let r=i.closest("[data-tag]");r&&this.contains(r)&&this.selectTag(r)}onRemoveClick(e){e.stopPropagation();let r=e.target.closest("[data-tag]");r&&this.contains(r)&&this.removeTag(r)}onTagKeydown(e){let i=this.getVisibleTags(),r=e.target.closest("[data-tag]");if(!r)return;if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.embedded||this.selectTag(r);return}if(e.key==="Backspace"||e.key==="Delete"){r.querySelector("[data-tag-remove]")&&(e.preventDefault(),this.removeTag(r));return}de({items:i,current:r,key:e.key,orientation:"horizontal"}).handled&&e.preventDefault()}static{Zc()}};import{jsx as je,jsxs as HD}from"@ecopages/jsx/jsx-runtime";function wd({children:t,class:e,...i}){return je("div",{...i,"data-tag-list":!0,class:j("rui-tag-group__list",e),children:t})}function Td({value:t,label:e,children:i,class:r,disabled:s,aria:d,...h}){return HD("span",{...h,"data-tag":!0,"data-value":t,"data-label":e,class:j("rui-tag",r),aria:ne(d,e),"aria-disabled":s?"true":void 0,children:[i,je(Sd,{})]})}function Sd({children:t,class:e,aria:i,...r}){return je("button",{...r,aria:ne(i,"Remove"),type:"button","data-tag-remove":!0,class:j("rui-tag__remove",e),children:t??je(Re,{})})}function xd({children:t}){return je("div",{class:"rui-tag-group","data-ref":"root",children:t})}function Mi({tags:t,children:e,value:i,...r}){return t!=null?je("rui-tag-group",{...r,value:i,children:je(xd,{children:je(wd,{children:t.map(s=>je(Td,{value:s.value,label:typeof s.label=="string"?s.label:void 0,disabled:s.disabled,children:s.label}))})})}):je("rui-tag-group",{...r,value:i,children:je(xd,{children:e})})}function Rd({children:t,class:e,...i}){return ae("div",{...i,class:j("rui-combobox__control",e),children:t})}function Ad({placeholder:t,disabled:e,class:i,...r}){return ae("input",{...r,type:"text","data-combobox-input":!0,"data-autocomplete-input":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:j("rui-combobox__input",i),placeholder:t,disabled:e,autocomplete:"off"})}function Id({children:t,class:e,aria:i,disabled:r,...s}){return ae("button",{...s,aria:ne(i,"Show suggestions"),type:"button","data-combobox-trigger":!0,class:j("rui-control-toggle",e),disabled:r,tabIndex:-1,children:t??ae(Xe,{})})}function YD({children:t,class:e,aria:i,disabled:r,...s}){return ae("button",{...s,aria:ne(i,"Clear selection"),type:"button","data-combobox-clear":!0,class:j("rui-control-clear",e),disabled:r,children:t??ae(Re,{})})}function Cd({children:t,class:e,...i}){return ae("span",{...i,"data-combobox-value":!0,class:j("rui-combobox__value",e),children:t})}function Dd({children:t,class:e,...i}){return ae("div",{...i,"data-combobox-listbox":!0,class:j("rui-combobox__listbox rui-popover rui-popover--listbox rui-floating",e),children:t})}function Ed({children:t}){return ae("div",{class:"rui-combobox","data-ref":"root",children:t})}function ND({options:t,children:e,value:i,...r}){let s=et(i),d=t?.filter(a=>s.includes(a.value)).map(a=>({value:a.value,label:a.label})),h=r.selectionMode==="multiple";return t!=null?ae("rui-combobox",{...r,value:s,children:io(Ed,{children:[io(Rd,{children:[h?ae(Cd,{children:ae(Mi,{tags:d??[],label:"Selected options"})}):null,ae(Ad,{placeholder:r.placeholder,disabled:r.disabled}),ae(Id,{})]}),ae(Dd,{children:ae(vn,{children:io(gn,{children:[ae(ii,{embedded:!0,options:t,selectionMode:r.selectionMode,value:s}),ae(bn,{children:"No results found."})]})})})]})}):ae("rui-combobox",{...r,value:s,children:ae(Ed,{children:e})})}import{RadiantElement as Wd,bindTo as e1,customElement as t1,event as i1,onEvent as r1,onUpdated as n1,prop as Li}from"@ecopages/radiant";function ro(t,e){if(t.length===0)throw new RangeError("cycleValue requires at least one value");let i=e===void 0?-1:t.indexOf(e);return i===-1?t[0]:t[(i+1)%t.length]}var Od,Vd,kd,Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd,$d;function XD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Gd(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Gd(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:QD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ZD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function QD(t){var e=JD(t,"string");return typeof e=="symbol"?e:e+""}function JD(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gd(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ZD(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var o1="[data-cycle-value]",no="button[data-cycle-toggle-button]",Yd,Hd=class extends Wd{static{({e:[kd,Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd,$d,Od],c:[Yd,Vd]}=XD(this,[t1("rui-cycle-toggle")],[[Li({type:String,reflect:!0,defaultValue:""}),0,"value"],[Li({type:String,reflect:!0,defaultValue:"filled"}),0,"variant"],[Li({type:String,reflect:!0,defaultValue:"md"}),0,"size"],[Li({type:String,defaultValue:""}),0,"label"],[[Li({type:Boolean,reflect:!0,defaultValue:!1}),e1({selector:"button[data-cycle-toggle-button]",prop:"disabled"})],0,"disabled"],[i1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[n1(["value","label","disabled","size","variant"]),2,"onPropsUpdated"],[r1({selector:no,type:"click"}),2,"onButtonClick"]],0,void 0,Wd))}value=(Od(this),kd(this));variant=(Md(this),Ld(this));size=(Pd(this),jd(this));label=(Fd(this),Bd(this));disabled=(Ud(this),zd(this));changeEvent=(qd(this),Kd(this));childObserver=($d(this),null);connectedCallback(){super.connectedCallback(),this.childObserver=new MutationObserver(()=>this.resync()),this.childObserver.observe(this,{childList:!0,subtree:!0})}onConnected(){this.resync()}disconnectedCallback(){this.childObserver?.disconnect(),this.childObserver=null,super.disconnectedCallback()}onPropsUpdated(){this.resync()}resync(){let e=this.syncSelection(this.value||this.getItemValue(this.getEnabledItems()[0])||"");this.syncButtonPresentation(),this.syncButtonLabel(e)}getItems(){return Array.from(this.querySelectorAll(o1))}getEnabledItems(){return this.getItems().filter(e=>e.getAttribute("aria-disabled")!=="true")}getItemValue(e){return e?e.dataset.cycleValue??"":""}syncButtonLabel(e){let i=this.querySelector(no);if(!i)return;let r=e?.querySelector("[aria-label]")?.ariaLabel??e?.textContent?.trim();if(!this.label||!r){i.removeAttribute("aria-label");return}i.setAttribute("aria-label",`${this.label}: ${r}`)}syncButtonPresentation(){let e=this.querySelector(no);if(e){for(let i of Array.from(e.classList))i.startsWith("rui-button--")&&e.classList.remove(i);e.classList.add(`rui-button--${this.variant}`,`rui-button--${this.size}`)}}syncSelection(e){let i=this.getItems();if(!i.length)return;let r=this.getEnabledItems(),s=i.find(h=>this.getItemValue(h)===e&&r.includes(h))??r[0]??i[0],d=this.getItemValue(s);this.value=d;for(let h of i)h.hidden=h!==s;return s}cycle(){if(this.disabled)return;let i=this.getEnabledItems().map(s=>this.getItemValue(s)).filter(Boolean);if(!i.length)return;let r=ro(i,this.value||void 0);r!==this.value&&(this.syncSelection(r),this.changeEvent.emit({value:this.value}))}onButtonClick(){this.cycle()}static{Vd()}};import{jsx as Cr}from"@ecopages/jsx/jsx-runtime";function a1({id:t,children:e,class:i,disabled:r,selected:s,...d}){return Cr("span",{...d,class:j("rui-cycle-toggle__item",i),"data-cycle-value":t,hidden:s===void 0?void 0:!s,"aria-disabled":r?"true":void 0,children:e})}function Nd({children:t,variant:e="filled",size:i="md",disabled:r,class:s,...d}){return Cr("button",{...d,type:"button",class:j("rui-button","rui-cycle-toggle__button",`rui-button--${e}`,`rui-button--${i}`,s),disabled:r,"data-cycle-toggle-button":!0,children:t})}function s1({children:t,variant:e,size:i,disabled:r,...s}){return Cr("rui-cycle-toggle",{...s,variant:e,size:i,disabled:r,children:Cr(Nd,{variant:e,size:i,disabled:r,children:t})})}import{jsx as ge,jsxs as ao}from"@ecopages/jsx/jsx-runtime";var Xd={system:"System",light:"Light",dark:"Dark"},oo={xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":!0},l1={system:ao("svg",{...oo,children:[ge("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),ge("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),ge("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]}),light:ao("svg",{...oo,children:[ge("circle",{cx:"12",cy:"12",r:"4"}),ge("path",{d:"M12 2v2"}),ge("path",{d:"M12 20v2"}),ge("path",{d:"m4.93 4.93 1.41 1.41"}),ge("path",{d:"m17.66 17.66 1.41 1.41"}),ge("path",{d:"M2 12h2"}),ge("path",{d:"M20 12h2"}),ge("path",{d:"m6.34 17.66-1.41 1.41"}),ge("path",{d:"m19.07 4.93-1.41 1.41"})]}),dark:ge("svg",{...oo,children:ge("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"})})};function Qd({preference:t}){return l1[t]}function Jd({preference:t}){return Xd[t]}function u1({preference:t,showLabel:e=!0}){return ao("span",{class:"inline-flex items-center gap-inline","aria-label":e?void 0:Xd[t],children:[ge(Qd,{preference:t}),e?ge(Jd,{preference:t}):void 0]})}import{RadiantElement as Rh,bindTo as bt,customElement as b1,event as v1,onEvent as vt,onUpdated as Ah,prop as it,query as y1,state as _1}from"@ecopages/radiant";function d1(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(`(max-width: ${639}px)`).matches}function Dr(t){return t<=1||!d1()?t:1}function Or(t){if(typeof window>"u"||typeof window.matchMedia!="function")return null;let e=window.matchMedia(`(max-width: ${639}px)`);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}var ri=class{config;popoverController=null;suppressPopoverDismiss=!1;constructor(e){this.config=e}destroy(){this.popoverController?.destroy(),this.popoverController=null}suppressDismiss(){this.suppressPopoverDismiss=!0}syncPopover(){let e=this.config.getFloating();if(!e)return;e.hidden=!this.config.getOpen();let i=this.ensureController();i.updateConfig({getOpen:()=>this.config.getOpen()}),i.sync()}focusCalendarDay(){h1(this.config.getCalendar(),this.config.getFocusIso())}handleFocusOut(e,i){let r=e.relatedTarget;queueMicrotask(()=>{if(this.suppressPopoverDismiss){this.suppressPopoverDismiss=!1;return}if(!this.config.getOpen())return;let s=this.config.getFloating();if(!s)return;let d=r instanceof Node?r:document.activeElement;tt(this.config.getHost(),s,d)&&i()})}ensureController(){return this.popoverController||(this.popoverController=new ce({getAnchor:this.config.getAnchor,getFloating:this.config.getFloating,getOpen:this.config.getOpen,getPlacement:()=>"bottom-start",gap:4,portal:!1})),this.popoverController}};function h1(t,e){requestAnimationFrame(()=>{if(!t)return;((e?t.querySelector(`[data-calendar-day][data-iso="${e}"]:not(:disabled)`):null)??t.querySelector('[data-calendar-day][tabindex="0"]:not(:disabled), [data-calendar-day]:not(:disabled)'))?.focus()})}var Zd,eh,th,ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,bh,vh,yh,_h,xh,wh,Th,Sh;function p1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Eh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Eh(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:f1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return g1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function f1(t){var e=m1(t,"string");return typeof e=="symbol"?e:e+""}function m1(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Eh(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function g1(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Ch,Ih=class extends Rh{static{({e:[th,ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,bh,vh,yh,_h,xh,wh,Th,Sh,Zd],c:[Ch,eh]}=p1(this,[b1("rui-date-field")],[[[it({type:String,reflect:!0,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"value"},{selector:"[data-date-field-calendar]",attr:"value"}])],0,"value"],[[it({type:String,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"min"},{selector:"[data-date-field-calendar]",attr:"min"}])],0,"min"],[[it({type:String,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"max"},{selector:"[data-date-field-calendar]",attr:"max"}])],0,"max"],[[it({type:Boolean,reflect:!0,defaultValue:!1}),bt([{selector:"[data-date-field-input]",bool:"disabled"},{selector:"[data-date-field-calendar]",bool:"disabled"}])],0,"disabled"],[[it({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),bt({selector:"[data-date-field-input]",bool:"read-only"})],0,"readOnly"],[it({type:String,defaultValue:""}),0,"label"],[[it({type:String,defaultValue:""}),bt({selector:"[data-date-field-input]",attr:"name"})],0,"name"],[[it({type:String,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"locale"},{selector:"[data-date-field-calendar]",attr:"locale"}])],0,"locale"],[it({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[v1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[_1,bt({selector:"[data-date-field-trigger]",attr:"aria-expanded"})],0,"open"],[y1({ref:"popover"}),0,"popoverTarget"],[Ah(["value","min","max","label","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[Ah(["open"]),2,"onOpenUpdated"],[vt({selector:"[data-date-field-input]",type:"rui-change"}),2,"onDateInputChange"],[vt({selector:"[data-date-field-input]",type:"rui-form-reset"}),2,"onDateInputReset"],[vt({selector:"[data-date-field-input], [data-date-field-trigger], [data-date-field-popover]",type:"focusout"}),2,"onRootFocusOut"],[vt({ref:"trigger",type:"pointerdown"}),2,"onTriggerPointerDown"],[vt({ref:"trigger",type:"click"}),2,"onTriggerClick"],[vt({selector:"[data-date-field-popover]",type:"mousedown"}),2,"onPopoverMouseDown"],[vt({selector:"[data-date-field-calendar]",type:"rui-change"}),2,"onCalendarChange"],[vt({selector:"[data-date-field-input], [data-date-field-trigger], [data-date-field-calendar]",type:"keydown"}),2,"onRootKeydown"]],0,void 0,Rh))}value=(Zd(this),th(this));min=(ih(this),rh(this));max=(nh(this),oh(this));disabled=(ah(this),sh(this));readOnly=(lh(this),uh(this));label=(ch(this),dh(this));name=(hh(this),ph(this));locale=(fh(this),mh(this));visibleMonths=(gh(this),bh(this));changeEvent=(vh(this),yh(this));open=(_h(this),xh(this,!1));uid=(wh(this),re("rui-date-field"));calendarPopover=new ri({getHost:()=>this,getAnchor:()=>this.getToggle()?.parentElement??this,getFloating:()=>this.popoverTarget,getOpen:()=>this.open,getCalendar:()=>this.getCalendar(),getFocusIso:()=>this.isoValue||void 0});disposeMobileLayoutListener=null;popoverTarget=Th(this);onMediaChange=(Sh(this),()=>{this.syncCalendar(),this.open&&this.calendarPopover.syncPopover()});get isoValue(){return this.value??""}get inputId(){return`${this.uid}-input`}getDateInput(){return this.querySelector("[data-date-field-input]")}getToggle(){return this.querySelector("[data-date-field-trigger]")}getCalendar(){return this.querySelector("[data-date-field-calendar]")}syncLabel(){let e=this.getDateInput();qe(this,e,{controlId:this.inputId,label:this.label,labelId:`${this.uid}-label`})}syncInput(){let e=this.getDateInput();e?.id||e?.setAttribute("id",this.inputId)}syncToggle(){let e=this.getToggle();e&&(e.disabled=this.disabled||this.readOnly)}commitValue(e){e!==this.isoValue&&(this.value=e,this.changeEvent.emit({value:e}))}syncCalendar(){let e=this.getCalendar();e&&(e.setAttribute("selection-mode","single"),e.setAttribute("visible-months",String(Dr(this.visibleMonths))))}initialize(){this.syncLabel(),this.syncInput(),this.syncToggle(),this.syncCalendar(),this.setOpen(!1)}setOpen(e){this.open=e,queueMicrotask(()=>{this.calendarPopover.syncPopover(),e&&this.calendarPopover.focusCalendarDay()})}onConnected(){this.disposeMobileLayoutListener=Or(this.onMediaChange),this.initialize()}disconnectedCallback(){this.disposeMobileLayoutListener?.(),this.disposeMobileLayoutListener=null,this.calendarPopover.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.syncLabel(),this.syncInput(),this.syncToggle(),this.syncCalendar()}onOpenUpdated(){this.syncToggle(),this.calendarPopover.syncPopover()}onDateInputChange(e){let i=e.target;if(!(i instanceof HTMLElement)||!i.matches("[data-date-field-input]"))return;let r=e.detail;this.commitValue(r?.value??"")}onDateInputReset(){let e=this.getDateInput(),i=e&&Reflect.get(e,"value");this.value=typeof i=="string"?i:""}onRootFocusOut(e){this.calendarPopover.handleFocusOut(e,()=>this.setOpen(!1))}onTriggerPointerDown(){this.calendarPopover.suppressDismiss()}onTriggerClick(){this.disabled||this.readOnly||this.setOpen(!this.open)}onPopoverMouseDown(e){e.preventDefault()}onCalendarChange(e){let i=e.target;if(!(i instanceof HTMLElement)||!i.matches("[data-date-field-calendar]"))return;let r=e.detail;r?.value&&(this.commitValue(r.value),this.setOpen(!1))}onRootKeydown(e){e.key==="Escape"&&this.open&&(e.preventDefault(),this.setOpen(!1))}static{eh()}};import{Fragment as D1,jsx as De,jsxs as rp}from"@ecopages/jsx/jsx-runtime";import{jsx as Vr}from"@ecopages/jsx/jsx-runtime";import{customElement as E1,event as R1,onEvent as ni,onUpdated as Jh,prop as oi,registerSsrPreparationCallback as A1,state as Zh}from"@ecopages/radiant";import{FormAssociatedElement as ep}from"@ecopages/radiant/form-associated-element";function Dh(t,e){let i=t.type,r=yr(t),s=!e.useTextboxRole,d=s?"spinbutton":"textbox",h=!e.disabled&&!e.readOnly,a=vr(i,e.segments);return{ariaLabel:Pn(i,e.locale),ariaReadonly:e.readOnly||void 0,ariaRole:d,ariaValuemax:s?a.max:void 0,ariaValuemin:s?a.min:void 0,ariaValuenow:s&&r!=null?r:void 0,ariaValuetext:s?Ti(t):void 0,className:j("rui-date-input__segment",t.isPlaceholder&&"rui-date-input__segment--placeholder"),dataRuiFocusManaged:!0,contenteditable:h?"true":void 0,inputmode:h?"numeric":void 0,suppresscontenteditablewarning:h?"true":void 0,tabindex:e.disabled?void 0:0}}var Oh,Vh,kh,Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,$h,Gh,Wh,Hh,Yh,Nh,Xh;function x1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Qh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Qh(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:w1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return S1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function w1(t){var e=T1(t,"string");return typeof e=="symbol"?e:e+""}function T1(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qh(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function S1(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}function I1(){return typeof navigator>"u"?!1:/iPad|iPhone|iPod/.test(navigator.userAgent)}var ip,tp=class extends ep{static{({e:[kh,Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,$h,Gh,Wh,Hh,Yh,Nh,Xh,Oh],c:[ip,Vh]}=x1(this,[E1("rui-date-input")],[[oi({type:String,reflect:!0,defaultValue:""}),0,"value"],[oi({type:String,defaultValue:""}),0,"min"],[oi({type:String,defaultValue:""}),0,"max"],[oi({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[oi({type:String,defaultValue:""}),0,"label"],[oi({type:String,defaultValue:""}),0,"locale"],[R1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Zh,0,"segments"],[Zh,0,"focusedPart"],[Jh(["value","locale"]),2,"syncSegmentsFromValue"],[Jh("label"),2,"syncGroupLabel"],[ni({selector:'[data-ref="root"]',type:"focusin"}),2,"onGroupFocusIn"],[ni({selector:"[data-date-segment]",type:"focusin"}),2,"onSegmentFocusIn"],[ni({selector:"[data-date-segment]",type:"focusout"}),2,"onSegmentFocusOut"],[ni({selector:"[data-date-segment]",type:"keydown"}),2,"onSegmentKeyDown"],[ni({selector:"[data-date-segment]",type:"beforeinput"}),2,"onSegmentBeforeInput"],[ni({selector:"[data-date-segment]",type:"pointerdown"}),2,"onSegmentPointerDown"]],0,void 0,ep))}value=(Oh(this),kh(this));min=(Mh(this),Lh(this));max=(Ph(this),jh(this));readOnly=(Fh(this),Bh(this));label=(Uh(this),zh(this));locale=(qh(this),Kh(this));changeEvent=($h(this),Gh(this));segments=(Wh(this),Hh(this,[]));focusedPart=(Yh(this),Nh(this,null));uid=(Xh(this),re("rui-date-input"));buffer="";useTextboxRole=I1();pendingFocus=null;get resolvedLocale(){return ht(this.locale)}get isoValue(){return this.value??""}syncSegmentsFromValue(){this.segments=br(Dt(this.isoValue),this.resolvedLocale),this.buffer=""}get displaySegments(){return this.segments.length>0?this.segments:br(Dt(this.isoValue),this.resolvedLocale)}constructor(){super(),A1(this,()=>this.syncSegmentsFromValue())}getSegmentElement(e){return this.querySelector(`[data-date-segment][data-type="${e}"]`)}setFocusedPart(e,i="leave"){let r=this.focusedPart;e===r&&i==="leave"||(this.buffer="",(r!=null||i==="blur")&&this.commit(i),this.focusedPart=e)}focusPart(e){this.setFocusedPart(e),this.pendingFocus=e}updated(e){super.updated(e),this.pendingFocus=null;let i=this.focusedPart;if(!i||!(e.has("focusedPart")||e.has("segments"))||!this.matches(":focus-within"))return;let r=this.getSegmentElement(i);r&&(document.activeElement!==r&&r.focus(),document.activeElement===r&&window.getSelection()?.collapse(r,0))}commit(e){if(e==="edit"&&this.buffer)return;let i=Vn(this.segments,{min:this.min,max:this.max});switch(i.kind){case"partial-year":e!=="edit"&&this.syncSegmentsFromValue();return;case"incomplete":e==="blur"&&this.syncSegmentsFromValue();return;case"out-of-range":this.syncSegmentsFromValue();return;case"empty":this.publish("");return;case"date":this.publish(i.iso)}}publish(e){if(e===this.isoValue){this.syncSegmentsFromValue();return}this.value=e,this.changeEvent.emit({value:e})}partFromTarget(e){if(!(e instanceof HTMLElement))return null;let r=e.closest("[data-date-segment]")?.getAttribute("data-type");return r==="month"||r==="day"||r==="year"?r:null}handleDigit(e,i){this.setFocusedPart(e);let r=Fn(this.segments,e,i,this.buffer);if(this.segments=r.segments,this.buffer=r.enteredKeys,r.focusNext){this.focusPart(Qt(this.segments,e,1));return}this.commit("edit")}handleBackspace(e){this.setFocusedPart(e);let i=Un(this.segments,e);if(i.kind==="focus-previous"){this.focusPart(Qt(this.segments,e,-1));return}this.segments=i.segments,this.buffer=i.enteredKeys,this.commit("edit")}handleIncrement(e,i){this.setFocusedPart(e),this.buffer="",this.segments=jn(this.segments,e,i),this.commit("edit")}onConnected(){this.syncSegmentsFromValue(),this.syncGroupLabel()}formValue(){return this.name?this.isoValue:null}formState(){return this.value}restoreFormState(e){this.value=typeof e=="string"?e:"",this.syncSegmentsFromValue()}formResetCallback(){super.formResetCallback(),this.dispatchEvent(new Event("rui-form-reset",{bubbles:!0}))}syncGroupLabel(){let e=this.querySelector('[data-ref="root"]');if(!e)return;e.id||(e.id=`${this.uid}-group`);let i=this.label||this.getAttribute("aria-label")||"";i?e.setAttribute("aria-label",i):e.removeAttribute("aria-label")}onGroupFocusIn(e){this.partFromTarget(e.target)||this.focusPart(Bn(this.segments))}onSegmentFocusIn(e){let i=this.partFromTarget(e.target);i&&(this.pendingFocus&&this.pendingFocus!==i||this.setFocusedPart(i))}onSegmentFocusOut(){queueMicrotask(()=>{this.matches(":focus-within")||this.setFocusedPart(null,"blur")})}onSegmentKeyDown(e){let i=this.partFromTarget(e.target);if(!(!i||this.effectiveDisabled||this.readOnly)){if(e.key==="ArrowLeft"){e.preventDefault(),this.focusPart(Qt(this.segments,i,-1));return}if(e.key==="ArrowRight"){e.preventDefault(),this.focusPart(Qt(this.segments,i,1));return}if(e.key==="ArrowUp"){e.preventDefault(),this.handleIncrement(i,1);return}if(e.key==="ArrowDown"){e.preventDefault(),this.handleIncrement(i,-1);return}(e.key==="Backspace"||e.key==="Delete")&&(e.preventDefault(),e.stopPropagation(),this.handleBackspace(i))}}onSegmentBeforeInput(e){let i=this.partFromTarget(e.target);if(!(!i||this.effectiveDisabled||this.readOnly))switch(e.preventDefault(),e.inputType){case"deleteContentBackward":case"deleteContentForward":this.handleBackspace(i);break;default:e.data!=null&&this.handleDigit(i,e.data);break}}onSegmentPointerDown(e){e.stopPropagation()}renderSegment(e,i){if(!e.editable)return Vr("span",{class:"rui-date-input__literal","data-type":"literal","aria-hidden":"true",children:e.value},`literal-${i}`);let r=e.type,s=this.focusedPart===r,d=Dh(e,{disabled:this.effectiveDisabled,locale:this.resolvedLocale,readOnly:this.readOnly,segments:this.displaySegments,useTextboxRole:this.useTextboxRole});return Vr("span",{class:d.className,"data-date-segment":!0,"data-type":r,"data-placeholder":e.isPlaceholder?"true":void 0,"data-focused":s?"true":void 0,role:d.ariaRole,"aria-label":d.ariaLabel,"aria-valuemin":d.ariaValuemin,"aria-valuemax":d.ariaValuemax,"aria-valuenow":d.ariaValuenow,"aria-valuetext":d.ariaValuetext,"aria-readonly":d.ariaReadonly,"data-rui-focus-managed":d.dataRuiFocusManaged,contenteditable:d.contenteditable,suppresscontenteditablewarning:d.suppresscontenteditablewarning,spellcheck:"false",inputmode:d.inputmode,tabindex:d.tabindex,children:Ti(e)},r)}render(){return Vr("div",{class:"rui-date-input","data-ref":"root",role:"group",children:Vr("div",{class:"rui-date-input__segments",children:this.displaySegments.map((e,i)=>this.renderSegment(e,i))})})}static{Vh()}};import{jsx as C1}from"@ecopages/jsx/jsx-runtime";function ai({children:t,...e}){return C1("rui-date-input",{"data-rui-control":!0,"data-rui-control-type":"date","data-rui-aria-target":'[data-ref="root"]',...e,children:t})}function np({children:t,class:e,...i}){return De("div",{...i,class:j("rui-date-field",e),children:De("div",{class:"rui-date-field__group","data-ref":"control",children:t})})}function op({class:t,...e}){return De(ai,{...e,"data-date-field-input":!0,class:j("rui-date-field__input",t)})}function ap({children:t,class:e,aria:i,...r}){return De("button",{...r,aria:ne(i,"Open calendar"),type:"button","data-ref":"trigger","data-date-field-trigger":!0,class:j("rui-control-toggle",e),"aria-haspopup":"dialog",children:t??De(xi,{})})}function sp({children:t,class:e,...i}){return De("div",{...i,"data-ref":"popover","data-date-field-popover":!0,class:j("rui-date-field__popover rui-popover rui-floating",e),hidden:!0,role:"dialog",children:t})}function lp(t){return De(Si,{...t,"data-date-field-calendar":!0})}function O1(t){let{children:e,value:i,min:r,max:s,disabled:d,readOnly:h,label:a,name:E,locale:A}=t;return De("rui-date-field",{"data-rui-aria-target":'[data-date-field-input] [data-ref="root"]',...t,children:e??rp(D1,{children:[rp(np,{children:[De(op,{value:i,min:r,max:s,disabled:d,readOnly:h,label:a,name:E,locale:A}),De(ap,{})]}),De(sp,{children:De(lp,{})})]})})}import{RadiantElement as Fp,bindTo as rt,customElement as P1,event as j1,onEvent as yt,onUpdated as Bp,prop as $e,query as F1,state as B1}from"@ecopages/radiant";var up,cp,dp,hp,pp,fp,mp,gp,bp,vp,yp,_p,xp,wp,Tp,Sp,Ep,Rp,Ap,Ip,Cp,Dp,Op,Vp,kp,Mp,Lp,Pp;function V1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:jp(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||jp(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:k1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return L1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function k1(t){var e=M1(t,"string");return typeof e=="symbol"?e:e+""}function M1(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jp(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function L1(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var zp,Up=class extends Fp{static{({e:[dp,hp,pp,fp,mp,gp,bp,vp,yp,_p,xp,wp,Tp,Sp,Ep,Rp,Ap,Ip,Cp,Dp,Op,Vp,kp,Mp,Lp,Pp,up],c:[zp,cp]}=V1(this,[P1("rui-date-range-picker")],[[[$e({type:String,reflect:!0,defaultValue:""}),rt({selector:"[data-range-calendar]",attr:"value"})],0,"value"],[[$e({type:String,defaultValue:""}),rt([{selector:"[data-range-start]",attr:"min"},{selector:"[data-range-end]",attr:"min"},{selector:"[data-range-calendar]",attr:"min"}])],0,"min"],[[$e({type:String,defaultValue:""}),rt([{selector:"[data-range-start]",attr:"max"},{selector:"[data-range-end]",attr:"max"},{selector:"[data-range-calendar]",attr:"max"}])],0,"max"],[[$e({type:Boolean,reflect:!0,defaultValue:!1}),rt([{selector:"[data-range-start]",bool:"disabled"},{selector:"[data-range-end]",bool:"disabled"},{selector:"[data-range-calendar]",bool:"disabled"}])],0,"disabled"],[[$e({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),rt([{selector:"[data-range-start]",bool:"read-only"},{selector:"[data-range-end]",bool:"read-only"}])],0,"readOnly"],[[$e({type:String,defaultValue:""}),rt([{selector:"[data-range-start]",attr:"locale"},{selector:"[data-range-end]",attr:"locale"},{selector:"[data-range-calendar]",attr:"locale"}])],0,"locale"],[[$e({type:String,attribute:"start-name",defaultValue:""}),rt({selector:"[data-range-start]",attr:"name"})],0,"startName"],[[$e({type:String,attribute:"end-name",defaultValue:""}),rt({selector:"[data-range-end]",attr:"name"})],0,"endName"],[$e({type:String,defaultValue:""}),0,"name"],[$e({type:Number,attribute:"visible-months",defaultValue:2}),0,"visibleMonths"],[j1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[B1,rt({selector:"[data-range-trigger]",attr:"aria-expanded"})],0,"open"],[F1({ref:"popover"}),0,"popoverTarget"],[Bp(["value","min","max","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[Bp(["open"]),2,"onOpenUpdated"],[yt({selector:"[data-range-start], [data-range-end]",type:"rui-change"}),2,"onDateInputChange"],[yt({selector:"[data-range-start], [data-range-end]",type:"rui-form-reset"}),2,"onDateInputReset"],[yt({ref:"trigger",type:"pointerdown"}),2,"onTriggerPointerDown"],[yt({ref:"trigger",type:"click"}),2,"onTriggerClick"],[yt({selector:"[data-range-popover]",type:"mousedown"}),2,"onPopoverMouseDown"],[yt({selector:"[data-range-calendar]",type:"rui-change"}),2,"onCalendarChange"],[yt({selector:"[data-range-start], [data-range-end], [data-range-trigger], [data-range-calendar]",type:"keydown"}),2,"onRootKeydown"],[yt({selector:"[data-range-start], [data-range-end], [data-range-trigger], [data-range-popover]",type:"focusout"}),2,"onRootFocusOut"]],0,void 0,Fp))}value=(up(this),dp(this));min=(hp(this),pp(this));max=(fp(this),mp(this));disabled=(gp(this),bp(this));readOnly=(vp(this),yp(this));locale=(_p(this),xp(this));startName=(wp(this),Tp(this));endName=(Sp(this),Ep(this));name=(Rp(this),Ap(this));visibleMonths=(Ip(this),Cp(this));changeEvent=(Dp(this),Op(this));open=(Vp(this),kp(this,!1));calendarPopover=(Mp(this),new ri({getHost:()=>this,getAnchor:()=>this.getToggle()?.parentElement??this,getFloating:()=>this.popoverTarget,getOpen:()=>this.open,getCalendar:()=>this.getCalendar(),getFocusIso:()=>Me(this.isoValue)?.start}));disposeMobileLayoutListener=null;popoverTarget=Lp(this);onMediaChange=(Pp(this),()=>{this.syncCalendar(),this.open&&this.calendarPopover.syncPopover()});get isoValue(){return this.value??""}getStartInput(){return this.querySelector("[data-range-start]")}getEndInput(){return this.querySelector("[data-range-end]")}getToggle(){return this.querySelector("[data-range-trigger]")}getCalendar(){return this.querySelector("[data-range-calendar]")}readInputIso(e){let i=e==="start"?this.getStartInput():this.getEndInput();if(!i)return"";let r=Reflect.get(i,"value");return typeof r=="string"?r:i.getAttribute("value")??""}projectCompleteRangeOntoInputs(){let e=Me(this.isoValue);e&&(this.getStartInput()?.setAttribute("value",e.start),this.getEndInput()?.setAttribute("value",e.end))}commitRange(e,i){let r=this.min||void 0,s=this.max||void 0;if(e&&!pt(e,r,s)||i&&!pt(i,r,s))return;let d=e&&i?Nt({start:e,end:i}):"";d!==this.isoValue&&(this.value=d,this.changeEvent.emit({value:d,start:e,end:i}))}commitFromInputs(){let e=this.readInputIso("start"),i=this.readInputIso("end");if(e&&i){this.commitRange(e,i);return}this.commitRange("","")}setOpen(e){this.open=e,queueMicrotask(()=>{this.calendarPopover.syncPopover(),e&&this.calendarPopover.focusCalendarDay()})}syncToggle(){let e=this.getToggle();e&&(e.disabled=this.disabled||this.readOnly)}syncCalendar(){let e=this.getCalendar();e&&(e.setAttribute("selection-mode","range"),e.setAttribute("visible-months",String(Dr(this.visibleMonths))))}initialize(){this.projectCompleteRangeOntoInputs(),this.syncToggle(),this.syncCalendar(),this.setOpen(!1)}onConnected(){this.disposeMobileLayoutListener=Or(this.onMediaChange),this.initialize()}disconnectedCallback(){this.disposeMobileLayoutListener?.(),this.disposeMobileLayoutListener=null,this.calendarPopover.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.projectCompleteRangeOntoInputs(),this.syncToggle(),this.syncCalendar()}onOpenUpdated(){this.syncToggle(),this.calendarPopover.syncPopover()}onDateInputChange(e){let i=e.target;i instanceof HTMLElement&&i.matches("[data-range-start], [data-range-end]")&&this.commitFromInputs()}onDateInputReset(){queueMicrotask(()=>{let e=this.readInputIso("start"),i=this.readInputIso("end");this.value=e&&i?Nt({start:e,end:i}):""})}onTriggerPointerDown(){this.calendarPopover.suppressDismiss()}onTriggerClick(){this.disabled||this.readOnly||this.setOpen(!this.open)}onPopoverMouseDown(e){e.preventDefault()}onCalendarChange(e){let i=e.target;if(!(i instanceof HTMLElement)||!i.matches("[data-range-calendar]"))return;let r=e.detail;!r?.start||!r.end||(this.commitRange(r.start,r.end),this.setOpen(!1))}onRootKeydown(e){e.key==="Escape"&&this.open&&(e.preventDefault(),this.setOpen(!1))}onRootFocusOut(e){this.calendarPopover.handleFocusOut(e,()=>this.setOpen(!1))}static{cp()}};import{Fragment as U1,jsx as fe,jsxs as so}from"@ecopages/jsx/jsx-runtime";function qp({children:t,class:e,...i}){return fe("div",{...i,class:j("rui-date-range-picker",e),children:fe("div",{class:"rui-date-range-picker__group","data-ref":"control",children:t})})}function Kp({children:t,class:e,...i}){return fe("div",{...i,class:j("rui-date-range-picker__values",e),"data-ref":"values",children:t})}function $p({class:t,...e}){return fe(ai,{...e,"data-range-start":!0,class:j("rui-date-range-picker__input",t)})}function Gp({class:t,...e}){return fe(ai,{...e,"data-range-end":!0,class:j("rui-date-range-picker__input",t)})}function Wp({children:t="\u2013",class:e,...i}){return fe("span",{...i,class:j("rui-date-range-picker__separator",e),"aria-hidden":"true",children:t})}function Hp({children:t,class:e,aria:i,...r}){return fe("button",{...r,aria:ne(i,"Open calendar"),type:"button","data-ref":"trigger","data-range-trigger":!0,class:j("rui-control-toggle",e),"aria-haspopup":"dialog",children:t??fe(xi,{})})}function Yp({children:t,class:e,...i}){return fe("div",{...i,"data-ref":"popover","data-range-popover":!0,class:j("rui-date-range-picker__popover rui-popover rui-floating",e),hidden:!0,role:"dialog",children:t})}function Np(t){return fe(Si,{...t,"data-range-calendar":!0})}function z1(t){let{children:e,startLabel:i="Start date",endLabel:r="End date",value:s,min:d,max:h,disabled:a,readOnly:E,locale:A,startName:S,endName:I}=t,T=Me(s??"");return fe("rui-date-range-picker",{"data-rui-aria-targets":'[data-range-start] [data-ref="root"],[data-range-end] [data-ref="root"]',...t,children:e??so(U1,{children:[so(qp,{children:[so(Kp,{children:[fe($p,{"aria-label":i,value:T?.start,min:d,max:h,disabled:a,readOnly:E,locale:A,name:S}),fe(Wp,{}),fe(Gp,{"aria-label":r,value:T?.end,min:d,max:h,disabled:a,readOnly:E,locale:A,name:I})]}),fe(Hp,{})]}),fe(Yp,{children:fe(Np,{})})]})})}import{RadiantElement as mf,bindTo as H1,bound as Y1,customElement as N1,event as X1,onEvent as uo,onUpdated as Q1,prop as co,query as ho}from"@ecopages/radiant";var Xp="a[href], button, input, select, textarea, [tabindex]";function q1(t){return!t.hasAttribute("disabled")&&t.getAttribute("tabindex")!=="-1"}function lo(t){return Array.from(t.querySelectorAll(Xp)).filter(q1)}function kr(t){return Array.from(t.querySelectorAll(Xp)).filter(e=>!e.hasAttribute("disabled"))}function si(t){return lo(t)[0]}var Qp,Jp,Zp,ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf,pf;function K1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ff(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ff(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:$1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return W1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function $1(t){var e=G1(t,"string");return typeof e=="symbol"?e:e+""}function G1(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ff(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function W1(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var bf,gf=class extends mf{static{({e:[Zp,ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf,pf,Qp],c:[bf,Jp]}=K1(this,[N1("rui-dialog")],[[[co({type:Boolean,reflect:!0,defaultValue:!1}),H1({ref:"root",bool:"hidden",invert:!0})],0,"open"],[co({type:Boolean,reflect:!0,defaultValue:!1}),0,"alert"],[co({type:String,defaultValue:""}),0,"label"],[ho({ref:"dialog"}),0,"dialogTarget"],[ho({selector:"[data-dialog-title]"}),0,"titleTarget"],[ho({selector:"[data-dialog-body]"}),0,"descriptionTarget"],[X1({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[Y1,Q1(["open","label"])],2,"syncOpenState"],[uo({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[uo({ref:"backdrop",type:"click"}),2,"onBackdropClick"],[uo({selector:"[data-dialog-close]",type:"click"}),2,"onCloseClick"]],0,void 0,mf))}open=(Qp(this),Zp(this));alert=(ef(this),tf(this));label=(rf(this),nf(this));dialogTarget=(of(this),af(this));titleTarget=(sf(this),lf(this));descriptionTarget=(uf(this),cf(this));closeEvent=(df(this),hf(this));previouslyFocused=(pf(this),null);uid=re("rui-dialog");get titleId(){return`${this.uid}-title`}get descriptionId(){return`${this.uid}-desc`}onConnected(){this.syncOpenState()}syncOpenState(){this.dialogTarget&&(this.titleTarget?.textContent?.trim()?(this.titleTarget.id=this.titleId,this.dialogTarget.setAttribute("aria-labelledby",this.titleId),this.dialogTarget.removeAttribute("aria-label")):this.label&&(this.dialogTarget.setAttribute("aria-label",this.label),this.dialogTarget.removeAttribute("aria-labelledby")),this.descriptionTarget?(this.descriptionTarget.id=this.descriptionId,this.dialogTarget.setAttribute("aria-describedby",this.descriptionId)):this.dialogTarget.removeAttribute("aria-describedby"),this.open?(this.previouslyFocused=document.activeElement,queueMicrotask(()=>this.focusInitial())):(this.previouslyFocused?.focus?.(),this.previouslyFocused=null))}focusInitial(){(this.getFocusable()[0]??this.dialogTarget)?.focus()}getFocusable(){return this.dialogTarget?lo(this.dialogTarget):[]}dismiss(e){this.open&&(this.open=!1,this.closeEvent.emit({reason:e}))}onDocumentKeydown(e){if(!this.open)return;if(e.key==="Escape"){e.preventDefault(),this.dismiss("escape");return}if(e.key!=="Tab")return;let i=this.getFocusable();if(!i.length){e.preventDefault(),this.dialogTarget.focus();return}let r=i[0],s=i[i.length-1],d=document.activeElement;e.shiftKey&&d===r?(e.preventDefault(),s.focus()):!e.shiftKey&&d===s&&(e.preventDefault(),r.focus())}onBackdropClick(){this.dismiss("backdrop")}onCloseClick(){this.dismiss("dismiss")}static{Jp()}};import{jsx as ve,jsxs as yf}from"@ecopages/jsx/jsx-runtime";function _f({children:t,class:e,...i}){return ve("div",{...i,"data-dialog-title":!0,"data-ref":"title",class:j("rui-dialog__title",e),children:t})}function xf({children:t,class:e,...i}){return ve("div",{...i,"data-dialog-body":!0,"data-ref":"description",class:j("rui-dialog__body",e),children:t})}function wf({children:t,class:e,...i}){return ve("div",{...i,class:j("rui-dialog__actions",e),children:t})}function Tf({children:t,class:e,aria:i,...r}){return ve("button",{...r,aria:ne(i,"Close"),type:"button","data-dialog-close":!0,"data-ref":"close",class:j("rui-dialog__close",e),children:t??ve(Re,{})})}function vf({alert:t,children:e,open:i}){return yf("div",{"data-ref":"root",class:"rui-dialog",hidden:i?void 0:!0,children:[ve("div",{"data-ref":"backdrop",class:"rui-dialog__backdrop"}),ve("div",{"data-ref":"dialog",class:"rui-dialog__surface",tabindex:-1,role:t?"alertdialog":"dialog","aria-modal":"true",children:e})]})}function J1({title:t,actions:e,children:i,open:r,alert:s,...d}){return t!=null||e!=null?ve("rui-dialog",{...d,open:r,alert:s,children:yf(vf,{open:r,alert:s,children:[ve(Tf,{}),t!=null?ve(_f,{children:t}):null,i!=null?ve(xf,{children:i}):null,e!=null?ve(wf,{children:e}):null]})}):ve("rui-dialog",{...d,open:r,alert:s,children:ve(vf,{open:r,alert:s,children:i})})}var nt="__rui-dialog-host",Mr="rui-dialog-open",Lr="rui-dialog-close",Pr="rui-dialog-toggle",po="rui-dialog-action";function Sf(t){return"id"in t&&t.id!=null&&t.id!==""}var Pi=!1,jr=null,ji=null,be=null;function mo(t){let e=t.trim();if(!e)return null;let i=document.getElementById(e);return i?.localName==="rui-dialog"?i:null}function Z1(){let t=document.createElement("button");return t.type="button",t.setAttribute("data-dialog-close",""),t.setAttribute("data-ref","close"),t.className="rui-dialog__close",t.setAttribute("aria-label","Close"),t.append(hr()),t}function eO(t){let e=document.createElement("div");return e.setAttribute("data-dialog-title",""),e.setAttribute("data-ref","title"),e.className="rui-dialog__title",e.textContent=t,e}function tO(t){let e=document.createElement("div");e.setAttribute("data-dialog-body",""),e.setAttribute("data-ref","description"),e.className="rui-dialog__body";let i=document.createElement("p");return i.textContent=t,e.append(i),e}function iO(t){let e=document.createElement("div");e.className="rui-dialog__actions";for(let i of t){let r=document.createElement("button");r.type="button",r.className=`rui-button rui-button--${i.variant??"filled"} rui-button--${i.size??"md"}`,r.setAttribute("data-dialog-action",i.value??""),i.closeOnClick===!1&&r.setAttribute("data-dialog-action-close","false"),r.textContent=i.label,e.append(r)}return e}function rO(t){let e=document.createElement("div");e.dataset.ref="root",e.className="rui-dialog";let i=document.createElement("div");i.setAttribute("data-ref","backdrop"),i.className="rui-dialog__backdrop";let r=document.createElement("div");return r.setAttribute("data-ref","dialog"),r.className="rui-dialog__surface",r.tabIndex=-1,r.setAttribute("role",t?"alertdialog":"dialog"),r.setAttribute("aria-modal","true"),e.append(i,r),e}function Fi(){ji?.remove(),ji=null}function nO(t){Fi();let e=document.createElement("rui-dialog");e.id=nt,e.alert=!!t.alert,e.label=t.label??"",e.open=!0;let i=rO(e.alert),r=i.querySelector('[data-ref="dialog"]');if(!r)throw new Error("Failed to create the dialog surface.");return r.append(Z1()),t.title&&r.append(eO(t.title)),t.body&&r.append(tO(t.body)),t.actions?.length&&r.append(iO(t.actions)),e.append(i),(jr??document.body).appendChild(e),ji=e,e}function Ef(t){if(!(!be||be===t))if(be===nt)Fi();else{let e=mo(be);e&&(e.open=!1)}}function li(t){_t();let e=mo(t);e&&(Ef(t),e.open=!0,be=t)}function oO(t){_t(),Ef(nt),nO(t),be=nt}function Fr(t){if(typeof t=="string"){li(t);return}if(Sf(t)){li(t.id);return}oO(t)}function ui(t){_t();let e=t??be;if(e){if(e===nt)Fi();else{let i=mo(e);i&&(i.open=!1)}be===e&&(be=null)}}function go(t){if(_t(),be===t){ui(t);return}li(t)}function Rf(t){let e=t.detail;if(typeof e=="string"){Fr(e);return}e&&typeof e=="object"&&Fr(e)}function Af(t){let e=t.detail;ui(e?.id)}function If(t){let e=t.detail;e?.id&&go(e.id)}function Cf(t){let e=t.target;if(!e?.closest)return;let i=e.closest("[data-dialog-action]");if(i&&ji?.contains(i)){t.preventDefault();let h={value:i.getAttribute("data-dialog-action")||void 0||void 0};ji.dispatchEvent(new CustomEvent(po,{detail:h,bubbles:!0,composed:!0})),i.getAttribute("data-dialog-action-close")!=="false"&&ui(nt);return}let r=e.closest("[data-dialog-open]");if(r){let d=r.getAttribute("data-dialog-open")?.trim();d&&(t.preventDefault(),li(d));return}let s=e.closest("[data-dialog-close]");if(s){if(s.closest("rui-dialog")?.hasAttribute("open"))return;t.preventDefault(),ui()}}function Df(t){let e=t.target?.closest?.("rui-dialog");if(!e)return;let i=e.id||null;i&&be===i&&(i===nt&&Fi(),be=null)}function Of(t={}){return Pi?(t.mount&&(jr=t.mount),fo):(Pi=!0,jr=t.mount??document.body,document.addEventListener(Mr,Rf),document.addEventListener(Lr,Af),document.addEventListener(Pr,If),document.addEventListener("click",Cf),document.addEventListener("rui-close",Df),fo)}function _t(){Pi||Of()}function fo(){Pi&&(document.removeEventListener(Mr,Rf),document.removeEventListener(Lr,Af),document.removeEventListener(Pr,If),document.removeEventListener("click",Cf),document.removeEventListener("rui-close",Df),Fi(),jr=null,be=null,Pi=!1)}function aO(){return be}function sO(t){_t(),Fr(t)}function lO(t){_t(),ui(t)}function uO(t){_t(),go(t)}function cO(t){_t();let e=t?.trim()||void 0;return{open:r=>{if(e){li(e);return}if(r!=null){if(typeof r=="string"){li(r);return}Fr(r)}},close:r=>{ui(r??e)},toggle:r=>{let s=r??e;s&&go(s)},get openId(){return be}}}import{RadiantElement as zf,bindTo as qf,bound as mO,customElement as gO,onEvent as bO,onUpdated as vO,prop as bo}from"@ecopages/radiant";var Vf,kf,Mf,Lf,Pf,jf,Ff,Bf;function dO(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Uf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Uf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:hO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return fO(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function hO(t){var e=pO(t,"string");return typeof e=="symbol"?e:e+""}function pO(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Uf(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function fO(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Br,Kf=class extends zf{static{({e:[Mf,Lf,Pf,jf,Ff,Bf,Vf],c:[Br,kf]}=dO(this,[gO("rui-disclosure")],[[[bo({type:Boolean,reflect:!0,defaultValue:!1}),qf([{selector:"[data-disclosure-trigger]",attr:"aria-expanded"},{selector:"[data-disclosure-panel]",attr:"data-state",map:e=>e?"open":"closed"}])],0,"open"],[bo({type:String,reflect:!0,defaultValue:""}),0,"value"],[[bo({type:Boolean,reflect:!0,defaultValue:!1}),qf({bool:"data-animated"})],0,"animated"],[bO({selector:"[data-disclosure-trigger]",type:"click"}),2,"onTriggerClick"],[[mO,vO(["open","animated"])],2,"syncExpanded"]],0,void 0,zf))}open=(Vf(this),Mf(this));value=(Lf(this),Pf(this));animated=(jf(this),Ff(this));panelId=(Bf(this),re("rui-disclosure"));onConnected(){this.syncPanelRelationship(),this.syncExpanded()}onTriggerClick(e){e.preventDefault(),this.toggle()}toggle(){let e=!this.open;this.open=e,this.dispatchEvent(new CustomEvent("rui-disclosure-toggle",{bubbles:!0,composed:!0,detail:{value:this.value,open:e}}))}syncPanelRelationship(){let e=this.querySelector("[data-disclosure-trigger]"),i=this.querySelector("[data-disclosure-panel]");!e||!i||(e.setAttribute("aria-controls",this.panelId),i.id=this.panelId)}syncExpanded(){let e=this.querySelector("[data-disclosure-panel]");if(e){if(this.animated){e.toggleAttribute("hidden",!1),e.setAttribute("aria-hidden",String(!this.open));return}e.toggleAttribute("hidden",!this.open),e.removeAttribute("aria-hidden")}}static{kf()}};import{RadiantElement as Qf,customElement as TO,onEvent as Jf,onUpdated as SO,prop as Zf}from"@ecopages/radiant";var $f,Gf,Wf,Hf,Yf,Nf;function yO(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Xf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Xf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:_O(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wO(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function _O(t){var e=xO(t,"string");return typeof e=="symbol"?e:e+""}function xO(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xf(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function wO(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var tm,em=class extends Qf{static{({e:[Wf,Hf,Yf,Nf,$f],c:[tm,Gf]}=yO(this,[TO("rui-disclosure-group")],[[Zf({type:Boolean,reflect:!0,defaultValue:!1}),0,"multiple"],[Zf({type:Boolean,reflect:!0,attribute:"animated",defaultValue:!1}),0,"animated"],[SO("animated"),2,"onAnimatedUpdated"],[Jf({selector:"rui-disclosure",type:"rui-disclosure-toggle"}),2,"onDisclosureToggle"],[Jf({selector:"[data-disclosure-trigger]",type:"keydown"}),2,"onTriggerKeydown"]],0,void 0,Qf))}constructor(...e){super(...e),Nf(this)}multiple=($f(this),Wf(this));animated=(Hf(this),Yf(this));onConnected(){this.syncChildrenAnimated(),this.syncTriggers()}getTriggers(){return Array.from(this.querySelectorAll("[data-disclosure-trigger]"))}getDisclosureForTrigger(e){return e.closest("rui-disclosure")}syncTriggers(){let e=this.getTriggers();if(!e.length)return;let i=Math.max(0,e.findIndex(r=>r.tabIndex===0||r===document.activeElement));ue(e,i)}syncChildrenAnimated(){for(let e of this.querySelectorAll("rui-disclosure"))e.animated=this.animated}onAnimatedUpdated(){this.syncChildrenAnimated()}onDisclosureToggle(e){if(this.multiple||!e.detail?.open)return;let r=e.target;if(r instanceof Br)for(let s of this.querySelectorAll("rui-disclosure"))s!==r&&(s.open=!1)}onTriggerKeydown(e){let i=this.getTriggers(),r=e.target.closest("[data-disclosure-trigger]");if(!r)return;if(e.key==="ArrowLeft"||e.key==="ArrowRight"){let d=this.getDisclosureForTrigger(r);if(!d)return;let h=e.key==="ArrowRight";if(d.open===h){e.preventDefault();return}if(e.preventDefault(),d.open=h,h&&!this.multiple)for(let a of this.querySelectorAll("rui-disclosure"))a!==d&&(a.open=!1);return}de({items:i,current:r,key:e.key,orientation:"vertical",wrap:!0}).handled&&e.preventDefault()}static{Gf()}};import{jsx as ye,jsxs as rm}from"@ecopages/jsx/jsx-runtime";function nm({variant:t="chevron",class:e,children:i,...r}){return ye("span",{...r,class:j("rui-disclosure__icon",`rui-disclosure__icon--${t}`,e),"data-disclosure-icon":!0,"aria-hidden":"true",children:i??(t==="chevron"?ye(Xe,{}):null)})}function om({children:t,class:e,disabled:i,icon:r,iconPosition:s="start",...d}){let a=r!==null?r??ye(nm,{}):null;return rm("button",{...d,type:"button","data-disclosure-trigger":!0,class:j("rui-disclosure__trigger",s==="end"&&"rui-disclosure__trigger--icon-end",e),disabled:i,children:[s==="start"?a:null,ye("span",{class:"rui-disclosure__label",children:t}),s==="end"?a:null]})}function am({children:t,class:e,...i}){return ye("div",{...i,"data-disclosure-panel":!0,"data-ref":"panel",class:j("rui-disclosure__panel",e),children:ye("div",{class:"rui-disclosure__panel-inner",children:t})})}function im({children:t}){return ye("div",{class:"rui-disclosure","data-ref":"root",children:t})}function EO({trigger:t,icon:e,iconPosition:i,children:r,...s}){return t!=null?ye("rui-disclosure",{...s,children:rm(im,{children:[ye(om,{icon:e,iconPosition:i,children:t}),r!=null?ye(am,{children:r}):null]})}):ye("rui-disclosure",{...s,children:ye(im,{children:r})})}function RO({children:t,...e}){return ye("rui-disclosure-group",{...e,children:ye("div",{class:"rui-disclosure-group","data-ref":"root",children:t})})}import{jsx as xt}from"@ecopages/jsx/jsx-runtime";function AO({children:t,label:e,class:i,aria:r,...s}){return xt("div",{...s,aria:ne(r,e),role:"feed",class:j("rui-feed",i),children:t})}function IO({children:t,posinset:e,setsize:i,labelledBy:r,describedBy:s,tabindex:d=0,class:h,"aria-posinset":a,"aria-setsize":E,"aria-labelledby":A,"aria-describedby":S,...I}){return xt("article",{...I,class:j("rui-feed__article",h),tabindex:d,"aria-posinset":ke(a,e),"aria-setsize":ke(E,i),"aria-labelledby":ke(A,r),"aria-describedby":ke(S,s),children:t})}function CO({children:t,class:e,...i}){return xt("header",{...i,class:j("rui-feed__header",e),children:t})}function DO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__content",e),children:t})}function OO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__actions",e),children:t})}function VO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline",e),children:t})}function kO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline-body",e),children:t})}function MO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__meta",e),children:t})}import{jsx as Ym}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Gm,customElement as JO,onEvent as Gr,onUpdated as Io,prop as Bt,registerSsrPreparationCallback as ZO}from"@ecopages/radiant";import{consumeContext as eV,onContextUpdate as tV,provideContext as iV}from"@ecopages/radiant/context";var ot="data-rui-control",vo="data-rui-field-managed",qr="data-rui-field-label",Kr="data-rui-field-description",ci="data-rui-field-error",yo="data-default-value",_o="data-default-values",cm="data-rui-aria-target",dm="data-rui-aria-targets",xo='[data-ref="field"]';function hm(){return`[${ot}], ${wo()}`}function wo(){return Array.from(wt.keys()).join(", ")}function LO(t){return t.localName==="rui-listbox"&&(t.hasAttribute("embedded")||Reflect.get(t,"embedded")===!0)}var PO={"rui-combobox":"[data-combobox-input]","rui-select":"[data-select-trigger]","rui-tag-group":"[data-tag-list]","rui-number-field":"[data-number-field-input], input","rui-knob":"[data-knob-control]","rui-checkbox":"input","rui-checkbox-group":"[data-checkbox-group-root]","rui-switch":"input"};function di(t){return t.localName==="input"||t.localName==="textarea"}function pm(t){return t.localName==="input"}function fm(t){return t.localName==="textarea"}function To(t){return Reflect.get(t.constructor,"formAssociated")===!0}var Ur={read:t=>{let e=Reflect.get(t,"value");return typeof e=="string"?e:t.getAttribute("value")??""},write:(t,e)=>{let i=e==null?"":String(e);t.setAttribute("value",i),"value"in t&&Reflect.set(t,"value",i)}},sm={read:t=>{let e=Reflect.get(t,"value");if(typeof e=="number")return e;let i=t.getAttribute("value");return i==null||i===""?"":Number(i)},write:(t,e)=>{let i=e==null?"":String(e);t.setAttribute("value",i),"value"in t&&Reflect.set(t,"value",e)}},lm={read:t=>t.querySelector('input[type="checkbox"]')?.checked??t.hasAttribute("checked"),write:(t,e)=>{e?t.setAttribute("checked",""):t.removeAttribute("checked")}};function mm(t,e){let i=Reflect.get(t,"value");return i!==void 0&&e.fromProperty?e.fromProperty(i):e.fromAttribute?e.fromAttribute(t.getAttribute("value")):i}function gm(t,e){Reflect.set(t,"value",e)}var Bi={read:t=>mm(t,Er),write:gm},jO={read:t=>mm(t,Rr),write:gm},wt=new Map([["rui-checkbox",lm],["rui-switch",lm],["rui-combobox",{...Bi,submission:"none"}],["rui-date-field",Ur],["rui-date-input",{...Ur,submission:"host"}],["rui-date-range-picker",Ur],["rui-select",{...Bi,submission:"none"}],["rui-radio-group",Ur],["rui-checkbox-group",Bi],["rui-listbox",Bi],["rui-tag-group",Bi],["rui-slider",{...jO,submission:"host"}],["rui-knob",{...sm,submission:"host"}],["rui-number-field",{...sm,submission:"host"}]]);function bm(t,e){let i=t,r=new Set,s=a=>{r.has(a)||(r.add(a),e(a))};if(typeof i.getSlotElements=="function")for(let a of i.getSlotElements())s(a);let d=t.querySelector(xo)??t;for(let a of Array.from(d.children))s(a);for(let a of d.querySelectorAll("*"))s(a);for(let a of Array.from(t.children))s(a);let h=t.shadowRoot;if(h)for(let a of Array.from(h.children))s(a)}function So(t,e){let i=null;return bm(t,r=>{if(!(i||!(r instanceof HTMLElement))){if(r.matches(e)){i=r;return}i=r.querySelector(e)}}),i}function um(t){let e=t.filter(i=>!LO(i));return e.length===0?null:e.find(i=>!e.some(r=>r!==i&&r.contains(i)))??null}function FO(t){let e=[];return bm(t,i=>{i instanceof HTMLElement&&i.matches(hm())&&e.push(i)}),e}function BO(t){let e=t.querySelector(xo);return e instanceof HTMLElement?Array.from(e.querySelectorAll(hm())).filter(i=>t.contains(i)):[]}function hi(t){let e=um(BO(t));return e||um(FO(t))}function UO(t,e){let i=t.toLowerCase();wt.set(i,e)}function vm(t,e){let i=hi(t);if(!i||!(e.target instanceof Element)||e.target!==i&&!i.contains(e.target))return!1;let r=e.target.closest(wo());return r===i||r==null}function Eo(t){if(pm(t)){let i=zr(t),r=i===t?void 0:wt.get(i.localName);return r?r.read(i):t.type==="checkbox"?t.checked:t.type==="number"||t.type==="range"?t.value===""?"":Number(t.value):t.value}if(fm(t))return t.value;let e=zr(t);return wt.get(e.localName)?.read(e)??e.getAttribute("value")??""}function $r(t,e){if(pm(t)){let r=zr(t),s=r===t?void 0:wt.get(r.localName);if(s){s.write(r,e);return}if(t.type==="checkbox"){t.checked=!!e;let d=t.closest("rui-checkbox, rui-switch");d&&(e?d.setAttribute("checked",""):d.removeAttribute("checked"));return}t.value=e==null?"":String(e);return}if(fm(t)){t.value=e==null?"":String(e);return}let i=zr(t);wt.get(i.localName)?.write(i,e)}function zr(t){return t.hasAttribute(ot)?t.closest(wo())??t:t}function ym(t){return So(t,`[${qr}]`)}function _m(t){return So(t,`[${Kr}]`)}function xm(t){return Ro(t)[0]??null}function Ro(t){let e=t.querySelector(xo);if(e instanceof HTMLElement){let s=Array.from(e.querySelectorAll(`[${ci}]`));if(s.length>0)return s}let i=Array.from(t.querySelectorAll(`[${ci}]`));if(i.length>0)return i;let r=So(t,`[${ci}]`);return r?[r]:[]}function wm(t,e,i){if(e&&di(e)){let r=t&&wt.get(t.localName)?.submission;(t==null||t===e||!To(t)&&r!=="host"&&r!=="none")&&i?e.name=i:e.removeAttribute("name")}t&&wt.has(t.localName)&&(Reflect.set(t,"name",i),i?t.setAttribute("name",i):t.removeAttribute("name"))}function zO(t){let e=Reflect.get(t,"checked");return typeof e=="boolean"?e:t.hasAttribute("checked")}function qO(t){let e=t.getAttribute(dm);if(e){let r=e.split(",")[0]?.trim();if(r)return t.querySelector(r)}let i=t.getAttribute(cm);return i?t.querySelector(i):null}function KO(t){let e=t.getAttribute(dm);if(e)return e.split(",").map(r=>r.trim()).filter(r=>r!=="").map(r=>t.querySelector(r)).filter(r=>r!=null);let i=t.getAttribute(cm);if(i){let r=t.querySelector(i);return r?[r]:[]}return[]}function $O(t){if(di(t))return t;let e=qO(t);if(e)return e;if(t.hasAttribute(ot))return t;if(t.localName==="rui-slider")return Array.from(t.querySelectorAll("[data-thumb]")).find(d=>!d.hasAttribute("hidden"))??t;let i=t.querySelector(`[${ot}]`);if(i)return i;if(t.localName==="rui-radio-group")return GO(t)??t;let r=PO[t.localName];return r?t.querySelector(r)??t:t}function GO(t){let e=t.querySelectorAll('input[type="radio"]');return Array.from(e).find(zO)??e[0]}function Tm(t){let e=KO(t);if(e.length>0)return e;if(t.localName==="rui-slider"){let i=Array.from(t.querySelectorAll("[data-thumb]")).filter(r=>!r.hasAttribute("hidden"));return i.length>0?i:[t]}return[$O(t)]}import{createContext as WO}from"@ecopages/radiant/context";var pi=WO(Symbol.for("rui-form-context"));import{createContext as HO}from"@ecopages/radiant/context";var Ao=HO(Symbol.for("rui-field-context"));var Sm,Em,Rm,Am,Im,Cm,Dm,Om,Vm,km,Mm,Lm,Pm,jm,Fm,Bm,Um,zm,qm,Km;function YO(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:$m(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||$m(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:NO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return QO(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function NO(t){var e=XO(t,"string");return typeof e=="symbol"?e:e+""}function XO(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $m(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function QO(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}function rV(t){if(!t)return;let{validate:e,...i}=t;return i}var Hm,Wm=class extends Gm{static{({e:[Rm,Am,Im,Cm,Dm,Om,Vm,km,Mm,Lm,Pm,jm,Fm,Bm,Um,zm,qm,Km,Sm],c:[Hm,Em]}=YO(this,[JO("rui-field")],[[Bt({type:String,reflect:!0,defaultValue:""}),0,"name"],[Bt({type:Object}),0,"rules"],[Bt({type:Object}),0,"defaultValue"],[Bt({type:String,attribute:yo}),0,"defaultValueData"],[Bt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Bt({type:String,defaultValue:""}),0,"error"],[Bt({type:Boolean,reflect:!0,defaultValue:!1}),0,"invalid"],[iV({context:Ao,initialValue:{name:"",controlId:"",descriptionId:"",errorId:"",error:void 0,invalid:!1,required:!1},hydrate:Object,serialize:e=>({...e,rules:rV(e.rules)})}),0,"fieldProvider"],[eV(pi),0,"formContextProvider"],[tV({context:pi,requestUpdate:!1}),2,"onFormContextChanged"],[Io(["name"]),2,"onNameUpdated"],[Io(["rules","defaultValue","defaultValueData"]),2,"onRulesUpdated"],[Io(["disabled","error","invalid"]),2,"onPresentationUpdated"],[Gr({selector:"*",type:"rui-change"}),2,"onControlChange"],[Gr({selector:"[data-rui-control]",type:"input",options:{capture:!0}}),2,"onControlInput"],[Gr({selector:"[data-rui-control]",type:"change",options:{capture:!0}}),2,"onControlNativeChange"],[Gr({selector:"[data-rui-control], rui-knob, rui-slider",type:"focusout"}),2,"onControlFocusOut"]],0,void 0,Gm))}name=(Sm(this),Rm(this));rules=(Am(this),Im(this));defaultValue=(Cm(this),Dm(this));defaultValueData=(Om(this),Vm(this));disabled=(km(this),Mm(this));error=(Lm(this),Pm(this));invalid=(jm(this),Fm(this));fieldProvider=(Bm(this),Um(this));formContextProvider=(zm(this),qm(this));uid=(Km(this),re("rui-field"));resolveFieldName(){return(this.name||this.getAttribute("name")||"").trim()}unregister;unregisterPresentation;registeredWithForm=!1;pendingControlWrite;controlObserver;constructor(){super(),ZO(this,()=>this.fieldProvider.setContext({rules:this.readFieldRules()}))}onConnected(){this.connectToForm()}disconnectedCallback(){this.unregister?.(),this.unregister=void 0,this.unregisterPresentation?.(),this.unregisterPresentation=void 0,this.registeredWithForm=!1,this.clearPendingControlWrite(),super.disconnectedCallback()}get currentFormContext(){return this.formContextProvider?.getContext()}parseJsonAttr(e){if(e)try{return JSON.parse(e)}catch{return}}readFieldRules(){let e=this.rules;return e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0?e:this.fieldProvider.getContext()?.rules}readDefaultValue(){return this.defaultValue!==void 0?this.defaultValue:this.parseJsonAttr(this.defaultValueData??this.getAttribute(yo))}isRequired(){return!!this.readFieldRules()?.required}resolveErrorMessage(e){if(this.error)return this.error;let i=this.resolveFieldName();return i?(e??this.currentFormContext)?.fields[i]?.error:void 0}resolveInvalid(e){if(this.invalid||this.error)return!0;let i=this.resolveFieldName();return i?(e??this.currentFormContext)?.fields[i]?.invalid??!1:!1}connectToForm(){let e=this.resolveFieldName(),i=this.currentFormContext,r=i?.actions;if(!i?.ready||!r||!e){this.syncField();return}if(!this.registeredWithForm){this.registeredWithForm=!0,this.unregisterPresentation?.(),this.unregisterPresentation=r.subscribePresentation(s=>this.syncField(s)),this.unregister=r.register({name:e,rules:this.readFieldRules(),getRules:()=>this.readFieldRules(),defaultValue:this.readDefaultValue(),getValue:()=>{let s=hi(this);return s?Eo(s):void 0},setValue:s=>{let d=hi(this);if(d){$r(d,s),this.clearPendingControlWrite();return}this.pendingControlWrite={value:s},this.observeControlAppearance()}}),this.syncField();return}r.updateFieldOptions(e,{rules:this.readFieldRules(),defaultValue:this.readDefaultValue()}),this.syncField()}onFormContextChanged(e){if(!this.registeredWithForm){e.ready?this.connectToForm():this.syncField(e);return}this.syncField(e)}onNameUpdated(){this.unregister?.(),this.unregister=void 0,this.unregisterPresentation?.(),this.unregisterPresentation=void 0,this.registeredWithForm=!1,this.clearPendingControlWrite(),this.connectToForm()}onRulesUpdated(){this.connectToForm()}onPresentationUpdated(){this.syncField()}onControlChange(e){vm(this,e)&&this.syncControlToForm()}onControlInput(){this.syncControlToForm()}onControlNativeChange(){this.syncControlToForm()}onControlFocusOut(){let e=this.resolveFieldName();e&&this.currentFormContext?.actions.handleFieldBlur(e)}syncField(e){let i=hi(this);i&&this.pendingControlWrite&&($r(i,this.pendingControlWrite.value),this.clearPendingControlWrite());let r=i?Tm(i):[],s=r[0]??null,d=s?.id||`${this.uid}-control`,h=`${this.uid}-desc`,a=`${this.uid}-error`,E=this.resolveErrorMessage(e),A=this.resolveInvalid(e),S=this.isRequired(),I=this.resolveFieldName();wm(i,s,I);let T=this.syncDescriptions(h,a,E);this.syncAriaTargets(i,r,d,T,A,S),this.syncLabel(r,s),this.syncErrorPresentation(E);let K={name:I,controlId:s?.id??d,descriptionId:h,errorId:a,error:E,invalid:A,required:S};this.publishFieldContext(K)}syncControlToForm(){let e=this.resolveFieldName();e&&this.currentFormContext?.actions.handleFieldChange(e)}observeControlAppearance(){this.controlObserver||(this.controlObserver=new MutationObserver(()=>this.syncField()),this.controlObserver.observe(this,{childList:!0,subtree:!0}))}clearPendingControlWrite(){this.pendingControlWrite=void 0,this.controlObserver?.disconnect(),this.controlObserver=void 0}syncDescriptions(e,i,r){let s=[],d=_m(this);d&&(d.id=e,s.push(e));let h=xm(this);return h&&(h.id=i),h&&r&&s.push(i),s}syncLabel(e,i){let r=ym(this);if(!r||!i||(r.htmlFor=i.id,di(i)))return;let s=r.id||`${this.uid}-label`;for(let d of e)Nn(r,d,{controlId:d.id,labelId:s})}syncAriaTargets(e,i,r,s,d,h){for(let[a,E]of i.entries())E.id||(E.id=a===0?r:`${r}-${a}`),E.setAttribute(vo,""),E.setAttribute("aria-invalid",String(d)),E.toggleAttribute("aria-required",h),h&&E.setAttribute("aria-required","true"),s.length?E.setAttribute("aria-describedby",s.join(" ")):E.removeAttribute("aria-describedby"),this.disabled&&this.disableAriaTarget(E);this.disabled&&e&&To(e)&&Reflect.set(e,"disabled",!0)}disableAriaTarget(e){e.setAttribute("aria-disabled","true"),di(e)&&(e.disabled=!0)}syncErrorPresentation(e){for(let i of Ro(this))i.textContent=e??"",i.hidden=!e,e&&i.removeAttribute("hidden")}publishFieldContext(e){let i=this.fieldProvider.getContext();nV(i,e)||this.fieldProvider.setContext(e)}static{Em()}};function nV(t,e){return t.name===e.name&&t.controlId===e.controlId&&t.descriptionId===e.descriptionId&&t.errorId===e.errorId&&t.error===e.error&&t.invalid===e.invalid&&t.required===e.required}function oV({children:t,rules:e,defaultValue:i,defaultValueData:r,...s}){return Ym("rui-field",{...s,"prop:rules":e,"prop:defaultValue":i,data:{defaultValue:r??(i!==void 0?JSON.stringify(i):void 0)},children:Ym("div",{class:"rui-field","data-ref":"field",children:t})})}import{jsx as aV}from"@ecopages/jsx/jsx-runtime";function sV({children:t,class:e,...i}){return aV("p",{...i,[Kr]:"",class:j("rui-field__description",e),children:t})}import{jsx as lV}from"@ecopages/jsx/jsx-runtime";function uV({class:t,...e}){return lV("p",{...e,[ci]:"",class:j("rui-field__error",t),role:"alert",hidden:!0})}import{jsx as Rg}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as _g,customElement as yV,event as xg,onEvent as Do,onUpdated as wg,prop as Ut}from"@ecopages/radiant";import{provideContext as _V}from"@ecopages/radiant/context";function fi(t,e){if(!(e===void 0||e===!1))return typeof e=="string"?e:typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:t}function at(t){return typeof t=="object"&&t!==null&&"value"in t?t.value:t}async function cV(t,e,i,r){if(i)for(let s of[dV,hV,pV,fV]){let d=await s(e,i,r);if(d)return d}}function dV(t,e){let i=t==null||t===""||t===!1||Array.isArray(t)&&t.length===0;return e.required&&i?fi("This field is required",e.required)??"This field is required":void 0}function hV(t,e){let i=typeof t=="number"?t:typeof t=="string"&&t!==""?Number(t):void 0;if(!(i===void 0||Number.isNaN(i))){if(e.min!==void 0&&i<at(e.min))return fi(`Minimum value is ${at(e.min)}`,e.min);if(e.max!==void 0&&i>at(e.max))return fi(`Maximum value is ${at(e.max)}`,e.max)}}function pV(t,e){let i=t==null?"":String(t);if(e.minLength!==void 0&&i.length<at(e.minLength))return fi(`Minimum length is ${at(e.minLength)}`,e.minLength);if(e.maxLength!==void 0&&i.length>at(e.maxLength))return fi(`Maximum length is ${at(e.maxLength)}`,e.maxLength);if(e.pattern!==void 0&&!at(e.pattern).test(i))return fi("Invalid format",e.pattern)??"Invalid format"}async function fV(t,e,i){if(!e.validate)return;let r=typeof e.validate=="function"?[e.validate]:Object.values(e.validate);for(let s of r){let d=await s(t,i);if(d!==!0&&d!==void 0)return d===!1?"Invalid value":String(d)}}async function Nm(t,e,i){let r=i??Object.keys(e.fields),s={};for(let d of r){let h=e.fields[d]?.rules,a=await cV(d,t[d],h,t);a&&(s[d]={type:"validation",message:a})}return Object.keys(s).length>0?{values:{},errors:s}:{values:t,errors:{}}}function Co(){return(t,e,i)=>Nm(t,e,i.names)}function Xm(t){return typeof t=="function"?t:Co()}var Ui=class{mode;reValidateMode;resolver;fields=new Map;listeners=new Set;revision=0;defaultValues;values;errors={};touched={};dirty={};isSubmitting=!1;isSubmitted=!1;constructor(e={}){this.mode=e.mode??"onSubmit",this.reValidateMode=e.reValidateMode??"onChange",this.resolver=Xm(e.resolver),this.defaultValues={...e.defaultValues??{}},this.values={...this.defaultValues,...e.values??{}}}updateOptions(e){e.mode!==void 0&&(this.mode=e.mode),e.reValidateMode!==void 0&&(this.reValidateMode=e.reValidateMode),e.resolver!==void 0&&(this.resolver=Xm(e.resolver)),e.defaultValues!==void 0&&(this.defaultValues={...e.defaultValues})}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notify(){this.revision+=1;for(let e of this.listeners)e()}getRevision(){return this.revision}getRegisteredFieldNames(){return Array.from(this.fields.keys())}register(e){let i=this.fields.get(e.name),r={...e,rules:e.rules??i?.rules,defaultValue:e.defaultValue??i?.defaultValue,getRules:e.getRules??i?.getRules};return this.fields.set(e.name,r),this.values[e.name]===void 0&&r.defaultValue!==void 0&&(this.values={...this.values,[e.name]:r.defaultValue}),r.setValue(this.values[e.name]),()=>{this.fields.get(e.name)===r&&(this.fields.delete(e.name),this.notify())}}updateFieldOptions(e,i){let r=this.fields.get(e);r&&(i.rules!==void 0&&(r.rules=i.rules),i.defaultValue!==void 0&&(r.defaultValue=i.defaultValue))}getValues(){let e={...this.values};for(let[i,r]of this.fields)e[i]=r.getValue();return e}setValue(e,i,r){this.values={...this.values,[e]:i},this.fields.get(String(e))?.setValue(i),r?.shouldDirty&&(this.dirty={...this.dirty,[e]:!0}),r?.shouldTouch&&(this.touched={...this.touched,[e]:!0}),this.notify()}markTouched(e){this.touched={...this.touched,[e]:!0},this.notify()}markDirty(e){this.dirty={...this.dirty,[e]:!0},this.notify()}clearErrors(e){if(e){let i={...this.errors};delete i[e],this.errors=i,this.notify();return}this.errors={},this.notify()}getFieldError(e){return this.errors[e]?.message}getState(){let e=this.getValues(),i=Object.keys(this.errors).length;return{values:e,errors:this.errors,touched:this.touched,dirty:this.dirty,isSubmitting:this.isSubmitting,isSubmitted:this.isSubmitted,isValid:i===0}}async validateField(e){let i=this.getValues(),s=(await this.resolver(i,{fields:this.buildResolverFields()},{names:[e]})).errors[e]?.message,d={...this.errors};return s?d[e]={type:"validation",message:s}:delete d[e],this.errors=d,this.notify(),!s}async validateAll(){let e=this.getValues(),i=await this.resolver(e,{fields:this.buildResolverFields()},{});return this.errors=i.errors,this.notify(),Object.keys(this.errors).length===0}shouldValidate(e,i){switch(this.isSubmitted?this.reValidateMode:this.mode){case"all":return!0;case"onChange":return i==="change";case"onBlur":return i==="blur";case"onTouched":return i==="blur"&&!!this.touched[e];case"onSubmit":return!1;default:return!1}}async handleFieldChange(e){let i=this.fields.get(e);if(!i)return;let r=i.getValue();this.values={...this.values,[e]:r},this.dirty={...this.dirty,[e]:!0},this.shouldValidate(e,"change")?await this.validateField(e):this.notify()}async handleFieldBlur(e){this.markTouched(e),this.shouldValidate(e,"blur")?await this.validateField(e):this.notify()}shouldDisplayFieldError(e){if(!this.errors[e]?.message)return!1;if(this.isSubmitted)return!0;switch(this.mode){case"all":return!!(this.dirty[e]||this.touched[e]);case"onChange":return!!this.dirty[e];case"onBlur":case"onTouched":return!!this.touched[e];default:return!1}}async handleSubmit(e,i){this.isSubmitting=!0,this.isSubmitted=!0;for(let s of this.fields.keys())this.touched={...this.touched,[s]:!0};this.notify();let r=await this.validateAll();if(this.isSubmitting=!1,this.notify(),r){await e(this.getValues());return}i?.(this.errors)}reset(e){let i=e??{...this.defaultValues,...this.collectFieldDefaults()};this.values={...i},this.errors={},this.touched={},this.dirty={},this.isSubmitted=!1,this.isSubmitting=!1;for(let r of this.fields.values())r.setValue(this.values[r.name]);this.notify()}collectFieldDefaults(){let e={};for(let[i,r]of this.fields)r.defaultValue!==void 0&&(e[i]=r.defaultValue);return e}buildResolverFields(){let e={};for(let[i,r]of this.fields){let s=r.getRules?.()??r.rules;e[i]={rules:s}}return e}};var Qm,Jm,Zm,eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg,vg;function mV(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:yg(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||yg(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:gV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return vV(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function gV(t){var e=bV(t,"string");return typeof e=="symbol"?e:e+""}function bV(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yg(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function vV(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Tg=()=>{},xV={register:()=>Tg,updateFieldOptions:()=>{},handleFieldChange:()=>{},handleFieldBlur:()=>{},subscribePresentation:()=>Tg},Eg,Sg=class extends _g{static{({e:[Zm,eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg,vg,Qm],c:[Eg,Jm]}=mV(this,[yV("rui-form")],[[_V({context:pi,initialValue:{ready:!1,store:void 0,revision:0,fields:{},errors:{},actions:xV},hydrate:Object,serialize:({revision:e,fields:i,errors:r})=>({ready:!1,revision:e,fields:i,errors:r})}),0,"formProvider"],[xg({name:"rui-submit",bubbles:!0,composed:!0}),0,"submitEvent"],[xg({name:"rui-invalid",bubbles:!0,composed:!0}),0,"invalidEvent"],[Ut({type:Object,defaultValue:{}}),0,"defaultValues"],[Ut({type:String,attribute:_o}),0,"defaultValuesData"],[Ut({type:Object}),0,"resolver"],[Ut({type:String,reflect:!0,defaultValue:"onSubmit"}),0,"mode"],[Ut({type:String,reflect:!0,attribute:"revalidate-mode",defaultValue:"onChange"}),0,"reValidateMode"],[Ut({type:String,reflect:!0}),0,"action"],[Ut({type:String,reflect:!0}),0,"method"],[wg(["defaultValues","defaultValuesData","mode","reValidateMode"]),2,"syncOptions"],[wg(["resolver"]),2,"syncResolver"],[Do({selector:"button[type=submit]",type:"click"}),2,"onSubmitButtonClick"],[Do({ref:"form",type:"submit"}),2,"onNativeSubmit"],[Do({ref:"form",type:"reset"}),2,"onNativeReset"]],0,void 0,_g))}formProvider=(Qm(this),Zm(this));submitEvent=(eg(this),tg(this));invalidEvent=(ig(this),rg(this));defaultValues=(ng(this),og(this));defaultValuesData=(ag(this),sg(this));resolver=(lg(this),ug(this));mode=(cg(this),dg(this));reValidateMode=(hg(this),pg(this));action=(fg(this),mg(this));method=(gg(this),bg(this));onSubmit=void vg(this);store;unsubscribeStore;nativeFormId=re("rui-form");lastPublishedRevision=-1;lastPublishedContext;presentationListeners=new Set;formActions={register:e=>{let r=this.ensureStore().register(e);return this.publishFormContext({force:!0}),()=>{r(),this.publishFormContext({force:!0})}},updateFieldOptions:(e,i)=>{this.ensureStore().updateFieldOptions(e,i)},handleFieldChange:e=>{this.ensureStore().handleFieldChange(e).then(()=>this.publishFormContext({force:!0}))},handleFieldBlur:e=>{this.ensureStore().handleFieldBlur(e).then(()=>this.publishFormContext({force:!0}))},subscribePresentation:e=>(this.presentationListeners.add(e),this.lastPublishedContext&&e(this.lastPublishedContext),()=>this.presentationListeners.delete(e))};connectedCallback(){super.connectedCallback(),this.ensureStore(),this.publishFormContext({force:!0})}onConnected(){this.wireOrphanSubmitButtons()}queryNativeForm(){return this.getRef("form")}wireOrphanSubmitButtons(){let e=this.queryNativeForm();if(e){e.id||(e.id=this.nativeFormId);for(let i of this.querySelectorAll("button[type=submit]"))e.contains(i)||i.setAttribute("form",e.id)}}runFormSubmit(){this.ensureStore().handleSubmit(async i=>{if(this.submitEvent.emit({values:i}),typeof this.onSubmit=="function"){await this.onSubmit(i);return}this.hasNativeSubmission()&&this.queryNativeForm()?.submit()},i=>{this.invalidEvent.emit({errors:i})})}hasNativeSubmission(){return typeof this.onSubmit!="function"&&(this.getAttribute("action")!==null||this.getAttribute("method")!==null)}disconnectedCallback(){this.unsubscribeStore?.(),this.unsubscribeStore=void 0,super.disconnectedCallback()}resolveMode(){let e=this.getAttribute("mode");return e||(this.mode??"onSubmit")}resolveReValidateMode(){let e=this.getAttribute("revalidate-mode");return e||(this.reValidateMode??"onChange")}resolveDefaultValues(){if(this.defaultValues&&Object.keys(this.defaultValues).length>0)return this.defaultValues;let e=this.defaultValuesData??this.getAttribute(_o);if(!e)return this.defaultValues??{};try{let i=JSON.parse(e);return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}catch{return this.defaultValues??{}}}ensureStore(){return this.store||(this.store=new Ui({defaultValues:this.resolveDefaultValues(),resolver:typeof this.resolver=="function"?this.resolver:void 0,mode:this.resolveMode(),reValidateMode:this.resolveReValidateMode()})),this.unsubscribeStore??=this.store.subscribe(()=>this.publishFormContext()),this.store}buildFieldPresentations(e){let i={};for(let r of e.getRegisteredFieldNames()){let s=e.getFieldError(r),d=e.shouldDisplayFieldError(r);i[r]={error:d?s:void 0,invalid:!!(d&&s)}}return i}publishFormContext(e){let i=this.store;if(!i)return;let r=i.getRevision();if(!e?.force&&r===this.lastPublishedRevision)return;this.lastPublishedRevision=r;let s={ready:!0,store:i,revision:r,fields:this.buildFieldPresentations(i),errors:{...i.errors},actions:this.formActions};this.lastPublishedContext=s,this.formProvider.setContext(s);for(let d of this.presentationListeners)d(s)}syncOptions(){this.ensureStore().updateOptions({defaultValues:this.resolveDefaultValues(),mode:this.resolveMode(),reValidateMode:this.resolveReValidateMode()})}syncResolver(){typeof this.resolver=="function"&&this.ensureStore().updateOptions({resolver:this.resolver})}onSubmitButtonClick(e){e.preventDefault(),this.runFormSubmit()}onNativeSubmit(e){e.preventDefault(),this.runFormSubmit()}onNativeReset(){this.store?.reset()}static{Jm()}};function wV({children:t,defaultValues:e,defaultValuesData:i,resolver:r,reValidateMode:s,onSubmit:d,action:h,method:a,...E}){return Rg("rui-form",{...E,action:h,method:a,reValidateMode:s,"attr:revalidate-mode":s,"prop:defaultValues":e,"prop:resolver":r,"prop:onSubmit":d,data:{defaultValues:i??(e!==void 0?JSON.stringify(e):void 0)},children:Rg("form",{class:"rui-form","data-ref":"form",noValidate:!0,action:h,method:a,children:t})})}import{RadiantElement as Vg,customElement as AV,onEvent as IV,prop as CV}from"@ecopages/radiant";var Ag,Ig,Cg,Dg;function TV(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Og(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Og(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:SV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return RV(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function SV(t){var e=EV(t,"string");return typeof e=="symbol"?e:e+""}function EV(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Og(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function RV(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Mg,kg=class extends Vg{static{({e:[Cg,Dg,Ag],c:[Mg,Ig]}=TV(this,[AV("rui-grid")],[[CV({type:String,defaultValue:""}),0,"label"],[IV({selector:'[role="gridcell"]',type:"keydown"}),2,"onKeydown"]],0,void 0,Vg))}constructor(...e){super(...e),Dg(this)}label=(Ag(this),Cg(this));onConnected(){let e=Array.from(this.querySelectorAll('[role="gridcell"]'));ue(e,0)}getRows(){return Array.from(this.querySelectorAll('[role="row"]'))}onKeydown(e){let i=this.getRows(),r=e.target.closest('[role="gridcell"]');if(!r)return;let s=r.parentElement,d=i.indexOf(s),h=Array.from(s.querySelectorAll('[role="gridcell"]')),a=h.indexOf(r),E=d,A=a;switch(e.key){case"ArrowRight":A=Math.min(h.length-1,a+1);break;case"ArrowLeft":A=Math.max(0,a-1);break;case"ArrowDown":E=Math.min(i.length-1,d+1);break;case"ArrowUp":E=Math.max(0,d-1);break;case"Home":A=0;break;case"End":A=h.length-1;break;default:return}e.preventDefault();let S=i[E],I=Array.from(S.querySelectorAll('[role="gridcell"]')),T=I[Math.min(A,I.length-1)],K=Array.from(this.querySelectorAll('[role="gridcell"]'));ue(K,K.indexOf(T)),T.focus()}static{Ig()}};import{jsx as Wr}from"@ecopages/jsx/jsx-runtime";function DV({rows:t,label:e,children:i,...r}){let s=t!=null?t.map(d=>Wr("div",{class:"rui-grid__row",role:"row",children:d.map(h=>Wr("div",{class:"rui-grid__cell",role:"gridcell",tabindex:-1,children:h}))})):i;return Wr("rui-grid",{...r,label:e,children:Wr("div",{class:"rui-grid","data-ref":"root",role:"grid","aria-label":e||void 0,children:s})})}import{jsx as Yr}from"@ecopages/jsx/jsx-runtime";import{jsx as OV}from"@ecopages/jsx/jsx-runtime";function Hr({as:t,children:e,...i}){return OV(t??"div",{...i,children:e})}import{jsx as VV}from"@ecopages/jsx/jsx-runtime";function Oo(t){let{children:e,as:i="h2",size:r="md",class:s,...d}=t;return VV(Hr,{as:i,...d,class:j("rui-headline",r!==!1&&`rui-headline--size-${r}`,s),children:e})}function kV(t,e,i){return j("rui-heading",`rui-heading--align-${t}`,`rui-heading--size-${e}`,i)}function MV(t){let{children:e,as:i="div",align:r="start",size:s="md",class:d,...h}=t;return Yr(Hr,{as:i,...h,class:kV(r,s,d),children:e})}function LV({children:t,class:e,...i}){return Yr("p",{...i,class:j("rui-heading__eyebrow",e),children:t})}function PV(t){let{children:e,as:i="h2",class:r,...s}=t;return Yr(Oo,{as:i,size:!1,class:j("rui-heading__title",r),...s,children:e})}function jV({children:t,class:e,...i}){return Yr("p",{...i,class:j("rui-heading__description",e),children:t})}import{jsx as Ki}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as ob,bindTo as qV,bound as qi,customElement as KV,event as $V,onEvent as Nr,onUpdated as GV,prop as zt,query as WV}from"@ecopages/radiant";var zi=0,Lg=0;function Pg(){zi+=1}function Vo(t=Date.now(),e=300){zi=Math.max(0,zi-1),zi===0&&(Lg=t+e)}function jg(t,e=Date.now()){return zi>0||e<Lg?0:t}var Fg,Bg,Ug,zg,qg,Kg,$g,Gg,Wg,Hg,Yg,Ng,Xg,Qg,Jg,Zg,eb,tb,ib,rb;function FV(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:nb(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||nb(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:BV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return zV(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function BV(t){var e=UV(t,"string");return typeof e=="symbol"?e:e+""}function UV(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nb(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function zV(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var ko="Preview",ab=8,HV=500,lb,sb=class extends ob{static{({e:[Ug,zg,qg,Kg,$g,Gg,Wg,Hg,Yg,Ng,Xg,Qg,Jg,Zg,eb,tb,ib,rb,Fg],c:[lb,Bg]}=FV(this,[KV("rui-hover-card")],[[zt({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[zt({type:String,defaultValue:"bottom-start"}),0,"placement"],[zt({type:Number,defaultValue:600}),0,"delay"],[zt({type:Number,defaultValue:200}),0,"closeDelay"],[zt({type:Boolean,defaultValue:!0}),0,"portal"],[zt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[[zt({type:String,attribute:"content-label",reflect:!0,defaultValue:ko}),qV({ref:"content",attr:"aria-label"})],0,"contentLabel"],[WV({ref:"content"}),0,"contentTarget"],[$V({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[qi,GV(["open","placement","portal","disabled"])],2,"syncCard"],[Nr({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[Nr({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[Nr({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[Nr({type:"keydown",ref:"trigger"}),2,"onHostKeydown"],[qi,2,"onPointerEnter"],[qi,2,"onPointerLeave"],[qi,2,"onPointerDown"],[qi,2,"onPointerUp"]],0,void 0,ob))}open=(Fg(this),Ug(this));placement=(zg(this),qg(this));delay=(Kg(this),$g(this));closeDelay=(Gg(this),Wg(this));portal=(Hg(this),Yg(this));disabled=(Ng(this),Xg(this));contentLabel=(Qg(this),Jg(this));contentTarget=(Zg(this),eb(this));openChangeEvent=(tb(this),ib(this));contentId=(rb(this),re("rui-hover-card"));controller=null;showTimer=null;hideTimer=null;longPressTimer=null;openedByKeyboard=!1;connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.onPointerEnter),this.addEventListener("pointerleave",this.onPointerLeave),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointercancel",this.onPointerUp)}onConnected(){this.syncCard()}disconnectedCallback(){this.clearTimers(),this.open&&Vo(),this.controller?.destroy(),this.controller=null,this.removeEventListener("pointerenter",this.onPointerEnter),this.removeEventListener("pointerleave",this.onPointerLeave),this.removeEventListener("pointerdown",this.onPointerDown),this.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointercancel",this.onPointerUp),super.disconnectedCallback()}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.longPressTimer&&clearTimeout(this.longPressTimer),this.showTimer=null,this.hideTimer=null,this.longPressTimer=null}getAnchor(){let e=this.querySelector("[data-hover-card-trigger]");return e instanceof HTMLElement?si(e)??e:si(this)??this}getFloatingElement(){return this.controller?.getFloatingElement()??this.contentTarget}ensureController(){return this.controller||(this.controller=new ce({getAnchor:()=>this.getAnchor(),getFloating:()=>this.contentTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:ab,portal:this.portal})),this.controller}syncCard(){let e=this.getAnchor(),i=this.contentTarget;i&&(i.id=this.contentId),e&&(e.setAttribute("aria-controls",this.contentId),e.setAttribute("aria-expanded",String(this.open)));let r=this.ensureController();r.updateConfig({getAnchor:()=>this.getAnchor(),getFloating:()=>this.contentTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:ab,portal:this.portal}),r.sync(),this.syncContentPointerBridge()}syncContentPointerBridge(){let e=this.getFloatingElement();e&&(e.removeEventListener("pointerenter",this.onPointerEnter),e.removeEventListener("pointerleave",this.onPointerLeave),this.open&&(e.addEventListener("pointerenter",this.onPointerEnter),e.addEventListener("pointerleave",this.onPointerLeave)))}setOpen(e,i=!0){if(this.disabled&&e)return;if(this.open===e){this.syncCard();return}let r=this.open;this.open=e,e?Pg():r&&Vo(),i&&this.openChangeEvent.emit({open:e}),this.syncCard()}scheduleShow(e=!1){if(this.disabled||this.open)return;this.clearTimers(),this.openedByKeyboard=e;let i=jg(this.delay);if(i<=0){this.setOpen(!0);return}this.showTimer=setTimeout(()=>this.setOpen(!0),i)}scheduleHide(){this.clearTimers();let e=this.closeDelay>0?this.closeDelay:0;if(e<=0){this.setOpen(!1);return}this.hideTimer=setTimeout(()=>this.setOpen(!1),e)}isTouchPointer(e){return e.pointerType==="touch"}onDocumentKeydown(e){if(!this.open||e.key!=="Escape")return;e.preventDefault();let i=this.getAnchor();this.setOpen(!1),i&&document.activeElement!==i&&i.focus()}onFocusIn(e){tt(this.getAnchor(),this.getFloatingElement(),e.relatedTarget)&&this.scheduleShow(!0)}onFocusOut(e){tt(this.getAnchor(),this.getFloatingElement(),e.relatedTarget)&&this.scheduleHide()}onHostKeydown(e){if(!this.open||e.key!=="Tab"||e.shiftKey||!this.openedByKeyboard)return;let i=this.getFloatingElement();if(!i)return;let r=si(i);r&&(e.preventDefault(),r.focus())}onPointerEnter(e){this.isTouchPointer(e)||this.scheduleShow()}onPointerLeave(e){this.isTouchPointer(e)||this.scheduleHide()}onPointerDown(e){this.disabled||!this.isTouchPointer(e)||(this.clearTimers(),this.longPressTimer=setTimeout(()=>{this.openedByKeyboard=!1,this.setOpen(!0)},HV))}onPointerUp(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}static{Bg()}};function YV({children:t,class:e,...i}){return Ki("span",{class:"rui-hover-card__trigger","data-ref":"trigger",children:Ki("span",{...i,"data-hover-card-trigger":!0,class:j(e),children:t})})}function NV({children:t,class:e,...i}){return Ki("div",{...i,"data-ref":"content",class:j("rui-hover-card__content","rui-floating",e),role:"dialog",hidden:!0,children:t})}function XV({children:t,contentLabel:e=ko,...i}){return Ki("rui-hover-card",{contentLabel:e,...i,children:Ki("span",{class:"rui-hover-card",children:t})})}import{jsx as QV}from"@ecopages/jsx/jsx-runtime";function JV(t){let{class:e,type:i="text",mask:r,placeholder:s,"on:input":d,...h}=t,a=r?Dn(r):s;return QV("input",{...h,type:i,placeholder:a,"on:input":r?A=>{if(r){let S=A.target;S.value=On(S.value,r)}typeof d=="function"?d(A):d!=null&&typeof d=="object"&&"handleEvent"in d&&d.handleEvent(A)}:d,inputmode:r?"numeric":void 0,[ot]:"","data-rui-control-type":"text",class:j("rui-input",e)})}import{jsx as Mo}from"@ecopages/jsx/jsx-runtime";function ZV({children:t,class:e,...i}){return Mo("div",{...i,role:"group",class:j("rui-input-group",e),children:t})}function ek({children:t,align:e="start",class:i,...r}){return Mo("div",{...r,class:j("rui-input-group__addon",`rui-input-group__addon--${e}`,i),children:t})}function tk({children:t,class:e,...i}){return Mo("span",{...i,class:j("rui-input-group__text",e),children:t})}import{bindTo as Zb,customElement as dk,event as hk,onEvent as Gi,onUpdated as pk,prop as Oe,query as qt}from"@ecopages/radiant";import{FormAssociatedElement as ev}from"@ecopages/radiant/form-associated-element";function ik(t){if(!Number.isFinite(t)||t<=0)return 0;let e=t.toString().match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);if(!e)return 0;let i=e[1]?.length??0,r=e[2]?Number(e[2]):0;return Math.min(15,Math.max(0,i-r))}function mi(t,e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.min(15,Math.round(e)):ik(t)}function Ge(t,e){return Number.isFinite(t)?t.toFixed(e):""}function $i(t,e,i){if(Object.is(t,e))return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;let r=Number.isFinite(i)&&i>0?i:1,s=Number.EPSILON*Math.max(Math.abs(t),Math.abs(e),r)*4;return Math.abs(t-e)<=Math.min(s,r*1e-6)}function We(t,e,i){let r=Number.isFinite(t)?t:0,s=Number.isFinite(e)?e:100,d=Math.min(r,s),h=Math.max(r,s),a=Number.isFinite(i)&&i>0?i:1,E=h-d,A=S=>{let I=Number.isFinite(S)?S:d,T=d+Math.round((I-d)/a)*a;return Math.min(h,Math.max(d,T))};return{lowerBound:d,upperBound:h,step:a,clamp:A,ratioFor:S=>E===0?0:(A(S)-d)/E,valueFromRatio:S=>{let I=Math.min(1,Math.max(0,Number.isFinite(S)?S:0));return A(d+I*E)}}}function Xr(t,e,i){switch(i){case"ArrowRight":case"ArrowUp":return t.clamp(e+t.step);case"ArrowLeft":case"ArrowDown":return t.clamp(e-t.step);case"Home":return t.lowerBound;case"End":return t.upperBound;case"PageUp":return t.clamp(e+t.step*10);case"PageDown":return t.clamp(e-t.step*10);default:return}}var ub=120,gi=300,rk=14,nk=gi+(360-gi)/2;function ok(t){return Math.min(100,Math.max(0,Number.isFinite(t)?Number(t):rk))}function ak(t,e,i){return i.replace("{value}",Ge(t,e))}function Qr(t,e,i,r,s,d,h){let a=We(e,i,r),E=ok(s),A=50-E/2,S=2*Math.PI*A,I=gi/360*S,T=a.clamp(t),K=mi(r,h);return{startAngle:ub,strokeWidth:E,radius:A,circumference:S,arcLength:I,progressLength:a.ratioFor(T)*I,valueText:ak(T,K,d)}}function Lo(t,e,i,r){if(i.width===0||i.height===0)return null;let d=(Math.atan2(e-(i.top+i.height/2),t-(i.left+i.width/2))*180/Math.PI-ub+360)%360,h=d<=gi?d:d<=nk?gi:0;return r.valueFromRatio(h/gi)}var cb,db,hb,pb,fb,mb,gb,bb,vb,yb,_b,xb,wb,Tb,Sb,Eb,Rb,Ab,Ib,Cb,Db,Ob,Vb,kb,Mb,Lb,Pb,jb,Fb,Bb,Ub,zb,qb,Kb,$b,Gb,Wb,Hb,Yb,Nb,Xb,Qb;function sk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Jb(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Jb(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:lk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ck(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function lk(t){var e=uk(t,"string");return typeof e=="symbol"?e:e+""}function uk(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jb(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ck(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Po=50,iv,tv=class extends ev{static{({e:[hb,pb,fb,mb,gb,bb,vb,yb,_b,xb,wb,Tb,Sb,Eb,Rb,Ab,Ib,Cb,Db,Ob,Vb,kb,Mb,Lb,Pb,jb,Fb,Bb,Ub,zb,qb,Kb,$b,Gb,Wb,Hb,Yb,Nb,Xb,Qb,cb],c:[iv,db]}=sk(this,[dk("rui-knob")],[[Oe({type:Number,reflect:!0,defaultValue:Po}),0,"value"],[Oe({type:Number,defaultValue:0}),0,"min"],[Oe({type:Number,defaultValue:100}),0,"max"],[Oe({type:Number,defaultValue:1}),0,"step"],[Oe({type:Number,attribute:"value-precision",defaultValue:Number.NaN}),0,"valuePrecision"],[[Oe({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),Zb({ref:"control",attr:"aria-readonly",map:e=>String(e)})],0,"readOnly"],[[Oe({type:String,defaultValue:""}),Zb([{ref:"label",bool:"hidden",invert:!0},{ref:"label",text:!0},{ref:"control",attr:"aria-label",map:e=>e||void 0}])],0,"label"],[Oe({type:Number,defaultValue:void 0}),0,"size"],[Oe({type:Number,attribute:"stroke-width",defaultValue:14}),0,"strokeWidth"],[Oe({type:Boolean,attribute:"show-value",defaultValue:!0}),0,"showValue"],[Oe({type:String,attribute:"value-position",defaultValue:"center"}),0,"valuePosition"],[Oe({type:String,attribute:"value-template",defaultValue:"{value}"}),0,"valueTemplate"],[hk({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[qt({ref:"root"}),0,"rootTarget"],[qt({ref:"label"}),0,"labelTarget"],[qt({ref:"control"}),0,"controlTarget"],[qt({ref:"track"}),0,"trackTarget"],[qt({ref:"progress"}),0,"progressTarget"],[qt({ref:"centerValue"}),0,"centerValueTarget"],[qt({ref:"belowValue"}),0,"belowValueTarget"],[pk(["value","min","max","step","valuePrecision","disabled","readOnly","effectiveDisabled","name","label","size","strokeWidth","showValue","valuePosition","valueTemplate"]),2,"onPropsUpdated"],[Gi({ref:"control",type:"pointerdown"}),2,"onPointerDown"],[Gi({ref:"control",type:"pointermove"}),2,"onPointerMove"],[Gi({ref:"control",type:"pointerup"}),2,"onPointerUp"],[Gi({ref:"control",type:"pointercancel"}),2,"onPointerCancel"],[Gi({ref:"control",type:"keydown"}),2,"onKeydown"]],0,void 0,ev))}value=(cb(this),hb(this));min=(pb(this),fb(this));max=(mb(this),gb(this));step=(bb(this),vb(this));valuePrecision=(yb(this),_b(this));readOnly=(xb(this),wb(this));label=(Tb(this),Sb(this));size=(Eb(this),Rb(this));strokeWidth=(Ab(this),Ib(this));showValue=(Cb(this),Db(this));valuePosition=(Ob(this),Vb(this));valueTemplate=(kb(this),Mb(this));changeEvent=(Lb(this),Pb(this));rootTarget=(jb(this),Fb(this));labelTarget=(Bb(this),Ub(this));controlTarget=(zb(this),qb(this));trackTarget=(Kb(this),$b(this));progressTarget=(Gb(this),Wb(this));centerValueTarget=(Hb(this),Yb(this));belowValueTarget=(Nb(this),Xb(this));activePointerId=(Qb(this),null);lastEmitted=null;rangeCommitQueued=!1;onConnected(){this.syncPresentation()}formValue(){return this.name?String(this.numericRange.clamp(this.value)):null}formState(){return String(this.value)}restoreFormState(e){this.value=Number(e),this.syncPresentation()}onPropsUpdated(){this.syncPresentation()}get numericRange(){return We(this.min,this.max,this.step)}get resolvedSize(){return typeof this.size=="number"&&Number.isFinite(this.size)&&this.size>0?this.size:void 0}get resolvedValuePosition(){return this.valuePosition==="below"?"below":"center"}paint(e){let i=Qr(e,this.min,this.max,this.step,this.strokeWidth,this.valueTemplate,this.valuePrecision),r=this.resolvedValuePosition;this.syncKnobLayout(r),this.syncControlValues(e,i.valueText),this.syncRing(i),this.syncReadout(i.valueText,r)}syncKnobLayout(e){this.rootTarget?.classList.toggle("rui-knob--value-below",e==="below"),this.resolvedSize?this.style.setProperty("--rui-knob-size",`${this.resolvedSize}px`):this.style.removeProperty("--rui-knob-size")}syncControlValues(e,i){let r=this.controlTarget;r&&(r.setAttribute("aria-valuemin",String(this.numericRange.lowerBound)),r.setAttribute("aria-valuemax",String(this.numericRange.upperBound)),r.setAttribute("aria-valuenow",String(e)),r.setAttribute("aria-valuetext",i))}syncRing(e){for(let i of[this.trackTarget,this.progressTarget])i?.setAttribute("r",String(e.radius)),i?.setAttribute("stroke-width",String(e.strokeWidth));this.trackTarget?.setAttribute("stroke-dasharray",`${e.arcLength} ${e.circumference}`),this.progressTarget?.setAttribute("stroke-dasharray",`${e.progressLength} ${e.circumference}`)}syncReadout(e,i){for(let[r,s]of[[this.centerValueTarget,this.showValue&&i==="center"],[this.belowValueTarget,this.showValue&&i==="below"]])r&&(r.textContent=e,r.toggleAttribute("hidden",!s))}syncPresentation(){this.controlTarget&&(this.controlTarget.disabled=this.effectiveDisabled),this.paint(this.numericRange.clamp(this.value)),this.queueNormalizedValueCommit()}queueNormalizedValueCommit(){this.rangeCommitQueued||(this.rangeCommitQueued=!0,queueMicrotask(()=>{this.rangeCommitQueued=!1;let e=this.numericRange.clamp(this.value);this.paint(e),$i(this.value,e,this.step)||(this.value=e)}))}commitValue(e){if(this.effectiveDisabled||this.readOnly)return;let i=this.numericRange.clamp(e);this.paint(i),!$i(i,this.value,this.step)&&(this.value=i,this.lastEmitted!==i&&(this.lastEmitted=i,this.changeEvent.emit({value:i})))}onPointerDown(e){if(e.button!==0||this.effectiveDisabled||this.readOnly)return;this.activePointerId=e.pointerId,this.lastEmitted=this.value,this.controlTarget.setPointerCapture(e.pointerId);let i=this.controlTarget.getBoundingClientRect(),r=Lo(e.clientX,e.clientY,i,this.numericRange);r!=null&&this.commitValue(r),e.preventDefault()}onPointerMove(e){if(e.pointerId!==this.activePointerId)return;let i=this.controlTarget.getBoundingClientRect(),r=Lo(e.clientX,e.clientY,i,this.numericRange);r!=null&&this.commitValue(r)}onPointerUp(e){e.pointerId===this.activePointerId&&(this.controlTarget.releasePointerCapture(e.pointerId),this.activePointerId=null)}onPointerCancel(e){e.pointerId===this.activePointerId&&(this.controlTarget.hasPointerCapture(e.pointerId)&&this.controlTarget.releasePointerCapture(e.pointerId),this.activePointerId=null)}onKeydown(e){if(this.effectiveDisabled||this.readOnly)return;let i=Xr(this.numericRange,this.value,e.key);i!=null&&(e.preventDefault(),this.lastEmitted=this.value,this.commitValue(i))}static{db()}};import{jsx as st,jsxs as jo}from"@ecopages/jsx/jsx-runtime";function fk({value:t=Po,min:e=0,max:i=100,step:r=1,disabled:s=!1,readOnly:d=!1,label:h,name:a,size:E,strokeWidth:A=14,showValue:S=!0,valuePosition:I="center",valueTemplate:T="{value}",valuePrecision:K,...$}){let V=We(e,i,r),G=V.clamp(t),W=Qr(G,e,i,r,A,T,K);return st(mk,{props:$,value:G,min:e,max:i,step:r,disabled:s,readOnly:d,label:h,name:a,size:E,strokeWidth:A,showValue:S,valuePosition:I,valueTemplate:T,valuePrecision:K,ring:W,range:V})}function mk({props:t,ring:e,range:i,...r}){return st("rui-knob",{...t,value:r.value,min:r.min,max:r.max,step:r.step,disabled:r.disabled,"prop:readOnly":r.readOnly,label:r.label,name:r.name,size:r.size,strokeWidth:r.strokeWidth,showValue:r.showValue,valuePosition:r.valuePosition,valueTemplate:r.valueTemplate,valuePrecision:r.valuePrecision,style:r.size?{"--rui-knob-size":`${r.size}px`}:void 0,children:st(gk,{knob:r,ring:e,range:i})})}function gk({knob:t,ring:e,range:i}){let r=t.valuePosition==="below";return jo("div",{class:r?"rui-knob rui-knob--value-below":"rui-knob","data-ref":"root",children:[st("span",{class:"rui-knob__label","data-ref":"label",hidden:!t.label,children:t.label}),st(bk,{knob:t,ring:e,range:i,valueBelow:r}),st("span",{class:"rui-knob__value rui-knob__value--below","data-ref":"belowValue","aria-hidden":"true",hidden:!t.showValue||!r,children:e.valueText})]})}function bk({knob:t,ring:e,range:i,valueBelow:r}){return jo("button",{type:"button",class:"rui-knob__control","data-ref":"control","data-knob-control":!0,role:"slider","aria-label":t.label||void 0,"aria-valuemin":i.lowerBound,"aria-valuemax":i.upperBound,"aria-valuenow":t.value,"aria-valuetext":e.valueText,"aria-readonly":t.readOnly,disabled:t.disabled,children:[jo("svg",{class:"rui-knob__svg",viewBox:"0 0 100 100","aria-hidden":"true",children:[st("circle",{class:"rui-knob__track","data-ref":"track",cx:"50",cy:"50",r:e.radius,fill:"none","stroke-width":e.strokeWidth,"stroke-dasharray":`${e.arcLength} ${e.circumference}`,transform:`rotate(${e.startAngle} 50 50)`}),st("circle",{class:"rui-knob__progress","data-ref":"progress",cx:"50",cy:"50",r:e.radius,fill:"none","stroke-width":e.strokeWidth,"stroke-dasharray":`${e.progressLength} ${e.circumference}`,transform:`rotate(${e.startAngle} 50 50)`})]}),st("span",{class:"rui-knob__value","data-ref":"centerValue","aria-hidden":"true",hidden:!t.showValue||r,children:e.valueText})]})}import{jsx as vk}from"@ecopages/jsx/jsx-runtime";function yk({children:t,htmlFor:e,class:i,...r}){return vk("label",{...r,[qr]:"",class:j("rui-label",i),htmlFor:e,children:t})}import{RadiantElement as vv,bindTo as Ak,bound as Ik,customElement as Ck,event as yv,onEvent as Tt,onUpdated as Dk,prop as _v,query as xv}from"@ecopages/radiant";var _k=200,xk=250,wk=6,bi=class{config;popovers=new Map;openMenus=new Set;openTimers=new Map;closeTimers=new Map;constructor(e){this.config=e}sync(){for(let e of this.getMenus())for(let i of this.getDirectItems(e)){let r=this.getSubmenu(i);r&&(i.setAttribute("aria-haspopup","menu"),i.hasAttribute("aria-expanded")||i.setAttribute("aria-expanded","false"),r.id||(r.id=re("rui-submenu")),i.setAttribute("aria-controls",r.id),r.hidden=i.getAttribute("aria-expanded")!=="true")}}handlePointerOver(e){let i=this.getDirectItem(e.target);if(!i||this.isDisabled(i)||(this.cancelCloseFor(i),this.cancelAncestorCloseTimers(i),!this.getSubmenu(i)||i.getAttribute("aria-expanded")==="true"))return;this.closeSiblingBranches(i),this.cancelOpenFor(i);let s=setTimeout(()=>{this.openTimers.delete(i),this.openSubmenu(i,!1)},_k);this.openTimers.set(i,s)}handlePointerOut(e){let i=this.getDirectItem(e.target);if(!i)return;let r=e.relatedTarget,s=this.getSubmenu(i);s&&r&&s.contains(r)||r&&i.contains(r)||(this.cancelOpenFor(i),i.getAttribute("aria-expanded")==="true"&&this.scheduleClose(i))}handleFocusOut(e){let i=this.getDirectItem(e.target);if(!i||i.getAttribute("aria-expanded")!=="true")return;let r=this.getSubmenu(i),s=e.relatedTarget;r&&s&&r.contains(s)||this.closeSubmenu(i,!1)}handleKeydown(e){let i=this.getDirectItem(e.target),r=i?.parentElement;if(!i||!r||r.getAttribute("role")!=="menu")return!1;let s=this.keyHandlers[e.key];if(!s)return!1;let d=s.call(this,{item:i,items:this.getFocusableItems(r),menu:r,submenu:this.getSubmenu(i)});return d&&e.key!=="Tab"&&e.preventDefault(),d}keyHandlers={ArrowDown:this.focusNextItem,ArrowUp:this.focusPreviousItem,Home:this.focusFirstItem,End:this.focusLastItem,ArrowRight:this.openNestedMenu,ArrowLeft:this.closeNestedMenu,Enter:this.activateOrOpenItem," ":this.activateOrOpenItem,Escape:this.closeRootMenu,Tab:this.closeMenuForTab};focusNextItem(e){return this.focusRelativeItem(e,1)}focusPreviousItem(e){return this.focusRelativeItem(e,-1)}focusRelativeItem(e,i){let r=e.items.indexOf(e.item);return r<0||!e.items.length?!1:(e.items[(r+i+e.items.length)%e.items.length]?.focus(),!0)}focusFirstItem(e){return e.items[0]?.focus(),!0}focusLastItem(e){return e.items.at(-1)?.focus(),!0}openNestedMenu(e){return e.submenu?(this.openSubmenu(e.item,!0),!0):!1}closeNestedMenu(e){if(this.getRootMenu()===e.menu)return!1;let i=this.getTriggerForMenu(e.menu);return i&&this.closeSubmenu(i,!0),!0}activateOrOpenItem(e){return e.submenu?this.openSubmenu(e.item,!0):this.config.onActivate(e.item),!0}closeRootMenu(){return this.config.onCloseRoot(!0),!0}closeMenuForTab(){return this.config.onCloseRoot(!1),!0}handleClick(e){let i=this.getDirectItem(e.target);return!i||this.isDisabled(i)?!1:this.getSubmenu(i)?(e.preventDefault(),this.closeSiblingBranches(i),this.openSubmenu(i,!1),!0):(this.config.onActivate(i),!0)}closeAll(){for(let e of Array.from(this.openMenus)){let i=this.getTriggerForMenu(e);i&&this.closeSubmenu(i,!1)}this.clearTimers()}getFocusableItems(e){return this.getDirectItems(e).filter(i=>!this.isDisabled(i))}destroy(){this.closeAll();for(let e of this.popovers.values())e.destroy();this.popovers.clear()}openSubmenu(e,i){let r=this.getSubmenu(e);if(!r||this.isDisabled(e))return;this.cancelOpenFor(e),this.cancelCloseFor(e),this.closeSiblingBranches(e),e.setAttribute("aria-expanded","true"),r.hidden=!1,this.openMenus.add(r);let s=this.popovers.get(r);s||(s=new ce({getAnchor:()=>e,getFloating:()=>r,getOpen:()=>e.getAttribute("aria-expanded")==="true",getPlacement:()=>"right-start",gap:wk,portal:!1}),this.popovers.set(r,s)),s.updateConfig({getAnchor:()=>e,getOpen:()=>e.getAttribute("aria-expanded")==="true"}),s.sync(),i&&this.getFocusableItems(r)[0]?.focus()}closeSubmenu(e,i){let r=this.getSubmenu(e);if(r){for(let s of this.getDirectItems(r))this.closeSubmenu(s,!1);this.cancelOpenFor(e),this.cancelCloseFor(e),e.setAttribute("aria-expanded","false"),r.hidden=!0,this.openMenus.delete(r),this.popovers.get(r)?.teardown(),i&&e.focus()}}closeSiblingBranches(e){let i=e.parentElement;if(i)for(let r of this.getDirectItems(i))r!==e&&r.getAttribute("aria-expanded")==="true"&&this.closeSubmenu(r,!1)}scheduleClose(e){this.cancelCloseFor(e);let i=setTimeout(()=>{this.closeTimers.delete(e),this.closeSubmenu(e,!1)},xk);this.closeTimers.set(e,i)}getMenus(){return Array.from(this.config.root.querySelectorAll('[role="menu"]'))}getRootMenu(){return this.config.getRootMenu()}getDirectItems(e){return Array.from(e.querySelectorAll('[role="menuitem"]')).filter(i=>i.closest('[role="menu"]')===e)}getDirectItem(e){if(!(e instanceof HTMLElement))return null;let i=e.closest('[role="menuitem"]');return i&&i.closest('[role="menu"]')&&this.config.root.contains(i)?i:null}getSubmenu(e){let i=e.nextElementSibling;return i instanceof HTMLElement&&i.getAttribute("role")==="menu"?i:null}getTriggerForMenu(e){let i=e.previousElementSibling;return i instanceof HTMLElement&&i.getAttribute("role")==="menuitem"?i:null}isDisabled(e){return e.getAttribute("aria-disabled")==="true"||e instanceof HTMLButtonElement&&e.disabled}cancelOpenFor(e){let i=this.openTimers.get(e);i&&clearTimeout(i),this.openTimers.delete(e)}cancelCloseFor(e){let i=this.closeTimers.get(e);i&&clearTimeout(i),this.closeTimers.delete(e)}cancelAncestorCloseTimers(e){let i=e.closest('[role="menu"]');for(;i;){let r=this.getTriggerForMenu(i);if(!r)return;this.cancelCloseFor(r),i=r.closest('[role="menu"]')}}clearTimers(){for(let e of this.openTimers.values())clearTimeout(e);for(let e of this.closeTimers.values())clearTimeout(e);this.openTimers.clear(),this.closeTimers.clear()}};var rv,nv,ov,av,sv,lv,uv,cv,dv,hv,pv,fv,mv,gv;function Tk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:bv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||bv(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Sk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Rk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Sk(t){var e=Ek(t,"string");return typeof e=="symbol"?e:e+""}function Ek(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bv(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Rk(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Ok=6,Tv,wv=class extends vv{static{({e:[ov,av,sv,lv,uv,cv,dv,hv,pv,fv,mv,gv,rv],c:[Tv,nv]}=Tk(this,[Ck("rui-menu-button")],[[[_v({type:Boolean,reflect:!0,defaultValue:!1}),Ak([{ref:"trigger",attr:"aria-expanded"},{ref:"menu",bool:"hidden",invert:!0}])],0,"open"],[_v({type:String,defaultValue:"bottom-start"}),0,"placement"],[xv({ref:"trigger"}),0,"triggerTarget"],[xv({ref:"menu"}),0,"menuTarget"],[yv({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[yv({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[Ik,Dk(["open","placement"])],2,"syncOpenState"],[Tt({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[Tt({ref:"trigger",type:"click"}),2,"onTriggerClick"],[Tt({ref:"trigger",type:"keydown"}),2,"onTriggerKeydown"],[Tt({ref:"menu",type:"keydown"}),2,"onMenuKeydown"],[Tt({ref:"menu",type:"pointerover"}),2,"onMenuPointerOver"],[Tt({ref:"menu",type:"pointerout"}),2,"onMenuPointerOut"],[Tt({ref:"menu",type:"focusout"}),2,"onMenuFocusOut"],[Tt({selector:'[role="menuitem"]',type:"click"}),2,"onItemClick"]],0,void 0,vv))}open=(rv(this),ov(this));placement=(av(this),sv(this));triggerTarget=(lv(this),uv(this));menuTarget=(cv(this),dv(this));changeEvent=(hv(this),pv(this));closeEvent=(fv(this),mv(this));menuId=(gv(this),re("rui-menu"));popoverController=null;menuTree=null;pendingFocus=null;onConnected(){this.syncOpenState()}disconnectedCallback(){this.menuTree?.destroy(),this.menuTree=null,this.popoverController?.destroy(),this.popoverController=null,super.disconnectedCallback()}getItems(){return this.menuTarget?this.ensureMenuTree().getFocusableItems(this.menuTarget):[]}ensureMenuTree(){return this.menuTree||(this.menuTree=new bi({root:this,getRootMenu:()=>this.menuTarget,onActivate:e=>this.activateItem(e),onCloseRoot:e=>this.setOpen(!1,e?"trigger":null)})),this.menuTree}getSearchInput(){return this.menuTarget?.querySelector("[data-autocomplete-input]")??null}ensurePopoverController(){return this.popoverController||(this.popoverController=new ce({getAnchor:()=>this.triggerTarget,getFloating:()=>this.menuTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:Ok,portal:!1})),this.popoverController}syncOpenState(){if(!this.triggerTarget||!this.menuTarget)return;this.menuTarget.id=this.menuId,this.triggerTarget.setAttribute("aria-controls",this.menuId),this.triggerTarget.setAttribute("aria-haspopup","menu");let e=this.ensureMenuTree();e.sync(),this.open||e.closeAll();let i=this.ensurePopoverController();i.updateConfig({getPlacement:()=>this.placement,getOpen:()=>this.open}),i.sync();let r=this.pendingFocus;if(this.pendingFocus=null,!r)return;if(r==="trigger"){this.triggerTarget?.focus();return}let s=this.getSearchInput();if(s){s.focus();return}if(r==="first"&&this.getItems()[0]?.focus(),r==="last"){let d=this.getItems();d[d.length-1]?.focus()}}setOpen(e,i=null){let r=this.open;this.pendingFocus=i,this.open=e,r&&!e&&this.closeEvent.emit(),r===e&&this.syncOpenState()}onDocumentPointerDown(e){if(!this.open)return;let i=e.target;Ke(this.triggerTarget,this.menuTarget,i)&&this.setOpen(!1)}onTriggerClick(){this.setOpen(!this.open,this.open?null:"first")}onTriggerKeydown(e){switch(e.key){case"ArrowDown":case"Enter":case" ":e.preventDefault(),this.setOpen(!0,"first");break;case"ArrowUp":e.preventDefault(),this.setOpen(!0,"last");break;default:break}}onMenuKeydown(e){this.ensureMenuTree().handleKeydown(e)}onMenuPointerOver(e){this.ensureMenuTree().handlePointerOver(e)}onMenuPointerOut(e){this.ensureMenuTree().handlePointerOut(e)}onMenuFocusOut(e){this.ensureMenuTree().handleFocusOut(e)}onItemClick(e){this.ensureMenuTree().handleClick(e)}activateItem(e){let i=e.getAttribute("data-value")||e.textContent?.trim()||"";this.changeEvent.emit({value:i}),this.setOpen(!1,"trigger")}static{nv()}};import{jsx as He,jsxs as Sv}from"@ecopages/jsx/jsx-runtime";import{jsx as Vk}from"@ecopages/jsx/jsx-runtime";function Wi({orientation:t="horizontal",class:e,...i}){return Vk("hr",{...i,class:j("rui-separator",e),role:"separator","aria-orientation":t,"data-orientation":t})}import{Fragment as kk,jsxs as Mk}from"@ecopages/jsx/jsx-runtime";function Hi(t,e){return t.map(i=>{if(i.type==="separator")return e.Separator({id:i.id});let r=!!i.items?.length;return Mk(kk,{children:[e.Item({value:i.value,disabled:i.disabled,hasSubmenu:r,children:i.label}),r?e.Submenu({children:Hi(i.items??[],e)}):null]})})}function Ev({children:t,class:e,variant:i="filled",size:r="md",...s}){return Sv(Je,{...s,variant:i,size:r,"data-ref":"trigger",class:j("rui-menu-button__trigger",e),"aria-haspopup":"menu",children:[t,He(Xe,{class:"rui-menu-button__chevron"})]})}function Rv({children:t,class:e,...i}){return He("div",{...i,"data-ref":"menu",class:j("rui-menu-button__menu","rui-popover","rui-floating",e),role:"menu",children:t})}function Av({children:t,class:e,...i}){return He("div",{...i,"data-ref":"submenu-menu",class:j("rui-menu-button__menu","rui-menu-button__submenu","rui-popover","rui-floating",e),role:"menu",hidden:!0,children:t})}function Iv({children:t,value:e,disabled:i,hasSubmenu:r,class:s,...d}){return He("button",{...d,type:"button",class:j("rui-menu-button__item",s),role:"menuitem","data-value":e,"aria-haspopup":r?"menu":void 0,"aria-disabled":i?"true":void 0,disabled:i,tabIndex:-1,children:t})}function Lk({trigger:t,items:e,children:i,class:r,...s}){return t==null&&e==null?He("rui-menu-button",{...s,class:j("rui-menu-button",r),children:i}):Sv("rui-menu-button",{...s,class:j("rui-menu-button",r),children:[He(Ev,{children:t}),He(Rv,{children:e?Hi(e,{Item:d=>He(Iv,{...d}),Submenu:d=>He(Av,{...d}),Separator:d=>He(Wi,{},d.id)}):i})]})}import{RadiantElement as Pv,customElement as Uk,event as zk,onEvent as St,prop as qk}from"@ecopages/radiant";var Cv,Dv,Ov,Vv,kv,Mv;function Pk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Lv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Lv(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:jk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Bk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function jk(t){var e=Fk(t,"string");return typeof e=="symbol"?e:e+""}function Fk(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lv(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Bk(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Fv,jv=class extends Pv{static{({e:[Ov,Vv,kv,Mv,Cv],c:[Fv,Dv]}=Pk(this,[Uk("rui-menubar")],[[qk({type:String,defaultValue:""}),0,"label"],[zk({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[St({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[St({selector:'[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]',type:"keydown"}),2,"onTopKeydown"],[St({selector:'[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]',type:"click"}),2,"onTopClick"],[St({selector:'[role="menu"] > [role="menuitem"]',type:"keydown"}),2,"onMenuKeydown"],[St({selector:'[role="menu"] > [role="menuitem"]',type:"click"}),2,"onMenuItemClick"],[St({selector:'[role="menuitem"]',type:"pointerover"}),2,"onPointerOver"],[St({selector:'[role="menuitem"]',type:"pointerout"}),2,"onPointerOut"],[St({selector:'[role="menuitem"]',type:"focusout"}),2,"onFocusOut"]],0,void 0,Pv))}label=(Cv(this),Ov(this));changeEvent=(Vv(this),kv(this));openRoot=(Mv(this),null);popoverController=null;menuTree=null;getTopItems(){return Array.from(this.querySelectorAll('[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]'))}getMenuFor(e){return e.closest('[data-ref="menubar-root"]')?.querySelector(':scope > [role="menu"]')??null}onConnected(){ue(this.getTopItems(),0),this.ensureMenuTree().sync()}disconnectedCallback(){this.menuTree?.destroy(),this.menuTree=null,this.popoverController?.destroy(),this.popoverController=null,super.disconnectedCallback()}ensureMenuTree(){return this.menuTree||(this.menuTree=new bi({root:this,getRootMenu:()=>this.getOpenMenuSurface(),onActivate:e=>this.activateItem(e),onCloseRoot:e=>this.closeOpenMenu(e)})),this.menuTree}getOpenMenuAnchor(){return this.openRoot?this.openRoot.querySelector(':scope > [role="menuitem"]'):null}getOpenMenuSurface(){return this.openRoot?this.openRoot.querySelector(':scope > [role="menu"]'):null}syncOpenMenuPosition(){let e=this.getOpenMenuAnchor(),i=this.getOpenMenuSurface();!e||!i||(this.popoverController||(this.popoverController=new ce({getAnchor:()=>this.getOpenMenuAnchor(),getFloating:()=>this.getOpenMenuSurface(),getOpen:()=>!!this.openRoot,getPlacement:()=>"bottom-start",gap:6,portal:!1})),this.popoverController.updateConfig({getAnchor:()=>this.getOpenMenuAnchor(),getFloating:()=>this.getOpenMenuSurface(),getOpen:()=>!!this.openRoot}),this.popoverController.sync())}closeOpenMenu(e=!1){if(!this.openRoot)return;this.menuTree?.closeAll();let i=this.openRoot.querySelector(':scope > [role="menuitem"]'),r=this.openRoot.querySelector(':scope > [role="menu"]');i&&i.setAttribute("aria-expanded","false"),r&&(r.hidden=!0),this.openRoot=null,this.popoverController?.teardown(),e&&i&&i.focus()}openMenu(e,i="first"){let r=e.closest('[data-ref="menubar-root"]'),s=this.getMenuFor(e);!r||!s||(this.openRoot&&this.openRoot!==r&&this.closeOpenMenu(),e.setAttribute("aria-expanded","true"),s.hidden=!1,this.openRoot=r,this.syncOpenMenuPosition(),this.ensureMenuTree().sync(),i==="first"&&this.ensureMenuTree().getFocusableItems(s)[0]?.focus())}onDocumentPointerDown(e){this.openRoot&&Ke(this.getOpenMenuAnchor(),this.getOpenMenuSurface(),e.target)&&this.closeOpenMenu()}onTopKeydown(e){let i=this.getTopItems(),r=e.target.closest('[role="menuitem"]');if(!r||!i.includes(r))return;if(e.key==="ArrowDown"||e.key==="Enter"||e.key===" "){this.getMenuFor(r)&&(e.preventDefault(),this.openMenu(r,"first"));return}if(e.key==="Escape"){e.preventDefault(),this.closeOpenMenu(!0);return}let s=de({items:i,current:r,key:e.key,orientation:"horizontal"});s.handled&&(e.preventDefault(),this.openRoot&&(this.getMenuFor(s.item)?this.openMenu(s.item,"first"):this.closeOpenMenu()))}onTopClick(e){let i=e.target.closest('[role="menuitem"]');if(!i||!this.getTopItems().includes(i))return;if(!this.getMenuFor(i)){this.closeOpenMenu();return}i.getAttribute("aria-expanded")==="true"?this.closeOpenMenu():this.openMenu(i,null)}onMenuKeydown(e){let i=e.target.closest('[role="menu"]'),r=e.target.closest('[role="menuitem"]');if(!i||!r||!this.contains(i)||this.ensureMenuTree().handleKeydown(e)||e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;let s=this.getOpenMenuAnchor();if(!s)return;e.preventDefault();let d=de({items:this.getTopItems(),current:s,key:e.key,orientation:"horizontal"});d.handled&&this.getMenuFor(d.item)&&this.openMenu(d.item,"first")}onMenuItemClick(e){this.ensureMenuTree().handleClick(e)}onPointerOver(e){let r=e.target?.closest('[data-ref="menubar-root"] > [role="menuitem"]');if(r&&this.getTopItems().includes(r)&&this.openRoot&&this.getMenuFor(r)){let s=r.closest('[data-ref="menubar-root"]');s&&s!==this.openRoot&&this.openMenu(r,null);return}this.ensureMenuTree().handlePointerOver(e)}onPointerOut(e){this.ensureMenuTree().handlePointerOut(e)}onFocusOut(e){this.ensureMenuTree().handleFocusOut(e)}activateItem(e){let i=e.getAttribute("data-value")||e.textContent?.trim()||"";this.changeEvent.emit({value:i}),this.closeOpenMenu(!0)}static{Dv()}};import{jsx as Ye,jsxs as Kk}from"@ecopages/jsx/jsx-runtime";function Bv({label:t,children:e,disabled:i}){let r=e!=null;return Kk("div",{class:"rui-menubar__root","data-ref":"menubar-root",children:[Ye("button",{type:"button",class:"rui-menubar__item",role:"menuitem",tabindex:-1,"aria-haspopup":r?"true":void 0,"aria-expanded":r?"false":void 0,"aria-disabled":i?"true":void 0,disabled:i,children:t}),r?Ye("div",{class:"rui-menubar__menu rui-popover rui-floating","data-ref":"menu",role:"menu",hidden:!0,children:e}):null]})}function Uv({children:t,value:e,disabled:i,hasSubmenu:r,class:s,...d}){return Ye("button",{...d,type:"button",class:j("rui-menubar__menu-item",s),role:"menuitem","data-value":e,"aria-haspopup":r?"menu":void 0,"aria-disabled":i?"true":void 0,disabled:i,tabIndex:-1,children:t})}function zv({children:t,class:e,...i}){return Ye("div",{...i,"data-ref":"submenu-menu",class:j("rui-menubar__menu","rui-menubar__submenu","rui-popover","rui-floating",e),role:"menu",hidden:!0,children:t})}function $k({items:t,label:e,children:i,...r}){let s=t!=null?t.map(d=>Ye(Bv,{label:d.label,disabled:d.disabled,children:d.items?.length?Hi(d.items,{Item:h=>Ye(Uv,{...h}),Submenu:h=>Ye(zv,{...h}),Separator:h=>Ye(Wi,{},h.id)}):null})):i;return Ye("rui-menubar",{...r,label:e,children:Ye("div",{class:"rui-menubar","data-ref":"root",role:"menubar","aria-label":e||void 0,children:s})})}import{jsx as Fo,jsxs as Bo}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as ty,customElement as Nk,onUpdated as Xk,prop as Jr,state as Qk}from"@ecopages/radiant";var qv,Kv,$v,Gv,Wv,Hv,Yv,Nv,Xv,Qv,Jv,Zv;function Gk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ey(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ey(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Wk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Yk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Wk(t){var e=Hk(t,"string");return typeof e=="symbol"?e:e+""}function Hk(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ey(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Yk(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var ry,iy=class extends ty{static{({e:[$v,Gv,Wv,Hv,Yv,Nv,Xv,Qv,Jv,Zv,qv],c:[ry,Kv]}=Gk(this,[Nk("rui-meter")],[[Jr({type:Number,reflect:!0,defaultValue:0}),0,"value"],[Jr({type:Number,defaultValue:0}),0,"min"],[Jr({type:Number,defaultValue:100}),0,"max"],[Jr({type:String,defaultValue:""}),0,"label"],[Qk,0,"percent"],[Xk(["value","min","max"]),2,"onRangeUpdated"]],0,void 0,ty))}value=(qv(this),$v(this));min=(Gv(this),Wv(this));max=(Hv(this),Yv(this));label=(Nv(this),Xv(this));percent=(Qv(this),Jv(this,0));resolvedAriaLabel=(Zv(this),this.$.label.map(e=>e||void 0));trackStyle=this.$.percent.map(e=>({"--rui-meter-percent":`${e}%`}));onRangeUpdated(){let e=this.max===this.min?0:Math.round((this.value-this.min)/(this.max-this.min)*100);this.percent=Math.min(100,Math.max(0,e))}render(){return Bo("div",{class:"rui-meter",children:[this.label?Fo("span",{class:"rui-meter__label",children:this.$.label}):null,Bo("meter",{class:"rui-meter__bar",min:this.$.min,max:this.$.max,value:this.$.value,"aria-label":this.resolvedAriaLabel,children:[this.$.percent,"%"]}),Fo("div",{class:"rui-meter__track",style:this.trackStyle,"aria-hidden":"true",children:Fo("div",{class:"rui-meter__fill"})}),Bo("span",{class:"rui-meter__value","aria-hidden":"true",children:[this.$.percent,"%"]})]})}static{Kv()}};import{jsx as Jk}from"@ecopages/jsx/jsx-runtime";function Zk(t){return Jk("rui-meter",{...t})}import{jsx as Kt}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as my,customElement as nM,onEvent as Fe,prop as Zr}from"@ecopages/radiant";var ny,oy,ay,sy,ly,uy,cy,dy,hy,py;function eM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:fy(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||fy(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:tM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return rM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function tM(t){var e=iM(t,"string");return typeof e=="symbol"?e:e+""}function iM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fy(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function rM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var by=200,vy=150,oM=8,yy,gy=class extends my{static{({e:[ay,sy,ly,uy,cy,dy,hy,py,ny],c:[yy,oy]}=eM(this,[nM("rui-navigation-menu")],[[Zr({type:String,defaultValue:""}),0,"label"],[Zr({type:Boolean,reflect:!0,attribute:"open-on-hover",defaultValue:!1}),0,"openOnHover"],[Zr({type:Number,attribute:"hover-delay",defaultValue:by}),0,"hoverDelay"],[Zr({type:Number,attribute:"close-delay",defaultValue:vy}),0,"closeDelay"],[Fe({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[Fe({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[Fe({ref:"root",type:"keydown"}),2,"onRootKeydown"],[Fe({selector:"[data-navigation-trigger]",type:"click"}),2,"onTriggerClick"],[Fe({selector:"[data-navigation-trigger]",type:"pointerover"}),2,"onTriggerPointerOver"],[Fe({selector:"[data-navigation-trigger]",type:"pointerout"}),2,"onTriggerPointerOut"],[Fe({selector:"[data-navigation-panel]",type:"pointerover"}),2,"onPanelPointerOver"],[Fe({selector:"[data-navigation-panel]",type:"pointerout"}),2,"onPanelPointerOut"],[Fe({selector:"[data-navigation-item]",type:"pointerover"}),2,"onBarItemPointerOver"],[Fe({selector:"[data-navigation-item]",type:"keydown"}),2,"onBarItemKeydown"],[Fe({selector:"[data-navigation-panel]",type:"keydown"}),2,"onPanelKeydown"]],0,void 0,my))}label=(ny(this),ay(this));openOnHover=(sy(this),ly(this));hoverDelay=(uy(this),cy(this));closeDelay=(dy(this),hy(this));openValue=(py(this),null);popoverController=null;openTimer=null;closeTimer=null;onConnected(){this.syncPanels(),this.syncBarRovingTabindex(),this.syncPopover()}disconnectedCallback(){this.clearHoverTimers(),this.popoverController?.destroy(),this.popoverController=null,super.disconnectedCallback()}clearHoverTimers(){this.openTimer&&clearTimeout(this.openTimer),this.closeTimer&&clearTimeout(this.closeTimer),this.openTimer=null,this.closeTimer=null}getBarItems(){return Array.from(this.querySelectorAll("[data-navigation-item]"))}syncBarRovingTabindex(){let e=this.getBarItems(),i=Math.max(0,e.findIndex(r=>r.tabIndex===0||r===document.activeElement));ue(e,i)}isBarTrigger(e){return e.hasAttribute("data-navigation-trigger")}getTriggers(){return Array.from(this.querySelectorAll("[data-navigation-trigger]"))}getPanel(e){return this.querySelector(`[data-navigation-panel][data-value="${e}"]`)}getTrigger(e){return this.querySelector(`[data-navigation-trigger][data-value="${e}"]`)}getPanels(){return Array.from(this.querySelectorAll("[data-navigation-panel]"))}getPanelFocusables(e){return kr(e)}getOpenTrigger(){return this.openValue?this.getTrigger(this.openValue):null}getOpenPanel(){return this.openValue?this.getPanel(this.openValue):null}focusPanelEntry(e){let i=this.getPanel(e);if(!i){this.getTrigger(e)?.focus();return}let r=this.getPanelFocusables(i);if(r.length>0){r[0].focus();return}i.hasAttribute("tabindex")||(i.tabIndex=-1),i.focus()}ensurePairIds(e,i){e.id||(e.id=re("rui-navigation-trigger")),i.id||(i.id=re("rui-navigation-panel"))}syncPanels(){for(let e of this.getPanels()){let i=e.getAttribute("data-value")??"",r=this.openValue===i;e.toggleAttribute("hidden",!r),e.dataset.state=r?"open":"closed",e.setAttribute("aria-hidden",String(!r)),e.setAttribute("role","region");let s=this.getTrigger(i);s&&(this.ensurePairIds(s,e),s.setAttribute("aria-expanded",String(r)),s.setAttribute("aria-controls",e.id),e.setAttribute("aria-labelledby",s.id))}for(let e of this.getTriggers()){let i=e.getAttribute("data-value")??"",r=this.openValue===i;e.setAttribute("aria-expanded",String(r)),this.getPanel(i)?e.setAttribute("aria-haspopup","true"):e.removeAttribute("aria-haspopup")}}ensurePopoverController(){return this.popoverController||(this.popoverController=new ce({getAnchor:()=>this.getOpenTrigger(),getFloating:()=>this.getOpenPanel(),getOpen:()=>!!this.openValue,getPlacement:()=>"bottom-start",gap:oM,portal:!1})),this.popoverController}syncPopover(){let e=this.ensurePopoverController();e.updateConfig({getAnchor:()=>this.getOpenTrigger(),getFloating:()=>this.getOpenPanel(),getOpen:()=>!!this.openValue}),e.sync()}closeMenu(e=!1){let i=this.openValue;i&&(this.clearHoverTimers(),this.openValue=null,this.syncPanels(),this.syncPopover(),e&&this.getTrigger(i)?.focus())}openPanel(e,i={}){let{focusPanel:r=!0,toggle:s=!0}=i;if(this.openValue===e){s&&this.closeMenu(!0);return}this.clearHoverTimers();let d=this.getOpenPanel(),h=!!(d&&document.activeElement instanceof Node&&d.contains(document.activeElement));this.openValue=e,this.syncPanels(),this.syncPopover(),queueMicrotask(()=>{if(r){this.focusPanelEntry(e);return}h&&this.getTrigger(e)?.focus()})}isTouchPointer(e){return e.pointerType==="touch"}pointerIsInOpenMenu(e){return e instanceof Node?!Ke(this.getOpenTrigger(),this.getOpenPanel(),e):!1}triggerValueFromEvent(e){let i=e.target;return i instanceof Element?i.closest("[data-navigation-trigger]")?.getAttribute("data-value")??null:null}scheduleHoverOpen(e){if(!this.openOnHover||!this.getPanel(e)||(this.clearHoverTimers(),this.openValue===e))return;let i=this.openValue?0:Math.max(0,this.hoverDelay);if(i<=0){this.openPanel(e,{focusPanel:!1,toggle:!1});return}this.openTimer=setTimeout(()=>{this.openTimer=null,this.openPanel(e,{focusPanel:!1,toggle:!1})},i)}scheduleHoverClose(){if(!this.openOnHover||!this.openValue){this.clearHoverTimers();return}this.clearHoverTimers();let e=Math.max(0,this.closeDelay);if(e<=0){this.closeMenu();return}this.closeTimer=setTimeout(()=>{this.closeTimer=null,this.closeMenu()},e)}onDocumentPointerDown(e){this.openValue&&(this.pointerIsInOpenMenu(e.target)||this.closeMenu())}onDocumentKeydown(e){if(e.key!=="Escape"||!this.openValue)return;let i=document.activeElement,r=this.getOpenPanel();i&&!this.contains(i)&&!(r&&r.contains(i))||(e.preventDefault(),this.closeMenu(!0))}onRootKeydown(e){e.key==="Escape"&&this.openValue&&(e.preventDefault(),this.closeMenu(!0))}onTriggerClick(e){let i=e.target.closest("[data-navigation-trigger]"),r=i?.getAttribute("data-value");!i||!r||(e.preventDefault(),this.openPanel(r))}onTriggerPointerOver(e){if(!this.openOnHover||this.isTouchPointer(e))return;let i=this.triggerValueFromEvent(e);i&&this.scheduleHoverOpen(i)}onTriggerPointerOut(e){if(!this.openOnHover||this.isTouchPointer(e)||this.pointerIsInOpenMenu(e.relatedTarget))return;let i=e.relatedTarget;i instanceof Element&&i.closest("[data-navigation-trigger]")&&this.contains(i)||this.scheduleHoverClose()}onPanelPointerOver(e){if(!this.openOnHover||this.isTouchPointer(e)||!this.openValue)return;let i=e.target.closest("[data-navigation-panel]");!i||i.getAttribute("data-value")!==this.openValue||this.clearHoverTimers()}onPanelPointerOut(e){!this.openOnHover||this.isTouchPointer(e)||this.pointerIsInOpenMenu(e.relatedTarget)||this.scheduleHoverClose()}onBarItemPointerOver(e){if(!this.openOnHover||this.isTouchPointer(e)||!this.openValue)return;let i=e.target.closest("[data-navigation-item]");!i||this.isBarTrigger(i)||this.scheduleHoverClose()}onBarItemKeydown(e){let i=e.target.closest("[data-navigation-item]");if(!i||this.handleBarTriggerKeydown(e,i))return;let r=de({items:this.getBarItems(),current:i,key:e.key,orientation:"horizontal",wrap:!1});r.handled&&(e.preventDefault(),this.syncMenuToBarItem(r.item))}handleBarTriggerKeydown(e,i){if(e.key==="Escape")return this.openValue&&(e.preventDefault(),this.closeMenu(!0)),!0;let r=i.getAttribute("data-value");return!this.isBarTrigger(i)||!r?!1:e.key==="Enter"||e.key===" "?(e.preventDefault(),this.openPanel(r),!0):e.key!=="ArrowDown"?!1:(e.preventDefault(),this.openValue===r?this.focusPanelEntry(r):this.openPanel(r),!0)}syncMenuToBarItem(e){if(!this.openValue)return;let i=e.getAttribute("data-value");this.isBarTrigger(e)&&i?this.openPanel(i):this.closeMenu(!1)}onPanelKeydown(e){let i=e.target;if(!(i instanceof Element))return;let r=i.closest("[data-navigation-panel]");if(!r||r.hidden)return;let s=r.getAttribute("data-value");if(!s||this.openValue!==s)return;let d=document.activeElement instanceof HTMLElement?document.activeElement:null;if(!d||!r.contains(d))return;if(e.key==="Escape"){e.preventDefault(),this.closeMenu(!0);return}let h=this.getPanelFocusables(r);if(e.key==="ArrowUp"&&d===h[0]){e.preventDefault(),this.getTrigger(s)?.focus();return}!h.length||!de({items:h,current:d,key:e.key,orientation:"vertical",wrap:!1}).handled||e.preventDefault()}static{oy()}};function aM({children:t,class:e,...i}){return Kt("div",{...i,"data-ref":"bar",class:j("rui-navigation-menu__bar",e),children:t})}function sM({children:t,class:e,...i}){return Kt("div",{...i,"data-ref":"panels",class:j("rui-navigation-menu__panels",e),children:t})}function lM({children:t,label:e,...i}){return Kt("rui-navigation-menu",{...i,label:e,children:Kt("nav",{class:"rui-navigation-menu","data-ref":"root","aria-label":e||void 0,children:t})})}function uM({children:t,value:e,variant:i="ghost",class:r,...s}){return Kt(Je,{...s,variant:i,class:r,"data-navigation-item":!0,"data-navigation-trigger":!0,"data-value":e,children:t})}function cM({children:t,href:e,class:i,...r}){return Kt("a",{...r,href:e,"data-navigation-item":!0,class:j("rui-button","rui-button--ghost","rui-button--md",i),children:t})}function dM({children:t,value:e,class:i,...r}){return Kt("div",{...r,class:j("rui-navigation-menu__panel","rui-popover","rui-floating",i),"data-navigation-panel":!0,"data-value":e,children:t})}import{bindTo as Go,customElement as bM,event as vM,onEvent as $t,onUpdated as yM,prop as Ee,state as i_}from"@ecopages/radiant";import{FormAssociatedElement as r_}from"@ecopages/radiant/form-associated-element";function Uo(t,e){return new Intl.NumberFormat(t,e)}function zo(t,e,i){return Number.isFinite(t)?Uo(e,i).format(t):""}function qo(t,e,i){let r=t.trim();if(!r)return null;let d=Uo(e,i).formatToParts(1234.5),h=d.find(S=>S.type==="decimal")?.value??".",a=d.find(S=>S.type==="group")?.value??",",E=r.replaceAll(a,"").replace(h,".").replace(/[^\d.-]/g,""),A=Number(E);return Number.isFinite(A)?A:null}function Ko(t){if(t)try{let e=JSON.parse(t);return hM(e)?(new Intl.NumberFormat(void 0,e),e):void 0}catch{return}}function hM(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function $o(t,e,i,r){if(!Number.isFinite(t))return Number.isFinite(e)?e:0;if(!Number.isFinite(r)||r===0)return _y(t,e,i);let s=Number.isFinite(e)?e:0,d=Math.round((t-s)/r)*r+s;return _y(d,e,i)}function _y(t,e,i){let r=t;return Number.isFinite(e)&&(r=Math.max(e,r)),Number.isFinite(i)&&(r=Math.min(i,r)),r}var xy,wy,Ty,Sy,Ey,Ry,Ay,Iy,Cy,Dy,Oy,Vy,ky,My,Ly,Py,jy,Fy,By,Uy,zy,qy,Ky,$y,Gy,Wy,Hy,Yy,Ny,Xy,Qy,Jy,Zy,e_;function pM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:t_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||t_(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:fM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return gM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function fM(t){var e=mM(t,"string");return typeof e=="symbol"?e:e+""}function mM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function t_(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function gM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var o_,n_=class extends r_{static{({e:[Ty,Sy,Ey,Ry,Ay,Iy,Cy,Dy,Oy,Vy,ky,My,Ly,Py,jy,Fy,By,Uy,zy,qy,Ky,$y,Gy,Wy,Hy,Yy,Ny,Xy,Qy,Jy,Zy,e_,xy],c:[o_,wy]}=pM(this,[bM("rui-number-field")],[[Ee({type:Number,reflect:!0,defaultValue:void 0}),0,"value"],[Ee({type:Number,attribute:"default-value",defaultValue:void 0}),0,"defaultValue"],[[Ee({type:Number,attribute:"min-value",defaultValue:Number.NEGATIVE_INFINITY}),Go({selector:"[data-number-field-input]",attr:"aria-valuemin",map:e=>Number.isFinite(e)?String(e):void 0})],0,"minValue"],[[Ee({type:Number,attribute:"max-value",defaultValue:Number.POSITIVE_INFINITY}),Go({selector:"[data-number-field-input]",attr:"aria-valuemax",map:e=>Number.isFinite(e)?String(e):void 0})],0,"maxValue"],[Ee({type:Number,defaultValue:1}),0,"step"],[[Ee({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),Go({selector:"[data-number-field-input]",bool:"data-readonly"})],0,"readOnly"],[Ee({type:String,defaultValue:""}),0,"label"],[Ee({type:String,defaultValue:""}),0,"locale"],[Ee({type:String,attribute:"format-options",defaultValue:""}),0,"formatOptions"],[Ee({type:String,attribute:"commit-behavior",defaultValue:"snap"}),0,"commitBehavior"],[Ee({type:String,attribute:"increment-aria-label",defaultValue:""}),0,"incrementAriaLabel"],[Ee({type:String,attribute:"decrement-aria-label",defaultValue:""}),0,"decrementAriaLabel"],[Ee({type:Boolean,attribute:"wheel-disabled",defaultValue:!1}),0,"wheelDisabled"],[vM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[i_,0,"decreaseDisabled"],[i_,0,"increaseDisabled"],[yM(["value","defaultValue","minValue","maxValue","step","label","name","disabled","readOnly","effectiveDisabled","locale","formatOptions","commitBehavior"]),2,"onPropsUpdated"],[$t({selector:'[data-number-field-action="decrement"]',type:"click"}),2,"decrement"],[$t({selector:'[data-number-field-action="increment"]',type:"click"}),2,"increment"],[$t({selector:"[data-number-field-input]",type:"focusin"}),2,"onInputFocus"],[$t({selector:"[data-number-field-input]",type:"focusout"}),2,"onInputBlur"],[$t({selector:"[data-number-field-input]",type:"input"}),2,"onInput"],[$t({selector:"[data-number-field-input]",type:"keydown"}),2,"onKeydown"],[$t({selector:"[data-number-field-input]",type:"wheel"}),2,"onWheel"]],0,void 0,r_))}value=(xy(this),Ty(this));defaultValue=(Sy(this),Ey(this));minValue=(Ry(this),Ay(this));maxValue=(Iy(this),Cy(this));step=(Dy(this),Oy(this));readOnly=(Vy(this),ky(this));label=(My(this),Ly(this));locale=(Py(this),jy(this));formatOptions=(Fy(this),By(this));commitBehavior=(Uy(this),zy(this));incrementAriaLabel=(qy(this),Ky(this));decrementAriaLabel=($y(this),Gy(this));wheelDisabled=(Wy(this),Hy(this));changeEvent=(Yy(this),Ny(this));decreaseDisabled=(Xy(this),Qy(this,!1));increaseDisabled=(Jy(this),Zy(this,!1));editing=(e_(this),!1);draftValue="";initialized=!1;uid=re("rui-number-field");get resolvedLocale(){return ht(this.locale)}get resolvedFormatOptions(){return Ko(this.formatOptions)}get inputId(){return`${this.uid}-input`}getNumericValue(){return typeof this.value=="number"&&Number.isFinite(this.value)?this.value:typeof this.defaultValue=="number"&&Number.isFinite(this.defaultValue)?this.defaultValue:0}getInput(){return this.querySelector("[data-number-field-input]")}syncLabel(){let e=this.getInput();qe(this,e,{controlId:this.inputId,label:this.label,labelId:`${this.uid}-label`})}syncInput(){let e=this.getInput();if(!e)return;e.id||(e.id=this.inputId);let i=this.getNumericValue();e.disabled=this.effectiveDisabled,e.toggleAttribute("data-disabled",e.disabled),e.setAttribute("role","spinbutton"),e.setAttribute("inputmode","decimal"),e.setAttribute("aria-valuenow",String(i)),this.editing||(e.value=zo(i,this.resolvedLocale,this.resolvedFormatOptions))}updateStepperState(){let e=this.getNumericValue();this.decreaseDisabled=this.effectiveDisabled||this.readOnly||e<=this.minValue,this.increaseDisabled=this.effectiveDisabled||this.readOnly||e>=this.maxValue,queueMicrotask(()=>this.syncSlottedSteppers())}syncSlottedSteppers(){let e=this.incrementAriaLabel||"Increment",i=this.decrementAriaLabel||"Decrement";for(let r of this.querySelectorAll('[data-number-field-action="decrement"]'))r.disabled=this.decreaseDisabled,r.setAttribute("aria-label",i);for(let r of this.querySelectorAll('[data-number-field-action="increment"]'))r.disabled=this.increaseDisabled,r.setAttribute("aria-label",e)}commitValue(e,i=!1){let r=e;if((this.commitBehavior==="snap"||i)&&(r=$o(e,this.minValue,this.maxValue,this.step)),r===this.getNumericValue()){this.editing=!1,this.syncInput(),this.updateStepperState();return}this.value=r,this.changeEvent.emit({value:r}),this.editing=!1,this.syncInput(),this.updateStepperState()}commitDraft(){let e=qo(this.draftValue,this.resolvedLocale,this.resolvedFormatOptions);if(e==null){this.editing=!1,this.syncInput();return}if(this.commitBehavior==="validate"&&(e<this.minValue||e>this.maxValue)){this.editing=!1,this.syncInput();return}this.commitValue(e)}initialize(){this.initialized||(this.initialized=!0,this.value==null&&this.defaultValue!=null&&(this.value=this.defaultValue),this.syncLabel(),this.syncInput(),this.updateStepperState())}formValue(){return this.name?String(this.getNumericValue()):null}formState(){return this.value==null?"":String(this.value)}restoreFormState(e){this.value=e===""||e==null?void 0:Number(e),this.editing=!1,this.draftValue="",this.syncInput(),this.updateStepperState()}onConnected(){this.initialize()}onPropsUpdated(){this.syncLabel(),this.syncInput(),this.updateStepperState()}decrement(e){e.preventDefault(),!this.decreaseDisabled&&this.commitValue(this.getNumericValue()-this.step,!0)}increment(e){e.preventDefault(),!this.increaseDisabled&&this.commitValue(this.getNumericValue()+this.step,!0)}onInputFocus(e){if(this.effectiveDisabled||this.readOnly)return;let i=e.target;this.editing=!0,this.draftValue=String(this.getNumericValue()),i.value=this.draftValue,i.select()}onInputBlur(){this.editing&&this.commitDraft()}onInput(e){this.effectiveDisabled||this.readOnly||(this.editing=!0,this.draftValue=e.target.value)}onKeydown(e){if(!(this.effectiveDisabled||this.readOnly)){if(e.key==="ArrowUp"){e.preventDefault(),this.increment(e);return}if(e.key==="ArrowDown"){e.preventDefault(),this.decrement(e);return}if(e.key==="Home"&&Number.isFinite(this.minValue)){e.preventDefault(),this.commitValue(this.minValue,!0);return}if(e.key==="End"&&Number.isFinite(this.maxValue)){e.preventDefault(),this.commitValue(this.maxValue,!0);return}e.key==="Enter"&&(e.preventDefault(),this.commitDraft(),this.getInput()?.blur())}}onWheel(e){if(this.wheelDisabled||this.effectiveDisabled||this.readOnly)return;let i=e.target;document.activeElement===i&&(e.preventDefault(),e.deltaY<0?this.increment(e):e.deltaY>0&&this.decrement(e))}static{wy()}};import{jsx as Be,jsxs as a_}from"@ecopages/jsx/jsx-runtime";function s_({children:t,class:e,...i}){return Be("div",{...i,"data-number-field-group":!0,class:j("rui-number-field__group",e),children:t})}function l_({class:t,disabled:e,readOnly:i,...r}){return Be("input",{...r,type:"text","data-number-field-input":!0,"data-rui-control":!0,"data-rui-control-type":"number",class:j("rui-number-field__input",t),disabled:e,readOnly:i})}function u_({children:t,class:e,...i}){return Be("div",{...i,class:j("rui-number-field__steppers",e),children:t})}function c_({children:t,class:e,aria:i,disabled:r,...s}){return Be("button",{...s,aria:ne(i,"Increment"),type:"button","data-number-field-action":"increment",class:j("rui-number-field__stepper",e),disabled:r,tabIndex:-1,children:t??"+"})}function d_({children:t,class:e,aria:i,disabled:r,...s}){return Be("button",{...s,aria:ne(i,"Decrement"),type:"button","data-number-field-action":"decrement",class:j("rui-number-field__stepper",e),disabled:r,tabIndex:-1,children:t??"\u2212"})}function _M(){return a_(s_,{children:[Be(l_,{}),a_(u_,{children:[Be(d_,{}),Be(c_,{})]})]})}function xM({children:t,...e}){return Be("rui-number-field",{...e,children:Be("div",{class:"rui-number-field","data-ref":"root",children:t??Be(_M,{})})})}import{jsx as _e,jsxs as Ho}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as A_,customElement as RM,event as AM,onEvent as IM,prop as Yi}from"@ecopages/radiant";var h_,p_,f_,m_,g_,b_,v_,y_,__,x_,w_,T_,S_,E_;function wM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:R_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||R_(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:TM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return EM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function TM(t){var e=SM(t,"string");return typeof e=="symbol"?e:e+""}function SM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function R_(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function EM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Wo="Pagination";function en(t,e){return Math.min(Math.max(1,Math.floor(t)||1),e)}var C_,I_=class extends A_{static{({e:[f_,m_,g_,b_,v_,y_,__,x_,w_,T_,S_,E_,h_],c:[C_,p_]}=wM(this,[RM("rui-pagination")],[[Yi({type:String,defaultValue:Wo}),0,"label"],[Yi({type:Number,reflect:!0,defaultValue:1}),0,"page"],[Yi({type:Number,attribute:"page-count",defaultValue:1}),0,"pageCount"],[Yi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Yi({type:Number,attribute:"sibling-count",defaultValue:1}),0,"siblingCount"],[AM({name:"rui-page-change",bubbles:!0,composed:!0}),0,"pageChangeEvent"],[IM({selector:"[data-pagination-page]",type:"click"}),2,"onPageClick"]],0,void 0,A_))}constructor(...e){super(...e),E_(this)}label=(h_(this),f_(this));page=(m_(this),g_(this));pageCount=(b_(this),v_(this));disabled=(y_(this),__(this));siblingCount=(x_(this),w_(this));pageChangeEvent=(T_(this),S_(this));changePage(e){if(this.disabled)return;let i=en(e,Math.max(1,Math.floor(this.pageCount)||1));i!==this.page&&this.pageChangeEvent.emit({page:i})}onPageClick(e){let i=e.target.closest("[data-pagination-page]"),r=Number(i?.getAttribute("data-pagination-page"));Number.isInteger(r)&&this.changePage(r)}static{p_()}};function CM(t,e,i){let r=i*2+5;if(e<=r)return Array.from({length:e},(a,E)=>E+1);let s=Math.max(2,t-i),d=Math.min(e-1,t+i),h=[1];s>2&&h.push("start-ellipsis");for(let a=s;a<=d;a+=1)h.push(a);return d<e-1&&h.push("end-ellipsis"),h.push(e),h}function D_({label:t,page:e,pageCount:i,disabled:r=!1,siblingCount:s=1,previousText:d="Previous",previousLabel:h="Go to previous page",nextText:a="Next",nextLabel:E="Go to next page",pageLabel:A=I=>`Go to page ${I}`,statusLabel:S=(I,T)=>`Page ${I} of ${T}`}){let I=Math.max(1,Math.floor(i)||1),T=en(e,I),K=Math.max(0,Math.floor(s)||0),$=CM(T,I,K);return _e("nav",{class:"rui-pagination__nav","aria-label":t,children:Ho("ul",{class:"rui-pagination__list",children:[_e("li",{children:Ho(Je,{variant:"ghost",size:"sm",class:"rui-pagination__link rui-pagination__link--previous","data-pagination-page":T-1,"aria-label":h,disabled:r||T<=1,children:[_e(fn,{}),_e("span",{children:d})]})}),$.map(V=>typeof V=="number"?_e("li",{class:j("rui-pagination__page",V===T&&"rui-pagination__page--current"),children:_e(Je,{variant:V===T?"filled":"ghost",size:"sm",square:!0,class:"rui-pagination__link","data-pagination-page":V,"aria-label":A(V),"aria-current":V===T?"page":void 0,disabled:r,children:V})},V):_e("li",{class:"rui-pagination__ellipsis","aria-hidden":"true",children:"\u2026"},V)),_e("li",{class:"rui-pagination__status","aria-live":"polite",children:_e("span",{class:"rui-pagination__status-label",children:S(T,I)})}),_e("li",{children:Ho(Je,{variant:"ghost",size:"sm",class:"rui-pagination__link rui-pagination__link--next","data-pagination-page":T+1,"aria-label":E,disabled:r||T>=I,children:[_e("span",{children:a}),_e(mn,{})]})})]})})}function DM({children:t,label:e=Wo,page:i=1,pageCount:r=1,disabled:s=!1,siblingCount:d=1,previousText:h,previousLabel:a,nextText:E,nextLabel:A,pageLabel:S,statusLabel:I,class:T,...K}){let $=Math.max(1,Math.floor(r)||1),V=en(i,$),G=Math.max(0,Math.floor(d)||0);return _e("rui-pagination",{...K,class:j("rui-pagination",T),label:e,page:V,pageCount:$,disabled:s,siblingCount:G,children:t??_e(D_,{label:e,page:V,pageCount:$,disabled:s,siblingCount:G,previousText:h,previousLabel:a,nextText:E,nextLabel:A,pageLabel:S,statusLabel:I})})}import{jsx as vi,jsxs as px}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as tn,bound as No,customElement as ux,event as MM,onEvent as Ni,onUpdated as cx,prop as Et,query as Xo}from"@ecopages/radiant";import{isServer as LM}from"@ecopages/radiant/is-server";var O_,V_,k_,M_,L_,P_,j_,F_,B_,U_,z_,q_,K_,$_,G_,W_,H_,Y_,N_,X_,Q_,J_,Z_,ex,tx,ix,rx,nx;function lx(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ox(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ox(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:OM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return kM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function OM(t){var e=VM(t,"string");return typeof e=="symbol"?e:e+""}function VM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ox(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function kM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var dx,ax=class extends tn{static{({e:[k_,M_,L_,P_,j_,F_,B_,U_,z_,q_,K_,$_,G_,W_,H_,Y_,N_,X_,Q_,J_,O_],c:[dx,V_]}=lx(this,[ux("rui-popover")],[[Et({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Et({type:String,defaultValue:"bottom"}),0,"placement"],[Et({type:Boolean,defaultValue:!0}),0,"portal"],[Et({type:Boolean,defaultValue:!1}),0,"matchAnchorWidth"],[Et({type:Number,defaultValue:8}),0,"offset"],[Et({type:String,defaultValue:""}),0,"anchor"],[Et({type:String,defaultValue:"default"}),0,"variant"],[Xo({ref:"surface"}),0,"surfaceTarget"],[Xo({ref:"host"}),0,"hostTarget"],[MM({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[No,cx(["open","placement","portal","matchAnchorWidth","offset","anchor"])],2,"syncPopover"],[Ni({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[Ni({ref:"host",type:"focusout"}),2,"onFocusOut"],[No,2,"onExternalAnchorClick"],[Ni({document:!0,type:"keydown"}),2,"onDocumentKeydown"]],0,void 0,tn))}open=(O_(this),k_(this));placement=(M_(this),L_(this));portal=(P_(this),j_(this));matchAnchorWidth=(F_(this),B_(this));offset=(U_(this),z_(this));anchor=(q_(this),K_(this));variant=($_(this),G_(this));surfaceTarget=(W_(this),H_(this));hostTarget=(Y_(this),N_(this));openChangeEvent=(X_(this),Q_(this));surfaceId=(J_(this),re("rui-popover"));controller=null;anchorClickTarget=null;onConnected(){this.syncPopover()}disconnectedCallback(){this.unbindExternalAnchorClick(),this.controller?.destroy(),this.controller=null,super.disconnectedCallback()}getAnchorElement(){let i=this.closest("rui-popover-trigger")?.querySelector("[data-popover-trigger]");if(i instanceof HTMLElement)return Yo(i);let r=this.querySelector("[data-popover-trigger]");if(r instanceof HTMLElement)return Yo(r);let s=this.anchor.trim();if(s){let d=document.querySelector(s);if(d instanceof HTMLElement)return Yo(d)}return null}ensureController(){return this.controller||(this.controller=new ce({getAnchor:()=>this.getAnchorElement(),getFloating:()=>this.surfaceTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:this.offset,portal:this.portal,matchAnchorWidth:this.matchAnchorWidth})),this.controller}syncPopover(){let e=this.getAnchorElement(),i=this.surfaceTarget;i&&(i.id=this.surfaceId),e&&(e.setAttribute("aria-controls",this.surfaceId),e.setAttribute("aria-expanded",String(this.open))),this.syncExternalAnchorClick(e);let r=this.ensureController();r.updateConfig({getAnchor:()=>this.getAnchorElement(),getFloating:()=>this.surfaceTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:this.offset,portal:this.portal,matchAnchorWidth:this.matchAnchorWidth}),r.sync()}setOpen(e,i=!0){if(this.open===e){this.syncPopover();return}this.open=e,i&&this.openChangeEvent.emit({open:e}),this.syncPopover()}onDocumentPointerDown(e){if(!this.open)return;let i=e.target;Ke(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,i)&&this.setOpen(!1)}onFocusOut(e){this.open&&tt(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,e.relatedTarget)&&this.setOpen(!1)}usesExternalAnchor(){return!this.anchor.trim()||this.closest("rui-popover-trigger")?!1:!this.querySelector("[data-popover-trigger]")}syncExternalAnchorClick(e){if(!this.usesExternalAnchor()||!e){this.unbindExternalAnchorClick();return}this.anchorClickTarget!==e&&(this.unbindExternalAnchorClick(),e.addEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=e)}unbindExternalAnchorClick(){this.anchorClickTarget&&(this.anchorClickTarget.removeEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=null)}onExternalAnchorClick(){this.setOpen(!this.open)}onDocumentKeydown(e){if(!this.open||e.key!=="Escape")return;e.preventDefault(),this.setOpen(!1),this.getAnchorElement()?.focus()}static{V_()}};var hx,sx=class extends tn{static{({e:[tx,ix,rx,nx,Z_],c:[hx,ex]}=lx(this,[ux("rui-popover-trigger")],[[Et({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Xo({ref:"root"}),0,"rootTarget"],[[No,cx(["open"])],2,"syncToPopover"],[Ni({ref:"root",type:"click"}),2,"onHostClick"],[Ni({selector:"rui-popover",type:"rui-open-change"}),2,"onPopoverOpenChange"]],0,void 0,tn))}constructor(...e){super(...e),nx(this)}open=(Z_(this),tx(this));rootTarget=(ix(this),rx(this));getPopover(){return this.querySelector("rui-popover")}onConnected(){this.syncToPopover()}syncToPopover(){if(LM)return;let e=this.getPopover();!e||typeof e.setOpen!="function"||e.open!==this.open&&e.setOpen(this.open,!1)}onHostClick(e){if(!e.target?.closest("[data-popover-trigger]"))return;this.open=!this.open;let r=this.getPopover();r&&typeof r.setOpen=="function"&&r.setOpen(this.open)}onPopoverOpenChange(e){let i=this.getPopover();e.target===i&&(this.open=e.detail.open)}static{ex()}};function Yo(t){return t.querySelector('button, a[href], input, select, textarea, [role="button"]')??t}function PM({children:t,class:e,...i}){return vi("div",{...i,class:j(e),children:t})}function jM({trigger:t,children:e,variant:i="default",...r}){let s=i==="listbox"?"rui-popover--listbox":"";return vi("rui-popover",{...r,variant:i,children:px("div",{class:"rui-popover-host","data-ref":"host",children:[t!=null?vi("span",{"data-popover-trigger":!0,children:t}):null,vi("div",{"data-ref":"surface",class:`rui-popover rui-floating ${s}`.trim(),role:"dialog",children:e})]})})}function FM({trigger:t,children:e,...i}){return vi("rui-popover-trigger",{...i,children:px("div",{class:"rui-popover-trigger","data-ref":"root",children:[vi("span",{"data-popover-trigger":!0,children:t}),e]})})}import{RadiantElement as Cx,bindTo as Dx,customElement as KM,event as $M,onEvent as GM,onUpdated as WM,prop as rn,query as HM}from"@ecopages/radiant";var fx,mx,gx,bx,vx,yx,_x,xx,wx,Tx,Sx,Ex,Rx,Ax;function BM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Ix(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ix(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:UM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return qM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function UM(t){var e=zM(t,"string");return typeof e=="symbol"?e:e+""}function zM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ix(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function qM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Vx,Ox=class extends Cx{static{({e:[gx,bx,vx,yx,_x,xx,wx,Tx,Sx,Ex,Rx,Ax,fx],c:[Vx,mx]}=BM(this,[KM("rui-radio-group")],[[rn({type:String,reflect:!0,defaultValue:""}),0,"value"],[rn({type:String,defaultValue:""}),0,"name"],[[rn({type:String,defaultValue:""}),Dx({selector:"[data-radio-group-root]",attr:"aria-label",map:gt})],0,"label"],[[rn({type:Boolean,reflect:!0,defaultValue:!1}),Dx({selector:"[data-radio-group-root]",attr:"aria-disabled",map:e=>e?"true":void 0})],0,"disabled"],[HM({selector:'input[type="radio"]',all:!0,cache:!1}),0,"radioTargets"],[$M({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[WM(["value","name","disabled"]),2,"syncRadios"],[GM({selector:'input[type="radio"]',type:"change"}),2,"onRadioChange"]],0,void 0,Cx))}constructor(...e){super(...e),Ax(this)}value=(fx(this),gx(this));name=(bx(this),vx(this));label=(yx(this),_x(this));disabled=(xx(this),wx(this));radioTargets=(Tx(this),Sx(this));changeEvent=(Ex(this),Rx(this));onConnected(){this.syncRadios()}syncRadios(){let e=this.name||this.getAttribute("name")||"rui-radio-group";for(let i of this.radioTargets)i.name=e,i.disabled=this.disabled||i.hasAttribute("data-disabled"),i.checked=this.value!==""&&i.value===this.value}onRadioChange(e){let i=e.target;i.checked&&(this.value=i.value,this.changeEvent.emit({value:this.value}))}static{mx()}};import{jsx as Gt,jsxs as YM}from"@ecopages/jsx/jsx-runtime";function kx({children:t,class:e,...i}){return Gt("div",{...i,"data-radio-group-root":!0,class:j("rui-radio-group",e),role:"radiogroup","data-rui-control":!0,"data-rui-control-type":"text",children:t})}function Mx({children:t,value:e,name:i,disabled:r,class:s,...d}){return YM("label",{...d,class:j("rui-radio",s),children:[Gt("input",{type:"radio",class:"rui-radio__input",value:e,name:i,disabled:r,"data-disabled":r?"":void 0}),Gt("span",{class:"rui-radio__control","aria-hidden":"true"}),Gt("span",{class:"rui-radio__label",children:t})]})}function NM({options:t,children:e,...i}){return Gt("rui-radio-group",{...i,children:t==null?e:Gt(kx,{children:t.map(r=>Gt(Mx,{value:r.value,disabled:r.disabled,children:r.label}))})})}import{RadiantElement as i0,bindTo as r0,customElement as eL,event as tL,onEvent as xe,onUpdated as iL,prop as Wt,query as rL}from"@ecopages/radiant";var Lx,Px,jx,Fx,Bx,Ux,zx,qx,Kx,$x,Gx,Wx,Hx,Yx,Nx,Xx,Qx,Jx,Zx,e0;function XM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:t0(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||t0(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:QM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ZM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function QM(t){var e=JM(t,"string");return typeof e=="symbol"?e:e+""}function JM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function t0(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ZM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var o0,n0=class extends i0{static{({e:[jx,Fx,Bx,Ux,zx,qx,Kx,$x,Gx,Wx,Hx,Yx,Nx,Xx,Qx,Jx,Zx,e0,Lx],c:[o0,Px]}=XM(this,[eL("rui-select")],[[[Wt({...Ie,defaultValue:[]}),r0({selector:"[data-select-clear]",bool:"hidden",map:e=>e.length===0})],0,"value"],[Wt({type:String,defaultValue:""}),0,"label"],[Wt({type:String,defaultValue:""}),0,"placeholder"],[[Wt({type:Boolean,reflect:!0,defaultValue:!1}),r0([{selector:"[data-select-trigger]",attr:"aria-disabled",map:e=>e?"true":void 0},{selector:"[data-select-trigger]",prop:"tabIndex",map:e=>e?-1:0},{selector:"[data-select-toggle]",prop:"disabled"},{selector:"[data-select-clear]",prop:"disabled"}])],0,"disabled"],[Wt({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[Wt({type:Boolean,attribute:"should-close-on-select"}),0,"shouldCloseOnSelect"],[Wt({type:String,attribute:"trigger-kind",reflect:!0,defaultValue:"manual"}),0,"triggerKind"],[tL({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[rL({ref:"root"}),0,"rootTarget"],[iL(["value","label","placeholder","disabled","triggerKind","selectionMode","shouldCloseOnSelect"]),2,"onPropsUpdated"],[xe({selector:"[data-select-trigger], [data-select-toggle]",type:"pointerdown"}),2,"onTriggerPointerDown"],[xe({selector:"[data-select-trigger], [data-select-toggle]",type:"click"}),2,"onTriggerClick"],[xe({selector:"[data-select-trigger]",type:"keydown",options:{capture:!0}}),2,"onTriggerKeydown"],[xe({selector:"[data-select-listbox] [data-autocomplete-input]",type:"keydown",options:{capture:!0}}),2,"onSearchKeydown"],[xe({selector:"[data-select-listbox] [data-autocomplete-input]",type:"input"}),2,"onSearchInput"],[xe({selector:"[data-select-value] rui-tag-group",type:"rui-remove"}),2,"onTagRemove"],[xe({selector:"[data-select-clear]",type:"click"}),2,"onClearClick"],[xe({selector:"[data-select-value] [data-tag]",type:"click"}),2,"onTagClick"],[xe({selector:'[data-select-listbox] [role="option"]',type:"pointerover"}),2,"onOptionPointerOver"],[xe({selector:'[data-select-listbox] [role="option"]',type:"mousedown"}),2,"onOptionMouseDown"],[xe({selector:'[data-select-listbox] [role="option"]',type:"click"}),2,"onOptionClick"],[xe({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[xe({ref:"root",type:"focusout"}),2,"onFocusOut"],[xe({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"]],0,void 0,i0))}constructor(...e){super(...e),e0(this)}value=(Lx(this),jx(this));label=(Fx(this),Bx(this));placeholder=(Ux(this),zx(this));disabled=(qx(this),Kx(this));selectionMode=($x(this),Gx(this));shouldCloseOnSelect=(Wx(this),Hx(this));triggerKind=(Yx(this),Nx(this));changeEvent=(Xx(this),Qx(this));open=(Jx(this),!1);uid=re("rui-select");collection=new Jt({getRoot:()=>this,getSelectionMode:()=>this.selectionMode,getValue:()=>this.value,setValue:e=>{this.value=e},getPopup:()=>this.getListboxPopup(),tagGroupSelector:"[data-select-value] rui-tag-group"});listboxBehavior=new Zt({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.collection.getOptions(),getActiveDescendantHost:()=>this.getActiveDescendantHost(),getOptionIdPrefix:()=>`${this.uid}-option`});rootTarget=Zx(this);get listboxId(){return`${this.uid}-list`}get triggerId(){return`${this.uid}-trigger`}isMultiple(){return this.selectionMode==="multiple"}closesOnSelect(){return this.shouldCloseOnSelect!=null?this.shouldCloseOnSelect:!this.isMultiple()}getSearchInput(){return this.querySelector("[data-select-listbox] [data-autocomplete-input]")}hasSearchInput(){return this.getSearchInput()!=null}getActiveDescendantHost(){return this.open&&this.hasSearchInput()?this.getSearchInput():this.getTrigger()}resetSearchFilter(){let e=this.getSearchInput();!e||e.value===""||(e.value="",e.dispatchEvent(new Event("input",{bubbles:!0})))}syncSearchInput(){let e=this.getSearchInput(),i=this.getTrigger(),r=this.collection.getListbox();if(!(!e||!r||!i)){if(this.open){e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",this.listboxId),i.removeAttribute("aria-activedescendant");return}e.removeAttribute("role"),e.removeAttribute("aria-autocomplete"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-activedescendant")}}focusPopupInput(){queueMicrotask(()=>{this.getSearchInput()?.focus()})}hasTagGroup(){return this.collection.getTagGroup()!=null}syncTagGroup(){let e=this.getValueElement();this.collection.syncTagGroup(),!(!e||!this.hasTagGroup())&&this.syncTagGroupPlaceholder(e,this.collection.getSelectedValues().length)}syncTagGroupPlaceholder(e,i){let r=e.querySelector("[data-select-placeholder]");if(!this.placeholder){r?.remove();return}r||(r=document.createElement("span"),r.setAttribute("data-select-placeholder","true"),e.insertBefore(r,e.firstChild)),r.textContent=this.placeholder,r.hidden=i>0,e.toggleAttribute("data-placeholder",i===0)}removeSelectedValue(e){this.collection.removeValue(e)&&(this.syncValueDisplay(),this.collection.syncOptionSelection(),this.syncTagGroup(),this.changeEvent.emit({value:this.value}))}clearSelection(){this.collection.clearValues()&&(this.syncValueDisplay(),this.collection.syncOptionSelection(),this.syncTagGroup(),this.changeEvent.emit({value:[]}),this.getTrigger()?.focus())}getTrigger(){return this.querySelector("[data-select-trigger]")}isTriggerFocusTarget(e){let i=this.getTrigger();return!i||!(e instanceof Node)||!i.contains(e)?!1:!(e instanceof Element&&e.closest("[data-tag-remove]"))}getToggle(){return this.querySelector("[data-select-toggle]")}getValueElement(){return this.querySelector("[data-select-value]")}getListboxPopup(){return this.querySelector("[data-select-listbox]")}ensureOptionIds(){this.listboxBehavior.ensureOptionIds()}getAccessibleName(){return Vi(this)?.textContent?.trim()||this.label||"Options"}syncLabel(){let e=this.getTrigger();qe(this,e,{controlId:this.triggerId,label:this.label,labelId:`${this.uid}-label`})}syncTrigger(){let e=this.getTrigger(),i=this.collection.getListbox(),r=this.getListboxPopup();!e||!i||(e.id||(e.id=this.triggerId),i.id||(i.id=this.listboxId),e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-autocomplete","none"),e.setAttribute("aria-expanded",String(this.open)),e.setAttribute("aria-controls",this.listboxId),i.setAttribute("aria-label",this.getAccessibleName()),this.collection.syncMultiselectable(i),r&&(r.removeAttribute("role"),r.removeAttribute("aria-label"),r.removeAttribute("aria-multiselectable")),this.syncToggle(),this.syncSearchInput())}syncToggle(){let e=this.getToggle();e&&e.setAttribute("aria-expanded",String(this.open))}syncValueDisplay(){if(this.hasTagGroup()){this.syncTagGroup();return}let e=this.getValueElement();if(!e||e.childElementCount>0)return;let i=this.collection.getSelectedValues();if(i.length===0){e.textContent="",e.toggleAttribute("data-placeholder",!0),this.placeholder&&(e.textContent=this.placeholder);return}if(e.toggleAttribute("data-placeholder",!1),this.isMultiple()){e.textContent=i.map(r=>this.collection.labelForValue(r)).join(", ");return}e.textContent=this.collection.labelForValue(i[0])}setOpen(e,i={}){let r=i.activate??"none";this.open=e;let s=this.getTrigger(),d=this.getListboxPopup();if(!(!s||!d)){if(s.setAttribute("aria-expanded",String(e)),d.toggleAttribute("hidden",!e),!e){this.listboxBehavior.clearActiveOption(),this.resetSearchFilter(),this.syncSearchInput(),this.listboxBehavior.syncPopoverPosition();return}if(this.ensureOptionIds(),this.syncSearchInput(),this.listboxBehavior.syncPopoverPosition(),this.hasSearchInput()&&this.focusPopupInput(),r==="first"){let h=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(h.length?0:-1);return}if(r==="last"){let h=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(h.length?h.length-1:-1);return}this.listboxBehavior.clearActiveOption()}}selectOption(e){this.collection.isSelectableOption(e)&&(this.collection.toggleValue(Ce(e)),this.syncValueDisplay(),this.collection.syncOptionSelection(),this.changeEvent.emit({value:this.value}),this.closesOnSelect()&&(this.resetSearchFilter(),this.setOpen(!1),this.getTrigger()?.focus()))}handleListboxKeydown(e){this.listboxBehavior.handleKeydown(e,{isOpen:this.open,canUseSpace:!this.hasSearchInput(),closesOnTab:this.closesOnSelect(),enterWhenClosed:"open",enterWithoutActive:"ignore",onOpen:(i="none")=>this.setOpen(!0,{activate:i}),onClose:i=>{this.setOpen(!1),(i==="arrow"||i==="escape")&&this.getTrigger()?.focus()},onSelectActive:()=>{let i=this.listboxBehavior.getVisibleOptions()[this.listboxBehavior.activeOptionIndex];i&&this.selectOption(i)}})}handleTriggerKeydown(e){this.handleListboxKeydown(e)}initialize(){this.ensureOptionIds(),this.syncLabel(),this.syncTrigger(),this.collection.syncListboxHost(),this.syncValueDisplay(),this.collection.syncOptionSelection(),this.setOpen(!1)}onConnected(){this.initialize()}disconnectedCallback(){this.listboxBehavior.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.syncLabel(),this.syncTrigger(),this.collection.syncListboxHost(),this.syncValueDisplay(),this.collection.syncOptionSelection()}onTriggerPointerDown(e){this.triggerKind==="focus"&&e.preventDefault()}onTriggerClick(e){e.preventDefault();let i=this.getTrigger();if(!(!i||this.disabled)){if(this.open?this.setOpen(!1):this.setOpen(!0),this.open&&this.hasSearchInput()){this.focusPopupInput();return}i.focus()}}onTriggerKeydown(e){this.handleTriggerKeydown(e)}onSearchKeydown(e){this.handleListboxKeydown(e)}onSearchInput(){this.open&&this.listboxBehavior.clearActiveOption()}onTagRemove(e){let i=e.detail;i?.value&&this.removeSelectedValue(i.value)}onClearClick(e){e.preventDefault(),e.stopPropagation(),this.clearSelection()}onTagClick(e){e.target.closest("[data-tag-remove]")||e.stopPropagation()}onOptionPointerOver(e){if(!this.open)return;let i=this.collection.findOption(e.target);if(!this.collection.isSelectableOption(i))return;let s=this.listboxBehavior.getVisibleOptions().indexOf(i);s>=0&&this.listboxBehavior.setActiveOption(s)}onOptionMouseDown(e){e.preventDefault()}onOptionClick(e){let i=this.collection.findOption(e.target);i&&this.selectOption(i)}onRootFocusIn(e){this.triggerKind!=="focus"||this.disabled||this.open||!this.isTriggerFocusTarget(e.target)||e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||this.setOpen(!0)}onFocusOut(e){this.listboxBehavior.shouldDismissFocus(e.relatedTarget)&&this.setOpen(!1)}onDocumentPointerDown(e){this.open&&this.listboxBehavior.shouldDismissPointer(e.target)&&this.setOpen(!1)}static{Px()}};import{Fragment as nL,jsx as he,jsxs as a0}from"@ecopages/jsx/jsx-runtime";function s0({children:t,class:e,...i}){return he("div",{...i,class:j("rui-select__control",e),children:t})}function l0({children:t,class:e,disabled:i,...r}){return he("div",{...r,"data-select-trigger":!0,"data-rui-focus-managed":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:j("rui-select__trigger",e),tabIndex:i?-1:0,"aria-disabled":i?"true":void 0,children:t})}function u0({children:t,class:e,aria:i,disabled:r,...s}){return he("button",{...s,aria:ne(i,"Show options"),type:"button","data-select-toggle":!0,class:j("rui-control-toggle",e),disabled:r,tabIndex:-1,children:t??he(Xe,{})})}function oL({children:t,class:e,aria:i,disabled:r,...s}){return he("button",{...s,aria:ne(i,"Clear selection"),type:"button","data-select-clear":!0,class:j("rui-control-clear",e),disabled:r,children:t??he(Re,{})})}function c0({children:t,class:e,...i}){return he("span",{...i,"data-select-value":!0,class:j("rui-select__value",e),children:t})}function d0({children:t,class:e,...i}){return he("div",{...i,"data-select-listbox":!0,class:j("rui-select__listbox rui-popover rui-popover--listbox rui-floating",e),children:t})}function aL({placeholder:t,class:e,disabled:i,...r}){return he("input",{...r,type:"search","data-autocomplete-input":!0,class:j("rui-select__search",e),placeholder:t,disabled:i,autocomplete:"off"})}function sL(t,e,i){let r=et(e)[0]??"",s=typeof i=="string"?i:"";if(!r)return s;let d=t?.find(h=>h.value===r);return d&&typeof d.label=="string"?d.label:r}function lL({children:t}){return he("div",{class:"rui-select","data-ref":"root",children:t})}function uL({options:t,children:e,value:i,...r}){let s=et(i),d=r.selectionMode==="multiple",h=t!=null?sL(t,i,r.placeholder):"",a=t?.filter(E=>s.includes(E.value)).map(E=>({value:E.value,label:E.label}));return he("rui-select",{...r,value:s,children:he(lL,{children:t==null?e:a0(nL,{children:[a0(s0,{children:[he(l0,{disabled:r.disabled,children:he(c0,{children:d?he(Mi,{tags:a??[],label:"Selected options"}):h})}),he(u0,{})]}),he(d0,{children:he(ii,{embedded:!0,options:t,selectionMode:r.selectionMode,value:s})})]})})})}import{RadiantElement as dw,bindTo as Xi,bound as hw,customElement as fL,event as Qo,onEvent as Qi,onUpdated as Jo,prop as me,query as on,state as mL}from"@ecopages/radiant";import{isServer as gL}from"@ecopages/radiant/is-server";function nn(t){return t.split(",").map(e=>e.trim()).filter(e=>e.length>0)}var h0,p0,f0,m0,g0,b0,v0,y0,_0,x0,w0,T0,S0,E0,R0,A0,I0,C0,D0,O0,V0,k0,M0,L0,P0,j0,F0,B0,U0,z0,q0,K0,$0,G0,W0,H0,Y0,N0,X0,Q0,J0,Z0,ew,tw,iw,rw,nw,ow,aw,sw,lw,uw;function cL(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:cw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||cw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:dL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return pL(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function dL(t){var e=hL(t,"string");return typeof e=="symbol"?e:e+""}function hL(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cw(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function pL(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var bL=256,vL=48,yL=200,_L=480,xL="b",pw=8,fw=32,mw='[data-ref="menu-button"]';function wL(t){return t.metaKey||t.ctrlKey}function TL(){return typeof window<"u"&&typeof window.matchMedia=="function"}function an(t){return t==="left"||t==="right"}var bw,gw=class extends dw{static{({e:[f0,m0,g0,b0,v0,y0,_0,x0,w0,T0,S0,E0,R0,A0,I0,C0,D0,O0,V0,k0,M0,L0,P0,j0,F0,B0,U0,z0,q0,K0,$0,G0,W0,H0,Y0,N0,X0,Q0,J0,Z0,ew,tw,iw,rw,nw,ow,aw,sw,lw,uw,h0],c:[bw,p0]}=cL(this,[fL("rui-sidebar")],[[[me({type:String,reflect:!0,defaultValue:"sidebar"}),Xi([{attr:"data-variant"},{ref:"root",attr:"data-variant"},{ref:"pane",attr:"data-variant"}])],0,"variant"],[[me({type:String,reflect:!0,defaultValue:"left"}),Xi([{attr:"data-side"},{ref:"root",attr:"data-side"},{ref:"pane",attr:"data-side"}])],0,"side"],[[me({type:String,reflect:!0,defaultValue:"off"}),Xi([{attr:"data-collapsible"},{ref:"root",attr:"data-collapsible"}])],0,"collapsible"],[me({type:Number,defaultValue:bL}),0,"defaultWidth"],[me({type:Number,reflect:!0,attribute:"width"}),0,"width"],[me({type:Number,defaultValue:yL}),0,"minWidth"],[me({type:Number,defaultValue:_L}),0,"maxWidth"],[me({type:Boolean,defaultValue:!1}),0,"resizable"],[me({type:Boolean,defaultValue:!0}),0,"defaultOpen"],[me({type:Boolean,defaultValue:!1}),0,"mobileDefaultOpen"],[me({type:Boolean,attribute:"open"}),0,"open"],[me({type:Number,defaultValue:768}),0,"mobileBreakpoint"],[[me({type:String,defaultValue:"Sidebar"}),Xi([{attr:"aria-label"},{ref:"pane",attr:"aria-label"}])],0,"label"],[me({type:Boolean,reflect:!0,attribute:"match-active"}),0,"matchActive"],[me({type:String,defaultValue:"pathname"}),0,"matchMode"],[me({type:Boolean,attribute:"scroll-active-on-mount"}),0,"scrollActiveOnMount"],[me({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[on({ref:"root"}),0,"rootTarget"],[on({ref:"pane"}),0,"paneTarget"],[on({ref:"handle"}),0,"handleTarget"],[on({ref:"scrim"}),0,"scrimTarget"],[Qo({name:"rui-sidebar-toggle",bubbles:!0,composed:!0}),0,"toggleEvent"],[Qo({name:"rui-sidebar-resize",bubbles:!0,composed:!0}),0,"resizeEvent"],[Qo({name:"rui-sidebar-mobile-change",bubbles:!0,composed:!0}),0,"mobileChangeEvent"],[[mL,Xi([{attr:"data-mobile"},{ref:"root",attr:"data-mobile"}])],0,"isMobile"],[Jo(["open","collapsible","variant","side","width","defaultWidth","defaultOpen","minWidth","maxWidth","isMobile","resizable","label"]),2,"onStateUpdated"],[Jo(["mobileBreakpoint"]),2,"onMobileBreakpointUpdated"],[Jo(["matchActive","matchMode","navigationEvents"]),2,"onMatchSettingsUpdated"],[hw,2,"onPointerMove"],[hw,2,"onPointerUp"],[Qi({ref:"handle",type:"pointerdown"}),2,"onHandlePointerDown"],[Qi({ref:"handle",type:"keydown"}),2,"onHandleKeydown"],[Qi({ref:"scrim",type:"click"}),2,"onScrimClick"],[Qi({selector:mw,type:"click"}),2,"onMenuLinkClick"],[Qi({document:!0,type:"keydown"}),2,"onHostKeydown"]],0,void 0,dw))}variant=(h0(this),f0(this));side=(m0(this),g0(this));collapsible=(b0(this),v0(this));defaultWidth=(y0(this),_0(this));width=(x0(this),w0(this));minWidth=(T0(this),S0(this));maxWidth=(E0(this),R0(this));resizable=(A0(this),I0(this));defaultOpen=(C0(this),D0(this));mobileDefaultOpen=(O0(this),V0(this));open=(k0(this),M0(this));mobileBreakpoint=(L0(this),P0(this));label=(j0(this),F0(this));matchActive=(B0(this),U0(this,!1));matchMode=(z0(this),q0(this));scrollActiveOnMount=(K0(this),$0(this,!1));navigationEvents=(G0(this),W0(this,""));rootTarget=(H0(this),Y0(this));paneTarget=(N0(this),X0(this));handleTarget=(Q0(this),J0(this));scrimTarget=(Z0(this),ew(this));toggleEvent=(tw(this),iw(this));resizeEvent=(rw(this),nw(this));mobileChangeEvent=(ow(this),aw(this));isMobile=(sw(this),lw(this,!1));mediaQuery=(uw(this),null);mediaListener=e=>this.setMobile(e.matches);dragging=!1;dragStartCoord=0;dragStartSize=0;navigationCleanups=[];didScrollActiveOnMount=!1;openControlled=!1;mobileReady=!1;connectedCallback(){super.connectedCallback(),this.ensureWidthInitialized(),this.setAttribute("role","complementary"),this.attachNavigationListeners()}onConnected(){this.ensureWidthInitialized(),this.openControlled=this.open!==void 0,this.bindMobileMediaQuery(),this.openControlled||(this.open=this.isMobile?this.mobileDefaultOpen:this.defaultOpen),this.syncPresentation(),this.syncPaneWidthVar(),this.mobileReady=!0}updated(e){super.updated(e);let i=this.scrollActiveOnMount&&!this.didScrollActiveOnMount;this.syncActiveLinks(i),i&&(this.didScrollActiveOnMount=!0)}disconnectedCallback(){this.endDrag(),this.unbindMobileMediaQuery(),this.detachNavigationListeners(),this.mobileReady=!1,super.disconnectedCallback()}syncPresentation(){let e=this.isOpen(),i=e?"expanded":"collapsed",r=this.resizable&&this.collapsible==="off"&&e&&!this.isMobile,s=!(e||!this.isMobile&&this.collapsible==="icon"),d=this.paneWidth();this.setAttribute("data-state",i),this.setAttribute("data-pane-width",String(d));let h=this.rootTarget;h&&(h.dataset.state=i);let a=this.scrimTarget;a&&a.toggleAttribute("hidden",!(this.isMobile&&e));let E=this.paneTarget;E&&(s?E.setAttribute("inert",""):E.removeAttribute("inert")),this.syncHandlePresentation(r,d)}syncHandlePresentation(e,i){let r=this.handleTarget;r&&(r.toggleAttribute("hidden",!e),e&&(r.setAttribute("aria-orientation",an(this.side)?"vertical":"horizontal"),r.setAttribute("aria-valuenow",String(i)),r.setAttribute("aria-valuemin",String(this.minWidth)),r.setAttribute("aria-valuemax",String(this.maxWidth)),r.setAttribute("aria-label",`${this.label} resize handle`)))}isOpen(){return this.open!==void 0?this.open:this.defaultOpen}ensureWidthInitialized(){this.hasAttribute("width")||(this.width===void 0||this.width===0)&&(this.width=this.defaultWidth)}onStateUpdated(){this.syncPresentation(),this.syncPaneWidthVar()}onMobileBreakpointUpdated(){this.bindMobileMediaQuery()}onMatchSettingsUpdated(){this.detachNavigationListeners(),this.attachNavigationListeners()}syncActiveLinks(e=!1){if(!this.matchActive||typeof window>"u"||typeof window.location>"u")return!1;let i=window.location.pathname,r=!1;for(let s of this.querySelectorAll(mw)){let d=this.isLinkActive(s,i);s.classList.toggle("rui-sidebar__menu-button--active",d),d?(s.setAttribute("aria-current","page"),e&&!r&&(s.scrollIntoView({block:"nearest"}),r=!0)):s.removeAttribute("aria-current")}return r}isLinkActive(e,i){let r=e.pathname;return this.matchMode==="prefix"?i===r||i.startsWith(`${r}/`):r===i}attachNavigationListeners(){if(gL||!this.isConnected||!this.matchActive||typeof window>"u"||typeof window.addEventListener!="function")return;let e=()=>this.syncActiveLinks(!1);if(window.addEventListener("popstate",e),this.navigationCleanups.push(()=>window.removeEventListener("popstate",e)),typeof document<"u"&&typeof document.addEventListener=="function")for(let i of nn(this.navigationEvents))document.addEventListener(i,e),this.navigationCleanups.push(()=>document.removeEventListener(i,e))}detachNavigationListeners(){for(let e of this.navigationCleanups)e();this.navigationCleanups=[]}unbindMobileMediaQuery(){this.mediaQuery?.removeEventListener("change",this.mediaListener),this.mediaQuery=null}bindMobileMediaQuery(){if(this.unbindMobileMediaQuery(),this.mobileBreakpoint<=0||!TL()){this.setMobile(!1);return}this.mediaQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.mediaQuery.addEventListener("change",this.mediaListener),this.setMobile(this.mediaQuery.matches)}setMobile(e){if(e===this.isMobile)return;let i=this.isMobile&&!e,r=!this.isMobile&&e;this.isMobile=e;let s=this.mobileReady&&!this.openControlled;s&&i&&this.collapsible==="off"&&!this.isOpen()?this.setOpen(!0):s&&r?this.setOpen(this.mobileDefaultOpen):this.syncPaneWidthVar(),this.mobileChangeEvent.emit({mobile:e})}clampWidth(e){return Math.min(this.maxWidth,Math.max(this.minWidth,e))}paneWidth(){return this.isOpen()?this.width&&this.width>0?this.width:this.defaultWidth:this.isMobile?0:this.collapsible==="icon"?vL:0}syncPaneWidthVar(e=this.paneWidth()){let i=this.rootTarget;i&&i.style.setProperty("--rui-sidebar-pane-width",`${e}px`),this.paneTarget&&(this.paneTarget.style.removeProperty("width"),this.paneTarget.style.removeProperty("height")),this.setAttribute("data-pane-width",String(e))}applyWidth(e,i){let r=this.clampWidth(e);this.width=r,this.syncPaneWidthVar(r),i&&this.resizeEvent.emit({width:r})}toggle(){this.setOpen(!this.isOpen())}setOpen(e){let i=this.isOpen();if(e===i){this.syncPresentation(),this.syncPaneWidthVar();return}this.open=e;let r=e?"expanded":"collapsed";this.syncPresentation(),this.syncPaneWidthVar(),this.toggleEvent.emit({open:e,state:r})}beginDrag(e){if(e.button!==0||this.collapsible!=="off")return;this.dragging=!0;let i=an(this.side);this.dragStartCoord=i?e.clientX:e.clientY,this.dragStartSize=this.paneWidth(),this.handleTarget?.setPointerCapture(e.pointerId),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp),document.addEventListener("pointercancel",this.onPointerUp)}endDrag(){this.dragging&&(this.dragging=!1,document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),document.removeEventListener("pointercancel",this.onPointerUp))}onPointerMove(e){if(!this.dragging)return;let r=an(this.side)?e.clientX:e.clientY,s=this.side==="right"?this.dragStartCoord-r:r-this.dragStartCoord;this.applyWidth(this.dragStartSize+s,!0)}onPointerUp(){this.endDrag()}onHandlePointerDown(e){e.preventDefault(),this.beginDrag(e)}onHandleKeydown(e){let i=e,r=this.paneWidth(),s=an(this.side),d=s?"ArrowLeft":"ArrowUp",h=s?"ArrowRight":"ArrowDown",a=r;if(i.key===d)a=r-(i.shiftKey?fw:pw);else if(i.key===h)a=r+(i.shiftKey?fw:pw);else if(i.key==="Home")a=this.minWidth;else if(i.key==="End")a=this.maxWidth;else return;e.preventDefault(),this.applyWidth(a,!0)}onScrimClick(){this.isMobile&&this.setOpen(!1)}onMenuLinkClick(){this.isMobile&&this.setOpen(!1)}onHostKeydown(e){let i=e;if(i.key==="Escape"&&this.isMobile&&this.isOpen()){i.preventDefault(),this.setOpen(!1);return}wL(i)&&i.key.toLowerCase()===xL&&(i.preventDefault(),this.toggle())}static{p0()}};import{RadiantElement as Bw,bindTo as sn,customElement as IL,onEvent as CL,onUpdated as Uw,prop as Ji,query as DL,state as Zo}from"@ecopages/radiant";var vw,yw,_w,xw,ww,Tw,Sw,Ew,Rw,Aw,Iw,Cw,Dw,Ow,Vw,kw,Mw,Lw,Pw,jw;function SL(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Fw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Fw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:EL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return AL(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function EL(t){var e=RL(t,"string");return typeof e=="symbol"?e:e+""}function RL(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fw(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function AL(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var zw="Toggle sidebar",OL=["filled","outline","ghost"],VL=["sm","md","lg"];function Kw({variant:t,size:e}){return`rui-button rui-button--${t} rui-button--${e} rui-sidebar__trigger`}function kL(t){return t==="inset"?"collapsed":"expanded"}var $w,qw=class extends Bw{static{({e:[_w,xw,ww,Tw,Sw,Ew,Rw,Aw,Iw,Cw,Dw,Ow,Vw,kw,Mw,Lw,Pw,jw,vw],c:[$w,yw]}=SL(this,[IL("rui-sidebar-trigger")],[[Ji({type:String,defaultValue:""}),0,"controls"],[[Ji({type:String,attribute:"button-label",defaultValue:zw}),sn({ref:"button",attr:"aria-label",map:e=>e?.trim()||zw})],0,"buttonLabel"],[Ji({type:String,reflect:!0,defaultValue:""}),0,"placement"],[Ji({type:String,defaultValue:"ghost"}),0,"variant"],[Ji({type:String,defaultValue:"md"}),0,"size"],[DL({ref:"button"}),0,"buttonTarget"],[[Zo,sn([{attr:"data-sidebar-state"},{ref:"button",attr:"aria-expanded",map:e=>String(e==="expanded")}])],0,"sidebarState"],[[Zo,sn({attr:"data-sidebar-mobile"})],0,"sidebarMobile"],[[Zo,sn({attr:"data-sidebar-collapsible"})],0,"sidebarCollapsible"],[Uw(["controls","placement"]),2,"onTargetUpdated"],[Uw(["variant","size"]),2,"onPresentationUpdated"],[CL({ref:"button",type:"click"}),2,"onButtonClick"]],0,void 0,Bw))}controls=(vw(this),_w(this));buttonLabel=(xw(this),ww(this));placement=(Tw(this),Sw(this));variant=(Ew(this),Rw(this));size=(Aw(this),Iw(this));buttonTarget=(Cw(this),Dw(this));sidebarState=(Ow(this),Vw(this,"expanded"));sidebarMobile=(kw(this),Mw(this,null));sidebarCollapsible=(Lw(this),Pw(this,null));sidebarObserver=(jw(this),null);attachedSidebar=null;onConnected(){this.syncWithSidebar()}disconnectedCallback(){this.detachFromSidebar(),super.disconnectedCallback()}onTargetUpdated(){this.syncWithSidebar()}onPresentationUpdated(){let e=this.buttonTarget?.classList;if(e){for(let i of OL)e.toggle(`rui-button--${i}`,i===this.variant);for(let i of VL)e.toggle(`rui-button--${i}`,i===this.size)}}resolveSidebar(){let e=this.controls?.trim();if(e){let r=document.getElementById(e);return r?.localName==="rui-sidebar"?r:null}let i=this.closest("rui-sidebar");return i?.id?i:null}syncWithSidebar(){let e=this.resolveSidebar();e!==this.attachedSidebar&&(this.detachFromSidebar(),e&&(this.attachedSidebar=e,typeof MutationObserver=="function"&&(this.sidebarObserver=new MutationObserver(()=>this.applyState()),this.sidebarObserver.observe(e,{attributes:!0,attributeFilter:["data-state","data-mobile","data-collapsible"]}))));let i=e?.id||this.controls;i?this.buttonTarget?.setAttribute("aria-controls",i):this.buttonTarget?.removeAttribute("aria-controls"),this.applyState()}detachFromSidebar(){this.sidebarObserver?.disconnect(),this.attachedSidebar=null,this.sidebarObserver=null}applyState(){let e=this.attachedSidebar;if(!e){this.sidebarState=kL(this.placement),this.sidebarMobile=null,this.sidebarCollapsible=null;return}this.sidebarState=e.getAttribute("data-state")==="collapsed"?"collapsed":"expanded",this.sidebarMobile=e.getAttribute("data-mobile")==="true",this.sidebarCollapsible=e.getAttribute("data-collapsible")??"off"}onButtonClick(e){e.preventDefault(),e.stopPropagation();let i=this.resolveSidebar();i&&typeof i.toggle=="function"&&i.toggle()}static{yw()}};import{jsx as we,jsxs as Zi}from"@ecopages/jsx/jsx-runtime";function ML(){return Zi("span",{class:"rui-sidebar__trigger-icon","aria-hidden":"true",children:[Zi("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--collapse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[we("path",{d:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),we("path",{d:"M9 3v18"}),we("path",{d:"m14 15 3-3-3-3"})]}),Zi("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--expand",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[we("path",{d:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),we("path",{d:"M9 3v18"}),we("path",{d:"m14 9-3 3 3 3"})]}),Zi("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--close",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[we("path",{d:"M18 6 6 18"}),we("path",{d:"m6 6 12 12"})]}),Zi("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--menu",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[we("path",{d:"M4 6h16"}),we("path",{d:"M4 12h16"}),we("path",{d:"M4 18h16"})]})]})}function LL({children:t,triggerLabel:e,placement:i,variant:r="ghost",size:s="md",controls:d,...h}){return we("rui-sidebar-trigger",{...h,"prop:buttonLabel":e,placement:i,variant:r,size:s,controls:d,children:we("button",{"data-ref":"button",type:"button",class:Kw({variant:r,size:s}),children:t??we(ML,{})})})}import{jsx as se,jsxs as er}from"@ecopages/jsx/jsx-runtime";function ea(t,...e){let i={...t};for(let r of e)delete i[r];return i}function PL({layout:t="default",siteHeader:e,sidebar:i,children:r,class:s,...d}){return t==="docs"?er("div",{...d,class:j("rui-sidebar-provider",s),"data-layout":t,children:[e?se("div",{class:"rui-sidebar-provider__site-header",children:e}):null,er("div",{class:"rui-sidebar-provider__body",children:[i,r]})]}):er("div",{...d,class:j("rui-sidebar-provider",s),"data-layout":t,children:[i,r]})}function jL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__header",e),children:t})}function FL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__content",e),children:t})}function BL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__footer",e),children:t})}function UL({class:t,...e}){return se("hr",{...e,role:"separator","aria-orientation":"horizontal",class:j("rui-sidebar__separator",t)})}function zL({children:t,class:e,...i}){return se("section",{...i,class:j("rui-sidebar__group",e),children:t})}function Gw({children:t,class:e,...i}){return se("h2",{...i,class:j("rui-sidebar__group-label",e),children:t})}function qL({children:t,class:e,...i}){return se("button",{...i,type:"button",class:j("rui-sidebar__group-action",e),children:t})}function KL({label:t,action:e,class:i,...r}){return er("div",{...r,class:j("rui-sidebar__group-header",i),children:[se(Gw,{children:t}),e]})}function $L({children:t,class:e,...i}){return se("ul",{...i,role:"list",class:j("rui-sidebar__menu",e),children:t})}function GL({children:t,class:e,...i}){return se("li",{...i,class:j("rui-sidebar__menu-item",e),children:t})}function Ww(t){if(t.href!==void 0){let{children:K,class:$,isActive:V,href:G,tooltip:W,aria:O,title:_,"aria-current":H,...Y}=t;return se("a",{...ea(Y,"as"),aria:ne(O,typeof K=="string"?void 0:W),href:G,"data-ref":"menu-button",class:j("rui-sidebar__menu-button",V&&"rui-sidebar__menu-button--active",$),"aria-current":V?"page":H,title:ke(_,W),children:K})}let{children:e,class:i,isActive:r,type:s="button",tooltip:d,disabled:h,onClick:a,aria:E,title:A,"aria-current":S,"on:click":I,...T}=t;return se("button",{...ea(T,"as","href"),aria:ne(E,typeof e=="string"?void 0:d),type:s,"data-ref":"menu-button",class:j("rui-sidebar__menu-button",r&&"rui-sidebar__menu-button--active",i),"aria-current":r?"page":S,disabled:h,title:ke(A,d),"on:click":ke(I,a),children:e})}function WL(t){let{class:e,...i}=t;return se(Ww,{class:j("rui-sidebar__menu-action",e),...i})}function HL({children:t,class:e,...i}){return se("main",{...i,class:j("rui-sidebar__inset",e),children:t})}function YL({children:t,open:e,label:i,...r}){return se("rui-sidebar",{...r,"prop:open":e,label:i,children:er("div",{class:"rui-sidebar","data-ref":"root",children:[se("button",{"data-ref":"scrim",type:"button",class:"rui-sidebar__scrim",tabindex:-1,"aria-label":"Close sidebar",hidden:!0}),se("div",{"data-ref":"pane",class:"rui-sidebar__pane","aria-label":i,children:t}),se("div",{"data-ref":"handle",class:"rui-sidebar__handle",role:"separator",tabindex:0,hidden:!0,children:se("span",{class:"rui-sidebar__handle-grip","aria-hidden":"true"})})]})})}import{bindTo as FT,customElement as ZL,event as eP,onEvent as tr,onUpdated as tP,prop as Ve,query as Rt}from"@ecopages/radiant";import{FormAssociatedElement as BT}from"@ecopages/radiant/form-associated-element";var Hw,Yw,Nw,Xw,Qw,Jw,Zw,eT,tT,iT,rT,nT,oT,aT,sT,lT,uT,cT,dT,hT,pT,fT,mT,gT,bT,vT,yT,_T,xT,wT,TT,ST,ET,RT,AT,IT,CT,DT,OT,VT,kT,MT,LT,PT;function NL(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:jT(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||jT(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:XL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return JL(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function XL(t){var e=QL(t,"string");return typeof e=="symbol"?e:e+""}function QL(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jT(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function JL(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var ta=50,ia=25,ra=75,zT=100;function qT(t,e,i,r,s){let d=t.clamp(e),h=t.clamp(i);d>h&&([d,h]=[h,d]);let a=Math.max(0,r);return h-d<a&&(s==="min"?d=t.clamp(h-a):h=t.clamp(d+a)),[d,h]}function iP(t){return Array.isArray(t.value)?[...t.value]:typeof t.value=="number"?[t.value]:t.variant==="range"?[ia,ra]:[ta]}function KT(t){let e=We(t.min,t.max,t.step);if(t.variant==="range"||t.values.length>=2){let i=t.values[0]??ia,r=t.values[1]??ra;return qT(e,i,r,t.minDistance??0)}return[e.clamp(t.values[0]??ta)]}function $T(t,e,i){let r=mi(e,i);return t.length===2?`${Ge(t[0],r)} \u2013 ${Ge(t[1],r)}`:Ge(t[0],r)}function GT(t){let e=t.variant??"single",i=t.min??0,r=t.max??zT,s=t.step??1,d=t.minDistance??0,h=iP(t),a=KT({variant:e,values:h,min:i,max:r,step:s,minDistance:d}),E=We(i,r,s);return{variant:a.length===2?"range":"single",min:i,max:r,step:s,minDistance:d,committed:a,readoutPrecision:mi(s,t.valuePrecision),readoutText:$T(a,s,t.valuePrecision),trackStyle:WT(a,E),isRange:a.length===2,valuePrecision:typeof t.valuePrecision=="number"&&Number.isFinite(t.valuePrecision)?t.valuePrecision:void 0}}function WT(t,e){let i=t[0],r=t.length===2?t[1]:t[0],s=`${e.ratioFor(i)*100}%`,d=`${e.ratioFor(r)*100}%`,h=`${(e.ratioFor(r)-e.ratioFor(i))*100}%`;return{"--rui-slider-fill-start":t.length===2?s:"0%","--rui-slider-fill-size":t.length===2?h:d,"--rui-slider-value":s,"--rui-slider-min":s,"--rui-slider-max":d}}var HT,UT=class extends BT{static{({e:[Nw,Xw,Qw,Jw,Zw,eT,tT,iT,rT,nT,oT,aT,sT,lT,uT,cT,dT,hT,pT,fT,mT,gT,bT,vT,yT,_T,xT,wT,TT,ST,ET,RT,AT,IT,CT,DT,OT,VT,kT,MT,LT,PT,Hw],c:[HT,Yw]}=NL(this,[ZL("rui-slider")],[[Ve({type:String,defaultValue:"single"}),0,"variant"],[Ve({type:String,defaultValue:"horizontal"}),0,"orientation"],[Ve({type:Array,reflect:!0,defaultValue:[ta],transform:Rr}),0,"value"],[Ve({type:Number,defaultValue:0}),0,"min"],[Ve({type:Number,defaultValue:zT}),0,"max"],[Ve({type:Number,defaultValue:1}),0,"step"],[Ve({type:Number,attribute:"value-precision",defaultValue:Number.NaN}),0,"valuePrecision"],[Ve({type:Number,defaultValue:0}),0,"minDistance"],[Ve({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[[Ve({type:String,defaultValue:""}),FT([{ref:"label",bool:"hidden",invert:!0},{ref:"label",text:!0}])],0,"label"],[[Ve({type:Boolean,attribute:"show-value",defaultValue:!1}),FT({selector:"[data-default-value]",bool:"hidden",invert:!0})],0,"showValue"],[Ve({type:Boolean,attribute:"value-title",defaultValue:!1}),0,"valueTitle"],[eP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Rt({ref:"root"}),0,"rootTarget"],[Rt({ref:"header"}),0,"headerTarget"],[Rt({ref:"label"}),0,"labelTarget"],[Rt({ref:"rangeTrack"}),0,"rangeTrack"],[Rt({ref:"value"}),0,"valueTarget"],[Rt({ref:"singleThumb"}),0,"singleThumb"],[Rt({ref:"rangeMinThumb"}),0,"rangeMinThumb"],[Rt({ref:"rangeMaxThumb"}),0,"rangeMaxThumb"],[tP(["value","min","max","step","valuePrecision","minDistance","variant","orientation","disabled","readOnly","effectiveDisabled","label","name","showValue","valueTitle"]),2,"onPropsUpdated"],[tr({ref:"rangeTrack",type:"pointerdown"}),2,"onPointerDown"],[tr({document:!0,type:"pointermove"}),2,"onPointerMove"],[tr({document:!0,type:"pointerup"}),2,"onPointerUp"],[tr({document:!0,type:"pointercancel"}),2,"onPointerCancel"],[tr({selector:"[data-thumb]",type:"keydown"}),2,"onThumbKeydown"]],0,void 0,BT))}variant=(Hw(this),Nw(this));orientation=(Xw(this),Qw(this));value=(Jw(this),Zw(this));min=(eT(this),tT(this));max=(iT(this),rT(this));step=(nT(this),oT(this));valuePrecision=(aT(this),sT(this));minDistance=(lT(this),uT(this));readOnly=(cT(this),dT(this));label=(hT(this),pT(this));showValue=(fT(this),mT(this));valueTitle=(gT(this),bT(this));changeEvent=(vT(this),yT(this));rootTarget=(_T(this),xT(this));headerTarget=(wT(this),TT(this));labelTarget=(ST(this),ET(this));rangeTrack=(RT(this),AT(this));valueTarget=(IT(this),CT(this));singleThumb=(DT(this),OT(this));rangeMinThumb=(VT(this),kT(this));rangeMaxThumb=(MT(this),LT(this));activeThumb=(PT(this),null);activePointerId=null;pending=null;lastEmitted="";onConnected(){this.adoptLegacyRangeAttributes(),this.syncChrome(),this.syncValues(this.committedValues())}formValue(){if(!this.name)return null;let e=this.liveValues();if(e.length===2){let i=new FormData;return i.append(this.name,String(e[0])),i.append(`${this.name}-max`,String(e[1])),i}return String(e[0]??"")}formState(){return this.committedValues().join(",")}restoreFormState(e){this.value=String(e).split(",").map(Number).filter(i=>Number.isFinite(i)),this.syncValues(this.committedValues())}adoptLegacyRangeAttributes(){if(this.hasAttribute("value"))return;let e=this.getAttribute("range-min"),i=this.getAttribute("range-max");if(e===null&&i===null)return;let r=e!==null?Number(e):ia,s=i!==null?Number(i):ra;this.value=[r,s]}onPropsUpdated(){this.activeThumb||(this.syncChrome(),this.syncValues(this.committedValues()))}get isRange(){return this.liveValues().length===2}get isVertical(){return this.orientation==="vertical"}get numericRange(){return We(this.min,this.max,this.step)}get resolvedValuePrecision(){return mi(this.step,this.valuePrecision)}formatValue(e){return Ge(e,this.resolvedValuePrecision)}formatValues(e){return $T(e,this.step,this.valuePrecision)}get defaultValueTarget(){return this.querySelector("[data-default-value]")}thumbFor(e){return e==="value"?this.singleThumb:e==="min"?this.rangeMinThumb:this.rangeMaxThumb}parseThumb(e){return this.isRange?e==="min"||e==="max"?e:null:e==="value"?e:null}constrainPair(e,i,r){return qT(this.numericRange,e,i,this.minDistance,r)}committedValues(){return KT({variant:this.variant,values:this.value,min:this.min,max:this.max,step:this.step,minDistance:this.minDistance})}liveValues(){return this.pending??this.committedValues()}changeDetail(e){return{value:e}}emitIfChanged(e){let i=e.join(",");i!==this.lastEmitted&&(this.lastEmitted=i,this.changeEvent.emit(this.changeDetail(e)))}reflectValues(e){let i=this.value;i.length===e.length&&e.every((d,h)=>$i(i[h],d,this.step))||(this.value=e)}syncValues(e){this.paint(e),this.reflectValues(e);let i=e.length>=2?"range":"single";this.variant!==i&&(this.variant=i)}syncChrome(){this.syncRootChrome(),this.syncThumbChrome()}syncRootChrome(){let e=!!this.valueTarget&&(!this.defaultValueTarget||this.showValue);this.rootTarget?.classList.toggle("rui-slider--single",!this.isRange),this.rootTarget?.classList.toggle("rui-slider--range",this.isRange),this.rootTarget?.classList.toggle("rui-slider--vertical",this.isVertical),this.headerTarget?.toggleAttribute("hidden",!this.label&&!e)}syncThumbChrome(){let e=this.effectiveDisabled?-1:0,i=this.isVertical?"vertical":"horizontal",r=this.numericRange;for(let{id:s,label:d,visible:h}of this.getThumbChrome()){let a=this.thumbFor(s);a&&(a.toggleAttribute("hidden",!h),a.toggleAttribute("disabled",this.effectiveDisabled||!h),a.setAttribute("tabindex",String(h?e:-1)),a.setAttribute("aria-label",d),a.setAttribute("aria-orientation",i),a.setAttribute("aria-valuemin",String(r.lowerBound)),a.setAttribute("aria-valuemax",String(r.upperBound)),a.setAttribute("aria-readonly",String(this.readOnly)))}}getThumbChrome(){let e=this.isRange;return[{id:"value",label:this.label||"Value",visible:!e},{id:"min",label:this.label?`${this.label} minimum`:"Minimum value",visible:e},{id:"max",label:this.label?`${this.label} maximum`:"Maximum value",visible:e}]}paint(e){let i=e[0],r=e.length===2?e[1]:e[0],s=this.rangeTrack,d=WT(e,this.numericRange);for(let[h,a]of Object.entries(d))s?.style.setProperty(h,a);this.singleThumb&&(this.singleThumb.setAttribute("aria-valuenow",String(i)),this.singleThumb.setAttribute("aria-valuetext",this.formatValue(i))),this.rangeMinThumb&&(this.rangeMinThumb.setAttribute("aria-valuenow",String(i)),this.rangeMinThumb.setAttribute("aria-valuetext",this.formatValue(i)),this.rangeMinThumb.setAttribute("aria-valuemax",String(r))),this.rangeMaxThumb&&(this.rangeMaxThumb.setAttribute("aria-valuemin",String(i)),this.rangeMaxThumb.setAttribute("aria-valuenow",String(r)),this.rangeMaxThumb.setAttribute("aria-valuetext",this.formatValue(r))),this.valueTarget&&(this.valueTarget.textContent=this.formatValues(e)),this.syncFormValue(),this.syncValueTitle(e)}syncValueTitle(e){let i=[[this.rangeTrack,"track"],[this.singleThumb,"value"],[this.rangeMinThumb,"min"],[this.rangeMaxThumb,"max"]],r=this.getValueTitles(e);for(let[s,d]of i){let h=r[d];h?s?.setAttribute("title",h):s?.removeAttribute("title")}}getValueTitles(e){if(!this.valueTitle)return{};if(e.length===1)return{value:this.formatValue(e[0])};let[i,r]=e;return{min:this.formatValue(i),max:this.formatValue(r),track:this.formatValues(e)}}valueFromPointer(e){let i=this.rangeTrack;if(!i)return this.numericRange.lowerBound;let r=i.getBoundingClientRect();if(r.width===0||r.height===0)return this.numericRange.lowerBound;let s=this.isVertical?1-(e.clientY-r.top)/r.height:(e.clientX-r.left)/r.width;return this.numericRange.valueFromRatio(s)}nearestThumb(e){if(!this.isRange)return"value";let[i,r]=this.liveValues();return Math.abs(e-i)<=Math.abs(e-r)?"min":"max"}moveThumb(e,i){if(this.activeThumb=e,this.isRange){let s=this.pending??this.committedValues();this.pending=this.constrainPair(e==="min"?i:s[0],e==="max"?i:s[1],e)}else this.pending=[this.numericRange.clamp(i)];let r=this.pending;return this.paint(r),this.emitIfChanged(r),r}commit(){let e=this.liveValues();this.pending=null,this.activeThumb=null,this.activePointerId=null,this.syncValues(e)}revert(){this.pending=null,this.activeThumb=null,this.activePointerId=null,this.lastEmitted=this.committedValues().join(","),this.paint(this.committedValues())}releasePointer(e){let i=this.rangeTrack;i?.hasPointerCapture(e.pointerId)&&i.releasePointerCapture(e.pointerId)}onPointerDown(e){if(e.button!==0||this.effectiveDisabled||this.readOnly)return;let i=e.target.closest("[data-thumb]"),r=this.parseThumb(i?.getAttribute("data-thumb")??null),s=this.valueFromPointer(e),d=r??this.nearestThumb(s);this.pending=this.committedValues(),this.lastEmitted=this.pending.join(","),this.activeThumb=d,this.activePointerId=e.pointerId,this.rangeTrack?.setPointerCapture(e.pointerId),this.thumbFor(d)?.focus(),r||this.moveThumb(d,s),e.preventDefault()}onPointerMove(e){!this.activeThumb||e.pointerId!==this.activePointerId||this.moveThumb(this.activeThumb,this.valueFromPointer(e))}onPointerUp(e){!this.activeThumb||e.pointerId!==this.activePointerId||(this.releasePointer(e),this.commit())}onPointerCancel(e){!this.activeThumb||e.pointerId!==this.activePointerId||(this.releasePointer(e),this.revert())}onThumbKeydown(e){if(this.effectiveDisabled||this.readOnly)return;let i=e.target.closest("[data-thumb]"),r=this.parseThumb(i?.getAttribute("data-thumb")??null);if(!r)return;let s=this.committedValues(),d=r==="max"?s[s.length-1]:s[0],h=Xr(this.numericRange,d,e.key);h!=null&&(e.preventDefault(),this.lastEmitted=s.join(","),this.moveThumb(r,h),this.commit())}static{Yw()}};import{jsx as Ue,jsxs as na}from"@ecopages/jsx/jsx-runtime";function YT({children:t,class:e,...i}){return Ue("span",{...i,class:j("rui-slider__value",e),"data-ref":"value","aria-hidden":"true",children:t})}function rP({disabled:t,min:e,max:i,label:r,variant:s,committed:d,readoutPrecision:h,trackStyle:a}){let E=s!=="range",A=r||"Value",S=d[0],I=d.length===2?d[1]:d[0],T=Ge(S,h),K=Ge(I,h);return Ue("div",{class:"rui-slider__range",children:na("div",{class:"rui-slider__range-track","data-ref":"rangeTrack",style:a,children:[Ue("div",{class:"rui-slider__range-fill","data-ref":"rangeFill"}),Ue("button",{type:"button",class:"rui-slider__thumb","data-ref":"singleThumb","data-thumb":"value",role:"slider",tabindex:t||!E?-1:0,"aria-label":A,"aria-valuemin":e,"aria-valuemax":i,"aria-valuenow":S,"aria-valuetext":T,disabled:t||!E,hidden:!E}),Ue("button",{type:"button",class:"rui-slider__thumb","data-ref":"rangeMinThumb","data-thumb":"min",role:"slider",tabindex:t||E?-1:0,"aria-label":r?`${r} minimum`:"Minimum value","aria-valuemin":e,"aria-valuemax":I,"aria-valuenow":S,"aria-valuetext":T,disabled:t||E,hidden:E}),Ue("button",{type:"button",class:"rui-slider__thumb","data-ref":"rangeMaxThumb","data-thumb":"max",role:"slider",tabindex:t||E?-1:0,"aria-label":r?`${r} maximum`:"Maximum value","aria-valuemin":S,"aria-valuemax":i,"aria-valuenow":I,"aria-valuetext":K,disabled:t||E,hidden:E})]})})}function nP({variant:t,orientation:e="horizontal",label:i,showValue:r=!1,valueTitle:s=!1,disabled:d,name:h,min:a,max:E,step:A,value:S,valuePrecision:I,minDistance:T,children:K,...$}){let V=GT({variant:t,value:S,min:a,max:E,step:A,minDistance:T,valuePrecision:I}),G=K??Ue(YT,{"data-default-value":!0,hidden:!r,children:V.readoutText}),W=!!K||r;return Ue("rui-slider",{...$,variant:V.variant,orientation:e,label:i,showValue:r,valueTitle:s,disabled:d,name:h,min:V.min,max:V.max,step:V.step,value:V.committed,minDistance:V.minDistance,valuePrecision:V.valuePrecision,children:Ue(oP,{seed:V,orientation:e,label:i,disabled:d,hasVisibleReadout:W,valueReadout:G})})}function oP({seed:t,orientation:e,label:i,disabled:r,hasVisibleReadout:s,valueReadout:d}){return na("div",{class:j("rui-slider",t.isRange?"rui-slider--range":"rui-slider--single",e==="vertical"&&"rui-slider--vertical"),"data-ref":"root",children:[na("div",{class:"rui-slider__header","data-ref":"header",hidden:!i&&!s,children:[Ue("span",{class:"rui-slider__label","data-ref":"label",hidden:!i,children:i}),d]}),Ue(rP,{disabled:r,min:t.min,max:t.max,label:i,variant:t.variant,committed:t.committed,readoutPrecision:t.readoutPrecision,trackStyle:t.trackStyle})]})}import{jsx as aP}from"@ecopages/jsx/jsx-runtime";function sP({size:t="md",aria:e,class:i,...r}){return aP("span",{...r,role:"status",aria:ne(e,"Loading"),class:j("rui-spinner",`rui-spinner--${t}`,i)})}import{RadiantElement as aS,bindTo as oa,customElement as hP,event as pP,onEvent as fP,prop as aa}from"@ecopages/radiant";var NT,XT,QT,JT,ZT,eS,tS,iS,rS,nS;function lP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:oS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||oS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:uP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return dP(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function uP(t){var e=cP(t,"string");return typeof e=="symbol"?e:e+""}function cP(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oS(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function dP(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var lS,sS=class extends aS{static{({e:[QT,JT,ZT,eS,tS,iS,rS,nS,NT],c:[lS,XT]}=lP(this,[hP("rui-switch")],[[[aa({type:Boolean,reflect:!0,defaultValue:!1}),oa({ref:"input",prop:"checked"})],0,"checked"],[[aa({type:Boolean,reflect:!0,defaultValue:!1}),oa({ref:"input",prop:"disabled"})],0,"disabled"],[[aa({type:String,defaultValue:""}),oa({ref:"input",attr:"name",map:gt})],0,"name"],[pP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[fP({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,aS))}constructor(...e){super(...e),nS(this)}checked=(NT(this),QT(this));disabled=(JT(this),ZT(this));name=(eS(this),tS(this));changeEvent=(iS(this),rS(this));onInputChange(e){let i=e.target;this.checked=i.checked,this.changeEvent.emit({checked:this.checked})}static{XT()}};import{jsx as ir,jsxs as mP}from"@ecopages/jsx/jsx-runtime";function gP({children:t,checked:e,disabled:i,name:r,...s}){return ir("rui-switch",{...s,checked:e,disabled:i,name:r,children:mP("label",{class:"rui-switch",children:[ir("input",{type:"checkbox",role:"switch","data-ref":"input","data-rui-control":!0,"data-rui-control-type":"boolean",class:"rui-switch__input",checked:e,disabled:i,name:r||void 0}),ir("span",{class:"rui-switch__track","aria-hidden":"true",children:ir("span",{class:"rui-switch__thumb"})}),ir("span",{class:"rui-switch__label",children:t})]})})}import{jsx as pe,jsxs as MS}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as DS,customElement as xP,event as sa,onEvent as yi,onUpdated as OS,prop as _i}from"@ecopages/radiant";var uS,cS,dS,hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,TS,SS,ES,RS,AS,IS;function bP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:CS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||CS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:vP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _P(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function vP(t){var e=yP(t,"string");return typeof e=="symbol"?e:e+""}function yP(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CS(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function _P(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var kS,VS=class extends DS{static{({e:[dS,hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,TS,SS,ES,RS,AS,IS,uS],c:[kS,cS]}=bP(this,[xP("rui-table")],[[_i({type:String,defaultValue:""}),0,"label"],[_i({type:String,attribute:"aria-busy",defaultValue:"false"}),0,"ariaBusy"],[_i({type:String,attribute:"selection-mode",defaultValue:"none"}),0,"selectionMode"],[_i({...Ie,defaultValue:[]}),0,"value"],[_i({type:String,attribute:"sort-column",reflect:!0,defaultValue:""}),0,"sortColumn"],[_i({type:String,attribute:"sort-direction",reflect:!0,defaultValue:"ascending"}),0,"sortDirection"],[sa({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[sa({name:"rui-sort-change",bubbles:!0,composed:!0}),0,"sortChangeEvent"],[sa({name:"rui-row-action",bubbles:!0,composed:!0}),0,"rowActionEvent"],[OS(["value","selectionMode"]),2,"onSelectionUpdated"],[OS(["sortColumn","sortDirection"]),2,"onSortUpdated"],[yi({selector:"[data-table-cell]",type:"click"}),2,"onCellClick"],[yi({selector:"[data-table-cell]",type:"dblclick"}),2,"onCellDoubleClick"],[yi({selector:"[data-table-cell]",type:"keydown"}),2,"onCellKeydown"],[yi({selector:"rui-checkbox[data-table-select-row]",type:"rui-change"}),2,"onRowSelectionChange"],[yi({selector:"rui-checkbox[data-table-select-all]",type:"rui-change"}),2,"onSelectAllChange"],[yi({selector:"[data-table-sort]",type:"click"}),2,"onSortClick"]],0,void 0,DS))}label=(uS(this),dS(this));ariaBusy=(hS(this),pS(this));selectionMode=(fS(this),mS(this));value=(gS(this),bS(this));sortColumn=(vS(this),yS(this));sortDirection=(_S(this),xS(this));changeEvent=(wS(this),TS(this));sortChangeEvent=(SS(this),ES(this));rowActionEvent=(RS(this),AS(this));structureObserver=void IS(this);rovingSyncPending=!1;connectedCallback(){super.connectedCallback(),this.observeStructure()}onConnected(){this.syncSelectionState(),this.syncSorting(),this.syncRovingTabindex()}disconnectedCallback(){this.structureObserver?.disconnect(),this.structureObserver=void 0,super.disconnectedCallback()}onSelectionUpdated(){this.syncSelectionState()}onSortUpdated(){this.syncSorting()}observeStructure(){typeof MutationObserver>"u"||(this.structureObserver?.disconnect(),this.structureObserver=new MutationObserver(()=>this.queueRovingSync()),this.structureObserver.observe(this,{childList:!0,subtree:!0}))}queueRovingSync(){this.rovingSyncPending||(this.rovingSyncPending=!0,queueMicrotask(()=>{this.rovingSyncPending=!1,this.isConnected&&this.syncRovingTabindex()}))}getRows(){return Array.from(this.querySelectorAll("[data-table-row]"))}getSelectableRows(){return this.getRows().filter(e=>!e.hidden&&e.getAttribute("aria-disabled")!=="true")}getRowCells(e){return Array.from(e.children).filter(i=>i instanceof HTMLElement&&i.hasAttribute("data-table-cell"))}getFocusableCells(){return this.getSelectableRows().flatMap(e=>this.getRowCells(e))}selectedIds(){return this.selectionMode==="single"?this.value.length>0?[this.value[0]]:[]:this.value}setSelectedIds(e){this.selectionMode==="single"?this.value=e.length>0?[e[0]]:[]:this.value=e,this.syncSelectionState(),this.changeEvent.emit({value:this.value})}getActiveCellPosition(){let e=this.getFocusableCells(),i=e.findIndex(h=>h.tabIndex===0),r=i>=0?e[i]:this.querySelector("[data-table-cell]:focus")??null;if(!r)return null;let s=r.closest("[data-table-row]");if(!s)return null;let d=this.getRowCells(s).indexOf(r);return d<0?null:{rowId:s.getAttribute("data-table-row")??"",columnIndex:d}}syncSelectionState(){let e=new Set(this.selectedIds()),i=this.getSelectableRows(),r=this.selectionMode!=="none";for(let s of this.getRows()){let d=s.getAttribute("data-table-row")??"";r?s.setAttribute("aria-selected",String(e.has(d))):s.removeAttribute("aria-selected");let h=s.querySelector("rui-checkbox[data-table-select-row]");h&&(h.checked=r&&e.has(d),h.disabled=!r||s.getAttribute("aria-disabled")==="true")}for(let s of this.querySelectorAll("rui-checkbox[data-table-select-all]")){let d=i.filter(a=>e.has(a.getAttribute("data-table-row")??"")).length,h=this.selectionMode==="multiple";s.checked=h&&i.length>0&&d===i.length,s.indeterminate=h&&d>0&&d<i.length,s.disabled=!h||i.length===0}}syncRovingTabindex(){let e=this.getFocusableCells();if(e.length===0)return;let i=this.getActiveCellPosition(),r=e.findIndex(s=>s.tabIndex===0);if(i){let s=this.getRows().find(d=>d.getAttribute("data-table-row")===i.rowId);if(s){let d=this.getRowCells(s)[i.columnIndex],h=d?e.indexOf(d):-1;h>=0&&(r=h)}}ue(e,r>=0?r:0)}syncSorting(){for(let e of this.querySelectorAll("[data-table-column]")){let i=e.getAttribute("data-table-column");i&&i===this.sortColumn?e.setAttribute("aria-sort",this.sortDirection):e.removeAttribute("aria-sort")}}isInteractiveTarget(e){return!!e.closest('button, input, select, textarea, a[href], [contenteditable="true"], rui-checkbox')}selectRow(e,i=!1){if(this.selectionMode==="none"||e.getAttribute("aria-disabled")==="true")return;let r=e.getAttribute("data-table-row")??"";if(!r)return;if(this.selectionMode==="single"){this.setSelectedIds([r]);return}let s=new Set(this.selectedIds());i&&s.has(r)?s.delete(r):s.add(r),this.setSelectedIds([...s])}focusCell(e,i){let r=this.getFocusableCells(),s=this.getRowCells(e),d=s[Math.min(Math.max(i,0),s.length-1)],h=r.indexOf(d);h<0||(ue(r,h),d.focus(),d.scrollIntoView({block:"nearest",inline:"nearest"}))}activateRow(e){if(!e.hasAttribute("data-table-actionable")||e.getAttribute("aria-disabled")==="true")return;let i=e.getAttribute("data-table-row")??"";i&&this.rowActionEvent.emit({rowId:i})}onCellClick(e){let i=e.target;if(this.isInteractiveTarget(i))return;let r=i.closest("[data-table-cell]"),s=r?.closest("[data-table-row]");!r||!s||!this.contains(s)||(this.selectRow(s,this.selectionMode==="multiple"),this.focusCell(s,this.getRowCells(s).indexOf(r)))}onCellDoubleClick(e){let i=e.target;if(this.isInteractiveTarget(i))return;let r=i.closest("[data-table-row]");r&&this.contains(r)&&this.activateRow(r)}onCellKeydown(e){let i=e.target;if(this.isInteractiveTarget(i))return;let r=i.closest("[data-table-cell]"),s=r?.closest("[data-table-row]");if(!r||!s)return;let d=this.getSelectableRows(),h=d.indexOf(s),a=this.getRowCells(s),E=a.indexOf(r);switch(e.key){case"ArrowRight":e.preventDefault(),this.focusCell(s,E+1);return;case"ArrowLeft":e.preventDefault(),this.focusCell(s,E-1);return;case"ArrowDown":e.preventDefault(),this.focusCell(d[Math.min(h+1,d.length-1)]??s,E);return;case"ArrowUp":e.preventDefault(),this.focusCell(d[Math.max(h-1,0)]??s,E);return;case"Home":e.preventDefault(),this.focusCell(s,0);return;case"End":e.preventDefault(),this.focusCell(s,a.length-1);return;case" ":e.preventDefault(),this.selectRow(s,!0);return;case"Enter":e.preventDefault(),this.activateRow(s);return;default:return}}onRowSelectionChange(e){let r=e.target.closest("[data-table-row]");if(!r||!this.contains(r))return;let s=r.getAttribute("data-table-row")??"";if(!e.detail.checked){let d=new Set(this.selectedIds());d.delete(s),this.setSelectedIds([...d]);return}this.selectRow(r)}onSelectAllChange(e){this.selectionMode==="multiple"&&this.setSelectedIds(e.detail.checked?this.getSelectableRows().map(i=>i.getAttribute("data-table-row")??""):[])}onSortClick(e){let r=e.target.closest("[data-table-sort]")?.getAttribute("data-table-sort");r&&(this.sortDirection=r===this.sortColumn&&this.sortDirection==="ascending"?"descending":"ascending",this.sortColumn=r,this.syncSorting(),this.sortChangeEvent.emit({column:r,direction:this.sortDirection}))}static{cS()}};function wP({children:t,class:e,...i}){return pe("div",{...i,role:"rowgroup",class:j("rui-table__header",e),children:pe("div",{class:"rui-table__row",role:"row",children:t})})}function TP({children:t,class:e,...i}){return pe("div",{...i,role:"rowgroup",class:j("rui-table__body",e),children:t})}function SP({children:t,class:e,...i}){return pe("div",{...i,role:"rowgroup",class:j("rui-table__footer",e),children:pe("div",{class:"rui-table__row",role:"row",children:t})})}function EP({id:t,allowsSorting:e=!1,isRowHeader:i=!1,children:r,class:s,...d}){return pe("div",{...d,role:"columnheader","data-table-column":t,"data-table-row-header":i?"":void 0,class:j("rui-table__column",s),children:e?MS("button",{type:"button","data-table-sort":t,class:"rui-table__sort",children:[pe("span",{children:r}),pe("span",{class:"rui-table__sort-indicator","aria-hidden":"true"})]}):r})}function RP({id:t,disabled:e,actionable:i,children:r,class:s,...d}){return pe("div",{...d,role:"row","data-table-row":t,"data-table-actionable":i?"":void 0,"aria-disabled":e?"true":void 0,class:j("rui-table__row",s),children:r})}function AP({isRowHeader:t=!1,children:e,class:i,...r}){return pe("div",{...r,role:t?"rowheader":"gridcell","data-table-cell":!0,tabindex:-1,class:j("rui-table__cell",i),children:e})}function IP({scope:t,label:e,class:i,...r}){let s=t==="all";return pe("div",{...r,role:s?"columnheader":"gridcell","data-table-cell":!0,"data-table-selection-cell":t,class:j("rui-table__selection-cell",i),children:pe(Di,{"data-table-select-all":s?"":void 0,"data-table-select-row":s?void 0:"",children:pe("span",{class:"sr-only",children:e??(s?"Select all rows":"Select row")})})})}function CP({colSpan:t,children:e,class:i,...r}){let s=Math.max(1,Math.floor(t));return MS("div",{role:"row",class:"rui-table__row rui-table__row--empty",children:[pe("div",{...r,role:"gridcell","aria-colspan":s,class:j("rui-table__empty-state",i),children:pe("span",{class:"rui-table__empty-state-message",children:e})}),Array.from({length:s-1},(d,h)=>pe("div",{"aria-hidden":"true",class:"rui-table__empty-state-spacer"},h))]})}function DP({children:t,label:e,ariaBusy:i,selectionMode:r,value:s,...d}){return pe("rui-table",{...d,value:s,label:e,ariaBusy:i,selectionMode:r,children:pe("div",{class:"rui-table",role:"grid","aria-label":e||void 0,"aria-busy":i==="true"?"true":void 0,"aria-multiselectable":r==="multiple"?"true":void 0,children:t})})}import{RadiantElement as YS,customElement as LP,event as PP,onEvent as NS,onUpdated as jP,prop as ln}from"@ecopages/radiant";var LS,PS,jS,FS,BS,US,zS,qS,KS,$S,GS,WS;function OP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:HS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||HS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:VP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return MP(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function VP(t){var e=kP(t,"string");return typeof e=="symbol"?e:e+""}function kP(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function HS(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function MP(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var QS,XS=class extends YS{static{({e:[jS,FS,BS,US,zS,qS,KS,$S,GS,WS,LS],c:[QS,PS]}=OP(this,[LP("rui-tabs")],[[ln({type:String,reflect:!0,defaultValue:"boxed"}),0,"variant"],[ln({type:String,reflect:!0,defaultValue:""}),0,"value"],[ln({type:String,defaultValue:""}),0,"label"],[ln({type:Boolean,defaultValue:!0}),0,"automatic"],[PP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[jP(["value","label"]),2,"onPropsUpdated"],[NS({selector:'[role="tab"]',type:"click"}),2,"onTabClick"],[NS({selector:'[role="tab"]',type:"keydown"}),2,"onTabKeydown"]],0,void 0,YS))}variant=(LS(this),jS(this));value=(FS(this),BS(this));label=(US(this),zS(this));automatic=(qS(this),KS(this));changeEvent=($S(this),GS(this));childObserver=(WS(this),null);connectedCallback(){super.connectedCallback(),this.childObserver=new MutationObserver(()=>this.resync()),this.childObserver.observe(this,{childList:!0,subtree:!0})}onConnected(){this.resync()}disconnectedCallback(){this.childObserver?.disconnect(),this.childObserver=null,super.disconnectedCallback()}onPropsUpdated(){this.resync()}resync(){this.syncTablistLabel(),this.syncSelection(this.value||this.getTabValue(this.getTabs()[0])||"")}getTabs(){return Array.from(this.querySelectorAll('[role="tab"]'))}getPanels(){return Array.from(this.querySelectorAll('[role="tabpanel"]'))}getTabValue(e){return e?e.dataset.tabValue??e.id.replace(/^tab-/,""):""}syncTablistLabel(){let e=this.querySelector('[role="tablist"]');!e||e.hasAttribute("aria-label")||!this.label||e.setAttribute("aria-label",this.label)}syncSelection(e){let i=this.getTabs(),r=this.getPanels();if(!i.length)return;let s=i.find(h=>this.getTabValue(h)===e)??i.find(h=>h.id===e)??i[0],d=this.getTabValue(s);this.value=d;for(let h of i){let a=h===s;h.setAttribute("aria-selected",String(a)),h.tabIndex=a?0:-1}for(let h of r){let E=(h.dataset.tabValue??h.id.replace(/^panel-/,""))===d;h.hidden=!E,h.hasAttribute("tabindex")||(h.tabIndex=0)}}activateTab(e){!e||e.getAttribute("aria-disabled")==="true"||(this.syncSelection(this.getTabValue(e)),this.changeEvent.emit({value:this.value}))}onTabClick(e){let i=e.target.closest('[role="tab"]');!i||!this.contains(i)||this.activateTab(i)}onTabKeydown(e){let i=this.getTabs(),r=e.target.closest('[role="tab"]');if(!r||!i.includes(r))return;if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateTab(r);return}let s=de({items:i,current:r,key:e.key,orientation:"horizontal"});s.handled&&(e.preventDefault(),this.automatic&&this.activateTab(s.item))}static{PS()}};import{jsx as rr}from"@ecopages/jsx/jsx-runtime";function FP({children:t,class:e,...i}){return rr("div",{...i,class:j("rui-tabs__list",e),role:"tablist",children:t})}function BP({id:t,children:e,class:i,disabled:r,selected:s,...d}){return rr("button",{...d,type:"button",class:j("rui-tabs__tab",i),role:"tab",id:`tab-${t}`,"data-tab-value":t,"aria-controls":`panel-${t}`,"aria-selected":s?"true":"false",tabindex:s?0:-1,disabled:r,children:e})}function UP({children:t,class:e,...i}){return rr("div",{...i,class:j("rui-tabs__panels",e),children:t})}function zP({id:t,children:e,class:i,selected:r,hidden:s,...d}){return rr("div",{...d,class:j("rui-tabs__panel",i),role:"tabpanel",id:`panel-${t}`,"data-tab-value":t,"aria-labelledby":`tab-${t}`,tabindex:0,hidden:r===void 0?s:!r,children:e})}function qP({children:t,...e}){return rr("rui-tabs",{...e,children:t})}import{jsx as KP}from"@ecopages/jsx/jsx-runtime";function $P(t){let{class:e,rows:i=3,...r}=t;return KP("textarea",{...r,rows:i,[ot]:"","data-rui-control-type":"text",class:j("rui-textarea",e)})}import{jsx as ut,jsxs as SE}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as EE,bindTo as fa,bound as ma,customElement as ZP,onEvent as RE,onUpdated as ga,prop as Ne,query as ej}from"@ecopages/radiant";var nr="rui-toast-show",or="rui-toast-dismiss",GP=["top-start","top-center","top-end","bottom-start","bottom-center","bottom-end"],ar=4e3,WP=356,la=14,ua=24,ca=3,da=3,sr=45,ha=200,lr="bottom-end";function lt(t){let[e,i]=t.split("-");return{y:e,x:i}}var HP=1;function YP(){return HP++}function JS(t,e){return typeof t=="function"?t(e):t}var pa=class{subscribers=[];toasts=[];subscribe=e=>(this.subscribers.push(e),e(this.toasts),()=>{let i=this.subscribers.indexOf(e);i>=0&&this.subscribers.splice(i,1)});getSnapshot=()=>this.toasts;publish(){let e=this.toasts;for(let i of this.subscribers)i(e)}create=(e,i={})=>{let r=i.id??YP(),s=i.dismissible??!0,d=this.toasts.findIndex(a=>a.id===r),h={id:r,title:e,description:i.description,variant:i.variant??"default",duration:i.duration,action:i.action,dismissible:s,closeButton:i.closeButton,position:i.position,delete:!1};return d>=0?this.toasts=this.toasts.map(a=>a.id===r?{...a,...h,delete:!1}:a):this.toasts=[h,...this.toasts],this.publish(),r};dismiss=e=>{if(e==null){if(this.toasts.length===0)return;this.toasts=this.toasts.map(i=>({...i,delete:!0}))}else{let i=this.toasts.find(r=>r.id===e);if(!i||i.delete)return;this.toasts=this.toasts.map(r=>r.id===e?{...r,delete:!0}:r)}this.publish()};remove=e=>{this.toasts=this.toasts.filter(i=>i.id!==e),this.publish()};clear=()=>{this.toasts.length!==0&&(this.toasts=[],this.publish())};message=(e,i)=>this.create(e,i);success=(e,i)=>this.create(e,{...i,variant:"success"});error=(e,i)=>this.create(e,{...i,variant:"error"});info=(e,i)=>this.create(e,{...i,variant:"info"});warning=(e,i)=>this.create(e,{...i,variant:"warning"});loading=(e,i)=>this.create(e,{...i,variant:"loading",duration:i?.duration??Number.POSITIVE_INFINITY});promise=(e,i)=>{let r=this.loading(i.loading,{duration:Number.POSITIVE_INFINITY,action:i.action,closeButton:i.closeButton,position:i.position,description:typeof i.description=="string"?i.description:void 0});return(typeof e=="function"?e():e).then(d=>{let h=typeof i.description=="function"?i.description(d):i.description;this.create(JS(i.success,d),{id:r,variant:"success",description:h,duration:i.duration,action:i.action,closeButton:i.closeButton,position:i.position})}).catch(d=>{let h=typeof i.description=="function"?i.description(d):i.description;this.create(JS(i.error,d),{id:r,variant:"error",description:h,duration:i.duration,action:i.action,closeButton:i.closeButton,position:i.position})}),r}},le=new pa;var ZS,eE,tE,iE,rE,nE,oE,aE,sE,lE,uE,cE,dE,hE,pE,fE,mE,gE,bE,vE,yE,_E,xE,wE;function NP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:TE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||TE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:XP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return JP(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function XP(t){var e=QP(t,"string");return typeof e=="symbol"?e:e+""}function QP(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function TE(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function JP(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var ur=new Map,cn=new Map;function ba(t){return String(t)}function un(t){if(t==="")return;let e=ba(t);ur.delete(e),cn.delete(e)}function tj(t){if(t==="")return;let e=ba(t),i=ur.get(e);i!=null&&(cn.set(e,Math.max(0,i-Date.now())),ur.delete(e))}var IE,AE=class extends EE{static{({e:[tE,iE,rE,nE,oE,aE,sE,lE,uE,cE,dE,hE,pE,fE,mE,gE,bE,vE,yE,_E,xE,wE,ZS],c:[IE,eE]}=NP(this,[ZP("rui-toast")],[[Ne({type:String,reflect:!0,defaultValue:""}),0,"toastId"],[Ne({type:String,defaultValue:""}),0,"title"],[Ne({type:String,defaultValue:""}),0,"description"],[[Ne({type:String,reflect:!0,defaultValue:"default"}),fa({attr:"data-variant",map:e=>e??"default"})],0,"variant"],[Ne({type:Number,defaultValue:4e3}),0,"duration"],[[Ne({type:Boolean,defaultValue:!0}),fa({attr:"data-dismissible"})],0,"dismissible"],[Ne({type:Boolean,defaultValue:!1}),0,"closeButton"],[Ne({type:String,defaultValue:""}),0,"actionLabel"],[[Ne({type:String,defaultValue:lr}),fa([{attr:"data-y-position",map:e=>lt(e).y},{attr:"data-x-position",map:e=>lt(e).x}])],0,"position"],[Ne({type:Boolean,defaultValue:!1}),0,"markedDelete"],[ej({ref:"toast"}),0,"toastTarget"],[ga("position"),2,"onPositionUpdated"],[ga("duration"),2,"onDurationUpdated"],[ga("markedDelete"),2,"onMarkedDeleteUpdated"],[ma,2,"onPointerDown"],[ma,2,"onPointerMove"],[ma,2,"onPointerUp"],[RE({selector:"[data-toast-close]",type:"click"}),2,"onCloseClick"],[RE({selector:"[data-toast-action]",type:"click"}),2,"onActionClick"]],0,void 0,EE))}toastId=(ZS(this),tE(this));title=(iE(this),rE(this));description=(nE(this),oE(this));variant=(aE(this),sE(this));duration=(lE(this),uE(this));dismissible=(cE(this),dE(this));closeButton=(hE(this),pE(this));actionLabel=(fE(this),mE(this));position=(gE(this),bE(this));markedDelete=(vE(this),yE(this));toastTarget=(_E(this),xE(this));mounted=(wE(this),!1);removed=!1;swiping=!1;swipeOut=!1;swipeAxis=null;swipeOutDirection=null;held=!1;timerReady=!1;timeoutId=null;pointerStart=null;dragStartTime=null;exitTimer=null;connectedCallback(){super.connectedCallback();let e=this.mounted;if(this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointermove",this.onPointerMove),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointercancel",this.onPointerUp),e){this.timerReady=!0,this.syncDomState(),this.dispatchEvent(new CustomEvent("rui-toast-mounted",{bubbles:!0})),!this.held&&!this.removed&&this.startTimer();return}this.timerReady=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.isConnected&&(this.mounted=!0,this.timerReady=!0,this.syncDomState(),this.dispatchEvent(new CustomEvent("rui-toast-mounted",{bubbles:!0})),!this.held&&!this.removed&&this.startTimer())})}),this.syncDomState()}disconnectedCallback(){this.clearTimer(),this.exitTimer&&(clearTimeout(this.exitTimer),this.exitTimer=null);let e=this.resolvedId;e!==""&&this.removed&&le.remove(e),this.held=!1,this.timerReady=!1,this.removeEventListener("pointerdown",this.onPointerDown),this.removeEventListener("pointermove",this.onPointerMove),this.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointercancel",this.onPointerUp),super.disconnectedCallback()}onPositionUpdated(){this.syncDomState()}setPaused(e){if(this.held===e){!e&&this.timerReady&&this.mounted&&!this.removed&&!this.timeoutId&&this.startTimer();return}this.held=e,!(!this.timerReady||!this.mounted||this.removed)&&(e||document.hidden?(tj(this.resolvedId),this.clearTimer()):this.startTimer())}onDurationUpdated(){!this.timerReady||!this.mounted||this.removed||this.held||(un(this.resolvedId),this.startTimer())}onMarkedDeleteUpdated(){this.markedDelete&&!this.removed&&this.beginRemove()}get resolvedId(){let e=this.toastId;if(e==null||e==="")return"";let i=Number(e);return Number.isFinite(i)&&String(i)===e?i:e}clearTimer(){this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=null}startTimer(){if(this.held||this.removed||document.hidden||this.duration===Number.POSITIVE_INFINITY||this.variant==="loading")return;if(this.duration<=0){this.beginRemove();return}let e=this.resolvedId,i=ba(e),r=Date.now(),s=cn.get(i);if(cn.delete(i),s==null){let d=ur.get(i);s=d!=null?d-r:this.duration}if(s<=0){un(e),this.beginRemove();return}ur.set(i,r+s),this.clearTimer(),this.timeoutId=setTimeout(()=>{un(e),this.beginRemove()},s)}beginRemove(){this.removed||(this.removed=!0,this.clearTimer(),un(this.resolvedId),this.syncDomState(),this.markedDelete||le.dismiss(this.resolvedId),this.exitTimer=setTimeout(()=>{this.exitTimer=null,le.remove(this.resolvedId)},200))}onPointerDown(e){!this.dismissible||this.variant==="loading"||e.button!==0||e.target?.closest("[data-toast-close], [data-toast-action], button, a")||(this.dragStartTime=Date.now(),this.pointerStart={x:e.clientX,y:e.clientY},this.swipeAxis=null,this.setPointerCapture(e.pointerId))}onPointerMove(e){if(!this.pointerStart)return;let i={x:e.clientX-this.pointerStart.x,y:e.clientY-this.pointerStart.y};if(!this.startSwipe(i))return;this.swipeAxis??=Math.abs(i.x)>Math.abs(i.y)?"x":"y";let r=this.swipeAxis==="x"?{x:i.x,y:0}:{x:0,y:i.y};this.isSwipeReversing(r)?this.resetSwipeTranslation():this.setSwipeTranslation(r)}startSwipe(e){return this.swiping?!0:Math.abs(e.x)<8&&Math.abs(e.y)<8?!1:(this.swiping=!0,this.syncDomState(),!0)}isSwipeReversing(e){let{x:i,y:r}=lt(this.position);return this.swipeAxis==="y"?(r==="bottom"?e.y<0:e.y>0)&&Math.abs(e.y)<45:i!=="center"&&(i==="start"?e.x>0:e.x<0)&&Math.abs(e.x)<45}setSwipeTranslation(e){this.style.setProperty("--rui-toast-swipe-x",`${e.x}px`),this.style.setProperty("--rui-toast-swipe-y",`${e.y}px`)}resetSwipeTranslation(){this.setSwipeTranslation({x:0,y:0})}onPointerUp(e){if(!this.pointerStart)return;this.releaseToastPointer(e.pointerId);let i=this.readSwipe();this.swiping=!1,i&&this.dismissible&&this.shouldDismissSwipe(i)?this.dismissFromSwipe(i):this.cancelSwipe(),this.clearPointerState()}releaseToastPointer(e){try{this.releasePointerCapture(e)}catch{}}readSwipe(){if(this.swiping)return{x:Number.parseFloat(this.style.getPropertyValue("--rui-toast-swipe-x")||"0"),y:Number.parseFloat(this.style.getPropertyValue("--rui-toast-swipe-y")||"0")}}shouldDismissSwipe(e){let i=this.swipeAxis==="x"?e.x:e.y,r=this.dragStartTime?Date.now()-this.dragStartTime:0;return Math.abs(i)>=45||Math.abs(i)/Math.max(r,1)>.11}dismissFromSwipe(e){let{x:i,y:r}=lt(this.position);this.swipeOutDirection=this.swipeAxis==="y"?r==="bottom"?"down":"up":i==="start"?"left":i==="end"?"right":e.x<0?"left":"right",this.swipeOut=!0,this.syncDomState(),this.beginRemove()}cancelSwipe(){this.resetSwipeTranslation(),this.swipeAxis=null,this.syncDomState()}clearPointerState(){this.pointerStart=null,this.dragStartTime=null}onCloseClick(e){e.stopPropagation(),this.dismissible&&this.beginRemove()}onActionClick(e){e.stopPropagation(),le.getSnapshot().find(r=>r.id===this.resolvedId)?.action?.onClick(e),this.dismissible&&this.beginRemove()}syncDomState(){this.setAttribute("role","listitem"),this.dataset.mounted=String(this.mounted),this.dataset.removed=String(this.removed),this.dataset.swiping=String(this.swiping),this.dataset.swipeOut=String(this.swipeOut),this.swipeOutDirection?this.dataset.swipeDirection=this.swipeOutDirection:delete this.dataset.swipeDirection}iconForVariant(){switch(this.variant){case"success":return ut(wi,{});case"error":return ut(Re,{});case"warning":return"!";case"info":return"i";default:return""}}render(){let e=this.variant??"default",i=this.iconForVariant(),r=e!=="default";return SE("div",{ref:"toast",class:`rui-toast rui-toast--${e}`,role:"status","aria-live":"off","data-ref":"toast",children:[this.closeButton&&e!=="loading"?ut("button",{type:"button",class:"rui-toast__close","data-toast-close":!0,"aria-label":"Close toast",children:ut(Re,{})}):null,r?ut("span",{class:"rui-toast__icon","data-icon":!0,"aria-hidden":"true",children:e==="loading"?ut("span",{class:"rui-toast__loader"}):i}):null,SE("div",{class:"rui-toast__content",children:[ut("div",{class:"rui-toast__title","data-title":!0,children:this.$.title}),this.description?ut("div",{class:"rui-toast__description","data-description":!0,children:this.$.description}):null]}),this.actionLabel?ut("button",{type:"button",class:"rui-toast__action rui-button rui-button--outline rui-button--sm","data-toast-action":!0,children:this.$.actionLabel}):null]})}static{eE()}};import{jsx as va}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as tR,bindTo as aj,bound as dn,customElement as sj,onEvent as ya,onUpdated as lj,prop as At,query as uj,state as cj}from"@ecopages/radiant";function CE(t,e,i){let r=0;for(let s=0;s<t;s+=1)r+=e[s]??0;return r+t*i}function DE(t,e){return t.length===0?0:t.reduce((r,s)=>r+s,0)+Math.max(0,t.length-1)*e}function OE(t,e,i){return e<=0?0:t+Math.max(0,e-1)*i}var VE,kE,ME,LE,PE,jE,FE,BE,UE,zE,qE,KE,$E,GE,WE,HE,YE,NE,XE,QE,JE,ZE;function ij(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:eR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||eR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:rj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return oj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function rj(t){var e=nj(t,"string");return typeof e=="symbol"?e:e+""}function nj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eR(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function oj(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}function iR(t,e){return t instanceof Node&&e.contains(t)}var nR,rR=class extends tR{static{({e:[ME,LE,PE,jE,FE,BE,UE,zE,qE,KE,$E,GE,WE,HE,YE,NE,XE,QE,JE,ZE,VE],c:[nR,kE]}=ij(this,[sj("rui-toaster")],[[[At({type:String,reflect:!0,defaultValue:lr}),aj([{attr:"data-y-position",map:e=>lt(e).y},{attr:"data-x-position",map:e=>lt(e).x}])],0,"position"],[At({type:Number,defaultValue:4e3}),0,"duration"],[At({type:Number,defaultValue:3}),0,"visibleToasts"],[At({type:Boolean,defaultValue:!1}),0,"closeButton"],[At({type:Boolean,defaultValue:!1}),0,"expand"],[At({type:Number,defaultValue:14}),0,"gap"],[At({type:Number,defaultValue:24}),0,"offset"],[At({type:String,reflect:!0,defaultValue:""}),0,"container"],[uj({ref:"list"}),0,"listTarget"],[cj,0,"toasts"],[lj(["position","duration","visibleToasts","closeButton","expand","gap","offset","container"]),2,"onConfigUpdated"],[ya({document:!0,type:nr}),2,"onDocumentShow"],[ya({document:!0,type:or}),2,"onDocumentDismiss"],[ya({selector:"rui-toast",type:"rui-toast-mounted"}),2,"onToastMounted"],[dn,2,"onPointerOver"],[dn,2,"onPointerOut"],[dn,2,"onPointerDown"],[dn,2,"onPointerUp"]],0,void 0,tR))}position=(VE(this),ME(this));duration=(LE(this),PE(this));visibleToasts=(jE(this),FE(this));closeButton=(BE(this),UE(this));expand=(zE(this),qE(this));gap=(KE(this),$E(this));offset=(GE(this),WE(this));container=(HE(this),YE(this));listTarget=(NE(this),XE(this));toasts=(QE(this),JE(this,[]));expanded=(ZE(this),!1);interacting=!1;unsubscribe=null;visibilityHandler=null;heights=new Map;observers=new Map;layoutFrame=null;measuring=!1;connectedCallback(){super.connectedCallback(),this.syncHostPosition(),this.syncContainer(),this.unsubscribe=le.subscribe(e=>{this.toasts=e,e.length===0&&this.resetLayoutState(),this.scheduleLayoutSync()}),this.visibilityHandler=()=>this.syncPauseState(),document.addEventListener("visibilitychange",this.visibilityHandler)}disconnectedCallback(){this.unsubscribe?.(),this.unsubscribe=null,this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null),document.removeEventListener("pointerup",this.onPointerUp),document.removeEventListener("pointercancel",this.onPointerUp),this.layoutFrame!=null&&cancelAnimationFrame(this.layoutFrame),this.resetLayoutState(),super.disconnectedCallback()}onConfigUpdated(){this.syncHostPosition(),this.syncContainer(),this.scheduleLayoutSync()}onDocumentShow(e){let i=e.detail;i?.title&&le.create(i.title,{id:i.id,description:i.description,variant:i.variant,duration:i.duration,action:i.action,dismissible:i.dismissible,closeButton:i.closeButton,position:i.position})}onDocumentDismiss(e){let i=e.detail;le.dismiss(i?.id)}onToastMounted(){this.scheduleLayoutSync()}filteredToasts(){let e=this.toasts.filter(s=>(s.position??this.position)===this.position),i=[],r=[];for(let s of e)s.delete?r.push(s):i.push(s);return[...i.slice(0,this.visibleToasts),...r]}syncHostPosition(){this.style.setProperty("--rui-toaster-gap",`${this.gap}px`),this.style.setProperty("--rui-toaster-offset",`${this.offset}px`)}syncContainer(){let e=this.container.trim();if(!e){this.removeAttribute("data-contained"),this.style.position="";return}let i=this.closest(e)??document.querySelector(e);if(!i){this.removeAttribute("data-contained"),this.style.position="";return}getComputedStyle(i).position==="static"&&(i.style.position="relative"),i.contains(this)||i.appendChild(this),this.dataset.contained="true",this.style.position="absolute"}isStackExpanded(){return this.expanded||this.expand}isPaused(){return this.expanded||this.interacting||document.hidden}resetLayoutState(){for(let i of this.observers.values())i.disconnect();this.observers.clear(),this.heights.clear(),this.expanded=!1,this.interacting=!1;let e=this.listTarget;e&&(e.style.height="0px",e.dataset.expanded="false"),this.dataset.expanded="false"}syncPauseState(){let e=this.isPaused();for(let i of this.querySelectorAll("rui-toast"))i.setPaused(e);this.patchStackLayout()}scheduleLayoutSync(){this.layoutFrame!=null&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame(()=>{if(this.layoutFrame=null,this.toasts.length>0&&!this.interacting){let i=!!(this.listTarget?.matches(":hover")||this.matches(":hover"));this.expanded=i}this.observeToasts(),this.syncPauseState()})}measureToast(e){this.measuring=!0;let i=e.style.height,r=e.style.overflow;e.style.height="auto",e.style.overflow="visible";let s=e.getRef("toast"),d=Math.round(s instanceof HTMLElement?s.offsetHeight:e.offsetHeight)||64;return e.style.height=i,e.style.overflow=r,this.measuring=!1,d}observeToasts(){let e=this.listTarget;if(!e)return;let i=[...e.querySelectorAll("rui-toast")],r=new Set;for(let s of i){let d=s.toastId;if(!d)continue;r.add(d);let h=s.getRef("toast")??s;if(!this.observers.has(d)){let a=new ResizeObserver(()=>{if(this.measuring)return;let E=this.measureToast(s);this.heights.get(d)!==E&&(this.heights.set(d,E),this.patchStackLayout())});a.observe(h),this.observers.set(d,a)}this.heights.set(d,this.measureToast(s))}for(let[s,d]of[...this.observers])r.has(s)||(d.disconnect(),this.observers.delete(s),this.heights.delete(s))}patchStackLayout(){let e=this.listTarget;if(!e)return;let i=this.isStackExpanded(),{y:r}=lt(this.position),s=r==="bottom"?-1:1,d=Math.min(3,Math.max(1,this.visibleToasts));this.dataset.expanded=String(i),e.dataset.expanded=String(i),this.style.setProperty("--rui-toaster-lift",String(s)),e.style.setProperty("--rui-toaster-gap",`${this.gap}px`);let h=[...e.querySelectorAll("rui-toast")].filter(S=>S.dataset.mounted==="true"&&S.dataset.removed!=="true");if(h.length===0){e.style.height="0px";return}let a=h.map(S=>{let I=this.measureToast(S);return this.heights.set(S.toastId,I),I}),E=a[0]??64;this.style.setProperty("--rui-toaster-front-height",`${E}px`);for(let S=0;S<h.length;S+=1){let I=h[S];if(!I)continue;let T=a[S]??64,K=S===0,$=CE(S,a,this.gap),V=S<d;if(I.dataset.index=String(S),I.dataset.front=String(K),I.dataset.expanded=String(i),I.dataset.visible=String(i||V),I.style.setProperty("--rui-toast-z",String(h.length-S)),I.style.setProperty("--rui-toast-index",String(S)),I.style.setProperty("--rui-toast-offset",`${$}px`),I.style.setProperty("--rui-toast-initial-height",`${T}px`),I.style.setProperty("--rui-toaster-gap",`${this.gap}px`),i)I.style.setProperty("--rui-toast-y",`translateY(${s*$}px)`),I.style.height=`${T}px`,I.style.overflow="visible";else if(!V)I.style.setProperty("--rui-toast-y",`translateY(${s*(d-1)*this.gap}px) scale(0.7)`),I.style.height=`${E}px`,I.style.overflow="hidden";else if(K)I.style.setProperty("--rui-toast-y","translateY(0px)"),I.style.height=`${T}px`,I.style.overflow="visible";else{let G=Math.max(.7,1-S*.05);I.style.setProperty("--rui-toast-y",`translateY(${s*S*this.gap}px) scale(${G})`),I.style.height=`${E}px`,I.style.overflow="hidden"}}let A=Math.min(d,h.length);e.style.height=`${i?DE(a,this.gap):OE(E,A,this.gap)}px`}onPointerOver(e){iR(e.relatedTarget,this)||(this.expanded=!0,this.syncPauseState())}onPointerOut(e){iR(e.relatedTarget,this)||this.interacting||(this.expanded=!1,this.syncPauseState())}onPointerDown(){this.interacting=!0,this.expanded=!0,this.syncPauseState(),document.addEventListener("pointerup",this.onPointerUp,{once:!0}),document.addEventListener("pointercancel",this.onPointerUp,{once:!0})}onPointerUp(){if(!this.interacting)return;this.interacting=!1,this.listTarget?.matches(":hover")||this.querySelector("rui-toast:hover")||(this.expanded=!1),this.syncPauseState()}render(){let e=this.filteredToasts();return va("section",{class:"rui-toaster-region","aria-label":"Notifications","aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",tabIndex:-1,children:va("ol",{class:"rui-toaster","data-ref":"list","data-rui-toaster":!0,"on:pointerover":this.onPointerOver,"on:pointerout":this.onPointerOut,"on:pointerdown":this.onPointerDown,children:e.map(i=>{let r=i.duration??(i.variant==="loading"?Number.POSITIVE_INFINITY:this.duration);return va("rui-toast",{"prop:toastId":String(i.id),"prop:title":i.title,"prop:description":i.description??"","prop:variant":i.variant,"prop:duration":r,"prop:dismissible":i.dismissible,"prop:closeButton":i.closeButton??this.closeButton,"prop:actionLabel":i.action?.label??"","prop:position":i.position??this.position,"prop:markedDelete":!!i.delete},String(i.id))})})})}static{kE()}};import{jsx as oR}from"@ecopages/jsx/jsx-runtime";function dj({toastId:t,...e}){return oR("rui-toast",{...e,toastId:t!=null?String(t):void 0})}function hj({children:t,...e}){return oR("rui-toaster",{...e,children:t})}var pj=Object.assign((t,e)=>le.create(t,e),{message:(t,e)=>le.message(t,e),success:(t,e)=>le.success(t,e),error:(t,e)=>le.error(t,e),info:(t,e)=>le.info(t,e),warning:(t,e)=>le.warning(t,e),loading:(t,e)=>le.loading(t,e),promise:(t,e)=>le.promise(t,e),dismiss:t=>le.dismiss(t),clear:()=>le.clear()});function fj(t){document.dispatchEvent(new CustomEvent(nr,{detail:t,bubbles:!0,composed:!0}))}function mj(t){let e=t==null?{}:{id:t};document.dispatchEvent(new CustomEvent(or,{detail:e,bubbles:!0,composed:!0}))}import{jsx as hn,jsxs as xj}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as IR,bound as wj,customElement as Tj,onUpdated as Sj,prop as cr,state as CR}from"@ecopages/radiant";import{isServer as DR}from"@ecopages/radiant/is-server";function aR(t,e){try{return t.querySelector(e)}catch{return null}}function sR(t,e){try{return Array.from(t.querySelectorAll(e))}catch{return[]}}function gj(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}function lR(t,e,i=r=>document.getElementById(r)!==null){if(t.id)return e.add(t.id),t.id;let r=gj(t.textContent||"")||"section",s=r,d=2;for(;e.has(s)||i(s);)s=`${r}-${d}`,d+=1;return t.id=s,e.add(s),s}function uR(t,e){return t instanceof HTMLElement?t.getBoundingClientRect().top+e:e}function cR(t,e,i,r){if(e instanceof HTMLElement){let s=e.getBoundingClientRect(),d=t.getBoundingClientRect();e.scrollTo({top:e.scrollTop+(d.top-s.top)-i,behavior:r});return}window.scrollTo({top:window.scrollY+t.getBoundingClientRect().top-i,behavior:r})}var dR,hR,pR,fR,mR,gR,bR,vR,yR,_R,xR,wR,TR,SR,ER,RR;function bj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:AR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||AR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:vj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _j(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function vj(t){var e=yj(t,"string");return typeof e=="symbol"?e:e+""}function yj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AR(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function _j(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var VR,OR=class extends IR{static{({e:[pR,fR,mR,gR,bR,vR,yR,_R,xR,wR,TR,SR,ER,RR,dR],c:[VR,hR]}=bj(this,[Tj("rui-toc")],[[cr({type:String,attribute:"target",defaultValue:""}),0,"target"],[cr({type:String,attribute:"heading-selector",defaultValue:"h2,h3"}),0,"headingSelector"],[cr({type:String,defaultValue:"On this page"}),0,"label"],[cr({type:Number,attribute:"scroll-offset",defaultValue:120}),0,"scrollOffset"],[cr({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[CR,0,"entries"],[CR,0,"activeId"],[Sj(["target","headingSelector","scrollOffset","navigationEvents"]),2,"onScanSettingsUpdated"],[wj,2,"onLinkClick"]],0,void 0,IR))}target=(dR(this),pR(this,""));headingSelector=(fR(this),mR(this,"h2,h3"));label=(gR(this),bR(this,"On this page"));scrollOffset=(vR(this),yR(this,120));navigationEvents=(_R(this),xR(this,""));entries=(wR(this),TR(this,[]));activeId=(SR(this),ER(this,null));headings=(RR(this),[]);scrollRoot=null;scrollCleanup=null;navigationCleanups=[];pendingScrollTargetId=null;scrollRafPending=!1;scrollOffsetTolerance=4;readConfiguredProp(e,i){return e.trim()||this.getAttribute(i)?.trim()||""}readConfiguredNumber(e,i,r){if(Number.isFinite(e)&&e!==0)return e;let s=Number(this.getAttribute(i));return Number.isFinite(s)?s:r}connectedCallback(){super.connectedCallback(),this.attachNavigationListeners()}onConnected(){this.rebuild()}disconnectedCallback(){this.detachScrollListener(),this.detachNavigationListeners(),super.disconnectedCallback()}onScanSettingsUpdated(){this.detachNavigationListeners(),this.attachNavigationListeners(),this.rebuild()}rebuild(){this.detachScrollListener(),this.headings=[],this.entries=[],this.activeId=null,this.pendingScrollTargetId=null,this.scrollRoot=null;let e=this.resolveTarget();if(!e)return;let i=sR(e,this.readConfiguredProp(this.headingSelector,"heading-selector")||"h2,h3");if(i.length===0)return;let r=new Set,s=i.map(d=>({id:lR(d,r),label:(d.textContent||"").trim(),depth:this.headingDepth(d)}));this.headings=i,this.entries=s,this.scrollRoot=this.resolveScrollRoot(e),this.attachScrollListener(),this.updateActiveHeading()}resolveTarget(){let e=this.readConfiguredProp(this.target,"target");return e?aR(document,e):this.parentElement}resolvedScrollOffset(){return this.readConfiguredNumber(this.scrollOffset,"scroll-offset",120)}resolveScrollRoot(e){let i=e;for(;i&&i!==document.documentElement&&i!==document.body;){let r=getComputedStyle(i).overflowY;if(r==="auto"||r==="scroll"||r==="overlay")return i;i=i.parentElement}return window}headingDepth(e){let i=Number.parseInt(e.tagName.slice(1),10);return Number.isFinite(i)?i:2}attachNavigationListeners(){if(DR||!this.isConnected)return;let e=()=>this.rebuild();for(let i of nn(this.readConfiguredProp(this.navigationEvents,"navigation-events")))document.addEventListener(i,e),this.navigationCleanups.push(()=>document.removeEventListener(i,e))}detachNavigationListeners(){for(let e of this.navigationCleanups)e();this.navigationCleanups=[]}attachScrollListener(){if(DR||!this.isConnected)return;let e=()=>{this.scrollRafPending||(this.scrollRafPending=!0,requestAnimationFrame(()=>{this.updateActiveHeading(),this.scrollRafPending=!1}))},i=this.scrollRoot??window;if(i===window){window.addEventListener("scroll",e,{passive:!0}),this.scrollCleanup=()=>window.removeEventListener("scroll",e);return}i.addEventListener("scroll",e,{passive:!0}),this.scrollCleanup=()=>i.removeEventListener("scroll",e)}detachScrollListener(){this.scrollCleanup?.(),this.scrollCleanup=null}isScrollAtBottom(){let e=this.scrollRoot??window;if(!(e instanceof HTMLElement)){let i=document.documentElement.scrollHeight,r=window.innerHeight;return i<=r+1?!1:window.scrollY+r>=i-10}return e.scrollHeight<=e.clientHeight+1?!1:e.scrollTop+e.clientHeight>=e.scrollHeight-10}activeLineY(){return uR(this.scrollRoot??window,this.resolvedScrollOffset()+this.scrollOffsetTolerance)}updateActiveHeading(){if(this.headings.length===0)return;if(this.isScrollAtBottom()){this.pendingScrollTargetId=null;let r=this.headings[this.headings.length-1]?.id;r&&this.setActiveId(r);return}if(this.pendingScrollTargetId){let r=this.findHeadingById(this.pendingScrollTargetId);if(!r)this.pendingScrollTargetId=null;else if(this.hasPendingScrollReachedTarget(r))this.pendingScrollTargetId=null;else{this.setActiveId(this.pendingScrollTargetId);return}}let e=this.activeLineY(),i=null;for(let r of this.headings)if(r.getBoundingClientRect().top<=e)i=r.id;else break;this.setActiveId(i??this.headings[0].id)}setActiveId(e){this.activeId!==e&&(this.activeId=e)}findHeadingById(e){return this.headings.find(i=>i.id===e)??null}hasPendingScrollReachedTarget(e){return e.getBoundingClientRect().top<=this.activeLineY()}onLinkClick(e,i){let r=e;if(r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.button!==0)return;let s=this.findHeadingById(i);s&&(e.preventDefault(),this.pendingScrollTargetId=i,this.setActiveId(i),this.scrollToHeading(i,s))}scrollToHeading(e,i){let r=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth";window.history.replaceState(window.history.state,"",`${window.location.pathname}${window.location.search}#${e}`),cR(i,this.scrollRoot??window,this.resolvedScrollOffset(),r)}render(){return this.entries.length===0?null:xj("nav",{class:"rui-toc","aria-label":this.$.label,children:[this.label?hn("p",{class:"rui-toc__label",children:this.$.label}):null,hn("ul",{class:"rui-toc__list",children:this.entries.map(e=>hn("li",{class:e.depth>=3?"rui-toc__item rui-toc__item--depth-3":"rui-toc__item",children:hn("a",{href:`#${e.id}`,class:e.id===this.activeId?"rui-toc__link rui-toc__link--active":"rui-toc__link","on:click":i=>this.onLinkClick(i,e.id),children:e.label})}))})]})}static{hR()}};import{jsx as Ej}from"@ecopages/jsx/jsx-runtime";function Rj(t){return Ej("rui-toc",{...t})}import{RadiantElement as UR,customElement as Oj,onEvent as zR,prop as qR}from"@ecopages/radiant";var kR,MR,LR,PR,jR,FR;function Aj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:BR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||BR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Ij(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Dj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Ij(t){var e=Cj(t,"string");return typeof e=="symbol"?e:e+""}function Cj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function BR(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Dj(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var $R,KR=class extends UR{static{({e:[LR,PR,jR,FR,kR],c:[$R,MR]}=Aj(this,[Oj("rui-toolbar")],[[qR({type:String,defaultValue:""}),0,"label"],[qR({type:Boolean,reflect:!0,defaultValue:!1}),0,"exclusiveToggles"],[zR({type:"keydown",selector:"button, a[href], input, select, [tabindex]"}),2,"onKeydown"],[zR({type:"click",selector:"button[data-toggle][aria-pressed]",options:{capture:!0}}),2,"onToggleButtonClick"]],0,void 0,UR))}constructor(...e){super(...e),FR(this)}label=(kR(this),LR(this));exclusiveToggles=(PR(this),jR(this));getItems(){return kr(this)}onConnected(){ue(this.getItems(),0)}onKeydown(e){let i=this.getItems(),r=e.target.closest("button, a[href], input, select, [tabindex]");de({items:i,current:r,key:e.key,orientation:"horizontal"}).handled&&e.preventDefault()}getToggleButtons(){return Array.from(this.querySelectorAll("button[data-toggle][aria-pressed]")).filter(e=>!e.disabled)}onToggleButtonClick(e){let i=e.target.closest("button[data-toggle][aria-pressed]");if(!i||i.disabled)return;e.stopImmediatePropagation();let r=i.getAttribute("aria-pressed")==="true";if(this.exclusiveToggles){for(let s of this.getToggleButtons())s.setAttribute("aria-pressed","false");r||i.setAttribute("aria-pressed","true");return}i.setAttribute("aria-pressed",String(!r))}static{MR()}};import{jsx as GR}from"@ecopages/jsx/jsx-runtime";function Vj({children:t,label:e,...i}){return GR("rui-toolbar",{...i,label:e,children:GR("div",{class:"rui-toolbar","data-ref":"root",role:"toolbar","aria-label":e||void 0,children:t})})}import{jsx as _a,jsxs as jj}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as rA,bound as nA,customElement as Fj,onEvent as xa,onUpdated as Bj,prop as wa,query as Uj}from"@ecopages/radiant";var WR,HR,YR,NR,XR,QR,JR,ZR,eA,tA;function kj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:iA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||iA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Mj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Pj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Mj(t){var e=Lj(t,"string");return typeof e=="symbol"?e:e+""}function Lj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iA(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Pj(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var oA=8,sA,aA=class extends rA{static{({e:[YR,NR,XR,QR,JR,ZR,eA,tA,WR],c:[sA,HR]}=kj(this,[Fj("rui-tooltip")],[[wa({type:String,defaultValue:""}),0,"content"],[wa({type:String,defaultValue:"top"}),0,"placement"],[wa({type:Number,defaultValue:200}),0,"delay"],[Uj({ref:"tooltip"}),0,"tooltipTarget"],[Bj(["content","placement"]),2,"onDescribedPropsUpdated"],[xa({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[xa({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[xa({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[nA,2,"onPointerEnter"],[nA,2,"onPointerLeave"]],0,void 0,rA))}content=(WR(this),YR(this));placement=(NR(this),XR(this));delay=(QR(this),JR(this));tooltipTarget=(ZR(this),eA(this));open=(tA(this),!1);showTimer=null;hideTimer=null;tooltipId=re("rui-tooltip");describedEl=null;cleanupFloating=null;connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.onPointerEnter),this.addEventListener("pointerleave",this.onPointerLeave),queueMicrotask(()=>this.wireTrigger())}disconnectedCallback(){this.clearTimers(),this.teardownFloating(),this.removeEventListener("pointerenter",this.onPointerEnter),this.removeEventListener("pointerleave",this.onPointerLeave),this.describedEl?.removeAttribute("aria-describedby"),super.disconnectedCallback()}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.showTimer=null,this.hideTimer=null}teardownFloating(){this.cleanupFloating?.(),this.cleanupFloating=null}getAnchor(){return si(this)??this}wireTrigger(){this.describedEl?.removeAttribute("aria-describedby"),this.describedEl=this.getAnchor(),this.tooltipTarget&&(this.tooltipTarget.id=this.tooltipId),this.describedEl.setAttribute("aria-describedby",this.tooltipId)}attachFloating(){this.tooltipTarget&&(this.teardownFloating(),this.cleanupFloating=Ir({anchor:this.getAnchor(),floating:this.tooltipTarget,getPlacement:()=>this.placement,gap:oA}))}onDescribedPropsUpdated(){this.wireTrigger(),this.open&&this.tooltipTarget&&Qn(this.getAnchor(),this.tooltipTarget,this.placement,oA)}setOpen(e){this.clearTimers(),this.open=e,this.tooltipTarget&&(this.tooltipTarget.hidden=!e,e?this.attachFloating():this.teardownFloating())}scheduleShow(){if(this.clearTimers(),this.delay<=0){this.setOpen(!0);return}this.showTimer=setTimeout(()=>this.setOpen(!0),this.delay)}scheduleHide(){this.clearTimers(),this.hideTimer=setTimeout(()=>this.setOpen(!1),80)}onDocumentKeydown(e){!this.open||e.key!=="Escape"||this.setOpen(!1)}onFocusIn(){this.scheduleShow()}onFocusOut(e){let i=e.relatedTarget;i&&this.contains(i)||this.scheduleHide()}onPointerEnter(){this.scheduleShow()}onPointerLeave(){this.scheduleHide()}render(){return jj("span",{class:"rui-tooltip",children:[_a("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:_a("slot",{})}),_a("span",{"data-ref":"tooltip",id:this.tooltipId,class:"rui-tooltip__content rui-floating",role:"tooltip",hidden:!0,children:this.$.content})]})}static{HR()}};import{jsx as Ta,jsxs as zj}from"@ecopages/jsx/jsx-runtime";function qj({children:t,content:e="",...i}){return Ta("rui-tooltip",{content:e,...i,children:zj("span",{class:"rui-tooltip",children:[Ta("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:t}),Ta("span",{class:"rui-tooltip__content rui-floating","data-ref":"tooltip",role:"tooltip",hidden:!0,children:e})]})})}import{RadiantElement as bA,customElement as Hj,event as Yj,onEvent as vA,onUpdated as Nj,prop as yA}from"@ecopages/radiant";var lA,uA,cA,dA,hA,pA,fA,mA;function Kj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:gA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||gA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:$j(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Wj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function $j(t){var e=Gj(t,"string");return typeof e=="symbol"?e:e+""}function Gj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gA(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Wj(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var xA,_A=class extends bA{static{({e:[cA,dA,hA,pA,fA,mA,lA],c:[xA,uA]}=Kj(this,[Hj("rui-tree")],[[yA({type:String,defaultValue:""}),0,"label"],[yA({type:String,reflect:!0,defaultValue:""}),0,"value"],[Yj({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Nj("value"),2,"onValueUpdated"],[vA({selector:'[role="treeitem"]',type:"click"}),2,"onClick"],[vA({selector:'[role="treeitem"]',type:"keydown"}),2,"onKeydown"]],0,void 0,bA))}label=(lA(this),cA(this));value=(dA(this),hA(this));changeEvent=(pA(this),fA(this));getVisibleItems(){return Array.from(this.querySelectorAll('[role="treeitem"]')).filter(e=>{let i=e.parentElement;for(;i&&i!==this;){if(i.getAttribute("role")==="group"&&i.hidden)return!1;i=i.parentElement}return!0})}getParentItem(e){let i=e.closest('[role="group"]');if(!i)return null;let r=i.previousElementSibling;return r?.getAttribute("role")==="treeitem"?r:null}getSiblingItems(e){let i=this.getParentItem(e),r=i?i.nextElementSibling?.getAttribute("role")==="group"?i.nextElementSibling:null:this.querySelector('[role="tree"]')??this;return r?Array.from(r.querySelectorAll(':scope > li > [role="treeitem"], :scope > [role="treeitem"]')):[]}syncSelection(){let e=Array.from(this.querySelectorAll('[role="treeitem"]')),i=this.getVisibleItems(),r=0;e.forEach((s,d)=>{let h=s.getAttribute("data-value")||s.id||"",a=!!this.value&&h===this.value;if(s.setAttribute("aria-selected",String(a)),a){let E=i.indexOf(s);E>=0&&(r=E)}else!this.value&&d===0&&(r=0)}),ue(i,r)}syncExpanded(){let e=Array.from(this.querySelectorAll('[role="treeitem"]'));for(let i of e){if(!i.hasAttribute("aria-expanded"))continue;let r=i.nextElementSibling;r?.getAttribute("role")==="group"&&(r.hidden=i.getAttribute("aria-expanded")==="false")}}onConnected(){this.syncExpanded(),this.syncSelection()}onValueUpdated(){this.syncSelection()}select(e){let i=e.getAttribute("data-value")||e.id||e.textContent?.trim()||"";this.value=i,this.syncSelection(),this.changeEvent.emit({value:i}),e.focus()}setExpanded(e,i){e.setAttribute("aria-expanded",String(i));let r=e.nextElementSibling;r?.getAttribute("role")==="group"&&(r.hidden=!i),this.syncSelection()}onClick(e){let i=e.target.closest('[role="treeitem"]');!i||!this.contains(i)||(i.hasAttribute("aria-expanded")&&this.setExpanded(i,i.getAttribute("aria-expanded")!=="true"),this.select(i))}onKeydown(e){let i=e.target.closest('[role="treeitem"]');!i||!this.treeKeyHandlers[e.key]?.call(this,i,e)||e.preventDefault()}treeKeyHandlers=(mA(this),{ArrowDown:this.navigateTreeItem,ArrowUp:this.navigateTreeItem,Home:this.navigateTreeItem,End:this.navigateTreeItem,ArrowRight:this.expandOrEnterChild,ArrowLeft:this.collapseOrFocusParent,"*":this.expandSiblings,Enter:this.toggleAndSelect," ":this.selectTreeItem});navigateTreeItem(e,i){return de({items:this.getVisibleItems(),current:e,key:i.key,orientation:"vertical",wrap:!1}).handled}expandOrEnterChild(e){return e.getAttribute("aria-expanded")==="false"?(this.setExpanded(e,!0),!0):e.getAttribute("aria-expanded")!=="true"?!1:(this.focusAdjacentVisibleItem(e,1),!0)}collapseOrFocusParent(e){if(e.getAttribute("aria-expanded")==="true")return this.setExpanded(e,!1),!0;let i=this.getParentItem(e);return i&&this.focusVisibleItem(i),!!i}expandSiblings(e){for(let i of this.getSiblingItems(e))i.hasAttribute("aria-expanded")&&this.setExpanded(i,!0);return!0}toggleAndSelect(e){return e.hasAttribute("aria-expanded")&&this.setExpanded(e,e.getAttribute("aria-expanded")!=="true"),this.select(e),!0}selectTreeItem(e){return this.select(e),!0}focusAdjacentVisibleItem(e,i){let r=this.getVisibleItems(),s=r.indexOf(e);r[s+i]&&ei(r,s+i)}focusVisibleItem(e){let i=this.getVisibleItems(),r=i.indexOf(e);r>=0&&ei(i,r)}static{uA()}};import{Fragment as wA,jsx as ct,jsxs as Xj}from"@ecopages/jsx/jsx-runtime";var TA=({nodes:t})=>ct(wA,{children:t.map(e=>ct("li",{class:"rui-tree__item",children:e.children?.length?Xj(wA,{children:[ct("button",{type:"button",class:"rui-tree__node",role:"treeitem","data-value":e.id,"aria-expanded":e.expanded??!1,"aria-selected":"false",tabindex:-1,children:e.label}),ct("ul",{role:"group",children:ct(TA,{nodes:e.children})})]}):ct("button",{type:"button",class:"rui-tree__node",role:"treeitem","data-value":e.id,"aria-selected":"false",tabindex:-1,children:e.label})}))});function Qj({nodes:t,label:e,children:i,...r}){let s=t!=null?ct(TA,{nodes:t}):i;return ct("rui-tree",{...r,label:e,children:ct("ul",{class:"rui-tree","data-ref":"root",role:"tree","aria-label":e||void 0,"aria-multiselectable":"false",children:s})})}import{RadiantElement as kA,customElement as i2,event as r2,onEvent as MA,onUpdated as n2,prop as LA}from"@ecopages/radiant";var SA,EA,RA,AA,IA,CA,DA,OA;function Jj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:VA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||VA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Zj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return t2(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Zj(t){var e=e2(t,"string");return typeof e=="symbol"?e:e+""}function e2(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function VA(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function t2(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var jA,PA=class extends kA{static{({e:[RA,AA,IA,CA,DA,OA,SA],c:[jA,EA]}=Jj(this,[i2("rui-treegrid")],[[LA({type:String,defaultValue:""}),0,"label"],[LA({type:String,reflect:!0,defaultValue:""}),0,"value"],[r2({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[n2("value"),2,"onValueUpdated"],[MA({selector:'[role="gridcell"]',type:"click"}),2,"onCellClick"],[MA({selector:'[role="gridcell"]',type:"keydown"}),2,"onCellKeydown"]],0,void 0,kA))}label=(SA(this),RA(this));value=(AA(this),IA(this));changeEvent=(CA(this),DA(this));getDataRows(){return Array.from(this.querySelectorAll('[role="row"][data-row-id]'))}getVisibleRows(){return this.getDataRows().filter(e=>{let i=e.parentElement;for(;i&&i!==this;){if(i.getAttribute("role")==="rowgroup"&&i.hidden)return!1;i=i.parentElement}return!0})}getRowCells(e){return Array.from(e.children).filter(i=>i instanceof HTMLElement&&i.getAttribute("role")==="gridcell")}getVisibleCells(){return this.getVisibleRows().flatMap(e=>this.getRowCells(e))}getParentRow(e){let i=e.parentElement;if(!i||i.getAttribute("role")!=="rowgroup")return null;let r=i.previousElementSibling;return r?.getAttribute("role")==="row"?r:null}syncExpanded(){for(let e of this.getDataRows()){if(!e.hasAttribute("aria-expanded"))continue;let i=e.nextElementSibling;i?.getAttribute("role")==="rowgroup"&&(i.hidden=e.getAttribute("aria-expanded")==="false")}}syncDepth(){for(let e of this.getDataRows()){let i=0,r=e.parentElement;for(;r&&r!==this;)r.getAttribute("role")==="rowgroup"&&(i+=1),r=r.parentElement;e.setAttribute("data-depth",String(i)),e.style.setProperty("--rui-treegrid-depth",String(i))}}syncSelection(){let e=this.getVisibleCells(),i=0;for(let r of this.getDataRows()){let s=r.getAttribute("data-row-id")??"",d=!!this.value&&s===this.value;for(let h of this.getRowCells(r))if(h.setAttribute("aria-selected",String(d)),d){let a=e.indexOf(h);a>=0&&(i=a)}}e.length>0&&ue(e,i)}onConnected(){this.syncDepth(),this.syncExpanded(),this.syncSelection()}onValueUpdated(){this.syncSelection()}setExpanded(e,i){e.setAttribute("aria-expanded",String(i));let r=e.nextElementSibling;r?.getAttribute("role")==="rowgroup"&&(r.hidden=!i)}activateCell(e){let i=e.closest('[role="row"][data-row-id]');if(!i)return;let r=i.getAttribute("data-row-id")??"",s=this.getRowCells(i).indexOf(e);this.value=r,this.syncSelection(),this.changeEvent.emit({rowId:r,columnIndex:s}),e.focus()}focusCell(e,i){if(this.getVisibleRows().indexOf(e)<0)return;let d=this.getVisibleCells(),h=this.getRowCells(e),a=h[Math.min(Math.max(0,i),h.length-1)],E=d.indexOf(a);E>=0&&ei(d,E)}onCellClick(e){let i=e.target.closest('[role="gridcell"]');if(!i||!this.contains(i))return;let r=i.closest('[role="row"][data-row-id]');r&&this.getRowCells(r).indexOf(i)===0&&r.hasAttribute("aria-expanded")&&this.setExpanded(r,r.getAttribute("aria-expanded")!=="true"),this.activateCell(i)}onCellKeydown(e){let i=e.target.closest('[role="gridcell"]'),r=i?.closest('[role="row"][data-row-id]');if(!i||!r)return;let s=this.createCellContext(i,r),d=this.cellKeyHandlers[e.key];d&&(e.preventDefault(),d.call(this,s))}cellKeyHandlers=(OA(this),{ArrowRight:this.moveRight,ArrowLeft:this.moveLeft,ArrowDown:this.moveDown,ArrowUp:this.moveUp,Home:this.focusFirstCell,End:this.focusLastCell,"*":this.expandAllRows,Enter:this.toggleOrActivateCell," ":this.activateContextCell});createCellContext(e,i){return{cell:e,columnIndex:this.getRowCells(i).indexOf(e),row:i,rowCells:this.getRowCells(i),visibleRows:this.getVisibleRows()}}moveRight(e){this.setExpandedFromFirstCell(e,!0)||e.columnIndex<e.rowCells.length-1&&this.focusCell(e.row,e.columnIndex+1)}moveLeft(e){if(this.setExpandedFromFirstCell(e,!1))return;if(e.columnIndex>0){this.focusCell(e.row,e.columnIndex-1);return}let i=this.getParentRow(e.row);i&&this.focusCell(i,0)}moveDown(e){this.focusAdjacentRow(e,1)}moveUp(e){this.focusAdjacentRow(e,-1)}focusAdjacentRow(e,i){let r=e.visibleRows.indexOf(e.row),s=e.visibleRows[r+i];s&&this.focusCell(s,e.columnIndex)}focusFirstCell(e){this.focusCell(e.row,0)}focusLastCell(e){this.focusCell(e.row,e.rowCells.length-1)}expandAllRows(){for(let e of this.getDataRows())e.hasAttribute("aria-expanded")&&this.setExpanded(e,!0);this.syncSelection()}toggleOrActivateCell(e){this.toggleExpansionFromFirstCell(e)||this.activateCell(e.cell)}activateContextCell(e){this.activateCell(e.cell)}setExpandedFromFirstCell(e,i){let r=e.row.getAttribute("aria-expanded")==="true";return e.columnIndex!==0||!e.row.hasAttribute("aria-expanded")||r===i?!1:(this.setExpanded(e.row,i),this.syncSelection(),!0)}toggleExpansionFromFirstCell(e){return e.columnIndex!==0||!e.row.hasAttribute("aria-expanded")?!1:(this.setExpanded(e.row,e.row.getAttribute("aria-expanded")!=="true"),this.syncSelection(),!0)}static{EA()}};import{Fragment as o2,jsx as dt,jsxs as a2}from"@ecopages/jsx/jsx-runtime";var FA=({rows:t,depth:e=0})=>t.flatMap(i=>{let r=[dt("div",{class:"rui-treegrid__row",role:"row","data-row-id":i.id,"data-depth":e,style:{"--rui-treegrid-depth":`${e}`},"aria-expanded":i.children?.length?i.expanded??!1:void 0,children:i.cells.map((s,d)=>dt("div",{class:"rui-treegrid__cell",role:"gridcell",tabindex:-1,"data-col":d,"aria-selected":"false",children:s}))},i.id)];return i.children?.length&&r.push(dt("div",{class:"rui-treegrid__group",role:"rowgroup",hidden:!(i.expanded??!1),children:dt(FA,{rows:i.children,depth:e+1})},`${i.id}-group`)),r});function s2({columns:t,rows:e,label:i,children:r,...s}){let d=t!=null&&e!=null?a2(o2,{children:[dt("div",{class:"rui-treegrid__row rui-treegrid__row--header",role:"row",children:t.map(h=>dt("div",{class:"rui-treegrid__cell rui-treegrid__cell--header",role:"columnheader",children:h}))}),dt(FA,{rows:e})]}):r;return dt("rui-treegrid",{...s,label:i,children:dt("div",{class:"rui-treegrid","data-ref":"root",role:"treegrid","aria-label":i||void 0,children:d})})}import{RadiantElement as eI,bindTo as Sa,bound as tI,customElement as h2,event as p2,onEvent as iI,onUpdated as f2,prop as Ea,query as rI}from"@ecopages/radiant";var BA,UA,zA,qA,KA,$A,GA,WA,HA,YA,NA,XA,QA,JA;function l2(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ZA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ZA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:u2(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return d2(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function u2(t){var e=c2(t,"string");return typeof e=="symbol"?e:e+""}function c2(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ZA(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function d2(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var It=20,Ct=80;function Ra(t){return t!=="vertical"}var oI,nI=class extends eI{static{({e:[zA,qA,KA,$A,GA,WA,HA,YA,NA,XA,QA,JA,BA],c:[oI,UA]}=l2(this,[h2("rui-window-splitter")],[[[Ea({type:Number,reflect:!0,defaultValue:50}),Sa({ref:"separator",attr:"aria-valuenow"})],0,"value"],[[Ea({type:String,defaultValue:"horizontal"}),Sa({ref:"separator",attr:"aria-orientation",map:e=>Ra(e)?"vertical":"horizontal"})],0,"orientation"],[[Ea({type:String,defaultValue:"Split view"}),Sa({ref:"separator",attr:"aria-label"})],0,"label"],[rI({ref:"primary"}),0,"primaryTarget"],[rI({ref:"separator"}),0,"separatorTarget"],[p2({name:"rui-splitter-change",bubbles:!0,composed:!0}),0,"changeEvent"],[f2(["value","orientation"]),2,"onPropsUpdated"],[iI({ref:"separator",type:"keydown"}),2,"onKeydown"],[iI({ref:"separator",type:"pointerdown"}),2,"onPointerDown"],[tI,2,"onPointerMove"],[tI,2,"onPointerUp"]],0,void 0,eI))}value=(BA(this),zA(this));orientation=(qA(this),KA(this));label=($A(this),GA(this));primaryTarget=(WA(this),HA(this));separatorTarget=(YA(this),NA(this));changeEvent=(XA(this),QA(this));dragging=(JA(this),!1);onConnected(){this.syncSeparatorPresentation(),this.applySize()}disconnectedCallback(){document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),super.disconnectedCallback()}onPropsUpdated(){this.syncSeparatorPresentation(),this.applySize()}syncSeparatorPresentation(){let e=this.querySelector('[data-ref="root"]');if(!e)return;let i=Ra(this.orientation);e.classList.toggle("rui-window-splitter--horizontal",i),e.classList.toggle("rui-window-splitter--vertical",!i)}applySize(){if(!this.primaryTarget)return;let e=`${Math.min(Ct,Math.max(It,this.value))}%`;this.orientation==="vertical"?(this.primaryTarget.style.height=e,this.primaryTarget.style.width=""):(this.primaryTarget.style.width=e,this.primaryTarget.style.height="")}onKeydown(e){let i=e.shiftKey?10:2,r=Ra(this.orientation);r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowUp"?(e.preventDefault(),this.updateValue(Math.max(It,this.value-i))):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowDown"?(e.preventDefault(),this.updateValue(Math.min(Ct,this.value+i))):e.key==="Home"?(e.preventDefault(),this.updateValue(It)):e.key==="End"&&(e.preventDefault(),this.updateValue(Ct))}updateValue(e){e!==this.value&&(this.value=e,this.changeEvent.emit({value:e}))}onPointerDown(e){this.dragging=!0,this.separatorTarget.setPointerCapture(e.pointerId),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)}onPointerMove(e){if(!this.dragging)return;let i=this.getBoundingClientRect();this.orientation==="vertical"?this.updateValue(Math.min(Ct,Math.max(It,(e.clientY-i.top)/i.height*100))):this.updateValue(Math.min(Ct,Math.max(It,(e.clientX-i.left)/i.width*100)))}onPointerUp(){this.dragging=!1,document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp)}static{UA()}};import{jsx as pn,jsxs as m2}from"@ecopages/jsx/jsx-runtime";function g2({primary:t,secondary:e,orientation:i="horizontal",...r}){return pn("rui-window-splitter",{...r,orientation:i,children:m2("div",{class:j("rui-window-splitter",i!=="vertical"?"rui-window-splitter--horizontal":"rui-window-splitter--vertical"),"data-ref":"root",children:[pn("div",{"data-ref":"primary",class:"rui-window-splitter__pane",children:t}),pn("div",{"data-ref":"separator",class:"rui-window-splitter__separator",role:"separator",tabindex:0,"aria-valuemin":It,"aria-valuemax":Ct}),pn("div",{"data-ref":"secondary",class:"rui-window-splitter__pane",children:e})]})})}export{lr as DEFAULT_TOAST_POSITION,Ui as FormStore,vy as NAVIGATION_MENU_DEFAULT_CLOSE_DELAY,by as NAVIGATION_MENU_DEFAULT_HOVER_DELAY,ot as RUI_CONTROL_ATTR,po as RUI_DIALOG_ACTION_EVENT,Lr as RUI_DIALOG_CLOSE_EVENT,nt as RUI_DIALOG_HOST_ID,Mr as RUI_DIALOG_OPEN_EVENT,Pr as RUI_DIALOG_TOGGLE_EVENT,Kr as RUI_FIELD_DESCRIPTION_ATTR,ci as RUI_FIELD_ERROR_ATTR,qr as RUI_FIELD_LABEL_ATTR,vo as RUI_FIELD_MANAGED_ATTR,or as RUI_TOAST_DISMISS_EVENT,nr as RUI_TOAST_SHOW_EVENT,_I as RuiAlert,yI as RuiAlertDescription,Ya as RuiAlertElement,bI as RuiAlertIcon,vI as RuiAlertTitle,vn as RuiAutocomplete,gn as RuiAutocompleteCollection,as as RuiAutocompleteElement,bn as RuiAutocompleteEmpty,II as RuiAutocompleteInput,OI as RuiAvatar,kI as RuiBadge,UI as RuiBreadcrumb,gs as RuiBreadcrumbElement,WI as RuiBreadcrumbEllipsis,qI as RuiBreadcrumbItem,KI as RuiBreadcrumbLink,zI as RuiBreadcrumbList,$I as RuiBreadcrumbPage,GI as RuiBreadcrumbSeparator,Je as RuiButton,XI as RuiButtonGroup,Si as RuiCalendar,vl as RuiCalendarElement,BC as RuiCarousel,su as RuiCarouselElement,cu as RuiCarouselNext,uu as RuiCarouselPrev,du as RuiCarouselRotation,lu as RuiCarouselSlide,Di as RuiCheckbox,Tr as RuiCheckboxElement,nD as RuiCheckboxGroup,Xu as RuiCheckboxGroupControl,Nu as RuiCheckboxGroupElement,aD as RuiChip,sD as RuiChipList,lD as RuiChipListItem,ND as RuiCombobox,YD as RuiComboboxClear,Rd as RuiComboboxControl,Cc as RuiComboboxElement,Ad as RuiComboboxInput,Dd as RuiComboboxListbox,Id as RuiComboboxTrigger,Cd as RuiComboboxValue,s1 as RuiCycleToggle,Nd as RuiCycleToggleButton,Yd as RuiCycleToggleElement,a1 as RuiCycleToggleItem,O1 as RuiDateField,lp as RuiDateFieldCalendar,np as RuiDateFieldControl,Ch as RuiDateFieldElement,op as RuiDateFieldInput,sp as RuiDateFieldPopover,ap as RuiDateFieldToggle,ai as RuiDateInput,ip as RuiDateInputElement,z1 as RuiDateRangePicker,Np as RuiDateRangePickerCalendar,qp as RuiDateRangePickerControl,zp as RuiDateRangePickerElement,Gp as RuiDateRangePickerEndInput,Kp as RuiDateRangePickerInputs,Yp as RuiDateRangePickerPopover,Wp as RuiDateRangePickerSeparator,$p as RuiDateRangePickerStartInput,Hp as RuiDateRangePickerToggle,J1 as RuiDialog,wf as RuiDialogActions,xf as RuiDialogBody,Tf as RuiDialogClose,bf as RuiDialogElement,_f as RuiDialogTitle,EO as RuiDisclosure,Br as RuiDisclosureElement,RO as RuiDisclosureGroup,tm as RuiDisclosureGroupElement,nm as RuiDisclosureIcon,am as RuiDisclosurePanel,om as RuiDisclosureTrigger,AO as RuiFeed,IO as RuiFeedArticle,OO as RuiFeedArticleActions,DO as RuiFeedArticleContent,CO as RuiFeedArticleHeader,VO as RuiFeedByline,kO as RuiFeedBylineBody,MO as RuiFeedMeta,oV as RuiField,sV as RuiFieldDescription,Hm as RuiFieldElement,uV as RuiFieldError,wV as RuiForm,Eg as RuiFormElement,DV as RuiGrid,Mg as RuiGridElement,MV as RuiHeading,jV as RuiHeadingDescription,LV as RuiHeadingEyebrow,PV as RuiHeadingTitle,Oo as RuiHeadline,XV as RuiHoverCard,NV as RuiHoverCardContent,lb as RuiHoverCardElement,YV as RuiHoverCardTrigger,xi as RuiIconCalendar,wi as RuiIconCheck,Xe as RuiIconChevronDown,fn as RuiIconChevronLeft,mn as RuiIconChevronRight,Re as RuiIconX,JV as RuiInput,ZV as RuiInputGroup,ek as RuiInputGroupAddon,tk as RuiInputGroupText,fk as RuiKnob,iv as RuiKnobElement,yk as RuiLabel,ii as RuiListbox,Xc as RuiListboxElement,eo as RuiListboxOption,Qc as RuiListboxOptionIndicator,Lk as RuiMenuButton,Rv as RuiMenuButtonContent,Tv as RuiMenuButtonElement,Iv as RuiMenuButtonItem,Av as RuiMenuButtonSubmenuContent,Ev as RuiMenuButtonTrigger,$k as RuiMenubar,Fv as RuiMenubarElement,Bv as RuiMenubarMenu,Uv as RuiMenubarMenuItem,zv as RuiMenubarSubmenuContent,Zk as RuiMeter,ry as RuiMeterElement,lM as RuiNavigationMenu,aM as RuiNavigationMenuBar,yy as RuiNavigationMenuElement,cM as RuiNavigationMenuLink,dM as RuiNavigationMenuPanel,sM as RuiNavigationMenuPanels,uM as RuiNavigationMenuTrigger,xM as RuiNumberField,d_ as RuiNumberFieldDecrementButton,o_ as RuiNumberFieldElement,s_ as RuiNumberFieldGroup,c_ as RuiNumberFieldIncrementButton,l_ as RuiNumberFieldInput,u_ as RuiNumberFieldSteppers,DM as RuiPagination,C_ as RuiPaginationElement,D_ as RuiPaginationNav,jM as RuiPopover,PM as RuiPopoverContent,dx as RuiPopoverElement,FM as RuiPopoverTrigger,hx as RuiPopoverTriggerElement,Mx as RuiRadio,NM as RuiRadioGroup,kx as RuiRadioGroupControl,Vx as RuiRadioGroupElement,uL as RuiSelect,oL as RuiSelectClear,s0 as RuiSelectControl,o0 as RuiSelectElement,d0 as RuiSelectListbox,aL as RuiSelectSearch,u0 as RuiSelectToggle,l0 as RuiSelectTrigger,c0 as RuiSelectValue,Wi as RuiSeparator,YL as RuiSidebar,FL as RuiSidebarContent,bw as RuiSidebarElement,BL as RuiSidebarFooter,zL as RuiSidebarGroup,qL as RuiSidebarGroupAction,KL as RuiSidebarGroupHeader,Gw as RuiSidebarGroupLabel,jL as RuiSidebarHeader,HL as RuiSidebarInset,$L as RuiSidebarMenu,WL as RuiSidebarMenuAction,Ww as RuiSidebarMenuButton,GL as RuiSidebarMenuItem,PL as RuiSidebarProvider,UL as RuiSidebarSeparator,LL as RuiSidebarTrigger,$w as RuiSidebarTriggerElement,nP as RuiSlider,HT as RuiSliderElement,YT as RuiSliderValue,sP as RuiSpinner,gP as RuiSwitch,lS as RuiSwitchElement,BP as RuiTab,FP as RuiTabList,zP as RuiTabPanel,UP as RuiTabPanels,DP as RuiTable,TP as RuiTableBody,AP as RuiTableCell,EP as RuiTableColumn,kS as RuiTableElement,CP as RuiTableEmptyState,SP as RuiTableFooter,wP as RuiTableHeader,RP as RuiTableRow,IP as RuiTableSelectionCell,qP as RuiTabs,QS as RuiTabsElement,Td as RuiTag,Mi as RuiTagGroup,_d as RuiTagGroupElement,wd as RuiTagList,Sd as RuiTagRemove,$P as RuiTextarea,dj as RuiToast,IE as RuiToastElement,hj as RuiToaster,nR as RuiToasterElement,Rj as RuiToc,VR as RuiTocElement,Vj as RuiToolbar,$R as RuiToolbarElement,qj as RuiTooltip,sA as RuiTooltipElement,Qj as RuiTree,xA as RuiTreeElement,s2 as RuiTreegrid,jA as RuiTreegridElement,g2 as RuiWindowSplitter,oI as RuiWindowSplitterElement,da as TOAST_COLLAPSED_PEEK,ha as TOAST_EXIT_MS,la as TOAST_GAP,ar as TOAST_LIFETIME,GP as TOAST_POSITIONS,sr as TOAST_SWIPE_THRESHOLD,ua as TOAST_VIEWPORT_OFFSET,ca as TOAST_VISIBLE_AMOUNT,WP as TOAST_WIDTH,Jd as ThemeItemLabel,Qd as ThemePreferenceIcon,u1 as ThemePreferenceItemContent,Ct as WINDOW_SPLITTER_MAX,It as WINDOW_SPLITTER_MIN,lO as closeDialog,cO as createDialogHandle,Co as createRulesResolver,j as cx,ro as cycleValue,mj as dismissToast,Ao as fieldContext,hi as findFieldControl,pi as formContext,aO as getOpenDialogId,Of as installDialogs,di as isNativeTextControl,sO as openDialog,Eo as readControlValue,UO as registerFieldControl,Nm as runRulesResolver,fj as showToast,pj as toast,uO as toggleDialog,fo as uninstallDialogs,ne as withDefaultAriaLabel,$r as writeControlValue};
|
|
1
|
+
function ne(t,e){return e===void 0||t?.label!==void 0?t:{...t,label:e}}function j(...t){return t.filter(Boolean).join(" ")}import{jsx as dr,jsxs as aI}from"@ecopages/jsx/jsx-runtime";function xi({class:t,size:e="sm",...i}){return aI("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[dr("path",{d:"M8 2v4"}),dr("path",{d:"M16 2v4"}),dr("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),dr("path",{d:"M3 10h18"})]})}import{jsx as Aa}from"@ecopages/jsx/jsx-runtime";function wi({class:t,size:e="sm",...i}){return Aa("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Aa("path",{d:"m5 12 4 4L19 6"})})}import{jsx as Ia}from"@ecopages/jsx/jsx-runtime";function Xe({class:t,size:e="sm",...i}){return Ia("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Ia("path",{d:"m6 9 6 6 6-6"})})}import{jsx as Ca}from"@ecopages/jsx/jsx-runtime";function fn({class:t,size:e="sm",...i}){return Ca("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Ca("path",{d:"m15 18-6-6 6-6"})})}import{jsx as Da}from"@ecopages/jsx/jsx-runtime";function mn({class:t,size:e="sm",...i}){return Da("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Da("path",{d:"m9 18 6-6-6-6"})})}import{jsx as Oa,jsxs as sI}from"@ecopages/jsx/jsx-runtime";var Va="http://www.w3.org/2000/svg";function Re({class:t,size:e="sm",...i}){return sI("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[Oa("path",{d:"m18 6-12 12"}),Oa("path",{d:"m6 6 12 12"})]})}function hr(){let t=document.createElementNS(Va,"svg");t.setAttribute("class","rui-icon"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true");for(let e of["m18 6-12 12","m6 6 12 12"]){let i=document.createElementNS(Va,"path");i.setAttribute("d",e),t.append(i)}return t}import{RadiantElement as Wa,bound as hI,customElement as pI,event as fI,onEvent as mI,prop as pr}from"@ecopages/radiant";var ka,Ma,La,Pa,ja,Fa,Ba,Ua,za,qa,Ka,$a;function lI(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Ga(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ga(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:uI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return dI(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function uI(t){var e=cI(t,"string");return typeof e=="symbol"?e:e+""}function cI(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ga(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function dI(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Ya,Ha=class extends Wa{static{({e:[La,Pa,ja,Fa,Ba,Ua,za,qa,Ka,$a,ka],c:[Ya,Ma]}=lI(this,[pI("rui-alert")],[[pr({type:String,reflect:!0,defaultValue:"info"}),0,"variant"],[pr({type:String,reflect:!0,defaultValue:"inline"}),0,"layout"],[pr({type:Boolean,reflect:!0,defaultValue:!1}),0,"dismissible"],[pr({type:String,attribute:"close-label",defaultValue:"Dismiss"}),0,"closeLabel"],[fI({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[hI,2,"dismiss"],[mI({selector:"[data-alert-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Wa))}constructor(...e){super(...e),$a(this)}variant=(ka(this),La(this));layout=(Pa(this),ja(this));dismissible=(Fa(this),Ba(this));closeLabel=(Ua(this),za(this));closeEvent=(qa(this),Ka(this));dismiss(){this.isConnected&&(this.closeEvent.emit({reason:"dismiss"}),this.remove())}onCloseClick(e){e.stopPropagation(),this.dismissible&&this.dismiss()}static{Ma()}};import{jsx as ze,jsxs as Na}from"@ecopages/jsx/jsx-runtime";var gI={info:["M12 16v-4","M12 8h.01","M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z"],success:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","m9 12 2 2 4-4"],warning:["m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3","M12 9v4","M12 17h.01"],error:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","m15 9-6 6","m9 9 6 6"]};function bI({variant:t="info",class:e,children:i,...r}){if(i!=null)return ze("span",{...r,class:j("rui-alert__icon",e),children:i});let s=gI[t],d=Array.isArray(s)?s:[s];return ze("span",{...r,class:j("rui-alert__icon",e),"aria-hidden":"true",children:ze("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:d.map(h=>ze("path",{d:h}))})})}function vI({children:t,class:e,...i}){return ze("p",{...i,class:j("rui-alert__title",e),children:t})}function yI({children:t,class:e,...i}){return ze("div",{...i,class:j("rui-alert__description",e),children:t})}function _I({children:t,variant:e="info",layout:i="inline",dismissible:r=!1,closeLabel:s="Dismiss",class:d,slot:h,...a}){return ze("rui-alert",{slot:h,variant:e,layout:i,dismissible:r,"close-label":s,children:Na("div",{...a,class:j("rui-alert",`rui-alert--${e}`,`rui-alert--${i}`,r&&"rui-alert--dismissible",d),role:"alert",children:[t,r?ze("button",{type:"button",class:"rui-alert__close","data-alert-close":!0,"aria-label":s||"Dismiss",children:Na("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[ze("path",{d:"M18 6 6 18"}),ze("path",{d:"m6 6 12 12"})]})}):null]})})}import{RadiantElement as rs,customElement as EI,onEvent as RI,onUpdated as AI,prop as ns}from"@ecopages/radiant";function fr(t,e,i="base"){if(!e)return!0;if(i==="case")return t.includes(e);let r=new Intl.Collator(void 0,{sensitivity:i==="accent"?"accent":"base",usage:"search"});for(let s=0;s<=t.length-e.length;s+=1){let d=t.slice(s,s+e.length);if(r.compare(d,e)===0)return!0}return!1}var Xa,Qa,Ja,Za,es,ts;function xI(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:is(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||is(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:wI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return SI(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function wI(t){var e=TI(t,"string");return typeof e=="symbol"?e:e+""}function TI(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function is(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function SI(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var as,os=class extends rs{static{({e:[Ja,Za,es,ts,Xa],c:[as,Qa]}=xI(this,[EI("rui-autocomplete")],[[ns({type:String,defaultValue:"base"}),0,"sensitivity"],[ns({type:String,attribute:"input-value",defaultValue:""}),0,"inputValue"],[AI(["sensitivity","inputValue"]),2,"onPropsUpdated"],[RI({selector:"[data-autocomplete-input]",type:"input"}),2,"onInput"]],0,void 0,rs))}sensitivity=(Xa(this),Ja(this));inputValue=(Za(this),es(this));externalInput=(ts(this),null);onExternalInput=()=>{this.applyFilter()};getInput(){let e=this.querySelector("[data-autocomplete-input]");return e||(this.closest("rui-combobox, rui-select")?.querySelector("[data-autocomplete-input]")??null)}bindExternalInput(){this.unbindExternalInput();let e=this.getInput();!e||this.contains(e)||(this.externalInput=e,e.addEventListener("input",this.onExternalInput))}unbindExternalInput(){this.externalInput?.removeEventListener("input",this.onExternalInput),this.externalInput=null}syncFilter(){this.applyFilter()}getCollection(){return this.querySelector("[data-autocomplete-collection]")??this}getFilterableItems(){let e=this.getCollection();return e?Array.from(e.querySelectorAll('[role="option"], [data-tag], [role="menuitem"]')).filter(r=>this.contains(r)||e.contains(r)):[]}getItemText(e){return e.getAttribute("data-label")||e.textContent?.trim()||""}getQuery(){return this.inputValue?this.inputValue:this.getInput()?.value??""}applyFilter(){let e=this.getQuery(),i=this.getFilterableItems(),r=0;for(let d of i){let h=fr(this.getItemText(d),e,this.sensitivity);d.hidden=!h,h&&(r+=1)}let s=this.querySelector("[data-autocomplete-empty]");s&&s.toggleAttribute("hidden",r>0)}initialize(){this.applyFilter()}onConnected(){this.bindExternalInput(),this.initialize()}disconnectedCallback(){this.unbindExternalInput(),super.disconnectedCallback()}onPropsUpdated(){this.applyFilter()}onInput(){this.applyFilter()}static{Qa()}};import{jsx as Ht}from"@ecopages/jsx/jsx-runtime";function II({placeholder:t,class:e,disabled:i,...r}){return Ht("input",{...r,type:"search","data-autocomplete-input":!0,class:j("rui-autocomplete__input",e),placeholder:t,disabled:i,autocomplete:"off"})}function gn({children:t,class:e,...i}){return Ht("div",{...i,"data-autocomplete-collection":!0,class:j("rui-autocomplete__collection",e),children:t})}function bn({children:t,class:e,...i}){return Ht("div",{...i,"data-autocomplete-empty":!0,class:j("rui-autocomplete__empty",e),children:t})}function CI({children:t}){return Ht("div",{class:"rui-autocomplete","data-ref":"root",children:t})}function vn({children:t,...e}){return Ht("rui-autocomplete",{...e,children:Ht(CI,{children:t})})}import{jsx as yn}from"@ecopages/jsx/jsx-runtime";function ke(...t){for(let e of t)if(e!==void 0)return e}function DI(t){let e=t.trim().split(/\s+/).filter(Boolean);return e.length===0?"?":e.length===1?e[0].slice(0,2).toUpperCase():`${e[0][0]??""}${e[1][0]??""}`.toUpperCase()}function OI({src:t,alt:e="",fallback:i,size:r="md",class:s,children:d,role:h,aria:a,...E}){let A=i??(e?DI(e):void 0);return yn("span",{...E,aria:ne(a,t?void 0:e||i),class:j("rui-avatar",`rui-avatar--${r}`,s),role:ke(h,t?void 0:"img"),children:t?yn("img",{class:"rui-avatar__image",src:t,alt:e}):yn("span",{class:"rui-avatar__fallback","aria-hidden":e||i?"true":void 0,children:d??A??"?"})})}import{jsx as VI}from"@ecopages/jsx/jsx-runtime";function kI({children:t,variant:e="filled",class:i,...r}){return VI("span",{...r,class:j("rui-badge",`rui-badge--${e}`,i),children:t})}import{RadiantElement as ps,customElement as FI,prop as fs}from"@ecopages/radiant";var ss,ls,us,cs,ds;function MI(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:hs(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||hs(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:LI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return jI(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function LI(t){var e=PI(t,"string");return typeof e=="symbol"?e:e+""}function PI(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hs(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function jI(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var gs,ms=class extends ps{static{({e:[ls,us,cs,ds],c:[gs,ss]}=MI(this,[FI("rui-breadcrumb")],[[fs({type:String,defaultValue:"Breadcrumb"}),0,"label"],[fs({type:String,defaultValue:"/"}),0,"separator"]],0,void 0,ps))}constructor(...e){super(...e),ds(this)}label=ls(this);separator=(us(this),cs(this));static{ss()}};import{jsx as Qe,jsxs as BI}from"@ecopages/jsx/jsx-runtime";function UI({children:t,label:e,separator:i,...r}){return Qe("rui-breadcrumb",{...r,label:e,separator:i,children:Qe("nav",{class:"rui-breadcrumb","aria-label":e||"Breadcrumb",style:{"--rui-breadcrumb-separator":JSON.stringify(i||"/")},children:t})})}function zI({children:t,class:e,...i}){return Qe("ol",{...i,class:j("rui-breadcrumb__list",e),children:t})}function qI({children:t,class:e,...i}){return Qe("li",{...i,class:j("rui-breadcrumb__item",e),children:t})}function KI({children:t,href:e,class:i,...r}){return Qe("a",{...r,class:j("rui-breadcrumb__link",i),href:e,children:t})}function $I({children:t,class:e,...i}){return Qe("span",{...i,class:j("rui-breadcrumb__page",e),"aria-current":"page",children:t})}function GI({children:t,class:e,...i}){return Qe("li",{...i,class:j("rui-breadcrumb__separator",e),role:"presentation","aria-hidden":"true",children:t})}function WI({label:t="More",class:e,...i}){return BI("span",{...i,class:j("rui-breadcrumb__ellipsis",e),role:"presentation","aria-hidden":"true",children:[Qe("span",{"aria-hidden":"true",children:"\u2026"}),Qe("span",{class:"rui-breadcrumb__ellipsis-label",children:t})]})}import{jsx as bs}from"@ecopages/jsx/jsx-runtime";function HI(t,e,i){if(t!==void 0)return t;if(e)return i}function YI(t,e){if(typeof t=="function"){t(e);return}t!=null&&typeof t=="object"&&"handleEvent"in t&&t.handleEvent(e)}function Je(t){if(t.href!==void 0){let{href:$,target:V,rel:G,download:W,children:O,class:_,variant:H,size:Y,square:n,...g}=t;return bs("a",{...g,href:$,target:V,rel:G,download:W,class:j("rui-button",`rui-button--${H??"filled"}`,`rui-button--${Y??"md"}`,n&&"rui-button--square",_),children:O})}let{variant:e,size:i,square:r,class:s,children:d,type:h="button",disabled:a,pressed:E,defaultPressed:A=!1,toggle:S=!1,"on:click":I,...T}=t,K=$=>{if(S&&E===void 0){let V=$.currentTarget,G=V.getAttribute("aria-pressed")!=="true";V.setAttribute("aria-pressed",String(G))}YI(I,$)};return bs("button",{...T,type:h,class:j("rui-button",`rui-button--${e??"filled"}`,`rui-button--${i??"md"}`,r&&"rui-button--square",s),disabled:a,"aria-pressed":HI(E,S,A),"data-toggle":S&&E===void 0?"":void 0,"on:click":S||I?K:void 0,children:d})}import{jsx as NI}from"@ecopages/jsx/jsx-runtime";function XI({children:t,orientation:e="horizontal",class:i,...r}){return NI("div",{...r,role:"group","aria-orientation":e,class:j("rui-button-group",`rui-button-group--${e}`,i),children:t})}import{jsx as Te,jsxs as zn}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as gl,customElement as xC,event as wC,onEvent as kt,onUpdated as TC,prop as ft,registerSsrPreparationCallback as SC,state as mt}from"@ecopages/radiant";function ht(t){if(!t)return;let e=t.split(",").map(i=>i.trim()).filter(Boolean);return e.length>1?e:e[0]}function Dt(t){if(t==null)return null;let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t.trim());if(!e)return null;let i=Number(e[1]),r=Number(e[2])-1,s=Number(e[3]),d=new Date(i,r,s);return d.getFullYear()!==i||d.getMonth()!==r||d.getDate()!==s?null:d}function Ze(t){let e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${i}-${r}`}function pt(t,e,i){return!(e&&t<e||i&&t>i)}function Ot(t,e){return t.localeCompare(e)}function Yt(t,e){return Ot(t,e)<=0?{start:t,end:e}:{start:e,end:t}}function Me(t){if(!t)return null;let[e,i]=t.split("/");return!e||!i?null:Yt(e,i)}function Nt(t){if(!t)return"";let e=Yt(t.start,t.end);return`${e.start}/${e.end}`}function Xt(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean).sort(Ot):[]}function _n(t){return[...new Set(t)].sort(Ot).join(",")}function xn(t,e){let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),[...i].sort(Ot)}function vs(t,e){let i=Yt(e.start,e.end);return Ot(t,i.start)>=0&&Ot(t,i.end)<=0}function wn(t,e,i){if(e==="single"){let A=i.singleIso===t;return{isSelected:A,isRangeStart:A,isRangeEnd:A,isRangeMiddle:!1}}if(e==="multiple"){let A=i.multipleIsos?.includes(t)??!1;return{isSelected:A,isRangeStart:A,isRangeEnd:A,isRangeMiddle:!1}}let r=i.range;if(!r)return{isSelected:!1,isRangeStart:!1,isRangeEnd:!1,isRangeMiddle:!1};let s=Yt(r.start,r.end),d=vs(t,s),h=t===s.start,a=t===s.end;return{isSelected:d,isRangeStart:h,isRangeEnd:a,isRangeMiddle:d&&!h&&!a}}function Tn(t,e,i){return e.anchor?{committed:Yt(e.anchor,i),draft:{anchor:null,hover:null}}:{committed:t,draft:{anchor:i,hover:i}}}function mr(t){let e=QI(t);try{let r=new Intl.Locale(e).weekInfo;if(r?.firstDay!=null)return r.firstDay===7?0:r.firstDay}catch{}return e.startsWith("en-US")?0:1}function QI(t){return Array.isArray(t)?t[0]??navigator.language:t??navigator.language}function JI(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function ZI(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function eC(t){let e=t.selectionMode??"single",i=t.value??"";if(e==="multiple")return{mode:e,multipleIsos:Xt(i)};if(e==="range"){let r=Me(i);if(t.rangeDraft?.anchor){let s=t.rangeDraft.hover??t.rangeDraft.anchor;return{mode:e,range:tC(t.rangeDraft.anchor,s)}}return{mode:e,range:r}}return{mode:e,singleIso:i||void 0}}function tC(t,e){return t.localeCompare(e)<=0?{start:t,end:e}:{start:e,end:t}}function Sn(t,e,i){let r=mr(i.locale),s=JI(i.today??new Date),d=eC(i),a=(new Date(t,e,1).getDay()-r+7)%7,E=new Date(t,e,1-a),A=[],S=new Date(E);for(let I=0;I<6;I+=1){let T=[];for(let K=0;K<7;K+=1){let $=Ze(S),V=wn($,d.mode,{singleIso:d.singleIso,multipleIsos:d.multipleIsos,range:d.range});T.push({date:new Date(S),iso:$,inMonth:S.getMonth()===e,isToday:ZI(S,s),isSelected:V.isSelected,isDisabled:!pt($,i.min,i.max),isRangeStart:V.isRangeStart,isRangeEnd:V.isRangeEnd,isRangeMiddle:V.isRangeMiddle}),S.setDate(S.getDate()+1)}if(A.push(T),I>=4&&S.getMonth()!==e&&S.getDate()>7)break}return A}function gr(t,e,i){let r=new Date(t,e+i,1);return{year:r.getFullYear(),month:r.getMonth()}}function En(t,e,i){let r=Math.max(1,Math.min(i,12));return Array.from({length:r},(s,d)=>{let h=gr(t,e,d);return{year:h.year,month:h.month,offset:d}})}var ys=new Map;function iC(t,e){return`${JSON.stringify(t??null)}|${JSON.stringify(e)}`}function Vt(t,e){let i=iC(t,e),r=ys.get(i);if(r)return r;let s=new Intl.DateTimeFormat(t,e);return ys.set(i,s),s}function Rn(t,e){return Vt(e,{month:"long",year:"numeric"}).format(t)}function An(t,e){let i=Vt(t,{weekday:"narrow"}),r=[];for(let s=0;s<7;s+=1){let d=(e+s)%7,h=new Date(2024,0,d===0?7:d);r.push(i.format(h))}return r}function In(t){return new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(0,"day")}var rC={0:"digit",a:"letter","*":"any"},nC=/\p{L}/u;function oC(t,e){let i=e?.[t];if(i instanceof RegExp)return{kind:"any",pattern:i};if(i)return{kind:i};let r=rC[t];return r?{kind:r}:null}function _s(t,e,i){return i?i.test(t):e==="digit"?/\d/.test(t):e==="letter"?nC.test(t):t.length>0}function xs(t,e,i=!1){let r=[],s=0;for(;s<t.length;){let d=t[s];if(d==="\\"){let a=t[s+1];a&&r.push({type:"literal",value:a}),s+=2;continue}if(d==="{"){let a=t.indexOf("}",s+1);if(a<0){r.push({type:"literal",value:"{"}),s+=1;continue}r.push({type:"fixed",value:t.slice(s+1,a)}),s=a+1;continue}if(d==="["){let a=aC(t,s+1);if(a<0){r.push({type:"literal",value:"["}),s+=1;continue}let E=xs(t.slice(s+1,a),e,!0);r.push(...E),s=a+1;continue}if(d==="]")break;let h=oC(d,e);if(h){r.push({type:"input",definition:d,kind:h.kind,pattern:h.pattern,optional:i}),s+=1;continue}r.push({type:"literal",value:d}),s+=1}return r}function aC(t,e){let i=1;for(let r=e;r<t.length;r+=1)if(t[r]==="["&&t[r-1]!=="\\"&&(i+=1),t[r]==="]"&&t[r-1]!=="\\"&&(i-=1,i===0))return r;return-1}function Cn(t,e){return xs(t,e)}function ws(t,e={}){return t.filter(i=>i.type==="input"&&(!e.requiredOnly||!i.optional)).length}function Dn(t,e){let i=Cn(t,e),r="";for(let s of i){if(s.type==="literal"||s.type==="fixed"){r+=s.value;continue}r+="_"}return r}function Ts(t,e){let i="",r=0;for(let s of e){if(s.type==="fixed"||s.type==="literal"){t.slice(r,r+s.value.length)===s.value&&(r+=s.value.length);continue}if(r>=t.length)continue;let d=t[r];_s(d,s.kind,s.pattern)&&(i+=d,r+=1)}return i}function Ss(t,e){if(!t)return"";let i=0,r="";for(let s of e){if(s.type==="fixed"||s.type==="literal"){r+=s.value;continue}if(i>=t.length){if(s.optional)continue;break}let d=t[i];if(!_s(d,s.kind,s.pattern)){if(s.optional)continue;break}r+=d,i+=1}return r}function sC(t){return t.every(e=>e.type!=="input"||e.kind==="digit")}function lC(t,e){let i=t.replace(/\D/g,""),r=e.filter(s=>s.type==="fixed").map(s=>s.value.replace(/\D/g,"")).join("");return r&&i.startsWith(r)?i.slice(r.length):i}function On(t,e,i){let r=Cn(e,i),s=ws(r),d=Ts(t,r);return d.length===0&&/\S/.test(t)&&sC(r)&&(d=lC(t,r)),d.length>s&&(d=d.slice(0,s)),Ss(d,r)}var uC=new Date(2e3,0,1);function cC(t,e){return t==="year"?e==="year":t==="month"?e==="year"||e==="month":!0}function dC(t,e){let r=Vt(e,{[t]:t==="year"?"numeric":"2-digit"}).formatToParts(uC).find(s=>s.type===t);return r?r.value.replace(/\d/g,t==="year"?"y":t==="month"?"m":"d"):t==="year"?"yyyy":"mm"}function hC(t,e,i){let r=t==="year"?{year:"numeric"}:{[t]:"2-digit"};return Vt(i,r).formatToParts(e).find(s=>s.type===t)?.value??""}function br(t,e,i={}){let r=i.granularity??"day",s=t??i.placeholderDate??new Date;return Vt(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(s).filter(h=>h.type!=="era").map(h=>{if(h.type==="literal")return{type:"literal",value:h.value,placeholder:h.value,isPlaceholder:!1,editable:!1};let a=h.type;if(!cC(r,a))return null;let E=t!=null;return{type:a,value:E?hC(a,t,e):"",placeholder:dC(a,e),isPlaceholder:!E,editable:!0}}).filter(h=>h!=null)}function pC(t){if(t.isPlaceholder||t.value==="")return null;let e=Number(t.value);return Number.isFinite(e)?e:null}function fC(t){return t>=100?t:t>=69?1900+t:2e3+t}function Es(t){let e={};for(let r of t){if(!r.editable)continue;let s=pC(r);if(s==null)return null;e[r.type]=r.type==="year"?fC(s):s}if(e.year==null||e.month==null||e.day==null)return null;let i=new Date(e.year,e.month-1,e.day);return i.getFullYear()!==e.year||i.getMonth()!==e.month-1||i.getDate()!==e.day?null:i}function Rs(t){return t.every(e=>!e.editable||e.isPlaceholder||e.value==="")}function Vn(t,e={}){let i=t.find(d=>d.editable&&d.type==="year");if(i&&!i.isPlaceholder&&i.value!==""&&i.value.replace(/\D/g,"").length<4)return{kind:"partial-year"};if(Rs(t))return{kind:"empty"};let r=Es(t);if(!r)return{kind:"incomplete"};let s=Ze(r);return pt(s,e.min,e.max)?{kind:"date",iso:s}:{kind:"out-of-range"}}function kn(t){return t==="year"?4:2}function mC(t,e){return t.findIndex(i=>i.editable&&i.type===e)}function gC(t){return t.map(e=>({...e}))}function Ln(t,e,i){let r=gC(t),s=mC(r,e);return s<0||(r[s]={...r[s],...i}),r}function Mn(t){if(t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function vr(t,e){return{min:1,max:Is(t,e)}}function Is(t,e){if(t==="month")return 12;if(t==="day"){let i=As(e,"year"),r=As(e,"month");return i!=null&&r!=null?new Date(i,r,0).getDate():31}return 9999}function As(t,e){let i=t.find(r=>r.editable&&r.type===e);return!i||i.isPlaceholder||i.value===""?null:Number(i.value)}function Cs(t,e){return t==="year"?String(e).padStart(4,"0"):String(e).padStart(2,"0")}function Pn(t,e){try{let r=new Intl.DisplayNames(e,{type:"dateTimeField"}).of(t);if(r)return r}catch{}return t==="month"?"Month":t==="day"?"Day":"Year"}function Ti(t){return t.isPlaceholder||t.value===""?t.placeholder:t.value}function yr(t){return t.isPlaceholder||t.value===""?null:Mn(t.value.replace(/\D/g,""))}function Ds(t,e){return Ln(t,e,{value:"",isPlaceholder:!0})}function Os(t,e,i){return Ln(t,e,{value:Cs(e,i),isPlaceholder:!1})}function jn(t,e,i){let r=t.find(E=>E.editable&&E.type===e);if(!r)return t;let{min:s,max:d}=vr(e,t),a=(yr(r)??(i>0?s-1:d+1))+i;return e==="month"||e==="day"?a<s?a=d:a>d&&(a=s):a=Math.max(s,a),Os(t,e,a)}function Fn(t,e,i,r){let s=i.replace(/\D/g,"");if(!s)return{segments:t,enteredKeys:r,focusNext:!1};let d=r+s,h=Mn(d);if(h==null)return{segments:t,enteredKeys:r,focusNext:!1};let a=Is(e,t),E=h;E>a&&(E=Mn(s)??E);let A=kn(e),S=+`${E}0`>a||d.length>=A||String(E).length>=A,I=S?Cs(e,E):String(E);return{segments:Ln(t,e,{value:I,isPlaceholder:!1}),enteredKeys:S?"":d,focusNext:S}}function Vs(t){return t.filter(e=>e.editable).map(e=>e.type)}function Qt(t,e,i){let r=Vs(t),s=r.indexOf(e);if(s<0)return r[0]??null;let d=s+i;return d<0||d>=r.length?null:r[d]??null}function Bn(t){let e=null;for(let i of t){if(!i.editable)continue;let r=i.type;if(e||(e=r),i.isPlaceholder||i.value==="")return r}return e}function Un(t,e){let i=t.find(d=>d.editable&&d.type===e);if(!i)return{kind:"focus-previous"};if(i.isPlaceholder||i.value==="")return{kind:"focus-previous"};let r=i.value.replace(/\D/g,"");if(r.length<=1)return{kind:"updated",segments:Ds(t,e),enteredKeys:""};let s=r.slice(0,-1);return{kind:"updated",segments:t.map(d=>d.editable&&d.type===e?{...d,value:s,isPlaceholder:!1}:d),enteredKeys:s}}var ks,Ms,Ls,Ps,js,Fs,Bs,Us,zs,qs,Ks,$s,Gs,Ws,Hs,Ys,Ns,Xs,Qs,Js,Zs,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl;function bC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ml(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ml(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:vC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _C(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function vC(t){var e=yC(t,"string");return typeof e=="symbol"?e:e+""}function yC(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ml(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function _C(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var vl,bl=class extends gl{static{({e:[Ls,Ps,js,Fs,Bs,Us,zs,qs,Ks,$s,Gs,Ws,Hs,Ys,Ns,Xs,Qs,Js,Zs,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ks],c:[vl,Ms]}=bC(this,[xC("rui-calendar")],[[ft({type:String,reflect:!0,defaultValue:""}),0,"value"],[ft({type:String,defaultValue:""}),0,"min"],[ft({type:String,defaultValue:""}),0,"max"],[ft({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ft({type:String,defaultValue:""}),0,"locale"],[ft({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[ft({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[ft({type:String,attribute:"page-behavior",defaultValue:"visible"}),0,"pageBehavior"],[wC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[mt,0,"viewYear"],[mt,0,"viewMonth"],[mt,0,"focusedIso"],[mt,0,"weekdayLabels"],[mt,0,"monthPanels"],[mt,0,"todayLabel"],[mt,0,"rangeAnchor"],[mt,0,"rangeHover"],[TC(["value","min","max","disabled","locale","selectionMode","visibleMonths","pageBehavior"]),2,"onPropsUpdated"],[kt({selector:"[data-calendar-prev-month]",type:"click"}),2,"onPrevMonth"],[kt({selector:"[data-calendar-next-month]",type:"click"}),2,"onNextMonth"],[kt({selector:"[data-calendar-today]",type:"click"}),2,"onTodayClick"],[kt({selector:"[data-calendar-day]",type:"click"}),2,"onDayClick"],[kt({selector:"[data-calendar-day]",type:"pointerenter"}),2,"onDayPointerEnter"],[kt({selector:"[data-calendar-grid]",type:"pointerleave"}),2,"onGridPointerLeave"],[kt({selector:"[data-calendar-day]",type:"keydown"}),2,"onDayKeydown"]],0,void 0,gl))}value=(ks(this),Ls(this));min=(Ps(this),js(this));max=(Fs(this),Bs(this));disabled=(Us(this),zs(this));locale=(qs(this),Ks(this));selectionMode=($s(this),Gs(this));visibleMonths=(Ws(this),Hs(this));pageBehavior=(Ys(this),Ns(this));changeEvent=(Xs(this),Qs(this));viewYear=(Js(this),Zs(this,new Date().getFullYear()));viewMonth=(el(this),tl(this,new Date().getMonth()));focusedIso=(il(this),rl(this,""));weekdayLabels=(nl(this),ol(this,[]));monthPanels=(al(this),sl(this,[]));todayLabel=(ll(this),ul(this,""));rangeAnchor=(cl(this),dl(this,null));rangeHover=(hl(this),pl(this,null));get resolvedLocale(){return ht(this.locale)}get pageDelta(){return this.pageBehavior==="single"?1:Math.max(1,Math.min(this.visibleMonths,12))}get monthOptions(){return{locale:this.resolvedLocale,selectionMode:this.selectionMode,value:this.value??"",rangeDraft:{anchor:this.rangeAnchor,hover:this.rangeHover},min:this.min||void 0,max:this.max||void 0}}syncViewFromValue(){let e=this.selectionMode==="range"?Me(this.value)?.start??"":this.selectionMode==="multiple"?Xt(this.value)[0]??"":this.value,i=Dt(e);if(i){this.viewYear=i.getFullYear(),this.viewMonth=i.getMonth(),this.focusedIso=e;return}let r=new Date;this.viewYear=r.getFullYear(),this.viewMonth=r.getMonth(),this.focusedIso=Ze(r)}refreshGrid(){this.weekdayLabels=An(this.resolvedLocale,mr(this.resolvedLocale)),this.monthPanels=En(this.viewYear,this.viewMonth,this.visibleMonths).map(e=>{let i=new Date(e.year,e.month,1);return{year:e.year,month:e.month,label:Rn(i,this.resolvedLocale),weeks:Sn(e.year,e.month,this.monthOptions)}}),this.todayLabel=In(this.resolvedLocale)}moveMonth(e){let i=gr(this.viewYear,this.viewMonth,e);this.viewYear=i.year,this.viewMonth=i.month,this.refreshGrid()}getFlatDays(){return this.monthPanels.flatMap(e=>e.weeks.flat())}moveFocusedDay(e){let i=this.getFlatDays().filter(h=>!h.isDisabled);if(!i.length)return;let r=i.findIndex(h=>h.iso===this.focusedIso),s=r<0?Math.max(0,i.findIndex(h=>h.inMonth)):(r+e+i.length)%i.length,d=i[s];if(d){if(!this.isMonthVisible(d.date)){this.viewYear=d.date.getFullYear(),this.viewMonth=d.date.getMonth(),this.focusedIso=d.iso,this.refreshGrid(),this.focusFocusedDay();return}this.focusedIso=d.iso,this.focusDayInCurrentGrid(d.iso)}}isMonthVisible(e){let i=this.viewYear*12+this.viewMonth,r=i+this.visibleMonths-1,s=e.getFullYear()*12+e.getMonth();return s>=i&&s<=r}focusDayInCurrentGrid(e){let i=this.querySelector('[data-calendar-day][tabindex="0"]'),r=Array.from(this.querySelectorAll(`[data-calendar-day][data-iso="${e}"]:not(:disabled)`)),s=r.find(d=>!d.hasAttribute("data-outside"))??r[0];s&&(i&&i!==s&&(i.tabIndex=-1),s.tabIndex=0,s.focus())}focusFocusedDay(){requestAnimationFrame(()=>{this.focusDayInCurrentGrid(this.focusedIso)})}moveFocusedMonth(e){let i=Dt(this.focusedIso)??new Date(this.viewYear,this.viewMonth,1),r=new Date(i.getFullYear(),i.getMonth()+e,1),s=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),d=new Date(r.getFullYear(),r.getMonth(),Math.min(i.getDate(),s));this.viewYear=d.getFullYear(),this.viewMonth=d.getMonth(),this.focusedIso=Ze(d),this.refreshGrid(),this.focusFocusedDay()}isIsoAllowed(e){return!(this.min&&e<this.min||this.max&&e>this.max)}emitChange(e,i={}){this.changeEvent.emit({value:e,...i})}selectSingle(e){!this.isIsoAllowed(e)||e===this.value||(this.value=e,this.emitChange(e),this.refreshGrid())}selectMultiple(e){if(!this.isIsoAllowed(e))return;let i=_n(xn(Xt(this.value),e));i!==this.value&&(this.value=i,this.emitChange(i),this.refreshGrid())}selectRange(e){if(!this.isIsoAllowed(e))return;let i=Tn(Me(this.value),{anchor:this.rangeAnchor,hover:this.rangeHover},e);if(this.rangeAnchor=i.draft.anchor,this.rangeHover=i.draft.hover,i.committed){let r=Nt(i.committed);r!==this.value&&(this.value=r,this.emitChange(r,{start:i.committed.start,end:i.committed.end}))}this.refreshGrid()}selectIso(e){if(this.selectionMode==="multiple"){this.selectMultiple(e);return}if(this.selectionMode==="range"){this.selectRange(e);return}this.selectSingle(e)}previewRange(e){this.selectionMode!=="range"||!this.rangeAnchor||this.disabled||this.rangeHover!==e&&(this.rangeHover=e,this.refreshGrid())}clearRangePreview(){this.rangeHover&&(this.rangeHover=this.rangeAnchor,this.refreshGrid())}initialize(){this.syncViewFromValue(),this.refreshGrid()}constructor(){super(),fl(this),SC(this,()=>this.initialize())}onConnected(){this.initialize()}onPropsUpdated(){this.selectionMode!=="range"&&(this.rangeAnchor=null,this.rangeHover=null),this.syncViewFromValue(),this.refreshGrid()}onPrevMonth(e){e.preventDefault(),this.moveMonth(-this.pageDelta)}onNextMonth(e){e.preventDefault(),this.moveMonth(this.pageDelta)}onTodayClick(e){e.preventDefault(),this.selectIso(Ze(new Date))}onDayClick(e){let i=e.target.closest("[data-calendar-day]"),r=i?.getAttribute("data-iso");!r||i?.disabled||this.disabled||this.selectIso(r)}onDayPointerEnter(e){let i=e.target.closest("[data-calendar-day]"),r=i?.getAttribute("data-iso");!r||i?.disabled||this.previewRange(r)}onGridPointerLeave(){this.clearRangePreview()}onDayKeydown(e){if(this.disabled)return;let i=e.target.getAttribute("data-iso");if(i&&(this.focusedIso=i),e.key==="ArrowLeft"){e.preventDefault(),this.moveFocusedDay(-1);return}if(e.key==="ArrowRight"){e.preventDefault(),this.moveFocusedDay(1);return}if(e.key==="ArrowUp"){e.preventDefault(),this.moveFocusedDay(-7);return}if(e.key==="ArrowDown"){e.preventDefault(),this.moveFocusedDay(7);return}if(e.key==="PageUp"){e.preventDefault(),this.moveFocusedMonth(e.shiftKey?-12:-this.pageDelta);return}if(e.key==="PageDown"){e.preventDefault(),this.moveFocusedMonth(e.shiftKey?12:this.pageDelta);return}if(e.key==="Enter"||e.key===" "){e.preventDefault();let r=e.target,s=r.getAttribute("data-iso");s&&!r.disabled&&this.selectIso(s)}}dayDataAttributes(e){return{"data-range-start":e.isRangeStart?"true":void 0,"data-range-end":e.isRangeEnd?"true":void 0,"data-range-middle":e.isRangeMiddle?"true":void 0}}render(){let e=this.monthPanels.length,i=e>1;return zn("div",{class:`rui-calendar${i?" rui-calendar--multi":""}`,"data-ref":"root",role:"application","aria-label":"Calendar","aria-multiselectable":this.selectionMode==="multiple"?"true":void 0,children:[Te("div",{class:"rui-calendar__months",children:this.monthPanels.map((r,s)=>zn("div",{class:"rui-calendar__month-panel","data-calendar-month-panel":!0,children:[zn("div",{class:"rui-calendar__header",children:[s===0?Te("button",{type:"button",class:"rui-calendar__nav","data-calendar-prev-month":!0,"aria-label":"Previous month",disabled:this.disabled,children:"\u2039"}):Te("span",{class:"rui-calendar__nav-spacer","aria-hidden":"true"}),Te("div",{class:"rui-calendar__month","aria-live":"polite",children:r.label}),s===e-1?Te("button",{type:"button",class:"rui-calendar__nav","data-calendar-next-month":!0,"aria-label":"Next month",disabled:this.disabled,children:"\u203A"}):Te("span",{class:"rui-calendar__nav-spacer","aria-hidden":"true"})]}),s===0?Te("div",{class:"rui-calendar__weekdays",role:"row",children:this.weekdayLabels.map(d=>Te("div",{class:"rui-calendar__weekday",role:"columnheader","aria-hidden":"true",children:d}))}):null,Te("div",{class:"rui-calendar__grid",role:"grid","data-calendar-grid":!0,children:r.weeks.map(d=>Te("div",{class:"rui-calendar__week",role:"row",children:d.map(h=>Te("button",{type:"button",class:"rui-calendar__day","data-calendar-day":!0,"data-iso":h.iso,role:"gridcell",disabled:this.disabled||h.isDisabled,tabIndex:h.iso===this.focusedIso?0:-1,"aria-selected":h.isSelected?"true":"false","aria-current":h.isToday?"date":void 0,"data-outside":h.inMonth?void 0:"true",...this.dayDataAttributes(h),children:h.date.getDate()}))}))})]}))}),Te("div",{class:"rui-calendar__footer",children:Te("button",{type:"button",class:"rui-calendar__today","data-calendar-today":!0,disabled:this.disabled,children:this.todayLabel})})]})}static{Ms()}};import{jsx as EC}from"@ecopages/jsx/jsx-runtime";function Si({children:t,...e}){return EC("rui-calendar",{...e,children:t})}import{RadiantElement as ou,bindTo as MC,customElement as LC,onEvent as Ae,onUpdated as Wn,prop as Se,query as wr}from"@ecopages/radiant";var RC=/^[A-Za-z][A-Za-z0-9_-]*$/;function yl(t){return RC.test(t)}function AC(t){let e=t.trim();if(yl(e))return e;let i=`rui-${e}`;return e&&yl(i)?i:"rui"}function re(t){let e=typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,""):Array.from(crypto.getRandomValues(new Uint8Array(16)),i=>i.toString(16).padStart(2,"0")).join("");return`${AC(t)}-${e}`}var _r=class{constructor(e){this.config=e}config;timer=null;get isRunning(){return this.timer!==null}start(){if(!this.config.canRotate()){this.stop();return}this.stop();let e=Math.max(0,this.config.getInterval());this.timer=setInterval(()=>{if(!this.config.canRotate()){this.stop();return}this.config.onTick()},e),this.config.onRunningChange()}stop(){this.timer!==null&&(clearInterval(this.timer),this.timer=null,this.config.onRunningChange())}sync(){this.config.canRotate()?this.start():this.stop()}};function IC(t,e,i=48){return Math.abs(t)<i||Math.abs(t)<=Math.abs(e)?null:t<0?"next":"prev"}var xr=class{pointerId=null;startX=0;startY=0;onPointerDown(e,i){e.button!==0||i||(this.pointerId=e.pointerId,this.startX=e.clientX,this.startY=e.clientY)}onPointerUp(e){if(this.pointerId!==e.pointerId)return null;let i=e.clientX-this.startX,r=e.clientY-this.startY;return this.pointerId=null,IC(i,r)}onPointerCancel(e){this.pointerId===e.pointerId&&(this.pointerId=null)}};function Mt(t){return!Number.isFinite(t)||t<1?1:t}function _l(t){return!Number.isFinite(t)||t<1?1:Math.floor(t)}function qn(t,e){return t<=0?0:Math.max(0,t-Math.floor(Mt(e)))}function Kn(t,e,i){if(e<=0||!Number.isFinite(t))return 0;let r=qn(e,i);return Math.min(Math.max(Math.trunc(t),0),r)}function CC(t,e,i){let r=Mt(i),s=Kn(t,e,r);return Math.min(s,Math.max(0,e-r))}function $n(t,e,i,r){let s=Mt(r),d=CC(e,i,s);return t+1>d&&t<d+s}function Ei(t,e){return Mt(e)>1?"window":t==="fade"?"stack":t==="slide"?"window":"swap"}function Ri(t){return Mt(t)>1?"cards":"shell"}function xl(t){let e=Mt(t);return e<=1?0:Math.ceil(e)-1}function Gn(t){let e=Mt(t.slidesPerView),i=_l(t.slidesPerGroup),r=Kn(t.index,t.count,e),s=qn(t.count,e);return{index:r,slidesPerView:e,slidesPerGroup:i,maxStartIndex:s,canGoPrev:t.wrap||r>0,canGoNext:t.wrap||r<s}}function Ai(t,e){let i=_l(t.slidesPerGroup),r=Math.trunc(t.index)+e*i,s=qn(t.count,t.slidesPerView);return t.wrap?s<=0||r>s?0:r<0?s:r:Kn(r,t.count,t.slidesPerView)}var wl,Tl,Sl,El,Rl,Al,Il,Cl,Dl,Ol,Vl,kl,Ml,Ll,Pl,jl,Fl,Bl,Ul,zl,ql,Kl,$l,Gl,Wl,Hl,Yl,Nl,Xl,Ql,Jl,Zl,eu,tu,iu,ru;function DC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:nu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||nu(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:OC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return kC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function OC(t){var e=VC(t,"string");return typeof e=="symbol"?e:e+""}function VC(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nu(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function kC(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Le={label:"Carousel",transition:"none",controlsVariant:"toolbar",slidesPerView:1,slidesPerGroup:1},su,au=class extends ou{static{({e:[Sl,El,Rl,Al,Il,Cl,Dl,Ol,Vl,kl,Ml,Ll,Pl,jl,Fl,Bl,Ul,zl,ql,Kl,$l,Gl,Wl,Hl,Yl,Nl,Xl,Ql,Jl,Zl,eu,tu,iu,ru,wl],c:[su,Tl]}=DC(this,[LC("rui-carousel")],[[Se({type:String,defaultValue:Le.label}),0,"label"],[Se({type:Number,reflect:!0,defaultValue:0}),0,"index"],[Se({type:Boolean,reflect:!0,defaultValue:!1}),0,"autoplay"],[Se({type:Number,defaultValue:4e3}),0,"interval"],[Se({type:String,defaultValue:Le.transition}),0,"transition"],[Se({type:String,defaultValue:Le.controlsVariant,attribute:"controls-variant"}),0,"controlsVariant"],[Se({type:Boolean,defaultValue:!1}),0,"showIndicators"],[Se({type:Boolean,defaultValue:!1}),0,"showRotationControl"],[Se({type:Boolean,defaultValue:!0}),0,"loop"],[Se({type:Boolean,defaultValue:!0}),0,"wrap"],[[Se({type:Number,defaultValue:Le.slidesPerView,attribute:"slides-per-view"}),MC({ref:"root",attr:"data-carousel-surface",map:e=>Ri(e)})],0,"slidesPerView"],[Se({type:Number,defaultValue:Le.slidesPerGroup,attribute:"slides-per-group"}),0,"slidesPerGroup"],[Se({type:Number,defaultValue:0}),0,"slideCount"],[wr({ref:"root"}),0,"rootTarget"],[wr({ref:"track"}),0,"trackTarget"],[wr({ref:"indicators"}),0,"indicatorsTarget"],[wr({ref:"viewport"}),0,"viewportTarget"],[Wn(["index","transition","loop","wrap","controlsVariant","slidesPerView","slidesPerGroup"]),2,"onSlideStateUpdated"],[Wn(["autoplay","showRotationControl","interval"]),2,"onAutoplayUpdated"],[Wn(["showIndicators"]),2,"onIndicatorsUpdated"],[Ae({selector:'[data-carousel-action="prev"]',type:"click"}),2,"prev"],[Ae({selector:'[data-carousel-action="next"]',type:"click"}),2,"next"],[Ae({selector:'[data-carousel-action="rotation"]',type:"click"}),2,"toggleRotation"],[Ae({selector:"[data-carousel-indicator]",type:"click"}),2,"onIndicatorClick"],[Ae({selector:"[data-carousel-indicator]",type:"keydown"}),2,"onIndicatorKeydown"],[Ae({ref:"root",type:"pointerenter"}),2,"onRootPointerEnter"],[Ae({ref:"root",type:"pointerleave"}),2,"onRootPointerLeave"],[Ae({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[Ae({ref:"root",type:"focusout"}),2,"onRootFocusOut"],[Ae({ref:"viewport",type:"pointerdown"}),2,"onViewportPointerDown"],[Ae({ref:"viewport",type:"pointerup"}),2,"onViewportPointerUp"],[Ae({ref:"viewport",type:"pointercancel"}),2,"onViewportPointerCancel"]],0,void 0,ou))}label=(wl(this),Sl(this));index=(El(this),Rl(this));autoplay=(Al(this),Il(this));interval=(Cl(this),Dl(this));transition=(Ol(this),Vl(this));controlsVariant=(kl(this),Ml(this));showIndicators=(Ll(this),Pl(this));showRotationControl=(jl(this),Fl(this));loop=(Bl(this),Ul(this));wrap=(zl(this),ql(this));slidesPerView=(Kl(this),$l(this));slidesPerGroup=(Gl(this),Wl(this));slideCount=(Hl(this),Yl(this));rootTarget=(Nl(this),Xl(this));trackTarget=(Ql(this),Jl(this));indicatorsTarget=(Zl(this),eu(this));viewportTarget=(tu(this),iu(this));paused=(ru(this),!1);uid=re("rui-carousel");userOverrideReducedMotion=!1;swipe=new xr;autoplayController=new _r({getInterval:()=>this.interval,canRotate:()=>this.canAutoplayRotate(),onTick:()=>this.onAutoplayTick(),onRunningChange:()=>this.syncAriaLive()});onConnected(){this.autoplay&&this.prefersReducedMotion()&&(this.paused=!0),this.sync(),this.syncAutoplay(),this.syncIndicators(),this.syncAriaLive()}disconnectedCallback(){this.autoplayController.stop(),super.disconnectedCallback()}onSlideStateUpdated(){this.sync(),this.syncIndicators(),this.syncAutoplay()}onAutoplayUpdated(){this.syncAutoplay(),this.syncRotationControl()}onIndicatorsUpdated(){this.sync(),this.syncIndicators()}prefersReducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}slidePanelId(e,i){let r=e.getAttribute("data-slide")??String(i),s=`${this.uid}-panel-${r}`;return e.id=s,s}tabId(e){return`${this.uid}-tab-${e}`}getSlides(){return Array.from(this.querySelectorAll("[data-slide]"))}get shouldWrap(){return this.wrap&&this.loop}windowParams(e,i=this.index){return{index:i,count:e,slidesPerView:this.slidesPerView,slidesPerGroup:this.slidesPerGroup,wrap:this.shouldWrap}}windowFor(e){return Gn(this.windowParams(e))}trackMode(){return Ei(this.transition,this.slidesPerView)}syncSlideAccessibility(e,i,r){let s=e.length,d=this.trackMode();e.forEach((h,a)=>{let E=a===i,A=$n(a,i,s,r),S=`${a+1} of ${s}`;this.showIndicators&&r===1?(this.slidePanelId(h,a),h.setAttribute("role","tabpanel"),h.setAttribute("aria-labelledby",this.tabId(a)),h.setAttribute("aria-label",S),h.removeAttribute("aria-roledescription")):(h.setAttribute("role","group"),h.setAttribute("aria-roledescription","slide"),h.setAttribute("aria-label",S),h.removeAttribute("aria-labelledby"),h.removeAttribute("tabindex")),h.hidden=d==="swap"&&!E,h.setAttribute("aria-hidden",String(!A)),h.setAttribute("data-active",E?"true":"false")})}sync(){let e=this.getSlides();if(!e.length)return;let i=this.windowFor(e.length);i.index!==this.index&&(this.index=i.index);let r=this.rootTarget;r&&r.setAttribute("data-carousel-track",this.trackMode());let s=this.trackTarget;s&&(s.style.setProperty("--rui-carousel-index",String(i.index)),s.style.setProperty("--rui-carousel-slides-per-view",String(i.slidesPerView)),s.style.setProperty("--rui-carousel-gap-count",String(xl(i.slidesPerView))),s.style.setProperty("--rui-carousel-slide-count",String(e.length))),this.syncSlideAccessibility(e,i.index,i.slidesPerView),this.syncPrevNextDisabled(i)}syncPrevNextDisabled(e){let i=!this.shouldWrap&&!e.canGoPrev,r=!this.shouldWrap&&!e.canGoNext;for(let s of this.querySelectorAll('[data-carousel-action="prev"]'))this.shouldWrap?s.removeAttribute("disabled"):s.disabled=i;for(let s of this.querySelectorAll('[data-carousel-action="next"]'))this.shouldWrap?s.removeAttribute("disabled"):s.disabled=r}syncIndicators(){let e=this.indicatorsTarget;if(!e)return;let i=this.getSlides(),r=this.windowFor(i.length),s=r.slidesPerView===1,d=i.slice(0,r.maxStartIndex+1);e.setAttribute("role",s?"tablist":"group"),e.setAttribute("aria-label",s?"Choose slide to display":"Choose slide window"),Array.from(e.querySelectorAll("[data-carousel-indicator]")).length!==d.length&&e.replaceChildren(...d.map((A,S)=>{let I=document.createElement("button");return I.type="button",I.className="rui-carousel__indicator",I.id=this.tabId(S),I.setAttribute("data-carousel-indicator",String(S)),I}));let a=Array.from(e.querySelectorAll("[data-carousel-indicator]")),E=i.map((A,S)=>this.slidePanelId(A,S));a.forEach((A,S)=>{let I=S===r.index;A.id=this.tabId(S),A.setAttribute("aria-label",s?`Slide ${S+1}`:`Slide window ${S+1}`),A.setAttribute("aria-controls",E.filter((T,K)=>$n(K,S,i.length,r.slidesPerView)).join(" ")),s?(A.setAttribute("role","tab"),A.setAttribute("aria-selected",String(I)),A.removeAttribute("aria-current")):(A.removeAttribute("role"),A.removeAttribute("aria-selected"),I?A.setAttribute("aria-current","true"):A.removeAttribute("aria-current")),A.tabIndex=I?0:-1})}syncRotationControl(){for(let e of this.querySelectorAll('[data-carousel-action="rotation"]')){let i=this.autoplay&&!this.paused;e.setAttribute("aria-pressed",String(i)),e.setAttribute("aria-label",i?"Pause rotation":"Start rotation")}}syncAriaLive(){let e=this.viewportTarget;if(!e)return;let i=this.autoplay&&!this.paused&&this.autoplayController.isRunning;e.setAttribute("aria-live",i?"off":"polite"),e.setAttribute("aria-atomic","false")}canAutoplayRotate(){if(!this.autoplay||this.paused||this.prefersReducedMotion()&&!this.userOverrideReducedMotion)return!1;let e=this.getSlides();return e.length?this.windowFor(e.length).canGoNext:!1}onAutoplayTick(){let e=this.getSlides();if(!e.length)return;if(!this.windowFor(e.length).canGoNext){this.autoplayController.stop(),this.syncAriaLive();return}this.goTo(Ai(this.windowParams(e.length),1))}syncAutoplay(){this.autoplayController.sync(),this.syncRotationControl(),this.syncAriaLive()}goTo(e){let i=this.getSlides();i.length&&(this.index=Gn(this.windowParams(i.length,e)).index,this.sync(),this.syncIndicators())}userNavigate(e){this.paused=!0,this.autoplayController.stop();let i=this.getSlides();i.length&&this.goTo(Ai(this.windowParams(i.length),e))}isSwipeExcludedTarget(e){return e instanceof Element?!!e.closest("button, a, input, textarea, select, [data-carousel-indicator], [data-carousel-action]"):!1}prev(){this.userNavigate(-1)}next(){this.userNavigate(1)}toggleRotation(){this.autoplay?(this.paused=!this.paused,this.paused||(this.userOverrideReducedMotion=!0)):(this.autoplay=!0,this.paused=!1,this.userOverrideReducedMotion=!0),this.syncAutoplay()}onIndicatorClick(e){let i=e.target.closest("[data-carousel-indicator]");if(!i)return;let r=Number(i.getAttribute("data-carousel-indicator"));Number.isFinite(r)&&(this.paused=!0,this.autoplayController.stop(),this.goTo(r),i.focus())}onIndicatorKeydown(e){let i=this.getSlides();if(!i.length)return;let r=e.target.closest("[data-carousel-indicator]");if(!r)return;let s=Number(r.getAttribute("data-carousel-indicator"));if(!Number.isFinite(s))return;if(e.key==="ArrowRight")s=Ai({...this.windowParams(i.length,s),slidesPerGroup:1},1);else if(e.key==="ArrowLeft")s=Ai({...this.windowParams(i.length,s),slidesPerGroup:1},-1);else if(e.key==="Home")s=0;else if(e.key==="End")s=this.windowFor(i.length).maxStartIndex;else if(e.key===" "||e.key==="Enter"){e.preventDefault(),this.paused=!0,this.autoplayController.stop(),this.goTo(s);return}else return;e.preventDefault(),this.paused=!0,this.autoplayController.stop(),this.goTo(s),Array.from(this.indicatorsTarget?.querySelectorAll("[data-carousel-indicator]")??[])[this.index]?.focus()}onRootPointerEnter(e){this.autoplay&&e.pointerType==="mouse"&&this.autoplayController.stop()}onRootPointerLeave(e){this.autoplay&&!this.paused&&e.pointerType==="mouse"&&this.syncAutoplay()}onRootFocusIn(){this.autoplay&&this.autoplayController.stop()}onRootFocusOut(e){let i=e.relatedTarget;i&&this.contains(i)||this.autoplay&&!this.paused&&this.syncAutoplay()}onViewportPointerDown(e){this.swipe.onPointerDown(e,this.isSwipeExcludedTarget(e.target))}onViewportPointerUp(e){let i=this.swipe.onPointerUp(e);i==="next"?this.next():i==="prev"&&this.prev()}onViewportPointerCancel(e){this.swipe.onPointerCancel(e)}static{Tl()}};import{jsx as oe,jsxs as Lt}from"@ecopages/jsx/jsx-runtime";function lu({id:t,children:e,class:i,...r}){return oe("div",{...r,class:j("rui-carousel__slide",i),"data-slide":t,children:e})}function PC(){return Lt("span",{class:"rui-carousel__nav-label",children:[oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})}function jC(){return Lt("span",{class:"rui-carousel__nav-label",children:["Next",oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})}function uu({children:t,class:e,disabled:i,overlay:r,aria:s,...d}){return oe("button",{...d,aria:ne(s,"Previous slide"),type:"button","data-carousel-action":"prev","data-ref":"prev",class:j("rui-carousel__nav rui-button rui-button--outline rui-button--sm",r?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",e),disabled:i,children:t??(r?oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}):PC())})}function cu({children:t,class:e,disabled:i,overlay:r,aria:s,...d}){return oe("button",{...d,aria:ne(s,"Next slide"),type:"button","data-carousel-action":"next","data-ref":"next",class:j("rui-carousel__nav rui-button rui-button--outline rui-button--sm",r?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",e),disabled:i,children:t??(r?oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"}):jC())})}function du({children:t,class:e,overlay:i,aria:r,...s}){return oe("button",{...s,aria:ne(r,"Start rotation"),type:"button","data-carousel-action":"rotation","data-ref":"rotation",class:j("rui-carousel__rotation rui-button rui-button--ghost rui-button--sm",i&&"rui-carousel__rotation--overlay",e),"aria-pressed":!1,children:t??"Play"})}function FC({autoplay:t,children:e,controlsVariant:i,label:r,next:s,prev:d,rotation:h,showIndicators:a,showRotationControl:E,slidesPerView:A,transition:S}){let I=i==="overlay",T=t||E,K=d??oe(uu,{overlay:I}),$=s??oe(cu,{overlay:I}),V=T?h??oe(du,{overlay:I}):null,G=Ei(S,A),W=Ri(A),O=a?oe("div",{class:j("rui-carousel__indicators",I&&"rui-carousel__indicators--overlay"),"data-ref":"indicators",role:W==="shell"?"tablist":"group","aria-label":W==="shell"?"Choose slide to display":"Choose slide window"}):null,_=Lt("div",{class:"rui-carousel__toolbar",children:[T?oe("div",{class:"rui-carousel__toolbar-rotation",children:V}):null,oe("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--start",children:K}),oe("div",{class:"rui-carousel__toolbar-center",children:O}),oe("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--end",children:$})]}),H=I?Lt("div",{class:"rui-carousel__overlay-chrome",children:[T?oe("div",{class:"rui-carousel__overlay-rotation",children:V}):null,Lt("div",{class:"rui-carousel__controls rui-carousel__controls--overlay",children:[K,$]}),O]}):null;return Lt("section",{class:j("rui-carousel",`rui-carousel--${S}`,`rui-carousel--controls-${i}`),"data-ref":"root","data-carousel-track":G,"data-carousel-surface":W,"aria-roledescription":"carousel","aria-label":r,children:[oe("div",{class:"rui-carousel__stage",children:Lt("div",{class:"rui-carousel__viewport","data-ref":"viewport",children:[oe("div",{class:"rui-carousel__track","data-ref":"track",children:e}),H]})}),I?null:oe("div",{class:"rui-carousel__footer",children:_})]})}function BC({slides:t,children:e,prev:i,next:r,rotation:s,label:d=Le.label,transition:h=Le.transition,controlsVariant:a=Le.controlsVariant,showIndicators:E,showRotationControl:A,autoplay:S,slidesPerView:I=Le.slidesPerView,slidesPerGroup:T=Le.slidesPerGroup,...K}){let $=t??[],V=t!=null?$.map(G=>oe(lu,{id:G.id,children:G.children})):e;return oe("rui-carousel",{...K,label:d,transition:h,controlsVariant:a,showIndicators:E,showRotationControl:A,autoplay:S,slidesPerView:I,slidesPerGroup:T,slideCount:$.length,children:oe(FC,{autoplay:S,controlsVariant:a,label:d,next:r,prev:i,rotation:s,showIndicators:E,showRotationControl:A,slidesPerView:I,transition:h,children:V})})}import{RadiantElement as Au,bindTo as Ii,customElement as $C,event as GC,onEvent as WC,prop as Ci}from"@ecopages/radiant";function gt(t){return t||void 0}var hu,pu,fu,mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su,Eu;function UC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Ru(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ru(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:zC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return KC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function zC(t){var e=qC(t,"string");return typeof e=="symbol"?e:e+""}function qC(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ru(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function KC(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Hn="on",Tr,Iu=class extends Au{static{({e:[fu,mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su,Eu,hu],c:[Tr,pu]}=UC(this,[$C("rui-checkbox")],[[[Ci({type:Boolean,reflect:!0,defaultValue:!1}),Ii({ref:"input",prop:"checked"})],0,"checked"],[[Ci({type:Boolean,reflect:!0,defaultValue:!1}),Ii([{ref:"input",prop:"indeterminate"},{ref:"input",attr:"aria-checked",map:e=>e?"mixed":void 0}])],0,"indeterminate"],[[Ci({type:Boolean,reflect:!0,defaultValue:!1}),Ii({ref:"input",prop:"disabled"})],0,"disabled"],[[Ci({type:String,defaultValue:Hn}),Ii({ref:"input",prop:"value"})],0,"value"],[[Ci({type:String,defaultValue:""}),Ii({ref:"input",attr:"name",map:gt})],0,"name"],[GC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[WC({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,Au))}constructor(...e){super(...e),Eu(this)}checked=(hu(this),fu(this));indeterminate=(mu(this),gu(this));disabled=(bu(this),vu(this));value=(yu(this),_u(this));name=(xu(this),wu(this));changeEvent=(Tu(this),Su(this));onInputChange(e){let i=e.target;this.checked=i.checked,i.indeterminate=this.indeterminate,this.changeEvent.emit({checked:this.checked,indeterminate:this.indeterminate})}static{pu()}};import{jsx as Sr,jsxs as HC}from"@ecopages/jsx/jsx-runtime";function Di({children:t,checked:e,disabled:i,indeterminate:r,name:s,value:d=Hn,...h}){return Sr("rui-checkbox",{...h,checked:e,disabled:i,indeterminate:r,name:s,value:d,"data-disabled":i?"":void 0,children:HC("label",{class:"rui-checkbox",children:[Sr("input",{type:"checkbox","data-ref":"input","data-rui-control":!0,"data-rui-control-type":"boolean",class:"rui-checkbox__input",checked:e,disabled:i,value:d,name:s||void 0,"aria-checked":r?"mixed":void 0}),Sr("span",{class:"rui-checkbox__control","aria-hidden":"true"}),Sr("span",{class:"rui-checkbox__label",children:t})]})})}import{RadiantElement as Hu,bindTo as Yn,customElement as eD,event as tD,onEvent as iD,onUpdated as rD,prop as Oi}from"@ecopages/radiant";function Cu(t){return t?Ou(t.split(",")):[]}function YC(t){return t.join(",")}var Er={fromAttribute:t=>Cu(t),toAttribute:t=>t.length>0?YC(t):null,fromProperty:t=>Array.isArray(t)?Ou(t.map(String)):typeof t=="string"?Cu(t):[]},Ie={type:Array,reflect:!0,transform:Er};function et(t){return Er.fromProperty?.(t)??[]}function Du(t){return t?t.split(",").map(e=>Number(e.trim())).filter(e=>Number.isFinite(e)):[]}function NC(t){return t.join(",")}var Rr={fromAttribute:t=>Du(t),toAttribute:t=>t.length>0?NC(t):null,fromProperty:t=>Array.isArray(t)?t.map(Number).filter(e=>Number.isFinite(e)):typeof t=="number"&&Number.isFinite(t)?[t]:typeof t=="string"?Du(t):[]};function Ou(t){return[...new Set(t.map(e=>e.trim()).filter(Boolean))]}var Vu,ku,Mu,Lu,Pu,ju,Fu,Bu,Uu,zu,qu,Ku,$u,Gu;function XC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Wu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Wu(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:QC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ZC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function QC(t){var e=JC(t,"string");return typeof e=="symbol"?e:e+""}function JC(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wu(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ZC(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Nu,Yu=class extends Hu{static{({e:[Mu,Lu,Pu,ju,Fu,Bu,Uu,zu,qu,Ku,$u,Gu,Vu],c:[Nu,ku]}=XC(this,[eD("rui-checkbox-group")],[[Oi({...Ie,defaultValue:[]}),0,"value"],[Oi({type:String,defaultValue:""}),0,"name"],[[Oi({type:String,defaultValue:""}),Yn({selector:"[data-checkbox-group-root]",attr:"aria-label",map:gt})],0,"label"],[[Oi({type:Boolean,reflect:!0,defaultValue:!1}),Yn({selector:"[data-checkbox-group-root]",attr:"aria-disabled",map:e=>e?"true":void 0})],0,"disabled"],[[Oi({type:String,reflect:!0,defaultValue:"vertical"}),Yn({selector:"[data-checkbox-group-root]",attr:"data-orientation"})],0,"orientation"],[tD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[rD(["value","name","disabled"]),2,"syncCheckboxes"],[iD({selector:"rui-checkbox",type:"rui-change"}),2,"onCheckboxChange"]],0,void 0,Hu))}constructor(...e){super(...e),Gu(this)}value=(Vu(this),Mu(this));name=(Lu(this),Pu(this));label=(ju(this),Fu(this));disabled=(Bu(this),Uu(this));orientation=(zu(this),qu(this));changeEvent=(Ku(this),$u(this));onConnected(){this.syncCheckboxes()}syncCheckboxes(){let e=new Set(this.value),i=this.name||this.getAttribute("name")||"";for(let r of this.getCheckboxes())r.checked=e.has(r.value),r.disabled=this.disabled||r.hasAttribute("data-disabled"),i&&(r.name=i)}onCheckboxChange(e){e.stopImmediatePropagation();let i=this.getCheckboxes().filter(r=>r.checked).map(r=>r.value);this.value=i,this.changeEvent.emit({value:this.value})}getCheckboxes(){return Array.from(this.querySelectorAll("rui-checkbox")).filter(e=>e instanceof Tr)}static{ku()}};import{jsx as Ar}from"@ecopages/jsx/jsx-runtime";function Xu({children:t,class:e,orientation:i="vertical",...r}){return Ar("div",{...r,"data-checkbox-group-root":!0,"data-orientation":i,class:j("rui-checkbox-group",e),role:"group","data-rui-control":!0,"data-rui-control-type":"text",children:t})}function nD({options:t,children:e,value:i,orientation:r="vertical",...s}){let d=et(i),h=new Set(d);return Ar("rui-checkbox-group",{...s,value:d,orientation:r,children:t==null?e:Ar(Xu,{orientation:r,children:t.map(a=>Ar(Di,{value:a.value,disabled:a.disabled,checked:h.has(a.value),children:a.label}))})})}import{jsx as oD}from"@ecopages/jsx/jsx-runtime";function aD({children:t,variant:e="default",class:i,...r}){return oD("span",{...r,class:j("rui-chip",`rui-chip--${e}`,i),children:t})}import{jsx as Qu}from"@ecopages/jsx/jsx-runtime";function sD({children:t,class:e,...i}){return Qu("ul",{...i,class:j("rui-chip-list",e),children:t})}function lD({children:t,class:e,...i}){return Qu("li",{...i,class:j("rui-chip-list__item",e),children:t})}import{RadiantElement as Ac,bindTo as TD,customElement as SD,event as ED,onEvent as Pe,onUpdated as RD,prop as jt,query as AD}from"@ecopages/radiant";function Vi(t){let e=t.previousElementSibling;return e?.tagName.toLowerCase()==="label"?e:t.parentElement?.querySelector("[data-rui-field-label]")??null}function Nn(t,e,i){t.id||(t.id=i.labelId),t.htmlFor||(t.htmlFor=i.controlId),e.setAttribute("aria-labelledby",t.id),e.removeAttribute("aria-label")}function qe(t,e,i){if(!e||e.hasAttribute("data-rui-field-managed"))return;let r=Vi(t);if(r){Nn(r,e,i);return}if(i.label){e.setAttribute("aria-label",i.label),e.removeAttribute("aria-labelledby");return}e.removeAttribute("aria-label"),e.removeAttribute("aria-labelledby")}var uD="data-listbox-option-indicator";function Pt(t){let e=t.getAttribute("data-label");return e||Ju(t).trim()}function Ce(t){return t.getAttribute("data-value")||Pt(t)}function Ju(t){if(cD(t))return"";if(t.nodeType===Node.TEXT_NODE)return t.textContent??"";let e="";for(let i of t.childNodes)e+=Ju(i);return e}function cD(t){return t instanceof HTMLElement&&t.hasAttribute(uD)}var Jt=class{config;constructor(e){this.config=e}getListboxHost(){return this.config.getRoot()?.querySelector("rui-listbox")??null}getListbox(){let e=this.getListboxHost();return e?e.querySelector('[role="listbox"]')??e:this.config.getPopup?.()??null}getOptions(){let e=this.getListbox();return e?Array.from(e.querySelectorAll('[role="option"]')):[]}getSelectedValues(){return this.config.getValue()}setSelectedValues(e){this.config.setValue(e)}toggleValue(e){if(this.config.getSelectionMode()==="multiple"){let i=new Set(this.getSelectedValues());i.has(e)?i.delete(e):i.add(e),this.setSelectedValues([...i]);return}this.setSelectedValues([e])}removeValue(e){let i=new Set(this.getSelectedValues());return i.delete(e)?(this.setSelectedValues([...i]),!0):!1}clearValues(){return this.getSelectedValues().length===0?!1:(this.setSelectedValues([]),!0)}findOption(e){return e instanceof Element?e.closest('[role="option"]')??null:null}isSelectableOption(e){return e!=null&&e.getAttribute("aria-disabled")!=="true"&&!e.hidden}syncListboxHost(){let e=this.getListboxHost();e&&(e.embedded=!0,e.selectionMode=this.config.getSelectionMode(),e.value=this.config.getValue())}syncOptionSelection(){let e=new Set(this.getSelectedValues());for(let i of this.getOptions())i.setAttribute("aria-selected",String(e.has(Ce(i))))}syncMultiselectable(e){if(e){if(this.config.getSelectionMode()==="multiple"){e.setAttribute("aria-multiselectable","true");return}e.removeAttribute("aria-multiselectable")}}getTagGroup(){let e=this.config.tagGroupSelector;if(!e)return null;let i=this.config.getRoot()?.querySelector(e)??null;return!i||typeof i.setItems!="function"?null:i}syncTagGroup(){let e=this.getTagGroup();if(!e)return;let i=this.getSelectedValues().flatMap(r=>{let s=this.getOptions().find(d=>Ce(d)===r);return s?[{value:r,label:Pt(s)}]:[]});e.embedded=!0,e.setItems(i),e.value=this.config.getValue()}labelForValue(e){let i=this.getOptions().find(r=>Ce(r)===e);return i?Pt(i):e}};var dD={top:"bottom",bottom:"top",left:"right",right:"left"},hD=8,Xn=new WeakMap;function pD(t){Xn.has(t)&&(t.style.width="",t.style.minWidth="",t.style.maxWidth="",t.style.boxSizing="",Xn.delete(t))}function fD(t){let e=t.indexOf("-");if(e===-1)return{side:t,align:"center"};let i=t.slice(0,e),r=t.slice(e+1);return{side:i,align:r==="start"||r==="end"?r:"center"}}function tc(t){return t==="top"||t==="bottom"?"y":"x"}function Zu(t,e,i,r,s){let{width:d,height:h}=e,a=0,E=0;switch(i){case"top":E=t.top-h-s;break;case"bottom":E=t.bottom+s;break;case"left":a=t.left-d-s;break;case"right":a=t.right+s;break}return tc(i)==="y"?r==="start"?a=t.left:r==="end"?a=t.right-d:a=t.left+(t.width-d)/2:r==="start"?E=t.top:r==="end"?E=t.bottom-h:E=t.top+(t.height-h)/2,{x:a,y:E}}function mD(t,e,i,r){let{padding:s,width:d,height:h}=r;return i==="top"?Math.max(0,s-t.y):i==="bottom"?Math.max(0,t.y+e.height-(h-s)):i==="left"?Math.max(0,s-t.x):Math.max(0,t.x+e.width-(d-s))}function ec(t,e,i,r){let{padding:s,width:d,height:h}=r;return i==="top"?t.top-s-e.height:i==="bottom"?h-s-e.height-t.bottom:i==="left"?t.left-s-e.width:d-s-e.width-t.right}function gD(t,e){return e==="center"?t:`${t}-${e}`}function bD(t,e,i,r){let{padding:s,width:d,height:h}=r;if(tc(i)==="y"){let E=Math.max(s,d-s-e.width);return{x:Math.min(Math.max(t.x,s),E),y:Math.max(s,t.y)}}let a=Math.max(s,h-s-e.height);return{x:Math.max(s,t.x),y:Math.min(Math.max(t.y,s),a)}}function vD(t,e,i,r,s={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:hD}){let{side:d,align:h}=fD(i),a=Zu(t,e,d,h,r),E=mD(a,e,d,s),A=d,S=a;if(E>0){let I=dD[d],T=Zu(t,e,I,h,r),K=ec(t,e,d,s);ec(t,e,I,s)>K&&(A=I,S=T)}return{coords:bD(S,e,A,s),placement:gD(A,h)}}function Qn(t,e,i,r,s={}){let d=s.matchAnchorWidth===!0,h=t.offsetWidth,a=d?{width:h,height:e.offsetHeight}:{width:e.offsetWidth,height:e.offsetHeight};d?(e.style.width=`${h}px`,e.style.minWidth=`${h}px`,e.style.maxWidth=`${h}px`,e.style.boxSizing="border-box",Xn.set(e,!0)):pD(e);let{coords:E,placement:A}=vD(t.getBoundingClientRect(),a,i,r);return Object.assign(e.style,{position:"fixed",left:`${E.x}px`,top:`${E.y}px`,right:"auto",bottom:"auto",visibility:"visible"}),e.setAttribute("data-placement",A),A}function Ir({anchor:t,floating:e,getPlacement:i,gap:r,matchAnchorWidth:s}){let d=()=>{e.hidden||Qn(t,e,i(),r,{matchAnchorWidth:s})};d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0);let h=new ResizeObserver(d);return h.observe(t),h.observe(e),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0),h.disconnect()}}function ic(t,e=document.body){let i=t.parentNode;if(!i)return{unmount:()=>{}};let r=document.createComment("rui-portal");return i.insertBefore(r,t),e.appendChild(t),{unmount:()=>{let s=r.parentNode;s&&(s.insertBefore(t,r),r.remove())}}}function Jn(t,e,i){return i?!!(t?.contains(i)||e?.contains(i)):!1}function tt(t,e,i){return i instanceof Node?!Jn(t,e,i):!0}function Ke(t,e,i){return!Jn(t,e,i)}var ce=class{config;cleanupFloating=null;portalHandle=null;floatingElement=null;constructor(e){this.config=e}updateConfig(e){this.config={...this.config,...e}}sync(){let e=this.resolveFloating();if(!e)return;if(!this.config.getOpen()){this.teardown(),e.toggleAttribute("hidden",!0);return}let r=this.config.getAnchor();if(!r)return;e.toggleAttribute("hidden",!1),this.config.portal!==!1?this.portalHandle||(this.portalHandle=ic(e,this.config.portalContainer??document.body)):this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null),this.teardownFloating(),this.cleanupFloating=Ir({anchor:r,floating:e,getPlacement:this.config.getPlacement,gap:this.config.gap??8,matchAnchorWidth:this.config.matchAnchorWidth})}contains(e){return Jn(this.config.getAnchor(),this.resolveFloating(),e)}getFloatingElement(){return this.resolveFloating()}teardown(){this.teardownFloating(),this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null)}destroy(){this.teardown(),this.floatingElement=null}resolveFloating(){let e=this.config.getFloating();return e&&(this.floatingElement=e),e??this.floatingElement}teardownFloating(){this.cleanupFloating?.(),this.cleanupFloating=null}};function rc(t){return t.filter(e=>!e.hidden&&e.getAttribute("aria-disabled")!=="true")}function nc(t,e,i){return i===0?-1:e===1?t>=i-1?0:t+1:t<=0?i-1:t-1}function Zn(t,e){e?.removeAttribute("aria-activedescendant");for(let i of t)i.removeAttribute("data-active")}function oc(t,e,i,r,s){Zn(t,r);let d=e[i];return!d||!r?null:(d.id||(d.id=`${s}-${i}`),d.setAttribute("data-active","true"),r.setAttribute("aria-activedescendant",d.id),d.scrollIntoView({block:"nearest"}),d)}var Zt=class{config;popoverController;activeIndex=-1;visualFocus=!1;constructor(e){this.config=e,this.popoverController=new ce({getAnchor:e.getAnchor,getFloating:e.getFloating,getOpen:e.getOpen,getPlacement:()=>"bottom-start",gap:4,portal:!1,matchAnchorWidth:!0})}get activeOptionIndex(){return this.activeIndex}get hasVisualFocus(){return this.visualFocus}ensureOptionIds(){this.config.getOptions().forEach((e,i)=>{e.id||(e.id=`${this.config.getOptionIdPrefix()}-${i}`)})}getVisibleOptions(){return rc(this.config.getOptions())}clearActiveOption(){this.activeIndex=-1,this.visualFocus=!1,Zn(this.config.getOptions(),this.config.getActiveDescendantHost())}setActiveOption(e){let i=this.getVisibleOptions();if(e<0||e>=i.length){this.clearActiveOption();return}this.activeIndex=e,this.visualFocus=!0,oc(this.config.getOptions(),i,e,this.config.getActiveDescendantHost(),this.config.getOptionIdPrefix())}moveActive(e,i){let r=this.getVisibleOptions();if(r.length){if(!this.config.getOpen()){i(e===1?"first":"last");return}if(this.visualFocus){this.setActiveOption(nc(this.activeIndex,e,r.length));return}this.setActiveOption(e===1?0:r.length-1)}}handleKeydown(e,i){if(e.ctrlKey||e.shiftKey||e.metaKey)return;this.keydownHandlers[e.key]?.call(this,e,i)}keydownHandlers={ArrowDown:this.handleArrowKey,ArrowUp:this.handleArrowKey,Escape:this.handleEscapeKey,Enter:this.handleActivationKey," ":this.handleActivationKey,Tab:this.handleTabKey};handleArrowKey(e,i){e.preventDefault(),e.stopPropagation();let r=e.key==="ArrowDown"?1:-1;if(e.altKey){this.handleModifiedArrow(r,i);return}this.moveActive(r,s=>i.onOpen(s))}handleModifiedArrow(e,i){e===1&&!i.isOpen&&i.onOpen(),e===-1&&i.isOpen&&i.onClose("arrow")}handleEscapeKey(e,i){e.preventDefault(),i.isOpen?i.onClose("escape"):i.onEscapeWhenClosed?.()}handleActivationKey(e,i){if(!(e.key===" "&&!i.canUseSpace)){if(!i.isOpen&&i.enterWhenClosed==="open"){e.preventDefault(),i.onOpen();return}if(i.isOpen){if(this.hasActiveOption()){e.preventDefault(),i.onSelectActive();return}e.key==="Enter"&&i.enterWithoutActive==="close"&&(e.preventDefault(),i.onClose("enter"))}}}handleTabKey(e,i){i.isOpen&&(this.hasActiveOption()&&i.closesOnTab?i.onSelectActive():i.onClose("tab"))}hasActiveOption(){return this.visualFocus&&!!this.getVisibleOptions()[this.activeIndex]}syncPopoverPosition(){this.popoverController.sync()}shouldDismissFocus(e){return tt(this.config.getAnchor(),this.popoverController.getFloatingElement(),e)}shouldDismissPointer(e){return Ke(this.config.getAnchor(),this.popoverController.getFloatingElement(),e)}destroy(){this.popoverController.destroy()}};var ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Tc,Sc,Ec;function yD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Rc(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Rc(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:_D(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function _D(t){var e=xD(t,"string");return typeof e=="symbol"?e:e+""}function xD(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rc(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function wD(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Cc,Ic=class extends Ac{static{({e:[lc,uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Tc,Sc,Ec,ac],c:[Cc,sc]}=yD(this,[SD("rui-combobox")],[[jt({...Ie,defaultValue:[]}),0,"value"],[jt({type:String,defaultValue:""}),0,"label"],[jt({type:String,defaultValue:""}),0,"placeholder"],[[jt({type:Boolean,reflect:!0,defaultValue:!1}),TD({selector:"[data-combobox-clear]",prop:"disabled"})],0,"disabled"],[jt({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[jt({type:Boolean,attribute:"should-close-on-select"}),0,"shouldCloseOnSelect"],[jt({type:String,attribute:"trigger-kind",reflect:!0,defaultValue:"input"}),0,"triggerKind"],[ED({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[AD({ref:"root"}),0,"rootTarget"],[RD(["value","label","placeholder","disabled","triggerKind","selectionMode","shouldCloseOnSelect"]),2,"onPropsUpdated"],[Pe({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[Pe({ref:"root",type:"input"}),2,"onRootInput"],[Pe({ref:"root",type:"keydown",options:{capture:!0}}),2,"onRootKeydown"],[Pe({selector:"[data-combobox-trigger]",type:"click"}),2,"onTriggerClick"],[Pe({selector:'[data-combobox-listbox] [role="option"]',type:"pointerover"}),2,"onOptionPointerOver"],[Pe({selector:'[data-combobox-listbox] [role="option"]',type:"mousedown"}),2,"onOptionMouseDown"],[Pe({selector:'[data-combobox-listbox] [role="option"]',type:"click"}),2,"onOptionClick"],[Pe({selector:"[data-combobox-value] rui-tag-group",type:"rui-remove"}),2,"onTagRemove"],[Pe({selector:"[data-combobox-clear]",type:"click"}),2,"onClearClick"],[Pe({ref:"root",type:"focusout"}),2,"onFocusOut"],[Pe({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"]],0,void 0,Ac))}constructor(...e){super(...e),Ec(this)}value=(ac(this),lc(this));label=(uc(this),cc(this));placeholder=(dc(this),hc(this));disabled=(pc(this),fc(this));selectionMode=(mc(this),gc(this));shouldCloseOnSelect=(bc(this),vc(this));triggerKind=(yc(this),_c(this));changeEvent=(xc(this),wc(this));open=(Tc(this),!1);uid=re("rui-combobox");collection=new Jt({getRoot:()=>this,getSelectionMode:()=>this.selectionMode,getValue:()=>this.value,setValue:e=>{this.value=e},getPopup:()=>this.getListboxPopup(),tagGroupSelector:"[data-combobox-value] rui-tag-group"});listboxBehavior=new Zt({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.collection.getOptions(),getActiveDescendantHost:()=>this.getInput(),getOptionIdPrefix:()=>`${this.uid}-option`});rootTarget=Sc(this);get listboxId(){return`${this.uid}-list`}get inputId(){return`${this.uid}-input`}isMultiple(){return this.selectionMode==="multiple"}closesOnSelect(){return this.shouldCloseOnSelect??!this.isMultiple()}getInput(){return this.querySelector("[data-combobox-input]")}getTrigger(){return this.querySelector("[data-combobox-trigger]")}getClear(){return this.querySelector("[data-combobox-clear]")}getListboxPopup(){return this.querySelector("[data-combobox-listbox]")}ensureOptionIds(){this.listboxBehavior.ensureOptionIds()}getAccessibleName(){return Vi(this)?.textContent?.trim()||this.label||"Suggestions"}isComboboxInput(e){return e instanceof HTMLElement&&e.localName==="input"&&e.hasAttribute("data-combobox-input")}syncLabel(){let e=this.getInput();qe(this,e,{controlId:this.inputId,label:this.label,labelId:`${this.uid}-label`})}syncTrigger(){let e=this.getTrigger(),i=this.collection.getListbox();!e||!i||(e.setAttribute("aria-expanded",String(this.open)),e.setAttribute("aria-controls",i.id||this.listboxId),e.tabIndex=-1,this.disabled&&(e.disabled=!0))}syncInput(){let e=this.getInput(),i=this.collection.getListbox(),r=this.getListboxPopup();!e||!i||(e.id||(e.id=this.inputId),i.id||(i.id=this.listboxId),e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",String(this.open)),e.setAttribute("aria-controls",this.listboxId),i.setAttribute("aria-label",this.getAccessibleName()),this.collection.syncMultiselectable(i),r&&(r.removeAttribute("role"),r.removeAttribute("aria-label")),this.placeholder&&(e.placeholder=this.isMultiple()&&this.collection.getSelectedValues().length?"":this.placeholder),this.disabled&&(e.disabled=!0),this.syncClear(),this.syncTrigger())}syncClear(){let e=this.getClear();e&&(e.hidden=this.collection.getSelectedValues().length===0&&!(this.getInput()?.value??""))}setVisualFocusCombobox(){this.listboxBehavior.clearActiveOption(),this.collection.syncOptionSelection()}setOpen(e,i={}){let r=i.activate??"none";this.open=e;let s=this.getInput(),d=this.getListboxPopup();if(!(!s||!d)){if(s.setAttribute("aria-expanded",String(e)),d.toggleAttribute("hidden",!e),this.syncTrigger(),!e){this.listboxBehavior.clearActiveOption(),this.listboxBehavior.syncPopoverPosition();return}if(this.ensureOptionIds(),this.listboxBehavior.syncPopoverPosition(),r==="first"){let h=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(h.length?0:-1);return}if(r==="last"){let h=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(h.length?h.length-1:-1);return}this.listboxBehavior.clearActiveOption()}}getAutocomplete(){return this.querySelector("rui-autocomplete")}syncAutocompleteFilter(){let e=this.getAutocomplete();if(e){e.syncFilter();return}let i=this.getInput()?.value??"";for(let r of this.collection.getOptions()){let s=fr(Pt(r),i,"base");r.hidden=i.trim()!==""&&!s}}showAllOptions(){for(let e of this.collection.getOptions())e.hidden=!1}syncFilter(){this.syncAutocompleteFilter()}select(e){if(!this.collection.isSelectableOption(e))return;let i=Ce(e),r=Pt(e)||i;this.collection.toggleValue(i);let s=this.getInput();s&&(s.value=this.isMultiple()?"":r),this.collection.syncTagGroup(),this.syncInput(),this.collection.syncOptionSelection(),this.changeEvent.emit({value:this.value}),this.closesOnSelect()&&this.setOpen(!1),this.syncFilter(),s?.focus()}syncFromValue(){let e=this.getInput();if(!e)return;if(this.isMultiple()){e.value="";return}let i=this.collection.getSelectedValues()[0]??"";e.value=i?this.collection.labelForValue(i):""}removeSelectedValue(e){this.collection.removeValue(e)&&(this.collection.syncTagGroup(),this.syncInput(),this.collection.syncOptionSelection(),this.changeEvent.emit({value:this.value}),this.getInput()?.focus())}clearSelection(){let e=this.getInput(),i=this.value.length>0,r=!!e?.value;this.collection.clearValues(),e&&(e.value=""),this.syncFilter(),this.syncInput(),this.collection.syncTagGroup(),this.collection.syncOptionSelection(),i&&this.changeEvent.emit({value:[]}),(r||i)&&e?.focus()}initialize(){this.ensureOptionIds(),this.syncLabel(),this.syncInput(),this.collection.syncListboxHost(),this.syncFromValue(),this.collection.syncOptionSelection(),this.collection.syncTagGroup(),this.setOpen(!1)}onConnected(){this.initialize()}disconnectedCallback(){this.listboxBehavior.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.syncLabel(),this.syncInput(),this.collection.syncListboxHost(),this.syncFromValue(),this.collection.syncOptionSelection(),this.collection.syncTagGroup()}onRootFocusIn(e){this.triggerKind!=="focus"||!this.isComboboxInput(e.target)||e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||(this.syncFilter(),this.setOpen(!0),this.setVisualFocusCombobox())}onRootInput(e){if(!this.isComboboxInput(e.target))return;let i=e.target;this.syncFilter();let r=i.value.trim()!=="",s=this.listboxBehavior.getVisibleOptions().length>0;r&&s&&(this.open||this.triggerKind!=="manual")?this.setOpen(!0):!r&&this.triggerKind==="focus"?this.setOpen(!0):(!r||!s)&&this.setOpen(!1),this.setVisualFocusCombobox()}onRootKeydown(e){this.isComboboxInput(e.target)&&this.handleInputKeydown(e)}handleInputKeydown(e){if(e.key==="Home"){let i=this.getInput();if(!i)return;e.preventDefault(),i.setSelectionRange(0,0),this.setVisualFocusCombobox();return}if(e.key==="End"){let i=this.getInput();if(!i)return;e.preventDefault();let r=i.value.length;i.setSelectionRange(r,r),this.setVisualFocusCombobox();return}(e.key==="ArrowDown"||e.key==="ArrowUp")&&(this.syncFilter(),this.listboxBehavior.getVisibleOptions().length||this.showAllOptions()),this.listboxBehavior.handleKeydown(e,{isOpen:this.open,canUseSpace:!1,closesOnTab:!0,enterWhenClosed:"ignore",enterWithoutActive:"close",onOpen:(i="none")=>{this.syncFilter(),this.setOpen(!0,{activate:i})},onClose:()=>this.setOpen(!1),onSelectActive:()=>{let i=this.listboxBehavior.getVisibleOptions()[this.listboxBehavior.activeOptionIndex];i&&this.select(i)},onEscapeWhenClosed:()=>{let i=this.getInput();i&&i.value&&(i.value="",this.value=[],this.changeEvent.emit({value:[]}),this.syncFilter())}})}onTriggerClick(e){e.preventDefault();let i=this.getInput();!i||i.disabled||(this.open?this.setOpen(!1):(this.syncFilter(),this.setOpen(!0),this.setVisualFocusCombobox()),i.focus())}onOptionPointerOver(e){if(!this.open)return;let i=this.collection.findOption(e.target);if(!this.collection.isSelectableOption(i))return;let s=this.listboxBehavior.getVisibleOptions().indexOf(i);s>=0&&this.listboxBehavior.setActiveOption(s)}onOptionMouseDown(e){e.preventDefault()}onOptionClick(e){let i=this.collection.findOption(e.target);i&&this.select(i)}onTagRemove(e){let i=e.detail;i?.value&&this.removeSelectedValue(i.value)}onClearClick(e){e.preventDefault(),e.stopPropagation(),this.clearSelection()}onFocusOut(e){this.listboxBehavior.shouldDismissFocus(e.relatedTarget)&&this.setOpen(!1)}onDocumentPointerDown(e){this.open&&this.listboxBehavior.shouldDismissPointer(e.target)&&this.setOpen(!1)}static{sc()}};import{jsx as ae,jsxs as io}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Hc,bindTo as kD,customElement as MD,event as LD,onEvent as Yc,onUpdated as PD,prop as ti}from"@ecopages/radiant";function ue(t,e){t.forEach((i,r)=>{let s=r===e?0:-1;i.tabIndex!==s&&(i.tabIndex=s)})}function ei(t,e){if(!t.length)return null;let i=Math.max(0,Math.min(t.length-1,e));return ue(t,i),t[i]?.focus(),t[i]??null}function ID(t,e){return t==="Home"?"first":t==="End"?"last":e==="horizontal"?t==="ArrowRight"?"next":t==="ArrowLeft"?"prev":null:t==="ArrowDown"?"next":t==="ArrowUp"?"prev":null}function de(t){let{items:e,current:i,key:r,orientation:s="horizontal",wrap:d=!0}=t;if(!e.length||!i)return{handled:!1};let h=e.indexOf(i);if(h<0)return{handled:!1};let a=ID(r,s);if(!a)return{handled:!1};let E=h;a==="first"?E=0:a==="last"?E=e.length-1:a==="next"?E=d?(h+1)%e.length:Math.min(e.length-1,h+1):E=d?(h-1+e.length)%e.length:Math.max(0,h-1);let A=ei(e,E);return A?{handled:!0,index:E,item:A}:{handled:!1}}var Dc,Oc,Vc,kc,Mc,Lc,Pc,jc,Fc,Bc,Uc,zc,qc,Kc,$c,Gc;function CD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Wc(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Wc(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:DD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return VD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function DD(t){var e=OD(t,"string");return typeof e=="symbol"?e:e+""}function OD(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wc(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function VD(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Xc,Nc=class extends Hc{static{({e:[Vc,kc,Mc,Lc,Pc,jc,Fc,Bc,Uc,zc,qc,Kc,$c,Gc,Dc],c:[Xc,Oc]}=CD(this,[MD("rui-listbox")],[[ti({...Ie,defaultValue:[]}),0,"value"],[ti({type:String,defaultValue:""}),0,"label"],[ti({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[[ti({type:String,attribute:"selection-mode",defaultValue:"single"}),kD({selector:'[role="listbox"]',attr:"aria-multiselectable",map:e=>e==="multiple"?"true":void 0})],0,"selectionMode"],[ti({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[ti({type:Boolean,reflect:!0}),0,"bordered"],[LD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[PD(["value","label","disabled","embedded","selectionMode"]),2,"onPropsUpdated"],[Yc({selector:'[role="option"]',type:"click"}),2,"onOptionClick"],[Yc({selector:'[role="option"]',type:"keydown"}),2,"onOptionKeydown"]],0,void 0,Hc))}value=(Dc(this),Vc(this));label=(kc(this),Mc(this));disabled=(Lc(this),Pc(this));selectionMode=(jc(this),Fc(this));embedded=(Bc(this),Uc(this));bordered=(zc(this),qc(this));changeEvent=(Kc(this),$c(this));uid=(Gc(this),re("rui-listbox"));onConnected(){this.syncLabel(),this.sync()}onPropsUpdated(){this.syncLabel(),this.sync()}getOptions(){return Array.from(this.querySelectorAll('[role="option"]'))}syncLabel(){if(this.embedded)return;let e=this.querySelector('[role="listbox"]');e&&(e.id||(e.id=`${this.uid}-list`),qe(this,e,{controlId:e.id,label:this.label,labelId:`${this.uid}-label`}))}getSelectedValues(){return this.value}setSelectedValues(e){this.value=e}tabIndexFor(e,i){return this.embedded?-1:e===i?0:-1}sync(){let e=this.getOptions(),i=new Set(this.getSelectedValues()),r=e.find(s=>i.has(Ce(s)))??e[0];for(let s of e){let d=i.has(Ce(s));s.setAttribute("aria-selected",String(d)),s.tabIndex=this.tabIndexFor(s,r)}}select(e){if(this.disabled||e.getAttribute("aria-disabled")==="true")return;let i=Ce(e);if(this.selectionMode==="multiple"){let r=new Set(this.getSelectedValues());r.has(i)?r.delete(i):r.add(i),this.setSelectedValues([...r])}else this.setSelectedValues([i]);this.sync(),this.changeEvent.emit({value:this.value}),e.focus()}onOptionClick(e){if(this.embedded)return;let i=e.target.closest('[role="option"]');i&&this.contains(i)&&this.select(i)}onOptionKeydown(e){if(this.embedded)return;let i=this.getOptions(),r=e.target.closest('[role="option"]');if(!r)return;if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.select(r);return}let s=de({items:i,current:r,key:e.key,orientation:"vertical"});if(s.handled){if(e.preventDefault(),this.selectionMode==="multiple"){s.item.focus();return}this.select(s.item)}}static{Oc()}};import{jsx as Ft,jsxs as jD}from"@ecopages/jsx/jsx-runtime";function eo({value:t,label:e,children:i,class:r,disabled:s,...d}){return Ft("div",{...d,class:j("rui-listbox__option",r),role:"option","data-value":t,"data-label":e,"aria-disabled":s?"true":void 0,tabindex:-1,children:i})}function Qc({children:t,class:e,...i}){return Ft("span",{...i,"data-listbox-option-indicator":!0,"aria-hidden":"true",class:j("rui-listbox__option-indicator",e),children:t??Ft(wi,{})})}function FD(t,e){return e??!t}function BD({bordered:t,children:e,disabled:i,embedded:r,label:s,selectionMode:d="single"}){return Ft("div",{class:j("rui-listbox",t&&"rui-listbox--bordered"),role:"listbox","data-rui-control":r?void 0:!0,"data-rui-control-type":r?void 0:"text","aria-label":s||void 0,"aria-disabled":i?"true":void 0,"aria-multiselectable":d==="multiple"?"true":void 0,children:e})}function ii({options:t,children:e,value:i,embedded:r,bordered:s,label:d,disabled:h,selectionMode:a="single",...E}){let A=FD(r,s),S=et(i),I=new Set(S);return Ft("rui-listbox",{...E,value:S,embedded:r,bordered:s,label:d,disabled:h,selectionMode:a,children:Ft(BD,{bordered:A,disabled:h,embedded:r,label:d,selectionMode:a,children:t!=null?t.map(T=>jD(eo,{value:T.value,label:typeof T.label=="string"?T.label:void 0,disabled:T.disabled,"aria-selected":I.has(T.value)?"true":void 0,children:[T.label,a==="multiple"?Ft(Qc,{}):null]})):e})})}import{RadiantElement as bd,customElement as $D,event as vd,onEvent as to,onUpdated as GD,prop as ki,state as WD}from"@ecopages/radiant";var Jc,Zc,ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md;function UD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:gd(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||gd(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:zD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return KD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function zD(t){var e=qD(t,"string");return typeof e=="symbol"?e:e+""}function qD(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gd(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function KD(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var _d,yd=class extends bd{static{({e:[ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,Jc],c:[_d,Zc]}=UD(this,[$D("rui-tag-group")],[[ki({...Ie,defaultValue:[]}),0,"value"],[ki({type:String,defaultValue:""}),0,"label"],[ki({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ki({type:String,attribute:"selection-mode",defaultValue:"multiple"}),0,"selectionMode"],[ki({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[vd({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[vd({name:"rui-remove",bubbles:!0,composed:!0}),0,"removeEvent"],[WD,0,"derivedItems"],[GD(["value","label","disabled","selectionMode","embedded","derivedItems"]),2,"onPropsUpdated"],[to({selector:"[data-tag]",type:"click"}),2,"onTagClick"],[to({selector:"[data-tag-remove]",type:"click"}),2,"onRemoveClick"],[to({selector:"[data-tag]",type:"keydown"}),2,"onTagKeydown"]],0,void 0,bd))}constructor(...e){super(...e),md(this)}value=(Jc(this),ed(this));label=(td(this),id(this));disabled=(rd(this),nd(this));selectionMode=(od(this),ad(this));embedded=(sd(this),ld(this));changeEvent=(ud(this),cd(this));removeEvent=(dd(this),hd(this));uid=(pd(this),re("rui-tag-group"));derivedItems=fd(this,null);isMultiple(){return this.selectionMode==="multiple"}getSelectedValues(){return this.value}setSelectedValues(e){this.value=e}getList(){let e=this.querySelector("[data-rui-managed-list]");return e||(this.derivedItems!=null?null:this.querySelector("[data-tag-list]"))}getTags(){let e=this.getList();return e?Array.from(e.querySelectorAll("[data-tag]")):[]}getVisibleTags(){return this.getTags().filter(e=>!e.hidden&&e.getAttribute("aria-disabled")!=="true")}getTagValue(e){return e.getAttribute("data-value")||e.textContent?.trim()||""}getTagLabel(e){return e.getAttribute("data-label")||e.textContent?.trim()||""}ensureTagIds(){this.getTags().forEach((e,i)=>{e.id||(e.id=`${this.uid}-tag-${i}`)})}syncList(){let e=this.getList();e&&(e.id||(e.id=`${this.uid}-list`),e.setAttribute("role","list"),e.setAttribute("aria-label",this.label||"Tags"),this.disabled?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled"))}syncTags(){let e=new Set(this.getSelectedValues());this.getTags().forEach((r,s)=>{r.setAttribute("role","listitem");let d=this.getTagValue(r),h=e.has(d);r.setAttribute("aria-selected",String(h)),r.tabIndex=s===0?0:-1;let a=r.querySelector("[data-tag-remove]");a&&(a.type="button",a.tabIndex=-1,a.setAttribute("aria-label",`Remove ${this.getTagLabel(r)}`))})}selectTag(e){if(this.disabled||this.embedded||e.getAttribute("aria-disabled")==="true")return;let i=this.getTagValue(e);if(this.isMultiple()){let r=new Set(this.getSelectedValues());r.has(i)?r.delete(i):r.add(i),this.setSelectedValues([...r])}else this.value=[i];this.syncTags(),this.changeEvent.emit({value:this.value})}removeTag(e){let i=this.getTagValue(e),r=new Set(this.getSelectedValues());r.delete(i),this.setSelectedValues([...r]),this.syncTags(),this.removeEvent.emit({value:i}),this.changeEvent.emit({value:this.value})}initialize(){this.syncManagedList(),this.ensureTagIds(),this.syncList(),this.syncTags()}onConnected(){this.initialize()}onPropsUpdated(){this.syncManagedList(),this.syncList(),this.syncTags()}resync(){this.ensureTagIds(),this.syncList(),this.syncTags()}setItems(e){this.derivedItems=e,this.value=e.map(i=>i.value)}createManagedTag(e){let i=document.createElement("span");i.setAttribute("data-tag",""),i.setAttribute("data-value",e.value),i.setAttribute("data-label",e.label),i.className="rui-tag",i.textContent=e.label,i.setAttribute("aria-label",e.label);let r=document.createElement("button");return r.type="button",r.setAttribute("data-tag-remove",""),r.className="rui-tag__remove",r.setAttribute("aria-label",`Remove ${e.label}`),r.append(hr()),i.append(r),i}syncManagedList(){let e=this.querySelector('[data-ref="root"]');if(!e||this.derivedItems==null)return;e.querySelector("[data-tag-list]:not([data-rui-managed-list])")?.toggleAttribute("hidden",!0);let r=e.querySelector("[data-rui-managed-list]");if(this.derivedItems.length===0){r?.remove();return}r||(r=document.createElement("div"),r.setAttribute("data-tag-list",""),r.setAttribute("data-rui-managed-list",""),r.className="rui-tag-group__list",e.appendChild(r)),r.replaceChildren(...this.derivedItems.map(s=>this.createManagedTag(s))),this.ensureTagIds(),this.syncList(),this.syncTags()}onTagClick(e){let i=e.target;if(i.closest("[data-tag-remove]"))return;let r=i.closest("[data-tag]");r&&this.contains(r)&&this.selectTag(r)}onRemoveClick(e){e.stopPropagation();let r=e.target.closest("[data-tag]");r&&this.contains(r)&&this.removeTag(r)}onTagKeydown(e){let i=this.getVisibleTags(),r=e.target.closest("[data-tag]");if(!r)return;if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.embedded||this.selectTag(r);return}if(e.key==="Backspace"||e.key==="Delete"){r.querySelector("[data-tag-remove]")&&(e.preventDefault(),this.removeTag(r));return}de({items:i,current:r,key:e.key,orientation:"horizontal"}).handled&&e.preventDefault()}static{Zc()}};import{jsx as je,jsxs as HD}from"@ecopages/jsx/jsx-runtime";function wd({children:t,class:e,...i}){return je("div",{...i,"data-tag-list":!0,class:j("rui-tag-group__list",e),children:t})}function Td({value:t,label:e,children:i,class:r,disabled:s,aria:d,...h}){return HD("span",{...h,"data-tag":!0,"data-value":t,"data-label":e,class:j("rui-tag",r),aria:ne(d,e),"aria-disabled":s?"true":void 0,children:[i,je(Sd,{})]})}function Sd({children:t,class:e,aria:i,...r}){return je("button",{...r,aria:ne(i,"Remove"),type:"button","data-tag-remove":!0,class:j("rui-tag__remove",e),children:t??je(Re,{})})}function xd({children:t}){return je("div",{class:"rui-tag-group","data-ref":"root",children:t})}function Mi({tags:t,children:e,value:i,...r}){return t!=null?je("rui-tag-group",{...r,value:i,children:je(xd,{children:je(wd,{children:t.map(s=>je(Td,{value:s.value,label:typeof s.label=="string"?s.label:void 0,disabled:s.disabled,children:s.label}))})})}):je("rui-tag-group",{...r,value:i,children:je(xd,{children:e})})}function Rd({children:t,class:e,...i}){return ae("div",{...i,class:j("rui-combobox__control",e),children:t})}function Ad({placeholder:t,disabled:e,class:i,...r}){return ae("input",{...r,type:"text","data-combobox-input":!0,"data-autocomplete-input":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:j("rui-combobox__input",i),placeholder:t,disabled:e,autocomplete:"off"})}function Id({children:t,class:e,aria:i,disabled:r,...s}){return ae("button",{...s,aria:ne(i,"Show suggestions"),type:"button","data-combobox-trigger":!0,class:j("rui-control-toggle",e),disabled:r,tabIndex:-1,children:t??ae(Xe,{})})}function YD({children:t,class:e,aria:i,disabled:r,...s}){return ae("button",{...s,aria:ne(i,"Clear selection"),type:"button","data-combobox-clear":!0,class:j("rui-control-clear",e),disabled:r,children:t??ae(Re,{})})}function Cd({children:t,class:e,...i}){return ae("span",{...i,"data-combobox-value":!0,class:j("rui-combobox__value",e),children:t})}function Dd({children:t,class:e,...i}){return ae("div",{...i,"data-combobox-listbox":!0,class:j("rui-combobox__listbox rui-popover rui-popover--listbox rui-floating",e),children:t})}function Ed({children:t}){return ae("div",{class:"rui-combobox","data-ref":"root",children:t})}function ND({options:t,children:e,value:i,...r}){let s=et(i),d=t?.filter(a=>s.includes(a.value)).map(a=>({value:a.value,label:a.label})),h=r.selectionMode==="multiple";return t!=null?ae("rui-combobox",{...r,value:s,children:io(Ed,{children:[io(Rd,{children:[h?ae(Cd,{children:ae(Mi,{tags:d??[],label:"Selected options"})}):null,ae(Ad,{placeholder:r.placeholder,disabled:r.disabled}),ae(Id,{})]}),ae(Dd,{children:ae(vn,{children:io(gn,{children:[ae(ii,{embedded:!0,options:t,selectionMode:r.selectionMode,value:s}),ae(bn,{children:"No results found."})]})})})]})}):ae("rui-combobox",{...r,value:s,children:ae(Ed,{children:e})})}import{RadiantElement as Wd,bindTo as e1,customElement as t1,event as i1,onEvent as r1,onUpdated as n1,prop as Li}from"@ecopages/radiant";function ro(t,e){if(t.length===0)throw new RangeError("cycleValue requires at least one value");let i=e===void 0?-1:t.indexOf(e);return i===-1?t[0]:t[(i+1)%t.length]}var Od,Vd,kd,Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd,$d;function XD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Gd(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Gd(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:QD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ZD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function QD(t){var e=JD(t,"string");return typeof e=="symbol"?e:e+""}function JD(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gd(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ZD(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var o1="[data-cycle-value]",no="button[data-cycle-toggle-button]",Yd,Hd=class extends Wd{static{({e:[kd,Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd,$d,Od],c:[Yd,Vd]}=XD(this,[t1("rui-cycle-toggle")],[[Li({type:String,reflect:!0,defaultValue:""}),0,"value"],[Li({type:String,reflect:!0,defaultValue:"filled"}),0,"variant"],[Li({type:String,reflect:!0,defaultValue:"md"}),0,"size"],[Li({type:String,defaultValue:""}),0,"label"],[[Li({type:Boolean,reflect:!0,defaultValue:!1}),e1({selector:"button[data-cycle-toggle-button]",prop:"disabled"})],0,"disabled"],[i1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[n1(["value","label","disabled","size","variant"]),2,"onPropsUpdated"],[r1({selector:no,type:"click"}),2,"onButtonClick"]],0,void 0,Wd))}value=(Od(this),kd(this));variant=(Md(this),Ld(this));size=(Pd(this),jd(this));label=(Fd(this),Bd(this));disabled=(Ud(this),zd(this));changeEvent=(qd(this),Kd(this));childObserver=($d(this),null);connectedCallback(){super.connectedCallback(),this.childObserver=new MutationObserver(()=>this.resync()),this.childObserver.observe(this,{childList:!0,subtree:!0})}onConnected(){this.resync()}disconnectedCallback(){this.childObserver?.disconnect(),this.childObserver=null,super.disconnectedCallback()}onPropsUpdated(){this.resync()}resync(){let e=this.syncSelection(this.value||this.getItemValue(this.getEnabledItems()[0])||"");this.syncButtonPresentation(),this.syncButtonLabel(e)}getItems(){return Array.from(this.querySelectorAll(o1))}getEnabledItems(){return this.getItems().filter(e=>e.getAttribute("aria-disabled")!=="true")}getItemValue(e){return e?e.dataset.cycleValue??"":""}syncButtonLabel(e){let i=this.querySelector(no);if(!i)return;let r=e?.querySelector("[aria-label]")?.ariaLabel??e?.textContent?.trim();if(!this.label||!r){i.removeAttribute("aria-label");return}i.setAttribute("aria-label",`${this.label}: ${r}`)}syncButtonPresentation(){let e=this.querySelector(no);if(e){for(let i of Array.from(e.classList))i.startsWith("rui-button--")&&e.classList.remove(i);e.classList.add(`rui-button--${this.variant}`,`rui-button--${this.size}`)}}syncSelection(e){let i=this.getItems();if(!i.length)return;let r=this.getEnabledItems(),s=i.find(h=>this.getItemValue(h)===e&&r.includes(h))??r[0]??i[0],d=this.getItemValue(s);this.value=d;for(let h of i)h.hidden=h!==s;return s}cycle(){if(this.disabled)return;let i=this.getEnabledItems().map(s=>this.getItemValue(s)).filter(Boolean);if(!i.length)return;let r=ro(i,this.value||void 0);r!==this.value&&(this.syncSelection(r),this.changeEvent.emit({value:this.value}))}onButtonClick(){this.cycle()}static{Vd()}};import{jsx as Cr}from"@ecopages/jsx/jsx-runtime";function a1({id:t,children:e,class:i,disabled:r,selected:s,...d}){return Cr("span",{...d,class:j("rui-cycle-toggle__item",i),"data-cycle-value":t,hidden:s===void 0?void 0:!s,"aria-disabled":r?"true":void 0,children:e})}function Nd({children:t,variant:e="filled",size:i="md",disabled:r,class:s,...d}){return Cr("button",{...d,type:"button",class:j("rui-button","rui-cycle-toggle__button",`rui-button--${e}`,`rui-button--${i}`,s),disabled:r,"data-cycle-toggle-button":!0,children:t})}function s1({children:t,variant:e,size:i,disabled:r,...s}){return Cr("rui-cycle-toggle",{...s,variant:e,size:i,disabled:r,children:Cr(Nd,{variant:e,size:i,disabled:r,children:t})})}import{jsx as ge,jsxs as ao}from"@ecopages/jsx/jsx-runtime";var Xd={system:"System",light:"Light",dark:"Dark"},oo={xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":!0},l1={system:ao("svg",{...oo,children:[ge("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),ge("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),ge("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]}),light:ao("svg",{...oo,children:[ge("circle",{cx:"12",cy:"12",r:"4"}),ge("path",{d:"M12 2v2"}),ge("path",{d:"M12 20v2"}),ge("path",{d:"m4.93 4.93 1.41 1.41"}),ge("path",{d:"m17.66 17.66 1.41 1.41"}),ge("path",{d:"M2 12h2"}),ge("path",{d:"M20 12h2"}),ge("path",{d:"m6.34 17.66-1.41 1.41"}),ge("path",{d:"m19.07 4.93-1.41 1.41"})]}),dark:ge("svg",{...oo,children:ge("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"})})};function Qd({preference:t}){return l1[t]}function Jd({preference:t}){return Xd[t]}function u1({preference:t,showLabel:e=!0}){return ao("span",{class:"inline-flex items-center gap-inline","aria-label":e?void 0:Xd[t],children:[ge(Qd,{preference:t}),e?ge(Jd,{preference:t}):void 0]})}import{RadiantElement as Rh,bindTo as bt,customElement as b1,event as v1,onEvent as vt,onUpdated as Ah,prop as it,query as y1,state as _1}from"@ecopages/radiant";function d1(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(`(max-width: ${639}px)`).matches}function Dr(t){return t<=1||!d1()?t:1}function Or(t){if(typeof window>"u"||typeof window.matchMedia!="function")return null;let e=window.matchMedia(`(max-width: ${639}px)`);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}var ri=class{config;popoverController=null;suppressPopoverDismiss=!1;constructor(e){this.config=e}destroy(){this.popoverController?.destroy(),this.popoverController=null}suppressDismiss(){this.suppressPopoverDismiss=!0}syncPopover(){let e=this.config.getFloating();if(!e)return;e.hidden=!this.config.getOpen();let i=this.ensureController();i.updateConfig({getOpen:()=>this.config.getOpen()}),i.sync()}focusCalendarDay(){h1(this.config.getCalendar(),this.config.getFocusIso())}handleFocusOut(e,i){let r=e.relatedTarget;queueMicrotask(()=>{if(this.suppressPopoverDismiss){this.suppressPopoverDismiss=!1;return}if(!this.config.getOpen())return;let s=this.config.getFloating();if(!s)return;let d=r instanceof Node?r:document.activeElement;tt(this.config.getHost(),s,d)&&i()})}ensureController(){return this.popoverController||(this.popoverController=new ce({getAnchor:this.config.getAnchor,getFloating:this.config.getFloating,getOpen:this.config.getOpen,getPlacement:()=>"bottom-start",gap:4,portal:!1})),this.popoverController}};function h1(t,e){requestAnimationFrame(()=>{if(!t)return;((e?t.querySelector(`[data-calendar-day][data-iso="${e}"]:not(:disabled)`):null)??t.querySelector('[data-calendar-day][tabindex="0"]:not(:disabled), [data-calendar-day]:not(:disabled)'))?.focus()})}var Zd,eh,th,ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,bh,vh,yh,_h,xh,wh,Th,Sh;function p1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Eh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Eh(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:f1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return g1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function f1(t){var e=m1(t,"string");return typeof e=="symbol"?e:e+""}function m1(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Eh(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function g1(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Ch,Ih=class extends Rh{static{({e:[th,ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,bh,vh,yh,_h,xh,wh,Th,Sh,Zd],c:[Ch,eh]}=p1(this,[b1("rui-date-field")],[[[it({type:String,reflect:!0,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"value"},{selector:"[data-date-field-calendar]",attr:"value"}])],0,"value"],[[it({type:String,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"min"},{selector:"[data-date-field-calendar]",attr:"min"}])],0,"min"],[[it({type:String,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"max"},{selector:"[data-date-field-calendar]",attr:"max"}])],0,"max"],[[it({type:Boolean,reflect:!0,defaultValue:!1}),bt([{selector:"[data-date-field-input]",bool:"disabled"},{selector:"[data-date-field-calendar]",bool:"disabled"}])],0,"disabled"],[[it({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),bt({selector:"[data-date-field-input]",bool:"read-only"})],0,"readOnly"],[it({type:String,defaultValue:""}),0,"label"],[[it({type:String,defaultValue:""}),bt({selector:"[data-date-field-input]",attr:"name"})],0,"name"],[[it({type:String,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"locale"},{selector:"[data-date-field-calendar]",attr:"locale"}])],0,"locale"],[it({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[v1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[_1,bt({selector:"[data-date-field-trigger]",attr:"aria-expanded"})],0,"open"],[y1({ref:"popover"}),0,"popoverTarget"],[Ah(["value","min","max","label","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[Ah(["open"]),2,"onOpenUpdated"],[vt({selector:"[data-date-field-input]",type:"rui-change"}),2,"onDateInputChange"],[vt({selector:"[data-date-field-input]",type:"rui-form-reset"}),2,"onDateInputReset"],[vt({selector:"[data-date-field-input], [data-date-field-trigger], [data-date-field-popover]",type:"focusout"}),2,"onRootFocusOut"],[vt({ref:"trigger",type:"pointerdown"}),2,"onTriggerPointerDown"],[vt({ref:"trigger",type:"click"}),2,"onTriggerClick"],[vt({selector:"[data-date-field-popover]",type:"mousedown"}),2,"onPopoverMouseDown"],[vt({selector:"[data-date-field-calendar]",type:"rui-change"}),2,"onCalendarChange"],[vt({selector:"[data-date-field-input], [data-date-field-trigger], [data-date-field-calendar]",type:"keydown"}),2,"onRootKeydown"]],0,void 0,Rh))}value=(Zd(this),th(this));min=(ih(this),rh(this));max=(nh(this),oh(this));disabled=(ah(this),sh(this));readOnly=(lh(this),uh(this));label=(ch(this),dh(this));name=(hh(this),ph(this));locale=(fh(this),mh(this));visibleMonths=(gh(this),bh(this));changeEvent=(vh(this),yh(this));open=(_h(this),xh(this,!1));uid=(wh(this),re("rui-date-field"));calendarPopover=new ri({getHost:()=>this,getAnchor:()=>this.getToggle()?.parentElement??this,getFloating:()=>this.popoverTarget,getOpen:()=>this.open,getCalendar:()=>this.getCalendar(),getFocusIso:()=>this.isoValue||void 0});disposeMobileLayoutListener=null;popoverTarget=Th(this);onMediaChange=(Sh(this),()=>{this.syncCalendar(),this.open&&this.calendarPopover.syncPopover()});get isoValue(){return this.value??""}get inputId(){return`${this.uid}-input`}getDateInput(){return this.querySelector("[data-date-field-input]")}getToggle(){return this.querySelector("[data-date-field-trigger]")}getCalendar(){return this.querySelector("[data-date-field-calendar]")}syncLabel(){let e=this.getDateInput();qe(this,e,{controlId:this.inputId,label:this.label,labelId:`${this.uid}-label`})}syncInput(){let e=this.getDateInput();e?.id||e?.setAttribute("id",this.inputId)}syncToggle(){let e=this.getToggle();e&&(e.disabled=this.disabled||this.readOnly)}commitValue(e){e!==this.isoValue&&(this.value=e,this.changeEvent.emit({value:e}))}syncCalendar(){let e=this.getCalendar();e&&(e.setAttribute("selection-mode","single"),e.setAttribute("visible-months",String(Dr(this.visibleMonths))))}initialize(){this.syncLabel(),this.syncInput(),this.syncToggle(),this.syncCalendar(),this.setOpen(!1)}setOpen(e){this.open=e,queueMicrotask(()=>{this.calendarPopover.syncPopover(),e&&this.calendarPopover.focusCalendarDay()})}onConnected(){this.disposeMobileLayoutListener=Or(this.onMediaChange),this.initialize()}disconnectedCallback(){this.disposeMobileLayoutListener?.(),this.disposeMobileLayoutListener=null,this.calendarPopover.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.syncLabel(),this.syncInput(),this.syncToggle(),this.syncCalendar()}onOpenUpdated(){this.syncToggle(),this.calendarPopover.syncPopover()}onDateInputChange(e){let i=e.target;if(!(i instanceof HTMLElement)||!i.matches("[data-date-field-input]"))return;let r=e.detail;this.commitValue(r?.value??"")}onDateInputReset(){let e=this.getDateInput(),i=e&&Reflect.get(e,"value");this.value=typeof i=="string"?i:""}onRootFocusOut(e){this.calendarPopover.handleFocusOut(e,()=>this.setOpen(!1))}onTriggerPointerDown(){this.calendarPopover.suppressDismiss()}onTriggerClick(){this.disabled||this.readOnly||this.setOpen(!this.open)}onPopoverMouseDown(e){e.preventDefault()}onCalendarChange(e){let i=e.target;if(!(i instanceof HTMLElement)||!i.matches("[data-date-field-calendar]"))return;let r=e.detail;r?.value&&(this.commitValue(r.value),this.setOpen(!1))}onRootKeydown(e){e.key==="Escape"&&this.open&&(e.preventDefault(),this.setOpen(!1))}static{eh()}};import{Fragment as D1,jsx as De,jsxs as rp}from"@ecopages/jsx/jsx-runtime";import{jsx as Vr}from"@ecopages/jsx/jsx-runtime";import{customElement as E1,event as R1,onEvent as ni,onUpdated as Jh,prop as oi,registerSsrPreparationCallback as A1,state as Zh}from"@ecopages/radiant";import{FormAssociatedElement as ep}from"@ecopages/radiant/form-associated-element";function Dh(t,e){let i=t.type,r=yr(t),s=!e.useTextboxRole,d=s?"spinbutton":"textbox",h=!e.disabled&&!e.readOnly,a=vr(i,e.segments);return{ariaLabel:Pn(i,e.locale),ariaReadonly:e.readOnly||void 0,ariaRole:d,ariaValuemax:s?a.max:void 0,ariaValuemin:s?a.min:void 0,ariaValuenow:s&&r!=null?r:void 0,ariaValuetext:s?Ti(t):void 0,className:j("rui-date-input__segment",t.isPlaceholder&&"rui-date-input__segment--placeholder"),dataRuiFocusManaged:!0,contenteditable:h?"true":void 0,inputmode:h?"numeric":void 0,suppresscontenteditablewarning:h?"true":void 0,tabindex:e.disabled?void 0:0}}var Oh,Vh,kh,Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,$h,Gh,Wh,Hh,Yh,Nh,Xh;function x1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Qh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Qh(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:w1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return S1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function w1(t){var e=T1(t,"string");return typeof e=="symbol"?e:e+""}function T1(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qh(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function S1(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}function I1(){return typeof navigator>"u"?!1:/iPad|iPhone|iPod/.test(navigator.userAgent)}var ip,tp=class extends ep{static{({e:[kh,Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,$h,Gh,Wh,Hh,Yh,Nh,Xh,Oh],c:[ip,Vh]}=x1(this,[E1("rui-date-input")],[[oi({type:String,reflect:!0,defaultValue:""}),0,"value"],[oi({type:String,defaultValue:""}),0,"min"],[oi({type:String,defaultValue:""}),0,"max"],[oi({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[oi({type:String,defaultValue:""}),0,"label"],[oi({type:String,defaultValue:""}),0,"locale"],[R1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Zh,0,"segments"],[Zh,0,"focusedPart"],[Jh(["value","locale"]),2,"syncSegmentsFromValue"],[Jh("label"),2,"syncGroupLabel"],[ni({selector:'[data-ref="root"]',type:"focusin"}),2,"onGroupFocusIn"],[ni({selector:"[data-date-segment]",type:"focusin"}),2,"onSegmentFocusIn"],[ni({selector:"[data-date-segment]",type:"focusout"}),2,"onSegmentFocusOut"],[ni({selector:"[data-date-segment]",type:"keydown"}),2,"onSegmentKeyDown"],[ni({selector:"[data-date-segment]",type:"beforeinput"}),2,"onSegmentBeforeInput"],[ni({selector:"[data-date-segment]",type:"pointerdown"}),2,"onSegmentPointerDown"]],0,void 0,ep))}value=(Oh(this),kh(this));min=(Mh(this),Lh(this));max=(Ph(this),jh(this));readOnly=(Fh(this),Bh(this));label=(Uh(this),zh(this));locale=(qh(this),Kh(this));changeEvent=($h(this),Gh(this));segments=(Wh(this),Hh(this,[]));focusedPart=(Yh(this),Nh(this,null));uid=(Xh(this),re("rui-date-input"));buffer="";useTextboxRole=I1();pendingFocus=null;get resolvedLocale(){return ht(this.locale)}get isoValue(){return this.value??""}syncSegmentsFromValue(){this.segments=br(Dt(this.isoValue),this.resolvedLocale),this.buffer=""}get displaySegments(){return this.segments.length>0?this.segments:br(Dt(this.isoValue),this.resolvedLocale)}constructor(){super(),A1(this,()=>this.syncSegmentsFromValue())}getSegmentElement(e){return this.querySelector(`[data-date-segment][data-type="${e}"]`)}setFocusedPart(e,i="leave"){let r=this.focusedPart;e===r&&i==="leave"||(this.buffer="",(r!=null||i==="blur")&&this.commit(i),this.focusedPart=e)}focusPart(e){this.setFocusedPart(e),this.pendingFocus=e}updated(e){super.updated(e),this.pendingFocus=null;let i=this.focusedPart;if(!i||!(e.has("focusedPart")||e.has("segments"))||!this.matches(":focus-within"))return;let r=this.getSegmentElement(i);r&&(document.activeElement!==r&&r.focus(),document.activeElement===r&&window.getSelection()?.collapse(r,0))}commit(e){if(e==="edit"&&this.buffer)return;let i=Vn(this.segments,{min:this.min,max:this.max});switch(i.kind){case"partial-year":e!=="edit"&&this.syncSegmentsFromValue();return;case"incomplete":e==="blur"&&this.syncSegmentsFromValue();return;case"out-of-range":this.syncSegmentsFromValue();return;case"empty":this.publish("");return;case"date":this.publish(i.iso)}}publish(e){if(e===this.isoValue){this.syncSegmentsFromValue();return}this.value=e,this.changeEvent.emit({value:e})}partFromTarget(e){if(!(e instanceof HTMLElement))return null;let r=e.closest("[data-date-segment]")?.getAttribute("data-type");return r==="month"||r==="day"||r==="year"?r:null}handleDigit(e,i){this.setFocusedPart(e);let r=Fn(this.segments,e,i,this.buffer);if(this.segments=r.segments,this.buffer=r.enteredKeys,r.focusNext){this.focusPart(Qt(this.segments,e,1));return}this.commit("edit")}handleBackspace(e){this.setFocusedPart(e);let i=Un(this.segments,e);if(i.kind==="focus-previous"){this.focusPart(Qt(this.segments,e,-1));return}this.segments=i.segments,this.buffer=i.enteredKeys,this.commit("edit")}handleIncrement(e,i){this.setFocusedPart(e),this.buffer="",this.segments=jn(this.segments,e,i),this.commit("edit")}onConnected(){this.syncSegmentsFromValue(),this.syncGroupLabel()}formValue(){return this.name?this.isoValue:null}formState(){return this.value}restoreFormState(e){this.value=typeof e=="string"?e:"",this.syncSegmentsFromValue()}formResetCallback(){super.formResetCallback(),this.dispatchEvent(new Event("rui-form-reset",{bubbles:!0}))}syncGroupLabel(){let e=this.querySelector('[data-ref="root"]');if(!e)return;e.id||(e.id=`${this.uid}-group`);let i=this.label||this.getAttribute("aria-label")||"";i?e.setAttribute("aria-label",i):e.removeAttribute("aria-label")}onGroupFocusIn(e){this.partFromTarget(e.target)||this.focusPart(Bn(this.segments))}onSegmentFocusIn(e){let i=this.partFromTarget(e.target);i&&(this.pendingFocus&&this.pendingFocus!==i||this.setFocusedPart(i))}onSegmentFocusOut(){queueMicrotask(()=>{this.matches(":focus-within")||this.setFocusedPart(null,"blur")})}onSegmentKeyDown(e){let i=this.partFromTarget(e.target);if(!(!i||this.effectiveDisabled||this.readOnly)){if(e.key==="ArrowLeft"){e.preventDefault(),this.focusPart(Qt(this.segments,i,-1));return}if(e.key==="ArrowRight"){e.preventDefault(),this.focusPart(Qt(this.segments,i,1));return}if(e.key==="ArrowUp"){e.preventDefault(),this.handleIncrement(i,1);return}if(e.key==="ArrowDown"){e.preventDefault(),this.handleIncrement(i,-1);return}(e.key==="Backspace"||e.key==="Delete")&&(e.preventDefault(),e.stopPropagation(),this.handleBackspace(i))}}onSegmentBeforeInput(e){let i=this.partFromTarget(e.target);if(!(!i||this.effectiveDisabled||this.readOnly))switch(e.preventDefault(),e.inputType){case"deleteContentBackward":case"deleteContentForward":this.handleBackspace(i);break;default:e.data!=null&&this.handleDigit(i,e.data);break}}onSegmentPointerDown(e){e.stopPropagation()}renderSegment(e,i){if(!e.editable)return Vr("span",{class:"rui-date-input__literal","data-type":"literal","aria-hidden":"true",children:e.value},`literal-${i}`);let r=e.type,s=this.focusedPart===r,d=Dh(e,{disabled:this.effectiveDisabled,locale:this.resolvedLocale,readOnly:this.readOnly,segments:this.displaySegments,useTextboxRole:this.useTextboxRole});return Vr("span",{class:d.className,"data-date-segment":!0,"data-type":r,"data-placeholder":e.isPlaceholder?"true":void 0,"data-focused":s?"true":void 0,role:d.ariaRole,"aria-label":d.ariaLabel,"aria-valuemin":d.ariaValuemin,"aria-valuemax":d.ariaValuemax,"aria-valuenow":d.ariaValuenow,"aria-valuetext":d.ariaValuetext,"aria-readonly":d.ariaReadonly,"data-rui-focus-managed":d.dataRuiFocusManaged,contenteditable:d.contenteditable,suppresscontenteditablewarning:d.suppresscontenteditablewarning,spellcheck:"false",inputmode:d.inputmode,tabindex:d.tabindex,children:Ti(e)},r)}render(){return Vr("div",{class:"rui-date-input","data-ref":"root",role:"group",children:Vr("div",{class:"rui-date-input__segments",children:this.displaySegments.map((e,i)=>this.renderSegment(e,i))})})}static{Vh()}};import{jsx as C1}from"@ecopages/jsx/jsx-runtime";function ai({children:t,...e}){return C1("rui-date-input",{"data-rui-control":!0,"data-rui-control-type":"date","data-rui-aria-target":'[data-ref="root"]',...e,children:t})}function np({children:t,class:e,...i}){return De("div",{...i,class:j("rui-date-field",e),children:De("div",{class:"rui-date-field__group","data-ref":"control",children:t})})}function op({class:t,...e}){return De(ai,{...e,"data-date-field-input":!0,class:j("rui-date-field__input",t)})}function ap({children:t,class:e,aria:i,...r}){return De("button",{...r,aria:ne(i,"Open calendar"),type:"button","data-ref":"trigger","data-date-field-trigger":!0,class:j("rui-control-toggle",e),"aria-haspopup":"dialog",children:t??De(xi,{})})}function sp({children:t,class:e,...i}){return De("div",{...i,"data-ref":"popover","data-date-field-popover":!0,class:j("rui-date-field__popover rui-popover rui-floating",e),hidden:!0,role:"dialog",children:t})}function lp(t){return De(Si,{...t,"data-date-field-calendar":!0})}function O1(t){let{children:e,value:i,min:r,max:s,disabled:d,readOnly:h,label:a,name:E,locale:A}=t;return De("rui-date-field",{"data-rui-aria-target":'[data-date-field-input] [data-ref="root"]',...t,children:e??rp(D1,{children:[rp(np,{children:[De(op,{value:i,min:r,max:s,disabled:d,readOnly:h,label:a,name:E,locale:A}),De(ap,{})]}),De(sp,{children:De(lp,{})})]})})}import{RadiantElement as Fp,bindTo as rt,customElement as P1,event as j1,onEvent as yt,onUpdated as Bp,prop as $e,query as F1,state as B1}from"@ecopages/radiant";var up,cp,dp,hp,pp,fp,mp,gp,bp,vp,yp,_p,xp,wp,Tp,Sp,Ep,Rp,Ap,Ip,Cp,Dp,Op,Vp,kp,Mp,Lp,Pp;function V1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:jp(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||jp(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:k1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return L1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function k1(t){var e=M1(t,"string");return typeof e=="symbol"?e:e+""}function M1(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jp(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function L1(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var zp,Up=class extends Fp{static{({e:[dp,hp,pp,fp,mp,gp,bp,vp,yp,_p,xp,wp,Tp,Sp,Ep,Rp,Ap,Ip,Cp,Dp,Op,Vp,kp,Mp,Lp,Pp,up],c:[zp,cp]}=V1(this,[P1("rui-date-range-picker")],[[[$e({type:String,reflect:!0,defaultValue:""}),rt({selector:"[data-range-calendar]",attr:"value"})],0,"value"],[[$e({type:String,defaultValue:""}),rt([{selector:"[data-range-start]",attr:"min"},{selector:"[data-range-end]",attr:"min"},{selector:"[data-range-calendar]",attr:"min"}])],0,"min"],[[$e({type:String,defaultValue:""}),rt([{selector:"[data-range-start]",attr:"max"},{selector:"[data-range-end]",attr:"max"},{selector:"[data-range-calendar]",attr:"max"}])],0,"max"],[[$e({type:Boolean,reflect:!0,defaultValue:!1}),rt([{selector:"[data-range-start]",bool:"disabled"},{selector:"[data-range-end]",bool:"disabled"},{selector:"[data-range-calendar]",bool:"disabled"}])],0,"disabled"],[[$e({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),rt([{selector:"[data-range-start]",bool:"read-only"},{selector:"[data-range-end]",bool:"read-only"}])],0,"readOnly"],[[$e({type:String,defaultValue:""}),rt([{selector:"[data-range-start]",attr:"locale"},{selector:"[data-range-end]",attr:"locale"},{selector:"[data-range-calendar]",attr:"locale"}])],0,"locale"],[[$e({type:String,attribute:"start-name",defaultValue:""}),rt({selector:"[data-range-start]",attr:"name"})],0,"startName"],[[$e({type:String,attribute:"end-name",defaultValue:""}),rt({selector:"[data-range-end]",attr:"name"})],0,"endName"],[$e({type:String,defaultValue:""}),0,"name"],[$e({type:Number,attribute:"visible-months",defaultValue:2}),0,"visibleMonths"],[j1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[B1,rt({selector:"[data-range-trigger]",attr:"aria-expanded"})],0,"open"],[F1({ref:"popover"}),0,"popoverTarget"],[Bp(["value","min","max","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[Bp(["open"]),2,"onOpenUpdated"],[yt({selector:"[data-range-start], [data-range-end]",type:"rui-change"}),2,"onDateInputChange"],[yt({selector:"[data-range-start], [data-range-end]",type:"rui-form-reset"}),2,"onDateInputReset"],[yt({ref:"trigger",type:"pointerdown"}),2,"onTriggerPointerDown"],[yt({ref:"trigger",type:"click"}),2,"onTriggerClick"],[yt({selector:"[data-range-popover]",type:"mousedown"}),2,"onPopoverMouseDown"],[yt({selector:"[data-range-calendar]",type:"rui-change"}),2,"onCalendarChange"],[yt({selector:"[data-range-start], [data-range-end], [data-range-trigger], [data-range-calendar]",type:"keydown"}),2,"onRootKeydown"],[yt({selector:"[data-range-start], [data-range-end], [data-range-trigger], [data-range-popover]",type:"focusout"}),2,"onRootFocusOut"]],0,void 0,Fp))}value=(up(this),dp(this));min=(hp(this),pp(this));max=(fp(this),mp(this));disabled=(gp(this),bp(this));readOnly=(vp(this),yp(this));locale=(_p(this),xp(this));startName=(wp(this),Tp(this));endName=(Sp(this),Ep(this));name=(Rp(this),Ap(this));visibleMonths=(Ip(this),Cp(this));changeEvent=(Dp(this),Op(this));open=(Vp(this),kp(this,!1));calendarPopover=(Mp(this),new ri({getHost:()=>this,getAnchor:()=>this.getToggle()?.parentElement??this,getFloating:()=>this.popoverTarget,getOpen:()=>this.open,getCalendar:()=>this.getCalendar(),getFocusIso:()=>Me(this.isoValue)?.start}));disposeMobileLayoutListener=null;popoverTarget=Lp(this);onMediaChange=(Pp(this),()=>{this.syncCalendar(),this.open&&this.calendarPopover.syncPopover()});get isoValue(){return this.value??""}getStartInput(){return this.querySelector("[data-range-start]")}getEndInput(){return this.querySelector("[data-range-end]")}getToggle(){return this.querySelector("[data-range-trigger]")}getCalendar(){return this.querySelector("[data-range-calendar]")}readInputIso(e){let i=e==="start"?this.getStartInput():this.getEndInput();if(!i)return"";let r=Reflect.get(i,"value");return typeof r=="string"?r:i.getAttribute("value")??""}projectCompleteRangeOntoInputs(){let e=Me(this.isoValue);e&&(this.getStartInput()?.setAttribute("value",e.start),this.getEndInput()?.setAttribute("value",e.end))}commitRange(e,i){let r=this.min||void 0,s=this.max||void 0;if(e&&!pt(e,r,s)||i&&!pt(i,r,s))return;let d=e&&i?Nt({start:e,end:i}):"";d!==this.isoValue&&(this.value=d,this.changeEvent.emit({value:d,start:e,end:i}))}commitFromInputs(){let e=this.readInputIso("start"),i=this.readInputIso("end");if(e&&i){this.commitRange(e,i);return}this.commitRange("","")}setOpen(e){this.open=e,queueMicrotask(()=>{this.calendarPopover.syncPopover(),e&&this.calendarPopover.focusCalendarDay()})}syncToggle(){let e=this.getToggle();e&&(e.disabled=this.disabled||this.readOnly)}syncCalendar(){let e=this.getCalendar();e&&(e.setAttribute("selection-mode","range"),e.setAttribute("visible-months",String(Dr(this.visibleMonths))))}initialize(){this.projectCompleteRangeOntoInputs(),this.syncToggle(),this.syncCalendar(),this.setOpen(!1)}onConnected(){this.disposeMobileLayoutListener=Or(this.onMediaChange),this.initialize()}disconnectedCallback(){this.disposeMobileLayoutListener?.(),this.disposeMobileLayoutListener=null,this.calendarPopover.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.projectCompleteRangeOntoInputs(),this.syncToggle(),this.syncCalendar()}onOpenUpdated(){this.syncToggle(),this.calendarPopover.syncPopover()}onDateInputChange(e){let i=e.target;i instanceof HTMLElement&&i.matches("[data-range-start], [data-range-end]")&&this.commitFromInputs()}onDateInputReset(){queueMicrotask(()=>{let e=this.readInputIso("start"),i=this.readInputIso("end");this.value=e&&i?Nt({start:e,end:i}):""})}onTriggerPointerDown(){this.calendarPopover.suppressDismiss()}onTriggerClick(){this.disabled||this.readOnly||this.setOpen(!this.open)}onPopoverMouseDown(e){e.preventDefault()}onCalendarChange(e){let i=e.target;if(!(i instanceof HTMLElement)||!i.matches("[data-range-calendar]"))return;let r=e.detail;!r?.start||!r.end||(this.commitRange(r.start,r.end),this.setOpen(!1))}onRootKeydown(e){e.key==="Escape"&&this.open&&(e.preventDefault(),this.setOpen(!1))}onRootFocusOut(e){this.calendarPopover.handleFocusOut(e,()=>this.setOpen(!1))}static{cp()}};import{Fragment as U1,jsx as fe,jsxs as so}from"@ecopages/jsx/jsx-runtime";function qp({children:t,class:e,...i}){return fe("div",{...i,class:j("rui-date-range-picker",e),children:fe("div",{class:"rui-date-range-picker__group","data-ref":"control",children:t})})}function Kp({children:t,class:e,...i}){return fe("div",{...i,class:j("rui-date-range-picker__values",e),"data-ref":"values",children:t})}function $p({class:t,...e}){return fe(ai,{...e,"data-range-start":!0,class:j("rui-date-range-picker__input",t)})}function Gp({class:t,...e}){return fe(ai,{...e,"data-range-end":!0,class:j("rui-date-range-picker__input",t)})}function Wp({children:t="\u2013",class:e,...i}){return fe("span",{...i,class:j("rui-date-range-picker__separator",e),"aria-hidden":"true",children:t})}function Hp({children:t,class:e,aria:i,...r}){return fe("button",{...r,aria:ne(i,"Open calendar"),type:"button","data-ref":"trigger","data-range-trigger":!0,class:j("rui-control-toggle",e),"aria-haspopup":"dialog",children:t??fe(xi,{})})}function Yp({children:t,class:e,...i}){return fe("div",{...i,"data-ref":"popover","data-range-popover":!0,class:j("rui-date-range-picker__popover rui-popover rui-floating",e),hidden:!0,role:"dialog",children:t})}function Np(t){return fe(Si,{...t,"data-range-calendar":!0})}function z1(t){let{children:e,startLabel:i="Start date",endLabel:r="End date",value:s,min:d,max:h,disabled:a,readOnly:E,locale:A,startName:S,endName:I}=t,T=Me(s??"");return fe("rui-date-range-picker",{"data-rui-aria-targets":'[data-range-start] [data-ref="root"],[data-range-end] [data-ref="root"]',...t,children:e??so(U1,{children:[so(qp,{children:[so(Kp,{children:[fe($p,{"aria-label":i,value:T?.start,min:d,max:h,disabled:a,readOnly:E,locale:A,name:S}),fe(Wp,{}),fe(Gp,{"aria-label":r,value:T?.end,min:d,max:h,disabled:a,readOnly:E,locale:A,name:I})]}),fe(Hp,{})]}),fe(Yp,{children:fe(Np,{})})]})})}import{RadiantElement as mf,bindTo as H1,bound as Y1,customElement as N1,event as X1,onEvent as uo,onUpdated as Q1,prop as co,query as ho}from"@ecopages/radiant";var Xp="a[href], button, input, select, textarea, [tabindex]";function q1(t){return!t.hasAttribute("disabled")&&t.getAttribute("tabindex")!=="-1"}function lo(t){return Array.from(t.querySelectorAll(Xp)).filter(q1)}function kr(t){return Array.from(t.querySelectorAll(Xp)).filter(e=>!e.hasAttribute("disabled"))}function si(t){return lo(t)[0]}var Qp,Jp,Zp,ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf,pf;function K1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ff(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ff(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:$1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return W1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function $1(t){var e=G1(t,"string");return typeof e=="symbol"?e:e+""}function G1(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ff(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function W1(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var bf,gf=class extends mf{static{({e:[Zp,ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf,pf,Qp],c:[bf,Jp]}=K1(this,[N1("rui-dialog")],[[[co({type:Boolean,reflect:!0,defaultValue:!1}),H1({ref:"root",bool:"hidden",invert:!0})],0,"open"],[co({type:Boolean,reflect:!0,defaultValue:!1}),0,"alert"],[co({type:String,defaultValue:""}),0,"label"],[ho({ref:"dialog"}),0,"dialogTarget"],[ho({selector:"[data-dialog-title]"}),0,"titleTarget"],[ho({selector:"[data-dialog-body]"}),0,"descriptionTarget"],[X1({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[Y1,Q1(["open","label"])],2,"syncOpenState"],[uo({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[uo({ref:"backdrop",type:"click"}),2,"onBackdropClick"],[uo({selector:"[data-dialog-close]",type:"click"}),2,"onCloseClick"]],0,void 0,mf))}open=(Qp(this),Zp(this));alert=(ef(this),tf(this));label=(rf(this),nf(this));dialogTarget=(of(this),af(this));titleTarget=(sf(this),lf(this));descriptionTarget=(uf(this),cf(this));closeEvent=(df(this),hf(this));previouslyFocused=(pf(this),null);uid=re("rui-dialog");get titleId(){return`${this.uid}-title`}get descriptionId(){return`${this.uid}-desc`}onConnected(){this.syncOpenState()}syncOpenState(){this.dialogTarget&&(this.titleTarget?.textContent?.trim()?(this.titleTarget.id=this.titleId,this.dialogTarget.setAttribute("aria-labelledby",this.titleId),this.dialogTarget.removeAttribute("aria-label")):this.label&&(this.dialogTarget.setAttribute("aria-label",this.label),this.dialogTarget.removeAttribute("aria-labelledby")),this.descriptionTarget?(this.descriptionTarget.id=this.descriptionId,this.dialogTarget.setAttribute("aria-describedby",this.descriptionId)):this.dialogTarget.removeAttribute("aria-describedby"),this.open?(this.previouslyFocused=document.activeElement,queueMicrotask(()=>this.focusInitial())):(this.previouslyFocused?.focus?.(),this.previouslyFocused=null))}focusInitial(){(this.getFocusable()[0]??this.dialogTarget)?.focus()}getFocusable(){return this.dialogTarget?lo(this.dialogTarget):[]}dismiss(e){this.open&&(this.open=!1,this.closeEvent.emit({reason:e}))}onDocumentKeydown(e){if(!this.open)return;if(e.key==="Escape"){e.preventDefault(),this.dismiss("escape");return}if(e.key!=="Tab")return;let i=this.getFocusable();if(!i.length){e.preventDefault(),this.dialogTarget?.focus();return}let r=i[0],s=i[i.length-1],d=document.activeElement;e.shiftKey&&d===r?(e.preventDefault(),s.focus()):!e.shiftKey&&d===s&&(e.preventDefault(),r.focus())}onBackdropClick(){this.dismiss("backdrop")}onCloseClick(){this.dismiss("dismiss")}static{Jp()}};import{jsx as ve,jsxs as yf}from"@ecopages/jsx/jsx-runtime";function _f({children:t,class:e,...i}){return ve("div",{...i,"data-dialog-title":!0,"data-ref":"title",class:j("rui-dialog__title",e),children:t})}function xf({children:t,class:e,...i}){return ve("div",{...i,"data-dialog-body":!0,"data-ref":"description",class:j("rui-dialog__body",e),children:t})}function wf({children:t,class:e,...i}){return ve("div",{...i,class:j("rui-dialog__actions",e),children:t})}function Tf({children:t,class:e,aria:i,...r}){return ve("button",{...r,aria:ne(i,"Close"),type:"button","data-dialog-close":!0,"data-ref":"close",class:j("rui-dialog__close",e),children:t??ve(Re,{})})}function vf({alert:t,children:e,open:i}){return yf("div",{"data-ref":"root",class:"rui-dialog",hidden:i?void 0:!0,children:[ve("div",{"data-ref":"backdrop",class:"rui-dialog__backdrop"}),ve("div",{"data-ref":"dialog",class:"rui-dialog__surface",tabindex:-1,role:t?"alertdialog":"dialog","aria-modal":"true",children:e})]})}function J1({title:t,actions:e,children:i,open:r,alert:s,...d}){return t!=null||e!=null?ve("rui-dialog",{...d,open:r,alert:s,children:yf(vf,{open:r,alert:s,children:[ve(Tf,{}),t!=null?ve(_f,{children:t}):null,i!=null?ve(xf,{children:i}):null,e!=null?ve(wf,{children:e}):null]})}):ve("rui-dialog",{...d,open:r,alert:s,children:ve(vf,{open:r,alert:s,children:i})})}var nt="__rui-dialog-host",Mr="rui-dialog-open",Lr="rui-dialog-close",Pr="rui-dialog-toggle",po="rui-dialog-action";function Sf(t){return"id"in t&&t.id!=null&&t.id!==""}var Pi=!1,jr=null,ji=null,be=null;function mo(t){let e=t.trim();if(!e)return null;let i=document.getElementById(e);return i?.localName==="rui-dialog"?i:null}function Z1(){let t=document.createElement("button");return t.type="button",t.setAttribute("data-dialog-close",""),t.setAttribute("data-ref","close"),t.className="rui-dialog__close",t.setAttribute("aria-label","Close"),t.append(hr()),t}function eO(t){let e=document.createElement("div");return e.setAttribute("data-dialog-title",""),e.setAttribute("data-ref","title"),e.className="rui-dialog__title",e.textContent=t,e}function tO(t){let e=document.createElement("div");e.setAttribute("data-dialog-body",""),e.setAttribute("data-ref","description"),e.className="rui-dialog__body";let i=document.createElement("p");return i.textContent=t,e.append(i),e}function iO(t){let e=document.createElement("div");e.className="rui-dialog__actions";for(let i of t){let r=document.createElement("button");r.type="button",r.className=`rui-button rui-button--${i.variant??"filled"} rui-button--${i.size??"md"}`,r.setAttribute("data-dialog-action",i.value??""),i.closeOnClick===!1&&r.setAttribute("data-dialog-action-close","false"),r.textContent=i.label,e.append(r)}return e}function rO(t){let e=document.createElement("div");e.dataset.ref="root",e.className="rui-dialog";let i=document.createElement("div");i.setAttribute("data-ref","backdrop"),i.className="rui-dialog__backdrop";let r=document.createElement("div");return r.setAttribute("data-ref","dialog"),r.className="rui-dialog__surface",r.tabIndex=-1,r.setAttribute("role",t?"alertdialog":"dialog"),r.setAttribute("aria-modal","true"),e.append(i,r),e}function Fi(){ji?.remove(),ji=null}function nO(t){Fi();let e=document.createElement("rui-dialog");e.id=nt,e.alert=!!t.alert,e.label=t.label??"",e.open=!0;let i=rO(e.alert),r=i.querySelector('[data-ref="dialog"]');if(!r)throw new Error("Failed to create the dialog surface.");return r.append(Z1()),t.title&&r.append(eO(t.title)),t.body&&r.append(tO(t.body)),t.actions?.length&&r.append(iO(t.actions)),e.append(i),(jr??document.body).appendChild(e),ji=e,e}function Ef(t){if(!(!be||be===t))if(be===nt)Fi();else{let e=mo(be);e&&(e.open=!1)}}function li(t){_t();let e=mo(t);e&&(Ef(t),e.open=!0,be=t)}function oO(t){_t(),Ef(nt),nO(t),be=nt}function Fr(t){if(typeof t=="string"){li(t);return}if(Sf(t)){li(t.id);return}oO(t)}function ui(t){_t();let e=t??be;if(e){if(e===nt)Fi();else{let i=mo(e);i&&(i.open=!1)}be===e&&(be=null)}}function go(t){if(_t(),be===t){ui(t);return}li(t)}function Rf(t){let e=t.detail;if(typeof e=="string"){Fr(e);return}e&&typeof e=="object"&&Fr(e)}function Af(t){let e=t.detail;ui(e?.id)}function If(t){let e=t.detail;e?.id&&go(e.id)}function Cf(t){let e=t.target;if(!e?.closest)return;let i=e.closest("[data-dialog-action]");if(i&&ji?.contains(i)){t.preventDefault();let h={value:i.getAttribute("data-dialog-action")||void 0||void 0};ji.dispatchEvent(new CustomEvent(po,{detail:h,bubbles:!0,composed:!0})),i.getAttribute("data-dialog-action-close")!=="false"&&ui(nt);return}let r=e.closest("[data-dialog-open]");if(r){let d=r.getAttribute("data-dialog-open")?.trim();d&&(t.preventDefault(),li(d));return}let s=e.closest("[data-dialog-close]");if(s){if(s.closest("rui-dialog")?.hasAttribute("open"))return;t.preventDefault(),ui()}}function Df(t){let e=t.target?.closest?.("rui-dialog");if(!e)return;let i=e.id||null;i&&be===i&&(i===nt&&Fi(),be=null)}function Of(t={}){return Pi?(t.mount&&(jr=t.mount),fo):(Pi=!0,jr=t.mount??document.body,document.addEventListener(Mr,Rf),document.addEventListener(Lr,Af),document.addEventListener(Pr,If),document.addEventListener("click",Cf),document.addEventListener("rui-close",Df),fo)}function _t(){Pi||Of()}function fo(){Pi&&(document.removeEventListener(Mr,Rf),document.removeEventListener(Lr,Af),document.removeEventListener(Pr,If),document.removeEventListener("click",Cf),document.removeEventListener("rui-close",Df),Fi(),jr=null,be=null,Pi=!1)}function aO(){return be}function sO(t){_t(),Fr(t)}function lO(t){_t(),ui(t)}function uO(t){_t(),go(t)}function cO(t){_t();let e=t?.trim()||void 0;return{open:r=>{if(e){li(e);return}if(r!=null){if(typeof r=="string"){li(r);return}Fr(r)}},close:r=>{ui(r??e)},toggle:r=>{let s=r??e;s&&go(s)},get openId(){return be}}}import{RadiantElement as zf,bindTo as qf,bound as mO,customElement as gO,onEvent as bO,onUpdated as vO,prop as bo}from"@ecopages/radiant";var Vf,kf,Mf,Lf,Pf,jf,Ff,Bf;function dO(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Uf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Uf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:hO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return fO(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function hO(t){var e=pO(t,"string");return typeof e=="symbol"?e:e+""}function pO(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Uf(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function fO(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Br,Kf=class extends zf{static{({e:[Mf,Lf,Pf,jf,Ff,Bf,Vf],c:[Br,kf]}=dO(this,[gO("rui-disclosure")],[[[bo({type:Boolean,reflect:!0,defaultValue:!1}),qf([{selector:"[data-disclosure-trigger]",attr:"aria-expanded"},{selector:"[data-disclosure-panel]",attr:"data-state",map:e=>e?"open":"closed"}])],0,"open"],[bo({type:String,reflect:!0,defaultValue:""}),0,"value"],[[bo({type:Boolean,reflect:!0,defaultValue:!1}),qf({bool:"data-animated"})],0,"animated"],[bO({selector:"[data-disclosure-trigger]",type:"click"}),2,"onTriggerClick"],[[mO,vO(["open","animated"])],2,"syncExpanded"]],0,void 0,zf))}open=(Vf(this),Mf(this));value=(Lf(this),Pf(this));animated=(jf(this),Ff(this));panelId=(Bf(this),re("rui-disclosure"));onConnected(){this.syncPanelRelationship(),this.syncExpanded()}onTriggerClick(e){e.preventDefault(),this.toggle()}toggle(){let e=!this.open;this.open=e,this.dispatchEvent(new CustomEvent("rui-disclosure-toggle",{bubbles:!0,composed:!0,detail:{value:this.value,open:e}}))}syncPanelRelationship(){let e=this.querySelector("[data-disclosure-trigger]"),i=this.querySelector("[data-disclosure-panel]");!e||!i||(e.setAttribute("aria-controls",this.panelId),i.id=this.panelId)}syncExpanded(){let e=this.querySelector("[data-disclosure-panel]");if(e){if(this.animated){e.toggleAttribute("hidden",!1),e.setAttribute("aria-hidden",String(!this.open));return}e.toggleAttribute("hidden",!this.open),e.removeAttribute("aria-hidden")}}static{kf()}};import{RadiantElement as Qf,customElement as TO,onEvent as Jf,onUpdated as SO,prop as Zf}from"@ecopages/radiant";var $f,Gf,Wf,Hf,Yf,Nf;function yO(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Xf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Xf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:_O(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wO(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function _O(t){var e=xO(t,"string");return typeof e=="symbol"?e:e+""}function xO(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xf(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function wO(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var tm,em=class extends Qf{static{({e:[Wf,Hf,Yf,Nf,$f],c:[tm,Gf]}=yO(this,[TO("rui-disclosure-group")],[[Zf({type:Boolean,reflect:!0,defaultValue:!1}),0,"multiple"],[Zf({type:Boolean,reflect:!0,attribute:"animated",defaultValue:!1}),0,"animated"],[SO("animated"),2,"onAnimatedUpdated"],[Jf({selector:"rui-disclosure",type:"rui-disclosure-toggle"}),2,"onDisclosureToggle"],[Jf({selector:"[data-disclosure-trigger]",type:"keydown"}),2,"onTriggerKeydown"]],0,void 0,Qf))}constructor(...e){super(...e),Nf(this)}multiple=($f(this),Wf(this));animated=(Hf(this),Yf(this));onConnected(){this.syncChildrenAnimated(),this.syncTriggers()}getTriggers(){return Array.from(this.querySelectorAll("[data-disclosure-trigger]"))}getDisclosureForTrigger(e){return e.closest("rui-disclosure")}syncTriggers(){let e=this.getTriggers();if(!e.length)return;let i=Math.max(0,e.findIndex(r=>r.tabIndex===0||r===document.activeElement));ue(e,i)}syncChildrenAnimated(){for(let e of this.querySelectorAll("rui-disclosure"))e.animated=this.animated}onAnimatedUpdated(){this.syncChildrenAnimated()}onDisclosureToggle(e){if(this.multiple||!e.detail?.open)return;let r=e.target;if(r instanceof Br)for(let s of this.querySelectorAll("rui-disclosure"))s!==r&&(s.open=!1)}onTriggerKeydown(e){let i=this.getTriggers(),r=e.target.closest("[data-disclosure-trigger]");if(!r)return;if(e.key==="ArrowLeft"||e.key==="ArrowRight"){let d=this.getDisclosureForTrigger(r);if(!d)return;let h=e.key==="ArrowRight";if(d.open===h){e.preventDefault();return}if(e.preventDefault(),d.open=h,h&&!this.multiple)for(let a of this.querySelectorAll("rui-disclosure"))a!==d&&(a.open=!1);return}de({items:i,current:r,key:e.key,orientation:"vertical",wrap:!0}).handled&&e.preventDefault()}static{Gf()}};import{jsx as ye,jsxs as rm}from"@ecopages/jsx/jsx-runtime";function nm({variant:t="chevron",class:e,children:i,...r}){return ye("span",{...r,class:j("rui-disclosure__icon",`rui-disclosure__icon--${t}`,e),"data-disclosure-icon":!0,"aria-hidden":"true",children:i??(t==="chevron"?ye(Xe,{}):null)})}function om({children:t,class:e,disabled:i,icon:r,iconPosition:s="start",...d}){let a=r!==null?r??ye(nm,{}):null;return rm("button",{...d,type:"button","data-disclosure-trigger":!0,class:j("rui-disclosure__trigger",s==="end"&&"rui-disclosure__trigger--icon-end",e),disabled:i,children:[s==="start"?a:null,ye("span",{class:"rui-disclosure__label",children:t}),s==="end"?a:null]})}function am({children:t,class:e,...i}){return ye("div",{...i,"data-disclosure-panel":!0,"data-ref":"panel",class:j("rui-disclosure__panel",e),children:ye("div",{class:"rui-disclosure__panel-inner",children:t})})}function im({children:t}){return ye("div",{class:"rui-disclosure","data-ref":"root",children:t})}function EO({trigger:t,icon:e,iconPosition:i,children:r,...s}){return t!=null?ye("rui-disclosure",{...s,children:rm(im,{children:[ye(om,{icon:e,iconPosition:i,children:t}),r!=null?ye(am,{children:r}):null]})}):ye("rui-disclosure",{...s,children:ye(im,{children:r})})}function RO({children:t,...e}){return ye("rui-disclosure-group",{...e,children:ye("div",{class:"rui-disclosure-group","data-ref":"root",children:t})})}import{jsx as xt}from"@ecopages/jsx/jsx-runtime";function AO({children:t,label:e,class:i,aria:r,...s}){return xt("div",{...s,aria:ne(r,e),role:"feed",class:j("rui-feed",i),children:t})}function IO({children:t,posinset:e,setsize:i,labelledBy:r,describedBy:s,tabindex:d=0,class:h,"aria-posinset":a,"aria-setsize":E,"aria-labelledby":A,"aria-describedby":S,...I}){return xt("article",{...I,class:j("rui-feed__article",h),tabindex:d,"aria-posinset":ke(a,e),"aria-setsize":ke(E,i),"aria-labelledby":ke(A,r),"aria-describedby":ke(S,s),children:t})}function CO({children:t,class:e,...i}){return xt("header",{...i,class:j("rui-feed__header",e),children:t})}function DO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__content",e),children:t})}function OO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__actions",e),children:t})}function VO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline",e),children:t})}function kO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline-body",e),children:t})}function MO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__meta",e),children:t})}import{jsx as Ym}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Gm,customElement as JO,onEvent as Gr,onUpdated as Io,prop as Bt,registerSsrPreparationCallback as ZO}from"@ecopages/radiant";import{consumeContext as eV,onContextUpdate as tV,provideContext as iV}from"@ecopages/radiant/context";var ot="data-rui-control",vo="data-rui-field-managed",qr="data-rui-field-label",Kr="data-rui-field-description",ci="data-rui-field-error",yo="data-default-value",_o="data-default-values",cm="data-rui-aria-target",dm="data-rui-aria-targets",xo='[data-ref="field"]';function hm(){return`[${ot}], ${wo()}`}function wo(){return Array.from(wt.keys()).join(", ")}function LO(t){return t.localName==="rui-listbox"&&(t.hasAttribute("embedded")||Reflect.get(t,"embedded")===!0)}var PO={"rui-combobox":"[data-combobox-input]","rui-select":"[data-select-trigger]","rui-tag-group":"[data-tag-list]","rui-number-field":"[data-number-field-input], input","rui-knob":"[data-knob-control]","rui-checkbox":"input","rui-checkbox-group":"[data-checkbox-group-root]","rui-switch":"input"};function di(t){return t.localName==="input"||t.localName==="textarea"}function pm(t){return t.localName==="input"}function fm(t){return t.localName==="textarea"}function To(t){return Reflect.get(t.constructor,"formAssociated")===!0}var Ur={read:t=>{let e=Reflect.get(t,"value");return typeof e=="string"?e:t.getAttribute("value")??""},write:(t,e)=>{let i=e==null?"":String(e);t.setAttribute("value",i),"value"in t&&Reflect.set(t,"value",i)}},sm={read:t=>{let e=Reflect.get(t,"value");if(typeof e=="number")return e;let i=t.getAttribute("value");return i==null||i===""?"":Number(i)},write:(t,e)=>{let i=e==null?"":String(e);t.setAttribute("value",i),"value"in t&&Reflect.set(t,"value",e)}},lm={read:t=>t.querySelector('input[type="checkbox"]')?.checked??t.hasAttribute("checked"),write:(t,e)=>{e?t.setAttribute("checked",""):t.removeAttribute("checked")}};function mm(t,e){let i=Reflect.get(t,"value");return i!==void 0&&e.fromProperty?e.fromProperty(i):e.fromAttribute?e.fromAttribute(t.getAttribute("value")):i}function gm(t,e){Reflect.set(t,"value",e)}var Bi={read:t=>mm(t,Er),write:gm},jO={read:t=>mm(t,Rr),write:gm},wt=new Map([["rui-checkbox",lm],["rui-switch",lm],["rui-combobox",{...Bi,submission:"none"}],["rui-date-field",Ur],["rui-date-input",{...Ur,submission:"host"}],["rui-date-range-picker",Ur],["rui-select",{...Bi,submission:"none"}],["rui-radio-group",Ur],["rui-checkbox-group",Bi],["rui-listbox",Bi],["rui-tag-group",Bi],["rui-slider",{...jO,submission:"host"}],["rui-knob",{...sm,submission:"host"}],["rui-number-field",{...sm,submission:"host"}]]);function bm(t,e){let i=t,r=new Set,s=a=>{r.has(a)||(r.add(a),e(a))};if(typeof i.getSlotElements=="function")for(let a of i.getSlotElements())s(a);let d=t.querySelector(xo)??t;for(let a of Array.from(d.children))s(a);for(let a of d.querySelectorAll("*"))s(a);for(let a of Array.from(t.children))s(a);let h=t.shadowRoot;if(h)for(let a of Array.from(h.children))s(a)}function So(t,e){let i=null;return bm(t,r=>{if(!(i||!(r instanceof HTMLElement))){if(r.matches(e)){i=r;return}i=r.querySelector(e)}}),i}function um(t){let e=t.filter(i=>!LO(i));return e.length===0?null:e.find(i=>!e.some(r=>r!==i&&r.contains(i)))??null}function FO(t){let e=[];return bm(t,i=>{i instanceof HTMLElement&&i.matches(hm())&&e.push(i)}),e}function BO(t){let e=t.querySelector(xo);return e instanceof HTMLElement?Array.from(e.querySelectorAll(hm())).filter(i=>t.contains(i)):[]}function hi(t){let e=um(BO(t));return e||um(FO(t))}function UO(t,e){let i=t.toLowerCase();wt.set(i,e)}function vm(t,e){let i=hi(t);if(!i||!(e.target instanceof Element)||e.target!==i&&!i.contains(e.target))return!1;let r=e.target.closest(wo());return r===i||r==null}function Eo(t){if(pm(t)){let i=zr(t),r=i===t?void 0:wt.get(i.localName);return r?r.read(i):t.type==="checkbox"?t.checked:t.type==="number"||t.type==="range"?t.value===""?"":Number(t.value):t.value}if(fm(t))return t.value;let e=zr(t);return wt.get(e.localName)?.read(e)??e.getAttribute("value")??""}function $r(t,e){if(pm(t)){let r=zr(t),s=r===t?void 0:wt.get(r.localName);if(s){s.write(r,e);return}if(t.type==="checkbox"){t.checked=!!e;let d=t.closest("rui-checkbox, rui-switch");d&&(e?d.setAttribute("checked",""):d.removeAttribute("checked"));return}t.value=e==null?"":String(e);return}if(fm(t)){t.value=e==null?"":String(e);return}let i=zr(t);wt.get(i.localName)?.write(i,e)}function zr(t){return t.hasAttribute(ot)?t.closest(wo())??t:t}function ym(t){return So(t,`[${qr}]`)}function _m(t){return So(t,`[${Kr}]`)}function xm(t){return Ro(t)[0]??null}function Ro(t){let e=t.querySelector(xo);if(e instanceof HTMLElement){let s=Array.from(e.querySelectorAll(`[${ci}]`));if(s.length>0)return s}let i=Array.from(t.querySelectorAll(`[${ci}]`));if(i.length>0)return i;let r=So(t,`[${ci}]`);return r?[r]:[]}function wm(t,e,i){if(e&&di(e)){let r=t&&wt.get(t.localName)?.submission;(t==null||t===e||!To(t)&&r!=="host"&&r!=="none")&&i?e.name=i:e.removeAttribute("name")}t&&wt.has(t.localName)&&(Reflect.set(t,"name",i),i?t.setAttribute("name",i):t.removeAttribute("name"))}function zO(t){let e=Reflect.get(t,"checked");return typeof e=="boolean"?e:t.hasAttribute("checked")}function qO(t){let e=t.getAttribute(dm);if(e){let r=e.split(",")[0]?.trim();if(r)return t.querySelector(r)}let i=t.getAttribute(cm);return i?t.querySelector(i):null}function KO(t){let e=t.getAttribute(dm);if(e)return e.split(",").map(r=>r.trim()).filter(r=>r!=="").map(r=>t.querySelector(r)).filter(r=>r!=null);let i=t.getAttribute(cm);if(i){let r=t.querySelector(i);return r?[r]:[]}return[]}function $O(t){if(di(t))return t;let e=qO(t);if(e)return e;if(t.hasAttribute(ot))return t;if(t.localName==="rui-slider")return Array.from(t.querySelectorAll("[data-thumb]")).find(d=>!d.hasAttribute("hidden"))??t;let i=t.querySelector(`[${ot}]`);if(i)return i;if(t.localName==="rui-radio-group")return GO(t)??t;let r=PO[t.localName];return r?t.querySelector(r)??t:t}function GO(t){let e=t.querySelectorAll('input[type="radio"]');return Array.from(e).find(zO)??e[0]}function Tm(t){let e=KO(t);if(e.length>0)return e;if(t.localName==="rui-slider"){let i=Array.from(t.querySelectorAll("[data-thumb]")).filter(r=>!r.hasAttribute("hidden"));return i.length>0?i:[t]}return[$O(t)]}import{createContext as WO}from"@ecopages/radiant/context";var pi=WO(Symbol.for("rui-form-context"));import{createContext as HO}from"@ecopages/radiant/context";var Ao=HO(Symbol.for("rui-field-context"));var Sm,Em,Rm,Am,Im,Cm,Dm,Om,Vm,km,Mm,Lm,Pm,jm,Fm,Bm,Um,zm,qm,Km;function YO(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:$m(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||$m(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:NO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return QO(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function NO(t){var e=XO(t,"string");return typeof e=="symbol"?e:e+""}function XO(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $m(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function QO(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}function rV(t){if(!t)return;let{validate:e,...i}=t;return i}var Hm,Wm=class extends Gm{static{({e:[Rm,Am,Im,Cm,Dm,Om,Vm,km,Mm,Lm,Pm,jm,Fm,Bm,Um,zm,qm,Km,Sm],c:[Hm,Em]}=YO(this,[JO("rui-field")],[[Bt({type:String,reflect:!0,defaultValue:""}),0,"name"],[Bt({type:Object}),0,"rules"],[Bt({type:Object}),0,"defaultValue"],[Bt({type:String,attribute:yo}),0,"defaultValueData"],[Bt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Bt({type:String,defaultValue:""}),0,"error"],[Bt({type:Boolean,reflect:!0,defaultValue:!1}),0,"invalid"],[iV({context:Ao,initialValue:{name:"",controlId:"",descriptionId:"",errorId:"",error:void 0,invalid:!1,required:!1},hydrate:Object,serialize:e=>({...e,rules:rV(e.rules)})}),0,"fieldProvider"],[eV(pi),0,"formContextProvider"],[tV({context:pi,requestUpdate:!1}),2,"onFormContextChanged"],[Io(["name"]),2,"onNameUpdated"],[Io(["rules","defaultValue","defaultValueData"]),2,"onRulesUpdated"],[Io(["disabled","error","invalid"]),2,"onPresentationUpdated"],[Gr({selector:"*",type:"rui-change"}),2,"onControlChange"],[Gr({selector:"[data-rui-control]",type:"input",options:{capture:!0}}),2,"onControlInput"],[Gr({selector:"[data-rui-control]",type:"change",options:{capture:!0}}),2,"onControlNativeChange"],[Gr({selector:"[data-rui-control], rui-knob, rui-slider",type:"focusout"}),2,"onControlFocusOut"]],0,void 0,Gm))}name=(Sm(this),Rm(this));rules=(Am(this),Im(this));defaultValue=(Cm(this),Dm(this));defaultValueData=(Om(this),Vm(this));disabled=(km(this),Mm(this));error=(Lm(this),Pm(this));invalid=(jm(this),Fm(this));fieldProvider=(Bm(this),Um(this));formContextProvider=(zm(this),qm(this));uid=(Km(this),re("rui-field"));resolveFieldName(){return(this.name||this.getAttribute("name")||"").trim()}unregister;unregisterPresentation;registeredWithForm=!1;pendingControlWrite;controlObserver;constructor(){super(),ZO(this,()=>this.fieldProvider.setContext({rules:this.readFieldRules()}))}onConnected(){this.connectToForm()}disconnectedCallback(){this.unregister?.(),this.unregister=void 0,this.unregisterPresentation?.(),this.unregisterPresentation=void 0,this.registeredWithForm=!1,this.clearPendingControlWrite(),super.disconnectedCallback()}get currentFormContext(){return this.formContextProvider?.getContext()}parseJsonAttr(e){if(e)try{return JSON.parse(e)}catch{return}}readFieldRules(){let e=this.rules;return e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0?e:this.fieldProvider.getContext()?.rules}readDefaultValue(){return this.defaultValue!==void 0?this.defaultValue:this.parseJsonAttr(this.defaultValueData??this.getAttribute(yo))}isRequired(){return!!this.readFieldRules()?.required}resolveErrorMessage(e){if(this.error)return this.error;let i=this.resolveFieldName();return i?(e??this.currentFormContext)?.fields[i]?.error:void 0}resolveInvalid(e){if(this.invalid||this.error)return!0;let i=this.resolveFieldName();return i?(e??this.currentFormContext)?.fields[i]?.invalid??!1:!1}connectToForm(){let e=this.resolveFieldName(),i=this.currentFormContext,r=i?.actions;if(!i?.ready||!r||!e){this.syncField();return}if(!this.registeredWithForm){this.registeredWithForm=!0,this.unregisterPresentation?.(),this.unregisterPresentation=r.subscribePresentation(s=>this.syncField(s)),this.unregister=r.register({name:e,rules:this.readFieldRules(),getRules:()=>this.readFieldRules(),defaultValue:this.readDefaultValue(),getValue:()=>{let s=hi(this);return s?Eo(s):void 0},setValue:s=>{let d=hi(this);if(d){$r(d,s),this.clearPendingControlWrite();return}this.pendingControlWrite={value:s},this.observeControlAppearance()}}),this.syncField();return}r.updateFieldOptions(e,{rules:this.readFieldRules(),defaultValue:this.readDefaultValue()}),this.syncField()}onFormContextChanged(e){if(!this.registeredWithForm){e.ready?this.connectToForm():this.syncField(e);return}this.syncField(e)}onNameUpdated(){this.unregister?.(),this.unregister=void 0,this.unregisterPresentation?.(),this.unregisterPresentation=void 0,this.registeredWithForm=!1,this.clearPendingControlWrite(),this.connectToForm()}onRulesUpdated(){this.connectToForm()}onPresentationUpdated(){this.syncField()}onControlChange(e){vm(this,e)&&this.syncControlToForm()}onControlInput(){this.syncControlToForm()}onControlNativeChange(){this.syncControlToForm()}onControlFocusOut(){let e=this.resolveFieldName();e&&this.currentFormContext?.actions.handleFieldBlur(e)}syncField(e){let i=hi(this);i&&this.pendingControlWrite&&($r(i,this.pendingControlWrite.value),this.clearPendingControlWrite());let r=i?Tm(i):[],s=r[0]??null,d=s?.id||`${this.uid}-control`,h=`${this.uid}-desc`,a=`${this.uid}-error`,E=this.resolveErrorMessage(e),A=this.resolveInvalid(e),S=this.isRequired(),I=this.resolveFieldName();wm(i,s,I);let T=this.syncDescriptions(h,a,E);this.syncAriaTargets(i,r,d,T,A,S),this.syncLabel(r,s),this.syncErrorPresentation(E);let K={name:I,controlId:s?.id??d,descriptionId:h,errorId:a,error:E,invalid:A,required:S};this.publishFieldContext(K)}syncControlToForm(){let e=this.resolveFieldName();e&&this.currentFormContext?.actions.handleFieldChange(e)}observeControlAppearance(){this.controlObserver||(this.controlObserver=new MutationObserver(()=>this.syncField()),this.controlObserver.observe(this,{childList:!0,subtree:!0}))}clearPendingControlWrite(){this.pendingControlWrite=void 0,this.controlObserver?.disconnect(),this.controlObserver=void 0}syncDescriptions(e,i,r){let s=[],d=_m(this);d&&(d.id=e,s.push(e));let h=xm(this);return h&&(h.id=i),h&&r&&s.push(i),s}syncLabel(e,i){let r=ym(this);if(!r||!i||(r.htmlFor=i.id,di(i)))return;let s=r.id||`${this.uid}-label`;for(let d of e)Nn(r,d,{controlId:d.id,labelId:s})}syncAriaTargets(e,i,r,s,d,h){for(let[a,E]of i.entries())E.id||(E.id=a===0?r:`${r}-${a}`),E.setAttribute(vo,""),E.setAttribute("aria-invalid",String(d)),E.toggleAttribute("aria-required",h),h&&E.setAttribute("aria-required","true"),s.length?E.setAttribute("aria-describedby",s.join(" ")):E.removeAttribute("aria-describedby"),this.disabled&&this.disableAriaTarget(E);this.disabled&&e&&To(e)&&Reflect.set(e,"disabled",!0)}disableAriaTarget(e){e.setAttribute("aria-disabled","true"),di(e)&&(e.disabled=!0)}syncErrorPresentation(e){for(let i of Ro(this))i.textContent=e??"",i.hidden=!e,e&&i.removeAttribute("hidden")}publishFieldContext(e){let i=this.fieldProvider.getContext();nV(i,e)||this.fieldProvider.setContext(e)}static{Em()}};function nV(t,e){return t.name===e.name&&t.controlId===e.controlId&&t.descriptionId===e.descriptionId&&t.errorId===e.errorId&&t.error===e.error&&t.invalid===e.invalid&&t.required===e.required}function oV({children:t,rules:e,defaultValue:i,defaultValueData:r,...s}){return Ym("rui-field",{...s,"prop:rules":e,"prop:defaultValue":i,data:{defaultValue:r??(i!==void 0?JSON.stringify(i):void 0)},children:Ym("div",{class:"rui-field","data-ref":"field",children:t})})}import{jsx as aV}from"@ecopages/jsx/jsx-runtime";function sV({children:t,class:e,...i}){return aV("p",{...i,[Kr]:"",class:j("rui-field__description",e),children:t})}import{jsx as lV}from"@ecopages/jsx/jsx-runtime";function uV({class:t,...e}){return lV("p",{...e,[ci]:"",class:j("rui-field__error",t),role:"alert",hidden:!0})}import{jsx as Rg}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as _g,customElement as yV,event as xg,onEvent as Do,onUpdated as wg,prop as Ut}from"@ecopages/radiant";import{provideContext as _V}from"@ecopages/radiant/context";function fi(t,e){if(!(e===void 0||e===!1))return typeof e=="string"?e:typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:t}function at(t){return typeof t=="object"&&t!==null&&"value"in t?t.value:t}async function cV(t,e,i,r){if(i)for(let s of[dV,hV,pV,fV]){let d=await s(e,i,r);if(d)return d}}function dV(t,e){let i=t==null||t===""||t===!1||Array.isArray(t)&&t.length===0;return e.required&&i?fi("This field is required",e.required)??"This field is required":void 0}function hV(t,e){let i=typeof t=="number"?t:typeof t=="string"&&t!==""?Number(t):void 0;if(!(i===void 0||Number.isNaN(i))){if(e.min!==void 0&&i<at(e.min))return fi(`Minimum value is ${at(e.min)}`,e.min);if(e.max!==void 0&&i>at(e.max))return fi(`Maximum value is ${at(e.max)}`,e.max)}}function pV(t,e){let i=t==null?"":String(t);if(e.minLength!==void 0&&i.length<at(e.minLength))return fi(`Minimum length is ${at(e.minLength)}`,e.minLength);if(e.maxLength!==void 0&&i.length>at(e.maxLength))return fi(`Maximum length is ${at(e.maxLength)}`,e.maxLength);if(e.pattern!==void 0&&!at(e.pattern).test(i))return fi("Invalid format",e.pattern)??"Invalid format"}async function fV(t,e,i){if(!e.validate)return;let r=typeof e.validate=="function"?[e.validate]:Object.values(e.validate);for(let s of r){let d=await s(t,i);if(d!==!0&&d!==void 0)return d===!1?"Invalid value":String(d)}}async function Nm(t,e,i){let r=i??Object.keys(e.fields),s={};for(let d of r){let h=e.fields[d]?.rules,a=await cV(d,t[d],h,t);a&&(s[d]={type:"validation",message:a})}return Object.keys(s).length>0?{values:{},errors:s}:{values:t,errors:{}}}function Co(){return(t,e,i)=>Nm(t,e,i.names)}function Xm(t){return typeof t=="function"?t:Co()}var Ui=class{mode;reValidateMode;resolver;fields=new Map;listeners=new Set;revision=0;defaultValues;values;errors={};touched={};dirty={};isSubmitting=!1;isSubmitted=!1;constructor(e={}){this.mode=e.mode??"onSubmit",this.reValidateMode=e.reValidateMode??"onChange",this.resolver=Xm(e.resolver),this.defaultValues={...e.defaultValues??{}},this.values={...this.defaultValues,...e.values??{}}}updateOptions(e){e.mode!==void 0&&(this.mode=e.mode),e.reValidateMode!==void 0&&(this.reValidateMode=e.reValidateMode),e.resolver!==void 0&&(this.resolver=Xm(e.resolver)),e.defaultValues!==void 0&&(this.defaultValues={...e.defaultValues})}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notify(){this.revision+=1;for(let e of this.listeners)e()}getRevision(){return this.revision}getRegisteredFieldNames(){return Array.from(this.fields.keys())}register(e){let i=this.fields.get(e.name),r={...e,rules:e.rules??i?.rules,defaultValue:e.defaultValue??i?.defaultValue,getRules:e.getRules??i?.getRules};return this.fields.set(e.name,r),this.values[e.name]===void 0&&r.defaultValue!==void 0&&(this.values={...this.values,[e.name]:r.defaultValue}),r.setValue(this.values[e.name]),()=>{this.fields.get(e.name)===r&&(this.fields.delete(e.name),this.notify())}}updateFieldOptions(e,i){let r=this.fields.get(e);r&&(i.rules!==void 0&&(r.rules=i.rules),i.defaultValue!==void 0&&(r.defaultValue=i.defaultValue))}getValues(){let e={...this.values};for(let[i,r]of this.fields)e[i]=r.getValue();return e}setValue(e,i,r){this.values={...this.values,[e]:i},this.fields.get(String(e))?.setValue(i),r?.shouldDirty&&(this.dirty={...this.dirty,[e]:!0}),r?.shouldTouch&&(this.touched={...this.touched,[e]:!0}),this.notify()}markTouched(e){this.touched={...this.touched,[e]:!0},this.notify()}markDirty(e){this.dirty={...this.dirty,[e]:!0},this.notify()}clearErrors(e){if(e){let i={...this.errors};delete i[e],this.errors=i,this.notify();return}this.errors={},this.notify()}getFieldError(e){return this.errors[e]?.message}getState(){let e=this.getValues(),i=Object.keys(this.errors).length;return{values:e,errors:this.errors,touched:this.touched,dirty:this.dirty,isSubmitting:this.isSubmitting,isSubmitted:this.isSubmitted,isValid:i===0}}async validateField(e){let i=this.getValues(),s=(await this.resolver(i,{fields:this.buildResolverFields()},{names:[e]})).errors[e]?.message,d={...this.errors};return s?d[e]={type:"validation",message:s}:delete d[e],this.errors=d,this.notify(),!s}async validateAll(){let e=this.getValues(),i=await this.resolver(e,{fields:this.buildResolverFields()},{});return this.errors=i.errors,this.notify(),Object.keys(this.errors).length===0}shouldValidate(e,i){switch(this.isSubmitted?this.reValidateMode:this.mode){case"all":return!0;case"onChange":return i==="change";case"onBlur":return i==="blur";case"onTouched":return i==="blur"&&!!this.touched[e];case"onSubmit":return!1;default:return!1}}async handleFieldChange(e){let i=this.fields.get(e);if(!i)return;let r=i.getValue();this.values={...this.values,[e]:r},this.dirty={...this.dirty,[e]:!0},this.shouldValidate(e,"change")?await this.validateField(e):this.notify()}async handleFieldBlur(e){this.markTouched(e),this.shouldValidate(e,"blur")?await this.validateField(e):this.notify()}shouldDisplayFieldError(e){if(!this.errors[e]?.message)return!1;if(this.isSubmitted)return!0;switch(this.mode){case"all":return!!(this.dirty[e]||this.touched[e]);case"onChange":return!!this.dirty[e];case"onBlur":case"onTouched":return!!this.touched[e];default:return!1}}async handleSubmit(e,i){this.isSubmitting=!0,this.isSubmitted=!0;for(let s of this.fields.keys())this.touched={...this.touched,[s]:!0};this.notify();let r=await this.validateAll();if(this.isSubmitting=!1,this.notify(),r){await e(this.getValues());return}i?.(this.errors)}reset(e){let i=e??{...this.defaultValues,...this.collectFieldDefaults()};this.values={...i},this.errors={},this.touched={},this.dirty={},this.isSubmitted=!1,this.isSubmitting=!1;for(let r of this.fields.values())r.setValue(this.values[r.name]);this.notify()}collectFieldDefaults(){let e={};for(let[i,r]of this.fields)r.defaultValue!==void 0&&(e[i]=r.defaultValue);return e}buildResolverFields(){let e={};for(let[i,r]of this.fields){let s=r.getRules?.()??r.rules;e[i]={rules:s}}return e}};var Qm,Jm,Zm,eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg,vg;function mV(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:yg(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||yg(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:gV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return vV(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function gV(t){var e=bV(t,"string");return typeof e=="symbol"?e:e+""}function bV(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yg(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function vV(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Tg=()=>{},xV={register:()=>Tg,updateFieldOptions:()=>{},handleFieldChange:()=>{},handleFieldBlur:()=>{},subscribePresentation:()=>Tg},Eg,Sg=class extends _g{static{({e:[Zm,eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg,vg,Qm],c:[Eg,Jm]}=mV(this,[yV("rui-form")],[[_V({context:pi,initialValue:{ready:!1,store:void 0,revision:0,fields:{},errors:{},actions:xV},hydrate:Object,serialize:({revision:e,fields:i,errors:r})=>({ready:!1,revision:e,fields:i,errors:r})}),0,"formProvider"],[xg({name:"rui-submit",bubbles:!0,composed:!0}),0,"submitEvent"],[xg({name:"rui-invalid",bubbles:!0,composed:!0}),0,"invalidEvent"],[Ut({type:Object,defaultValue:{}}),0,"defaultValues"],[Ut({type:String,attribute:_o}),0,"defaultValuesData"],[Ut({type:Object}),0,"resolver"],[Ut({type:String,reflect:!0,defaultValue:"onSubmit"}),0,"mode"],[Ut({type:String,reflect:!0,attribute:"revalidate-mode",defaultValue:"onChange"}),0,"reValidateMode"],[Ut({type:String,reflect:!0}),0,"action"],[Ut({type:String,reflect:!0}),0,"method"],[wg(["defaultValues","defaultValuesData","mode","reValidateMode"]),2,"syncOptions"],[wg(["resolver"]),2,"syncResolver"],[Do({selector:"button[type=submit]",type:"click"}),2,"onSubmitButtonClick"],[Do({ref:"form",type:"submit"}),2,"onNativeSubmit"],[Do({ref:"form",type:"reset"}),2,"onNativeReset"]],0,void 0,_g))}formProvider=(Qm(this),Zm(this));submitEvent=(eg(this),tg(this));invalidEvent=(ig(this),rg(this));defaultValues=(ng(this),og(this));defaultValuesData=(ag(this),sg(this));resolver=(lg(this),ug(this));mode=(cg(this),dg(this));reValidateMode=(hg(this),pg(this));action=(fg(this),mg(this));method=(gg(this),bg(this));onSubmit=void vg(this);store;unsubscribeStore;nativeFormId=re("rui-form");lastPublishedRevision=-1;lastPublishedContext;presentationListeners=new Set;formActions={register:e=>{let r=this.ensureStore().register(e);return this.publishFormContext({force:!0}),()=>{r(),this.publishFormContext({force:!0})}},updateFieldOptions:(e,i)=>{this.ensureStore().updateFieldOptions(e,i)},handleFieldChange:e=>{this.ensureStore().handleFieldChange(e).then(()=>this.publishFormContext({force:!0}))},handleFieldBlur:e=>{this.ensureStore().handleFieldBlur(e).then(()=>this.publishFormContext({force:!0}))},subscribePresentation:e=>(this.presentationListeners.add(e),this.lastPublishedContext&&e(this.lastPublishedContext),()=>this.presentationListeners.delete(e))};connectedCallback(){super.connectedCallback(),this.ensureStore(),this.publishFormContext({force:!0})}onConnected(){this.wireOrphanSubmitButtons()}queryNativeForm(){return this.getRef("form")}wireOrphanSubmitButtons(){let e=this.queryNativeForm();if(e){e.id||(e.id=this.nativeFormId);for(let i of this.querySelectorAll("button[type=submit]"))e.contains(i)||i.setAttribute("form",e.id)}}runFormSubmit(){this.ensureStore().handleSubmit(async i=>{if(this.submitEvent.emit({values:i}),typeof this.onSubmit=="function"){await this.onSubmit(i);return}this.hasNativeSubmission()&&this.queryNativeForm()?.submit()},i=>{this.invalidEvent.emit({errors:i})})}hasNativeSubmission(){return typeof this.onSubmit!="function"&&(this.getAttribute("action")!==null||this.getAttribute("method")!==null)}disconnectedCallback(){this.unsubscribeStore?.(),this.unsubscribeStore=void 0,super.disconnectedCallback()}resolveMode(){let e=this.getAttribute("mode");return e||(this.mode??"onSubmit")}resolveReValidateMode(){let e=this.getAttribute("revalidate-mode");return e||(this.reValidateMode??"onChange")}resolveDefaultValues(){if(this.defaultValues&&Object.keys(this.defaultValues).length>0)return this.defaultValues;let e=this.defaultValuesData??this.getAttribute(_o);if(!e)return this.defaultValues??{};try{let i=JSON.parse(e);return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}catch{return this.defaultValues??{}}}ensureStore(){return this.store||(this.store=new Ui({defaultValues:this.resolveDefaultValues(),resolver:typeof this.resolver=="function"?this.resolver:void 0,mode:this.resolveMode(),reValidateMode:this.resolveReValidateMode()})),this.unsubscribeStore??=this.store.subscribe(()=>this.publishFormContext()),this.store}buildFieldPresentations(e){let i={};for(let r of e.getRegisteredFieldNames()){let s=e.getFieldError(r),d=e.shouldDisplayFieldError(r);i[r]={error:d?s:void 0,invalid:!!(d&&s)}}return i}publishFormContext(e){let i=this.store;if(!i)return;let r=i.getRevision();if(!e?.force&&r===this.lastPublishedRevision)return;this.lastPublishedRevision=r;let s={ready:!0,store:i,revision:r,fields:this.buildFieldPresentations(i),errors:{...i.errors},actions:this.formActions};this.lastPublishedContext=s,this.formProvider.setContext(s);for(let d of this.presentationListeners)d(s)}syncOptions(){this.ensureStore().updateOptions({defaultValues:this.resolveDefaultValues(),mode:this.resolveMode(),reValidateMode:this.resolveReValidateMode()})}syncResolver(){typeof this.resolver=="function"&&this.ensureStore().updateOptions({resolver:this.resolver})}onSubmitButtonClick(e){e.preventDefault(),this.runFormSubmit()}onNativeSubmit(e){e.preventDefault(),this.runFormSubmit()}onNativeReset(){this.store?.reset()}static{Jm()}};function wV({children:t,defaultValues:e,defaultValuesData:i,resolver:r,reValidateMode:s,onSubmit:d,action:h,method:a,...E}){return Rg("rui-form",{...E,action:h,method:a,reValidateMode:s,"attr:revalidate-mode":s,"prop:defaultValues":e,"prop:resolver":r,"prop:onSubmit":d,data:{defaultValues:i??(e!==void 0?JSON.stringify(e):void 0)},children:Rg("form",{class:"rui-form","data-ref":"form",noValidate:!0,action:h,method:a,children:t})})}import{RadiantElement as Vg,customElement as AV,onEvent as IV,prop as CV}from"@ecopages/radiant";var Ag,Ig,Cg,Dg;function TV(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Og(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Og(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:SV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return RV(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function SV(t){var e=EV(t,"string");return typeof e=="symbol"?e:e+""}function EV(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Og(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function RV(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Mg,kg=class extends Vg{static{({e:[Cg,Dg,Ag],c:[Mg,Ig]}=TV(this,[AV("rui-grid")],[[CV({type:String,defaultValue:""}),0,"label"],[IV({selector:'[role="gridcell"]',type:"keydown"}),2,"onKeydown"]],0,void 0,Vg))}constructor(...e){super(...e),Dg(this)}label=(Ag(this),Cg(this));onConnected(){let e=Array.from(this.querySelectorAll('[role="gridcell"]'));ue(e,0)}getRows(){return Array.from(this.querySelectorAll('[role="row"]'))}onKeydown(e){let i=this.getRows(),r=e.target.closest('[role="gridcell"]');if(!r)return;let s=r.parentElement,d=i.indexOf(s),h=Array.from(s.querySelectorAll('[role="gridcell"]')),a=h.indexOf(r),E=d,A=a;switch(e.key){case"ArrowRight":A=Math.min(h.length-1,a+1);break;case"ArrowLeft":A=Math.max(0,a-1);break;case"ArrowDown":E=Math.min(i.length-1,d+1);break;case"ArrowUp":E=Math.max(0,d-1);break;case"Home":A=0;break;case"End":A=h.length-1;break;default:return}e.preventDefault();let S=i[E],I=Array.from(S.querySelectorAll('[role="gridcell"]')),T=I[Math.min(A,I.length-1)],K=Array.from(this.querySelectorAll('[role="gridcell"]'));ue(K,K.indexOf(T)),T.focus()}static{Ig()}};import{jsx as Wr}from"@ecopages/jsx/jsx-runtime";function DV({rows:t,label:e,children:i,...r}){let s=t!=null?t.map(d=>Wr("div",{class:"rui-grid__row",role:"row",children:d.map(h=>Wr("div",{class:"rui-grid__cell",role:"gridcell",tabindex:-1,children:h}))})):i;return Wr("rui-grid",{...r,label:e,children:Wr("div",{class:"rui-grid","data-ref":"root",role:"grid","aria-label":e||void 0,children:s})})}import{jsx as Yr}from"@ecopages/jsx/jsx-runtime";import{jsx as OV}from"@ecopages/jsx/jsx-runtime";function Hr({as:t,children:e,...i}){return OV(t??"div",{...i,children:e})}import{jsx as VV}from"@ecopages/jsx/jsx-runtime";function Oo(t){let{children:e,as:i="h2",size:r="md",class:s,...d}=t;return VV(Hr,{as:i,...d,class:j("rui-headline",r!==!1&&`rui-headline--size-${r}`,s),children:e})}function kV(t,e,i){return j("rui-heading",`rui-heading--align-${t}`,`rui-heading--size-${e}`,i)}function MV(t){let{children:e,as:i="div",align:r="start",size:s="md",class:d,...h}=t;return Yr(Hr,{as:i,...h,class:kV(r,s,d),children:e})}function LV({children:t,class:e,...i}){return Yr("p",{...i,class:j("rui-heading__eyebrow",e),children:t})}function PV(t){let{children:e,as:i="h2",class:r,...s}=t;return Yr(Oo,{as:i,size:!1,class:j("rui-heading__title",r),...s,children:e})}function jV({children:t,class:e,...i}){return Yr("p",{...i,class:j("rui-heading__description",e),children:t})}import{jsx as Ki}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as ob,bindTo as qV,bound as qi,customElement as KV,event as $V,onEvent as Nr,onUpdated as GV,prop as zt,query as WV}from"@ecopages/radiant";var zi=0,Lg=0;function Pg(){zi+=1}function Vo(t=Date.now(),e=300){zi=Math.max(0,zi-1),zi===0&&(Lg=t+e)}function jg(t,e=Date.now()){return zi>0||e<Lg?0:t}var Fg,Bg,Ug,zg,qg,Kg,$g,Gg,Wg,Hg,Yg,Ng,Xg,Qg,Jg,Zg,eb,tb,ib,rb;function FV(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:nb(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||nb(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:BV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return zV(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function BV(t){var e=UV(t,"string");return typeof e=="symbol"?e:e+""}function UV(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nb(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function zV(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var ko="Preview",ab=8,HV=500,lb,sb=class extends ob{static{({e:[Ug,zg,qg,Kg,$g,Gg,Wg,Hg,Yg,Ng,Xg,Qg,Jg,Zg,eb,tb,ib,rb,Fg],c:[lb,Bg]}=FV(this,[KV("rui-hover-card")],[[zt({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[zt({type:String,defaultValue:"bottom-start"}),0,"placement"],[zt({type:Number,defaultValue:600}),0,"delay"],[zt({type:Number,defaultValue:200}),0,"closeDelay"],[zt({type:Boolean,defaultValue:!0}),0,"portal"],[zt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[[zt({type:String,attribute:"content-label",reflect:!0,defaultValue:ko}),qV({ref:"content",attr:"aria-label"})],0,"contentLabel"],[WV({ref:"content"}),0,"contentTarget"],[$V({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[qi,GV(["open","placement","portal","disabled"])],2,"syncCard"],[Nr({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[Nr({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[Nr({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[Nr({type:"keydown",ref:"trigger"}),2,"onHostKeydown"],[qi,2,"onPointerEnter"],[qi,2,"onPointerLeave"],[qi,2,"onPointerDown"],[qi,2,"onPointerUp"]],0,void 0,ob))}open=(Fg(this),Ug(this));placement=(zg(this),qg(this));delay=(Kg(this),$g(this));closeDelay=(Gg(this),Wg(this));portal=(Hg(this),Yg(this));disabled=(Ng(this),Xg(this));contentLabel=(Qg(this),Jg(this));contentTarget=(Zg(this),eb(this));openChangeEvent=(tb(this),ib(this));contentId=(rb(this),re("rui-hover-card"));controller=null;showTimer=null;hideTimer=null;longPressTimer=null;openedByKeyboard=!1;connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.onPointerEnter),this.addEventListener("pointerleave",this.onPointerLeave),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointercancel",this.onPointerUp)}onConnected(){this.syncCard()}disconnectedCallback(){this.clearTimers(),this.open&&Vo(),this.controller?.destroy(),this.controller=null,this.removeEventListener("pointerenter",this.onPointerEnter),this.removeEventListener("pointerleave",this.onPointerLeave),this.removeEventListener("pointerdown",this.onPointerDown),this.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointercancel",this.onPointerUp),super.disconnectedCallback()}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.longPressTimer&&clearTimeout(this.longPressTimer),this.showTimer=null,this.hideTimer=null,this.longPressTimer=null}getAnchor(){let e=this.querySelector("[data-hover-card-trigger]");return e instanceof HTMLElement?si(e)??e:si(this)??this}getFloatingElement(){return this.controller?.getFloatingElement()??this.contentTarget}ensureController(){return this.controller||(this.controller=new ce({getAnchor:()=>this.getAnchor(),getFloating:()=>this.contentTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:ab,portal:this.portal})),this.controller}syncCard(){let e=this.getAnchor(),i=this.contentTarget;i&&(i.id=this.contentId),e&&(e.setAttribute("aria-controls",this.contentId),e.setAttribute("aria-expanded",String(this.open)));let r=this.ensureController();r.updateConfig({getAnchor:()=>this.getAnchor(),getFloating:()=>this.contentTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:ab,portal:this.portal}),r.sync(),this.syncContentPointerBridge()}syncContentPointerBridge(){let e=this.getFloatingElement();e&&(e.removeEventListener("pointerenter",this.onPointerEnter),e.removeEventListener("pointerleave",this.onPointerLeave),this.open&&(e.addEventListener("pointerenter",this.onPointerEnter),e.addEventListener("pointerleave",this.onPointerLeave)))}setOpen(e,i=!0){if(this.disabled&&e)return;if(this.open===e){this.syncCard();return}let r=this.open;this.open=e,e?Pg():r&&Vo(),i&&this.openChangeEvent.emit({open:e}),this.syncCard()}scheduleShow(e=!1){if(this.disabled||this.open)return;this.clearTimers(),this.openedByKeyboard=e;let i=jg(this.delay);if(i<=0){this.setOpen(!0);return}this.showTimer=setTimeout(()=>this.setOpen(!0),i)}scheduleHide(){this.clearTimers();let e=this.closeDelay>0?this.closeDelay:0;if(e<=0){this.setOpen(!1);return}this.hideTimer=setTimeout(()=>this.setOpen(!1),e)}isTouchPointer(e){return e.pointerType==="touch"}onDocumentKeydown(e){if(!this.open||e.key!=="Escape")return;e.preventDefault();let i=this.getAnchor();this.setOpen(!1),i&&document.activeElement!==i&&i.focus()}onFocusIn(e){tt(this.getAnchor(),this.getFloatingElement(),e.relatedTarget)&&this.scheduleShow(!0)}onFocusOut(e){tt(this.getAnchor(),this.getFloatingElement(),e.relatedTarget)&&this.scheduleHide()}onHostKeydown(e){if(!this.open||e.key!=="Tab"||e.shiftKey||!this.openedByKeyboard)return;let i=this.getFloatingElement();if(!i)return;let r=si(i);r&&(e.preventDefault(),r.focus())}onPointerEnter(e){this.isTouchPointer(e)||this.scheduleShow()}onPointerLeave(e){this.isTouchPointer(e)||this.scheduleHide()}onPointerDown(e){this.disabled||!this.isTouchPointer(e)||(this.clearTimers(),this.longPressTimer=setTimeout(()=>{this.openedByKeyboard=!1,this.setOpen(!0)},HV))}onPointerUp(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}static{Bg()}};function YV({children:t,class:e,...i}){return Ki("span",{class:"rui-hover-card__trigger","data-ref":"trigger",children:Ki("span",{...i,"data-hover-card-trigger":!0,class:j(e),children:t})})}function NV({children:t,class:e,...i}){return Ki("div",{...i,"data-ref":"content",class:j("rui-hover-card__content","rui-floating",e),role:"dialog",hidden:!0,children:t})}function XV({children:t,contentLabel:e=ko,...i}){return Ki("rui-hover-card",{contentLabel:e,...i,children:Ki("span",{class:"rui-hover-card",children:t})})}import{jsx as QV}from"@ecopages/jsx/jsx-runtime";function JV(t){let{class:e,type:i="text",mask:r,placeholder:s,"on:input":d,...h}=t,a=r?Dn(r):s;return QV("input",{...h,type:i,placeholder:a,"on:input":r?A=>{if(r){let S=A.target;S.value=On(S.value,r)}typeof d=="function"?d(A):d!=null&&typeof d=="object"&&"handleEvent"in d&&d.handleEvent(A)}:d,inputmode:r?"numeric":void 0,[ot]:"","data-rui-control-type":"text",class:j("rui-input",e)})}import{jsx as Mo}from"@ecopages/jsx/jsx-runtime";function ZV({children:t,class:e,...i}){return Mo("div",{...i,role:"group",class:j("rui-input-group",e),children:t})}function ek({children:t,align:e="start",class:i,...r}){return Mo("div",{...r,class:j("rui-input-group__addon",`rui-input-group__addon--${e}`,i),children:t})}function tk({children:t,class:e,...i}){return Mo("span",{...i,class:j("rui-input-group__text",e),children:t})}import{bindTo as Zb,customElement as dk,event as hk,onEvent as Gi,onUpdated as pk,prop as Oe,query as qt}from"@ecopages/radiant";import{FormAssociatedElement as ev}from"@ecopages/radiant/form-associated-element";function ik(t){if(!Number.isFinite(t)||t<=0)return 0;let e=t.toString().match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);if(!e)return 0;let i=e[1]?.length??0,r=e[2]?Number(e[2]):0;return Math.min(15,Math.max(0,i-r))}function mi(t,e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.min(15,Math.round(e)):ik(t)}function Ge(t,e){return Number.isFinite(t)?t.toFixed(e):""}function $i(t,e,i){if(Object.is(t,e))return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;let r=Number.isFinite(i)&&i>0?i:1,s=Number.EPSILON*Math.max(Math.abs(t),Math.abs(e),r)*4;return Math.abs(t-e)<=Math.min(s,r*1e-6)}function We(t,e,i){let r=Number.isFinite(t)?t:0,s=Number.isFinite(e)?e:100,d=Math.min(r,s),h=Math.max(r,s),a=Number.isFinite(i)&&i>0?i:1,E=h-d,A=S=>{let I=Number.isFinite(S)?S:d,T=d+Math.round((I-d)/a)*a;return Math.min(h,Math.max(d,T))};return{lowerBound:d,upperBound:h,step:a,clamp:A,ratioFor:S=>E===0?0:(A(S)-d)/E,valueFromRatio:S=>{let I=Math.min(1,Math.max(0,Number.isFinite(S)?S:0));return A(d+I*E)}}}function Xr(t,e,i){switch(i){case"ArrowRight":case"ArrowUp":return t.clamp(e+t.step);case"ArrowLeft":case"ArrowDown":return t.clamp(e-t.step);case"Home":return t.lowerBound;case"End":return t.upperBound;case"PageUp":return t.clamp(e+t.step*10);case"PageDown":return t.clamp(e-t.step*10);default:return}}var ub=120,gi=300,rk=14,nk=gi+(360-gi)/2;function ok(t){return Math.min(100,Math.max(0,Number.isFinite(t)?Number(t):rk))}function ak(t,e,i){return i.replace("{value}",Ge(t,e))}function Qr(t,e,i,r,s,d,h){let a=We(e,i,r),E=ok(s),A=50-E/2,S=2*Math.PI*A,I=gi/360*S,T=a.clamp(t),K=mi(r,h);return{startAngle:ub,strokeWidth:E,radius:A,circumference:S,arcLength:I,progressLength:a.ratioFor(T)*I,valueText:ak(T,K,d)}}function Lo(t,e,i,r){if(i.width===0||i.height===0)return null;let d=(Math.atan2(e-(i.top+i.height/2),t-(i.left+i.width/2))*180/Math.PI-ub+360)%360,h=d<=gi?d:d<=nk?gi:0;return r.valueFromRatio(h/gi)}var cb,db,hb,pb,fb,mb,gb,bb,vb,yb,_b,xb,wb,Tb,Sb,Eb,Rb,Ab,Ib,Cb,Db,Ob,Vb,kb,Mb,Lb,Pb,jb,Fb,Bb,Ub,zb,qb,Kb,$b,Gb,Wb,Hb,Yb,Nb,Xb,Qb;function sk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Jb(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Jb(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:lk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ck(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function lk(t){var e=uk(t,"string");return typeof e=="symbol"?e:e+""}function uk(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jb(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ck(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Po=50,iv,tv=class extends ev{static{({e:[hb,pb,fb,mb,gb,bb,vb,yb,_b,xb,wb,Tb,Sb,Eb,Rb,Ab,Ib,Cb,Db,Ob,Vb,kb,Mb,Lb,Pb,jb,Fb,Bb,Ub,zb,qb,Kb,$b,Gb,Wb,Hb,Yb,Nb,Xb,Qb,cb],c:[iv,db]}=sk(this,[dk("rui-knob")],[[Oe({type:Number,reflect:!0,defaultValue:Po}),0,"value"],[Oe({type:Number,defaultValue:0}),0,"min"],[Oe({type:Number,defaultValue:100}),0,"max"],[Oe({type:Number,defaultValue:1}),0,"step"],[Oe({type:Number,attribute:"value-precision",defaultValue:Number.NaN}),0,"valuePrecision"],[[Oe({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),Zb({ref:"control",attr:"aria-readonly",map:e=>String(e)})],0,"readOnly"],[[Oe({type:String,defaultValue:""}),Zb([{ref:"label",bool:"hidden",invert:!0},{ref:"label",text:!0},{ref:"control",attr:"aria-label",map:e=>e||void 0}])],0,"label"],[Oe({type:Number,defaultValue:void 0}),0,"size"],[Oe({type:Number,attribute:"stroke-width",defaultValue:14}),0,"strokeWidth"],[Oe({type:Boolean,attribute:"show-value",defaultValue:!0}),0,"showValue"],[Oe({type:String,attribute:"value-position",defaultValue:"center"}),0,"valuePosition"],[Oe({type:String,attribute:"value-template",defaultValue:"{value}"}),0,"valueTemplate"],[hk({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[qt({ref:"root"}),0,"rootTarget"],[qt({ref:"label"}),0,"labelTarget"],[qt({ref:"control"}),0,"controlTarget"],[qt({ref:"track"}),0,"trackTarget"],[qt({ref:"progress"}),0,"progressTarget"],[qt({ref:"centerValue"}),0,"centerValueTarget"],[qt({ref:"belowValue"}),0,"belowValueTarget"],[pk(["value","min","max","step","valuePrecision","disabled","readOnly","effectiveDisabled","name","label","size","strokeWidth","showValue","valuePosition","valueTemplate"]),2,"onPropsUpdated"],[Gi({ref:"control",type:"pointerdown"}),2,"onPointerDown"],[Gi({ref:"control",type:"pointermove"}),2,"onPointerMove"],[Gi({ref:"control",type:"pointerup"}),2,"onPointerUp"],[Gi({ref:"control",type:"pointercancel"}),2,"onPointerCancel"],[Gi({ref:"control",type:"keydown"}),2,"onKeydown"]],0,void 0,ev))}value=(cb(this),hb(this));min=(pb(this),fb(this));max=(mb(this),gb(this));step=(bb(this),vb(this));valuePrecision=(yb(this),_b(this));readOnly=(xb(this),wb(this));label=(Tb(this),Sb(this));size=(Eb(this),Rb(this));strokeWidth=(Ab(this),Ib(this));showValue=(Cb(this),Db(this));valuePosition=(Ob(this),Vb(this));valueTemplate=(kb(this),Mb(this));changeEvent=(Lb(this),Pb(this));rootTarget=(jb(this),Fb(this));labelTarget=(Bb(this),Ub(this));controlTarget=(zb(this),qb(this));trackTarget=(Kb(this),$b(this));progressTarget=(Gb(this),Wb(this));centerValueTarget=(Hb(this),Yb(this));belowValueTarget=(Nb(this),Xb(this));activePointerId=(Qb(this),null);lastEmitted=null;rangeCommitQueued=!1;onConnected(){this.syncPresentation()}formValue(){return this.name?String(this.numericRange.clamp(this.value)):null}formState(){return String(this.value)}restoreFormState(e){this.value=Number(e),this.syncPresentation()}onPropsUpdated(){this.syncPresentation()}get numericRange(){return We(this.min,this.max,this.step)}get resolvedSize(){return typeof this.size=="number"&&Number.isFinite(this.size)&&this.size>0?this.size:void 0}get resolvedValuePosition(){return this.valuePosition==="below"?"below":"center"}paint(e){let i=Qr(e,this.min,this.max,this.step,this.strokeWidth,this.valueTemplate,this.valuePrecision),r=this.resolvedValuePosition;this.syncKnobLayout(r),this.syncControlValues(e,i.valueText),this.syncRing(i),this.syncReadout(i.valueText,r)}syncKnobLayout(e){this.rootTarget?.classList.toggle("rui-knob--value-below",e==="below"),this.resolvedSize?this.style.setProperty("--rui-knob-size",`${this.resolvedSize}px`):this.style.removeProperty("--rui-knob-size")}syncControlValues(e,i){let r=this.controlTarget;r&&(r.setAttribute("aria-valuemin",String(this.numericRange.lowerBound)),r.setAttribute("aria-valuemax",String(this.numericRange.upperBound)),r.setAttribute("aria-valuenow",String(e)),r.setAttribute("aria-valuetext",i))}syncRing(e){for(let i of[this.trackTarget,this.progressTarget])i?.setAttribute("r",String(e.radius)),i?.setAttribute("stroke-width",String(e.strokeWidth));this.trackTarget?.setAttribute("stroke-dasharray",`${e.arcLength} ${e.circumference}`),this.progressTarget?.setAttribute("stroke-dasharray",`${e.progressLength} ${e.circumference}`)}syncReadout(e,i){for(let[r,s]of[[this.centerValueTarget,this.showValue&&i==="center"],[this.belowValueTarget,this.showValue&&i==="below"]])r&&(r.textContent=e,r.toggleAttribute("hidden",!s))}syncPresentation(){this.controlTarget&&(this.controlTarget.disabled=this.effectiveDisabled),this.paint(this.numericRange.clamp(this.value)),this.queueNormalizedValueCommit()}queueNormalizedValueCommit(){this.rangeCommitQueued||(this.rangeCommitQueued=!0,queueMicrotask(()=>{this.rangeCommitQueued=!1;let e=this.numericRange.clamp(this.value);this.paint(e),$i(this.value,e,this.step)||(this.value=e)}))}commitValue(e){if(this.effectiveDisabled||this.readOnly)return;let i=this.numericRange.clamp(e);this.paint(i),!$i(i,this.value,this.step)&&(this.value=i,this.lastEmitted!==i&&(this.lastEmitted=i,this.changeEvent.emit({value:i})))}onPointerDown(e){let i=this.controlTarget;if(e.button!==0||this.effectiveDisabled||this.readOnly||!i)return;this.activePointerId=e.pointerId,this.lastEmitted=this.value,i.setPointerCapture(e.pointerId);let r=i.getBoundingClientRect(),s=Lo(e.clientX,e.clientY,r,this.numericRange);s!=null&&this.commitValue(s),e.preventDefault()}onPointerMove(e){let i=this.controlTarget;if(e.pointerId!==this.activePointerId||!i)return;let r=i.getBoundingClientRect(),s=Lo(e.clientX,e.clientY,r,this.numericRange);s!=null&&this.commitValue(s)}onPointerUp(e){e.pointerId===this.activePointerId&&(this.controlTarget?.releasePointerCapture(e.pointerId),this.activePointerId=null)}onPointerCancel(e){if(e.pointerId!==this.activePointerId)return;let i=this.controlTarget;i?.hasPointerCapture(e.pointerId)&&i.releasePointerCapture(e.pointerId),this.activePointerId=null}onKeydown(e){if(this.effectiveDisabled||this.readOnly)return;let i=Xr(this.numericRange,this.value,e.key);i!=null&&(e.preventDefault(),this.lastEmitted=this.value,this.commitValue(i))}static{db()}};import{jsx as st,jsxs as jo}from"@ecopages/jsx/jsx-runtime";function fk({value:t=Po,min:e=0,max:i=100,step:r=1,disabled:s=!1,readOnly:d=!1,label:h,name:a,size:E,strokeWidth:A=14,showValue:S=!0,valuePosition:I="center",valueTemplate:T="{value}",valuePrecision:K,...$}){let V=We(e,i,r),G=V.clamp(t),W=Qr(G,e,i,r,A,T,K);return st(mk,{props:$,value:G,min:e,max:i,step:r,disabled:s,readOnly:d,label:h,name:a,size:E,strokeWidth:A,showValue:S,valuePosition:I,valueTemplate:T,valuePrecision:K,ring:W,range:V})}function mk({props:t,ring:e,range:i,...r}){return st("rui-knob",{...t,value:r.value,min:r.min,max:r.max,step:r.step,disabled:r.disabled,"prop:readOnly":r.readOnly,label:r.label,name:r.name,size:r.size,strokeWidth:r.strokeWidth,showValue:r.showValue,valuePosition:r.valuePosition,valueTemplate:r.valueTemplate,valuePrecision:r.valuePrecision,style:r.size?{"--rui-knob-size":`${r.size}px`}:void 0,children:st(gk,{knob:r,ring:e,range:i})})}function gk({knob:t,ring:e,range:i}){let r=t.valuePosition==="below";return jo("div",{class:r?"rui-knob rui-knob--value-below":"rui-knob","data-ref":"root",children:[st("span",{class:"rui-knob__label","data-ref":"label",hidden:!t.label,children:t.label}),st(bk,{knob:t,ring:e,range:i,valueBelow:r}),st("span",{class:"rui-knob__value rui-knob__value--below","data-ref":"belowValue","aria-hidden":"true",hidden:!t.showValue||!r,children:e.valueText})]})}function bk({knob:t,ring:e,range:i,valueBelow:r}){return jo("button",{type:"button",class:"rui-knob__control","data-ref":"control","data-knob-control":!0,role:"slider","aria-label":t.label||void 0,"aria-valuemin":i.lowerBound,"aria-valuemax":i.upperBound,"aria-valuenow":t.value,"aria-valuetext":e.valueText,"aria-readonly":t.readOnly,disabled:t.disabled,children:[jo("svg",{class:"rui-knob__svg",viewBox:"0 0 100 100","aria-hidden":"true",children:[st("circle",{class:"rui-knob__track","data-ref":"track",cx:"50",cy:"50",r:e.radius,fill:"none","stroke-width":e.strokeWidth,"stroke-dasharray":`${e.arcLength} ${e.circumference}`,transform:`rotate(${e.startAngle} 50 50)`}),st("circle",{class:"rui-knob__progress","data-ref":"progress",cx:"50",cy:"50",r:e.radius,fill:"none","stroke-width":e.strokeWidth,"stroke-dasharray":`${e.progressLength} ${e.circumference}`,transform:`rotate(${e.startAngle} 50 50)`})]}),st("span",{class:"rui-knob__value","data-ref":"centerValue","aria-hidden":"true",hidden:!t.showValue||r,children:e.valueText})]})}import{jsx as vk}from"@ecopages/jsx/jsx-runtime";function yk({children:t,htmlFor:e,class:i,...r}){return vk("label",{...r,[qr]:"",class:j("rui-label",i),htmlFor:e,children:t})}import{RadiantElement as vv,bindTo as Ak,bound as Ik,customElement as Ck,event as yv,onEvent as Tt,onUpdated as Dk,prop as _v,query as xv}from"@ecopages/radiant";var _k=200,xk=250,wk=6,bi=class{config;popovers=new Map;openMenus=new Set;openTimers=new Map;closeTimers=new Map;constructor(e){this.config=e}sync(){for(let e of this.getMenus())for(let i of this.getDirectItems(e)){let r=this.getSubmenu(i);r&&(i.setAttribute("aria-haspopup","menu"),i.hasAttribute("aria-expanded")||i.setAttribute("aria-expanded","false"),r.id||(r.id=re("rui-submenu")),i.setAttribute("aria-controls",r.id),r.hidden=i.getAttribute("aria-expanded")!=="true")}}handlePointerOver(e){let i=this.getDirectItem(e.target);if(!i||this.isDisabled(i)||(this.cancelCloseFor(i),this.cancelAncestorCloseTimers(i),!this.getSubmenu(i)||i.getAttribute("aria-expanded")==="true"))return;this.closeSiblingBranches(i),this.cancelOpenFor(i);let s=setTimeout(()=>{this.openTimers.delete(i),this.openSubmenu(i,!1)},_k);this.openTimers.set(i,s)}handlePointerOut(e){let i=this.getDirectItem(e.target);if(!i)return;let r=e.relatedTarget,s=this.getSubmenu(i);s&&r&&s.contains(r)||r&&i.contains(r)||(this.cancelOpenFor(i),i.getAttribute("aria-expanded")==="true"&&this.scheduleClose(i))}handleFocusOut(e){let i=this.getDirectItem(e.target);if(!i||i.getAttribute("aria-expanded")!=="true")return;let r=this.getSubmenu(i),s=e.relatedTarget;r&&s&&r.contains(s)||this.closeSubmenu(i,!1)}handleKeydown(e){let i=this.getDirectItem(e.target),r=i?.parentElement;if(!i||!r||r.getAttribute("role")!=="menu")return!1;let s=this.keyHandlers[e.key];if(!s)return!1;let d=s.call(this,{item:i,items:this.getFocusableItems(r),menu:r,submenu:this.getSubmenu(i)});return d&&e.key!=="Tab"&&e.preventDefault(),d}keyHandlers={ArrowDown:this.focusNextItem,ArrowUp:this.focusPreviousItem,Home:this.focusFirstItem,End:this.focusLastItem,ArrowRight:this.openNestedMenu,ArrowLeft:this.closeNestedMenu,Enter:this.activateOrOpenItem," ":this.activateOrOpenItem,Escape:this.closeRootMenu,Tab:this.closeMenuForTab};focusNextItem(e){return this.focusRelativeItem(e,1)}focusPreviousItem(e){return this.focusRelativeItem(e,-1)}focusRelativeItem(e,i){let r=e.items.indexOf(e.item);return r<0||!e.items.length?!1:(e.items[(r+i+e.items.length)%e.items.length]?.focus(),!0)}focusFirstItem(e){return e.items[0]?.focus(),!0}focusLastItem(e){return e.items.at(-1)?.focus(),!0}openNestedMenu(e){return e.submenu?(this.openSubmenu(e.item,!0),!0):!1}closeNestedMenu(e){if(this.getRootMenu()===e.menu)return!1;let i=this.getTriggerForMenu(e.menu);return i&&this.closeSubmenu(i,!0),!0}activateOrOpenItem(e){return e.submenu?this.openSubmenu(e.item,!0):this.config.onActivate(e.item),!0}closeRootMenu(){return this.config.onCloseRoot(!0),!0}closeMenuForTab(){return this.config.onCloseRoot(!1),!0}handleClick(e){let i=this.getDirectItem(e.target);return!i||this.isDisabled(i)?!1:this.getSubmenu(i)?(e.preventDefault(),this.closeSiblingBranches(i),this.openSubmenu(i,!1),!0):(this.config.onActivate(i),!0)}closeAll(){for(let e of Array.from(this.openMenus)){let i=this.getTriggerForMenu(e);i&&this.closeSubmenu(i,!1)}this.clearTimers()}getFocusableItems(e){return this.getDirectItems(e).filter(i=>!this.isDisabled(i))}destroy(){this.closeAll();for(let e of this.popovers.values())e.destroy();this.popovers.clear()}openSubmenu(e,i){let r=this.getSubmenu(e);if(!r||this.isDisabled(e))return;this.cancelOpenFor(e),this.cancelCloseFor(e),this.closeSiblingBranches(e),e.setAttribute("aria-expanded","true"),r.hidden=!1,this.openMenus.add(r);let s=this.popovers.get(r);s||(s=new ce({getAnchor:()=>e,getFloating:()=>r,getOpen:()=>e.getAttribute("aria-expanded")==="true",getPlacement:()=>"right-start",gap:wk,portal:!1}),this.popovers.set(r,s)),s.updateConfig({getAnchor:()=>e,getOpen:()=>e.getAttribute("aria-expanded")==="true"}),s.sync(),i&&this.getFocusableItems(r)[0]?.focus()}closeSubmenu(e,i){let r=this.getSubmenu(e);if(r){for(let s of this.getDirectItems(r))this.closeSubmenu(s,!1);this.cancelOpenFor(e),this.cancelCloseFor(e),e.setAttribute("aria-expanded","false"),r.hidden=!0,this.openMenus.delete(r),this.popovers.get(r)?.teardown(),i&&e.focus()}}closeSiblingBranches(e){let i=e.parentElement;if(i)for(let r of this.getDirectItems(i))r!==e&&r.getAttribute("aria-expanded")==="true"&&this.closeSubmenu(r,!1)}scheduleClose(e){this.cancelCloseFor(e);let i=setTimeout(()=>{this.closeTimers.delete(e),this.closeSubmenu(e,!1)},xk);this.closeTimers.set(e,i)}getMenus(){return Array.from(this.config.root.querySelectorAll('[role="menu"]'))}getRootMenu(){return this.config.getRootMenu()}getDirectItems(e){return Array.from(e.querySelectorAll('[role="menuitem"]')).filter(i=>i.closest('[role="menu"]')===e)}getDirectItem(e){if(!(e instanceof HTMLElement))return null;let i=e.closest('[role="menuitem"]');return i&&i.closest('[role="menu"]')&&this.config.root.contains(i)?i:null}getSubmenu(e){let i=e.nextElementSibling;return i instanceof HTMLElement&&i.getAttribute("role")==="menu"?i:null}getTriggerForMenu(e){let i=e.previousElementSibling;return i instanceof HTMLElement&&i.getAttribute("role")==="menuitem"?i:null}isDisabled(e){return e.getAttribute("aria-disabled")==="true"||e instanceof HTMLButtonElement&&e.disabled}cancelOpenFor(e){let i=this.openTimers.get(e);i&&clearTimeout(i),this.openTimers.delete(e)}cancelCloseFor(e){let i=this.closeTimers.get(e);i&&clearTimeout(i),this.closeTimers.delete(e)}cancelAncestorCloseTimers(e){let i=e.closest('[role="menu"]');for(;i;){let r=this.getTriggerForMenu(i);if(!r)return;this.cancelCloseFor(r),i=r.closest('[role="menu"]')}}clearTimers(){for(let e of this.openTimers.values())clearTimeout(e);for(let e of this.closeTimers.values())clearTimeout(e);this.openTimers.clear(),this.closeTimers.clear()}};var rv,nv,ov,av,sv,lv,uv,cv,dv,hv,pv,fv,mv,gv;function Tk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:bv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||bv(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Sk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Rk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Sk(t){var e=Ek(t,"string");return typeof e=="symbol"?e:e+""}function Ek(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bv(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Rk(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Ok=6,Tv,wv=class extends vv{static{({e:[ov,av,sv,lv,uv,cv,dv,hv,pv,fv,mv,gv,rv],c:[Tv,nv]}=Tk(this,[Ck("rui-menu-button")],[[[_v({type:Boolean,reflect:!0,defaultValue:!1}),Ak([{ref:"trigger",attr:"aria-expanded"},{ref:"menu",bool:"hidden",invert:!0}])],0,"open"],[_v({type:String,defaultValue:"bottom-start"}),0,"placement"],[xv({ref:"trigger"}),0,"triggerTarget"],[xv({ref:"menu"}),0,"menuTarget"],[yv({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[yv({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[Ik,Dk(["open","placement"])],2,"syncOpenState"],[Tt({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[Tt({ref:"trigger",type:"click"}),2,"onTriggerClick"],[Tt({ref:"trigger",type:"keydown"}),2,"onTriggerKeydown"],[Tt({ref:"menu",type:"keydown"}),2,"onMenuKeydown"],[Tt({ref:"menu",type:"pointerover"}),2,"onMenuPointerOver"],[Tt({ref:"menu",type:"pointerout"}),2,"onMenuPointerOut"],[Tt({ref:"menu",type:"focusout"}),2,"onMenuFocusOut"],[Tt({selector:'[role="menuitem"]',type:"click"}),2,"onItemClick"]],0,void 0,vv))}open=(rv(this),ov(this));placement=(av(this),sv(this));triggerTarget=(lv(this),uv(this));menuTarget=(cv(this),dv(this));changeEvent=(hv(this),pv(this));closeEvent=(fv(this),mv(this));menuId=(gv(this),re("rui-menu"));popoverController=null;menuTree=null;pendingFocus=null;onConnected(){this.syncOpenState()}disconnectedCallback(){this.menuTree?.destroy(),this.menuTree=null,this.popoverController?.destroy(),this.popoverController=null,super.disconnectedCallback()}getItems(){return this.menuTarget?this.ensureMenuTree().getFocusableItems(this.menuTarget):[]}ensureMenuTree(){return this.menuTree||(this.menuTree=new bi({root:this,getRootMenu:()=>this.menuTarget,onActivate:e=>this.activateItem(e),onCloseRoot:e=>this.setOpen(!1,e?"trigger":null)})),this.menuTree}getSearchInput(){return this.menuTarget?.querySelector("[data-autocomplete-input]")??null}ensurePopoverController(){return this.popoverController||(this.popoverController=new ce({getAnchor:()=>this.triggerTarget,getFloating:()=>this.menuTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:Ok,portal:!1})),this.popoverController}syncOpenState(){if(!this.triggerTarget||!this.menuTarget)return;this.menuTarget.id=this.menuId,this.triggerTarget.setAttribute("aria-controls",this.menuId),this.triggerTarget.setAttribute("aria-haspopup","menu");let e=this.ensureMenuTree();e.sync(),this.open||e.closeAll();let i=this.ensurePopoverController();i.updateConfig({getPlacement:()=>this.placement,getOpen:()=>this.open}),i.sync();let r=this.pendingFocus;if(this.pendingFocus=null,!r)return;if(r==="trigger"){this.triggerTarget?.focus();return}let s=this.getSearchInput();if(s){s.focus();return}if(r==="first"&&this.getItems()[0]?.focus(),r==="last"){let d=this.getItems();d[d.length-1]?.focus()}}setOpen(e,i=null){let r=this.open;this.pendingFocus=i,this.open=e,r&&!e&&this.closeEvent.emit(),r===e&&this.syncOpenState()}onDocumentPointerDown(e){if(!this.open)return;let i=e.target;Ke(this.triggerTarget,this.menuTarget,i)&&this.setOpen(!1)}onTriggerClick(){this.setOpen(!this.open,this.open?null:"first")}onTriggerKeydown(e){switch(e.key){case"ArrowDown":case"Enter":case" ":e.preventDefault(),this.setOpen(!0,"first");break;case"ArrowUp":e.preventDefault(),this.setOpen(!0,"last");break;default:break}}onMenuKeydown(e){this.ensureMenuTree().handleKeydown(e)}onMenuPointerOver(e){this.ensureMenuTree().handlePointerOver(e)}onMenuPointerOut(e){this.ensureMenuTree().handlePointerOut(e)}onMenuFocusOut(e){this.ensureMenuTree().handleFocusOut(e)}onItemClick(e){this.ensureMenuTree().handleClick(e)}activateItem(e){let i=e.getAttribute("data-value")||e.textContent?.trim()||"";this.changeEvent.emit({value:i}),this.setOpen(!1,"trigger")}static{nv()}};import{jsx as He,jsxs as Sv}from"@ecopages/jsx/jsx-runtime";import{jsx as Vk}from"@ecopages/jsx/jsx-runtime";function Wi({orientation:t="horizontal",class:e,...i}){return Vk("hr",{...i,class:j("rui-separator",e),role:"separator","aria-orientation":t,"data-orientation":t})}import{Fragment as kk,jsxs as Mk}from"@ecopages/jsx/jsx-runtime";function Hi(t,e){return t.map(i=>{if(i.type==="separator")return e.Separator({id:i.id});let r=!!i.items?.length;return Mk(kk,{children:[e.Item({value:i.value,disabled:i.disabled,hasSubmenu:r,children:i.label}),r?e.Submenu({children:Hi(i.items??[],e)}):null]})})}function Ev({children:t,class:e,variant:i="filled",size:r="md",...s}){return Sv(Je,{...s,variant:i,size:r,"data-ref":"trigger",class:j("rui-menu-button__trigger",e),"aria-haspopup":"menu",children:[t,He(Xe,{class:"rui-menu-button__chevron"})]})}function Rv({children:t,class:e,...i}){return He("div",{...i,"data-ref":"menu",class:j("rui-menu-button__menu","rui-popover","rui-floating",e),role:"menu",children:t})}function Av({children:t,class:e,...i}){return He("div",{...i,"data-ref":"submenu-menu",class:j("rui-menu-button__menu","rui-menu-button__submenu","rui-popover","rui-floating",e),role:"menu",hidden:!0,children:t})}function Iv({children:t,value:e,disabled:i,hasSubmenu:r,class:s,...d}){return He("button",{...d,type:"button",class:j("rui-menu-button__item",s),role:"menuitem","data-value":e,"aria-haspopup":r?"menu":void 0,"aria-disabled":i?"true":void 0,disabled:i,tabIndex:-1,children:t})}function Lk({trigger:t,items:e,children:i,class:r,...s}){return t==null&&e==null?He("rui-menu-button",{...s,class:j("rui-menu-button",r),children:i}):Sv("rui-menu-button",{...s,class:j("rui-menu-button",r),children:[He(Ev,{children:t}),He(Rv,{children:e?Hi(e,{Item:d=>He(Iv,{...d}),Submenu:d=>He(Av,{...d}),Separator:d=>He(Wi,{},d.id)}):i})]})}import{RadiantElement as Pv,customElement as Uk,event as zk,onEvent as St,prop as qk}from"@ecopages/radiant";var Cv,Dv,Ov,Vv,kv,Mv;function Pk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Lv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Lv(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:jk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Bk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function jk(t){var e=Fk(t,"string");return typeof e=="symbol"?e:e+""}function Fk(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lv(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Bk(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Fv,jv=class extends Pv{static{({e:[Ov,Vv,kv,Mv,Cv],c:[Fv,Dv]}=Pk(this,[Uk("rui-menubar")],[[qk({type:String,defaultValue:""}),0,"label"],[zk({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[St({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[St({selector:'[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]',type:"keydown"}),2,"onTopKeydown"],[St({selector:'[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]',type:"click"}),2,"onTopClick"],[St({selector:'[role="menu"] > [role="menuitem"]',type:"keydown"}),2,"onMenuKeydown"],[St({selector:'[role="menu"] > [role="menuitem"]',type:"click"}),2,"onMenuItemClick"],[St({selector:'[role="menuitem"]',type:"pointerover"}),2,"onPointerOver"],[St({selector:'[role="menuitem"]',type:"pointerout"}),2,"onPointerOut"],[St({selector:'[role="menuitem"]',type:"focusout"}),2,"onFocusOut"]],0,void 0,Pv))}label=(Cv(this),Ov(this));changeEvent=(Vv(this),kv(this));openRoot=(Mv(this),null);popoverController=null;menuTree=null;getTopItems(){return Array.from(this.querySelectorAll('[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]'))}getMenuFor(e){return e.closest('[data-ref="menubar-root"]')?.querySelector(':scope > [role="menu"]')??null}onConnected(){ue(this.getTopItems(),0),this.ensureMenuTree().sync()}disconnectedCallback(){this.menuTree?.destroy(),this.menuTree=null,this.popoverController?.destroy(),this.popoverController=null,super.disconnectedCallback()}ensureMenuTree(){return this.menuTree||(this.menuTree=new bi({root:this,getRootMenu:()=>this.getOpenMenuSurface(),onActivate:e=>this.activateItem(e),onCloseRoot:e=>this.closeOpenMenu(e)})),this.menuTree}getOpenMenuAnchor(){return this.openRoot?this.openRoot.querySelector(':scope > [role="menuitem"]'):null}getOpenMenuSurface(){return this.openRoot?this.openRoot.querySelector(':scope > [role="menu"]'):null}syncOpenMenuPosition(){let e=this.getOpenMenuAnchor(),i=this.getOpenMenuSurface();!e||!i||(this.popoverController||(this.popoverController=new ce({getAnchor:()=>this.getOpenMenuAnchor(),getFloating:()=>this.getOpenMenuSurface(),getOpen:()=>!!this.openRoot,getPlacement:()=>"bottom-start",gap:6,portal:!1})),this.popoverController.updateConfig({getAnchor:()=>this.getOpenMenuAnchor(),getFloating:()=>this.getOpenMenuSurface(),getOpen:()=>!!this.openRoot}),this.popoverController.sync())}closeOpenMenu(e=!1){if(!this.openRoot)return;this.menuTree?.closeAll();let i=this.openRoot.querySelector(':scope > [role="menuitem"]'),r=this.openRoot.querySelector(':scope > [role="menu"]');i&&i.setAttribute("aria-expanded","false"),r&&(r.hidden=!0),this.openRoot=null,this.popoverController?.teardown(),e&&i&&i.focus()}openMenu(e,i="first"){let r=e.closest('[data-ref="menubar-root"]'),s=this.getMenuFor(e);!r||!s||(this.openRoot&&this.openRoot!==r&&this.closeOpenMenu(),e.setAttribute("aria-expanded","true"),s.hidden=!1,this.openRoot=r,this.syncOpenMenuPosition(),this.ensureMenuTree().sync(),i==="first"&&this.ensureMenuTree().getFocusableItems(s)[0]?.focus())}onDocumentPointerDown(e){this.openRoot&&Ke(this.getOpenMenuAnchor(),this.getOpenMenuSurface(),e.target)&&this.closeOpenMenu()}onTopKeydown(e){let i=this.getTopItems(),r=e.target.closest('[role="menuitem"]');if(!r||!i.includes(r))return;if(e.key==="ArrowDown"||e.key==="Enter"||e.key===" "){this.getMenuFor(r)&&(e.preventDefault(),this.openMenu(r,"first"));return}if(e.key==="Escape"){e.preventDefault(),this.closeOpenMenu(!0);return}let s=de({items:i,current:r,key:e.key,orientation:"horizontal"});s.handled&&(e.preventDefault(),this.openRoot&&(this.getMenuFor(s.item)?this.openMenu(s.item,"first"):this.closeOpenMenu()))}onTopClick(e){let i=e.target.closest('[role="menuitem"]');if(!i||!this.getTopItems().includes(i))return;if(!this.getMenuFor(i)){this.closeOpenMenu();return}i.getAttribute("aria-expanded")==="true"?this.closeOpenMenu():this.openMenu(i,null)}onMenuKeydown(e){let i=e.target.closest('[role="menu"]'),r=e.target.closest('[role="menuitem"]');if(!i||!r||!this.contains(i)||this.ensureMenuTree().handleKeydown(e)||e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;let s=this.getOpenMenuAnchor();if(!s)return;e.preventDefault();let d=de({items:this.getTopItems(),current:s,key:e.key,orientation:"horizontal"});d.handled&&this.getMenuFor(d.item)&&this.openMenu(d.item,"first")}onMenuItemClick(e){this.ensureMenuTree().handleClick(e)}onPointerOver(e){let r=e.target?.closest('[data-ref="menubar-root"] > [role="menuitem"]');if(r&&this.getTopItems().includes(r)&&this.openRoot&&this.getMenuFor(r)){let s=r.closest('[data-ref="menubar-root"]');s&&s!==this.openRoot&&this.openMenu(r,null);return}this.ensureMenuTree().handlePointerOver(e)}onPointerOut(e){this.ensureMenuTree().handlePointerOut(e)}onFocusOut(e){this.ensureMenuTree().handleFocusOut(e)}activateItem(e){let i=e.getAttribute("data-value")||e.textContent?.trim()||"";this.changeEvent.emit({value:i}),this.closeOpenMenu(!0)}static{Dv()}};import{jsx as Ye,jsxs as Kk}from"@ecopages/jsx/jsx-runtime";function Bv({label:t,children:e,disabled:i}){let r=e!=null;return Kk("div",{class:"rui-menubar__root","data-ref":"menubar-root",children:[Ye("button",{type:"button",class:"rui-menubar__item",role:"menuitem",tabindex:-1,"aria-haspopup":r?"true":void 0,"aria-expanded":r?"false":void 0,"aria-disabled":i?"true":void 0,disabled:i,children:t}),r?Ye("div",{class:"rui-menubar__menu rui-popover rui-floating","data-ref":"menu",role:"menu",hidden:!0,children:e}):null]})}function Uv({children:t,value:e,disabled:i,hasSubmenu:r,class:s,...d}){return Ye("button",{...d,type:"button",class:j("rui-menubar__menu-item",s),role:"menuitem","data-value":e,"aria-haspopup":r?"menu":void 0,"aria-disabled":i?"true":void 0,disabled:i,tabIndex:-1,children:t})}function zv({children:t,class:e,...i}){return Ye("div",{...i,"data-ref":"submenu-menu",class:j("rui-menubar__menu","rui-menubar__submenu","rui-popover","rui-floating",e),role:"menu",hidden:!0,children:t})}function $k({items:t,label:e,children:i,...r}){let s=t!=null?t.map(d=>Ye(Bv,{label:d.label,disabled:d.disabled,children:d.items?.length?Hi(d.items,{Item:h=>Ye(Uv,{...h}),Submenu:h=>Ye(zv,{...h}),Separator:h=>Ye(Wi,{},h.id)}):null})):i;return Ye("rui-menubar",{...r,label:e,children:Ye("div",{class:"rui-menubar","data-ref":"root",role:"menubar","aria-label":e||void 0,children:s})})}import{jsx as Fo,jsxs as Bo}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as ty,customElement as Nk,onUpdated as Xk,prop as Jr,state as Qk}from"@ecopages/radiant";var qv,Kv,$v,Gv,Wv,Hv,Yv,Nv,Xv,Qv,Jv,Zv;function Gk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ey(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ey(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Wk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Yk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Wk(t){var e=Hk(t,"string");return typeof e=="symbol"?e:e+""}function Hk(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ey(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Yk(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var ry,iy=class extends ty{static{({e:[$v,Gv,Wv,Hv,Yv,Nv,Xv,Qv,Jv,Zv,qv],c:[ry,Kv]}=Gk(this,[Nk("rui-meter")],[[Jr({type:Number,reflect:!0,defaultValue:0}),0,"value"],[Jr({type:Number,defaultValue:0}),0,"min"],[Jr({type:Number,defaultValue:100}),0,"max"],[Jr({type:String,defaultValue:""}),0,"label"],[Qk,0,"percent"],[Xk(["value","min","max"]),2,"onRangeUpdated"]],0,void 0,ty))}value=(qv(this),$v(this));min=(Gv(this),Wv(this));max=(Hv(this),Yv(this));label=(Nv(this),Xv(this));percent=(Qv(this),Jv(this,0));resolvedAriaLabel=(Zv(this),this.$.label.map(e=>e||void 0));trackStyle=this.$.percent.map(e=>({"--rui-meter-percent":`${e}%`}));onRangeUpdated(){let e=this.max===this.min?0:Math.round((this.value-this.min)/(this.max-this.min)*100);this.percent=Math.min(100,Math.max(0,e))}render(){return Bo("div",{class:"rui-meter",children:[this.label?Fo("span",{class:"rui-meter__label",children:this.$.label}):null,Bo("meter",{class:"rui-meter__bar",min:this.$.min,max:this.$.max,value:this.$.value,"aria-label":this.resolvedAriaLabel,children:[this.$.percent,"%"]}),Fo("div",{class:"rui-meter__track",style:this.trackStyle,"aria-hidden":"true",children:Fo("div",{class:"rui-meter__fill"})}),Bo("span",{class:"rui-meter__value","aria-hidden":"true",children:[this.$.percent,"%"]})]})}static{Kv()}};import{jsx as Jk}from"@ecopages/jsx/jsx-runtime";function Zk(t){return Jk("rui-meter",{...t})}import{jsx as Kt}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as my,customElement as nM,onEvent as Fe,prop as Zr}from"@ecopages/radiant";var ny,oy,ay,sy,ly,uy,cy,dy,hy,py;function eM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:fy(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||fy(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:tM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return rM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function tM(t){var e=iM(t,"string");return typeof e=="symbol"?e:e+""}function iM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fy(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function rM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var by=200,vy=150,oM=8,yy,gy=class extends my{static{({e:[ay,sy,ly,uy,cy,dy,hy,py,ny],c:[yy,oy]}=eM(this,[nM("rui-navigation-menu")],[[Zr({type:String,defaultValue:""}),0,"label"],[Zr({type:Boolean,reflect:!0,attribute:"open-on-hover",defaultValue:!1}),0,"openOnHover"],[Zr({type:Number,attribute:"hover-delay",defaultValue:by}),0,"hoverDelay"],[Zr({type:Number,attribute:"close-delay",defaultValue:vy}),0,"closeDelay"],[Fe({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[Fe({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[Fe({ref:"root",type:"keydown"}),2,"onRootKeydown"],[Fe({selector:"[data-navigation-trigger]",type:"click"}),2,"onTriggerClick"],[Fe({selector:"[data-navigation-trigger]",type:"pointerover"}),2,"onTriggerPointerOver"],[Fe({selector:"[data-navigation-trigger]",type:"pointerout"}),2,"onTriggerPointerOut"],[Fe({selector:"[data-navigation-panel]",type:"pointerover"}),2,"onPanelPointerOver"],[Fe({selector:"[data-navigation-panel]",type:"pointerout"}),2,"onPanelPointerOut"],[Fe({selector:"[data-navigation-item]",type:"pointerover"}),2,"onBarItemPointerOver"],[Fe({selector:"[data-navigation-item]",type:"keydown"}),2,"onBarItemKeydown"],[Fe({selector:"[data-navigation-panel]",type:"keydown"}),2,"onPanelKeydown"]],0,void 0,my))}label=(ny(this),ay(this));openOnHover=(sy(this),ly(this));hoverDelay=(uy(this),cy(this));closeDelay=(dy(this),hy(this));openValue=(py(this),null);popoverController=null;openTimer=null;closeTimer=null;onConnected(){this.syncPanels(),this.syncBarRovingTabindex(),this.syncPopover()}disconnectedCallback(){this.clearHoverTimers(),this.popoverController?.destroy(),this.popoverController=null,super.disconnectedCallback()}clearHoverTimers(){this.openTimer&&clearTimeout(this.openTimer),this.closeTimer&&clearTimeout(this.closeTimer),this.openTimer=null,this.closeTimer=null}getBarItems(){return Array.from(this.querySelectorAll("[data-navigation-item]"))}syncBarRovingTabindex(){let e=this.getBarItems(),i=Math.max(0,e.findIndex(r=>r.tabIndex===0||r===document.activeElement));ue(e,i)}isBarTrigger(e){return e.hasAttribute("data-navigation-trigger")}getTriggers(){return Array.from(this.querySelectorAll("[data-navigation-trigger]"))}getPanel(e){return this.querySelector(`[data-navigation-panel][data-value="${e}"]`)}getTrigger(e){return this.querySelector(`[data-navigation-trigger][data-value="${e}"]`)}getPanels(){return Array.from(this.querySelectorAll("[data-navigation-panel]"))}getPanelFocusables(e){return kr(e)}getOpenTrigger(){return this.openValue?this.getTrigger(this.openValue):null}getOpenPanel(){return this.openValue?this.getPanel(this.openValue):null}focusPanelEntry(e){let i=this.getPanel(e);if(!i){this.getTrigger(e)?.focus();return}let r=this.getPanelFocusables(i);if(r.length>0){r[0].focus();return}i.hasAttribute("tabindex")||(i.tabIndex=-1),i.focus()}ensurePairIds(e,i){e.id||(e.id=re("rui-navigation-trigger")),i.id||(i.id=re("rui-navigation-panel"))}syncPanels(){for(let e of this.getPanels()){let i=e.getAttribute("data-value")??"",r=this.openValue===i;e.toggleAttribute("hidden",!r),e.dataset.state=r?"open":"closed",e.setAttribute("aria-hidden",String(!r)),e.setAttribute("role","region");let s=this.getTrigger(i);s&&(this.ensurePairIds(s,e),s.setAttribute("aria-expanded",String(r)),s.setAttribute("aria-controls",e.id),e.setAttribute("aria-labelledby",s.id))}for(let e of this.getTriggers()){let i=e.getAttribute("data-value")??"",r=this.openValue===i;e.setAttribute("aria-expanded",String(r)),this.getPanel(i)?e.setAttribute("aria-haspopup","true"):e.removeAttribute("aria-haspopup")}}ensurePopoverController(){return this.popoverController||(this.popoverController=new ce({getAnchor:()=>this.getOpenTrigger(),getFloating:()=>this.getOpenPanel(),getOpen:()=>!!this.openValue,getPlacement:()=>"bottom-start",gap:oM,portal:!1})),this.popoverController}syncPopover(){let e=this.ensurePopoverController();e.updateConfig({getAnchor:()=>this.getOpenTrigger(),getFloating:()=>this.getOpenPanel(),getOpen:()=>!!this.openValue}),e.sync()}closeMenu(e=!1){let i=this.openValue;i&&(this.clearHoverTimers(),this.openValue=null,this.syncPanels(),this.syncPopover(),e&&this.getTrigger(i)?.focus())}openPanel(e,i={}){let{focusPanel:r=!0,toggle:s=!0}=i;if(this.openValue===e){s&&this.closeMenu(!0);return}this.clearHoverTimers();let d=this.getOpenPanel(),h=!!(d&&document.activeElement instanceof Node&&d.contains(document.activeElement));this.openValue=e,this.syncPanels(),this.syncPopover(),queueMicrotask(()=>{if(r){this.focusPanelEntry(e);return}h&&this.getTrigger(e)?.focus()})}isTouchPointer(e){return e.pointerType==="touch"}pointerIsInOpenMenu(e){return e instanceof Node?!Ke(this.getOpenTrigger(),this.getOpenPanel(),e):!1}triggerValueFromEvent(e){let i=e.target;return i instanceof Element?i.closest("[data-navigation-trigger]")?.getAttribute("data-value")??null:null}scheduleHoverOpen(e){if(!this.openOnHover||!this.getPanel(e)||(this.clearHoverTimers(),this.openValue===e))return;let i=this.openValue?0:Math.max(0,this.hoverDelay);if(i<=0){this.openPanel(e,{focusPanel:!1,toggle:!1});return}this.openTimer=setTimeout(()=>{this.openTimer=null,this.openPanel(e,{focusPanel:!1,toggle:!1})},i)}scheduleHoverClose(){if(!this.openOnHover||!this.openValue){this.clearHoverTimers();return}this.clearHoverTimers();let e=Math.max(0,this.closeDelay);if(e<=0){this.closeMenu();return}this.closeTimer=setTimeout(()=>{this.closeTimer=null,this.closeMenu()},e)}onDocumentPointerDown(e){this.openValue&&(this.pointerIsInOpenMenu(e.target)||this.closeMenu())}onDocumentKeydown(e){if(e.key!=="Escape"||!this.openValue)return;let i=document.activeElement,r=this.getOpenPanel();i&&!this.contains(i)&&!(r&&r.contains(i))||(e.preventDefault(),this.closeMenu(!0))}onRootKeydown(e){e.key==="Escape"&&this.openValue&&(e.preventDefault(),this.closeMenu(!0))}onTriggerClick(e){let i=e.target.closest("[data-navigation-trigger]"),r=i?.getAttribute("data-value");!i||!r||(e.preventDefault(),this.openPanel(r))}onTriggerPointerOver(e){if(!this.openOnHover||this.isTouchPointer(e))return;let i=this.triggerValueFromEvent(e);i&&this.scheduleHoverOpen(i)}onTriggerPointerOut(e){if(!this.openOnHover||this.isTouchPointer(e)||this.pointerIsInOpenMenu(e.relatedTarget))return;let i=e.relatedTarget;i instanceof Element&&i.closest("[data-navigation-trigger]")&&this.contains(i)||this.scheduleHoverClose()}onPanelPointerOver(e){if(!this.openOnHover||this.isTouchPointer(e)||!this.openValue)return;let i=e.target.closest("[data-navigation-panel]");!i||i.getAttribute("data-value")!==this.openValue||this.clearHoverTimers()}onPanelPointerOut(e){!this.openOnHover||this.isTouchPointer(e)||this.pointerIsInOpenMenu(e.relatedTarget)||this.scheduleHoverClose()}onBarItemPointerOver(e){if(!this.openOnHover||this.isTouchPointer(e)||!this.openValue)return;let i=e.target.closest("[data-navigation-item]");!i||this.isBarTrigger(i)||this.scheduleHoverClose()}onBarItemKeydown(e){let i=e.target.closest("[data-navigation-item]");if(!i||this.handleBarTriggerKeydown(e,i))return;let r=de({items:this.getBarItems(),current:i,key:e.key,orientation:"horizontal",wrap:!1});r.handled&&(e.preventDefault(),this.syncMenuToBarItem(r.item))}handleBarTriggerKeydown(e,i){if(e.key==="Escape")return this.openValue&&(e.preventDefault(),this.closeMenu(!0)),!0;let r=i.getAttribute("data-value");return!this.isBarTrigger(i)||!r?!1:e.key==="Enter"||e.key===" "?(e.preventDefault(),this.openPanel(r),!0):e.key!=="ArrowDown"?!1:(e.preventDefault(),this.openValue===r?this.focusPanelEntry(r):this.openPanel(r),!0)}syncMenuToBarItem(e){if(!this.openValue)return;let i=e.getAttribute("data-value");this.isBarTrigger(e)&&i?this.openPanel(i):this.closeMenu(!1)}onPanelKeydown(e){let i=e.target;if(!(i instanceof Element))return;let r=i.closest("[data-navigation-panel]");if(!r||r.hidden)return;let s=r.getAttribute("data-value");if(!s||this.openValue!==s)return;let d=document.activeElement instanceof HTMLElement?document.activeElement:null;if(!d||!r.contains(d))return;if(e.key==="Escape"){e.preventDefault(),this.closeMenu(!0);return}let h=this.getPanelFocusables(r);if(e.key==="ArrowUp"&&d===h[0]){e.preventDefault(),this.getTrigger(s)?.focus();return}!h.length||!de({items:h,current:d,key:e.key,orientation:"vertical",wrap:!1}).handled||e.preventDefault()}static{oy()}};function aM({children:t,class:e,...i}){return Kt("div",{...i,"data-ref":"bar",class:j("rui-navigation-menu__bar",e),children:t})}function sM({children:t,class:e,...i}){return Kt("div",{...i,"data-ref":"panels",class:j("rui-navigation-menu__panels",e),children:t})}function lM({children:t,label:e,...i}){return Kt("rui-navigation-menu",{...i,label:e,children:Kt("nav",{class:"rui-navigation-menu","data-ref":"root","aria-label":e||void 0,children:t})})}function uM({children:t,value:e,variant:i="ghost",class:r,...s}){return Kt(Je,{...s,variant:i,class:r,"data-navigation-item":!0,"data-navigation-trigger":!0,"data-value":e,children:t})}function cM({children:t,href:e,class:i,...r}){return Kt("a",{...r,href:e,"data-navigation-item":!0,class:j("rui-button","rui-button--ghost","rui-button--md",i),children:t})}function dM({children:t,value:e,class:i,...r}){return Kt("div",{...r,class:j("rui-navigation-menu__panel","rui-popover","rui-floating",i),"data-navigation-panel":!0,"data-value":e,children:t})}import{bindTo as Go,customElement as bM,event as vM,onEvent as $t,onUpdated as yM,prop as Ee,state as i_}from"@ecopages/radiant";import{FormAssociatedElement as r_}from"@ecopages/radiant/form-associated-element";function Uo(t,e){return new Intl.NumberFormat(t,e)}function zo(t,e,i){return Number.isFinite(t)?Uo(e,i).format(t):""}function qo(t,e,i){let r=t.trim();if(!r)return null;let d=Uo(e,i).formatToParts(1234.5),h=d.find(S=>S.type==="decimal")?.value??".",a=d.find(S=>S.type==="group")?.value??",",E=r.replaceAll(a,"").replace(h,".").replace(/[^\d.-]/g,""),A=Number(E);return Number.isFinite(A)?A:null}function Ko(t){if(t)try{let e=JSON.parse(t);return hM(e)?(new Intl.NumberFormat(void 0,e),e):void 0}catch{return}}function hM(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function $o(t,e,i,r){if(!Number.isFinite(t))return Number.isFinite(e)?e:0;if(!Number.isFinite(r)||r===0)return _y(t,e,i);let s=Number.isFinite(e)?e:0,d=Math.round((t-s)/r)*r+s;return _y(d,e,i)}function _y(t,e,i){let r=t;return Number.isFinite(e)&&(r=Math.max(e,r)),Number.isFinite(i)&&(r=Math.min(i,r)),r}var xy,wy,Ty,Sy,Ey,Ry,Ay,Iy,Cy,Dy,Oy,Vy,ky,My,Ly,Py,jy,Fy,By,Uy,zy,qy,Ky,$y,Gy,Wy,Hy,Yy,Ny,Xy,Qy,Jy,Zy,e_;function pM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:t_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||t_(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:fM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return gM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function fM(t){var e=mM(t,"string");return typeof e=="symbol"?e:e+""}function mM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function t_(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function gM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var o_,n_=class extends r_{static{({e:[Ty,Sy,Ey,Ry,Ay,Iy,Cy,Dy,Oy,Vy,ky,My,Ly,Py,jy,Fy,By,Uy,zy,qy,Ky,$y,Gy,Wy,Hy,Yy,Ny,Xy,Qy,Jy,Zy,e_,xy],c:[o_,wy]}=pM(this,[bM("rui-number-field")],[[Ee({type:Number,reflect:!0,defaultValue:void 0}),0,"value"],[Ee({type:Number,attribute:"default-value",defaultValue:void 0}),0,"defaultValue"],[[Ee({type:Number,attribute:"min-value",defaultValue:Number.NEGATIVE_INFINITY}),Go({selector:"[data-number-field-input]",attr:"aria-valuemin",map:e=>Number.isFinite(e)?String(e):void 0})],0,"minValue"],[[Ee({type:Number,attribute:"max-value",defaultValue:Number.POSITIVE_INFINITY}),Go({selector:"[data-number-field-input]",attr:"aria-valuemax",map:e=>Number.isFinite(e)?String(e):void 0})],0,"maxValue"],[Ee({type:Number,defaultValue:1}),0,"step"],[[Ee({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),Go({selector:"[data-number-field-input]",bool:"data-readonly"})],0,"readOnly"],[Ee({type:String,defaultValue:""}),0,"label"],[Ee({type:String,defaultValue:""}),0,"locale"],[Ee({type:String,attribute:"format-options",defaultValue:""}),0,"formatOptions"],[Ee({type:String,attribute:"commit-behavior",defaultValue:"snap"}),0,"commitBehavior"],[Ee({type:String,attribute:"increment-aria-label",defaultValue:""}),0,"incrementAriaLabel"],[Ee({type:String,attribute:"decrement-aria-label",defaultValue:""}),0,"decrementAriaLabel"],[Ee({type:Boolean,attribute:"wheel-disabled",defaultValue:!1}),0,"wheelDisabled"],[vM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[i_,0,"decreaseDisabled"],[i_,0,"increaseDisabled"],[yM(["value","defaultValue","minValue","maxValue","step","label","name","disabled","readOnly","effectiveDisabled","locale","formatOptions","commitBehavior"]),2,"onPropsUpdated"],[$t({selector:'[data-number-field-action="decrement"]',type:"click"}),2,"decrement"],[$t({selector:'[data-number-field-action="increment"]',type:"click"}),2,"increment"],[$t({selector:"[data-number-field-input]",type:"focusin"}),2,"onInputFocus"],[$t({selector:"[data-number-field-input]",type:"focusout"}),2,"onInputBlur"],[$t({selector:"[data-number-field-input]",type:"input"}),2,"onInput"],[$t({selector:"[data-number-field-input]",type:"keydown"}),2,"onKeydown"],[$t({selector:"[data-number-field-input]",type:"wheel"}),2,"onWheel"]],0,void 0,r_))}value=(xy(this),Ty(this));defaultValue=(Sy(this),Ey(this));minValue=(Ry(this),Ay(this));maxValue=(Iy(this),Cy(this));step=(Dy(this),Oy(this));readOnly=(Vy(this),ky(this));label=(My(this),Ly(this));locale=(Py(this),jy(this));formatOptions=(Fy(this),By(this));commitBehavior=(Uy(this),zy(this));incrementAriaLabel=(qy(this),Ky(this));decrementAriaLabel=($y(this),Gy(this));wheelDisabled=(Wy(this),Hy(this));changeEvent=(Yy(this),Ny(this));decreaseDisabled=(Xy(this),Qy(this,!1));increaseDisabled=(Jy(this),Zy(this,!1));editing=(e_(this),!1);draftValue="";initialized=!1;uid=re("rui-number-field");get resolvedLocale(){return ht(this.locale)}get resolvedFormatOptions(){return Ko(this.formatOptions)}get inputId(){return`${this.uid}-input`}getNumericValue(){return typeof this.value=="number"&&Number.isFinite(this.value)?this.value:typeof this.defaultValue=="number"&&Number.isFinite(this.defaultValue)?this.defaultValue:0}getInput(){return this.querySelector("[data-number-field-input]")}syncLabel(){let e=this.getInput();qe(this,e,{controlId:this.inputId,label:this.label,labelId:`${this.uid}-label`})}syncInput(){let e=this.getInput();if(!e)return;e.id||(e.id=this.inputId);let i=this.getNumericValue();e.disabled=this.effectiveDisabled,e.toggleAttribute("data-disabled",e.disabled),e.setAttribute("role","spinbutton"),e.setAttribute("inputmode","decimal"),e.setAttribute("aria-valuenow",String(i)),this.editing||(e.value=zo(i,this.resolvedLocale,this.resolvedFormatOptions))}updateStepperState(){let e=this.getNumericValue();this.decreaseDisabled=this.effectiveDisabled||this.readOnly||e<=this.minValue,this.increaseDisabled=this.effectiveDisabled||this.readOnly||e>=this.maxValue,queueMicrotask(()=>this.syncSlottedSteppers())}syncSlottedSteppers(){let e=this.incrementAriaLabel||"Increment",i=this.decrementAriaLabel||"Decrement";for(let r of this.querySelectorAll('[data-number-field-action="decrement"]'))r.disabled=this.decreaseDisabled,r.setAttribute("aria-label",i);for(let r of this.querySelectorAll('[data-number-field-action="increment"]'))r.disabled=this.increaseDisabled,r.setAttribute("aria-label",e)}commitValue(e,i=!1){let r=e;if((this.commitBehavior==="snap"||i)&&(r=$o(e,this.minValue,this.maxValue,this.step)),r===this.getNumericValue()){this.editing=!1,this.syncInput(),this.updateStepperState();return}this.value=r,this.changeEvent.emit({value:r}),this.editing=!1,this.syncInput(),this.updateStepperState()}commitDraft(){let e=qo(this.draftValue,this.resolvedLocale,this.resolvedFormatOptions);if(e==null){this.editing=!1,this.syncInput();return}if(this.commitBehavior==="validate"&&(e<this.minValue||e>this.maxValue)){this.editing=!1,this.syncInput();return}this.commitValue(e)}initialize(){this.initialized||(this.initialized=!0,this.value==null&&this.defaultValue!=null&&(this.value=this.defaultValue),this.syncLabel(),this.syncInput(),this.updateStepperState())}formValue(){return this.name?String(this.getNumericValue()):null}formState(){return this.value==null?"":String(this.value)}restoreFormState(e){this.value=e===""||e==null?void 0:Number(e),this.editing=!1,this.draftValue="",this.syncInput(),this.updateStepperState()}onConnected(){this.initialize()}onPropsUpdated(){this.syncLabel(),this.syncInput(),this.updateStepperState()}decrement(e){e.preventDefault(),!this.decreaseDisabled&&this.commitValue(this.getNumericValue()-this.step,!0)}increment(e){e.preventDefault(),!this.increaseDisabled&&this.commitValue(this.getNumericValue()+this.step,!0)}onInputFocus(e){if(this.effectiveDisabled||this.readOnly)return;let i=e.target;this.editing=!0,this.draftValue=String(this.getNumericValue()),i.value=this.draftValue,i.select()}onInputBlur(){this.editing&&this.commitDraft()}onInput(e){this.effectiveDisabled||this.readOnly||(this.editing=!0,this.draftValue=e.target.value)}onKeydown(e){if(!(this.effectiveDisabled||this.readOnly)){if(e.key==="ArrowUp"){e.preventDefault(),this.increment(e);return}if(e.key==="ArrowDown"){e.preventDefault(),this.decrement(e);return}if(e.key==="Home"&&Number.isFinite(this.minValue)){e.preventDefault(),this.commitValue(this.minValue,!0);return}if(e.key==="End"&&Number.isFinite(this.maxValue)){e.preventDefault(),this.commitValue(this.maxValue,!0);return}e.key==="Enter"&&(e.preventDefault(),this.commitDraft(),this.getInput()?.blur())}}onWheel(e){if(this.wheelDisabled||this.effectiveDisabled||this.readOnly)return;let i=e.target;document.activeElement===i&&(e.preventDefault(),e.deltaY<0?this.increment(e):e.deltaY>0&&this.decrement(e))}static{wy()}};import{jsx as Be,jsxs as a_}from"@ecopages/jsx/jsx-runtime";function s_({children:t,class:e,...i}){return Be("div",{...i,"data-number-field-group":!0,class:j("rui-number-field__group",e),children:t})}function l_({class:t,disabled:e,readOnly:i,...r}){return Be("input",{...r,type:"text","data-number-field-input":!0,"data-rui-control":!0,"data-rui-control-type":"number",class:j("rui-number-field__input",t),disabled:e,readOnly:i})}function u_({children:t,class:e,...i}){return Be("div",{...i,class:j("rui-number-field__steppers",e),children:t})}function c_({children:t,class:e,aria:i,disabled:r,...s}){return Be("button",{...s,aria:ne(i,"Increment"),type:"button","data-number-field-action":"increment",class:j("rui-number-field__stepper",e),disabled:r,tabIndex:-1,children:t??"+"})}function d_({children:t,class:e,aria:i,disabled:r,...s}){return Be("button",{...s,aria:ne(i,"Decrement"),type:"button","data-number-field-action":"decrement",class:j("rui-number-field__stepper",e),disabled:r,tabIndex:-1,children:t??"\u2212"})}function _M(){return a_(s_,{children:[Be(l_,{}),a_(u_,{children:[Be(d_,{}),Be(c_,{})]})]})}function xM({children:t,...e}){return Be("rui-number-field",{...e,children:Be("div",{class:"rui-number-field","data-ref":"root",children:t??Be(_M,{})})})}import{jsx as _e,jsxs as Ho}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as A_,customElement as RM,event as AM,onEvent as IM,prop as Yi}from"@ecopages/radiant";var h_,p_,f_,m_,g_,b_,v_,y_,__,x_,w_,T_,S_,E_;function wM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:R_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||R_(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:TM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return EM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function TM(t){var e=SM(t,"string");return typeof e=="symbol"?e:e+""}function SM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function R_(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function EM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Wo="Pagination";function en(t,e){return Math.min(Math.max(1,Math.floor(t)||1),e)}var C_,I_=class extends A_{static{({e:[f_,m_,g_,b_,v_,y_,__,x_,w_,T_,S_,E_,h_],c:[C_,p_]}=wM(this,[RM("rui-pagination")],[[Yi({type:String,defaultValue:Wo}),0,"label"],[Yi({type:Number,reflect:!0,defaultValue:1}),0,"page"],[Yi({type:Number,attribute:"page-count",defaultValue:1}),0,"pageCount"],[Yi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Yi({type:Number,attribute:"sibling-count",defaultValue:1}),0,"siblingCount"],[AM({name:"rui-page-change",bubbles:!0,composed:!0}),0,"pageChangeEvent"],[IM({selector:"[data-pagination-page]",type:"click"}),2,"onPageClick"]],0,void 0,A_))}constructor(...e){super(...e),E_(this)}label=(h_(this),f_(this));page=(m_(this),g_(this));pageCount=(b_(this),v_(this));disabled=(y_(this),__(this));siblingCount=(x_(this),w_(this));pageChangeEvent=(T_(this),S_(this));changePage(e){if(this.disabled)return;let i=en(e,Math.max(1,Math.floor(this.pageCount)||1));i!==this.page&&this.pageChangeEvent.emit({page:i})}onPageClick(e){let i=e.target.closest("[data-pagination-page]"),r=Number(i?.getAttribute("data-pagination-page"));Number.isInteger(r)&&this.changePage(r)}static{p_()}};function CM(t,e,i){let r=i*2+5;if(e<=r)return Array.from({length:e},(a,E)=>E+1);let s=Math.max(2,t-i),d=Math.min(e-1,t+i),h=[1];s>2&&h.push("start-ellipsis");for(let a=s;a<=d;a+=1)h.push(a);return d<e-1&&h.push("end-ellipsis"),h.push(e),h}function D_({label:t,page:e,pageCount:i,disabled:r=!1,siblingCount:s=1,previousText:d="Previous",previousLabel:h="Go to previous page",nextText:a="Next",nextLabel:E="Go to next page",pageLabel:A=I=>`Go to page ${I}`,statusLabel:S=(I,T)=>`Page ${I} of ${T}`}){let I=Math.max(1,Math.floor(i)||1),T=en(e,I),K=Math.max(0,Math.floor(s)||0),$=CM(T,I,K);return _e("nav",{class:"rui-pagination__nav","aria-label":t,children:Ho("ul",{class:"rui-pagination__list",children:[_e("li",{children:Ho(Je,{variant:"ghost",size:"sm",class:"rui-pagination__link rui-pagination__link--previous","data-pagination-page":T-1,"aria-label":h,disabled:r||T<=1,children:[_e(fn,{}),_e("span",{children:d})]})}),$.map(V=>typeof V=="number"?_e("li",{class:j("rui-pagination__page",V===T&&"rui-pagination__page--current"),children:_e(Je,{variant:V===T?"filled":"ghost",size:"sm",square:!0,class:"rui-pagination__link","data-pagination-page":V,"aria-label":A(V),"aria-current":V===T?"page":void 0,disabled:r,children:V})},V):_e("li",{class:"rui-pagination__ellipsis","aria-hidden":"true",children:"\u2026"},V)),_e("li",{class:"rui-pagination__status","aria-live":"polite",children:_e("span",{class:"rui-pagination__status-label",children:S(T,I)})}),_e("li",{children:Ho(Je,{variant:"ghost",size:"sm",class:"rui-pagination__link rui-pagination__link--next","data-pagination-page":T+1,"aria-label":E,disabled:r||T>=I,children:[_e("span",{children:a}),_e(mn,{})]})})]})})}function DM({children:t,label:e=Wo,page:i=1,pageCount:r=1,disabled:s=!1,siblingCount:d=1,previousText:h,previousLabel:a,nextText:E,nextLabel:A,pageLabel:S,statusLabel:I,class:T,...K}){let $=Math.max(1,Math.floor(r)||1),V=en(i,$),G=Math.max(0,Math.floor(d)||0);return _e("rui-pagination",{...K,class:j("rui-pagination",T),label:e,page:V,pageCount:$,disabled:s,siblingCount:G,children:t??_e(D_,{label:e,page:V,pageCount:$,disabled:s,siblingCount:G,previousText:h,previousLabel:a,nextText:E,nextLabel:A,pageLabel:S,statusLabel:I})})}import{jsx as vi,jsxs as px}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as tn,bound as No,customElement as ux,event as MM,onEvent as Ni,onUpdated as cx,prop as Et,query as Xo}from"@ecopages/radiant";import{isServer as LM}from"@ecopages/radiant/is-server";var O_,V_,k_,M_,L_,P_,j_,F_,B_,U_,z_,q_,K_,$_,G_,W_,H_,Y_,N_,X_,Q_,J_,Z_,ex,tx,ix,rx,nx;function lx(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ox(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ox(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:OM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return kM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function OM(t){var e=VM(t,"string");return typeof e=="symbol"?e:e+""}function VM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ox(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function kM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var dx,ax=class extends tn{static{({e:[k_,M_,L_,P_,j_,F_,B_,U_,z_,q_,K_,$_,G_,W_,H_,Y_,N_,X_,Q_,J_,O_],c:[dx,V_]}=lx(this,[ux("rui-popover")],[[Et({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Et({type:String,defaultValue:"bottom"}),0,"placement"],[Et({type:Boolean,defaultValue:!0}),0,"portal"],[Et({type:Boolean,defaultValue:!1}),0,"matchAnchorWidth"],[Et({type:Number,defaultValue:8}),0,"offset"],[Et({type:String,defaultValue:""}),0,"anchor"],[Et({type:String,defaultValue:"default"}),0,"variant"],[Xo({ref:"surface"}),0,"surfaceTarget"],[Xo({ref:"host"}),0,"hostTarget"],[MM({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[No,cx(["open","placement","portal","matchAnchorWidth","offset","anchor"])],2,"syncPopover"],[Ni({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[Ni({ref:"host",type:"focusout"}),2,"onFocusOut"],[No,2,"onExternalAnchorClick"],[Ni({document:!0,type:"keydown"}),2,"onDocumentKeydown"]],0,void 0,tn))}open=(O_(this),k_(this));placement=(M_(this),L_(this));portal=(P_(this),j_(this));matchAnchorWidth=(F_(this),B_(this));offset=(U_(this),z_(this));anchor=(q_(this),K_(this));variant=($_(this),G_(this));surfaceTarget=(W_(this),H_(this));hostTarget=(Y_(this),N_(this));openChangeEvent=(X_(this),Q_(this));surfaceId=(J_(this),re("rui-popover"));controller=null;anchorClickTarget=null;onConnected(){this.syncPopover()}disconnectedCallback(){this.unbindExternalAnchorClick(),this.controller?.destroy(),this.controller=null,super.disconnectedCallback()}getAnchorElement(){let i=this.closest("rui-popover-trigger")?.querySelector("[data-popover-trigger]");if(i instanceof HTMLElement)return Yo(i);let r=this.querySelector("[data-popover-trigger]");if(r instanceof HTMLElement)return Yo(r);let s=this.anchor.trim();if(s){let d=document.querySelector(s);if(d instanceof HTMLElement)return Yo(d)}return null}ensureController(){return this.controller||(this.controller=new ce({getAnchor:()=>this.getAnchorElement(),getFloating:()=>this.surfaceTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:this.offset,portal:this.portal,matchAnchorWidth:this.matchAnchorWidth})),this.controller}syncPopover(){let e=this.getAnchorElement(),i=this.surfaceTarget;i&&(i.id=this.surfaceId),e&&(e.setAttribute("aria-controls",this.surfaceId),e.setAttribute("aria-expanded",String(this.open))),this.syncExternalAnchorClick(e);let r=this.ensureController();r.updateConfig({getAnchor:()=>this.getAnchorElement(),getFloating:()=>this.surfaceTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:this.offset,portal:this.portal,matchAnchorWidth:this.matchAnchorWidth}),r.sync()}setOpen(e,i=!0){if(this.open===e){this.syncPopover();return}this.open=e,i&&this.openChangeEvent.emit({open:e}),this.syncPopover()}onDocumentPointerDown(e){if(!this.open)return;let i=e.target;Ke(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,i)&&this.setOpen(!1)}onFocusOut(e){this.open&&tt(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,e.relatedTarget)&&this.setOpen(!1)}usesExternalAnchor(){return!this.anchor.trim()||this.closest("rui-popover-trigger")?!1:!this.querySelector("[data-popover-trigger]")}syncExternalAnchorClick(e){if(!this.usesExternalAnchor()||!e){this.unbindExternalAnchorClick();return}this.anchorClickTarget!==e&&(this.unbindExternalAnchorClick(),e.addEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=e)}unbindExternalAnchorClick(){this.anchorClickTarget&&(this.anchorClickTarget.removeEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=null)}onExternalAnchorClick(){this.setOpen(!this.open)}onDocumentKeydown(e){if(!this.open||e.key!=="Escape")return;e.preventDefault(),this.setOpen(!1),this.getAnchorElement()?.focus()}static{V_()}};var hx,sx=class extends tn{static{({e:[tx,ix,rx,nx,Z_],c:[hx,ex]}=lx(this,[ux("rui-popover-trigger")],[[Et({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Xo({ref:"root"}),0,"rootTarget"],[[No,cx(["open"])],2,"syncToPopover"],[Ni({ref:"root",type:"click"}),2,"onHostClick"],[Ni({selector:"rui-popover",type:"rui-open-change"}),2,"onPopoverOpenChange"]],0,void 0,tn))}constructor(...e){super(...e),nx(this)}open=(Z_(this),tx(this));rootTarget=(ix(this),rx(this));getPopover(){return this.querySelector("rui-popover")}onConnected(){this.syncToPopover()}syncToPopover(){if(LM)return;let e=this.getPopover();!e||typeof e.setOpen!="function"||e.open!==this.open&&e.setOpen(this.open,!1)}onHostClick(e){if(!e.target?.closest("[data-popover-trigger]"))return;this.open=!this.open;let r=this.getPopover();r&&typeof r.setOpen=="function"&&r.setOpen(this.open)}onPopoverOpenChange(e){let i=this.getPopover();e.target===i&&(this.open=e.detail.open)}static{ex()}};function Yo(t){return t.querySelector('button, a[href], input, select, textarea, [role="button"]')??t}function PM({children:t,class:e,...i}){return vi("div",{...i,class:j(e),children:t})}function jM({trigger:t,children:e,variant:i="default",...r}){let s=i==="listbox"?"rui-popover--listbox":"";return vi("rui-popover",{...r,variant:i,children:px("div",{class:"rui-popover-host","data-ref":"host",children:[t!=null?vi("span",{"data-popover-trigger":!0,children:t}):null,vi("div",{"data-ref":"surface",class:`rui-popover rui-floating ${s}`.trim(),role:"dialog",children:e})]})})}function FM({trigger:t,children:e,...i}){return vi("rui-popover-trigger",{...i,children:px("div",{class:"rui-popover-trigger","data-ref":"root",children:[vi("span",{"data-popover-trigger":!0,children:t}),e]})})}import{RadiantElement as Cx,bindTo as Dx,customElement as KM,event as $M,onEvent as GM,onUpdated as WM,prop as rn,query as HM}from"@ecopages/radiant";var fx,mx,gx,bx,vx,yx,_x,xx,wx,Tx,Sx,Ex,Rx,Ax;function BM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Ix(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ix(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:UM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return qM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function UM(t){var e=zM(t,"string");return typeof e=="symbol"?e:e+""}function zM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ix(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function qM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var Vx,Ox=class extends Cx{static{({e:[gx,bx,vx,yx,_x,xx,wx,Tx,Sx,Ex,Rx,Ax,fx],c:[Vx,mx]}=BM(this,[KM("rui-radio-group")],[[rn({type:String,reflect:!0,defaultValue:""}),0,"value"],[rn({type:String,defaultValue:""}),0,"name"],[[rn({type:String,defaultValue:""}),Dx({selector:"[data-radio-group-root]",attr:"aria-label",map:gt})],0,"label"],[[rn({type:Boolean,reflect:!0,defaultValue:!1}),Dx({selector:"[data-radio-group-root]",attr:"aria-disabled",map:e=>e?"true":void 0})],0,"disabled"],[HM({selector:'input[type="radio"]',all:!0,cache:!1}),0,"radioTargets"],[$M({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[WM(["value","name","disabled"]),2,"syncRadios"],[GM({selector:'input[type="radio"]',type:"change"}),2,"onRadioChange"]],0,void 0,Cx))}constructor(...e){super(...e),Ax(this)}value=(fx(this),gx(this));name=(bx(this),vx(this));label=(yx(this),_x(this));disabled=(xx(this),wx(this));radioTargets=(Tx(this),Sx(this));changeEvent=(Ex(this),Rx(this));onConnected(){this.syncRadios()}syncRadios(){let e=this.name||this.getAttribute("name")||"rui-radio-group";for(let i of this.radioTargets)i.name=e,i.disabled=this.disabled||i.hasAttribute("data-disabled"),i.checked=this.value!==""&&i.value===this.value}onRadioChange(e){let i=e.target;i.checked&&(this.value=i.value,this.changeEvent.emit({value:this.value}))}static{mx()}};import{jsx as Gt,jsxs as YM}from"@ecopages/jsx/jsx-runtime";function kx({children:t,class:e,...i}){return Gt("div",{...i,"data-radio-group-root":!0,class:j("rui-radio-group",e),role:"radiogroup","data-rui-control":!0,"data-rui-control-type":"text",children:t})}function Mx({children:t,value:e,name:i,disabled:r,class:s,...d}){return YM("label",{...d,class:j("rui-radio",s),children:[Gt("input",{type:"radio",class:"rui-radio__input",value:e,name:i,disabled:r,"data-disabled":r?"":void 0}),Gt("span",{class:"rui-radio__control","aria-hidden":"true"}),Gt("span",{class:"rui-radio__label",children:t})]})}function NM({options:t,children:e,...i}){return Gt("rui-radio-group",{...i,children:t==null?e:Gt(kx,{children:t.map(r=>Gt(Mx,{value:r.value,disabled:r.disabled,children:r.label}))})})}import{RadiantElement as i0,bindTo as r0,customElement as eL,event as tL,onEvent as xe,onUpdated as iL,prop as Wt,query as rL}from"@ecopages/radiant";var Lx,Px,jx,Fx,Bx,Ux,zx,qx,Kx,$x,Gx,Wx,Hx,Yx,Nx,Xx,Qx,Jx,Zx,e0;function XM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:t0(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||t0(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:QM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ZM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function QM(t){var e=JM(t,"string");return typeof e=="symbol"?e:e+""}function JM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function t0(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function ZM(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var o0,n0=class extends i0{static{({e:[jx,Fx,Bx,Ux,zx,qx,Kx,$x,Gx,Wx,Hx,Yx,Nx,Xx,Qx,Jx,Zx,e0,Lx],c:[o0,Px]}=XM(this,[eL("rui-select")],[[[Wt({...Ie,defaultValue:[]}),r0({selector:"[data-select-clear]",bool:"hidden",map:e=>e.length===0})],0,"value"],[Wt({type:String,defaultValue:""}),0,"label"],[Wt({type:String,defaultValue:""}),0,"placeholder"],[[Wt({type:Boolean,reflect:!0,defaultValue:!1}),r0([{selector:"[data-select-trigger]",attr:"aria-disabled",map:e=>e?"true":void 0},{selector:"[data-select-trigger]",prop:"tabIndex",map:e=>e?-1:0},{selector:"[data-select-toggle]",prop:"disabled"},{selector:"[data-select-clear]",prop:"disabled"}])],0,"disabled"],[Wt({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[Wt({type:Boolean,attribute:"should-close-on-select"}),0,"shouldCloseOnSelect"],[Wt({type:String,attribute:"trigger-kind",reflect:!0,defaultValue:"manual"}),0,"triggerKind"],[tL({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[rL({ref:"root"}),0,"rootTarget"],[iL(["value","label","placeholder","disabled","triggerKind","selectionMode","shouldCloseOnSelect"]),2,"onPropsUpdated"],[xe({selector:"[data-select-trigger], [data-select-toggle]",type:"pointerdown"}),2,"onTriggerPointerDown"],[xe({selector:"[data-select-trigger], [data-select-toggle]",type:"click"}),2,"onTriggerClick"],[xe({selector:"[data-select-trigger]",type:"keydown",options:{capture:!0}}),2,"onTriggerKeydown"],[xe({selector:"[data-select-listbox] [data-autocomplete-input]",type:"keydown",options:{capture:!0}}),2,"onSearchKeydown"],[xe({selector:"[data-select-listbox] [data-autocomplete-input]",type:"input"}),2,"onSearchInput"],[xe({selector:"[data-select-value] rui-tag-group",type:"rui-remove"}),2,"onTagRemove"],[xe({selector:"[data-select-clear]",type:"click"}),2,"onClearClick"],[xe({selector:"[data-select-value] [data-tag]",type:"click"}),2,"onTagClick"],[xe({selector:'[data-select-listbox] [role="option"]',type:"pointerover"}),2,"onOptionPointerOver"],[xe({selector:'[data-select-listbox] [role="option"]',type:"mousedown"}),2,"onOptionMouseDown"],[xe({selector:'[data-select-listbox] [role="option"]',type:"click"}),2,"onOptionClick"],[xe({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[xe({ref:"root",type:"focusout"}),2,"onFocusOut"],[xe({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"]],0,void 0,i0))}constructor(...e){super(...e),e0(this)}value=(Lx(this),jx(this));label=(Fx(this),Bx(this));placeholder=(Ux(this),zx(this));disabled=(qx(this),Kx(this));selectionMode=($x(this),Gx(this));shouldCloseOnSelect=(Wx(this),Hx(this));triggerKind=(Yx(this),Nx(this));changeEvent=(Xx(this),Qx(this));open=(Jx(this),!1);uid=re("rui-select");collection=new Jt({getRoot:()=>this,getSelectionMode:()=>this.selectionMode,getValue:()=>this.value,setValue:e=>{this.value=e},getPopup:()=>this.getListboxPopup(),tagGroupSelector:"[data-select-value] rui-tag-group"});listboxBehavior=new Zt({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.collection.getOptions(),getActiveDescendantHost:()=>this.getActiveDescendantHost(),getOptionIdPrefix:()=>`${this.uid}-option`});rootTarget=Zx(this);get listboxId(){return`${this.uid}-list`}get triggerId(){return`${this.uid}-trigger`}isMultiple(){return this.selectionMode==="multiple"}closesOnSelect(){return this.shouldCloseOnSelect!=null?this.shouldCloseOnSelect:!this.isMultiple()}getSearchInput(){return this.querySelector("[data-select-listbox] [data-autocomplete-input]")}hasSearchInput(){return this.getSearchInput()!=null}getActiveDescendantHost(){return this.open&&this.hasSearchInput()?this.getSearchInput():this.getTrigger()}resetSearchFilter(){let e=this.getSearchInput();!e||e.value===""||(e.value="",e.dispatchEvent(new Event("input",{bubbles:!0})))}syncSearchInput(){let e=this.getSearchInput(),i=this.getTrigger(),r=this.collection.getListbox();if(!(!e||!r||!i)){if(this.open){e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",this.listboxId),i.removeAttribute("aria-activedescendant");return}e.removeAttribute("role"),e.removeAttribute("aria-autocomplete"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-activedescendant")}}focusPopupInput(){queueMicrotask(()=>{this.getSearchInput()?.focus()})}hasTagGroup(){return this.collection.getTagGroup()!=null}syncTagGroup(){let e=this.getValueElement();this.collection.syncTagGroup(),!(!e||!this.hasTagGroup())&&this.syncTagGroupPlaceholder(e,this.collection.getSelectedValues().length)}syncTagGroupPlaceholder(e,i){let r=e.querySelector("[data-select-placeholder]");if(!this.placeholder){r?.remove();return}r||(r=document.createElement("span"),r.setAttribute("data-select-placeholder","true"),e.insertBefore(r,e.firstChild)),r.textContent=this.placeholder,r.hidden=i>0,e.toggleAttribute("data-placeholder",i===0)}removeSelectedValue(e){this.collection.removeValue(e)&&(this.syncValueDisplay(),this.collection.syncOptionSelection(),this.syncTagGroup(),this.changeEvent.emit({value:this.value}))}clearSelection(){this.collection.clearValues()&&(this.syncValueDisplay(),this.collection.syncOptionSelection(),this.syncTagGroup(),this.changeEvent.emit({value:[]}),this.getTrigger()?.focus())}getTrigger(){return this.querySelector("[data-select-trigger]")}isTriggerFocusTarget(e){let i=this.getTrigger();return!i||!(e instanceof Node)||!i.contains(e)?!1:!(e instanceof Element&&e.closest("[data-tag-remove]"))}getToggle(){return this.querySelector("[data-select-toggle]")}getValueElement(){return this.querySelector("[data-select-value]")}getListboxPopup(){return this.querySelector("[data-select-listbox]")}ensureOptionIds(){this.listboxBehavior.ensureOptionIds()}getAccessibleName(){return Vi(this)?.textContent?.trim()||this.label||"Options"}syncLabel(){let e=this.getTrigger();qe(this,e,{controlId:this.triggerId,label:this.label,labelId:`${this.uid}-label`})}syncTrigger(){let e=this.getTrigger(),i=this.collection.getListbox(),r=this.getListboxPopup();!e||!i||(e.id||(e.id=this.triggerId),i.id||(i.id=this.listboxId),e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-autocomplete","none"),e.setAttribute("aria-expanded",String(this.open)),e.setAttribute("aria-controls",this.listboxId),i.setAttribute("aria-label",this.getAccessibleName()),this.collection.syncMultiselectable(i),r&&(r.removeAttribute("role"),r.removeAttribute("aria-label"),r.removeAttribute("aria-multiselectable")),this.syncToggle(),this.syncSearchInput())}syncToggle(){let e=this.getToggle();e&&e.setAttribute("aria-expanded",String(this.open))}syncValueDisplay(){if(this.hasTagGroup()){this.syncTagGroup();return}let e=this.getValueElement();if(!e||e.childElementCount>0)return;let i=this.collection.getSelectedValues();if(i.length===0){e.textContent="",e.toggleAttribute("data-placeholder",!0),this.placeholder&&(e.textContent=this.placeholder);return}if(e.toggleAttribute("data-placeholder",!1),this.isMultiple()){e.textContent=i.map(r=>this.collection.labelForValue(r)).join(", ");return}e.textContent=this.collection.labelForValue(i[0])}setOpen(e,i={}){let r=i.activate??"none";this.open=e;let s=this.getTrigger(),d=this.getListboxPopup();if(!(!s||!d)){if(s.setAttribute("aria-expanded",String(e)),d.toggleAttribute("hidden",!e),!e){this.listboxBehavior.clearActiveOption(),this.resetSearchFilter(),this.syncSearchInput(),this.listboxBehavior.syncPopoverPosition();return}if(this.ensureOptionIds(),this.syncSearchInput(),this.listboxBehavior.syncPopoverPosition(),this.hasSearchInput()&&this.focusPopupInput(),r==="first"){let h=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(h.length?0:-1);return}if(r==="last"){let h=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(h.length?h.length-1:-1);return}this.listboxBehavior.clearActiveOption()}}selectOption(e){this.collection.isSelectableOption(e)&&(this.collection.toggleValue(Ce(e)),this.syncValueDisplay(),this.collection.syncOptionSelection(),this.changeEvent.emit({value:this.value}),this.closesOnSelect()&&(this.resetSearchFilter(),this.setOpen(!1),this.getTrigger()?.focus()))}handleListboxKeydown(e){this.listboxBehavior.handleKeydown(e,{isOpen:this.open,canUseSpace:!this.hasSearchInput(),closesOnTab:this.closesOnSelect(),enterWhenClosed:"open",enterWithoutActive:"ignore",onOpen:(i="none")=>this.setOpen(!0,{activate:i}),onClose:i=>{this.setOpen(!1),(i==="arrow"||i==="escape")&&this.getTrigger()?.focus()},onSelectActive:()=>{let i=this.listboxBehavior.getVisibleOptions()[this.listboxBehavior.activeOptionIndex];i&&this.selectOption(i)}})}handleTriggerKeydown(e){this.handleListboxKeydown(e)}initialize(){this.ensureOptionIds(),this.syncLabel(),this.syncTrigger(),this.collection.syncListboxHost(),this.syncValueDisplay(),this.collection.syncOptionSelection(),this.setOpen(!1)}onConnected(){this.initialize()}disconnectedCallback(){this.listboxBehavior.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.syncLabel(),this.syncTrigger(),this.collection.syncListboxHost(),this.syncValueDisplay(),this.collection.syncOptionSelection()}onTriggerPointerDown(e){this.triggerKind==="focus"&&e.preventDefault()}onTriggerClick(e){e.preventDefault();let i=this.getTrigger();if(!(!i||this.disabled)){if(this.open?this.setOpen(!1):this.setOpen(!0),this.open&&this.hasSearchInput()){this.focusPopupInput();return}i.focus()}}onTriggerKeydown(e){this.handleTriggerKeydown(e)}onSearchKeydown(e){this.handleListboxKeydown(e)}onSearchInput(){this.open&&this.listboxBehavior.clearActiveOption()}onTagRemove(e){let i=e.detail;i?.value&&this.removeSelectedValue(i.value)}onClearClick(e){e.preventDefault(),e.stopPropagation(),this.clearSelection()}onTagClick(e){e.target.closest("[data-tag-remove]")||e.stopPropagation()}onOptionPointerOver(e){if(!this.open)return;let i=this.collection.findOption(e.target);if(!this.collection.isSelectableOption(i))return;let s=this.listboxBehavior.getVisibleOptions().indexOf(i);s>=0&&this.listboxBehavior.setActiveOption(s)}onOptionMouseDown(e){e.preventDefault()}onOptionClick(e){let i=this.collection.findOption(e.target);i&&this.selectOption(i)}onRootFocusIn(e){this.triggerKind!=="focus"||this.disabled||this.open||!this.isTriggerFocusTarget(e.target)||e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||this.setOpen(!0)}onFocusOut(e){this.listboxBehavior.shouldDismissFocus(e.relatedTarget)&&this.setOpen(!1)}onDocumentPointerDown(e){this.open&&this.listboxBehavior.shouldDismissPointer(e.target)&&this.setOpen(!1)}static{Px()}};import{Fragment as nL,jsx as he,jsxs as a0}from"@ecopages/jsx/jsx-runtime";function s0({children:t,class:e,...i}){return he("div",{...i,class:j("rui-select__control",e),children:t})}function l0({children:t,class:e,disabled:i,...r}){return he("div",{...r,"data-select-trigger":!0,"data-rui-focus-managed":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:j("rui-select__trigger",e),tabIndex:i?-1:0,"aria-disabled":i?"true":void 0,children:t})}function u0({children:t,class:e,aria:i,disabled:r,...s}){return he("button",{...s,aria:ne(i,"Show options"),type:"button","data-select-toggle":!0,class:j("rui-control-toggle",e),disabled:r,tabIndex:-1,children:t??he(Xe,{})})}function oL({children:t,class:e,aria:i,disabled:r,...s}){return he("button",{...s,aria:ne(i,"Clear selection"),type:"button","data-select-clear":!0,class:j("rui-control-clear",e),disabled:r,children:t??he(Re,{})})}function c0({children:t,class:e,...i}){return he("span",{...i,"data-select-value":!0,class:j("rui-select__value",e),children:t})}function d0({children:t,class:e,...i}){return he("div",{...i,"data-select-listbox":!0,class:j("rui-select__listbox rui-popover rui-popover--listbox rui-floating",e),children:t})}function aL({placeholder:t,class:e,disabled:i,...r}){return he("input",{...r,type:"search","data-autocomplete-input":!0,class:j("rui-select__search",e),placeholder:t,disabled:i,autocomplete:"off"})}function sL(t,e,i){let r=et(e)[0]??"",s=typeof i=="string"?i:"";if(!r)return s;let d=t?.find(h=>h.value===r);return d&&typeof d.label=="string"?d.label:r}function lL({children:t}){return he("div",{class:"rui-select","data-ref":"root",children:t})}function uL({options:t,children:e,value:i,...r}){let s=et(i),d=r.selectionMode==="multiple",h=t!=null?sL(t,i,r.placeholder):"",a=t?.filter(E=>s.includes(E.value)).map(E=>({value:E.value,label:E.label}));return he("rui-select",{...r,value:s,children:he(lL,{children:t==null?e:a0(nL,{children:[a0(s0,{children:[he(l0,{disabled:r.disabled,children:he(c0,{children:d?he(Mi,{tags:a??[],label:"Selected options"}):h})}),he(u0,{})]}),he(d0,{children:he(ii,{embedded:!0,options:t,selectionMode:r.selectionMode,value:s})})]})})})}import{RadiantElement as dw,bindTo as Xi,bound as hw,customElement as fL,event as Qo,onEvent as Qi,onUpdated as Jo,prop as me,query as on,state as mL}from"@ecopages/radiant";import{isServer as gL}from"@ecopages/radiant/is-server";function nn(t){return t.split(",").map(e=>e.trim()).filter(e=>e.length>0)}var h0,p0,f0,m0,g0,b0,v0,y0,_0,x0,w0,T0,S0,E0,R0,A0,I0,C0,D0,O0,V0,k0,M0,L0,P0,j0,F0,B0,U0,z0,q0,K0,$0,G0,W0,H0,Y0,N0,X0,Q0,J0,Z0,ew,tw,iw,rw,nw,ow,aw,sw,lw,uw;function cL(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:cw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||cw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:dL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return pL(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function dL(t){var e=hL(t,"string");return typeof e=="symbol"?e:e+""}function hL(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cw(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function pL(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var bL=256,vL=48,yL=200,_L=480,xL="b",pw=8,fw=32,mw='[data-ref="menu-button"]';function wL(t){return t.metaKey||t.ctrlKey}function TL(){return typeof window<"u"&&typeof window.matchMedia=="function"}function an(t){return t==="left"||t==="right"}var bw,gw=class extends dw{static{({e:[f0,m0,g0,b0,v0,y0,_0,x0,w0,T0,S0,E0,R0,A0,I0,C0,D0,O0,V0,k0,M0,L0,P0,j0,F0,B0,U0,z0,q0,K0,$0,G0,W0,H0,Y0,N0,X0,Q0,J0,Z0,ew,tw,iw,rw,nw,ow,aw,sw,lw,uw,h0],c:[bw,p0]}=cL(this,[fL("rui-sidebar")],[[[me({type:String,reflect:!0,defaultValue:"sidebar"}),Xi([{attr:"data-variant"},{ref:"root",attr:"data-variant"},{ref:"pane",attr:"data-variant"}])],0,"variant"],[[me({type:String,reflect:!0,defaultValue:"left"}),Xi([{attr:"data-side"},{ref:"root",attr:"data-side"},{ref:"pane",attr:"data-side"}])],0,"side"],[[me({type:String,reflect:!0,defaultValue:"off"}),Xi([{attr:"data-collapsible"},{ref:"root",attr:"data-collapsible"}])],0,"collapsible"],[me({type:Number,defaultValue:bL}),0,"defaultWidth"],[me({type:Number,reflect:!0,attribute:"width"}),0,"width"],[me({type:Number,defaultValue:yL}),0,"minWidth"],[me({type:Number,defaultValue:_L}),0,"maxWidth"],[me({type:Boolean,defaultValue:!1}),0,"resizable"],[me({type:Boolean,defaultValue:!0}),0,"defaultOpen"],[me({type:Boolean,defaultValue:!1}),0,"mobileDefaultOpen"],[me({type:Boolean,attribute:"open"}),0,"open"],[me({type:Number,defaultValue:768}),0,"mobileBreakpoint"],[[me({type:String,defaultValue:"Sidebar"}),Xi([{attr:"aria-label"},{ref:"pane",attr:"aria-label"}])],0,"label"],[me({type:Boolean,reflect:!0,attribute:"match-active"}),0,"matchActive"],[me({type:String,defaultValue:"pathname"}),0,"matchMode"],[me({type:Boolean,attribute:"scroll-active-on-mount"}),0,"scrollActiveOnMount"],[me({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[on({ref:"root"}),0,"rootTarget"],[on({ref:"pane"}),0,"paneTarget"],[on({ref:"handle"}),0,"handleTarget"],[on({ref:"scrim"}),0,"scrimTarget"],[Qo({name:"rui-sidebar-toggle",bubbles:!0,composed:!0}),0,"toggleEvent"],[Qo({name:"rui-sidebar-resize",bubbles:!0,composed:!0}),0,"resizeEvent"],[Qo({name:"rui-sidebar-mobile-change",bubbles:!0,composed:!0}),0,"mobileChangeEvent"],[[mL,Xi([{attr:"data-mobile"},{ref:"root",attr:"data-mobile"}])],0,"isMobile"],[Jo(["open","collapsible","variant","side","width","defaultWidth","defaultOpen","minWidth","maxWidth","isMobile","resizable","label"]),2,"onStateUpdated"],[Jo(["mobileBreakpoint"]),2,"onMobileBreakpointUpdated"],[Jo(["matchActive","matchMode","navigationEvents"]),2,"onMatchSettingsUpdated"],[hw,2,"onPointerMove"],[hw,2,"onPointerUp"],[Qi({ref:"handle",type:"pointerdown"}),2,"onHandlePointerDown"],[Qi({ref:"handle",type:"keydown"}),2,"onHandleKeydown"],[Qi({ref:"scrim",type:"click"}),2,"onScrimClick"],[Qi({selector:mw,type:"click"}),2,"onMenuLinkClick"],[Qi({document:!0,type:"keydown"}),2,"onHostKeydown"]],0,void 0,dw))}variant=(h0(this),f0(this));side=(m0(this),g0(this));collapsible=(b0(this),v0(this));defaultWidth=(y0(this),_0(this));width=(x0(this),w0(this));minWidth=(T0(this),S0(this));maxWidth=(E0(this),R0(this));resizable=(A0(this),I0(this));defaultOpen=(C0(this),D0(this));mobileDefaultOpen=(O0(this),V0(this));open=(k0(this),M0(this));mobileBreakpoint=(L0(this),P0(this));label=(j0(this),F0(this));matchActive=(B0(this),U0(this,!1));matchMode=(z0(this),q0(this));scrollActiveOnMount=(K0(this),$0(this,!1));navigationEvents=(G0(this),W0(this,""));rootTarget=(H0(this),Y0(this));paneTarget=(N0(this),X0(this));handleTarget=(Q0(this),J0(this));scrimTarget=(Z0(this),ew(this));toggleEvent=(tw(this),iw(this));resizeEvent=(rw(this),nw(this));mobileChangeEvent=(ow(this),aw(this));isMobile=(sw(this),lw(this,!1));mediaQuery=(uw(this),null);mediaListener=e=>this.setMobile(e.matches);dragging=!1;dragStartCoord=0;dragStartSize=0;navigationCleanups=[];didScrollActiveOnMount=!1;openControlled=!1;mobileReady=!1;connectedCallback(){super.connectedCallback(),this.ensureWidthInitialized(),this.setAttribute("role","complementary"),this.attachNavigationListeners()}onConnected(){this.ensureWidthInitialized(),this.openControlled=this.open!==void 0,this.bindMobileMediaQuery(),this.openControlled||(this.open=this.isMobile?this.mobileDefaultOpen:this.defaultOpen),this.syncPresentation(),this.syncPaneWidthVar(),this.mobileReady=!0}updated(e){super.updated(e);let i=this.scrollActiveOnMount&&!this.didScrollActiveOnMount;this.syncActiveLinks(i),i&&(this.didScrollActiveOnMount=!0)}disconnectedCallback(){this.endDrag(),this.unbindMobileMediaQuery(),this.detachNavigationListeners(),this.mobileReady=!1,super.disconnectedCallback()}syncPresentation(){let e=this.isOpen(),i=e?"expanded":"collapsed",r=this.resizable&&this.collapsible==="off"&&e&&!this.isMobile,s=!(e||!this.isMobile&&this.collapsible==="icon"),d=this.paneWidth();this.setAttribute("data-state",i),this.setAttribute("data-pane-width",String(d));let h=this.rootTarget;h&&(h.dataset.state=i);let a=this.scrimTarget;a&&a.toggleAttribute("hidden",!(this.isMobile&&e));let E=this.paneTarget;E&&(s?E.setAttribute("inert",""):E.removeAttribute("inert")),this.syncHandlePresentation(r,d)}syncHandlePresentation(e,i){let r=this.handleTarget;r&&(r.toggleAttribute("hidden",!e),e&&(r.setAttribute("aria-orientation",an(this.side)?"vertical":"horizontal"),r.setAttribute("aria-valuenow",String(i)),r.setAttribute("aria-valuemin",String(this.minWidth)),r.setAttribute("aria-valuemax",String(this.maxWidth)),r.setAttribute("aria-label",`${this.label} resize handle`)))}isOpen(){return this.open!==void 0?this.open:this.defaultOpen}ensureWidthInitialized(){this.hasAttribute("width")||(this.width===void 0||this.width===0)&&(this.width=this.defaultWidth)}onStateUpdated(){this.syncPresentation(),this.syncPaneWidthVar()}onMobileBreakpointUpdated(){this.bindMobileMediaQuery()}onMatchSettingsUpdated(){this.detachNavigationListeners(),this.attachNavigationListeners()}syncActiveLinks(e=!1){if(!this.matchActive||typeof window>"u"||typeof window.location>"u")return!1;let i=window.location.pathname,r=!1;for(let s of this.querySelectorAll(mw)){let d=this.isLinkActive(s,i);s.classList.toggle("rui-sidebar__menu-button--active",d),d?(s.setAttribute("aria-current","page"),e&&!r&&(s.scrollIntoView({block:"nearest"}),r=!0)):s.removeAttribute("aria-current")}return r}isLinkActive(e,i){let r=e.pathname;return this.matchMode==="prefix"?i===r||i.startsWith(`${r}/`):r===i}attachNavigationListeners(){if(gL||!this.isConnected||!this.matchActive||typeof window>"u"||typeof window.addEventListener!="function")return;let e=()=>this.syncActiveLinks(!1);if(window.addEventListener("popstate",e),this.navigationCleanups.push(()=>window.removeEventListener("popstate",e)),typeof document<"u"&&typeof document.addEventListener=="function")for(let i of nn(this.navigationEvents))document.addEventListener(i,e),this.navigationCleanups.push(()=>document.removeEventListener(i,e))}detachNavigationListeners(){for(let e of this.navigationCleanups)e();this.navigationCleanups=[]}unbindMobileMediaQuery(){this.mediaQuery?.removeEventListener("change",this.mediaListener),this.mediaQuery=null}bindMobileMediaQuery(){if(this.unbindMobileMediaQuery(),this.mobileBreakpoint<=0||!TL()){this.setMobile(!1);return}this.mediaQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.mediaQuery.addEventListener("change",this.mediaListener),this.setMobile(this.mediaQuery.matches)}setMobile(e){if(e===this.isMobile)return;let i=this.isMobile&&!e,r=!this.isMobile&&e;this.isMobile=e;let s=this.mobileReady&&!this.openControlled;s&&i&&this.collapsible==="off"&&!this.isOpen()?this.setOpen(!0):s&&r?this.setOpen(this.mobileDefaultOpen):this.syncPaneWidthVar(),this.mobileChangeEvent.emit({mobile:e})}clampWidth(e){return Math.min(this.maxWidth,Math.max(this.minWidth,e))}paneWidth(){return this.isOpen()?this.width&&this.width>0?this.width:this.defaultWidth:this.isMobile?0:this.collapsible==="icon"?vL:0}syncPaneWidthVar(e=this.paneWidth()){let i=this.rootTarget;i&&i.style.setProperty("--rui-sidebar-pane-width",`${e}px`),this.paneTarget&&(this.paneTarget.style.removeProperty("width"),this.paneTarget.style.removeProperty("height")),this.setAttribute("data-pane-width",String(e))}applyWidth(e,i){let r=this.clampWidth(e);this.width=r,this.syncPaneWidthVar(r),i&&this.resizeEvent.emit({width:r})}toggle(){this.setOpen(!this.isOpen())}setOpen(e){let i=this.isOpen();if(e===i){this.syncPresentation(),this.syncPaneWidthVar();return}this.open=e;let r=e?"expanded":"collapsed";this.syncPresentation(),this.syncPaneWidthVar(),this.toggleEvent.emit({open:e,state:r})}beginDrag(e){if(e.button!==0||this.collapsible!=="off")return;this.dragging=!0;let i=an(this.side);this.dragStartCoord=i?e.clientX:e.clientY,this.dragStartSize=this.paneWidth(),this.handleTarget?.setPointerCapture(e.pointerId),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp),document.addEventListener("pointercancel",this.onPointerUp)}endDrag(){this.dragging&&(this.dragging=!1,document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),document.removeEventListener("pointercancel",this.onPointerUp))}onPointerMove(e){if(!this.dragging)return;let r=an(this.side)?e.clientX:e.clientY,s=this.side==="right"?this.dragStartCoord-r:r-this.dragStartCoord;this.applyWidth(this.dragStartSize+s,!0)}onPointerUp(){this.endDrag()}onHandlePointerDown(e){e.preventDefault(),this.beginDrag(e)}onHandleKeydown(e){let i=e,r=this.paneWidth(),s=an(this.side),d=s?"ArrowLeft":"ArrowUp",h=s?"ArrowRight":"ArrowDown",a=r;if(i.key===d)a=r-(i.shiftKey?fw:pw);else if(i.key===h)a=r+(i.shiftKey?fw:pw);else if(i.key==="Home")a=this.minWidth;else if(i.key==="End")a=this.maxWidth;else return;e.preventDefault(),this.applyWidth(a,!0)}onScrimClick(){this.isMobile&&this.setOpen(!1)}onMenuLinkClick(){this.isMobile&&this.setOpen(!1)}onHostKeydown(e){let i=e;if(i.key==="Escape"&&this.isMobile&&this.isOpen()){i.preventDefault(),this.setOpen(!1);return}wL(i)&&i.key.toLowerCase()===xL&&(i.preventDefault(),this.toggle())}static{p0()}};import{RadiantElement as Bw,bindTo as sn,customElement as IL,onEvent as CL,onUpdated as Uw,prop as Ji,query as DL,state as Zo}from"@ecopages/radiant";var vw,yw,_w,xw,ww,Tw,Sw,Ew,Rw,Aw,Iw,Cw,Dw,Ow,Vw,kw,Mw,Lw,Pw,jw;function SL(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Fw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Fw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:EL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return AL(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function EL(t){var e=RL(t,"string");return typeof e=="symbol"?e:e+""}function RL(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fw(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function AL(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var zw="Toggle sidebar",OL=["filled","outline","ghost"],VL=["sm","md","lg"];function Kw({variant:t,size:e}){return`rui-button rui-button--${t} rui-button--${e} rui-sidebar__trigger`}function kL(t){return t==="inset"?"collapsed":"expanded"}var $w,qw=class extends Bw{static{({e:[_w,xw,ww,Tw,Sw,Ew,Rw,Aw,Iw,Cw,Dw,Ow,Vw,kw,Mw,Lw,Pw,jw,vw],c:[$w,yw]}=SL(this,[IL("rui-sidebar-trigger")],[[Ji({type:String,defaultValue:""}),0,"controls"],[[Ji({type:String,attribute:"button-label",defaultValue:zw}),sn({ref:"button",attr:"aria-label",map:e=>e?.trim()||zw})],0,"buttonLabel"],[Ji({type:String,reflect:!0,defaultValue:""}),0,"placement"],[Ji({type:String,defaultValue:"ghost"}),0,"variant"],[Ji({type:String,defaultValue:"md"}),0,"size"],[DL({ref:"button"}),0,"buttonTarget"],[[Zo,sn([{attr:"data-sidebar-state"},{ref:"button",attr:"aria-expanded",map:e=>String(e==="expanded")}])],0,"sidebarState"],[[Zo,sn({attr:"data-sidebar-mobile"})],0,"sidebarMobile"],[[Zo,sn({attr:"data-sidebar-collapsible"})],0,"sidebarCollapsible"],[Uw(["controls","placement"]),2,"onTargetUpdated"],[Uw(["variant","size"]),2,"onPresentationUpdated"],[CL({ref:"button",type:"click"}),2,"onButtonClick"]],0,void 0,Bw))}controls=(vw(this),_w(this));buttonLabel=(xw(this),ww(this));placement=(Tw(this),Sw(this));variant=(Ew(this),Rw(this));size=(Aw(this),Iw(this));buttonTarget=(Cw(this),Dw(this));sidebarState=(Ow(this),Vw(this,"expanded"));sidebarMobile=(kw(this),Mw(this,null));sidebarCollapsible=(Lw(this),Pw(this,null));sidebarObserver=(jw(this),null);attachedSidebar=null;onConnected(){this.syncWithSidebar()}disconnectedCallback(){this.detachFromSidebar(),super.disconnectedCallback()}onTargetUpdated(){this.syncWithSidebar()}onPresentationUpdated(){let e=this.buttonTarget?.classList;if(e){for(let i of OL)e.toggle(`rui-button--${i}`,i===this.variant);for(let i of VL)e.toggle(`rui-button--${i}`,i===this.size)}}resolveSidebar(){let e=this.controls?.trim();if(e){let r=document.getElementById(e);return r?.localName==="rui-sidebar"?r:null}let i=this.closest("rui-sidebar");return i?.id?i:null}syncWithSidebar(){let e=this.resolveSidebar();e!==this.attachedSidebar&&(this.detachFromSidebar(),e&&(this.attachedSidebar=e,typeof MutationObserver=="function"&&(this.sidebarObserver=new MutationObserver(()=>this.applyState()),this.sidebarObserver.observe(e,{attributes:!0,attributeFilter:["data-state","data-mobile","data-collapsible"]}))));let i=e?.id||this.controls;i?this.buttonTarget?.setAttribute("aria-controls",i):this.buttonTarget?.removeAttribute("aria-controls"),this.applyState()}detachFromSidebar(){this.sidebarObserver?.disconnect(),this.attachedSidebar=null,this.sidebarObserver=null}applyState(){let e=this.attachedSidebar;if(!e){this.sidebarState=kL(this.placement),this.sidebarMobile=null,this.sidebarCollapsible=null;return}this.sidebarState=e.getAttribute("data-state")==="collapsed"?"collapsed":"expanded",this.sidebarMobile=e.getAttribute("data-mobile")==="true",this.sidebarCollapsible=e.getAttribute("data-collapsible")??"off"}onButtonClick(e){e.preventDefault(),e.stopPropagation();let i=this.resolveSidebar();i&&typeof i.toggle=="function"&&i.toggle()}static{yw()}};import{jsx as we,jsxs as Zi}from"@ecopages/jsx/jsx-runtime";function ML(){return Zi("span",{class:"rui-sidebar__trigger-icon","aria-hidden":"true",children:[Zi("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--collapse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[we("path",{d:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),we("path",{d:"M9 3v18"}),we("path",{d:"m14 15 3-3-3-3"})]}),Zi("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--expand",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[we("path",{d:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),we("path",{d:"M9 3v18"}),we("path",{d:"m14 9-3 3 3 3"})]}),Zi("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--close",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[we("path",{d:"M18 6 6 18"}),we("path",{d:"m6 6 12 12"})]}),Zi("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--menu",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[we("path",{d:"M4 6h16"}),we("path",{d:"M4 12h16"}),we("path",{d:"M4 18h16"})]})]})}function LL({children:t,triggerLabel:e,placement:i,variant:r="ghost",size:s="md",controls:d,...h}){return we("rui-sidebar-trigger",{...h,"prop:buttonLabel":e,placement:i,variant:r,size:s,controls:d,children:we("button",{"data-ref":"button",type:"button",class:Kw({variant:r,size:s}),children:t??we(ML,{})})})}import{jsx as se,jsxs as er}from"@ecopages/jsx/jsx-runtime";function ea(t,...e){let i={...t};for(let r of e)delete i[r];return i}function PL({layout:t="default",siteHeader:e,sidebar:i,children:r,class:s,...d}){return t==="docs"?er("div",{...d,class:j("rui-sidebar-provider",s),"data-layout":t,children:[e?se("div",{class:"rui-sidebar-provider__site-header",children:e}):null,er("div",{class:"rui-sidebar-provider__body",children:[i,r]})]}):er("div",{...d,class:j("rui-sidebar-provider",s),"data-layout":t,children:[i,r]})}function jL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__header",e),children:t})}function FL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__content",e),children:t})}function BL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__footer",e),children:t})}function UL({class:t,...e}){return se("hr",{...e,role:"separator","aria-orientation":"horizontal",class:j("rui-sidebar__separator",t)})}function zL({children:t,class:e,...i}){return se("section",{...i,class:j("rui-sidebar__group",e),children:t})}function Gw({children:t,class:e,...i}){return se("h2",{...i,class:j("rui-sidebar__group-label",e),children:t})}function qL({children:t,class:e,...i}){return se("button",{...i,type:"button",class:j("rui-sidebar__group-action",e),children:t})}function KL({label:t,action:e,class:i,...r}){return er("div",{...r,class:j("rui-sidebar__group-header",i),children:[se(Gw,{children:t}),e]})}function $L({children:t,class:e,...i}){return se("ul",{...i,role:"list",class:j("rui-sidebar__menu",e),children:t})}function GL({children:t,class:e,...i}){return se("li",{...i,class:j("rui-sidebar__menu-item",e),children:t})}function Ww(t){if(t.href!==void 0){let{children:K,class:$,isActive:V,href:G,tooltip:W,aria:O,title:_,"aria-current":H,...Y}=t;return se("a",{...ea(Y,"as"),aria:ne(O,typeof K=="string"?void 0:W),href:G,"data-ref":"menu-button",class:j("rui-sidebar__menu-button",V&&"rui-sidebar__menu-button--active",$),"aria-current":V?"page":H,title:ke(_,W),children:K})}let{children:e,class:i,isActive:r,type:s="button",tooltip:d,disabled:h,onClick:a,aria:E,title:A,"aria-current":S,"on:click":I,...T}=t;return se("button",{...ea(T,"as","href"),aria:ne(E,typeof e=="string"?void 0:d),type:s,"data-ref":"menu-button",class:j("rui-sidebar__menu-button",r&&"rui-sidebar__menu-button--active",i),"aria-current":r?"page":S,disabled:h,title:ke(A,d),"on:click":ke(I,a),children:e})}function WL(t){let{class:e,...i}=t;return se(Ww,{class:j("rui-sidebar__menu-action",e),...i})}function HL({children:t,class:e,...i}){return se("main",{...i,class:j("rui-sidebar__inset",e),children:t})}function YL({children:t,open:e,label:i,...r}){return se("rui-sidebar",{...r,"prop:open":e,label:i,children:er("div",{class:"rui-sidebar","data-ref":"root",children:[se("button",{"data-ref":"scrim",type:"button",class:"rui-sidebar__scrim",tabindex:-1,"aria-label":"Close sidebar",hidden:!0}),se("div",{"data-ref":"pane",class:"rui-sidebar__pane","aria-label":i,children:t}),se("div",{"data-ref":"handle",class:"rui-sidebar__handle",role:"separator",tabindex:0,hidden:!0,children:se("span",{class:"rui-sidebar__handle-grip","aria-hidden":"true"})})]})})}import{bindTo as FT,customElement as ZL,event as eP,onEvent as tr,onUpdated as tP,prop as Ve,query as Rt}from"@ecopages/radiant";import{FormAssociatedElement as BT}from"@ecopages/radiant/form-associated-element";var Hw,Yw,Nw,Xw,Qw,Jw,Zw,eT,tT,iT,rT,nT,oT,aT,sT,lT,uT,cT,dT,hT,pT,fT,mT,gT,bT,vT,yT,_T,xT,wT,TT,ST,ET,RT,AT,IT,CT,DT,OT,VT,kT,MT,LT,PT;function NL(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:jT(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||jT(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:XL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return JL(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function XL(t){var e=QL(t,"string");return typeof e=="symbol"?e:e+""}function QL(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jT(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function JL(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var ta=50,ia=25,ra=75,zT=100;function qT(t,e,i,r,s){let d=t.clamp(e),h=t.clamp(i);d>h&&([d,h]=[h,d]);let a=Math.max(0,r);return h-d<a&&(s==="min"?d=t.clamp(h-a):h=t.clamp(d+a)),[d,h]}function iP(t){return Array.isArray(t.value)?[...t.value]:typeof t.value=="number"?[t.value]:t.variant==="range"?[ia,ra]:[ta]}function KT(t){let e=We(t.min,t.max,t.step);if(t.variant==="range"||t.values.length>=2){let i=t.values[0]??ia,r=t.values[1]??ra;return qT(e,i,r,t.minDistance??0)}return[e.clamp(t.values[0]??ta)]}function $T(t,e,i){let r=mi(e,i);return t.length===2?`${Ge(t[0],r)} \u2013 ${Ge(t[1],r)}`:Ge(t[0],r)}function GT(t){let e=t.variant??"single",i=t.min??0,r=t.max??zT,s=t.step??1,d=t.minDistance??0,h=iP(t),a=KT({variant:e,values:h,min:i,max:r,step:s,minDistance:d}),E=We(i,r,s);return{variant:a.length===2?"range":"single",min:i,max:r,step:s,minDistance:d,committed:a,readoutPrecision:mi(s,t.valuePrecision),readoutText:$T(a,s,t.valuePrecision),trackStyle:WT(a,E),isRange:a.length===2,valuePrecision:typeof t.valuePrecision=="number"&&Number.isFinite(t.valuePrecision)?t.valuePrecision:void 0}}function WT(t,e){let i=t[0],r=t.length===2?t[1]:t[0],s=`${e.ratioFor(i)*100}%`,d=`${e.ratioFor(r)*100}%`,h=`${(e.ratioFor(r)-e.ratioFor(i))*100}%`;return{"--rui-slider-fill-start":t.length===2?s:"0%","--rui-slider-fill-size":t.length===2?h:d,"--rui-slider-value":s,"--rui-slider-min":s,"--rui-slider-max":d}}var HT,UT=class extends BT{static{({e:[Nw,Xw,Qw,Jw,Zw,eT,tT,iT,rT,nT,oT,aT,sT,lT,uT,cT,dT,hT,pT,fT,mT,gT,bT,vT,yT,_T,xT,wT,TT,ST,ET,RT,AT,IT,CT,DT,OT,VT,kT,MT,LT,PT,Hw],c:[HT,Yw]}=NL(this,[ZL("rui-slider")],[[Ve({type:String,defaultValue:"single"}),0,"variant"],[Ve({type:String,defaultValue:"horizontal"}),0,"orientation"],[Ve({type:Array,reflect:!0,defaultValue:[ta],transform:Rr}),0,"value"],[Ve({type:Number,defaultValue:0}),0,"min"],[Ve({type:Number,defaultValue:zT}),0,"max"],[Ve({type:Number,defaultValue:1}),0,"step"],[Ve({type:Number,attribute:"value-precision",defaultValue:Number.NaN}),0,"valuePrecision"],[Ve({type:Number,defaultValue:0}),0,"minDistance"],[Ve({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[[Ve({type:String,defaultValue:""}),FT([{ref:"label",bool:"hidden",invert:!0},{ref:"label",text:!0}])],0,"label"],[[Ve({type:Boolean,attribute:"show-value",defaultValue:!1}),FT({selector:"[data-default-value]",bool:"hidden",invert:!0})],0,"showValue"],[Ve({type:Boolean,attribute:"value-title",defaultValue:!1}),0,"valueTitle"],[eP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Rt({ref:"root"}),0,"rootTarget"],[Rt({ref:"header"}),0,"headerTarget"],[Rt({ref:"label"}),0,"labelTarget"],[Rt({ref:"rangeTrack"}),0,"rangeTrack"],[Rt({ref:"value"}),0,"valueTarget"],[Rt({ref:"singleThumb"}),0,"singleThumb"],[Rt({ref:"rangeMinThumb"}),0,"rangeMinThumb"],[Rt({ref:"rangeMaxThumb"}),0,"rangeMaxThumb"],[tP(["value","min","max","step","valuePrecision","minDistance","variant","orientation","disabled","readOnly","effectiveDisabled","label","name","showValue","valueTitle"]),2,"onPropsUpdated"],[tr({ref:"rangeTrack",type:"pointerdown"}),2,"onPointerDown"],[tr({document:!0,type:"pointermove"}),2,"onPointerMove"],[tr({document:!0,type:"pointerup"}),2,"onPointerUp"],[tr({document:!0,type:"pointercancel"}),2,"onPointerCancel"],[tr({selector:"[data-thumb]",type:"keydown"}),2,"onThumbKeydown"]],0,void 0,BT))}variant=(Hw(this),Nw(this));orientation=(Xw(this),Qw(this));value=(Jw(this),Zw(this));min=(eT(this),tT(this));max=(iT(this),rT(this));step=(nT(this),oT(this));valuePrecision=(aT(this),sT(this));minDistance=(lT(this),uT(this));readOnly=(cT(this),dT(this));label=(hT(this),pT(this));showValue=(fT(this),mT(this));valueTitle=(gT(this),bT(this));changeEvent=(vT(this),yT(this));rootTarget=(_T(this),xT(this));headerTarget=(wT(this),TT(this));labelTarget=(ST(this),ET(this));rangeTrack=(RT(this),AT(this));valueTarget=(IT(this),CT(this));singleThumb=(DT(this),OT(this));rangeMinThumb=(VT(this),kT(this));rangeMaxThumb=(MT(this),LT(this));activeThumb=(PT(this),null);activePointerId=null;pending=null;lastEmitted="";onConnected(){this.adoptLegacyRangeAttributes(),this.syncChrome(),this.syncValues(this.committedValues())}formValue(){if(!this.name)return null;let e=this.liveValues();if(e.length===2){let i=new FormData;return i.append(this.name,String(e[0])),i.append(`${this.name}-max`,String(e[1])),i}return String(e[0]??"")}formState(){return this.committedValues().join(",")}restoreFormState(e){this.value=String(e).split(",").map(Number).filter(i=>Number.isFinite(i)),this.syncValues(this.committedValues())}adoptLegacyRangeAttributes(){if(this.hasAttribute("value"))return;let e=this.getAttribute("range-min"),i=this.getAttribute("range-max");if(e===null&&i===null)return;let r=e!==null?Number(e):ia,s=i!==null?Number(i):ra;this.value=[r,s]}onPropsUpdated(){this.activeThumb||(this.syncChrome(),this.syncValues(this.committedValues()))}get isRange(){return this.liveValues().length===2}get isVertical(){return this.orientation==="vertical"}get numericRange(){return We(this.min,this.max,this.step)}get resolvedValuePrecision(){return mi(this.step,this.valuePrecision)}formatValue(e){return Ge(e,this.resolvedValuePrecision)}formatValues(e){return $T(e,this.step,this.valuePrecision)}get defaultValueTarget(){return this.querySelector("[data-default-value]")}thumbFor(e){return e==="value"?this.singleThumb:e==="min"?this.rangeMinThumb:this.rangeMaxThumb}parseThumb(e){return this.isRange?e==="min"||e==="max"?e:null:e==="value"?e:null}constrainPair(e,i,r){return qT(this.numericRange,e,i,this.minDistance,r)}committedValues(){return KT({variant:this.variant,values:this.value,min:this.min,max:this.max,step:this.step,minDistance:this.minDistance})}liveValues(){return this.pending??this.committedValues()}changeDetail(e){return{value:e}}emitIfChanged(e){let i=e.join(",");i!==this.lastEmitted&&(this.lastEmitted=i,this.changeEvent.emit(this.changeDetail(e)))}reflectValues(e){let i=this.value;i.length===e.length&&e.every((d,h)=>$i(i[h],d,this.step))||(this.value=e)}syncValues(e){this.paint(e),this.reflectValues(e);let i=e.length>=2?"range":"single";this.variant!==i&&(this.variant=i)}syncChrome(){this.syncRootChrome(),this.syncThumbChrome()}syncRootChrome(){let e=!!this.valueTarget&&(!this.defaultValueTarget||this.showValue);this.rootTarget?.classList.toggle("rui-slider--single",!this.isRange),this.rootTarget?.classList.toggle("rui-slider--range",this.isRange),this.rootTarget?.classList.toggle("rui-slider--vertical",this.isVertical),this.headerTarget?.toggleAttribute("hidden",!this.label&&!e)}syncThumbChrome(){let e=this.effectiveDisabled?-1:0,i=this.isVertical?"vertical":"horizontal",r=this.numericRange;for(let{id:s,label:d,visible:h}of this.getThumbChrome()){let a=this.thumbFor(s);a&&(a.toggleAttribute("hidden",!h),a.toggleAttribute("disabled",this.effectiveDisabled||!h),a.setAttribute("tabindex",String(h?e:-1)),a.setAttribute("aria-label",d),a.setAttribute("aria-orientation",i),a.setAttribute("aria-valuemin",String(r.lowerBound)),a.setAttribute("aria-valuemax",String(r.upperBound)),a.setAttribute("aria-readonly",String(this.readOnly)))}}getThumbChrome(){let e=this.isRange;return[{id:"value",label:this.label||"Value",visible:!e},{id:"min",label:this.label?`${this.label} minimum`:"Minimum value",visible:e},{id:"max",label:this.label?`${this.label} maximum`:"Maximum value",visible:e}]}paint(e){let i=e[0],r=e.length===2?e[1]:e[0],s=this.rangeTrack,d=WT(e,this.numericRange);for(let[h,a]of Object.entries(d))s?.style.setProperty(h,a);this.singleThumb&&(this.singleThumb.setAttribute("aria-valuenow",String(i)),this.singleThumb.setAttribute("aria-valuetext",this.formatValue(i))),this.rangeMinThumb&&(this.rangeMinThumb.setAttribute("aria-valuenow",String(i)),this.rangeMinThumb.setAttribute("aria-valuetext",this.formatValue(i)),this.rangeMinThumb.setAttribute("aria-valuemax",String(r))),this.rangeMaxThumb&&(this.rangeMaxThumb.setAttribute("aria-valuemin",String(i)),this.rangeMaxThumb.setAttribute("aria-valuenow",String(r)),this.rangeMaxThumb.setAttribute("aria-valuetext",this.formatValue(r))),this.valueTarget&&(this.valueTarget.textContent=this.formatValues(e)),this.syncFormValue(),this.syncValueTitle(e)}syncValueTitle(e){let i=[[this.rangeTrack,"track"],[this.singleThumb,"value"],[this.rangeMinThumb,"min"],[this.rangeMaxThumb,"max"]],r=this.getValueTitles(e);for(let[s,d]of i){let h=r[d];h?s?.setAttribute("title",h):s?.removeAttribute("title")}}getValueTitles(e){if(!this.valueTitle)return{};if(e.length===1)return{value:this.formatValue(e[0])};let[i,r]=e;return{min:this.formatValue(i),max:this.formatValue(r),track:this.formatValues(e)}}valueFromPointer(e){let i=this.rangeTrack;if(!i)return this.numericRange.lowerBound;let r=i.getBoundingClientRect();if(r.width===0||r.height===0)return this.numericRange.lowerBound;let s=this.isVertical?1-(e.clientY-r.top)/r.height:(e.clientX-r.left)/r.width;return this.numericRange.valueFromRatio(s)}nearestThumb(e){if(!this.isRange)return"value";let[i,r]=this.liveValues();return Math.abs(e-i)<=Math.abs(e-r)?"min":"max"}moveThumb(e,i){if(this.activeThumb=e,this.isRange){let s=this.pending??this.committedValues();this.pending=this.constrainPair(e==="min"?i:s[0],e==="max"?i:s[1],e)}else this.pending=[this.numericRange.clamp(i)];let r=this.pending;return this.paint(r),this.emitIfChanged(r),r}commit(){let e=this.liveValues();this.pending=null,this.activeThumb=null,this.activePointerId=null,this.syncValues(e)}revert(){this.pending=null,this.activeThumb=null,this.activePointerId=null,this.lastEmitted=this.committedValues().join(","),this.paint(this.committedValues())}releasePointer(e){let i=this.rangeTrack;i?.hasPointerCapture(e.pointerId)&&i.releasePointerCapture(e.pointerId)}onPointerDown(e){if(e.button!==0||this.effectiveDisabled||this.readOnly)return;let i=e.target.closest("[data-thumb]"),r=this.parseThumb(i?.getAttribute("data-thumb")??null),s=this.valueFromPointer(e),d=r??this.nearestThumb(s);this.pending=this.committedValues(),this.lastEmitted=this.pending.join(","),this.activeThumb=d,this.activePointerId=e.pointerId,this.rangeTrack?.setPointerCapture(e.pointerId),this.thumbFor(d)?.focus(),r||this.moveThumb(d,s),e.preventDefault()}onPointerMove(e){!this.activeThumb||e.pointerId!==this.activePointerId||this.moveThumb(this.activeThumb,this.valueFromPointer(e))}onPointerUp(e){!this.activeThumb||e.pointerId!==this.activePointerId||(this.releasePointer(e),this.commit())}onPointerCancel(e){!this.activeThumb||e.pointerId!==this.activePointerId||(this.releasePointer(e),this.revert())}onThumbKeydown(e){if(this.effectiveDisabled||this.readOnly)return;let i=e.target.closest("[data-thumb]"),r=this.parseThumb(i?.getAttribute("data-thumb")??null);if(!r)return;let s=this.committedValues(),d=r==="max"?s[s.length-1]:s[0],h=Xr(this.numericRange,d,e.key);h!=null&&(e.preventDefault(),this.lastEmitted=s.join(","),this.moveThumb(r,h),this.commit())}static{Yw()}};import{jsx as Ue,jsxs as na}from"@ecopages/jsx/jsx-runtime";function YT({children:t,class:e,...i}){return Ue("span",{...i,class:j("rui-slider__value",e),"data-ref":"value","aria-hidden":"true",children:t})}function rP({disabled:t,min:e,max:i,label:r,variant:s,committed:d,readoutPrecision:h,trackStyle:a}){let E=s!=="range",A=r||"Value",S=d[0],I=d.length===2?d[1]:d[0],T=Ge(S,h),K=Ge(I,h);return Ue("div",{class:"rui-slider__range",children:na("div",{class:"rui-slider__range-track","data-ref":"rangeTrack",style:a,children:[Ue("div",{class:"rui-slider__range-fill","data-ref":"rangeFill"}),Ue("button",{type:"button",class:"rui-slider__thumb","data-ref":"singleThumb","data-thumb":"value",role:"slider",tabindex:t||!E?-1:0,"aria-label":A,"aria-valuemin":e,"aria-valuemax":i,"aria-valuenow":S,"aria-valuetext":T,disabled:t||!E,hidden:!E}),Ue("button",{type:"button",class:"rui-slider__thumb","data-ref":"rangeMinThumb","data-thumb":"min",role:"slider",tabindex:t||E?-1:0,"aria-label":r?`${r} minimum`:"Minimum value","aria-valuemin":e,"aria-valuemax":I,"aria-valuenow":S,"aria-valuetext":T,disabled:t||E,hidden:E}),Ue("button",{type:"button",class:"rui-slider__thumb","data-ref":"rangeMaxThumb","data-thumb":"max",role:"slider",tabindex:t||E?-1:0,"aria-label":r?`${r} maximum`:"Maximum value","aria-valuemin":S,"aria-valuemax":i,"aria-valuenow":I,"aria-valuetext":K,disabled:t||E,hidden:E})]})})}function nP({variant:t,orientation:e="horizontal",label:i,showValue:r=!1,valueTitle:s=!1,disabled:d,name:h,min:a,max:E,step:A,value:S,valuePrecision:I,minDistance:T,children:K,...$}){let V=GT({variant:t,value:S,min:a,max:E,step:A,minDistance:T,valuePrecision:I}),G=K??Ue(YT,{"data-default-value":!0,hidden:!r,children:V.readoutText}),W=!!K||r;return Ue("rui-slider",{...$,variant:V.variant,orientation:e,label:i,showValue:r,valueTitle:s,disabled:d,name:h,min:V.min,max:V.max,step:V.step,value:V.committed,minDistance:V.minDistance,valuePrecision:V.valuePrecision,children:Ue(oP,{seed:V,orientation:e,label:i,disabled:d,hasVisibleReadout:W,valueReadout:G})})}function oP({seed:t,orientation:e,label:i,disabled:r,hasVisibleReadout:s,valueReadout:d}){return na("div",{class:j("rui-slider",t.isRange?"rui-slider--range":"rui-slider--single",e==="vertical"&&"rui-slider--vertical"),"data-ref":"root",children:[na("div",{class:"rui-slider__header","data-ref":"header",hidden:!i&&!s,children:[Ue("span",{class:"rui-slider__label","data-ref":"label",hidden:!i,children:i}),d]}),Ue(rP,{disabled:r,min:t.min,max:t.max,label:i,variant:t.variant,committed:t.committed,readoutPrecision:t.readoutPrecision,trackStyle:t.trackStyle})]})}import{jsx as aP}from"@ecopages/jsx/jsx-runtime";function sP({size:t="md",aria:e,class:i,...r}){return aP("span",{...r,role:"status",aria:ne(e,"Loading"),class:j("rui-spinner",`rui-spinner--${t}`,i)})}import{RadiantElement as aS,bindTo as oa,customElement as hP,event as pP,onEvent as fP,prop as aa}from"@ecopages/radiant";var NT,XT,QT,JT,ZT,eS,tS,iS,rS,nS;function lP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:oS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||oS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:uP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return dP(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function uP(t){var e=cP(t,"string");return typeof e=="symbol"?e:e+""}function cP(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oS(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function dP(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var lS,sS=class extends aS{static{({e:[QT,JT,ZT,eS,tS,iS,rS,nS,NT],c:[lS,XT]}=lP(this,[hP("rui-switch")],[[[aa({type:Boolean,reflect:!0,defaultValue:!1}),oa({ref:"input",prop:"checked"})],0,"checked"],[[aa({type:Boolean,reflect:!0,defaultValue:!1}),oa({ref:"input",prop:"disabled"})],0,"disabled"],[[aa({type:String,defaultValue:""}),oa({ref:"input",attr:"name",map:gt})],0,"name"],[pP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[fP({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,aS))}constructor(...e){super(...e),nS(this)}checked=(NT(this),QT(this));disabled=(JT(this),ZT(this));name=(eS(this),tS(this));changeEvent=(iS(this),rS(this));onInputChange(e){let i=e.target;this.checked=i.checked,this.changeEvent.emit({checked:this.checked})}static{XT()}};import{jsx as ir,jsxs as mP}from"@ecopages/jsx/jsx-runtime";function gP({children:t,checked:e,disabled:i,name:r,...s}){return ir("rui-switch",{...s,checked:e,disabled:i,name:r,children:mP("label",{class:"rui-switch",children:[ir("input",{type:"checkbox",role:"switch","data-ref":"input","data-rui-control":!0,"data-rui-control-type":"boolean",class:"rui-switch__input",checked:e,disabled:i,name:r||void 0}),ir("span",{class:"rui-switch__track","aria-hidden":"true",children:ir("span",{class:"rui-switch__thumb"})}),ir("span",{class:"rui-switch__label",children:t})]})})}import{jsx as pe,jsxs as MS}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as DS,customElement as xP,event as sa,onEvent as yi,onUpdated as OS,prop as _i}from"@ecopages/radiant";var uS,cS,dS,hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,TS,SS,ES,RS,AS,IS;function bP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:CS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||CS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:vP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _P(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function vP(t){var e=yP(t,"string");return typeof e=="symbol"?e:e+""}function yP(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CS(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function _P(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var kS,VS=class extends DS{static{({e:[dS,hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,TS,SS,ES,RS,AS,IS,uS],c:[kS,cS]}=bP(this,[xP("rui-table")],[[_i({type:String,defaultValue:""}),0,"label"],[_i({type:String,attribute:"aria-busy",defaultValue:"false"}),0,"ariaBusy"],[_i({type:String,attribute:"selection-mode",defaultValue:"none"}),0,"selectionMode"],[_i({...Ie,defaultValue:[]}),0,"value"],[_i({type:String,attribute:"sort-column",reflect:!0,defaultValue:""}),0,"sortColumn"],[_i({type:String,attribute:"sort-direction",reflect:!0,defaultValue:"ascending"}),0,"sortDirection"],[sa({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[sa({name:"rui-sort-change",bubbles:!0,composed:!0}),0,"sortChangeEvent"],[sa({name:"rui-row-action",bubbles:!0,composed:!0}),0,"rowActionEvent"],[OS(["value","selectionMode"]),2,"onSelectionUpdated"],[OS(["sortColumn","sortDirection"]),2,"onSortUpdated"],[yi({selector:"[data-table-cell]",type:"click"}),2,"onCellClick"],[yi({selector:"[data-table-cell]",type:"dblclick"}),2,"onCellDoubleClick"],[yi({selector:"[data-table-cell]",type:"keydown"}),2,"onCellKeydown"],[yi({selector:"rui-checkbox[data-table-select-row]",type:"rui-change"}),2,"onRowSelectionChange"],[yi({selector:"rui-checkbox[data-table-select-all]",type:"rui-change"}),2,"onSelectAllChange"],[yi({selector:"[data-table-sort]",type:"click"}),2,"onSortClick"]],0,void 0,DS))}label=(uS(this),dS(this));ariaBusy=(hS(this),pS(this));selectionMode=(fS(this),mS(this));value=(gS(this),bS(this));sortColumn=(vS(this),yS(this));sortDirection=(_S(this),xS(this));changeEvent=(wS(this),TS(this));sortChangeEvent=(SS(this),ES(this));rowActionEvent=(RS(this),AS(this));structureObserver=void IS(this);rovingSyncPending=!1;connectedCallback(){super.connectedCallback(),this.observeStructure()}onConnected(){this.syncSelectionState(),this.syncSorting(),this.syncRovingTabindex()}disconnectedCallback(){this.structureObserver?.disconnect(),this.structureObserver=void 0,super.disconnectedCallback()}onSelectionUpdated(){this.syncSelectionState()}onSortUpdated(){this.syncSorting()}observeStructure(){typeof MutationObserver>"u"||(this.structureObserver?.disconnect(),this.structureObserver=new MutationObserver(()=>this.queueRovingSync()),this.structureObserver.observe(this,{childList:!0,subtree:!0}))}queueRovingSync(){this.rovingSyncPending||(this.rovingSyncPending=!0,queueMicrotask(()=>{this.rovingSyncPending=!1,this.isConnected&&this.syncRovingTabindex()}))}getRows(){return Array.from(this.querySelectorAll("[data-table-row]"))}getSelectableRows(){return this.getRows().filter(e=>!e.hidden&&e.getAttribute("aria-disabled")!=="true")}getRowCells(e){return Array.from(e.children).filter(i=>i instanceof HTMLElement&&i.hasAttribute("data-table-cell"))}getFocusableCells(){return this.getSelectableRows().flatMap(e=>this.getRowCells(e))}selectedIds(){return this.selectionMode==="single"?this.value.length>0?[this.value[0]]:[]:this.value}setSelectedIds(e){this.selectionMode==="single"?this.value=e.length>0?[e[0]]:[]:this.value=e,this.syncSelectionState(),this.changeEvent.emit({value:this.value})}getActiveCellPosition(){let e=this.getFocusableCells(),i=e.findIndex(h=>h.tabIndex===0),r=i>=0?e[i]:this.querySelector("[data-table-cell]:focus")??null;if(!r)return null;let s=r.closest("[data-table-row]");if(!s)return null;let d=this.getRowCells(s).indexOf(r);return d<0?null:{rowId:s.getAttribute("data-table-row")??"",columnIndex:d}}syncSelectionState(){let e=new Set(this.selectedIds()),i=this.getSelectableRows(),r=this.selectionMode!=="none";for(let s of this.getRows()){let d=s.getAttribute("data-table-row")??"";r?s.setAttribute("aria-selected",String(e.has(d))):s.removeAttribute("aria-selected");let h=s.querySelector("rui-checkbox[data-table-select-row]");h&&(h.checked=r&&e.has(d),h.disabled=!r||s.getAttribute("aria-disabled")==="true")}for(let s of this.querySelectorAll("rui-checkbox[data-table-select-all]")){let d=i.filter(a=>e.has(a.getAttribute("data-table-row")??"")).length,h=this.selectionMode==="multiple";s.checked=h&&i.length>0&&d===i.length,s.indeterminate=h&&d>0&&d<i.length,s.disabled=!h||i.length===0}}syncRovingTabindex(){let e=this.getFocusableCells();if(e.length===0)return;let i=this.getActiveCellPosition(),r=e.findIndex(s=>s.tabIndex===0);if(i){let s=this.getRows().find(d=>d.getAttribute("data-table-row")===i.rowId);if(s){let d=this.getRowCells(s)[i.columnIndex],h=d?e.indexOf(d):-1;h>=0&&(r=h)}}ue(e,r>=0?r:0)}syncSorting(){for(let e of this.querySelectorAll("[data-table-column]")){let i=e.getAttribute("data-table-column");i&&i===this.sortColumn?e.setAttribute("aria-sort",this.sortDirection):e.removeAttribute("aria-sort")}}isInteractiveTarget(e){return!!e.closest('button, input, select, textarea, a[href], [contenteditable="true"], rui-checkbox')}selectRow(e,i=!1){if(this.selectionMode==="none"||e.getAttribute("aria-disabled")==="true")return;let r=e.getAttribute("data-table-row")??"";if(!r)return;if(this.selectionMode==="single"){this.setSelectedIds([r]);return}let s=new Set(this.selectedIds());i&&s.has(r)?s.delete(r):s.add(r),this.setSelectedIds([...s])}focusCell(e,i){let r=this.getFocusableCells(),s=this.getRowCells(e),d=s[Math.min(Math.max(i,0),s.length-1)],h=r.indexOf(d);h<0||(ue(r,h),d.focus(),d.scrollIntoView({block:"nearest",inline:"nearest"}))}activateRow(e){if(!e.hasAttribute("data-table-actionable")||e.getAttribute("aria-disabled")==="true")return;let i=e.getAttribute("data-table-row")??"";i&&this.rowActionEvent.emit({rowId:i})}onCellClick(e){let i=e.target;if(this.isInteractiveTarget(i))return;let r=i.closest("[data-table-cell]"),s=r?.closest("[data-table-row]");!r||!s||!this.contains(s)||(this.selectRow(s,this.selectionMode==="multiple"),this.focusCell(s,this.getRowCells(s).indexOf(r)))}onCellDoubleClick(e){let i=e.target;if(this.isInteractiveTarget(i))return;let r=i.closest("[data-table-row]");r&&this.contains(r)&&this.activateRow(r)}onCellKeydown(e){let i=e.target;if(this.isInteractiveTarget(i))return;let r=i.closest("[data-table-cell]"),s=r?.closest("[data-table-row]");if(!r||!s)return;let d=this.getSelectableRows(),h=d.indexOf(s),a=this.getRowCells(s),E=a.indexOf(r);switch(e.key){case"ArrowRight":e.preventDefault(),this.focusCell(s,E+1);return;case"ArrowLeft":e.preventDefault(),this.focusCell(s,E-1);return;case"ArrowDown":e.preventDefault(),this.focusCell(d[Math.min(h+1,d.length-1)]??s,E);return;case"ArrowUp":e.preventDefault(),this.focusCell(d[Math.max(h-1,0)]??s,E);return;case"Home":e.preventDefault(),this.focusCell(s,0);return;case"End":e.preventDefault(),this.focusCell(s,a.length-1);return;case" ":e.preventDefault(),this.selectRow(s,!0);return;case"Enter":e.preventDefault(),this.activateRow(s);return;default:return}}onRowSelectionChange(e){let r=e.target.closest("[data-table-row]");if(!r||!this.contains(r))return;let s=r.getAttribute("data-table-row")??"";if(!e.detail.checked){let d=new Set(this.selectedIds());d.delete(s),this.setSelectedIds([...d]);return}this.selectRow(r)}onSelectAllChange(e){this.selectionMode==="multiple"&&this.setSelectedIds(e.detail.checked?this.getSelectableRows().map(i=>i.getAttribute("data-table-row")??""):[])}onSortClick(e){let r=e.target.closest("[data-table-sort]")?.getAttribute("data-table-sort");r&&(this.sortDirection=r===this.sortColumn&&this.sortDirection==="ascending"?"descending":"ascending",this.sortColumn=r,this.syncSorting(),this.sortChangeEvent.emit({column:r,direction:this.sortDirection}))}static{cS()}};function wP({children:t,class:e,...i}){return pe("div",{...i,role:"rowgroup",class:j("rui-table__header",e),children:pe("div",{class:"rui-table__row",role:"row",children:t})})}function TP({children:t,class:e,...i}){return pe("div",{...i,role:"rowgroup",class:j("rui-table__body",e),children:t})}function SP({children:t,class:e,...i}){return pe("div",{...i,role:"rowgroup",class:j("rui-table__footer",e),children:pe("div",{class:"rui-table__row",role:"row",children:t})})}function EP({id:t,allowsSorting:e=!1,isRowHeader:i=!1,children:r,class:s,...d}){return pe("div",{...d,role:"columnheader","data-table-column":t,"data-table-row-header":i?"":void 0,class:j("rui-table__column",s),children:e?MS("button",{type:"button","data-table-sort":t,class:"rui-table__sort",children:[pe("span",{children:r}),pe("span",{class:"rui-table__sort-indicator","aria-hidden":"true"})]}):r})}function RP({id:t,disabled:e,actionable:i,children:r,class:s,...d}){return pe("div",{...d,role:"row","data-table-row":t,"data-table-actionable":i?"":void 0,"aria-disabled":e?"true":void 0,class:j("rui-table__row",s),children:r})}function AP({isRowHeader:t=!1,children:e,class:i,...r}){return pe("div",{...r,role:t?"rowheader":"gridcell","data-table-cell":!0,tabindex:-1,class:j("rui-table__cell",i),children:e})}function IP({scope:t,label:e,class:i,...r}){let s=t==="all";return pe("div",{...r,role:s?"columnheader":"gridcell","data-table-cell":!0,"data-table-selection-cell":t,class:j("rui-table__selection-cell",i),children:pe(Di,{"data-table-select-all":s?"":void 0,"data-table-select-row":s?void 0:"",children:pe("span",{class:"sr-only",children:e??(s?"Select all rows":"Select row")})})})}function CP({colSpan:t,children:e,class:i,...r}){let s=Math.max(1,Math.floor(t));return MS("div",{role:"row",class:"rui-table__row rui-table__row--empty",children:[pe("div",{...r,role:"gridcell","aria-colspan":s,class:j("rui-table__empty-state",i),children:pe("span",{class:"rui-table__empty-state-message",children:e})}),Array.from({length:s-1},(d,h)=>pe("div",{"aria-hidden":"true",class:"rui-table__empty-state-spacer"},h))]})}function DP({children:t,label:e,ariaBusy:i,selectionMode:r,value:s,...d}){return pe("rui-table",{...d,value:s,label:e,ariaBusy:i,selectionMode:r,children:pe("div",{class:"rui-table",role:"grid","aria-label":e||void 0,"aria-busy":i==="true"?"true":void 0,"aria-multiselectable":r==="multiple"?"true":void 0,children:t})})}import{RadiantElement as YS,customElement as LP,event as PP,onEvent as NS,onUpdated as jP,prop as ln}from"@ecopages/radiant";var LS,PS,jS,FS,BS,US,zS,qS,KS,$S,GS,WS;function OP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:HS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||HS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:VP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return MP(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function VP(t){var e=kP(t,"string");return typeof e=="symbol"?e:e+""}function kP(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function HS(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function MP(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var QS,XS=class extends YS{static{({e:[jS,FS,BS,US,zS,qS,KS,$S,GS,WS,LS],c:[QS,PS]}=OP(this,[LP("rui-tabs")],[[ln({type:String,reflect:!0,defaultValue:"boxed"}),0,"variant"],[ln({type:String,reflect:!0,defaultValue:""}),0,"value"],[ln({type:String,defaultValue:""}),0,"label"],[ln({type:Boolean,defaultValue:!0}),0,"automatic"],[PP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[jP(["value","label"]),2,"onPropsUpdated"],[NS({selector:'[role="tab"]',type:"click"}),2,"onTabClick"],[NS({selector:'[role="tab"]',type:"keydown"}),2,"onTabKeydown"]],0,void 0,YS))}variant=(LS(this),jS(this));value=(FS(this),BS(this));label=(US(this),zS(this));automatic=(qS(this),KS(this));changeEvent=($S(this),GS(this));childObserver=(WS(this),null);connectedCallback(){super.connectedCallback(),this.childObserver=new MutationObserver(()=>this.resync()),this.childObserver.observe(this,{childList:!0,subtree:!0})}onConnected(){this.resync()}disconnectedCallback(){this.childObserver?.disconnect(),this.childObserver=null,super.disconnectedCallback()}onPropsUpdated(){this.resync()}resync(){this.syncTablistLabel(),this.syncSelection(this.value||this.getTabValue(this.getTabs()[0])||"")}getTabs(){return Array.from(this.querySelectorAll('[role="tab"]'))}getPanels(){return Array.from(this.querySelectorAll('[role="tabpanel"]'))}getTabValue(e){return e?e.dataset.tabValue??e.id.replace(/^tab-/,""):""}syncTablistLabel(){let e=this.querySelector('[role="tablist"]');!e||e.hasAttribute("aria-label")||!this.label||e.setAttribute("aria-label",this.label)}syncSelection(e){let i=this.getTabs(),r=this.getPanels();if(!i.length)return;let s=i.find(h=>this.getTabValue(h)===e)??i.find(h=>h.id===e)??i[0],d=this.getTabValue(s);this.value=d;for(let h of i){let a=h===s;h.setAttribute("aria-selected",String(a)),h.tabIndex=a?0:-1}for(let h of r){let E=(h.dataset.tabValue??h.id.replace(/^panel-/,""))===d;h.hidden=!E,h.hasAttribute("tabindex")||(h.tabIndex=0)}}activateTab(e){!e||e.getAttribute("aria-disabled")==="true"||(this.syncSelection(this.getTabValue(e)),this.changeEvent.emit({value:this.value}))}onTabClick(e){let i=e.target.closest('[role="tab"]');!i||!this.contains(i)||this.activateTab(i)}onTabKeydown(e){let i=this.getTabs(),r=e.target.closest('[role="tab"]');if(!r||!i.includes(r))return;if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateTab(r);return}let s=de({items:i,current:r,key:e.key,orientation:"horizontal"});s.handled&&(e.preventDefault(),this.automatic&&this.activateTab(s.item))}static{PS()}};import{jsx as rr}from"@ecopages/jsx/jsx-runtime";function FP({children:t,class:e,...i}){return rr("div",{...i,class:j("rui-tabs__list",e),role:"tablist",children:t})}function BP({id:t,children:e,class:i,disabled:r,selected:s,...d}){return rr("button",{...d,type:"button",class:j("rui-tabs__tab",i),role:"tab",id:`tab-${t}`,"data-tab-value":t,"aria-controls":`panel-${t}`,"aria-selected":s?"true":"false",tabindex:s?0:-1,disabled:r,children:e})}function UP({children:t,class:e,...i}){return rr("div",{...i,class:j("rui-tabs__panels",e),children:t})}function zP({id:t,children:e,class:i,selected:r,hidden:s,...d}){return rr("div",{...d,class:j("rui-tabs__panel",i),role:"tabpanel",id:`panel-${t}`,"data-tab-value":t,"aria-labelledby":`tab-${t}`,tabindex:0,hidden:r===void 0?s:!r,children:e})}function qP({children:t,...e}){return rr("rui-tabs",{...e,children:t})}import{jsx as KP}from"@ecopages/jsx/jsx-runtime";function $P(t){let{class:e,rows:i=3,...r}=t;return KP("textarea",{...r,rows:i,[ot]:"","data-rui-control-type":"text",class:j("rui-textarea",e)})}import{jsx as ut,jsxs as SE}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as EE,bindTo as fa,bound as ma,customElement as ZP,onEvent as RE,onUpdated as ga,prop as Ne,query as ej}from"@ecopages/radiant";var nr="rui-toast-show",or="rui-toast-dismiss",GP=["top-start","top-center","top-end","bottom-start","bottom-center","bottom-end"],ar=4e3,WP=356,la=14,ua=24,ca=3,da=3,sr=45,ha=200,lr="bottom-end";function lt(t){let[e,i]=t.split("-");return{y:e,x:i}}var HP=1;function YP(){return HP++}function JS(t,e){return typeof t=="function"?t(e):t}var pa=class{subscribers=[];toasts=[];subscribe=e=>(this.subscribers.push(e),e(this.toasts),()=>{let i=this.subscribers.indexOf(e);i>=0&&this.subscribers.splice(i,1)});getSnapshot=()=>this.toasts;publish(){let e=this.toasts;for(let i of this.subscribers)i(e)}create=(e,i={})=>{let r=i.id??YP(),s=i.dismissible??!0,d=this.toasts.findIndex(a=>a.id===r),h={id:r,title:e,description:i.description,variant:i.variant??"default",duration:i.duration,action:i.action,dismissible:s,closeButton:i.closeButton,position:i.position,delete:!1};return d>=0?this.toasts=this.toasts.map(a=>a.id===r?{...a,...h,delete:!1}:a):this.toasts=[h,...this.toasts],this.publish(),r};dismiss=e=>{if(e==null){if(this.toasts.length===0)return;this.toasts=this.toasts.map(i=>({...i,delete:!0}))}else{let i=this.toasts.find(r=>r.id===e);if(!i||i.delete)return;this.toasts=this.toasts.map(r=>r.id===e?{...r,delete:!0}:r)}this.publish()};remove=e=>{this.toasts=this.toasts.filter(i=>i.id!==e),this.publish()};clear=()=>{this.toasts.length!==0&&(this.toasts=[],this.publish())};message=(e,i)=>this.create(e,i);success=(e,i)=>this.create(e,{...i,variant:"success"});error=(e,i)=>this.create(e,{...i,variant:"error"});info=(e,i)=>this.create(e,{...i,variant:"info"});warning=(e,i)=>this.create(e,{...i,variant:"warning"});loading=(e,i)=>this.create(e,{...i,variant:"loading",duration:i?.duration??Number.POSITIVE_INFINITY});promise=(e,i)=>{let r=this.loading(i.loading,{duration:Number.POSITIVE_INFINITY,action:i.action,closeButton:i.closeButton,position:i.position,description:typeof i.description=="string"?i.description:void 0});return(typeof e=="function"?e():e).then(d=>{let h=typeof i.description=="function"?i.description(d):i.description;this.create(JS(i.success,d),{id:r,variant:"success",description:h,duration:i.duration,action:i.action,closeButton:i.closeButton,position:i.position})}).catch(d=>{let h=typeof i.description=="function"?i.description(d):i.description;this.create(JS(i.error,d),{id:r,variant:"error",description:h,duration:i.duration,action:i.action,closeButton:i.closeButton,position:i.position})}),r}},le=new pa;var ZS,eE,tE,iE,rE,nE,oE,aE,sE,lE,uE,cE,dE,hE,pE,fE,mE,gE,bE,vE,yE,_E,xE,wE;function NP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:TE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||TE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:XP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return JP(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function XP(t){var e=QP(t,"string");return typeof e=="symbol"?e:e+""}function QP(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function TE(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function JP(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var ur=new Map,cn=new Map;function ba(t){return String(t)}function un(t){if(t==="")return;let e=ba(t);ur.delete(e),cn.delete(e)}function tj(t){if(t==="")return;let e=ba(t),i=ur.get(e);i!=null&&(cn.set(e,Math.max(0,i-Date.now())),ur.delete(e))}var IE,AE=class extends EE{static{({e:[tE,iE,rE,nE,oE,aE,sE,lE,uE,cE,dE,hE,pE,fE,mE,gE,bE,vE,yE,_E,xE,wE,ZS],c:[IE,eE]}=NP(this,[ZP("rui-toast")],[[Ne({type:String,reflect:!0,defaultValue:""}),0,"toastId"],[Ne({type:String,defaultValue:""}),0,"title"],[Ne({type:String,defaultValue:""}),0,"description"],[[Ne({type:String,reflect:!0,defaultValue:"default"}),fa({attr:"data-variant",map:e=>e??"default"})],0,"variant"],[Ne({type:Number,defaultValue:4e3}),0,"duration"],[[Ne({type:Boolean,defaultValue:!0}),fa({attr:"data-dismissible"})],0,"dismissible"],[Ne({type:Boolean,defaultValue:!1}),0,"closeButton"],[Ne({type:String,defaultValue:""}),0,"actionLabel"],[[Ne({type:String,defaultValue:lr}),fa([{attr:"data-y-position",map:e=>lt(e).y},{attr:"data-x-position",map:e=>lt(e).x}])],0,"position"],[Ne({type:Boolean,defaultValue:!1}),0,"markedDelete"],[ej({ref:"toast"}),0,"toastTarget"],[ga("position"),2,"onPositionUpdated"],[ga("duration"),2,"onDurationUpdated"],[ga("markedDelete"),2,"onMarkedDeleteUpdated"],[ma,2,"onPointerDown"],[ma,2,"onPointerMove"],[ma,2,"onPointerUp"],[RE({selector:"[data-toast-close]",type:"click"}),2,"onCloseClick"],[RE({selector:"[data-toast-action]",type:"click"}),2,"onActionClick"]],0,void 0,EE))}toastId=(ZS(this),tE(this));title=(iE(this),rE(this));description=(nE(this),oE(this));variant=(aE(this),sE(this));duration=(lE(this),uE(this));dismissible=(cE(this),dE(this));closeButton=(hE(this),pE(this));actionLabel=(fE(this),mE(this));position=(gE(this),bE(this));markedDelete=(vE(this),yE(this));toastTarget=(_E(this),xE(this));mounted=(wE(this),!1);removed=!1;swiping=!1;swipeOut=!1;swipeAxis=null;swipeOutDirection=null;held=!1;timerReady=!1;timeoutId=null;pointerStart=null;dragStartTime=null;exitTimer=null;connectedCallback(){super.connectedCallback();let e=this.mounted;if(this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointermove",this.onPointerMove),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointercancel",this.onPointerUp),e){this.timerReady=!0,this.syncDomState(),this.dispatchEvent(new CustomEvent("rui-toast-mounted",{bubbles:!0})),!this.held&&!this.removed&&this.startTimer();return}this.timerReady=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.isConnected&&(this.mounted=!0,this.timerReady=!0,this.syncDomState(),this.dispatchEvent(new CustomEvent("rui-toast-mounted",{bubbles:!0})),!this.held&&!this.removed&&this.startTimer())})}),this.syncDomState()}disconnectedCallback(){this.clearTimer(),this.exitTimer&&(clearTimeout(this.exitTimer),this.exitTimer=null);let e=this.resolvedId;e!==""&&this.removed&&le.remove(e),this.held=!1,this.timerReady=!1,this.removeEventListener("pointerdown",this.onPointerDown),this.removeEventListener("pointermove",this.onPointerMove),this.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointercancel",this.onPointerUp),super.disconnectedCallback()}onPositionUpdated(){this.syncDomState()}setPaused(e){if(this.held===e){!e&&this.timerReady&&this.mounted&&!this.removed&&!this.timeoutId&&this.startTimer();return}this.held=e,!(!this.timerReady||!this.mounted||this.removed)&&(e||document.hidden?(tj(this.resolvedId),this.clearTimer()):this.startTimer())}onDurationUpdated(){!this.timerReady||!this.mounted||this.removed||this.held||(un(this.resolvedId),this.startTimer())}onMarkedDeleteUpdated(){this.markedDelete&&!this.removed&&this.beginRemove()}get resolvedId(){let e=this.toastId;if(e==null||e==="")return"";let i=Number(e);return Number.isFinite(i)&&String(i)===e?i:e}clearTimer(){this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=null}startTimer(){if(this.held||this.removed||document.hidden||this.duration===Number.POSITIVE_INFINITY||this.variant==="loading")return;if(this.duration<=0){this.beginRemove();return}let e=this.resolvedId,i=ba(e),r=Date.now(),s=cn.get(i);if(cn.delete(i),s==null){let d=ur.get(i);s=d!=null?d-r:this.duration}if(s<=0){un(e),this.beginRemove();return}ur.set(i,r+s),this.clearTimer(),this.timeoutId=setTimeout(()=>{un(e),this.beginRemove()},s)}beginRemove(){this.removed||(this.removed=!0,this.clearTimer(),un(this.resolvedId),this.syncDomState(),this.markedDelete||le.dismiss(this.resolvedId),this.exitTimer=setTimeout(()=>{this.exitTimer=null,le.remove(this.resolvedId)},200))}onPointerDown(e){!this.dismissible||this.variant==="loading"||e.button!==0||e.target?.closest("[data-toast-close], [data-toast-action], button, a")||(this.dragStartTime=Date.now(),this.pointerStart={x:e.clientX,y:e.clientY},this.swipeAxis=null,this.setPointerCapture(e.pointerId))}onPointerMove(e){if(!this.pointerStart)return;let i={x:e.clientX-this.pointerStart.x,y:e.clientY-this.pointerStart.y};if(!this.startSwipe(i))return;this.swipeAxis??=Math.abs(i.x)>Math.abs(i.y)?"x":"y";let r=this.swipeAxis==="x"?{x:i.x,y:0}:{x:0,y:i.y};this.isSwipeReversing(r)?this.resetSwipeTranslation():this.setSwipeTranslation(r)}startSwipe(e){return this.swiping?!0:Math.abs(e.x)<8&&Math.abs(e.y)<8?!1:(this.swiping=!0,this.syncDomState(),!0)}isSwipeReversing(e){let{x:i,y:r}=lt(this.position);return this.swipeAxis==="y"?(r==="bottom"?e.y<0:e.y>0)&&Math.abs(e.y)<45:i!=="center"&&(i==="start"?e.x>0:e.x<0)&&Math.abs(e.x)<45}setSwipeTranslation(e){this.style.setProperty("--rui-toast-swipe-x",`${e.x}px`),this.style.setProperty("--rui-toast-swipe-y",`${e.y}px`)}resetSwipeTranslation(){this.setSwipeTranslation({x:0,y:0})}onPointerUp(e){if(!this.pointerStart)return;this.releaseToastPointer(e.pointerId);let i=this.readSwipe();this.swiping=!1,i&&this.dismissible&&this.shouldDismissSwipe(i)?this.dismissFromSwipe(i):this.cancelSwipe(),this.clearPointerState()}releaseToastPointer(e){try{this.releasePointerCapture(e)}catch{}}readSwipe(){if(this.swiping)return{x:Number.parseFloat(this.style.getPropertyValue("--rui-toast-swipe-x")||"0"),y:Number.parseFloat(this.style.getPropertyValue("--rui-toast-swipe-y")||"0")}}shouldDismissSwipe(e){let i=this.swipeAxis==="x"?e.x:e.y,r=this.dragStartTime?Date.now()-this.dragStartTime:0;return Math.abs(i)>=45||Math.abs(i)/Math.max(r,1)>.11}dismissFromSwipe(e){let{x:i,y:r}=lt(this.position);this.swipeOutDirection=this.swipeAxis==="y"?r==="bottom"?"down":"up":i==="start"?"left":i==="end"?"right":e.x<0?"left":"right",this.swipeOut=!0,this.syncDomState(),this.beginRemove()}cancelSwipe(){this.resetSwipeTranslation(),this.swipeAxis=null,this.syncDomState()}clearPointerState(){this.pointerStart=null,this.dragStartTime=null}onCloseClick(e){e.stopPropagation(),this.dismissible&&this.beginRemove()}onActionClick(e){e.stopPropagation(),le.getSnapshot().find(r=>r.id===this.resolvedId)?.action?.onClick(e),this.dismissible&&this.beginRemove()}syncDomState(){this.setAttribute("role","listitem"),this.dataset.mounted=String(this.mounted),this.dataset.removed=String(this.removed),this.dataset.swiping=String(this.swiping),this.dataset.swipeOut=String(this.swipeOut),this.swipeOutDirection?this.dataset.swipeDirection=this.swipeOutDirection:delete this.dataset.swipeDirection}iconForVariant(){switch(this.variant){case"success":return ut(wi,{});case"error":return ut(Re,{});case"warning":return"!";case"info":return"i";default:return""}}render(){let e=this.variant??"default",i=this.iconForVariant(),r=e!=="default";return SE("div",{ref:"toast",class:`rui-toast rui-toast--${e}`,role:"status","aria-live":"off","data-ref":"toast",children:[this.closeButton&&e!=="loading"?ut("button",{type:"button",class:"rui-toast__close","data-toast-close":!0,"aria-label":"Close toast",children:ut(Re,{})}):null,r?ut("span",{class:"rui-toast__icon","data-icon":!0,"aria-hidden":"true",children:e==="loading"?ut("span",{class:"rui-toast__loader"}):i}):null,SE("div",{class:"rui-toast__content",children:[ut("div",{class:"rui-toast__title","data-title":!0,children:this.$.title}),this.description?ut("div",{class:"rui-toast__description","data-description":!0,children:this.$.description}):null]}),this.actionLabel?ut("button",{type:"button",class:"rui-toast__action rui-button rui-button--outline rui-button--sm","data-toast-action":!0,children:this.$.actionLabel}):null]})}static{eE()}};import{jsx as va}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as tR,bindTo as aj,bound as dn,customElement as sj,onEvent as ya,onUpdated as lj,prop as At,query as uj,state as cj}from"@ecopages/radiant";function CE(t,e,i){let r=0;for(let s=0;s<t;s+=1)r+=e[s]??0;return r+t*i}function DE(t,e){return t.length===0?0:t.reduce((r,s)=>r+s,0)+Math.max(0,t.length-1)*e}function OE(t,e,i){return e<=0?0:t+Math.max(0,e-1)*i}var VE,kE,ME,LE,PE,jE,FE,BE,UE,zE,qE,KE,$E,GE,WE,HE,YE,NE,XE,QE,JE,ZE;function ij(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:eR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||eR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:rj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return oj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function rj(t){var e=nj(t,"string");return typeof e=="symbol"?e:e+""}function nj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eR(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function oj(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}function iR(t,e){return t instanceof Node&&e.contains(t)}var nR,rR=class extends tR{static{({e:[ME,LE,PE,jE,FE,BE,UE,zE,qE,KE,$E,GE,WE,HE,YE,NE,XE,QE,JE,ZE,VE],c:[nR,kE]}=ij(this,[sj("rui-toaster")],[[[At({type:String,reflect:!0,defaultValue:lr}),aj([{attr:"data-y-position",map:e=>lt(e).y},{attr:"data-x-position",map:e=>lt(e).x}])],0,"position"],[At({type:Number,defaultValue:4e3}),0,"duration"],[At({type:Number,defaultValue:3}),0,"visibleToasts"],[At({type:Boolean,defaultValue:!1}),0,"closeButton"],[At({type:Boolean,defaultValue:!1}),0,"expand"],[At({type:Number,defaultValue:14}),0,"gap"],[At({type:Number,defaultValue:24}),0,"offset"],[At({type:String,reflect:!0,defaultValue:""}),0,"container"],[uj({ref:"list"}),0,"listTarget"],[cj,0,"toasts"],[lj(["position","duration","visibleToasts","closeButton","expand","gap","offset","container"]),2,"onConfigUpdated"],[ya({document:!0,type:nr}),2,"onDocumentShow"],[ya({document:!0,type:or}),2,"onDocumentDismiss"],[ya({selector:"rui-toast",type:"rui-toast-mounted"}),2,"onToastMounted"],[dn,2,"onPointerOver"],[dn,2,"onPointerOut"],[dn,2,"onPointerDown"],[dn,2,"onPointerUp"]],0,void 0,tR))}position=(VE(this),ME(this));duration=(LE(this),PE(this));visibleToasts=(jE(this),FE(this));closeButton=(BE(this),UE(this));expand=(zE(this),qE(this));gap=(KE(this),$E(this));offset=(GE(this),WE(this));container=(HE(this),YE(this));listTarget=(NE(this),XE(this));toasts=(QE(this),JE(this,[]));expanded=(ZE(this),!1);interacting=!1;unsubscribe=null;visibilityHandler=null;heights=new Map;observers=new Map;layoutFrame=null;measuring=!1;connectedCallback(){super.connectedCallback(),this.syncHostPosition(),this.syncContainer(),this.unsubscribe=le.subscribe(e=>{this.toasts=e,e.length===0&&this.resetLayoutState(),this.scheduleLayoutSync()}),this.visibilityHandler=()=>this.syncPauseState(),document.addEventListener("visibilitychange",this.visibilityHandler)}disconnectedCallback(){this.unsubscribe?.(),this.unsubscribe=null,this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null),document.removeEventListener("pointerup",this.onPointerUp),document.removeEventListener("pointercancel",this.onPointerUp),this.layoutFrame!=null&&cancelAnimationFrame(this.layoutFrame),this.resetLayoutState(),super.disconnectedCallback()}onConfigUpdated(){this.syncHostPosition(),this.syncContainer(),this.scheduleLayoutSync()}onDocumentShow(e){let i=e.detail;i?.title&&le.create(i.title,{id:i.id,description:i.description,variant:i.variant,duration:i.duration,action:i.action,dismissible:i.dismissible,closeButton:i.closeButton,position:i.position})}onDocumentDismiss(e){let i=e.detail;le.dismiss(i?.id)}onToastMounted(){this.scheduleLayoutSync()}filteredToasts(){let e=this.toasts.filter(s=>(s.position??this.position)===this.position),i=[],r=[];for(let s of e)s.delete?r.push(s):i.push(s);return[...i.slice(0,this.visibleToasts),...r]}syncHostPosition(){this.style.setProperty("--rui-toaster-gap",`${this.gap}px`),this.style.setProperty("--rui-toaster-offset",`${this.offset}px`)}syncContainer(){let e=this.container.trim();if(!e){this.removeAttribute("data-contained"),this.style.position="";return}let i=this.closest(e)??document.querySelector(e);if(!i){this.removeAttribute("data-contained"),this.style.position="";return}getComputedStyle(i).position==="static"&&(i.style.position="relative"),i.contains(this)||i.appendChild(this),this.dataset.contained="true",this.style.position="absolute"}isStackExpanded(){return this.expanded||this.expand}isPaused(){return this.expanded||this.interacting||document.hidden}resetLayoutState(){for(let i of this.observers.values())i.disconnect();this.observers.clear(),this.heights.clear(),this.expanded=!1,this.interacting=!1;let e=this.listTarget;e&&(e.style.height="0px",e.dataset.expanded="false"),this.dataset.expanded="false"}syncPauseState(){let e=this.isPaused();for(let i of this.querySelectorAll("rui-toast"))i.setPaused(e);this.patchStackLayout()}scheduleLayoutSync(){this.layoutFrame!=null&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame(()=>{if(this.layoutFrame=null,this.toasts.length>0&&!this.interacting){let i=!!(this.listTarget?.matches(":hover")||this.matches(":hover"));this.expanded=i}this.observeToasts(),this.syncPauseState()})}measureToast(e){this.measuring=!0;let i=e.style.height,r=e.style.overflow;e.style.height="auto",e.style.overflow="visible";let s=e.getRef("toast"),d=Math.round(s instanceof HTMLElement?s.offsetHeight:e.offsetHeight)||64;return e.style.height=i,e.style.overflow=r,this.measuring=!1,d}observeToasts(){let e=this.listTarget;if(!e)return;let i=[...e.querySelectorAll("rui-toast")],r=new Set;for(let s of i){let d=s.toastId;if(!d)continue;r.add(d);let h=s.getRef("toast")??s;if(!this.observers.has(d)){let a=new ResizeObserver(()=>{if(this.measuring)return;let E=this.measureToast(s);this.heights.get(d)!==E&&(this.heights.set(d,E),this.patchStackLayout())});a.observe(h),this.observers.set(d,a)}this.heights.set(d,this.measureToast(s))}for(let[s,d]of[...this.observers])r.has(s)||(d.disconnect(),this.observers.delete(s),this.heights.delete(s))}patchStackLayout(){let e=this.listTarget;if(!e)return;let i=this.isStackExpanded(),{y:r}=lt(this.position),s=r==="bottom"?-1:1,d=Math.min(3,Math.max(1,this.visibleToasts));this.dataset.expanded=String(i),e.dataset.expanded=String(i),this.style.setProperty("--rui-toaster-lift",String(s)),e.style.setProperty("--rui-toaster-gap",`${this.gap}px`);let h=[...e.querySelectorAll("rui-toast")].filter(S=>S.dataset.mounted==="true"&&S.dataset.removed!=="true");if(h.length===0){e.style.height="0px";return}let a=h.map(S=>{let I=this.measureToast(S);return this.heights.set(S.toastId,I),I}),E=a[0]??64;this.style.setProperty("--rui-toaster-front-height",`${E}px`);for(let S=0;S<h.length;S+=1){let I=h[S];if(!I)continue;let T=a[S]??64,K=S===0,$=CE(S,a,this.gap),V=S<d;if(I.dataset.index=String(S),I.dataset.front=String(K),I.dataset.expanded=String(i),I.dataset.visible=String(i||V),I.style.setProperty("--rui-toast-z",String(h.length-S)),I.style.setProperty("--rui-toast-index",String(S)),I.style.setProperty("--rui-toast-offset",`${$}px`),I.style.setProperty("--rui-toast-initial-height",`${T}px`),I.style.setProperty("--rui-toaster-gap",`${this.gap}px`),i)I.style.setProperty("--rui-toast-y",`translateY(${s*$}px)`),I.style.height=`${T}px`,I.style.overflow="visible";else if(!V)I.style.setProperty("--rui-toast-y",`translateY(${s*(d-1)*this.gap}px) scale(0.7)`),I.style.height=`${E}px`,I.style.overflow="hidden";else if(K)I.style.setProperty("--rui-toast-y","translateY(0px)"),I.style.height=`${T}px`,I.style.overflow="visible";else{let G=Math.max(.7,1-S*.05);I.style.setProperty("--rui-toast-y",`translateY(${s*S*this.gap}px) scale(${G})`),I.style.height=`${E}px`,I.style.overflow="hidden"}}let A=Math.min(d,h.length);e.style.height=`${i?DE(a,this.gap):OE(E,A,this.gap)}px`}onPointerOver(e){iR(e.relatedTarget,this)||(this.expanded=!0,this.syncPauseState())}onPointerOut(e){iR(e.relatedTarget,this)||this.interacting||(this.expanded=!1,this.syncPauseState())}onPointerDown(){this.interacting=!0,this.expanded=!0,this.syncPauseState(),document.addEventListener("pointerup",this.onPointerUp,{once:!0}),document.addEventListener("pointercancel",this.onPointerUp,{once:!0})}onPointerUp(){if(!this.interacting)return;this.interacting=!1,this.listTarget?.matches(":hover")||this.querySelector("rui-toast:hover")||(this.expanded=!1),this.syncPauseState()}render(){let e=this.filteredToasts();return va("section",{class:"rui-toaster-region","aria-label":"Notifications","aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",tabIndex:-1,children:va("ol",{class:"rui-toaster","data-ref":"list","data-rui-toaster":!0,"on:pointerover":this.onPointerOver,"on:pointerout":this.onPointerOut,"on:pointerdown":this.onPointerDown,children:e.map(i=>{let r=i.duration??(i.variant==="loading"?Number.POSITIVE_INFINITY:this.duration);return va("rui-toast",{"prop:toastId":String(i.id),"prop:title":i.title,"prop:description":i.description??"","prop:variant":i.variant,"prop:duration":r,"prop:dismissible":i.dismissible,"prop:closeButton":i.closeButton??this.closeButton,"prop:actionLabel":i.action?.label??"","prop:position":i.position??this.position,"prop:markedDelete":!!i.delete},String(i.id))})})})}static{kE()}};import{jsx as oR}from"@ecopages/jsx/jsx-runtime";function dj({toastId:t,...e}){return oR("rui-toast",{...e,toastId:t!=null?String(t):void 0})}function hj({children:t,...e}){return oR("rui-toaster",{...e,children:t})}var pj=Object.assign((t,e)=>le.create(t,e),{message:(t,e)=>le.message(t,e),success:(t,e)=>le.success(t,e),error:(t,e)=>le.error(t,e),info:(t,e)=>le.info(t,e),warning:(t,e)=>le.warning(t,e),loading:(t,e)=>le.loading(t,e),promise:(t,e)=>le.promise(t,e),dismiss:t=>le.dismiss(t),clear:()=>le.clear()});function fj(t){document.dispatchEvent(new CustomEvent(nr,{detail:t,bubbles:!0,composed:!0}))}function mj(t){let e=t==null?{}:{id:t};document.dispatchEvent(new CustomEvent(or,{detail:e,bubbles:!0,composed:!0}))}import{jsx as hn,jsxs as xj}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as IR,bound as wj,customElement as Tj,onUpdated as Sj,prop as cr,state as CR}from"@ecopages/radiant";import{isServer as DR}from"@ecopages/radiant/is-server";function aR(t,e){try{return t.querySelector(e)}catch{return null}}function sR(t,e){try{return Array.from(t.querySelectorAll(e))}catch{return[]}}function gj(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}function lR(t,e,i=r=>document.getElementById(r)!==null){if(t.id)return e.add(t.id),t.id;let r=gj(t.textContent||"")||"section",s=r,d=2;for(;e.has(s)||i(s);)s=`${r}-${d}`,d+=1;return t.id=s,e.add(s),s}function uR(t,e){return t instanceof HTMLElement?t.getBoundingClientRect().top+e:e}function cR(t,e,i,r){if(e instanceof HTMLElement){let s=e.getBoundingClientRect(),d=t.getBoundingClientRect();e.scrollTo({top:e.scrollTop+(d.top-s.top)-i,behavior:r});return}window.scrollTo({top:window.scrollY+t.getBoundingClientRect().top-i,behavior:r})}var dR,hR,pR,fR,mR,gR,bR,vR,yR,_R,xR,wR,TR,SR,ER,RR;function bj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:AR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||AR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:vj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _j(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function vj(t){var e=yj(t,"string");return typeof e=="symbol"?e:e+""}function yj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AR(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function _j(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var VR,OR=class extends IR{static{({e:[pR,fR,mR,gR,bR,vR,yR,_R,xR,wR,TR,SR,ER,RR,dR],c:[VR,hR]}=bj(this,[Tj("rui-toc")],[[cr({type:String,attribute:"target",defaultValue:""}),0,"target"],[cr({type:String,attribute:"heading-selector",defaultValue:"h2,h3"}),0,"headingSelector"],[cr({type:String,defaultValue:"On this page"}),0,"label"],[cr({type:Number,attribute:"scroll-offset",defaultValue:120}),0,"scrollOffset"],[cr({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[CR,0,"entries"],[CR,0,"activeId"],[Sj(["target","headingSelector","scrollOffset","navigationEvents"]),2,"onScanSettingsUpdated"],[wj,2,"onLinkClick"]],0,void 0,IR))}target=(dR(this),pR(this,""));headingSelector=(fR(this),mR(this,"h2,h3"));label=(gR(this),bR(this,"On this page"));scrollOffset=(vR(this),yR(this,120));navigationEvents=(_R(this),xR(this,""));entries=(wR(this),TR(this,[]));activeId=(SR(this),ER(this,null));headings=(RR(this),[]);scrollRoot=null;scrollCleanup=null;navigationCleanups=[];pendingScrollTargetId=null;scrollRafPending=!1;scrollOffsetTolerance=4;readConfiguredProp(e,i){return e.trim()||this.getAttribute(i)?.trim()||""}readConfiguredNumber(e,i,r){if(Number.isFinite(e)&&e!==0)return e;let s=Number(this.getAttribute(i));return Number.isFinite(s)?s:r}connectedCallback(){super.connectedCallback(),this.attachNavigationListeners()}onConnected(){this.rebuild()}disconnectedCallback(){this.detachScrollListener(),this.detachNavigationListeners(),super.disconnectedCallback()}onScanSettingsUpdated(){this.detachNavigationListeners(),this.attachNavigationListeners(),this.rebuild()}rebuild(){this.detachScrollListener(),this.headings=[],this.entries=[],this.activeId=null,this.pendingScrollTargetId=null,this.scrollRoot=null;let e=this.resolveTarget();if(!e)return;let i=sR(e,this.readConfiguredProp(this.headingSelector,"heading-selector")||"h2,h3");if(i.length===0)return;let r=new Set,s=i.map(d=>({id:lR(d,r),label:(d.textContent||"").trim(),depth:this.headingDepth(d)}));this.headings=i,this.entries=s,this.scrollRoot=this.resolveScrollRoot(e),this.attachScrollListener(),this.updateActiveHeading()}resolveTarget(){let e=this.readConfiguredProp(this.target,"target");return e?aR(document,e):this.parentElement}resolvedScrollOffset(){return this.readConfiguredNumber(this.scrollOffset,"scroll-offset",120)}resolveScrollRoot(e){let i=e;for(;i&&i!==document.documentElement&&i!==document.body;){let r=getComputedStyle(i).overflowY;if(r==="auto"||r==="scroll"||r==="overlay")return i;i=i.parentElement}return window}headingDepth(e){let i=Number.parseInt(e.tagName.slice(1),10);return Number.isFinite(i)?i:2}attachNavigationListeners(){if(DR||!this.isConnected)return;let e=()=>this.rebuild();for(let i of nn(this.readConfiguredProp(this.navigationEvents,"navigation-events")))document.addEventListener(i,e),this.navigationCleanups.push(()=>document.removeEventListener(i,e))}detachNavigationListeners(){for(let e of this.navigationCleanups)e();this.navigationCleanups=[]}attachScrollListener(){if(DR||!this.isConnected)return;let e=()=>{this.scrollRafPending||(this.scrollRafPending=!0,requestAnimationFrame(()=>{this.updateActiveHeading(),this.scrollRafPending=!1}))},i=this.scrollRoot??window;if(i===window){window.addEventListener("scroll",e,{passive:!0}),this.scrollCleanup=()=>window.removeEventListener("scroll",e);return}i.addEventListener("scroll",e,{passive:!0}),this.scrollCleanup=()=>i.removeEventListener("scroll",e)}detachScrollListener(){this.scrollCleanup?.(),this.scrollCleanup=null}isScrollAtBottom(){let e=this.scrollRoot??window;if(!(e instanceof HTMLElement)){let i=document.documentElement.scrollHeight,r=window.innerHeight;return i<=r+1?!1:window.scrollY+r>=i-10}return e.scrollHeight<=e.clientHeight+1?!1:e.scrollTop+e.clientHeight>=e.scrollHeight-10}activeLineY(){return uR(this.scrollRoot??window,this.resolvedScrollOffset()+this.scrollOffsetTolerance)}updateActiveHeading(){if(this.headings.length===0)return;if(this.isScrollAtBottom()){this.pendingScrollTargetId=null;let r=this.headings[this.headings.length-1]?.id;r&&this.setActiveId(r);return}if(this.pendingScrollTargetId){let r=this.findHeadingById(this.pendingScrollTargetId);if(!r)this.pendingScrollTargetId=null;else if(this.hasPendingScrollReachedTarget(r))this.pendingScrollTargetId=null;else{this.setActiveId(this.pendingScrollTargetId);return}}let e=this.activeLineY(),i=null;for(let r of this.headings)if(r.getBoundingClientRect().top<=e)i=r.id;else break;this.setActiveId(i??this.headings[0].id)}setActiveId(e){this.activeId!==e&&(this.activeId=e)}findHeadingById(e){return this.headings.find(i=>i.id===e)??null}hasPendingScrollReachedTarget(e){return e.getBoundingClientRect().top<=this.activeLineY()}onLinkClick(e,i){let r=e;if(r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.button!==0)return;let s=this.findHeadingById(i);s&&(e.preventDefault(),this.pendingScrollTargetId=i,this.setActiveId(i),this.scrollToHeading(i,s))}scrollToHeading(e,i){let r=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth";window.history.replaceState(window.history.state,"",`${window.location.pathname}${window.location.search}#${e}`),cR(i,this.scrollRoot??window,this.resolvedScrollOffset(),r)}render(){return this.entries.length===0?null:xj("nav",{class:"rui-toc","aria-label":this.$.label,children:[this.label?hn("p",{class:"rui-toc__label",children:this.$.label}):null,hn("ul",{class:"rui-toc__list",children:this.entries.map(e=>hn("li",{class:e.depth>=3?"rui-toc__item rui-toc__item--depth-3":"rui-toc__item",children:hn("a",{href:`#${e.id}`,class:e.id===this.activeId?"rui-toc__link rui-toc__link--active":"rui-toc__link","on:click":i=>this.onLinkClick(i,e.id),children:e.label})}))})]})}static{hR()}};import{jsx as Ej}from"@ecopages/jsx/jsx-runtime";function Rj(t){return Ej("rui-toc",{...t})}import{RadiantElement as UR,customElement as Oj,onEvent as zR,prop as qR}from"@ecopages/radiant";var kR,MR,LR,PR,jR,FR;function Aj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:BR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||BR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Ij(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Dj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Ij(t){var e=Cj(t,"string");return typeof e=="symbol"?e:e+""}function Cj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function BR(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Dj(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var $R,KR=class extends UR{static{({e:[LR,PR,jR,FR,kR],c:[$R,MR]}=Aj(this,[Oj("rui-toolbar")],[[qR({type:String,defaultValue:""}),0,"label"],[qR({type:Boolean,reflect:!0,defaultValue:!1}),0,"exclusiveToggles"],[zR({type:"keydown",selector:"button, a[href], input, select, [tabindex]"}),2,"onKeydown"],[zR({type:"click",selector:"button[data-toggle][aria-pressed]",options:{capture:!0}}),2,"onToggleButtonClick"]],0,void 0,UR))}constructor(...e){super(...e),FR(this)}label=(kR(this),LR(this));exclusiveToggles=(PR(this),jR(this));getItems(){return kr(this)}onConnected(){ue(this.getItems(),0)}onKeydown(e){let i=this.getItems(),r=e.target.closest("button, a[href], input, select, [tabindex]");de({items:i,current:r,key:e.key,orientation:"horizontal"}).handled&&e.preventDefault()}getToggleButtons(){return Array.from(this.querySelectorAll("button[data-toggle][aria-pressed]")).filter(e=>!e.disabled)}onToggleButtonClick(e){let i=e.target.closest("button[data-toggle][aria-pressed]");if(!i||i.disabled)return;e.stopImmediatePropagation();let r=i.getAttribute("aria-pressed")==="true";if(this.exclusiveToggles){for(let s of this.getToggleButtons())s.setAttribute("aria-pressed","false");r||i.setAttribute("aria-pressed","true");return}i.setAttribute("aria-pressed",String(!r))}static{MR()}};import{jsx as GR}from"@ecopages/jsx/jsx-runtime";function Vj({children:t,label:e,...i}){return GR("rui-toolbar",{...i,label:e,children:GR("div",{class:"rui-toolbar","data-ref":"root",role:"toolbar","aria-label":e||void 0,children:t})})}import{jsx as _a,jsxs as jj}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as rA,bound as nA,customElement as Fj,onEvent as xa,onUpdated as Bj,prop as wa,query as Uj}from"@ecopages/radiant";var WR,HR,YR,NR,XR,QR,JR,ZR,eA,tA;function kj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:iA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||iA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Mj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Pj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Mj(t){var e=Lj(t,"string");return typeof e=="symbol"?e:e+""}function Lj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iA(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Pj(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var oA=8,sA,aA=class extends rA{static{({e:[YR,NR,XR,QR,JR,ZR,eA,tA,WR],c:[sA,HR]}=kj(this,[Fj("rui-tooltip")],[[wa({type:String,defaultValue:""}),0,"content"],[wa({type:String,defaultValue:"top"}),0,"placement"],[wa({type:Number,defaultValue:200}),0,"delay"],[Uj({ref:"tooltip"}),0,"tooltipTarget"],[Bj(["content","placement"]),2,"onDescribedPropsUpdated"],[xa({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[xa({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[xa({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[nA,2,"onPointerEnter"],[nA,2,"onPointerLeave"]],0,void 0,rA))}content=(WR(this),YR(this));placement=(NR(this),XR(this));delay=(QR(this),JR(this));tooltipTarget=(ZR(this),eA(this));open=(tA(this),!1);showTimer=null;hideTimer=null;tooltipId=re("rui-tooltip");describedEl=null;cleanupFloating=null;connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.onPointerEnter),this.addEventListener("pointerleave",this.onPointerLeave),queueMicrotask(()=>this.wireTrigger())}disconnectedCallback(){this.clearTimers(),this.teardownFloating(),this.removeEventListener("pointerenter",this.onPointerEnter),this.removeEventListener("pointerleave",this.onPointerLeave),this.describedEl?.removeAttribute("aria-describedby"),super.disconnectedCallback()}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.showTimer=null,this.hideTimer=null}teardownFloating(){this.cleanupFloating?.(),this.cleanupFloating=null}getAnchor(){return si(this)??this}wireTrigger(){this.describedEl?.removeAttribute("aria-describedby"),this.describedEl=this.getAnchor(),this.tooltipTarget&&(this.tooltipTarget.id=this.tooltipId),this.describedEl.setAttribute("aria-describedby",this.tooltipId)}attachFloating(){this.tooltipTarget&&(this.teardownFloating(),this.cleanupFloating=Ir({anchor:this.getAnchor(),floating:this.tooltipTarget,getPlacement:()=>this.placement,gap:oA}))}onDescribedPropsUpdated(){this.wireTrigger(),this.open&&this.tooltipTarget&&Qn(this.getAnchor(),this.tooltipTarget,this.placement,oA)}setOpen(e){this.clearTimers(),this.open=e,this.tooltipTarget&&(this.tooltipTarget.hidden=!e,e?this.attachFloating():this.teardownFloating())}scheduleShow(){if(this.clearTimers(),this.delay<=0){this.setOpen(!0);return}this.showTimer=setTimeout(()=>this.setOpen(!0),this.delay)}scheduleHide(){this.clearTimers(),this.hideTimer=setTimeout(()=>this.setOpen(!1),80)}onDocumentKeydown(e){!this.open||e.key!=="Escape"||this.setOpen(!1)}onFocusIn(){this.scheduleShow()}onFocusOut(e){let i=e.relatedTarget;i&&this.contains(i)||this.scheduleHide()}onPointerEnter(){this.scheduleShow()}onPointerLeave(){this.scheduleHide()}render(){return jj("span",{class:"rui-tooltip",children:[_a("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:_a("slot",{})}),_a("span",{"data-ref":"tooltip",id:this.tooltipId,class:"rui-tooltip__content rui-floating",role:"tooltip",hidden:!0,children:this.$.content})]})}static{HR()}};import{jsx as Ta,jsxs as zj}from"@ecopages/jsx/jsx-runtime";function qj({children:t,content:e="",...i}){return Ta("rui-tooltip",{content:e,...i,children:zj("span",{class:"rui-tooltip",children:[Ta("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:t}),Ta("span",{class:"rui-tooltip__content rui-floating","data-ref":"tooltip",role:"tooltip",hidden:!0,children:e})]})})}import{RadiantElement as bA,customElement as Hj,event as Yj,onEvent as vA,onUpdated as Nj,prop as yA}from"@ecopages/radiant";var lA,uA,cA,dA,hA,pA,fA,mA;function Kj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:gA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||gA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:$j(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Wj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function $j(t){var e=Gj(t,"string");return typeof e=="symbol"?e:e+""}function Gj(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gA(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function Wj(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var xA,_A=class extends bA{static{({e:[cA,dA,hA,pA,fA,mA,lA],c:[xA,uA]}=Kj(this,[Hj("rui-tree")],[[yA({type:String,defaultValue:""}),0,"label"],[yA({type:String,reflect:!0,defaultValue:""}),0,"value"],[Yj({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Nj("value"),2,"onValueUpdated"],[vA({selector:'[role="treeitem"]',type:"click"}),2,"onClick"],[vA({selector:'[role="treeitem"]',type:"keydown"}),2,"onKeydown"]],0,void 0,bA))}label=(lA(this),cA(this));value=(dA(this),hA(this));changeEvent=(pA(this),fA(this));getVisibleItems(){return Array.from(this.querySelectorAll('[role="treeitem"]')).filter(e=>{let i=e.parentElement;for(;i&&i!==this;){if(i.getAttribute("role")==="group"&&i.hidden)return!1;i=i.parentElement}return!0})}getParentItem(e){let i=e.closest('[role="group"]');if(!i)return null;let r=i.previousElementSibling;return r?.getAttribute("role")==="treeitem"?r:null}getSiblingItems(e){let i=this.getParentItem(e),r=i?i.nextElementSibling?.getAttribute("role")==="group"?i.nextElementSibling:null:this.querySelector('[role="tree"]')??this;return r?Array.from(r.querySelectorAll(':scope > li > [role="treeitem"], :scope > [role="treeitem"]')):[]}syncSelection(){let e=Array.from(this.querySelectorAll('[role="treeitem"]')),i=this.getVisibleItems(),r=0;e.forEach((s,d)=>{let h=s.getAttribute("data-value")||s.id||"",a=!!this.value&&h===this.value;if(s.setAttribute("aria-selected",String(a)),a){let E=i.indexOf(s);E>=0&&(r=E)}else!this.value&&d===0&&(r=0)}),ue(i,r)}syncExpanded(){let e=Array.from(this.querySelectorAll('[role="treeitem"]'));for(let i of e){if(!i.hasAttribute("aria-expanded"))continue;let r=i.nextElementSibling;r?.getAttribute("role")==="group"&&(r.hidden=i.getAttribute("aria-expanded")==="false")}}onConnected(){this.syncExpanded(),this.syncSelection()}onValueUpdated(){this.syncSelection()}select(e){let i=e.getAttribute("data-value")||e.id||e.textContent?.trim()||"";this.value=i,this.syncSelection(),this.changeEvent.emit({value:i}),e.focus()}setExpanded(e,i){e.setAttribute("aria-expanded",String(i));let r=e.nextElementSibling;r?.getAttribute("role")==="group"&&(r.hidden=!i),this.syncSelection()}onClick(e){let i=e.target.closest('[role="treeitem"]');!i||!this.contains(i)||(i.hasAttribute("aria-expanded")&&this.setExpanded(i,i.getAttribute("aria-expanded")!=="true"),this.select(i))}onKeydown(e){let i=e.target.closest('[role="treeitem"]');!i||!this.treeKeyHandlers[e.key]?.call(this,i,e)||e.preventDefault()}treeKeyHandlers=(mA(this),{ArrowDown:this.navigateTreeItem,ArrowUp:this.navigateTreeItem,Home:this.navigateTreeItem,End:this.navigateTreeItem,ArrowRight:this.expandOrEnterChild,ArrowLeft:this.collapseOrFocusParent,"*":this.expandSiblings,Enter:this.toggleAndSelect," ":this.selectTreeItem});navigateTreeItem(e,i){return de({items:this.getVisibleItems(),current:e,key:i.key,orientation:"vertical",wrap:!1}).handled}expandOrEnterChild(e){return e.getAttribute("aria-expanded")==="false"?(this.setExpanded(e,!0),!0):e.getAttribute("aria-expanded")!=="true"?!1:(this.focusAdjacentVisibleItem(e,1),!0)}collapseOrFocusParent(e){if(e.getAttribute("aria-expanded")==="true")return this.setExpanded(e,!1),!0;let i=this.getParentItem(e);return i&&this.focusVisibleItem(i),!!i}expandSiblings(e){for(let i of this.getSiblingItems(e))i.hasAttribute("aria-expanded")&&this.setExpanded(i,!0);return!0}toggleAndSelect(e){return e.hasAttribute("aria-expanded")&&this.setExpanded(e,e.getAttribute("aria-expanded")!=="true"),this.select(e),!0}selectTreeItem(e){return this.select(e),!0}focusAdjacentVisibleItem(e,i){let r=this.getVisibleItems(),s=r.indexOf(e);r[s+i]&&ei(r,s+i)}focusVisibleItem(e){let i=this.getVisibleItems(),r=i.indexOf(e);r>=0&&ei(i,r)}static{uA()}};import{Fragment as wA,jsx as ct,jsxs as Xj}from"@ecopages/jsx/jsx-runtime";var TA=({nodes:t})=>ct(wA,{children:t.map(e=>ct("li",{class:"rui-tree__item",children:e.children?.length?Xj(wA,{children:[ct("button",{type:"button",class:"rui-tree__node",role:"treeitem","data-value":e.id,"aria-expanded":e.expanded??!1,"aria-selected":"false",tabindex:-1,children:e.label}),ct("ul",{role:"group",children:ct(TA,{nodes:e.children})})]}):ct("button",{type:"button",class:"rui-tree__node",role:"treeitem","data-value":e.id,"aria-selected":"false",tabindex:-1,children:e.label})}))});function Qj({nodes:t,label:e,children:i,...r}){let s=t!=null?ct(TA,{nodes:t}):i;return ct("rui-tree",{...r,label:e,children:ct("ul",{class:"rui-tree","data-ref":"root",role:"tree","aria-label":e||void 0,"aria-multiselectable":"false",children:s})})}import{RadiantElement as kA,customElement as i2,event as r2,onEvent as MA,onUpdated as n2,prop as LA}from"@ecopages/radiant";var SA,EA,RA,AA,IA,CA,DA,OA;function Jj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:VA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||VA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:Zj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return t2(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Zj(t){var e=e2(t,"string");return typeof e=="symbol"?e:e+""}function e2(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function VA(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function t2(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var jA,PA=class extends kA{static{({e:[RA,AA,IA,CA,DA,OA,SA],c:[jA,EA]}=Jj(this,[i2("rui-treegrid")],[[LA({type:String,defaultValue:""}),0,"label"],[LA({type:String,reflect:!0,defaultValue:""}),0,"value"],[r2({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[n2("value"),2,"onValueUpdated"],[MA({selector:'[role="gridcell"]',type:"click"}),2,"onCellClick"],[MA({selector:'[role="gridcell"]',type:"keydown"}),2,"onCellKeydown"]],0,void 0,kA))}label=(SA(this),RA(this));value=(AA(this),IA(this));changeEvent=(CA(this),DA(this));getDataRows(){return Array.from(this.querySelectorAll('[role="row"][data-row-id]'))}getVisibleRows(){return this.getDataRows().filter(e=>{let i=e.parentElement;for(;i&&i!==this;){if(i.getAttribute("role")==="rowgroup"&&i.hidden)return!1;i=i.parentElement}return!0})}getRowCells(e){return Array.from(e.children).filter(i=>i instanceof HTMLElement&&i.getAttribute("role")==="gridcell")}getVisibleCells(){return this.getVisibleRows().flatMap(e=>this.getRowCells(e))}getParentRow(e){let i=e.parentElement;if(!i||i.getAttribute("role")!=="rowgroup")return null;let r=i.previousElementSibling;return r?.getAttribute("role")==="row"?r:null}syncExpanded(){for(let e of this.getDataRows()){if(!e.hasAttribute("aria-expanded"))continue;let i=e.nextElementSibling;i?.getAttribute("role")==="rowgroup"&&(i.hidden=e.getAttribute("aria-expanded")==="false")}}syncDepth(){for(let e of this.getDataRows()){let i=0,r=e.parentElement;for(;r&&r!==this;)r.getAttribute("role")==="rowgroup"&&(i+=1),r=r.parentElement;e.setAttribute("data-depth",String(i)),e.style.setProperty("--rui-treegrid-depth",String(i))}}syncSelection(){let e=this.getVisibleCells(),i=0;for(let r of this.getDataRows()){let s=r.getAttribute("data-row-id")??"",d=!!this.value&&s===this.value;for(let h of this.getRowCells(r))if(h.setAttribute("aria-selected",String(d)),d){let a=e.indexOf(h);a>=0&&(i=a)}}e.length>0&&ue(e,i)}onConnected(){this.syncDepth(),this.syncExpanded(),this.syncSelection()}onValueUpdated(){this.syncSelection()}setExpanded(e,i){e.setAttribute("aria-expanded",String(i));let r=e.nextElementSibling;r?.getAttribute("role")==="rowgroup"&&(r.hidden=!i)}activateCell(e){let i=e.closest('[role="row"][data-row-id]');if(!i)return;let r=i.getAttribute("data-row-id")??"",s=this.getRowCells(i).indexOf(e);this.value=r,this.syncSelection(),this.changeEvent.emit({rowId:r,columnIndex:s}),e.focus()}focusCell(e,i){if(this.getVisibleRows().indexOf(e)<0)return;let d=this.getVisibleCells(),h=this.getRowCells(e),a=h[Math.min(Math.max(0,i),h.length-1)],E=d.indexOf(a);E>=0&&ei(d,E)}onCellClick(e){let i=e.target.closest('[role="gridcell"]');if(!i||!this.contains(i))return;let r=i.closest('[role="row"][data-row-id]');r&&this.getRowCells(r).indexOf(i)===0&&r.hasAttribute("aria-expanded")&&this.setExpanded(r,r.getAttribute("aria-expanded")!=="true"),this.activateCell(i)}onCellKeydown(e){let i=e.target.closest('[role="gridcell"]'),r=i?.closest('[role="row"][data-row-id]');if(!i||!r)return;let s=this.createCellContext(i,r),d=this.cellKeyHandlers[e.key];d&&(e.preventDefault(),d.call(this,s))}cellKeyHandlers=(OA(this),{ArrowRight:this.moveRight,ArrowLeft:this.moveLeft,ArrowDown:this.moveDown,ArrowUp:this.moveUp,Home:this.focusFirstCell,End:this.focusLastCell,"*":this.expandAllRows,Enter:this.toggleOrActivateCell," ":this.activateContextCell});createCellContext(e,i){return{cell:e,columnIndex:this.getRowCells(i).indexOf(e),row:i,rowCells:this.getRowCells(i),visibleRows:this.getVisibleRows()}}moveRight(e){this.setExpandedFromFirstCell(e,!0)||e.columnIndex<e.rowCells.length-1&&this.focusCell(e.row,e.columnIndex+1)}moveLeft(e){if(this.setExpandedFromFirstCell(e,!1))return;if(e.columnIndex>0){this.focusCell(e.row,e.columnIndex-1);return}let i=this.getParentRow(e.row);i&&this.focusCell(i,0)}moveDown(e){this.focusAdjacentRow(e,1)}moveUp(e){this.focusAdjacentRow(e,-1)}focusAdjacentRow(e,i){let r=e.visibleRows.indexOf(e.row),s=e.visibleRows[r+i];s&&this.focusCell(s,e.columnIndex)}focusFirstCell(e){this.focusCell(e.row,0)}focusLastCell(e){this.focusCell(e.row,e.rowCells.length-1)}expandAllRows(){for(let e of this.getDataRows())e.hasAttribute("aria-expanded")&&this.setExpanded(e,!0);this.syncSelection()}toggleOrActivateCell(e){this.toggleExpansionFromFirstCell(e)||this.activateCell(e.cell)}activateContextCell(e){this.activateCell(e.cell)}setExpandedFromFirstCell(e,i){let r=e.row.getAttribute("aria-expanded")==="true";return e.columnIndex!==0||!e.row.hasAttribute("aria-expanded")||r===i?!1:(this.setExpanded(e.row,i),this.syncSelection(),!0)}toggleExpansionFromFirstCell(e){return e.columnIndex!==0||!e.row.hasAttribute("aria-expanded")?!1:(this.setExpanded(e.row,e.row.getAttribute("aria-expanded")!=="true"),this.syncSelection(),!0)}static{EA()}};import{Fragment as o2,jsx as dt,jsxs as a2}from"@ecopages/jsx/jsx-runtime";var FA=({rows:t,depth:e=0})=>t.flatMap(i=>{let r=[dt("div",{class:"rui-treegrid__row",role:"row","data-row-id":i.id,"data-depth":e,style:{"--rui-treegrid-depth":`${e}`},"aria-expanded":i.children?.length?i.expanded??!1:void 0,children:i.cells.map((s,d)=>dt("div",{class:"rui-treegrid__cell",role:"gridcell",tabindex:-1,"data-col":d,"aria-selected":"false",children:s}))},i.id)];return i.children?.length&&r.push(dt("div",{class:"rui-treegrid__group",role:"rowgroup",hidden:!(i.expanded??!1),children:dt(FA,{rows:i.children,depth:e+1})},`${i.id}-group`)),r});function s2({columns:t,rows:e,label:i,children:r,...s}){let d=t!=null&&e!=null?a2(o2,{children:[dt("div",{class:"rui-treegrid__row rui-treegrid__row--header",role:"row",children:t.map(h=>dt("div",{class:"rui-treegrid__cell rui-treegrid__cell--header",role:"columnheader",children:h}))}),dt(FA,{rows:e})]}):r;return dt("rui-treegrid",{...s,label:i,children:dt("div",{class:"rui-treegrid","data-ref":"root",role:"treegrid","aria-label":i||void 0,children:d})})}import{RadiantElement as eI,bindTo as Sa,bound as tI,customElement as h2,event as p2,onEvent as iI,onUpdated as f2,prop as Ea,query as rI}from"@ecopages/radiant";var BA,UA,zA,qA,KA,$A,GA,WA,HA,YA,NA,XA,QA,JA;function l2(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:ZA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ZA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:u2(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return d2(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function u2(t){var e=c2(t,"string");return typeof e=="symbol"?e:e+""}function c2(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ZA(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function d2(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var It=20,Ct=80;function Ra(t){return t!=="vertical"}var oI,nI=class extends eI{static{({e:[zA,qA,KA,$A,GA,WA,HA,YA,NA,XA,QA,JA,BA],c:[oI,UA]}=l2(this,[h2("rui-window-splitter")],[[[Ea({type:Number,reflect:!0,defaultValue:50}),Sa({ref:"separator",attr:"aria-valuenow"})],0,"value"],[[Ea({type:String,defaultValue:"horizontal"}),Sa({ref:"separator",attr:"aria-orientation",map:e=>Ra(e)?"vertical":"horizontal"})],0,"orientation"],[[Ea({type:String,defaultValue:"Split view"}),Sa({ref:"separator",attr:"aria-label"})],0,"label"],[rI({ref:"primary"}),0,"primaryTarget"],[rI({ref:"separator"}),0,"separatorTarget"],[p2({name:"rui-splitter-change",bubbles:!0,composed:!0}),0,"changeEvent"],[f2(["value","orientation"]),2,"onPropsUpdated"],[iI({ref:"separator",type:"keydown"}),2,"onKeydown"],[iI({ref:"separator",type:"pointerdown"}),2,"onPointerDown"],[tI,2,"onPointerMove"],[tI,2,"onPointerUp"]],0,void 0,eI))}value=(BA(this),zA(this));orientation=(qA(this),KA(this));label=($A(this),GA(this));primaryTarget=(WA(this),HA(this));separatorTarget=(YA(this),NA(this));changeEvent=(XA(this),QA(this));dragging=(JA(this),!1);onConnected(){this.syncSeparatorPresentation(),this.applySize()}disconnectedCallback(){document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),super.disconnectedCallback()}onPropsUpdated(){this.syncSeparatorPresentation(),this.applySize()}syncSeparatorPresentation(){let e=this.querySelector('[data-ref="root"]');if(!e)return;let i=Ra(this.orientation);e.classList.toggle("rui-window-splitter--horizontal",i),e.classList.toggle("rui-window-splitter--vertical",!i)}applySize(){if(!this.primaryTarget)return;let e=`${Math.min(Ct,Math.max(It,this.value))}%`;this.orientation==="vertical"?(this.primaryTarget.style.height=e,this.primaryTarget.style.width=""):(this.primaryTarget.style.width=e,this.primaryTarget.style.height="")}onKeydown(e){let i=e.shiftKey?10:2,r=Ra(this.orientation);r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowUp"?(e.preventDefault(),this.updateValue(Math.max(It,this.value-i))):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowDown"?(e.preventDefault(),this.updateValue(Math.min(Ct,this.value+i))):e.key==="Home"?(e.preventDefault(),this.updateValue(It)):e.key==="End"&&(e.preventDefault(),this.updateValue(Ct))}updateValue(e){e!==this.value&&(this.value=e,this.changeEvent.emit({value:e}))}onPointerDown(e){this.dragging=!0,this.separatorTarget?.setPointerCapture(e.pointerId),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)}onPointerMove(e){if(!this.dragging)return;let i=this.getBoundingClientRect();this.orientation==="vertical"?this.updateValue(Math.min(Ct,Math.max(It,(e.clientY-i.top)/i.height*100))):this.updateValue(Math.min(Ct,Math.max(It,(e.clientX-i.left)/i.width*100)))}onPointerUp(){this.dragging=!1,document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp)}static{UA()}};import{jsx as pn,jsxs as m2}from"@ecopages/jsx/jsx-runtime";function g2({primary:t,secondary:e,orientation:i="horizontal",...r}){return pn("rui-window-splitter",{...r,orientation:i,children:m2("div",{class:j("rui-window-splitter",i!=="vertical"?"rui-window-splitter--horizontal":"rui-window-splitter--vertical"),"data-ref":"root",children:[pn("div",{"data-ref":"primary",class:"rui-window-splitter__pane",children:t}),pn("div",{"data-ref":"separator",class:"rui-window-splitter__separator",role:"separator",tabindex:0,"aria-valuemin":It,"aria-valuemax":Ct}),pn("div",{"data-ref":"secondary",class:"rui-window-splitter__pane",children:e})]})})}export{lr as DEFAULT_TOAST_POSITION,Ui as FormStore,vy as NAVIGATION_MENU_DEFAULT_CLOSE_DELAY,by as NAVIGATION_MENU_DEFAULT_HOVER_DELAY,ot as RUI_CONTROL_ATTR,po as RUI_DIALOG_ACTION_EVENT,Lr as RUI_DIALOG_CLOSE_EVENT,nt as RUI_DIALOG_HOST_ID,Mr as RUI_DIALOG_OPEN_EVENT,Pr as RUI_DIALOG_TOGGLE_EVENT,Kr as RUI_FIELD_DESCRIPTION_ATTR,ci as RUI_FIELD_ERROR_ATTR,qr as RUI_FIELD_LABEL_ATTR,vo as RUI_FIELD_MANAGED_ATTR,or as RUI_TOAST_DISMISS_EVENT,nr as RUI_TOAST_SHOW_EVENT,_I as RuiAlert,yI as RuiAlertDescription,Ya as RuiAlertElement,bI as RuiAlertIcon,vI as RuiAlertTitle,vn as RuiAutocomplete,gn as RuiAutocompleteCollection,as as RuiAutocompleteElement,bn as RuiAutocompleteEmpty,II as RuiAutocompleteInput,OI as RuiAvatar,kI as RuiBadge,UI as RuiBreadcrumb,gs as RuiBreadcrumbElement,WI as RuiBreadcrumbEllipsis,qI as RuiBreadcrumbItem,KI as RuiBreadcrumbLink,zI as RuiBreadcrumbList,$I as RuiBreadcrumbPage,GI as RuiBreadcrumbSeparator,Je as RuiButton,XI as RuiButtonGroup,Si as RuiCalendar,vl as RuiCalendarElement,BC as RuiCarousel,su as RuiCarouselElement,cu as RuiCarouselNext,uu as RuiCarouselPrev,du as RuiCarouselRotation,lu as RuiCarouselSlide,Di as RuiCheckbox,Tr as RuiCheckboxElement,nD as RuiCheckboxGroup,Xu as RuiCheckboxGroupControl,Nu as RuiCheckboxGroupElement,aD as RuiChip,sD as RuiChipList,lD as RuiChipListItem,ND as RuiCombobox,YD as RuiComboboxClear,Rd as RuiComboboxControl,Cc as RuiComboboxElement,Ad as RuiComboboxInput,Dd as RuiComboboxListbox,Id as RuiComboboxTrigger,Cd as RuiComboboxValue,s1 as RuiCycleToggle,Nd as RuiCycleToggleButton,Yd as RuiCycleToggleElement,a1 as RuiCycleToggleItem,O1 as RuiDateField,lp as RuiDateFieldCalendar,np as RuiDateFieldControl,Ch as RuiDateFieldElement,op as RuiDateFieldInput,sp as RuiDateFieldPopover,ap as RuiDateFieldToggle,ai as RuiDateInput,ip as RuiDateInputElement,z1 as RuiDateRangePicker,Np as RuiDateRangePickerCalendar,qp as RuiDateRangePickerControl,zp as RuiDateRangePickerElement,Gp as RuiDateRangePickerEndInput,Kp as RuiDateRangePickerInputs,Yp as RuiDateRangePickerPopover,Wp as RuiDateRangePickerSeparator,$p as RuiDateRangePickerStartInput,Hp as RuiDateRangePickerToggle,J1 as RuiDialog,wf as RuiDialogActions,xf as RuiDialogBody,Tf as RuiDialogClose,bf as RuiDialogElement,_f as RuiDialogTitle,EO as RuiDisclosure,Br as RuiDisclosureElement,RO as RuiDisclosureGroup,tm as RuiDisclosureGroupElement,nm as RuiDisclosureIcon,am as RuiDisclosurePanel,om as RuiDisclosureTrigger,AO as RuiFeed,IO as RuiFeedArticle,OO as RuiFeedArticleActions,DO as RuiFeedArticleContent,CO as RuiFeedArticleHeader,VO as RuiFeedByline,kO as RuiFeedBylineBody,MO as RuiFeedMeta,oV as RuiField,sV as RuiFieldDescription,Hm as RuiFieldElement,uV as RuiFieldError,wV as RuiForm,Eg as RuiFormElement,DV as RuiGrid,Mg as RuiGridElement,MV as RuiHeading,jV as RuiHeadingDescription,LV as RuiHeadingEyebrow,PV as RuiHeadingTitle,Oo as RuiHeadline,XV as RuiHoverCard,NV as RuiHoverCardContent,lb as RuiHoverCardElement,YV as RuiHoverCardTrigger,xi as RuiIconCalendar,wi as RuiIconCheck,Xe as RuiIconChevronDown,fn as RuiIconChevronLeft,mn as RuiIconChevronRight,Re as RuiIconX,JV as RuiInput,ZV as RuiInputGroup,ek as RuiInputGroupAddon,tk as RuiInputGroupText,fk as RuiKnob,iv as RuiKnobElement,yk as RuiLabel,ii as RuiListbox,Xc as RuiListboxElement,eo as RuiListboxOption,Qc as RuiListboxOptionIndicator,Lk as RuiMenuButton,Rv as RuiMenuButtonContent,Tv as RuiMenuButtonElement,Iv as RuiMenuButtonItem,Av as RuiMenuButtonSubmenuContent,Ev as RuiMenuButtonTrigger,$k as RuiMenubar,Fv as RuiMenubarElement,Bv as RuiMenubarMenu,Uv as RuiMenubarMenuItem,zv as RuiMenubarSubmenuContent,Zk as RuiMeter,ry as RuiMeterElement,lM as RuiNavigationMenu,aM as RuiNavigationMenuBar,yy as RuiNavigationMenuElement,cM as RuiNavigationMenuLink,dM as RuiNavigationMenuPanel,sM as RuiNavigationMenuPanels,uM as RuiNavigationMenuTrigger,xM as RuiNumberField,d_ as RuiNumberFieldDecrementButton,o_ as RuiNumberFieldElement,s_ as RuiNumberFieldGroup,c_ as RuiNumberFieldIncrementButton,l_ as RuiNumberFieldInput,u_ as RuiNumberFieldSteppers,DM as RuiPagination,C_ as RuiPaginationElement,D_ as RuiPaginationNav,jM as RuiPopover,PM as RuiPopoverContent,dx as RuiPopoverElement,FM as RuiPopoverTrigger,hx as RuiPopoverTriggerElement,Mx as RuiRadio,NM as RuiRadioGroup,kx as RuiRadioGroupControl,Vx as RuiRadioGroupElement,uL as RuiSelect,oL as RuiSelectClear,s0 as RuiSelectControl,o0 as RuiSelectElement,d0 as RuiSelectListbox,aL as RuiSelectSearch,u0 as RuiSelectToggle,l0 as RuiSelectTrigger,c0 as RuiSelectValue,Wi as RuiSeparator,YL as RuiSidebar,FL as RuiSidebarContent,bw as RuiSidebarElement,BL as RuiSidebarFooter,zL as RuiSidebarGroup,qL as RuiSidebarGroupAction,KL as RuiSidebarGroupHeader,Gw as RuiSidebarGroupLabel,jL as RuiSidebarHeader,HL as RuiSidebarInset,$L as RuiSidebarMenu,WL as RuiSidebarMenuAction,Ww as RuiSidebarMenuButton,GL as RuiSidebarMenuItem,PL as RuiSidebarProvider,UL as RuiSidebarSeparator,LL as RuiSidebarTrigger,$w as RuiSidebarTriggerElement,nP as RuiSlider,HT as RuiSliderElement,YT as RuiSliderValue,sP as RuiSpinner,gP as RuiSwitch,lS as RuiSwitchElement,BP as RuiTab,FP as RuiTabList,zP as RuiTabPanel,UP as RuiTabPanels,DP as RuiTable,TP as RuiTableBody,AP as RuiTableCell,EP as RuiTableColumn,kS as RuiTableElement,CP as RuiTableEmptyState,SP as RuiTableFooter,wP as RuiTableHeader,RP as RuiTableRow,IP as RuiTableSelectionCell,qP as RuiTabs,QS as RuiTabsElement,Td as RuiTag,Mi as RuiTagGroup,_d as RuiTagGroupElement,wd as RuiTagList,Sd as RuiTagRemove,$P as RuiTextarea,dj as RuiToast,IE as RuiToastElement,hj as RuiToaster,nR as RuiToasterElement,Rj as RuiToc,VR as RuiTocElement,Vj as RuiToolbar,$R as RuiToolbarElement,qj as RuiTooltip,sA as RuiTooltipElement,Qj as RuiTree,xA as RuiTreeElement,s2 as RuiTreegrid,jA as RuiTreegridElement,g2 as RuiWindowSplitter,oI as RuiWindowSplitterElement,da as TOAST_COLLAPSED_PEEK,ha as TOAST_EXIT_MS,la as TOAST_GAP,ar as TOAST_LIFETIME,GP as TOAST_POSITIONS,sr as TOAST_SWIPE_THRESHOLD,ua as TOAST_VIEWPORT_OFFSET,ca as TOAST_VISIBLE_AMOUNT,WP as TOAST_WIDTH,Jd as ThemeItemLabel,Qd as ThemePreferenceIcon,u1 as ThemePreferenceItemContent,Ct as WINDOW_SPLITTER_MAX,It as WINDOW_SPLITTER_MIN,lO as closeDialog,cO as createDialogHandle,Co as createRulesResolver,j as cx,ro as cycleValue,mj as dismissToast,Ao as fieldContext,hi as findFieldControl,pi as formContext,aO as getOpenDialogId,Of as installDialogs,di as isNativeTextControl,sO as openDialog,Eo as readControlValue,UO as registerFieldControl,Nm as runRulesResolver,fj as showToast,pj as toast,uO as toggleDialog,fo as uninstallDialogs,ne as withDefaultAriaLabel,$r as writeControlValue};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|