@ecopages/radiant-ui 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/components/ui/alert/alert.d.ts +1 -3
- package/dist/components/ui/alert/alert.script.d.ts +7 -0
- package/dist/components/ui/alert/index.js +1 -1
- package/dist/components/ui/alert/index.js.map +3 -3
- package/dist/components/ui/autocomplete/autocomplete.d.ts +1 -2
- package/dist/components/ui/autocomplete/autocomplete.script.d.ts +7 -0
- package/dist/components/ui/autocomplete/index.js +1 -1
- package/dist/components/ui/autocomplete/index.js.map +3 -3
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +1 -2
- package/dist/components/ui/breadcrumb/breadcrumb.script.d.ts +7 -0
- package/dist/components/ui/breadcrumb/index.js +1 -1
- package/dist/components/ui/breadcrumb/index.js.map +3 -3
- package/dist/components/ui/calendar/calendar.script.d.ts +8 -0
- package/dist/components/ui/calendar/index.d.ts +1 -2
- package/dist/components/ui/calendar/index.js +1 -1
- package/dist/components/ui/calendar/index.js.map +4 -4
- package/dist/components/ui/carousel/carousel.d.ts +1 -2
- package/dist/components/ui/carousel/carousel.script.d.ts +7 -0
- package/dist/components/ui/carousel/index.js +1 -1
- package/dist/components/ui/carousel/index.js.map +3 -3
- package/dist/components/ui/checkbox/checkbox.d.ts +1 -2
- package/dist/components/ui/checkbox/checkbox.script.d.ts +7 -0
- package/dist/components/ui/checkbox/index.js +1 -1
- package/dist/components/ui/checkbox/index.js.map +3 -3
- package/dist/components/ui/checkbox-group/checkbox-group.d.ts +1 -2
- package/dist/components/ui/checkbox-group/checkbox-group.script.d.ts +7 -0
- package/dist/components/ui/checkbox-group/index.js +1 -1
- package/dist/components/ui/checkbox-group/index.js.map +3 -3
- package/dist/components/ui/combobox/combobox.d.ts +1 -2
- package/dist/components/ui/combobox/combobox.script.d.ts +7 -0
- package/dist/components/ui/combobox/index.js +1 -1
- package/dist/components/ui/combobox/index.js.map +3 -3
- package/dist/components/ui/cycle-toggle/cycle-toggle.d.ts +1 -2
- package/dist/components/ui/cycle-toggle/cycle-toggle.script.d.ts +7 -0
- package/dist/components/ui/cycle-toggle/index.js +1 -1
- package/dist/components/ui/cycle-toggle/index.js.map +3 -3
- package/dist/components/ui/date-field/date-field.d.ts +1 -3
- package/dist/components/ui/date-field/date-field.script.d.ts +7 -0
- package/dist/components/ui/date-field/index.js +1 -1
- package/dist/components/ui/date-field/index.js.map +4 -4
- package/dist/components/ui/date-input/date-input.d.ts +1 -2
- package/dist/components/ui/date-input/date-input.script.d.ts +8 -0
- package/dist/components/ui/date-input/index.js +1 -1
- package/dist/components/ui/date-input/index.js.map +3 -3
- package/dist/components/ui/date-range-picker/date-range-picker.d.ts +1 -3
- package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +7 -0
- package/dist/components/ui/date-range-picker/index.js +1 -1
- package/dist/components/ui/date-range-picker/index.js.map +4 -4
- package/dist/components/ui/dialog/dialog-registry.d.ts +0 -1
- package/dist/components/ui/dialog/dialog.d.ts +1 -2
- package/dist/components/ui/dialog/dialog.script.d.ts +7 -0
- package/dist/components/ui/dialog/index.js +1 -1
- package/dist/components/ui/dialog/index.js.map +3 -3
- package/dist/components/ui/disclosure/disclosure-group.script.d.ts +7 -0
- package/dist/components/ui/disclosure/disclosure.d.ts +2 -4
- package/dist/components/ui/disclosure/disclosure.script.d.ts +7 -0
- package/dist/components/ui/disclosure/index.js +1 -1
- package/dist/components/ui/disclosure/index.js.map +3 -3
- package/dist/components/ui/field/field.d.ts +1 -2
- package/dist/components/ui/field/field.script.d.ts +7 -0
- package/dist/components/ui/field/index.js +1 -1
- package/dist/components/ui/field/index.js.map +3 -3
- package/dist/components/ui/form/form.d.ts +1 -2
- package/dist/components/ui/form/form.script.d.ts +7 -0
- package/dist/components/ui/form/index.js +1 -1
- package/dist/components/ui/form/index.js.map +3 -3
- package/dist/components/ui/grid/grid.d.ts +1 -2
- package/dist/components/ui/grid/grid.script.d.ts +7 -0
- package/dist/components/ui/grid/index.js +1 -1
- package/dist/components/ui/grid/index.js.map +3 -3
- package/dist/components/ui/hover-card/hover-card.d.ts +1 -2
- package/dist/components/ui/hover-card/hover-card.script.d.ts +7 -0
- package/dist/components/ui/hover-card/index.js +1 -1
- package/dist/components/ui/hover-card/index.js.map +3 -3
- package/dist/components/ui/knob/index.js +1 -1
- package/dist/components/ui/knob/index.js.map +3 -3
- package/dist/components/ui/knob/knob.d.ts +1 -2
- package/dist/components/ui/knob/knob.script.d.ts +7 -0
- package/dist/components/ui/listbox/index.js +1 -1
- package/dist/components/ui/listbox/index.js.map +3 -3
- package/dist/components/ui/listbox/listbox.d.ts +1 -2
- package/dist/components/ui/listbox/listbox.script.d.ts +7 -0
- package/dist/components/ui/menu-button/index.js +1 -1
- package/dist/components/ui/menu-button/index.js.map +3 -3
- package/dist/components/ui/menu-button/menu-button.d.ts +1 -2
- package/dist/components/ui/menu-button/menu-button.script.d.ts +7 -0
- package/dist/components/ui/menubar/index.js +1 -1
- package/dist/components/ui/menubar/index.js.map +3 -3
- package/dist/components/ui/menubar/menubar.d.ts +1 -2
- package/dist/components/ui/menubar/menubar.script.d.ts +7 -0
- package/dist/components/ui/meter/index.d.ts +1 -2
- package/dist/components/ui/meter/index.js +1 -1
- package/dist/components/ui/meter/index.js.map +4 -4
- package/dist/components/ui/meter/meter.script.d.ts +8 -0
- package/dist/components/ui/navigation-menu/index.js +1 -1
- package/dist/components/ui/navigation-menu/index.js.map +3 -3
- package/dist/components/ui/navigation-menu/navigation-menu.css +2 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +1 -2
- package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +7 -0
- package/dist/components/ui/number-field/index.js +1 -1
- package/dist/components/ui/number-field/index.js.map +3 -3
- package/dist/components/ui/number-field/number-field.d.ts +1 -2
- package/dist/components/ui/number-field/number-field.script.d.ts +7 -0
- package/dist/components/ui/pagination/index.js +1 -1
- package/dist/components/ui/pagination/index.js.map +3 -3
- package/dist/components/ui/pagination/pagination.d.ts +1 -2
- package/dist/components/ui/pagination/pagination.script.d.ts +7 -0
- package/dist/components/ui/popover/index.js +1 -1
- package/dist/components/ui/popover/index.js.map +3 -3
- package/dist/components/ui/popover/popover.d.ts +1 -2
- package/dist/components/ui/popover/popover.script.d.ts +9 -0
- package/dist/components/ui/radio-group/index.js +1 -1
- package/dist/components/ui/radio-group/index.js.map +3 -3
- package/dist/components/ui/radio-group/radio-group.d.ts +1 -2
- package/dist/components/ui/radio-group/radio-group.script.d.ts +7 -0
- package/dist/components/ui/select/index.js +1 -1
- package/dist/components/ui/select/index.js.map +3 -3
- package/dist/components/ui/select/select.d.ts +1 -2
- package/dist/components/ui/select/select.script.d.ts +7 -0
- package/dist/components/ui/sidebar/index.js +1 -1
- package/dist/components/ui/sidebar/index.js.map +3 -3
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts +1 -2
- package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +7 -0
- package/dist/components/ui/sidebar/sidebar.d.ts +1 -3
- package/dist/components/ui/sidebar/sidebar.script.d.ts +7 -0
- package/dist/components/ui/slider/index.js +1 -1
- package/dist/components/ui/slider/index.js.map +3 -3
- package/dist/components/ui/slider/slider.d.ts +1 -2
- package/dist/components/ui/slider/slider.script.d.ts +7 -0
- package/dist/components/ui/switch/index.js +1 -1
- package/dist/components/ui/switch/index.js.map +3 -3
- package/dist/components/ui/switch/switch.d.ts +1 -2
- package/dist/components/ui/switch/switch.script.d.ts +7 -0
- package/dist/components/ui/table/index.js +1 -1
- package/dist/components/ui/table/index.js.map +3 -3
- package/dist/components/ui/table/table.d.ts +1 -2
- package/dist/components/ui/table/table.script.d.ts +7 -0
- package/dist/components/ui/tabs/index.d.ts +2 -2
- package/dist/components/ui/tabs/index.js +1 -1
- package/dist/components/ui/tabs/index.js.map +3 -3
- package/dist/components/ui/tabs/tabs.d.ts +1 -4
- package/dist/components/ui/tabs/tabs.script.d.ts +7 -0
- package/dist/components/ui/tag-group/index.js +1 -1
- package/dist/components/ui/tag-group/index.js.map +3 -3
- package/dist/components/ui/tag-group/tag-group.d.ts +1 -2
- package/dist/components/ui/tag-group/tag-group.script.d.ts +7 -0
- package/dist/components/ui/toast/index.d.ts +2 -2
- package/dist/components/ui/toast/index.js +1 -1
- package/dist/components/ui/toast/index.js.map +3 -3
- package/dist/components/ui/toast/toast.d.ts +2 -9
- package/dist/components/ui/toast/toast.script.d.ts +8 -0
- package/dist/components/ui/toast/toaster.script.d.ts +8 -1
- package/dist/components/ui/toc/index.d.ts +6 -2
- package/dist/components/ui/toc/index.js +1 -1
- package/dist/components/ui/toc/index.js.map +4 -4
- package/dist/components/ui/toc/toc.script.d.ts +8 -0
- package/dist/components/ui/toolbar/index.js +1 -1
- package/dist/components/ui/toolbar/index.js.map +3 -3
- package/dist/components/ui/toolbar/toolbar.d.ts +1 -2
- package/dist/components/ui/toolbar/toolbar.script.d.ts +7 -0
- package/dist/components/ui/tooltip/index.js +1 -1
- package/dist/components/ui/tooltip/index.js.map +3 -3
- package/dist/components/ui/tooltip/tooltip.d.ts +1 -2
- package/dist/components/ui/tooltip/tooltip.script.d.ts +7 -0
- package/dist/components/ui/tree/index.js +1 -1
- package/dist/components/ui/tree/index.js.map +3 -3
- package/dist/components/ui/tree/tree.d.ts +1 -2
- package/dist/components/ui/tree/tree.script.d.ts +7 -0
- package/dist/components/ui/treegrid/index.js +1 -1
- package/dist/components/ui/treegrid/index.js.map +3 -3
- package/dist/components/ui/treegrid/treegrid.d.ts +1 -2
- package/dist/components/ui/treegrid/treegrid.script.d.ts +7 -0
- package/dist/components/ui/window-splitter/index.js +1 -1
- package/dist/components/ui/window-splitter/index.js.map +3 -3
- package/dist/components/ui/window-splitter/window-splitter.d.ts +1 -2
- package/dist/components/ui/window-splitter/window-splitter.script.d.ts +7 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/styles/radiant-ui-core.css +3 -0
- package/dist/styles/radiant-ui.css +3 -0
- package/dist/styles/styles.css +1 -1
- package/dist/styles/tailwind.css +3 -0
- package/package.json +11 -11
- package/dist/components/ui/calendar/calendar.d.ts +0 -6
- package/dist/components/ui/meter/meter.d.ts +0 -10
- package/dist/components/ui/toc/toc.d.ts +0 -7
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 oI}from"@ecopages/jsx/jsx-runtime";function xi({class:t,size:e="sm",...i}){return oI("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 Ra}from"@ecopages/jsx/jsx-runtime";function wi({class:t,size:e="sm",...i}){return Ra("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:Ra("path",{d:"m5 12 4 4L19 6"})})}import{jsx as Aa}from"@ecopages/jsx/jsx-runtime";function Xe({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:"m6 9 6 6 6-6"})})}import{jsx as Ia}from"@ecopages/jsx/jsx-runtime";function fn({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:"m15 18-6-6 6-6"})})}import{jsx as Ca}from"@ecopages/jsx/jsx-runtime";function mn({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:"m9 18 6-6-6-6"})})}import{jsx as Da,jsxs as aI}from"@ecopages/jsx/jsx-runtime";var Oa="http://www.w3.org/2000/svg";function Re({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:[Da("path",{d:"m18 6-12 12"}),Da("path",{d:"m6 6 12 12"})]})}function hr(){let t=document.createElementNS(Oa,"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(Oa,"path");i.setAttribute("d",e),t.append(i)}return t}import{RadiantElement as Ga,bound as dI,customElement as hI,event as pI,onEvent as fI,prop as pr}from"@ecopages/radiant";var Va,ka,Ma,La,Pa,ja,Fa,Ba,Ua,za,qa,Ka;function sI(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:$a(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||$a(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 cI(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=uI(t,"string");return typeof e=="symbol"?e:e+""}function uI(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 $a(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 cI(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 Ha,Wa=class extends Ga{static{({e:[Ma,La,Pa,ja,Fa,Ba,Ua,za,qa,Ka,Va],c:[Ha,ka]}=sI(this,[hI("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"],[pI({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[dI,2,"dismiss"],[fI({selector:"[data-alert-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Ga))}constructor(...e){super(...e),Ka(this)}variant=(Va(this),Ma(this));layout=(La(this),Pa(this));dismissible=(ja(this),Fa(this));closeLabel=(Ba(this),Ua(this));closeEvent=(za(this),qa(this));dismiss(){this.isConnected&&(this.closeEvent.emit({reason:"dismiss"}),this.remove())}onCloseClick(e){e.stopPropagation(),this.dismissible&&this.dismiss()}static{ka()}};import{jsx as ze,jsxs as Ya}from"@ecopages/jsx/jsx-runtime";var mI={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 gI({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=mI[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 bI({children:t,class:e,...i}){return ze("p",{...i,class:j("rui-alert__title",e),children:t})}function vI({children:t,class:e,...i}){return ze("div",{...i,class:j("rui-alert__description",e),children:t})}function yI({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:Ya("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:Ya("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 is,customElement as SI,onEvent as EI,onUpdated as RI,prop as rs}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 Na,Xa,Qa,Ja,Za,es;function _I(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:ts(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ts(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:xI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return TI(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 xI(t){var e=wI(t,"string");return typeof e=="symbol"?e:e+""}function wI(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 ts(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 TI(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 os,ns=class extends is{static{({e:[Qa,Ja,Za,es,Na],c:[os,Xa]}=_I(this,[SI("rui-autocomplete")],[[rs({type:String,defaultValue:"base"}),0,"sensitivity"],[rs({type:String,attribute:"input-value",defaultValue:""}),0,"inputValue"],[RI(["sensitivity","inputValue"]),2,"onPropsUpdated"],[EI({selector:"[data-autocomplete-input]",type:"input"}),2,"onInput"]],0,void 0,is))}sensitivity=(Na(this),Qa(this));inputValue=(Ja(this),Za(this));externalInput=(es(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{Xa()}};import{jsx as Ht}from"@ecopages/jsx/jsx-runtime";function AI({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 II({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(II,{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 CI(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 DI({src:t,alt:e="",fallback:i,size:r="md",class:s,children:d,role:h,aria:a,...E}){let A=i??(e?CI(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 OI}from"@ecopages/jsx/jsx-runtime";function VI({children:t,variant:e="filled",class:i,...r}){return OI("span",{...r,class:j("rui-badge",`rui-badge--${e}`,i),children:t})}import{RadiantElement as hs,customElement as jI,prop as ps}from"@ecopages/radiant";var as,ss,ls,us,cs;function kI(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:ds(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ds(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:MI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return PI(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 MI(t){var e=LI(t,"string");return typeof e=="symbol"?e:e+""}function LI(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 ds(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 PI(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 ms,fs=class extends hs{static{({e:[ss,ls,us,cs],c:[ms,as]}=kI(this,[jI("rui-breadcrumb")],[[ps({type:String,defaultValue:"Breadcrumb"}),0,"label"],[ps({type:String,defaultValue:"/"}),0,"separator"]],0,void 0,hs))}constructor(...e){super(...e),cs(this)}label=ss(this);separator=(ls(this),us(this));static{as()}};import{jsx as Qe,jsxs as FI}from"@ecopages/jsx/jsx-runtime";function BI({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 UI({children:t,class:e,...i}){return Qe("ol",{...i,class:j("rui-breadcrumb__list",e),children:t})}function zI({children:t,class:e,...i}){return Qe("li",{...i,class:j("rui-breadcrumb__item",e),children:t})}function qI({children:t,href:e,class:i,...r}){return Qe("a",{...r,class:j("rui-breadcrumb__link",i),href:e,children:t})}function KI({children:t,class:e,...i}){return Qe("span",{...i,class:j("rui-breadcrumb__page",e),"aria-current":"page",children:t})}function $I({children:t,class:e,...i}){return Qe("li",{...i,class:j("rui-breadcrumb__separator",e),role:"presentation","aria-hidden":"true",children:t})}function GI({label:t="More",class:e,...i}){return FI("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 gs}from"@ecopages/jsx/jsx-runtime";function WI(t,e,i){if(t!==void 0)return t;if(e)return i}function HI(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 gs("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))}HI(I,$)};return gs("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":WI(E,S,A),"data-toggle":S&&E===void 0?"":void 0,"on:click":S||I?K:void 0,children:d})}import{jsx as YI}from"@ecopages/jsx/jsx-runtime";function NI({children:t,orientation:e="horizontal",class:i,...r}){return YI("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 ml,customElement as _C,event as xC,onEvent as kt,onUpdated as wC,prop as ft,registerSsrPreparationCallback as TC,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 bs(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=bs(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=XI(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 XI(t){return Array.isArray(t)?t[0]??navigator.language:t??navigator.language}function QI(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function JI(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function ZI(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:eC(t.rangeDraft.anchor,s)}}return{mode:e,range:r}}return{mode:e,singleIso:i||void 0}}function eC(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=QI(i.today??new Date),d=ZI(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:JI(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 vs=new Map;function tC(t,e){return`${JSON.stringify(t??null)}|${JSON.stringify(e)}`}function Vt(t,e){let i=tC(t,e),r=vs.get(i);if(r)return r;let s=new Intl.DateTimeFormat(t,e);return vs.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 iC={0:"digit",a:"letter","*":"any"},rC=/\p{L}/u;function nC(t,e){let i=e?.[t];if(i instanceof RegExp)return{kind:"any",pattern:i};if(i)return{kind:i};let r=iC[t];return r?{kind:r}:null}function ys(t,e,i){return i?i.test(t):e==="digit"?/\d/.test(t):e==="letter"?rC.test(t):t.length>0}function _s(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=oC(t,s+1);if(a<0){r.push({type:"literal",value:"["}),s+=1;continue}let E=_s(t.slice(s+1,a),e,!0);r.push(...E),s=a+1;continue}if(d==="]")break;let h=nC(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 oC(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 _s(t,e)}function xs(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 ws(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];ys(d,s.kind,s.pattern)&&(i+=d,r+=1)}return i}function Ts(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(!ys(d,s.kind,s.pattern)){if(s.optional)continue;break}r+=d,i+=1}return r}function aC(t){return t.every(e=>e.type!=="input"||e.kind==="digit")}function sC(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=xs(r),d=ws(t,r);return d.length===0&&/\S/.test(t)&&aC(r)&&(d=sC(t,r)),d.length>s&&(d=d.slice(0,s)),Ts(d,r)}var lC=new Date(2e3,0,1);function uC(t,e){return t==="year"?e==="year":t==="month"?e==="year"||e==="month":!0}function cC(t,e){let r=Vt(e,{[t]:t==="year"?"numeric":"2-digit"}).formatToParts(lC).find(s=>s.type===t);return r?r.value.replace(/\d/g,t==="year"?"y":t==="month"?"m":"d"):t==="year"?"yyyy":"mm"}function dC(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(!uC(r,a))return null;let E=t!=null;return{type:a,value:E?dC(a,t,e):"",placeholder:cC(a,e),isPlaceholder:!E,editable:!0}}).filter(h=>h!=null)}function hC(t){if(t.isPlaceholder||t.value==="")return null;let e=Number(t.value);return Number.isFinite(e)?e:null}function pC(t){return t>=100?t:t>=69?1900+t:2e3+t}function Ss(t){let e={};for(let r of t){if(!r.editable)continue;let s=hC(r);if(s==null)return null;e[r.type]=r.type==="year"?pC(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 Es(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(Es(t))return{kind:"empty"};let r=Ss(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 fC(t,e){return t.findIndex(i=>i.editable&&i.type===e)}function mC(t){return t.map(e=>({...e}))}function Ln(t,e,i){let r=mC(t),s=fC(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:As(t,e)}}function As(t,e){if(t==="month")return 12;if(t==="day"){let i=Rs(e,"year"),r=Rs(e,"month");return i!=null&&r!=null?new Date(i,r,0).getDate():31}return 9999}function Rs(t,e){let i=t.find(r=>r.editable&&r.type===e);return!i||i.isPlaceholder||i.value===""?null:Number(i.value)}function Is(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 Cs(t,e){return Ln(t,e,{value:"",isPlaceholder:!0})}function Ds(t,e,i){return Ln(t,e,{value:Is(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),Ds(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=As(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?Is(e,E):String(E);return{segments:Ln(t,e,{value:I,isPlaceholder:!1}),enteredKeys:S?"":d,focusNext:S}}function Os(t){return t.filter(e=>e.editable).map(e=>e.type)}function Qt(t,e,i){let r=Os(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:Cs(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 Vs,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;function gC(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:fl(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||fl(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:bC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return yC(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 bC(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 fl(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 yC(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,gl=class extends ml{static{({e:[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,Vs],c:[bl,ks]}=gC(this,[_C("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"],[xC({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"],[wC(["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,ml))}value=(Vs(this),Ms(this));min=(Ls(this),Ps(this));max=(js(this),Fs(this));disabled=(Bs(this),Us(this));locale=(zs(this),qs(this));selectionMode=(Ks(this),$s(this));visibleMonths=(Gs(this),Ws(this));pageBehavior=(Hs(this),Ys(this));changeEvent=(Ns(this),Xs(this));viewYear=(Qs(this),Js(this,new Date().getFullYear()));viewMonth=(Zs(this),el(this,new Date().getMonth()));focusedIso=(tl(this),il(this,""));weekdayLabels=(rl(this),nl(this,[]));monthPanels=(ol(this),al(this,[]));todayLabel=(sl(this),ll(this,""));rangeAnchor=(ul(this),cl(this,null));rangeHover=(dl(this),hl(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(),pl(this),TC(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{ks()}};import{jsx as SC}from"@ecopages/jsx/jsx-runtime";function Si(t){return SC("rui-calendar",{...t})}import{RadiantElement as nu,bindTo as kC,customElement as MC,onEvent as Ae,onUpdated as Wn,prop as Se,query as wr}from"@ecopages/radiant";var EC=/^[A-Za-z][A-Za-z0-9_-]*$/;function vl(t){return EC.test(t)}function RC(t){let e=t.trim();if(vl(e))return e;let i=`rui-${e}`;return e&&vl(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`${RC(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 AC(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,AC(i,r)}onPointerCancel(e){this.pointerId===e.pointerId&&(this.pointerId=null)}};function Mt(t){return!Number.isFinite(t)||t<1?1:t}function yl(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 IC(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=IC(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 _l(t){let e=Mt(t);return e<=1?0:Math.ceil(e)-1}function Gn(t){let e=Mt(t.slidesPerView),i=yl(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=yl(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 xl,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;function CC(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:DC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return VC(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 DC(t){var e=OC(t,"string");return typeof e=="symbol"?e:e+""}function OC(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 VC(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},au,ou=class extends nu{static{({e:[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,xl],c:[au,wl]}=CC(this,[MC("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"}),kC({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,nu))}label=(xl(this),Tl(this));index=(Sl(this),El(this));autoplay=(Rl(this),Al(this));interval=(Il(this),Cl(this));transition=(Dl(this),Ol(this));controlsVariant=(Vl(this),kl(this));showIndicators=(Ml(this),Ll(this));showRotationControl=(Pl(this),jl(this));loop=(Fl(this),Bl(this));wrap=(Ul(this),zl(this));slidesPerView=(ql(this),Kl(this));slidesPerGroup=($l(this),Gl(this));slideCount=(Wl(this),Hl(this));rootTarget=(Yl(this),Nl(this));trackTarget=(Xl(this),Ql(this));indicatorsTarget=(Jl(this),Zl(this));viewportTarget=(eu(this),tu(this));paused=(iu(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(_l(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{wl()}};import{jsx as oe,jsxs as Lt}from"@ecopages/jsx/jsx-runtime";function su({id:t,children:e,class:i,...r}){return oe("div",{...r,class:j("rui-carousel__slide",i),"data-slide":t,children:e})}function LC(){return Lt("span",{class:"rui-carousel__nav-label",children:[oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})}function PC(){return Lt("span",{class:"rui-carousel__nav-label",children:["Next",oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})}function lu({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"}):LC())})}function uu({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"}):PC())})}function cu({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 jC({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(lu,{overlay:I}),$=s??oe(uu,{overlay:I}),V=T?h??oe(cu,{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 FC({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(su,{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(jC,{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 Ru,bindTo as Ii,customElement as KC,event as $C,onEvent as GC,prop as Ci}from"@ecopages/radiant";function gt(t){return t||void 0}var du,hu,pu,fu,mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su;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:Eu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Eu(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:UC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return qC(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 UC(t){var e=zC(t,"string");return typeof e=="symbol"?e:e+""}function zC(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 Eu(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 qC(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,Au=class extends Ru{static{({e:[pu,fu,mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su,du],c:[Tr,hu]}=BC(this,[KC("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"],[$C({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[GC({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,Ru))}constructor(...e){super(...e),Su(this)}checked=(du(this),pu(this));indeterminate=(fu(this),mu(this));disabled=(gu(this),bu(this));value=(vu(this),yu(this));name=(_u(this),xu(this));changeEvent=(wu(this),Tu(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{hu()}};import{jsx as Sr,jsxs as WC}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:WC("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 Wu,bindTo as Yn,customElement as ZC,event as eD,onEvent as tD,onUpdated as iD,prop as Oi}from"@ecopages/radiant";function Iu(t){return t?Du(t.split(",")):[]}function HC(t){return t.join(",")}var Er={fromAttribute:t=>Iu(t),toAttribute:t=>t.length>0?HC(t):null,fromProperty:t=>Array.isArray(t)?Du(t.map(String)):typeof t=="string"?Iu(t):[]},Ie={type:Array,reflect:!0,transform:Er};function et(t){return Er.fromProperty?.(t)??[]}function Cu(t){return t?t.split(",").map(e=>Number(e.trim())).filter(e=>Number.isFinite(e)):[]}function YC(t){return t.join(",")}var Rr={fromAttribute:t=>Cu(t),toAttribute:t=>t.length>0?YC(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"?Cu(t):[]};function Du(t){return[...new Set(t.map(e=>e.trim()).filter(Boolean))]}var Ou,Vu,ku,Mu,Lu,Pu,ju,Fu,Bu,Uu,zu,qu,Ku,$u;function NC(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:Gu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Gu(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:XC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return JC(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 XC(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 Gu(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 JC(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 Yu,Hu=class extends Wu{static{({e:[ku,Mu,Lu,Pu,ju,Fu,Bu,Uu,zu,qu,Ku,$u,Ou],c:[Yu,Vu]}=NC(this,[ZC("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"],[eD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[iD(["value","name","disabled"]),2,"syncCheckboxes"],[tD({selector:"rui-checkbox",type:"rui-change"}),2,"onCheckboxChange"]],0,void 0,Wu))}constructor(...e){super(...e),$u(this)}value=(Ou(this),ku(this));name=(Mu(this),Lu(this));label=(Pu(this),ju(this));disabled=(Fu(this),Bu(this));orientation=(Uu(this),zu(this));changeEvent=(qu(this),Ku(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{Vu()}};import{jsx as Ar}from"@ecopages/jsx/jsx-runtime";function Nu({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 rD({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(Nu,{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 nD}from"@ecopages/jsx/jsx-runtime";function oD({children:t,variant:e="default",class:i,...r}){return nD("span",{...r,class:j("rui-chip",`rui-chip--${e}`,i),children:t})}import{jsx as Xu}from"@ecopages/jsx/jsx-runtime";function aD({children:t,class:e,...i}){return Xu("ul",{...i,class:j("rui-chip-list",e),children:t})}function sD({children:t,class:e,...i}){return Xu("li",{...i,class:j("rui-chip-list__item",e),children:t})}import{RadiantElement as Rc,bindTo as wD,customElement as TD,event as SD,onEvent as Pe,onUpdated as ED,prop as jt,query as RD}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 lD="data-listbox-option-indicator";function Pt(t){let e=t.getAttribute("data-label");return e||Qu(t).trim()}function Ce(t){return t.getAttribute("data-value")||Pt(t)}function Qu(t){if(uD(t))return"";if(t.nodeType===Node.TEXT_NODE)return t.textContent??"";let e="";for(let i of t.childNodes)e+=Qu(i);return e}function uD(t){return t instanceof HTMLElement&&t.hasAttribute(lD)}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 cD={top:"bottom",bottom:"top",left:"right",right:"left"},dD=8,Xn=new WeakMap;function hD(t){Xn.has(t)&&(t.style.width="",t.style.minWidth="",t.style.maxWidth="",t.style.boxSizing="",Xn.delete(t))}function pD(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 ec(t){return t==="top"||t==="bottom"?"y":"x"}function Ju(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 ec(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 fD(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 Zu(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 mD(t,e){return e==="center"?t:`${t}-${e}`}function gD(t,e,i,r){let{padding:s,width:d,height:h}=r;if(ec(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 bD(t,e,i,r,s={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:dD}){let{side:d,align:h}=pD(i),a=Ju(t,e,d,h,r),E=fD(a,e,d,s),A=d,S=a;if(E>0){let I=cD[d],T=Ju(t,e,I,h,r),K=Zu(t,e,d,s);Zu(t,e,I,s)>K&&(A=I,S=T)}return{coords:gD(S,e,A,s),placement:mD(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)):hD(e);let{coords:E,placement:A}=bD(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 tc(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=tc(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 ic(t){return t.filter(e=>!e.hidden&&e.getAttribute("aria-disabled")!=="true")}function rc(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 nc(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 ic(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,nc(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(rc(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 oc,ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Tc,Sc;function vD(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:Ec(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ec(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:yD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return xD(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 yD(t){var e=_D(t,"string");return typeof e=="symbol"?e:e+""}function _D(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 Ec(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 xD(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 Ic,Ac=class extends Rc{static{({e:[sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Tc,Sc,oc],c:[Ic,ac]}=vD(this,[TD("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}),wD({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"],[SD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[RD({ref:"root"}),0,"rootTarget"],[ED(["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,Rc))}constructor(...e){super(...e),Sc(this)}value=(oc(this),sc(this));label=(lc(this),uc(this));placeholder=(cc(this),dc(this));disabled=(hc(this),pc(this));selectionMode=(fc(this),mc(this));shouldCloseOnSelect=(gc(this),bc(this));triggerKind=(vc(this),yc(this));changeEvent=(_c(this),xc(this));open=(wc(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=Tc(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{ac()}};import{jsx as ae,jsxs as io}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Wc,bindTo as VD,customElement as kD,event as MD,onEvent as Hc,onUpdated as LD,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 AD(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=AD(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 Cc,Dc,Oc,Vc,kc,Mc,Lc,Pc,jc,Fc,Bc,Uc,zc,qc,Kc,$c;function ID(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:Gc(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Gc(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:CD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return OD(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 CD(t){var e=DD(t,"string");return typeof e=="symbol"?e:e+""}function DD(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 Gc(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 OD(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 Nc,Yc=class extends Wc{static{({e:[Oc,Vc,kc,Mc,Lc,Pc,jc,Fc,Bc,Uc,zc,qc,Kc,$c,Cc],c:[Nc,Dc]}=ID(this,[kD("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"}),VD({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"],[MD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[LD(["value","label","disabled","embedded","selectionMode"]),2,"onPropsUpdated"],[Hc({selector:'[role="option"]',type:"click"}),2,"onOptionClick"],[Hc({selector:'[role="option"]',type:"keydown"}),2,"onOptionKeydown"]],0,void 0,Wc))}value=(Cc(this),Oc(this));label=(Vc(this),kc(this));disabled=(Mc(this),Lc(this));selectionMode=(Pc(this),jc(this));embedded=(Fc(this),Bc(this));bordered=(Uc(this),zc(this));changeEvent=(qc(this),Kc(this));uid=($c(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{Dc()}};import{jsx as Ft,jsxs as PD}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 Xc({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 jD(t,e){return e??!t}function FD({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=jD(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(FD,{bordered:A,disabled:h,embedded:r,label:d,selectionMode:a,children:t!=null?t.map(T=>PD(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(Xc,{}):null]})):e})})}import{RadiantElement as gd,customElement as KD,event as bd,onEvent as to,onUpdated as $D,prop as ki,state as GD}from"@ecopages/radiant";var Qc,Jc,Zc,ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd;function BD(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:md(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||md(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:UD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return qD(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 UD(t){var e=zD(t,"string");return typeof e=="symbol"?e:e+""}function zD(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 md(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 qD(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 yd,vd=class extends gd{static{({e:[Zc,ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,Qc],c:[yd,Jc]}=BD(this,[KD("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"],[bd({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[bd({name:"rui-remove",bubbles:!0,composed:!0}),0,"removeEvent"],[GD,0,"derivedItems"],[$D(["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,gd))}constructor(...e){super(...e),fd(this)}value=(Qc(this),Zc(this));label=(ed(this),td(this));disabled=(id(this),rd(this));selectionMode=(nd(this),od(this));embedded=(ad(this),sd(this));changeEvent=(ld(this),ud(this));removeEvent=(cd(this),dd(this));uid=(hd(this),re("rui-tag-group"));derivedItems=pd(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{Jc()}};import{jsx as je,jsxs as WD}from"@ecopages/jsx/jsx-runtime";function xd({children:t,class:e,...i}){return je("div",{...i,"data-tag-list":!0,class:j("rui-tag-group__list",e),children:t})}function wd({value:t,label:e,children:i,class:r,disabled:s,aria:d,...h}){return WD("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(Td,{})]})}function Td({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 _d({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(_d,{children:je(xd,{children:t.map(s=>je(wd,{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(_d,{children:e})})}function Ed({children:t,class:e,...i}){return ae("div",{...i,class:j("rui-combobox__control",e),children:t})}function Rd({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 Ad({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 HD({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 Id({children:t,class:e,...i}){return ae("span",{...i,"data-combobox-value":!0,class:j("rui-combobox__value",e),children:t})}function Cd({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 Sd({children:t}){return ae("div",{class:"rui-combobox","data-ref":"root",children:t})}function YD({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(Sd,{children:[io(Ed,{children:[h?ae(Id,{children:ae(Mi,{tags:d??[],label:"Selected options"})}):null,ae(Rd,{placeholder:r.placeholder,disabled:r.disabled}),ae(Ad,{})]}),ae(Cd,{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(Sd,{children:e})})}import{RadiantElement as Gd,bindTo as ZD,customElement as e1,event as t1,onEvent as i1,onUpdated as r1,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 Dd,Od,Vd,kd,Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd;function ND(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:$d(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||$d(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:XD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return JD(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 XD(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 $d(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 JD(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 n1="[data-cycle-value]",no="button[data-cycle-toggle-button]",Hd,Wd=class extends Gd{static{({e:[Vd,kd,Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd,Dd],c:[Hd,Od]}=ND(this,[e1("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}),ZD({selector:"button[data-cycle-toggle-button]",prop:"disabled"})],0,"disabled"],[t1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[r1(["value","label","disabled","size","variant"]),2,"onPropsUpdated"],[i1({selector:no,type:"click"}),2,"onButtonClick"]],0,void 0,Gd))}value=(Dd(this),Vd(this));variant=(kd(this),Md(this));size=(Ld(this),Pd(this));label=(jd(this),Fd(this));disabled=(Bd(this),Ud(this));changeEvent=(zd(this),qd(this));childObserver=(Kd(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(n1))}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{Od()}};import{jsx as Cr}from"@ecopages/jsx/jsx-runtime";function o1({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 Yd({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 a1({children:t,variant:e,size:i,disabled:r,...s}){return Cr("rui-cycle-toggle",{...s,variant:e,size:i,disabled:r,children:Cr(Yd,{variant:e,size:i,disabled:r,children:t})})}import{jsx as ge,jsxs as ao}from"@ecopages/jsx/jsx-runtime";var Nd={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},s1={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 Xd({preference:t}){return s1[t]}function Qd({preference:t}){return Nd[t]}function l1({preference:t,showLabel:e=!0}){return ao("span",{class:"inline-flex items-center gap-inline","aria-label":e?void 0:Nd[t],children:[ge(Xd,{preference:t}),e?ge(Qd,{preference:t}):void 0]})}import{RadiantElement as Eh,bindTo as bt,customElement as g1,event as b1,onEvent as vt,onUpdated as Rh,prop as it,query as v1,state as y1}from"@ecopages/radiant";function c1(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(`(max-width: ${639}px)`).matches}function Dr(t){return t<=1||!c1()?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(){d1(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 d1(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 Jd,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;function h1(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:Sh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Sh(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:p1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return m1(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 p1(t){var e=f1(t,"string");return typeof e=="symbol"?e:e+""}function f1(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 Sh(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 m1(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 Ih,Ah=class extends Eh{static{({e:[eh,th,ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,bh,vh,yh,_h,xh,wh,Th,Jd],c:[Ih,Zd]}=h1(this,[g1("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"],[b1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[y1,bt({selector:"[data-date-field-trigger]",attr:"aria-expanded"})],0,"open"],[v1({ref:"popover"}),0,"popoverTarget"],[Rh(["value","min","max","label","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[Rh(["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,Eh))}value=(Jd(this),eh(this));min=(th(this),ih(this));max=(rh(this),nh(this));disabled=(oh(this),ah(this));readOnly=(sh(this),lh(this));label=(uh(this),ch(this));name=(dh(this),hh(this));locale=(ph(this),fh(this));visibleMonths=(mh(this),gh(this));changeEvent=(bh(this),vh(this));open=(yh(this),_h(this,!1));uid=(xh(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=wh(this);onMediaChange=(Th(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{Zd()}};import{Fragment as C1,jsx as De,jsxs as ip}from"@ecopages/jsx/jsx-runtime";import{jsx as Vr}from"@ecopages/jsx/jsx-runtime";import{customElement as S1,event as E1,onEvent as ni,onUpdated as Qh,prop as oi,registerSsrPreparationCallback as R1,state as Jh}from"@ecopages/radiant";import{FormAssociatedElement as Zh}from"@ecopages/radiant/form-associated-element";function Ch(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 Dh,Oh,Vh,kh,Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,$h,Gh,Wh,Hh,Yh,Nh;function _1(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:Xh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Xh(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:x1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return T1(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 x1(t){var e=w1(t,"string");return typeof e=="symbol"?e:e+""}function w1(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 Xh(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 T1(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 A1(){return typeof navigator>"u"?!1:/iPad|iPhone|iPod/.test(navigator.userAgent)}var tp,ep=class extends Zh{static{({e:[Vh,kh,Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,$h,Gh,Wh,Hh,Yh,Nh,Dh],c:[tp,Oh]}=_1(this,[S1("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"],[E1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Jh,0,"segments"],[Jh,0,"focusedPart"],[Qh(["value","locale"]),2,"syncSegmentsFromValue"],[Qh("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,Zh))}value=(Dh(this),Vh(this));min=(kh(this),Mh(this));max=(Lh(this),Ph(this));readOnly=(jh(this),Fh(this));label=(Bh(this),Uh(this));locale=(zh(this),qh(this));changeEvent=(Kh(this),$h(this));segments=(Gh(this),Wh(this,[]));focusedPart=(Hh(this),Yh(this,null));uid=(Nh(this),re("rui-date-input"));buffer="";useTextboxRole=A1();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(),R1(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=Ch(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{Oh()}};import{jsx as I1}from"@ecopages/jsx/jsx-runtime";function ai(t){return I1("rui-date-input",{"data-rui-control":!0,"data-rui-control-type":"date","data-rui-aria-target":'[data-ref="root"]',...t})}function rp({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 np({class:t,...e}){return De(ai,{...e,"data-date-field-input":!0,class:j("rui-date-field__input",t)})}function op({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 ap({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 sp(t){return De(Si,{...t,"data-date-field-calendar":!0})}function D1(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??ip(C1,{children:[ip(rp,{children:[De(np,{value:i,min:r,max:s,disabled:d,readOnly:h,label:a,name:E,locale:A}),De(op,{})]}),De(ap,{children:De(sp,{})})]})})}import{RadiantElement as jp,bindTo as rt,customElement as L1,event as P1,onEvent as yt,onUpdated as Fp,prop as $e,query as j1,state as F1}from"@ecopages/radiant";var lp,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;function O1(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:Pp(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Pp(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:V1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return M1(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 V1(t){var e=k1(t,"string");return typeof e=="symbol"?e:e+""}function k1(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 Pp(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 M1(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 Up,Bp=class extends jp{static{({e:[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,lp],c:[Up,up]}=O1(this,[L1("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"],[P1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[F1,rt({selector:"[data-range-trigger]",attr:"aria-expanded"})],0,"open"],[j1({ref:"popover"}),0,"popoverTarget"],[Fp(["value","min","max","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[Fp(["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,jp))}value=(lp(this),cp(this));min=(dp(this),hp(this));max=(pp(this),fp(this));disabled=(mp(this),gp(this));readOnly=(bp(this),vp(this));locale=(yp(this),_p(this));startName=(xp(this),wp(this));endName=(Tp(this),Sp(this));name=(Ep(this),Rp(this));visibleMonths=(Ap(this),Ip(this));changeEvent=(Cp(this),Dp(this));open=(Op(this),Vp(this,!1));calendarPopover=(kp(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=Mp(this);onMediaChange=(Lp(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{up()}};import{Fragment as B1,jsx as fe,jsxs as so}from"@ecopages/jsx/jsx-runtime";function zp({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 qp({children:t,class:e,...i}){return fe("div",{...i,class:j("rui-date-range-picker__values",e),"data-ref":"values",children:t})}function Kp({class:t,...e}){return fe(ai,{...e,"data-range-start":!0,class:j("rui-date-range-picker__input",t)})}function $p({class:t,...e}){return fe(ai,{...e,"data-range-end":!0,class:j("rui-date-range-picker__input",t)})}function Gp({children:t="\u2013",class:e,...i}){return fe("span",{...i,class:j("rui-date-range-picker__separator",e),"aria-hidden":"true",children:t})}function Wp({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 Hp({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 Yp(t){return fe(Si,{...t,"data-range-calendar":!0})}function U1(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(B1,{children:[so(zp,{children:[so(qp,{children:[fe(Kp,{"aria-label":i,value:T?.start,min:d,max:h,disabled:a,readOnly:E,locale:A,name:S}),fe(Gp,{}),fe($p,{"aria-label":r,value:T?.end,min:d,max:h,disabled:a,readOnly:E,locale:A,name:I})]}),fe(Wp,{})]}),fe(Hp,{children:fe(Yp,{})})]})})}import{RadiantElement as ff,bindTo as W1,bound as H1,customElement as Y1,event as N1,onEvent as uo,onUpdated as X1,prop as co,query as ho}from"@ecopages/radiant";var Np="a[href], button, input, select, textarea, [tabindex]";function z1(t){return!t.hasAttribute("disabled")&&t.getAttribute("tabindex")!=="-1"}function lo(t){return Array.from(t.querySelectorAll(Np)).filter(z1)}function kr(t){return Array.from(t.querySelectorAll(Np)).filter(e=>!e.hasAttribute("disabled"))}function si(t){return lo(t)[0]}var Xp,Qp,Jp,Zp,ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf;function q1(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:pf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||pf(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 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 K1(t){var e=$1(t,"string");return typeof e=="symbol"?e:e+""}function $1(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 pf(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 gf,mf=class extends ff{static{({e:[Jp,Zp,ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf,Xp],c:[gf,Qp]}=q1(this,[Y1("rui-dialog")],[[[co({type:Boolean,reflect:!0,defaultValue:!1}),W1({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"],[N1({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[H1,X1(["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,ff))}open=(Xp(this),Jp(this));alert=(Zp(this),ef(this));label=(tf(this),rf(this));dialogTarget=(nf(this),of(this));titleTarget=(af(this),sf(this));descriptionTarget=(lf(this),uf(this));closeEvent=(cf(this),df(this));previouslyFocused=(hf(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{Qp()}};import{jsx as ve,jsxs as vf}from"@ecopages/jsx/jsx-runtime";function yf({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 _f({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 xf({children:t,class:e,...i}){return ve("div",{...i,class:j("rui-dialog__actions",e),children:t})}function wf({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 bf({alert:t,children:e,open:i}){return vf("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 Q1({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:vf(bf,{open:r,alert:s,children:[ve(wf,{}),t!=null?ve(yf,{children:t}):null,i!=null?ve(_f,{children:i}):null,e!=null?ve(xf,{children:e}):null]})}):ve("rui-dialog",{...d,open:r,alert:s,children:ve(bf,{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 Tf(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 J1(){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 Z1(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 eO(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 tO(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 iO(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 rO(t){Fi();let e=document.createElement("rui-dialog");e.id=nt,e.alert=!!t.alert,e.label=t.label??"",e.open=!0;let i=iO(e.alert),r=i.querySelector('[data-ref="dialog"]');if(!r)throw new Error("Failed to create the dialog surface.");return r.append(J1()),t.title&&r.append(Z1(t.title)),t.body&&r.append(eO(t.body)),t.actions?.length&&r.append(tO(t.actions)),e.append(i),(jr??document.body).appendChild(e),ji=e,e}function Sf(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&&(Sf(t),e.open=!0,be=t)}function nO(t){_t(),Sf(nt),rO(t),be=nt}function Fr(t){if(typeof t=="string"){li(t);return}if(Tf(t)){li(t.id);return}nO(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 Ef(t){let e=t.detail;if(typeof e=="string"){Fr(e);return}e&&typeof e=="object"&&Fr(e)}function Rf(t){let e=t.detail;ui(e?.id)}function Af(t){let e=t.detail;e?.id&&go(e.id)}function If(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 Cf(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 Df(t={}){return Pi?(t.mount&&(jr=t.mount),fo):(Pi=!0,jr=t.mount??document.body,document.addEventListener(Mr,Ef),document.addEventListener(Lr,Rf),document.addEventListener(Pr,Af),document.addEventListener("click",If),document.addEventListener("rui-close",Cf),fo)}function _t(){Pi||Df()}function fo(){Pi&&(document.removeEventListener(Mr,Ef),document.removeEventListener(Lr,Rf),document.removeEventListener(Pr,Af),document.removeEventListener("click",If),document.removeEventListener("rui-close",Cf),Fi(),jr=null,be=null,Pi=!1)}function oO(){return be}function aO(t){_t(),Fr(t)}function sO(t){_t(),ui(t)}function lO(t){_t(),go(t)}function uO(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 Uf,bindTo as zf,bound as fO,customElement as mO,onEvent as gO,onUpdated as bO,prop as bo}from"@ecopages/radiant";var Of,Vf,kf,Mf,Lf,Pf,jf,Ff;function cO(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:Bf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Bf(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:dO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return pO(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 dO(t){var e=hO(t,"string");return typeof e=="symbol"?e:e+""}function hO(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 Bf(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 pO(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,qf=class extends Uf{static{({e:[kf,Mf,Lf,Pf,jf,Ff,Of],c:[Br,Vf]}=cO(this,[mO("rui-disclosure")],[[[bo({type:Boolean,reflect:!0,defaultValue:!1}),zf([{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}),zf({bool:"data-animated"})],0,"animated"],[gO({selector:"[data-disclosure-trigger]",type:"click"}),2,"onTriggerClick"],[[fO,bO(["open","animated"])],2,"syncExpanded"]],0,void 0,Uf))}open=(Of(this),kf(this));value=(Mf(this),Lf(this));animated=(Pf(this),jf(this));panelId=(Ff(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{Vf()}};import{RadiantElement as Xf,customElement as wO,onEvent as Qf,onUpdated as TO,prop as Jf}from"@ecopages/radiant";var Kf,$f,Gf,Wf,Hf,Yf;function vO(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:Nf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Nf(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:yO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return xO(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 yO(t){var e=_O(t,"string");return typeof e=="symbol"?e:e+""}function _O(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 Nf(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 xO(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 em,Zf=class extends Xf{static{({e:[Gf,Wf,Hf,Yf,Kf],c:[em,$f]}=vO(this,[wO("rui-disclosure-group")],[[Jf({type:Boolean,reflect:!0,defaultValue:!1}),0,"multiple"],[Jf({type:Boolean,reflect:!0,attribute:"animated",defaultValue:!1}),0,"animated"],[TO("animated"),2,"onAnimatedUpdated"],[Qf({selector:"rui-disclosure",type:"rui-disclosure-toggle"}),2,"onDisclosureToggle"],[Qf({selector:"[data-disclosure-trigger]",type:"keydown"}),2,"onTriggerKeydown"]],0,void 0,Xf))}constructor(...e){super(...e),Yf(this)}multiple=(Kf(this),Gf(this));animated=(Wf(this),Hf(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{$f()}};import{jsx as ye,jsxs as im}from"@ecopages/jsx/jsx-runtime";function rm({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 nm({children:t,class:e,disabled:i,icon:r,iconPosition:s="start",...d}){let a=r!==null?r??ye(rm,{}):null;return im("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 om({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 tm({children:t}){return ye("div",{class:"rui-disclosure","data-ref":"root",children:t})}function SO({trigger:t,icon:e,iconPosition:i,children:r,...s}){return t!=null?ye("rui-disclosure",{...s,children:im(tm,{children:[ye(nm,{icon:e,iconPosition:i,children:t}),r!=null?ye(om,{children:r}):null]})}):ye("rui-disclosure",{...s,children:ye(tm,{children:r})})}function EO({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 RO({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 AO({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 IO({children:t,class:e,...i}){return xt("header",{...i,class:j("rui-feed__header",e),children:t})}function CO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__content",e),children:t})}function DO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__actions",e),children:t})}function OO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline",e),children:t})}function VO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline-body",e),children:t})}function kO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__meta",e),children:t})}import{jsx as Hm}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as $m,customElement as QO,onEvent as Gr,onUpdated as Io,prop as Bt,registerSsrPreparationCallback as JO}from"@ecopages/radiant";import{consumeContext as ZO,onContextUpdate as eV,provideContext as tV}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",um="data-rui-aria-target",cm="data-rui-aria-targets",xo='[data-ref="field"]';function dm(){return`[${ot}], ${wo()}`}function wo(){return Array.from(wt.keys()).join(", ")}function MO(t){return t.localName==="rui-listbox"&&(t.hasAttribute("embedded")||Reflect.get(t,"embedded")===!0)}var LO={"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 hm(t){return t.localName==="input"}function pm(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)}},am={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)}},sm={read:t=>t.querySelector('input[type="checkbox"]')?.checked??t.hasAttribute("checked"),write:(t,e)=>{e?t.setAttribute("checked",""):t.removeAttribute("checked")}};function fm(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 mm(t,e){Reflect.set(t,"value",e)}var Bi={read:t=>fm(t,Er),write:mm},PO={read:t=>fm(t,Rr),write:mm},wt=new Map([["rui-checkbox",sm],["rui-switch",sm],["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",{...PO,submission:"host"}],["rui-knob",{...am,submission:"host"}],["rui-number-field",{...am,submission:"host"}]]);function gm(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 gm(t,r=>{if(!(i||!(r instanceof HTMLElement))){if(r.matches(e)){i=r;return}i=r.querySelector(e)}}),i}function lm(t){let e=t.filter(i=>!MO(i));return e.length===0?null:e.find(i=>!e.some(r=>r!==i&&r.contains(i)))??null}function jO(t){let e=[];return gm(t,i=>{i instanceof HTMLElement&&i.matches(dm())&&e.push(i)}),e}function FO(t){let e=t.querySelector(xo);return e instanceof HTMLElement?Array.from(e.querySelectorAll(dm())).filter(i=>t.contains(i)):[]}function hi(t){let e=lm(FO(t));return e||lm(jO(t))}function BO(t,e){let i=t.toLowerCase();wt.set(i,e)}function bm(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(hm(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(pm(t))return t.value;let e=zr(t);return wt.get(e.localName)?.read(e)??e.getAttribute("value")??""}function $r(t,e){if(hm(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(pm(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 vm(t){return So(t,`[${qr}]`)}function ym(t){return So(t,`[${Kr}]`)}function _m(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 xm(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 UO(t){let e=Reflect.get(t,"checked");return typeof e=="boolean"?e:t.hasAttribute("checked")}function zO(t){let e=t.getAttribute(cm);if(e){let r=e.split(",")[0]?.trim();if(r)return t.querySelector(r)}let i=t.getAttribute(um);return i?t.querySelector(i):null}function qO(t){let e=t.getAttribute(cm);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(um);if(i){let r=t.querySelector(i);return r?[r]:[]}return[]}function KO(t){if(di(t))return t;let e=zO(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 $O(t)??t;let r=LO[t.localName];return r?t.querySelector(r)??t:t}function $O(t){let e=t.querySelectorAll('input[type="radio"]');return Array.from(e).find(UO)??e[0]}function wm(t){let e=qO(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[KO(t)]}import{createContext as GO}from"@ecopages/radiant/context";var pi=GO(Symbol.for("rui-form-context"));import{createContext as WO}from"@ecopages/radiant/context";var Ao=WO(Symbol.for("rui-field-context"));var Tm,Sm,Em,Rm,Am,Im,Cm,Dm,Om,Vm,km,Mm,Lm,Pm,jm,Fm,Bm,Um,zm,qm;function HO(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:Km(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Km(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:YO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return XO(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 YO(t){var e=NO(t,"string");return typeof e=="symbol"?e:e+""}function NO(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 Km(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 XO(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 iV(t){if(!t)return;let{validate:e,...i}=t;return i}var Wm,Gm=class extends $m{static{({e:[Em,Rm,Am,Im,Cm,Dm,Om,Vm,km,Mm,Lm,Pm,jm,Fm,Bm,Um,zm,qm,Tm],c:[Wm,Sm]}=HO(this,[QO("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"],[tV({context:Ao,initialValue:{name:"",controlId:"",descriptionId:"",errorId:"",error:void 0,invalid:!1,required:!1},hydrate:Object,serialize:e=>({...e,rules:iV(e.rules)})}),0,"fieldProvider"],[ZO(pi),0,"formContextProvider"],[eV({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,$m))}name=(Tm(this),Em(this));rules=(Rm(this),Am(this));defaultValue=(Im(this),Cm(this));defaultValueData=(Dm(this),Om(this));disabled=(Vm(this),km(this));error=(Mm(this),Lm(this));invalid=(Pm(this),jm(this));fieldProvider=(Fm(this),Bm(this));formContextProvider=(Um(this),zm(this));uid=(qm(this),re("rui-field"));resolveFieldName(){return(this.name||this.getAttribute("name")||"").trim()}unregister;unregisterPresentation;registeredWithForm=!1;pendingControlWrite;controlObserver;constructor(){super(),JO(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){bm(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?wm(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();xm(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=ym(this);d&&(d.id=e,s.push(e));let h=_m(this);return h&&(h.id=i),h&&r&&s.push(i),s}syncLabel(e,i){let r=vm(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();rV(i,e)||this.fieldProvider.setContext(e)}static{Sm()}};function rV(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 nV({children:t,rules:e,defaultValue:i,defaultValueData:r,...s}){return Hm("rui-field",{...s,"prop:rules":e,"prop:defaultValue":i,data:{defaultValue:r??(i!==void 0?JSON.stringify(i):void 0)},children:Hm("div",{class:"rui-field","data-ref":"field",children:t})})}import{jsx as oV}from"@ecopages/jsx/jsx-runtime";function aV({children:t,class:e,...i}){return oV("p",{...i,[Kr]:"",class:j("rui-field__description",e),children:t})}import{jsx as sV}from"@ecopages/jsx/jsx-runtime";function lV({class:t,...e}){return sV("p",{...e,[ci]:"",class:j("rui-field__error",t),role:"alert",hidden:!0})}import{jsx as Eg}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as yg,customElement as vV,event as _g,onEvent as Do,onUpdated as xg,prop as Ut}from"@ecopages/radiant";import{provideContext as yV}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 uV(t,e,i,r){if(i)for(let s of[cV,dV,hV,pV]){let d=await s(e,i,r);if(d)return d}}function cV(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 dV(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 hV(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 pV(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 Ym(t,e,i){let r=i??Object.keys(e.fields),s={};for(let d of r){let h=e.fields[d]?.rules,a=await uV(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)=>Ym(t,e,i.names)}function Nm(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=Nm(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=Nm(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 Xm,Qm,Jm,Zm,eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg;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:vg(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||vg(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:mV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return bV(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 mV(t){var e=gV(t,"string");return typeof e=="symbol"?e:e+""}function gV(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 vg(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 bV(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 wg=()=>{},_V={register:()=>wg,updateFieldOptions:()=>{},handleFieldChange:()=>{},handleFieldBlur:()=>{},subscribePresentation:()=>wg},Sg,Tg=class extends yg{static{({e:[Jm,Zm,eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg,Xm],c:[Sg,Qm]}=fV(this,[vV("rui-form")],[[yV({context:pi,initialValue:{ready:!1,store:void 0,revision:0,fields:{},errors:{},actions:_V},hydrate:Object,serialize:({revision:e,fields:i,errors:r})=>({ready:!1,revision:e,fields:i,errors:r})}),0,"formProvider"],[_g({name:"rui-submit",bubbles:!0,composed:!0}),0,"submitEvent"],[_g({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"],[xg(["defaultValues","defaultValuesData","mode","reValidateMode"]),2,"syncOptions"],[xg(["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,yg))}formProvider=(Xm(this),Jm(this));submitEvent=(Zm(this),eg(this));invalidEvent=(tg(this),ig(this));defaultValues=(rg(this),ng(this));defaultValuesData=(og(this),ag(this));resolver=(sg(this),lg(this));mode=(ug(this),cg(this));reValidateMode=(dg(this),hg(this));action=(pg(this),fg(this));method=(mg(this),gg(this));onSubmit=void bg(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{Qm()}};function xV({children:t,defaultValues:e,defaultValuesData:i,resolver:r,reValidateMode:s,onSubmit:d,action:h,method:a,...E}){return Eg("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:Eg("form",{class:"rui-form","data-ref":"form",noValidate:!0,action:h,method:a,children:t})})}import{RadiantElement as Og,customElement as RV,onEvent as AV,prop as IV}from"@ecopages/radiant";var Rg,Ag,Ig,Cg;function wV(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:Dg(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Dg(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:TV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return EV(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 TV(t){var e=SV(t,"string");return typeof e=="symbol"?e:e+""}function SV(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 Dg(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 EV(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 kg,Vg=class extends Og{static{({e:[Ig,Cg,Rg],c:[kg,Ag]}=wV(this,[RV("rui-grid")],[[IV({type:String,defaultValue:""}),0,"label"],[AV({selector:'[role="gridcell"]',type:"keydown"}),2,"onKeydown"]],0,void 0,Og))}constructor(...e){super(...e),Cg(this)}label=(Rg(this),Ig(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{Ag()}};import{jsx as Wr}from"@ecopages/jsx/jsx-runtime";function CV({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 DV}from"@ecopages/jsx/jsx-runtime";function Hr({as:t,children:e,...i}){return DV(t??"div",{...i,children:e})}import{jsx as OV}from"@ecopages/jsx/jsx-runtime";function Oo(t){let{children:e,as:i="h2",size:r="md",class:s,...d}=t;return OV(Hr,{as:i,...d,class:j("rui-headline",r!==!1&&`rui-headline--size-${r}`,s),children:e})}function VV(t,e,i){return j("rui-heading",`rui-heading--align-${t}`,`rui-heading--size-${e}`,i)}function kV(t){let{children:e,as:i="div",align:r="start",size:s="md",class:d,...h}=t;return Yr(Hr,{as:i,...h,class:VV(r,s,d),children:e})}function MV({children:t,class:e,...i}){return Yr("p",{...i,class:j("rui-heading__eyebrow",e),children:t})}function LV(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 PV({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 nb,bindTo as zV,bound as qi,customElement as qV,event as KV,onEvent as Nr,onUpdated as $V,prop as zt,query as GV}from"@ecopages/radiant";var zi=0,Mg=0;function Lg(){zi+=1}function Vo(t=Date.now(),e=300){zi=Math.max(0,zi-1),zi===0&&(Mg=t+e)}function Pg(t,e=Date.now()){return zi>0||e<Mg?0:t}var jg,Fg,Bg,Ug,zg,qg,Kg,$g,Gg,Wg,Hg,Yg,Ng,Xg,Qg,Jg,Zg,eb,tb,ib;function jV(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:rb(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||rb(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:FV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return UV(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 FV(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 rb(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 UV(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",ob=8,WV=500,sb,ab=class extends nb{static{({e:[Bg,Ug,zg,qg,Kg,$g,Gg,Wg,Hg,Yg,Ng,Xg,Qg,Jg,Zg,eb,tb,ib,jg],c:[sb,Fg]}=jV(this,[qV("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}),zV({ref:"content",attr:"aria-label"})],0,"contentLabel"],[GV({ref:"content"}),0,"contentTarget"],[KV({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[qi,$V(["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,nb))}open=(jg(this),Bg(this));placement=(Ug(this),zg(this));delay=(qg(this),Kg(this));closeDelay=($g(this),Gg(this));portal=(Wg(this),Hg(this));disabled=(Yg(this),Ng(this));contentLabel=(Xg(this),Qg(this));contentTarget=(Jg(this),Zg(this));openChangeEvent=(eb(this),tb(this));contentId=(ib(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:ob,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:ob,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?Lg():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=Pg(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)},WV))}onPointerUp(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}static{Fg()}};function HV({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 YV({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 NV({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 XV}from"@ecopages/jsx/jsx-runtime";function QV(t){let{class:e,type:i="text",mask:r,placeholder:s,"on:input":d,...h}=t,a=r?Dn(r):s;return XV("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 JV({children:t,class:e,...i}){return Mo("div",{...i,role:"group",class:j("rui-input-group",e),children:t})}function ZV({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 ek({children:t,class:e,...i}){return Mo("span",{...i,class:j("rui-input-group__text",e),children:t})}import{bindTo as Jb,customElement as ck,event as dk,onEvent as Gi,onUpdated as hk,prop as Oe,query as qt}from"@ecopages/radiant";import{FormAssociatedElement as Zb}from"@ecopages/radiant/form-associated-element";function tk(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)):tk(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 lb=120,gi=300,ik=14,rk=gi+(360-gi)/2;function nk(t){return Math.min(100,Math.max(0,Number.isFinite(t)?Number(t):ik))}function ok(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=nk(s),A=50-E/2,S=2*Math.PI*A,I=gi/360*S,T=a.clamp(t),K=mi(r,h);return{startAngle:lb,strokeWidth:E,radius:A,circumference:S,arcLength:I,progressLength:a.ratioFor(T)*I,valueText:ok(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-lb+360)%360,h=d<=gi?d:d<=rk?gi:0;return r.valueFromRatio(h/gi)}var ub,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;function ak(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:Qb(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Qb(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 uk(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=lk(t,"string");return typeof e=="symbol"?e:e+""}function lk(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 Qb(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 uk(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,tv,ev=class extends Zb{static{({e:[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,ub],c:[tv,cb]}=ak(this,[ck("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}),Jb({ref:"control",attr:"aria-readonly",map:e=>String(e)})],0,"readOnly"],[[Oe({type:String,defaultValue:""}),Jb([{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"],[dk({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"],[hk(["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,Zb))}value=(ub(this),db(this));min=(hb(this),pb(this));max=(fb(this),mb(this));step=(gb(this),bb(this));valuePrecision=(vb(this),yb(this));readOnly=(_b(this),xb(this));label=(wb(this),Tb(this));size=(Sb(this),Eb(this));strokeWidth=(Rb(this),Ab(this));showValue=(Ib(this),Cb(this));valuePosition=(Db(this),Ob(this));valueTemplate=(Vb(this),kb(this));changeEvent=(Mb(this),Lb(this));rootTarget=(Pb(this),jb(this));labelTarget=(Fb(this),Bb(this));controlTarget=(Ub(this),zb(this));trackTarget=(qb(this),Kb(this));progressTarget=($b(this),Gb(this));centerValueTarget=(Wb(this),Hb(this));belowValueTarget=(Yb(this),Nb(this));activePointerId=(Xb(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{cb()}};import{jsx as st,jsxs as jo}from"@ecopages/jsx/jsx-runtime";function pk({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(fk,{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 fk({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(mk,{knob:r,ring:e,range:i})})}function mk({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(gk,{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 gk({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 bk}from"@ecopages/jsx/jsx-runtime";function vk({children:t,htmlFor:e,class:i,...r}){return bk("label",{...r,[qr]:"",class:j("rui-label",i),for:e,children:t})}import{RadiantElement as bv,bindTo as Rk,bound as Ak,customElement as Ik,event as vv,onEvent as Tt,onUpdated as Ck,prop as yv,query as _v}from"@ecopages/radiant";var yk=200,_k=250,xk=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)},yk);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:xk,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)},_k);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 iv,rv,nv,ov,av,sv,lv,uv,cv,dv,hv,pv,fv,mv;function wk(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:gv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||gv(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:Tk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Ek(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 Tk(t){var e=Sk(t,"string");return typeof e=="symbol"?e:e+""}function Sk(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 gv(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 Ek(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 Dk=6,wv,xv=class extends bv{static{({e:[nv,ov,av,sv,lv,uv,cv,dv,hv,pv,fv,mv,iv],c:[wv,rv]}=wk(this,[Ik("rui-menu-button")],[[[yv({type:Boolean,reflect:!0,defaultValue:!1}),Rk([{ref:"trigger",attr:"aria-expanded"},{ref:"menu",bool:"hidden",invert:!0}])],0,"open"],[yv({type:String,defaultValue:"bottom-start"}),0,"placement"],[_v({ref:"trigger"}),0,"triggerTarget"],[_v({ref:"menu"}),0,"menuTarget"],[vv({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[vv({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[Ak,Ck(["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,bv))}open=(iv(this),nv(this));placement=(ov(this),av(this));triggerTarget=(sv(this),lv(this));menuTarget=(uv(this),cv(this));changeEvent=(dv(this),hv(this));closeEvent=(pv(this),fv(this));menuId=(mv(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:Dk,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{rv()}};import{jsx as He,jsxs as Tv}from"@ecopages/jsx/jsx-runtime";import{jsx as Ok}from"@ecopages/jsx/jsx-runtime";function Wi({orientation:t="horizontal",class:e,...i}){return Ok("hr",{...i,class:j("rui-separator",e),role:"separator","aria-orientation":t,"data-orientation":t})}import{Fragment as Vk,jsxs as kk}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 kk(Vk,{children:[e.Item({value:i.value,disabled:i.disabled,hasSubmenu:r,children:i.label}),r?e.Submenu({children:Hi(i.items??[],e)}):null]})})}function Sv({children:t,class:e,variant:i="filled",size:r="md",...s}){return Tv(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 Ev({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 Rv({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 Av({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 Mk({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}):Tv("rui-menu-button",{...s,class:j("rui-menu-button",r),children:[He(Sv,{children:t}),He(Ev,{children:e?Hi(e,{Item:d=>He(Av,{...d}),Submenu:d=>He(Rv,{...d}),Separator:d=>He(Wi,{},d.id)}):i})]})}import{RadiantElement as Lv,customElement as Bk,event as Uk,onEvent as St,prop as zk}from"@ecopages/radiant";var Iv,Cv,Dv,Ov,Vv,kv;function Lk(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:Mv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Mv(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:Pk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Fk(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 Pk(t){var e=jk(t,"string");return typeof e=="symbol"?e:e+""}function jk(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 Mv(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 Fk(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 jv,Pv=class extends Lv{static{({e:[Dv,Ov,Vv,kv,Iv],c:[jv,Cv]}=Lk(this,[Bk("rui-menubar")],[[zk({type:String,defaultValue:""}),0,"label"],[Uk({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,Lv))}label=(Iv(this),Dv(this));changeEvent=(Ov(this),Vv(this));openRoot=(kv(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{Cv()}};import{jsx as Ye,jsxs as qk}from"@ecopages/jsx/jsx-runtime";function Fv({label:t,children:e,disabled:i}){let r=e!=null;return qk("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 Bv({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 Uv({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 Kk({items:t,label:e,children:i,...r}){let s=t!=null?t.map(d=>Ye(Fv,{label:d.label,disabled:d.disabled,children:d.items?.length?Hi(d.items,{Item:h=>Ye(Bv,{...h}),Submenu:h=>Ye(Uv,{...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 ey,customElement as Yk,onUpdated as Nk,prop as Jr,state as Xk}from"@ecopages/radiant";var zv,qv,Kv,$v,Gv,Wv,Hv,Yv,Nv,Xv,Qv,Jv;function $k(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:Zv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Zv(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:Gk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Hk(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 Gk(t){var e=Wk(t,"string");return typeof e=="symbol"?e:e+""}function Wk(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 Zv(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 Hk(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 iy,ty=class extends ey{static{({e:[Kv,$v,Gv,Wv,Hv,Yv,Nv,Xv,Qv,Jv,zv],c:[iy,qv]}=$k(this,[Yk("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"],[Xk,0,"percent"],[Nk(["value","min","max"]),2,"onRangeUpdated"]],0,void 0,ey))}value=(zv(this),Kv(this));min=($v(this),Gv(this));max=(Wv(this),Hv(this));label=(Yv(this),Nv(this));percent=(Xv(this),Qv(this,0));resolvedAriaLabel=(Jv(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{qv()}};import{jsx as Qk}from"@ecopages/jsx/jsx-runtime";function Jk(t){return Qk("rui-meter",{...t})}import{jsx as Kt}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as fy,customElement as rM,onEvent as Fe,prop as Zr}from"@ecopages/radiant";var ry,ny,oy,ay,sy,ly,uy,cy,dy,hy;function Zk(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:py(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||py(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:eM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return iM(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 eM(t){var e=tM(t,"string");return typeof e=="symbol"?e:e+""}function tM(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 py(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 iM(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 gy=200,by=150,nM=8,vy,my=class extends fy{static{({e:[oy,ay,sy,ly,uy,cy,dy,hy,ry],c:[vy,ny]}=Zk(this,[rM("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:gy}),0,"hoverDelay"],[Zr({type:Number,attribute:"close-delay",defaultValue:by}),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,fy))}label=(ry(this),oy(this));openOnHover=(ay(this),sy(this));hoverDelay=(ly(this),uy(this));closeDelay=(cy(this),dy(this));openValue=(hy(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:nM,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{ny()}};function oM({children:t,class:e,...i}){return Kt("div",{...i,"data-ref":"bar",class:j("rui-navigation-menu__bar",e),children:t})}function aM({children:t,class:e,...i}){return Kt("div",{...i,"data-ref":"panels",class:j("rui-navigation-menu__panels",e),children:t})}function sM({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 lM({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 uM({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 cM({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 gM,event as bM,onEvent as $t,onUpdated as vM,prop as Ee,state as t_}from"@ecopages/radiant";import{FormAssociatedElement as i_}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 dM(e)?(new Intl.NumberFormat(void 0,e),e):void 0}catch{return}}function dM(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 yy(t,e,i);let s=Number.isFinite(e)?e:0,d=Math.round((t-s)/r)*r+s;return yy(d,e,i)}function yy(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 _y,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;function hM(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:e_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||e_(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:pM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return mM(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 pM(t){var e=fM(t,"string");return typeof e=="symbol"?e:e+""}function fM(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 e_(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 mM(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 n_,r_=class extends i_{static{({e:[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,_y],c:[n_,xy]}=hM(this,[gM("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"],[bM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[t_,0,"decreaseDisabled"],[t_,0,"increaseDisabled"],[vM(["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,i_))}value=(_y(this),wy(this));defaultValue=(Ty(this),Sy(this));minValue=(Ey(this),Ry(this));maxValue=(Ay(this),Iy(this));step=(Cy(this),Dy(this));readOnly=(Oy(this),Vy(this));label=(ky(this),My(this));locale=(Ly(this),Py(this));formatOptions=(jy(this),Fy(this));commitBehavior=(By(this),Uy(this));incrementAriaLabel=(zy(this),qy(this));decrementAriaLabel=(Ky(this),$y(this));wheelDisabled=(Gy(this),Wy(this));changeEvent=(Hy(this),Yy(this));decreaseDisabled=(Ny(this),Xy(this,!1));increaseDisabled=(Qy(this),Jy(this,!1));editing=(Zy(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{xy()}};import{jsx as Be,jsxs as o_}from"@ecopages/jsx/jsx-runtime";function a_({children:t,class:e,...i}){return Be("div",{...i,"data-number-field-group":!0,class:j("rui-number-field__group",e),children:t})}function s_({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 l_({children:t,class:e,...i}){return Be("div",{...i,class:j("rui-number-field__steppers",e),children:t})}function u_({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 c_({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 yM(){return o_(a_,{children:[Be(s_,{}),o_(l_,{children:[Be(c_,{}),Be(u_,{})]})]})}function _M({children:t,...e}){return Be("rui-number-field",{...e,children:Be("div",{class:"rui-number-field","data-ref":"root",children:t??Be(yM,{})})})}import{jsx as _e,jsxs as Ho}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as R_,customElement as EM,event as RM,onEvent as AM,prop as Yi}from"@ecopages/radiant";var d_,h_,p_,f_,m_,g_,b_,v_,y_,__,x_,w_,T_,S_;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:E_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||E_(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:wM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return SM(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 wM(t){var e=TM(t,"string");return typeof e=="symbol"?e:e+""}function TM(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 E_(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 SM(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 I_,A_=class extends R_{static{({e:[p_,f_,m_,g_,b_,v_,y_,__,x_,w_,T_,S_,d_],c:[I_,h_]}=xM(this,[EM("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"],[RM({name:"rui-page-change",bubbles:!0,composed:!0}),0,"pageChangeEvent"],[AM({selector:"[data-pagination-page]",type:"click"}),2,"onPageClick"]],0,void 0,R_))}constructor(...e){super(...e),S_(this)}label=(d_(this),p_(this));page=(f_(this),m_(this));pageCount=(g_(this),b_(this));disabled=(v_(this),y_(this));siblingCount=(__(this),x_(this));pageChangeEvent=(w_(this),T_(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{h_()}};function IM(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 C_({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),$=IM(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 CM({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(C_,{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 hx}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as tn,bound as No,customElement as lx,event as kM,onEvent as Ni,onUpdated as ux,prop as Et,query as Xo}from"@ecopages/radiant";import{isServer as MM}from"@ecopages/radiant/is-server";var D_,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;function sx(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:nx(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||nx(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:DM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return VM(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 DM(t){var e=OM(t,"string");return typeof e=="symbol"?e:e+""}function OM(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 nx(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 VM(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 cx,ox=class extends tn{static{({e:[V_,k_,M_,L_,P_,j_,F_,B_,U_,z_,q_,K_,$_,G_,W_,H_,Y_,N_,X_,Q_,D_],c:[cx,O_]}=sx(this,[lx("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"],[kM({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[No,ux(["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=(D_(this),V_(this));placement=(k_(this),M_(this));portal=(L_(this),P_(this));matchAnchorWidth=(j_(this),F_(this));offset=(B_(this),U_(this));anchor=(z_(this),q_(this));variant=(K_(this),$_(this));surfaceTarget=(G_(this),W_(this));hostTarget=(H_(this),Y_(this));openChangeEvent=(N_(this),X_(this));surfaceId=(Q_(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{O_()}};var dx,ax=class extends tn{static{({e:[ex,tx,ix,rx,J_],c:[dx,Z_]}=sx(this,[lx("rui-popover-trigger")],[[Et({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Xo({ref:"root"}),0,"rootTarget"],[[No,ux(["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),rx(this)}open=(J_(this),ex(this));rootTarget=(tx(this),ix(this));getPopover(){return this.querySelector("rui-popover")}onConnected(){this.syncToPopover()}syncToPopover(){if(MM)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{Z_()}};function Yo(t){return t.querySelector('button, a[href], input, select, textarea, [role="button"]')??t}function LM({children:t,class:e,...i}){return vi("div",{...i,class:j(e),children:t})}function PM({trigger:t,children:e,variant:i="default",...r}){let s=i==="listbox"?"rui-popover--listbox":"";return vi("rui-popover",{...r,variant:i,children:hx("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 jM({trigger:t,children:e,...i}){return vi("rui-popover-trigger",{...i,children:hx("div",{class:"rui-popover-trigger","data-ref":"root",children:[vi("span",{"data-popover-trigger":!0,children:t}),e]})})}import{RadiantElement as Ix,bindTo as Cx,customElement as qM,event as KM,onEvent as $M,onUpdated as GM,prop as rn,query as WM}from"@ecopages/radiant";var px,fx,mx,gx,bx,vx,yx,_x,xx,wx,Tx,Sx,Ex,Rx;function FM(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:Ax(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ax(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:BM(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 BM(t){var e=UM(t,"string");return typeof e=="symbol"?e:e+""}function UM(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 Ax(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 Ox,Dx=class extends Ix{static{({e:[mx,gx,bx,vx,yx,_x,xx,wx,Tx,Sx,Ex,Rx,px],c:[Ox,fx]}=FM(this,[qM("rui-radio-group")],[[rn({type:String,reflect:!0,defaultValue:""}),0,"value"],[rn({type:String,defaultValue:""}),0,"name"],[[rn({type:String,defaultValue:""}),Cx({selector:"[data-radio-group-root]",attr:"aria-label",map:gt})],0,"label"],[[rn({type:Boolean,reflect:!0,defaultValue:!1}),Cx({selector:"[data-radio-group-root]",attr:"aria-disabled",map:e=>e?"true":void 0})],0,"disabled"],[WM({selector:'input[type="radio"]',all:!0,cache:!1}),0,"radioTargets"],[KM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[GM(["value","name","disabled"]),2,"syncRadios"],[$M({selector:'input[type="radio"]',type:"change"}),2,"onRadioChange"]],0,void 0,Ix))}constructor(...e){super(...e),Rx(this)}value=(px(this),mx(this));name=(gx(this),bx(this));label=(vx(this),yx(this));disabled=(_x(this),xx(this));radioTargets=(wx(this),Tx(this));changeEvent=(Sx(this),Ex(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{fx()}};import{jsx as Gt,jsxs as HM}from"@ecopages/jsx/jsx-runtime";function Vx({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 kx({children:t,value:e,name:i,disabled:r,class:s,...d}){return HM("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 YM({options:t,children:e,...i}){return Gt("rui-radio-group",{...i,children:t==null?e:Gt(Vx,{children:t.map(r=>Gt(kx,{value:r.value,disabled:r.disabled,children:r.label}))})})}import{RadiantElement as t0,bindTo as i0,customElement as ZM,event as eL,onEvent as xe,onUpdated as tL,prop as Wt,query as iL}from"@ecopages/radiant";var Mx,Lx,Px,jx,Fx,Bx,Ux,zx,qx,Kx,$x,Gx,Wx,Hx,Yx,Nx,Xx,Qx,Jx,Zx;function NM(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:e0(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||e0(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:XM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return JM(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 XM(t){var e=QM(t,"string");return typeof e=="symbol"?e:e+""}function QM(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 e0(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 JM(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 n0,r0=class extends t0{static{({e:[Px,jx,Fx,Bx,Ux,zx,qx,Kx,$x,Gx,Wx,Hx,Yx,Nx,Xx,Qx,Jx,Zx,Mx],c:[n0,Lx]}=NM(this,[ZM("rui-select")],[[[Wt({...Ie,defaultValue:[]}),i0({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}),i0([{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"],[eL({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[iL({ref:"root"}),0,"rootTarget"],[tL(["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,t0))}constructor(...e){super(...e),Zx(this)}value=(Mx(this),Px(this));label=(jx(this),Fx(this));placeholder=(Bx(this),Ux(this));disabled=(zx(this),qx(this));selectionMode=(Kx(this),$x(this));shouldCloseOnSelect=(Gx(this),Wx(this));triggerKind=(Hx(this),Yx(this));changeEvent=(Nx(this),Xx(this));open=(Qx(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=Jx(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{Lx()}};import{Fragment as rL,jsx as he,jsxs as o0}from"@ecopages/jsx/jsx-runtime";function a0({children:t,class:e,...i}){return he("div",{...i,class:j("rui-select__control",e),children:t})}function s0({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 l0({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 nL({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 u0({children:t,class:e,...i}){return he("span",{...i,"data-select-value":!0,class:j("rui-select__value",e),children:t})}function c0({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 oL({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 aL(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 sL({children:t}){return he("div",{class:"rui-select","data-ref":"root",children:t})}function lL({options:t,children:e,value:i,...r}){let s=et(i),d=r.selectionMode==="multiple",h=t!=null?aL(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(sL,{children:t==null?e:o0(rL,{children:[o0(a0,{children:[he(s0,{disabled:r.disabled,children:he(u0,{children:d?he(Mi,{tags:a??[],label:"Selected options"}):h})}),he(l0,{})]}),he(c0,{children:he(ii,{embedded:!0,options:t,selectionMode:r.selectionMode,value:s})})]})})})}import{RadiantElement as cw,bindTo as Xi,bound as dw,customElement as pL,event as Qo,onEvent as Qi,onUpdated as Jo,prop as me,query as on,state as fL}from"@ecopages/radiant";import{isServer as mL}from"@ecopages/radiant/is-server";function nn(t){return t.split(",").map(e=>e.trim()).filter(e=>e.length>0)}var d0,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;function uL(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:uw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||uw(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:cL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return hL(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 cL(t){var e=dL(t,"string");return typeof e=="symbol"?e:e+""}function dL(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 uw(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 hL(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 gL=256,bL=48,vL=200,yL=480,_L="b",hw=8,pw=32,fw='[data-ref="menu-button"]';function xL(t){return t.metaKey||t.ctrlKey}function wL(){return typeof window<"u"&&typeof window.matchMedia=="function"}function an(t){return t==="left"||t==="right"}var gw,mw=class extends cw{static{({e:[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,d0],c:[gw,h0]}=uL(this,[pL("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:gL}),0,"defaultWidth"],[me({type:Number,reflect:!0,attribute:"width"}),0,"width"],[me({type:Number,defaultValue:vL}),0,"minWidth"],[me({type:Number,defaultValue:yL}),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"],[[fL,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"],[dw,2,"onPointerMove"],[dw,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:fw,type:"click"}),2,"onMenuLinkClick"],[Qi({document:!0,type:"keydown"}),2,"onHostKeydown"]],0,void 0,cw))}variant=(d0(this),p0(this));side=(f0(this),m0(this));collapsible=(g0(this),b0(this));defaultWidth=(v0(this),y0(this));width=(_0(this),x0(this));minWidth=(w0(this),T0(this));maxWidth=(S0(this),E0(this));resizable=(R0(this),A0(this));defaultOpen=(I0(this),C0(this));mobileDefaultOpen=(D0(this),O0(this));open=(V0(this),k0(this));mobileBreakpoint=(M0(this),L0(this));label=(P0(this),j0(this));matchActive=(F0(this),B0(this,!1));matchMode=(U0(this),z0(this));scrollActiveOnMount=(q0(this),K0(this,!1));navigationEvents=($0(this),G0(this,""));rootTarget=(W0(this),H0(this));paneTarget=(Y0(this),N0(this));handleTarget=(X0(this),Q0(this));scrimTarget=(J0(this),Z0(this));toggleEvent=(ew(this),tw(this));resizeEvent=(iw(this),rw(this));mobileChangeEvent=(nw(this),ow(this));isMobile=(aw(this),sw(this,!1));mediaQuery=(lw(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(fw)){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(mL||!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||!wL()){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"?bL: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?pw:hw);else if(i.key===h)a=r+(i.shiftKey?pw:hw);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}xL(i)&&i.key.toLowerCase()===_L&&(i.preventDefault(),this.toggle())}static{h0()}};import{RadiantElement as Fw,bindTo as sn,customElement as AL,onEvent as IL,onUpdated as Bw,prop as Ji,query as CL,state as Zo}from"@ecopages/radiant";var bw,vw,yw,_w,xw,ww,Tw,Sw,Ew,Rw,Aw,Iw,Cw,Dw,Ow,Vw,kw,Mw,Lw,Pw;function TL(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:jw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||jw(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:SL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return RL(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 SL(t){var e=EL(t,"string");return typeof e=="symbol"?e:e+""}function EL(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 jw(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 RL(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 Uw="Toggle sidebar",DL=["filled","outline","ghost"],OL=["sm","md","lg"];function qw({variant:t,size:e}){return`rui-button rui-button--${t} rui-button--${e} rui-sidebar__trigger`}function VL(t){return t==="inset"?"collapsed":"expanded"}var Kw,zw=class extends Fw{static{({e:[yw,_w,xw,ww,Tw,Sw,Ew,Rw,Aw,Iw,Cw,Dw,Ow,Vw,kw,Mw,Lw,Pw,bw],c:[Kw,vw]}=TL(this,[AL("rui-sidebar-trigger")],[[Ji({type:String,defaultValue:""}),0,"controls"],[[Ji({type:String,attribute:"button-label",defaultValue:Uw}),sn({ref:"button",attr:"aria-label",map:e=>e?.trim()||Uw})],0,"buttonLabel"],[Ji({type:String,reflect:!0,defaultValue:""}),0,"placement"],[Ji({type:String,defaultValue:"ghost"}),0,"variant"],[Ji({type:String,defaultValue:"md"}),0,"size"],[CL({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"],[Bw(["controls","placement"]),2,"onTargetUpdated"],[Bw(["variant","size"]),2,"onPresentationUpdated"],[IL({ref:"button",type:"click"}),2,"onButtonClick"]],0,void 0,Fw))}controls=(bw(this),yw(this));buttonLabel=(_w(this),xw(this));placement=(ww(this),Tw(this));variant=(Sw(this),Ew(this));size=(Rw(this),Aw(this));buttonTarget=(Iw(this),Cw(this));sidebarState=(Dw(this),Ow(this,"expanded"));sidebarMobile=(Vw(this),kw(this,null));sidebarCollapsible=(Mw(this),Lw(this,null));sidebarObserver=(Pw(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 DL)e.toggle(`rui-button--${i}`,i===this.variant);for(let i of OL)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=VL(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{vw()}};import{jsx as we,jsxs as Zi}from"@ecopages/jsx/jsx-runtime";function kL(){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 ML({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:qw({variant:r,size:s}),children:t??we(kL,{})})})}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 LL({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 PL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__header",e),children:t})}function jL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__content",e),children:t})}function FL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__footer",e),children:t})}function BL({class:t,...e}){return se("hr",{...e,role:"separator","aria-orientation":"horizontal",class:j("rui-sidebar__separator",t)})}function UL({children:t,class:e,...i}){return se("section",{...i,class:j("rui-sidebar__group",e),children:t})}function $w({children:t,class:e,...i}){return se("h2",{...i,class:j("rui-sidebar__group-label",e),children:t})}function zL({children:t,class:e,...i}){return se("button",{...i,type:"button",class:j("rui-sidebar__group-action",e),children:t})}function qL({label:t,action:e,class:i,...r}){return er("div",{...r,class:j("rui-sidebar__group-header",i),children:[se($w,{children:t}),e]})}function KL({children:t,class:e,...i}){return se("ul",{...i,role:"list",class:j("rui-sidebar__menu",e),children:t})}function $L({children:t,class:e,...i}){return se("li",{...i,class:j("rui-sidebar__menu-item",e),children:t})}function Gw(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 GL(t){let{class:e,...i}=t;return se(Gw,{class:j("rui-sidebar__menu-action",e),...i})}function WL({children:t,class:e,...i}){return se("main",{...i,class:j("rui-sidebar__inset",e),children:t})}function HL({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 jT,customElement as JL,event as ZL,onEvent as tr,onUpdated as eP,prop as Ve,query as Rt}from"@ecopages/radiant";import{FormAssociatedElement as FT}from"@ecopages/radiant/form-associated-element";var Ww,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;function YL(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:PT(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||PT(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:NL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return QL(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 NL(t){var e=XL(t,"string");return typeof e=="symbol"?e:e+""}function XL(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 PT(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 QL(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,UT=100;function zT(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 tP(t){return Array.isArray(t.value)?[...t.value]:typeof t.value=="number"?[t.value]:t.variant==="range"?[ia,ra]:[ta]}function qT(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 zT(e,i,r,t.minDistance??0)}return[e.clamp(t.values[0]??ta)]}function KT(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 $T(t){let e=t.variant??"single",i=t.min??0,r=t.max??UT,s=t.step??1,d=t.minDistance??0,h=tP(t),a=qT({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:KT(a,s,t.valuePrecision),trackStyle:GT(a,E),isRange:a.length===2,valuePrecision:typeof t.valuePrecision=="number"&&Number.isFinite(t.valuePrecision)?t.valuePrecision:void 0}}function GT(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 WT,BT=class extends FT{static{({e:[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,Ww],c:[WT,Hw]}=YL(this,[JL("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:UT}),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:""}),jT([{ref:"label",bool:"hidden",invert:!0},{ref:"label",text:!0}])],0,"label"],[[Ve({type:Boolean,attribute:"show-value",defaultValue:!1}),jT({selector:"[data-default-value]",bool:"hidden",invert:!0})],0,"showValue"],[Ve({type:Boolean,attribute:"value-title",defaultValue:!1}),0,"valueTitle"],[ZL({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"],[eP(["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,FT))}variant=(Ww(this),Yw(this));orientation=(Nw(this),Xw(this));value=(Qw(this),Jw(this));min=(Zw(this),eT(this));max=(tT(this),iT(this));step=(rT(this),nT(this));valuePrecision=(oT(this),aT(this));minDistance=(sT(this),lT(this));readOnly=(uT(this),cT(this));label=(dT(this),hT(this));showValue=(pT(this),fT(this));valueTitle=(mT(this),gT(this));changeEvent=(bT(this),vT(this));rootTarget=(yT(this),_T(this));headerTarget=(xT(this),wT(this));labelTarget=(TT(this),ST(this));rangeTrack=(ET(this),RT(this));valueTarget=(AT(this),IT(this));singleThumb=(CT(this),DT(this));rangeMinThumb=(OT(this),VT(this));rangeMaxThumb=(kT(this),MT(this));activeThumb=(LT(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 KT(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 zT(this.numericRange,e,i,this.minDistance,r)}committedValues(){return qT({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=GT(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{Hw()}};import{jsx as Ue,jsxs as na}from"@ecopages/jsx/jsx-runtime";function HT({children:t,class:e,...i}){return Ue("span",{...i,class:j("rui-slider__value",e),"data-ref":"value","aria-hidden":"true",children:t})}function iP({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 rP({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=$T({variant:t,value:S,min:a,max:E,step:A,minDistance:T,valuePrecision:I}),G=K??Ue(HT,{"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(nP,{seed:V,orientation:e,label:i,disabled:d,hasVisibleReadout:W,valueReadout:G})})}function nP({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(iP,{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 oP}from"@ecopages/jsx/jsx-runtime";function aP({size:t="md",aria:e,class:i,...r}){return oP("span",{...r,role:"status",aria:ne(e,"Loading"),class:j("rui-spinner",`rui-spinner--${t}`,i)})}import{RadiantElement as oS,bindTo as oa,customElement as dP,event as hP,onEvent as pP,prop as aa}from"@ecopages/radiant";var YT,NT,XT,QT,JT,ZT,eS,tS,iS,rS;function sP(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:nS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||nS(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:lP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return cP(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 lP(t){var e=uP(t,"string");return typeof e=="symbol"?e:e+""}function uP(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 nS(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 cP(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 sS,aS=class extends oS{static{({e:[XT,QT,JT,ZT,eS,tS,iS,rS,YT],c:[sS,NT]}=sP(this,[dP("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"],[hP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[pP({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,oS))}constructor(...e){super(...e),rS(this)}checked=(YT(this),XT(this));disabled=(QT(this),JT(this));name=(ZT(this),eS(this));changeEvent=(tS(this),iS(this));onInputChange(e){let i=e.target;this.checked=i.checked,this.changeEvent.emit({checked:this.checked})}static{NT()}};import{jsx as ir,jsxs as fP}from"@ecopages/jsx/jsx-runtime";function mP({children:t,checked:e,disabled:i,name:r,...s}){return ir("rui-switch",{...s,checked:e,disabled:i,name:r,children:fP("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 kS}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as CS,customElement as _P,event as sa,onEvent as yi,onUpdated as DS,prop as _i}from"@ecopages/radiant";var lS,uS,cS,dS,hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,TS,SS,ES,RS,AS;function gP(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:bP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return yP(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 bP(t){var e=vP(t,"string");return typeof e=="symbol"?e:e+""}function vP(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 yP(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 VS,OS=class extends CS{static{({e:[cS,dS,hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,TS,SS,ES,RS,AS,lS],c:[VS,uS]}=gP(this,[_P("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"],[DS(["value","selectionMode"]),2,"onSelectionUpdated"],[DS(["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,CS))}label=(lS(this),cS(this));ariaBusy=(dS(this),hS(this));selectionMode=(pS(this),fS(this));value=(mS(this),gS(this));sortColumn=(bS(this),vS(this));sortDirection=(yS(this),_S(this));changeEvent=(xS(this),wS(this));sortChangeEvent=(TS(this),SS(this));rowActionEvent=(ES(this),RS(this));structureObserver=void AS(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{uS()}};function xP({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 wP({children:t,class:e,...i}){return pe("div",{...i,role:"rowgroup",class:j("rui-table__body",e),children:t})}function TP({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 SP({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?kS("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 EP({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 RP({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 AP({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 IP({colSpan:t,children:e,class:i,...r}){let s=Math.max(1,Math.floor(t));return kS("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 CP({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 HS,customElement as MP,event as LP,onEvent as YS,onUpdated as PP,prop as ln}from"@ecopages/radiant";var MS,LS,PS,jS,FS,BS,US,zS,qS,KS,$S,GS;function DP(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:WS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||WS(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:OP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return kP(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 OP(t){var e=VP(t,"string");return typeof e=="symbol"?e:e+""}function VP(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 WS(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 kP(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 XS,NS=class extends HS{static{({e:[PS,jS,FS,BS,US,zS,qS,KS,$S,GS,MS],c:[XS,LS]}=DP(this,[MP("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"],[LP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[PP(["value","label"]),2,"onPropsUpdated"],[YS({selector:'[role="tab"]',type:"click"}),2,"onTabClick"],[YS({selector:'[role="tab"]',type:"keydown"}),2,"onTabKeydown"]],0,void 0,HS))}variant=(MS(this),PS(this));value=(jS(this),FS(this));label=(BS(this),US(this));automatic=(zS(this),qS(this));changeEvent=(KS(this),$S(this));childObserver=(GS(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{LS()}};import{jsx as rr}from"@ecopages/jsx/jsx-runtime";function jP({children:t,class:e,...i}){return rr("div",{...i,class:j("rui-tabs__list",e),role:"tablist",children:t})}function FP({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 BP({children:t,class:e,...i}){return rr("div",{...i,class:j("rui-tabs__panels",e),children:t})}function UP({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 zP({children:t,...e}){return rr("rui-tabs",{...e,children:t})}import{jsx as qP}from"@ecopages/jsx/jsx-runtime";function KP(t){let{class:e,rows:i=3,...r}=t;return qP("textarea",{...r,rows:i,[ot]:"","data-rui-control-type":"text",class:j("rui-textarea",e)})}import{jsx as ut,jsxs as TE}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as SE,bindTo as fa,bound as ma,customElement as JP,onEvent as EE,onUpdated as ga,prop as Ne,query as ZP}from"@ecopages/radiant";var nr="rui-toast-show",or="rui-toast-dismiss",$P=["top-start","top-center","top-end","bottom-start","bottom-center","bottom-end"],ar=4e3,GP=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 WP=1;function HP(){return WP++}function QS(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??HP(),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(QS(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(QS(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 JS,ZS,eE,tE,iE,rE,nE,oE,aE,sE,lE,uE,cE,dE,hE,pE,fE,mE,gE,bE,vE,yE,_E,xE;function YP(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:wE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||wE(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:NP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return QP(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 NP(t){var e=XP(t,"string");return typeof e=="symbol"?e:e+""}function XP(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 wE(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 QP(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 ej(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 AE,RE=class extends SE{static{({e:[eE,tE,iE,rE,nE,oE,aE,sE,lE,uE,cE,dE,hE,pE,fE,mE,gE,bE,vE,yE,_E,xE,JS],c:[AE,ZS]}=YP(this,[JP("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"],[ZP({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"],[EE({selector:"[data-toast-close]",type:"click"}),2,"onCloseClick"],[EE({selector:"[data-toast-action]",type:"click"}),2,"onActionClick"]],0,void 0,SE))}toastId=(JS(this),eE(this));title=(tE(this),iE(this));description=(rE(this),nE(this));variant=(oE(this),aE(this));duration=(sE(this),lE(this));dismissible=(uE(this),cE(this));closeButton=(dE(this),hE(this));actionLabel=(pE(this),fE(this));position=(mE(this),gE(this));markedDelete=(bE(this),vE(this));toastTarget=(yE(this),_E(this));mounted=(xE(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?(ej(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 TE("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,TE("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{ZS()}};import{jsx as va}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as eR,bindTo as oj,bound as dn,customElement as aj,onEvent as ya,onUpdated as sj,prop as At,query as lj,state as uj}from"@ecopages/radiant";function IE(t,e,i){let r=0;for(let s=0;s<t;s+=1)r+=e[s]??0;return r+t*i}function CE(t,e){return t.length===0?0:t.reduce((r,s)=>r+s,0)+Math.max(0,t.length-1)*e}function DE(t,e,i){return e<=0?0:t+Math.max(0,e-1)*i}var OE,VE,kE,ME,LE,PE,jE,FE,BE,UE,zE,qE,KE,$E,GE,WE,HE,YE,NE,XE,QE,JE;function tj(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:ZE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ZE(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 nj(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=rj(t,"string");return typeof e=="symbol"?e:e+""}function rj(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 ZE(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 nj(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 tR(t,e){return t instanceof Node&&e.contains(t)}var rR,iR=class extends eR{static{({e:[kE,ME,LE,PE,jE,FE,BE,UE,zE,qE,KE,$E,GE,WE,HE,YE,NE,XE,QE,JE,OE],c:[rR,VE]}=tj(this,[aj("rui-toaster")],[[[At({type:String,reflect:!0,defaultValue:lr}),oj([{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"],[lj({ref:"list"}),0,"listTarget"],[uj,0,"toasts"],[sj(["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,eR))}position=(OE(this),kE(this));duration=(ME(this),LE(this));visibleToasts=(PE(this),jE(this));closeButton=(FE(this),BE(this));expand=(UE(this),zE(this));gap=(qE(this),KE(this));offset=($E(this),GE(this));container=(WE(this),HE(this));listTarget=(YE(this),NE(this));toasts=(XE(this),QE(this,[]));expanded=(JE(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,$=IE(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?CE(a,this.gap):DE(E,A,this.gap)}px`}onPointerOver(e){tR(e.relatedTarget,this)||(this.expanded=!0,this.syncPauseState())}onPointerOut(e){tR(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{VE()}};import{jsx as nR}from"@ecopages/jsx/jsx-runtime";function cj({toastId:t,...e}){return nR("rui-toast",{...e,toastId:t!=null?String(t):void 0})}function dj(t){return nR("rui-toaster",{...t})}var hj=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 pj(t){document.dispatchEvent(new CustomEvent(nr,{detail:t,bubbles:!0,composed:!0}))}function fj(t){let e=t==null?{}:{id:t};document.dispatchEvent(new CustomEvent(or,{detail:e,bubbles:!0,composed:!0}))}import{jsx as hn,jsxs as _j}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as AR,bound as xj,customElement as wj,onUpdated as Tj,prop as cr,state as IR}from"@ecopages/radiant";import{isServer as CR}from"@ecopages/radiant/is-server";function oR(t,e){try{return t.querySelector(e)}catch{return null}}function aR(t,e){try{return Array.from(t.querySelectorAll(e))}catch{return[]}}function mj(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}function sR(t,e,i=r=>document.getElementById(r)!==null){if(t.id)return e.add(t.id),t.id;let r=mj(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 lR(t,e){return t instanceof HTMLElement?t.getBoundingClientRect().top+e:e}function uR(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 cR,dR,hR,pR,fR,mR,gR,bR,vR,yR,_R,xR,wR,TR,SR,ER;function gj(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:RR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||RR(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:bj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return yj(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 bj(t){var e=vj(t,"string");return typeof e=="symbol"?e:e+""}function vj(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 RR(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 yj(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 OR,DR=class extends AR{static{({e:[hR,pR,fR,mR,gR,bR,vR,yR,_R,xR,wR,TR,SR,ER,cR],c:[OR,dR]}=gj(this,[wj("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"],[IR,0,"entries"],[IR,0,"activeId"],[Tj(["target","headingSelector","scrollOffset","navigationEvents"]),2,"onScanSettingsUpdated"],[xj,2,"onLinkClick"]],0,void 0,AR))}target=(cR(this),hR(this,""));headingSelector=(pR(this),fR(this,"h2,h3"));label=(mR(this),gR(this,"On this page"));scrollOffset=(bR(this),vR(this,120));navigationEvents=(yR(this),_R(this,""));entries=(xR(this),wR(this,[]));activeId=(TR(this),SR(this,null));headings=(ER(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=aR(e,this.readConfiguredProp(this.headingSelector,"heading-selector")||"h2,h3");if(i.length===0)return;let r=new Set,s=i.map(d=>({id:sR(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?oR(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(CR||!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(CR||!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 lR(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}`),uR(i,this.scrollRoot??window,this.resolvedScrollOffset(),r)}render(){return this.entries.length===0?null:_j("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{dR()}};import{jsx as Sj}from"@ecopages/jsx/jsx-runtime";function Ej(t){return Sj("rui-toc",{...t})}import{RadiantElement as BR,customElement as Dj,onEvent as UR,prop as zR}from"@ecopages/radiant";var VR,kR,MR,LR,PR,jR;function Rj(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:FR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||FR(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:Aj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Cj(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 Aj(t){var e=Ij(t,"string");return typeof e=="symbol"?e:e+""}function Ij(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 FR(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 Cj(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 KR,qR=class extends BR{static{({e:[MR,LR,PR,jR,VR],c:[KR,kR]}=Rj(this,[Dj("rui-toolbar")],[[zR({type:String,defaultValue:""}),0,"label"],[zR({type:Boolean,reflect:!0,defaultValue:!1}),0,"exclusiveToggles"],[UR({type:"keydown",selector:"button, a[href], input, select, [tabindex]"}),2,"onKeydown"],[UR({type:"click",selector:"button[data-toggle][aria-pressed]",options:{capture:!0}}),2,"onToggleButtonClick"]],0,void 0,BR))}constructor(...e){super(...e),jR(this)}label=(VR(this),MR(this));exclusiveToggles=(LR(this),PR(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{kR()}};import{jsx as $R}from"@ecopages/jsx/jsx-runtime";function Oj({children:t,label:e,...i}){return $R("rui-toolbar",{...i,label:e,children:$R("div",{class:"rui-toolbar","data-ref":"root",role:"toolbar","aria-label":e||void 0,children:t})})}import{RadiantElement as iA,bindTo as Pj,bound as rA,customElement as jj,onEvent as _a,onUpdated as Fj,prop as xa,query as Bj}from"@ecopages/radiant";var GR,WR,HR,YR,NR,XR,QR,JR,ZR,eA;function Vj(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:tA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||tA(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:kj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Lj(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 kj(t){var e=Mj(t,"string");return typeof e=="symbol"?e:e+""}function Mj(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 tA(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 Lj(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 nA=8,aA,oA=class extends iA{static{({e:[HR,YR,NR,XR,QR,JR,ZR,eA,GR],c:[aA,WR]}=Vj(this,[jj("rui-tooltip")],[[[Pj({ref:"tooltip",text:!0}),xa({type:String,defaultValue:""})],0,"content"],[xa({type:String,defaultValue:"top"}),0,"placement"],[xa({type:Number,defaultValue:200}),0,"delay"],[Bj({ref:"tooltip"}),0,"tooltipTarget"],[Fj(["content","placement"]),2,"onDescribedPropsUpdated"],[_a({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[_a({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[_a({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[rA,2,"onPointerEnter"],[rA,2,"onPointerLeave"]],0,void 0,iA))}content=(GR(this),HR(this));placement=(YR(this),NR(this));delay=(XR(this),QR(this));tooltipTarget=(JR(this),ZR(this));open=(eA(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:nA}))}onDescribedPropsUpdated(){this.wireTrigger(),this.open&&this.tooltipTarget&&Qn(this.getAnchor(),this.tooltipTarget,this.placement,nA)}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()}static{WR()}};import{jsx as wa,jsxs as Uj}from"@ecopages/jsx/jsx-runtime";function zj({children:t,content:e="",...i}){return wa("rui-tooltip",{content:e,...i,children:Uj("span",{class:"rui-tooltip",children:[wa("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:t}),wa("span",{class:"rui-tooltip__content rui-floating","data-ref":"tooltip",role:"tooltip",hidden:!0,children:e})]})})}import{RadiantElement as gA,customElement as Wj,event as Hj,onEvent as bA,onUpdated as Yj,prop as vA}from"@ecopages/radiant";var sA,lA,uA,cA,dA,hA,pA,fA;function qj(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:mA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||mA(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:Kj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Gj(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 Kj(t){var e=$j(t,"string");return typeof e=="symbol"?e:e+""}function $j(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 mA(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 Gj(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 _A,yA=class extends gA{static{({e:[uA,cA,dA,hA,pA,fA,sA],c:[_A,lA]}=qj(this,[Wj("rui-tree")],[[vA({type:String,defaultValue:""}),0,"label"],[vA({type:String,reflect:!0,defaultValue:""}),0,"value"],[Hj({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Yj("value"),2,"onValueUpdated"],[bA({selector:'[role="treeitem"]',type:"click"}),2,"onClick"],[bA({selector:'[role="treeitem"]',type:"keydown"}),2,"onKeydown"]],0,void 0,gA))}label=(sA(this),uA(this));value=(cA(this),dA(this));changeEvent=(hA(this),pA(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=(fA(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{lA()}};import{Fragment as xA,jsx as ct,jsxs as Nj}from"@ecopages/jsx/jsx-runtime";var wA=({nodes:t})=>ct(xA,{children:t.map(e=>ct("li",{class:"rui-tree__item",children:e.children?.length?Nj(xA,{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(wA,{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 Xj({nodes:t,label:e,children:i,...r}){let s=t!=null?ct(wA,{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 VA,customElement as t2,event as i2,onEvent as kA,onUpdated as r2,prop as MA}from"@ecopages/radiant";var TA,SA,EA,RA,AA,IA,CA,DA;function Qj(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:OA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||OA(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:Jj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return e2(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 Jj(t){var e=Zj(t,"string");return typeof e=="symbol"?e:e+""}function Zj(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 OA(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 e2(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 PA,LA=class extends VA{static{({e:[EA,RA,AA,IA,CA,DA,TA],c:[PA,SA]}=Qj(this,[t2("rui-treegrid")],[[MA({type:String,defaultValue:""}),0,"label"],[MA({type:String,reflect:!0,defaultValue:""}),0,"value"],[i2({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[r2("value"),2,"onValueUpdated"],[kA({selector:'[role="gridcell"]',type:"click"}),2,"onCellClick"],[kA({selector:'[role="gridcell"]',type:"keydown"}),2,"onCellKeydown"]],0,void 0,VA))}label=(TA(this),EA(this));value=(RA(this),AA(this));changeEvent=(IA(this),CA(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=(DA(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{SA()}};import{Fragment as n2,jsx as dt,jsxs as o2}from"@ecopages/jsx/jsx-runtime";var jA=({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(jA,{rows:i.children,depth:e+1})},`${i.id}-group`)),r});function a2({columns:t,rows:e,label:i,children:r,...s}){let d=t!=null&&e!=null?o2(n2,{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(jA,{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 ZA,bindTo as Ta,bound as eI,customElement as d2,event as h2,onEvent as tI,onUpdated as p2,prop as Sa,query as iI}from"@ecopages/radiant";var FA,BA,UA,zA,qA,KA,$A,GA,WA,HA,YA,NA,XA,QA;function s2(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:JA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||JA(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:l2(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return c2(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 l2(t){var e=u2(t,"string");return typeof e=="symbol"?e:e+""}function u2(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 JA(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 c2(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 Ea(t){return t!=="vertical"}var nI,rI=class extends ZA{static{({e:[UA,zA,qA,KA,$A,GA,WA,HA,YA,NA,XA,QA,FA],c:[nI,BA]}=s2(this,[d2("rui-window-splitter")],[[[Sa({type:Number,reflect:!0,defaultValue:50}),Ta({ref:"separator",attr:"aria-valuenow"})],0,"value"],[[Sa({type:String,defaultValue:"horizontal"}),Ta({ref:"separator",attr:"aria-orientation",map:e=>Ea(e)?"vertical":"horizontal"})],0,"orientation"],[[Sa({type:String,defaultValue:"Split view"}),Ta({ref:"separator",attr:"aria-label"})],0,"label"],[iI({ref:"primary"}),0,"primaryTarget"],[iI({ref:"separator"}),0,"separatorTarget"],[h2({name:"rui-splitter-change",bubbles:!0,composed:!0}),0,"changeEvent"],[p2(["value","orientation"]),2,"onPropsUpdated"],[tI({ref:"separator",type:"keydown"}),2,"onKeydown"],[tI({ref:"separator",type:"pointerdown"}),2,"onPointerDown"],[eI,2,"onPointerMove"],[eI,2,"onPointerUp"]],0,void 0,ZA))}value=(FA(this),UA(this));orientation=(zA(this),qA(this));label=(KA(this),$A(this));primaryTarget=(GA(this),WA(this));separatorTarget=(HA(this),YA(this));changeEvent=(NA(this),XA(this));dragging=(QA(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=Ea(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=Ea(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{BA()}};import{jsx as pn,jsxs as f2}from"@ecopages/jsx/jsx-runtime";function m2({primary:t,secondary:e,orientation:i="horizontal",...r}){return pn("rui-window-splitter",{...r,orientation:i,children:f2("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,by as NAVIGATION_MENU_DEFAULT_CLOSE_DELAY,gy 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,yI as RuiAlert,vI as RuiAlertDescription,Ha as RuiAlertElement,gI as RuiAlertIcon,bI as RuiAlertTitle,vn as RuiAutocomplete,gn as RuiAutocompleteCollection,os as RuiAutocompleteElement,bn as RuiAutocompleteEmpty,AI as RuiAutocompleteInput,DI as RuiAvatar,VI as RuiBadge,BI as RuiBreadcrumb,ms as RuiBreadcrumbElement,GI as RuiBreadcrumbEllipsis,zI as RuiBreadcrumbItem,qI as RuiBreadcrumbLink,UI as RuiBreadcrumbList,KI as RuiBreadcrumbPage,$I as RuiBreadcrumbSeparator,Je as RuiButton,NI as RuiButtonGroup,Si as RuiCalendar,bl as RuiCalendarElement,FC as RuiCarousel,au as RuiCarouselElement,uu as RuiCarouselNext,lu as RuiCarouselPrev,cu as RuiCarouselRotation,su as RuiCarouselSlide,Di as RuiCheckbox,Tr as RuiCheckboxElement,rD as RuiCheckboxGroup,Nu as RuiCheckboxGroupControl,Yu as RuiCheckboxGroupElement,oD as RuiChip,aD as RuiChipList,sD as RuiChipListItem,YD as RuiCombobox,HD as RuiComboboxClear,Ed as RuiComboboxControl,Ic as RuiComboboxElement,Rd as RuiComboboxInput,Cd as RuiComboboxListbox,Ad as RuiComboboxTrigger,Id as RuiComboboxValue,a1 as RuiCycleToggle,Yd as RuiCycleToggleButton,Hd as RuiCycleToggleElement,o1 as RuiCycleToggleItem,D1 as RuiDateField,sp as RuiDateFieldCalendar,rp as RuiDateFieldControl,Ih as RuiDateFieldElement,np as RuiDateFieldInput,ap as RuiDateFieldPopover,op as RuiDateFieldToggle,ai as RuiDateInput,tp as RuiDateInputElement,U1 as RuiDateRangePicker,Yp as RuiDateRangePickerCalendar,zp as RuiDateRangePickerControl,Up as RuiDateRangePickerElement,$p as RuiDateRangePickerEndInput,qp as RuiDateRangePickerInputs,Hp as RuiDateRangePickerPopover,Gp as RuiDateRangePickerSeparator,Kp as RuiDateRangePickerStartInput,Wp as RuiDateRangePickerToggle,Q1 as RuiDialog,xf as RuiDialogActions,_f as RuiDialogBody,wf as RuiDialogClose,gf as RuiDialogElement,yf as RuiDialogTitle,SO as RuiDisclosure,Br as RuiDisclosureElement,EO as RuiDisclosureGroup,em as RuiDisclosureGroupElement,rm as RuiDisclosureIcon,om as RuiDisclosurePanel,nm as RuiDisclosureTrigger,RO as RuiFeed,AO as RuiFeedArticle,DO as RuiFeedArticleActions,CO as RuiFeedArticleContent,IO as RuiFeedArticleHeader,OO as RuiFeedByline,VO as RuiFeedBylineBody,kO as RuiFeedMeta,nV as RuiField,aV as RuiFieldDescription,Wm as RuiFieldElement,lV as RuiFieldError,xV as RuiForm,Sg as RuiFormElement,CV as RuiGrid,kg as RuiGridElement,kV as RuiHeading,PV as RuiHeadingDescription,MV as RuiHeadingEyebrow,LV as RuiHeadingTitle,Oo as RuiHeadline,NV as RuiHoverCard,YV as RuiHoverCardContent,sb as RuiHoverCardElement,HV as RuiHoverCardTrigger,xi as RuiIconCalendar,wi as RuiIconCheck,Xe as RuiIconChevronDown,fn as RuiIconChevronLeft,mn as RuiIconChevronRight,Re as RuiIconX,QV as RuiInput,JV as RuiInputGroup,ZV as RuiInputGroupAddon,ek as RuiInputGroupText,pk as RuiKnob,tv as RuiKnobElement,vk as RuiLabel,ii as RuiListbox,Nc as RuiListboxElement,eo as RuiListboxOption,Xc as RuiListboxOptionIndicator,Mk as RuiMenuButton,Ev as RuiMenuButtonContent,wv as RuiMenuButtonElement,Av as RuiMenuButtonItem,Rv as RuiMenuButtonSubmenuContent,Sv as RuiMenuButtonTrigger,Kk as RuiMenubar,jv as RuiMenubarElement,Fv as RuiMenubarMenu,Bv as RuiMenubarMenuItem,Uv as RuiMenubarSubmenuContent,Jk as RuiMeter,iy as RuiMeterElement,sM as RuiNavigationMenu,oM as RuiNavigationMenuBar,vy as RuiNavigationMenuElement,uM as RuiNavigationMenuLink,cM as RuiNavigationMenuPanel,aM as RuiNavigationMenuPanels,lM as RuiNavigationMenuTrigger,_M as RuiNumberField,c_ as RuiNumberFieldDecrementButton,n_ as RuiNumberFieldElement,a_ as RuiNumberFieldGroup,u_ as RuiNumberFieldIncrementButton,s_ as RuiNumberFieldInput,l_ as RuiNumberFieldSteppers,CM as RuiPagination,I_ as RuiPaginationElement,C_ as RuiPaginationNav,PM as RuiPopover,LM as RuiPopoverContent,cx as RuiPopoverElement,jM as RuiPopoverTrigger,dx as RuiPopoverTriggerElement,kx as RuiRadio,YM as RuiRadioGroup,Vx as RuiRadioGroupControl,Ox as RuiRadioGroupElement,lL as RuiSelect,nL as RuiSelectClear,a0 as RuiSelectControl,n0 as RuiSelectElement,c0 as RuiSelectListbox,oL as RuiSelectSearch,l0 as RuiSelectToggle,s0 as RuiSelectTrigger,u0 as RuiSelectValue,Wi as RuiSeparator,HL as RuiSidebar,jL as RuiSidebarContent,gw as RuiSidebarElement,FL as RuiSidebarFooter,UL as RuiSidebarGroup,zL as RuiSidebarGroupAction,qL as RuiSidebarGroupHeader,$w as RuiSidebarGroupLabel,PL as RuiSidebarHeader,WL as RuiSidebarInset,KL as RuiSidebarMenu,GL as RuiSidebarMenuAction,Gw as RuiSidebarMenuButton,$L as RuiSidebarMenuItem,LL as RuiSidebarProvider,BL as RuiSidebarSeparator,ML as RuiSidebarTrigger,Kw as RuiSidebarTriggerElement,rP as RuiSlider,WT as RuiSliderElement,HT as RuiSliderValue,aP as RuiSpinner,mP as RuiSwitch,sS as RuiSwitchElement,FP as RuiTab,jP as RuiTabList,UP as RuiTabPanel,BP as RuiTabPanels,CP as RuiTable,wP as RuiTableBody,RP as RuiTableCell,SP as RuiTableColumn,VS as RuiTableElement,IP as RuiTableEmptyState,TP as RuiTableFooter,xP as RuiTableHeader,EP as RuiTableRow,AP as RuiTableSelectionCell,zP as RuiTabs,XS as RuiTabsElement,wd as RuiTag,Mi as RuiTagGroup,yd as RuiTagGroupElement,xd as RuiTagList,Td as RuiTagRemove,KP as RuiTextarea,cj as RuiToast,AE as RuiToastElement,dj as RuiToaster,rR as RuiToasterElement,Ej as RuiToc,OR as RuiTocElement,Oj as RuiToolbar,KR as RuiToolbarElement,zj as RuiTooltip,aA as RuiTooltipElement,Xj as RuiTree,_A as RuiTreeElement,a2 as RuiTreegrid,PA as RuiTreegridElement,m2 as RuiWindowSplitter,nI as RuiWindowSplitterElement,da as TOAST_COLLAPSED_PEEK,ha as TOAST_EXIT_MS,la as TOAST_GAP,ar as TOAST_LIFETIME,$P as TOAST_POSITIONS,sr as TOAST_SWIPE_THRESHOLD,ua as TOAST_VIEWPORT_OFFSET,ca as TOAST_VISIBLE_AMOUNT,GP as TOAST_WIDTH,Qd as ThemeItemLabel,Xd as ThemePreferenceIcon,l1 as ThemePreferenceItemContent,Ct as WINDOW_SPLITTER_MAX,It as WINDOW_SPLITTER_MIN,sO as closeDialog,uO as createDialogHandle,Co as createRulesResolver,j as cx,ro as cycleValue,fj as dismissToast,Ao as fieldContext,hi as findFieldControl,pi as formContext,oO as getOpenDialogId,Df as installDialogs,di as isNativeTextControl,aO as openDialog,Eo as readControlValue,BO as registerFieldControl,Ym as runRulesResolver,pj as showToast,hj as toast,lO 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 br,jsxs as rI}from"@ecopages/jsx/jsx-runtime";function Ri({class:t,size:e="sm",...i}){return rI("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:[br("path",{d:"M8 2v4"}),br("path",{d:"M16 2v4"}),br("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),br("path",{d:"M3 10h18"})]})}import{jsx as ms}from"@ecopages/jsx/jsx-runtime";function Ai({class:t,size:e="sm",...i}){return ms("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:ms("path",{d:"m5 12 4 4L19 6"})})}import{jsx as gs}from"@ecopages/jsx/jsx-runtime";function Xe({class:t,size:e="sm",...i}){return gs("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:gs("path",{d:"m6 9 6 6 6-6"})})}import{jsx as bs}from"@ecopages/jsx/jsx-runtime";function Zn({class:t,size:e="sm",...i}){return bs("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:bs("path",{d:"m15 18-6-6 6-6"})})}import{jsx as vs}from"@ecopages/jsx/jsx-runtime";function eo({class:t,size:e="sm",...i}){return vs("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:vs("path",{d:"m9 18 6-6-6-6"})})}import{jsx as ys,jsxs as nI}from"@ecopages/jsx/jsx-runtime";var _s="http://www.w3.org/2000/svg";function Re({class:t,size:e="sm",...i}){return nI("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:[ys("path",{d:"m18 6-12 12"}),ys("path",{d:"m6 6 12 12"})]})}function vr(){let t=document.createElementNS(_s,"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(_s,"path");i.setAttribute("d",e),t.append(i)}return t}import{RadiantElement as Ms,bound as uI,customElement as cI,event as dI,onEvent as hI,prop as yr}from"@ecopages/radiant";var xs,ws,Ts,Ss,Es,Rs,As,Is,Cs,Ds,Os,Vs;function oI(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:ks(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ks(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:aI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return lI(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function aI(t){var e=sI(t,"string");return typeof e=="symbol"?e:e+""}function sI(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 ks(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 lI(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,Ls=class extends Ms{static{({e:[Ts,Ss,Es,Rs,As,Is,Cs,Ds,Os,Vs,xs],c:[_r,ws]}=oI(this,[cI("rui-alert")],[[yr({type:String,reflect:!0,defaultValue:"info"}),0,"variant"],[yr({type:String,reflect:!0,defaultValue:"inline"}),0,"layout"],[yr({type:Boolean,reflect:!0,defaultValue:!1}),0,"dismissible"],[yr({type:String,attribute:"close-label",defaultValue:"Dismiss"}),0,"closeLabel"],[dI({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[uI,2,"dismiss"],[hI({selector:"[data-alert-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Ms))}constructor(...e){super(...e),Vs(this)}variant=(xs(this),Ts(this));layout=(Ss(this),Es(this));dismissible=(Rs(this),As(this));closeLabel=(Is(this),Cs(this));closeEvent=(Ds(this),Os(this));dismiss(){this.isConnected&&(this.closeEvent.emit({reason:"dismiss"}),this.remove())}onCloseClick(e){e.stopPropagation(),this.dismissible&&this.dismiss()}static{ws()}};import{jsx as ze,jsxs as Ps}from"@ecopages/jsx/jsx-runtime";var fI={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 pI({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=fI[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 mI({children:t,class:e,...i}){return ze("p",{...i,class:j("rui-alert__title",e),children:t})}function gI({children:t,class:e,...i}){return ze("div",{...i,class:j("rui-alert__description",e),children:t})}function bI({children:t,variant:e="info",layout:i="inline",dismissible:r=!1,closeLabel:s="Dismiss",class:d,slot:h,...a}){return ze(_r,{slot:h,variant:e,layout:i,dismissible:r,"close-label":s,children:Ps("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:Ps("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 Gs,customElement as wI,onEvent as TI,onUpdated as SI,prop as $s}from"@ecopages/radiant";function xr(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 js,Fs,Bs,Us,zs,qs;function vI(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Ks(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ks(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:yI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return xI(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function yI(t){var e=_I(t,"string");return typeof e=="symbol"?e:e+""}function _I(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 Ks(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 xI(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 wr,Ws=class extends Gs{static{({e:[Bs,Us,zs,qs,js],c:[wr,Fs]}=vI(this,[wI("rui-autocomplete")],[[$s({type:String,defaultValue:"base"}),0,"sensitivity"],[$s({type:String,attribute:"input-value",defaultValue:""}),0,"inputValue"],[SI(["sensitivity","inputValue"]),2,"onPropsUpdated"],[TI({selector:"[data-autocomplete-input]",type:"input"}),2,"onInput"]],0,void 0,Gs))}sensitivity=(js(this),Bs(this));inputValue=(Us(this),zs(this));externalInput=(qs(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=xr(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{Fs()}};import{jsx as Xt}from"@ecopages/jsx/jsx-runtime";function EI({placeholder:t,class:e,disabled:i,...r}){return Xt("input",{...r,type:"search","data-autocomplete-input":!0,class:j("rui-autocomplete__input",e),placeholder:t,disabled:i,autocomplete:"off"})}function to({children:t,class:e,...i}){return Xt("div",{...i,"data-autocomplete-collection":!0,class:j("rui-autocomplete__collection",e),children:t})}function io({children:t,class:e,...i}){return Xt("div",{...i,"data-autocomplete-empty":!0,class:j("rui-autocomplete__empty",e),children:t})}function RI({children:t}){return Xt("div",{class:"rui-autocomplete","data-ref":"root",children:t})}function ro({children:t,...e}){return Xt(wr,{...e,children:Xt(RI,{children:t})})}import{jsx as no}from"@ecopages/jsx/jsx-runtime";function ke(...t){for(let e of t)if(e!==void 0)return e}function AI(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 II({src:t,alt:e="",fallback:i,size:r="md",class:s,children:d,role:h,aria:a,...E}){let A=i??(e?AI(e):void 0);return no("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?no("img",{class:"rui-avatar__image",src:t,alt:e}):no("span",{class:"rui-avatar__fallback","aria-hidden":e||i?"true":void 0,children:d??A??"?"})})}import{jsx as CI}from"@ecopages/jsx/jsx-runtime";function DI({children:t,variant:e="filled",class:i,...r}){return CI("span",{...r,class:j("rui-badge",`rui-badge--${e}`,i),children:t})}import{RadiantElement as Zs,customElement as LI,prop as el}from"@ecopages/radiant";var Hs,Ns,Ys,Xs,Qs;function OI(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Js(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Js(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:VI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return MI(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function VI(t){var e=kI(t,"string");return typeof e=="symbol"?e:e+""}function kI(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 Js(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 MI(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 Tr,tl=class extends Zs{static{({e:[Ns,Ys,Xs,Qs],c:[Tr,Hs]}=OI(this,[LI("rui-breadcrumb")],[[el({type:String,defaultValue:"Breadcrumb"}),0,"label"],[el({type:String,defaultValue:"/"}),0,"separator"]],0,void 0,Zs))}constructor(...e){super(...e),Qs(this)}label=Ns(this);separator=(Ys(this),Xs(this));static{Hs()}};import{jsx as Qe,jsxs as PI}from"@ecopages/jsx/jsx-runtime";function jI({children:t,label:e,separator:i,...r}){return Qe(Tr,{...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 FI({children:t,class:e,...i}){return Qe("ol",{...i,class:j("rui-breadcrumb__list",e),children:t})}function BI({children:t,class:e,...i}){return Qe("li",{...i,class:j("rui-breadcrumb__item",e),children:t})}function UI({children:t,href:e,class:i,...r}){return Qe("a",{...r,class:j("rui-breadcrumb__link",i),href:e,children:t})}function zI({children:t,class:e,...i}){return Qe("span",{...i,class:j("rui-breadcrumb__page",e),"aria-current":"page",children:t})}function qI({children:t,class:e,...i}){return Qe("li",{...i,class:j("rui-breadcrumb__separator",e),role:"presentation","aria-hidden":"true",children:t})}function KI({label:t="More",class:e,...i}){return PI("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 il}from"@ecopages/jsx/jsx-runtime";function GI(t,e,i){if(t!==void 0)return t;if(e)return i}function $I(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:G,target:V,rel:$,download:W,children:O,class:_,variant:H,size:N,square:n,...g}=t;return il("a",{...g,href:G,target:V,rel:$,download:W,class:j("rui-button",`rui-button--${H??"filled"}`,`rui-button--${N??"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=G=>{if(S&&E===void 0){let V=G.currentTarget,$=V.getAttribute("aria-pressed")!=="true";V.setAttribute("aria-pressed",String($))}$I(I,G)};return il("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":GI(E,S,A),"data-toggle":S&&E===void 0?"":void 0,"on:click":S||I?K:void 0,children:d})}import{jsx as WI}from"@ecopages/jsx/jsx-runtime";function HI({children:t,orientation:e="horizontal",class:i,...r}){return WI("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 Ao}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as tu,customElement as vC,event as yC,onEvent as kt,onUpdated as _C,prop as pt,registerSsrPreparationCallback as xC,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 ft(t,e,i){return!(e&&t<e||i&&t>i)}function Ot(t,e){return t.localeCompare(e)}function Qt(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:Qt(e,i)}function Jt(t){if(!t)return"";let e=Qt(t.start,t.end);return`${e.start}/${e.end}`}function Zt(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean).sort(Ot):[]}function oo(t){return[...new Set(t)].sort(Ot).join(",")}function ao(t,e){let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),[...i].sort(Ot)}function rl(t,e){let i=Qt(e.start,e.end);return Ot(t,i.start)>=0&&Ot(t,i.end)<=0}function so(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=Qt(r.start,r.end),d=rl(t,s),h=t===s.start,a=t===s.end;return{isSelected:d,isRangeStart:h,isRangeEnd:a,isRangeMiddle:d&&!h&&!a}}function lo(t,e,i){return e.anchor?{committed:Qt(e.anchor,i),draft:{anchor:null,hover:null}}:{committed:t,draft:{anchor:i,hover:i}}}function Sr(t){let e=NI(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 NI(t){return Array.isArray(t)?t[0]??navigator.language:t??navigator.language}function YI(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function XI(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function QI(t){let e=t.selectionMode??"single",i=t.value??"";if(e==="multiple")return{mode:e,multipleIsos:Zt(i)};if(e==="range"){let r=Me(i);if(t.rangeDraft?.anchor){let s=t.rangeDraft.hover??t.rangeDraft.anchor;return{mode:e,range:JI(t.rangeDraft.anchor,s)}}return{mode:e,range:r}}return{mode:e,singleIso:i||void 0}}function JI(t,e){return t.localeCompare(e)<=0?{start:t,end:e}:{start:e,end:t}}function uo(t,e,i){let r=Sr(i.locale),s=YI(i.today??new Date),d=QI(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 G=Ze(S),V=so(G,d.mode,{singleIso:d.singleIso,multipleIsos:d.multipleIsos,range:d.range});T.push({date:new Date(S),iso:G,inMonth:S.getMonth()===e,isToday:XI(S,s),isSelected:V.isSelected,isDisabled:!ft(G,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 Er(t,e,i){let r=new Date(t,e+i,1);return{year:r.getFullYear(),month:r.getMonth()}}function co(t,e,i){let r=Math.max(1,Math.min(i,12));return Array.from({length:r},(s,d)=>{let h=Er(t,e,d);return{year:h.year,month:h.month,offset:d}})}var nl=new Map;function ZI(t,e){return`${JSON.stringify(t??null)}|${JSON.stringify(e)}`}function Vt(t,e){let i=ZI(t,e),r=nl.get(i);if(r)return r;let s=new Intl.DateTimeFormat(t,e);return nl.set(i,s),s}function ho(t,e){return Vt(e,{month:"long",year:"numeric"}).format(t)}function fo(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 po(t){return new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(0,"day")}var eC={0:"digit",a:"letter","*":"any"},tC=/\p{L}/u;function iC(t,e){let i=e?.[t];if(i instanceof RegExp)return{kind:"any",pattern:i};if(i)return{kind:i};let r=eC[t];return r?{kind:r}:null}function ol(t,e,i){return i?i.test(t):e==="digit"?/\d/.test(t):e==="letter"?tC.test(t):t.length>0}function al(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=rC(t,s+1);if(a<0){r.push({type:"literal",value:"["}),s+=1;continue}let E=al(t.slice(s+1,a),e,!0);r.push(...E),s=a+1;continue}if(d==="]")break;let h=iC(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 rC(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 mo(t,e){return al(t,e)}function sl(t,e={}){return t.filter(i=>i.type==="input"&&(!e.requiredOnly||!i.optional)).length}function go(t,e){let i=mo(t,e),r="";for(let s of i){if(s.type==="literal"||s.type==="fixed"){r+=s.value;continue}r+="_"}return r}function ll(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];ol(d,s.kind,s.pattern)&&(i+=d,r+=1)}return i}function ul(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(!ol(d,s.kind,s.pattern)){if(s.optional)continue;break}r+=d,i+=1}return r}function nC(t){return t.every(e=>e.type!=="input"||e.kind==="digit")}function oC(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 bo(t,e,i){let r=mo(e,i),s=sl(r),d=ll(t,r);return d.length===0&&/\S/.test(t)&&nC(r)&&(d=oC(t,r)),d.length>s&&(d=d.slice(0,s)),ul(d,r)}var aC=new Date(2e3,0,1);function sC(t,e){return t==="year"?e==="year":t==="month"?e==="year"||e==="month":!0}function lC(t,e){let r=Vt(e,{[t]:t==="year"?"numeric":"2-digit"}).formatToParts(aC).find(s=>s.type===t);return r?r.value.replace(/\d/g,t==="year"?"y":t==="month"?"m":"d"):t==="year"?"yyyy":"mm"}function uC(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 Rr(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(!sC(r,a))return null;let E=t!=null;return{type:a,value:E?uC(a,t,e):"",placeholder:lC(a,e),isPlaceholder:!E,editable:!0}}).filter(h=>h!=null)}function cC(t){if(t.isPlaceholder||t.value==="")return null;let e=Number(t.value);return Number.isFinite(e)?e:null}function dC(t){return t>=100?t:t>=69?1900+t:2e3+t}function cl(t){let e={};for(let r of t){if(!r.editable)continue;let s=cC(r);if(s==null)return null;e[r.type]=r.type==="year"?dC(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 dl(t){return t.every(e=>!e.editable||e.isPlaceholder||e.value==="")}function vo(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(dl(t))return{kind:"empty"};let r=cl(t);if(!r)return{kind:"incomplete"};let s=Ze(r);return ft(s,e.min,e.max)?{kind:"date",iso:s}:{kind:"out-of-range"}}function yo(t){return t==="year"?4:2}function hC(t,e){return t.findIndex(i=>i.editable&&i.type===e)}function fC(t){return t.map(e=>({...e}))}function xo(t,e,i){let r=fC(t),s=hC(r,e);return s<0||(r[s]={...r[s],...i}),r}function _o(t){if(t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function Ar(t,e){return{min:1,max:fl(t,e)}}function fl(t,e){if(t==="month")return 12;if(t==="day"){let i=hl(e,"year"),r=hl(e,"month");return i!=null&&r!=null?new Date(i,r,0).getDate():31}return 9999}function hl(t,e){let i=t.find(r=>r.editable&&r.type===e);return!i||i.isPlaceholder||i.value===""?null:Number(i.value)}function pl(t,e){return t==="year"?String(e).padStart(4,"0"):String(e).padStart(2,"0")}function wo(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 Ii(t){return t.isPlaceholder||t.value===""?t.placeholder:t.value}function Ir(t){return t.isPlaceholder||t.value===""?null:_o(t.value.replace(/\D/g,""))}function ml(t,e){return xo(t,e,{value:"",isPlaceholder:!0})}function gl(t,e,i){return xo(t,e,{value:pl(e,i),isPlaceholder:!1})}function To(t,e,i){let r=t.find(E=>E.editable&&E.type===e);if(!r)return t;let{min:s,max:d}=Ar(e,t),a=(Ir(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),gl(t,e,a)}function So(t,e,i,r){let s=i.replace(/\D/g,"");if(!s)return{segments:t,enteredKeys:r,focusNext:!1};let d=r+s,h=_o(d);if(h==null)return{segments:t,enteredKeys:r,focusNext:!1};let a=fl(e,t),E=h;E>a&&(E=_o(s)??E);let A=yo(e),S=+`${E}0`>a||d.length>=A||String(E).length>=A,I=S?pl(e,E):String(E);return{segments:xo(t,e,{value:I,isPlaceholder:!1}),enteredKeys:S?"":d,focusNext:S}}function bl(t){return t.filter(e=>e.editable).map(e=>e.type)}function ei(t,e,i){let r=bl(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 Eo(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 Ro(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:ml(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 vl,yl,_l,xl,wl,Tl,Sl,El,Rl,Al,Il,Cl,Dl,Ol,Vl,kl,Ml,Ll,Pl,jl,Fl,Bl,Ul,zl,ql,Kl,Gl,$l,Wl,Hl,Nl,Yl,Xl,Ql,Jl,Zl;function pC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:eu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||eu(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:mC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return bC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function mC(t){var e=gC(t,"string");return typeof e=="symbol"?e:e+""}function gC(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 eu(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 bC(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 Mt,iu=class extends tu{static{({e:[_l,xl,wl,Tl,Sl,El,Rl,Al,Il,Cl,Dl,Ol,Vl,kl,Ml,Ll,Pl,jl,Fl,Bl,Ul,zl,ql,Kl,Gl,$l,Wl,Hl,Nl,Yl,Xl,Ql,Jl,Zl,vl],c:[Mt,yl]}=pC(this,[vC("rui-calendar")],[[pt({type:String,reflect:!0,defaultValue:""}),0,"value"],[pt({type:String,defaultValue:""}),0,"min"],[pt({type:String,defaultValue:""}),0,"max"],[pt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[pt({type:String,defaultValue:""}),0,"locale"],[pt({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[pt({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[pt({type:String,attribute:"page-behavior",defaultValue:"visible"}),0,"pageBehavior"],[yC({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"],[_C(["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,tu))}value=(vl(this),_l(this));min=(xl(this),wl(this));max=(Tl(this),Sl(this));disabled=(El(this),Rl(this));locale=(Al(this),Il(this));selectionMode=(Cl(this),Dl(this));visibleMonths=(Ol(this),Vl(this));pageBehavior=(kl(this),Ml(this));changeEvent=(Ll(this),Pl(this));viewYear=(jl(this),Fl(this,new Date().getFullYear()));viewMonth=(Bl(this),Ul(this,new Date().getMonth()));focusedIso=(zl(this),ql(this,""));weekdayLabels=(Kl(this),Gl(this,[]));monthPanels=($l(this),Wl(this,[]));todayLabel=(Hl(this),Nl(this,""));rangeAnchor=(Yl(this),Xl(this,null));rangeHover=(Ql(this),Jl(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"?Zt(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=fo(this.resolvedLocale,Sr(this.resolvedLocale)),this.monthPanels=co(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:ho(i,this.resolvedLocale),weeks:uo(e.year,e.month,this.monthOptions)}}),this.todayLabel=po(this.resolvedLocale)}moveMonth(e){let i=Er(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=oo(ao(Zt(this.value),e));i!==this.value&&(this.value=i,this.emitChange(i),this.refreshGrid())}selectRange(e){if(!this.isIsoAllowed(e))return;let i=lo(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=Jt(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(),Zl(this),xC(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 Ao("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)=>Ao("div",{class:"rui-calendar__month-panel","data-calendar-month-panel":!0,children:[Ao("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{yl()}};import{RadiantElement as Ku,bindTo as DC,customElement as OC,onEvent as Ae,onUpdated as Vo,prop as Se,query as Or}from"@ecopages/radiant";var wC=/^[A-Za-z][A-Za-z0-9_-]*$/;function ru(t){return wC.test(t)}function TC(t){let e=t.trim();if(ru(e))return e;let i=`rui-${e}`;return e&&ru(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`${TC(t)}-${e}`}var Cr=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 SC(t,e,i=48){return Math.abs(t)<i||Math.abs(t)<=Math.abs(e)?null:t<0?"next":"prev"}var Dr=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,SC(i,r)}onPointerCancel(e){this.pointerId===e.pointerId&&(this.pointerId=null)}};function Lt(t){return!Number.isFinite(t)||t<1?1:t}function nu(t){return!Number.isFinite(t)||t<1?1:Math.floor(t)}function Io(t,e){return t<=0?0:Math.max(0,t-Math.floor(Lt(e)))}function Co(t,e,i){if(e<=0||!Number.isFinite(t))return 0;let r=Io(e,i);return Math.min(Math.max(Math.trunc(t),0),r)}function EC(t,e,i){let r=Lt(i),s=Co(t,e,r);return Math.min(s,Math.max(0,e-r))}function Do(t,e,i,r){let s=Lt(r),d=EC(e,i,s);return t+1>d&&t<d+s}function Ci(t,e){return Lt(e)>1?"window":t==="fade"?"stack":t==="slide"?"window":"swap"}function Di(t){return Lt(t)>1?"cards":"shell"}function ou(t){let e=Lt(t);return e<=1?0:Math.ceil(e)-1}function Oo(t){let e=Lt(t.slidesPerView),i=nu(t.slidesPerGroup),r=Co(t.index,t.count,e),s=Io(t.count,e);return{index:r,slidesPerView:e,slidesPerGroup:i,maxStartIndex:s,canGoPrev:t.wrap||r>0,canGoNext:t.wrap||r<s}}function Oi(t,e){let i=nu(t.slidesPerGroup),r=Math.trunc(t.index)+e*i,s=Io(t.count,t.slidesPerView);return t.wrap?s<=0||r>s?0:r<0?s:r:Co(r,t.count,t.slidesPerView)}var au,su,lu,uu,cu,du,hu,fu,pu,mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su,Eu,Ru,Au,Iu,Cu,Du,Ou,Vu,ku,Mu,Lu,Pu,ju,Fu,Bu,Uu,zu;function RC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:qu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||qu(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:AC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return CC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function AC(t){var e=IC(t,"string");return typeof e=="symbol"?e:e+""}function IC(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 qu(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 CC(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},Vr,Gu=class extends Ku{static{({e:[lu,uu,cu,du,hu,fu,pu,mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su,Eu,Ru,Au,Iu,Cu,Du,Ou,Vu,ku,Mu,Lu,Pu,ju,Fu,Bu,Uu,zu,au],c:[Vr,su]}=RC(this,[OC("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"}),DC({ref:"root",attr:"data-carousel-surface",map:e=>Di(e)})],0,"slidesPerView"],[Se({type:Number,defaultValue:Le.slidesPerGroup,attribute:"slides-per-group"}),0,"slidesPerGroup"],[Se({type:Number,defaultValue:0}),0,"slideCount"],[Or({ref:"root"}),0,"rootTarget"],[Or({ref:"track"}),0,"trackTarget"],[Or({ref:"indicators"}),0,"indicatorsTarget"],[Or({ref:"viewport"}),0,"viewportTarget"],[Vo(["index","transition","loop","wrap","controlsVariant","slidesPerView","slidesPerGroup"]),2,"onSlideStateUpdated"],[Vo(["autoplay","showRotationControl","interval"]),2,"onAutoplayUpdated"],[Vo(["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,Ku))}label=(au(this),lu(this));index=(uu(this),cu(this));autoplay=(du(this),hu(this));interval=(fu(this),pu(this));transition=(mu(this),gu(this));controlsVariant=(bu(this),vu(this));showIndicators=(yu(this),_u(this));showRotationControl=(xu(this),wu(this));loop=(Tu(this),Su(this));wrap=(Eu(this),Ru(this));slidesPerView=(Au(this),Iu(this));slidesPerGroup=(Cu(this),Du(this));slideCount=(Ou(this),Vu(this));rootTarget=(ku(this),Mu(this));trackTarget=(Lu(this),Pu(this));indicatorsTarget=(ju(this),Fu(this));viewportTarget=(Bu(this),Uu(this));paused=(zu(this),!1);uid=re("rui-carousel");userOverrideReducedMotion=!1;swipe=new Dr;autoplayController=new Cr({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 Oo(this.windowParams(e))}trackMode(){return Ci(this.transition,this.slidesPerView)}syncSlideAccessibility(e,i,r){let s=e.length,d=this.trackMode();e.forEach((h,a)=>{let E=a===i,A=Do(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(ou(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)=>Do(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(Oi(this.windowParams(e.length),1))}syncAutoplay(){this.autoplayController.sync(),this.syncRotationControl(),this.syncAriaLive()}goTo(e){let i=this.getSlides();i.length&&(this.index=Oo(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(Oi(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=Oi({...this.windowParams(i.length,s),slidesPerGroup:1},1);else if(e.key==="ArrowLeft")s=Oi({...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{su()}};import{jsx as oe,jsxs as Pt}from"@ecopages/jsx/jsx-runtime";function $u({id:t,children:e,class:i,...r}){return oe("div",{...r,class:j("rui-carousel__slide",i),"data-slide":t,children:e})}function VC(){return Pt("span",{class:"rui-carousel__nav-label",children:[oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})}function kC(){return Pt("span",{class:"rui-carousel__nav-label",children:["Next",oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})}function Wu({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"}):VC())})}function Hu({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"}):kC())})}function Nu({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 MC({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(Wu,{overlay:I}),G=s??oe(Hu,{overlay:I}),V=T?h??oe(Nu,{overlay:I}):null,$=Ci(S,A),W=Di(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,_=Pt("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:G})]}),H=I?Pt("div",{class:"rui-carousel__overlay-chrome",children:[T?oe("div",{class:"rui-carousel__overlay-rotation",children:V}):null,Pt("div",{class:"rui-carousel__controls rui-carousel__controls--overlay",children:[K,G]}),O]}):null;return Pt("section",{class:j("rui-carousel",`rui-carousel--${S}`,`rui-carousel--controls-${i}`),"data-ref":"root","data-carousel-track":$,"data-carousel-surface":W,"aria-roledescription":"carousel","aria-label":r,children:[oe("div",{class:"rui-carousel__stage",children:Pt("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 LC({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 G=t??[],V=t!=null?G.map($=>oe($u,{id:$.id,children:$.children})):e;return oe(Vr,{...K,label:d,transition:h,controlsVariant:a,showIndicators:E,showRotationControl:A,autoplay:S,slidesPerView:I,slidesPerGroup:T,slideCount:G.length,children:oe(MC,{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 cc,bindTo as Vi,customElement as UC,event as zC,onEvent as qC,prop as ki}from"@ecopages/radiant";function gt(t){return t||void 0}var Yu,Xu,Qu,Ju,Zu,ec,tc,ic,rc,nc,oc,ac,sc,lc;function PC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:uc(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||uc(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:jC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return BC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function jC(t){var e=FC(t,"string");return typeof e=="symbol"?e:e+""}function FC(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 uc(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 BC(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="on",ti,dc=class extends cc{static{({e:[Qu,Ju,Zu,ec,tc,ic,rc,nc,oc,ac,sc,lc,Yu],c:[ti,Xu]}=PC(this,[UC("rui-checkbox")],[[[ki({type:Boolean,reflect:!0,defaultValue:!1}),Vi({ref:"input",prop:"checked"})],0,"checked"],[[ki({type:Boolean,reflect:!0,defaultValue:!1}),Vi([{ref:"input",prop:"indeterminate"},{ref:"input",attr:"aria-checked",map:e=>e?"mixed":void 0}])],0,"indeterminate"],[[ki({type:Boolean,reflect:!0,defaultValue:!1}),Vi({ref:"input",prop:"disabled"})],0,"disabled"],[[ki({type:String,defaultValue:ko}),Vi({ref:"input",prop:"value"})],0,"value"],[[ki({type:String,defaultValue:""}),Vi({ref:"input",attr:"name",map:gt})],0,"name"],[zC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[qC({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,cc))}constructor(...e){super(...e),lc(this)}checked=(Yu(this),Qu(this));indeterminate=(Ju(this),Zu(this));disabled=(ec(this),tc(this));value=(ic(this),rc(this));name=(nc(this),oc(this));changeEvent=(ac(this),sc(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{Xu()}};import{jsx as kr,jsxs as KC}from"@ecopages/jsx/jsx-runtime";function Mi({children:t,checked:e,disabled:i,indeterminate:r,name:s,value:d=ko,...h}){return kr(ti,{...h,checked:e,disabled:i,indeterminate:r,name:s,value:d,"data-disabled":i?"":void 0,children:KC("label",{class:"rui-checkbox",children:[kr("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}),kr("span",{class:"rui-checkbox__control","aria-hidden":"true"}),kr("span",{class:"rui-checkbox__label",children:t})]})})}import{RadiantElement as Dc,bindTo as Mo,customElement as XC,event as QC,onEvent as JC,onUpdated as ZC,prop as Li}from"@ecopages/radiant";function hc(t){return t?pc(t.split(",")):[]}function GC(t){return t.join(",")}var Mr={fromAttribute:t=>hc(t),toAttribute:t=>t.length>0?GC(t):null,fromProperty:t=>Array.isArray(t)?pc(t.map(String)):typeof t=="string"?hc(t):[]},Ie={type:Array,reflect:!0,transform:Mr};function et(t){return Mr.fromProperty?.(t)??[]}function fc(t){return t?t.split(",").map(e=>Number(e.trim())).filter(e=>Number.isFinite(e)):[]}function $C(t){return t.join(",")}var Lr={fromAttribute:t=>fc(t),toAttribute:t=>t.length>0?$C(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"?fc(t):[]};function pc(t){return[...new Set(t.map(e=>e.trim()).filter(Boolean))]}var mc,gc,bc,vc,yc,_c,xc,wc,Tc,Sc,Ec,Rc,Ac,Ic;function WC(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Cc(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Cc(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:HC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return YC(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function HC(t){var e=NC(t,"string");return typeof e=="symbol"?e:e+""}function NC(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 Cc(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 YC(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 Pr,Oc=class extends Dc{static{({e:[bc,vc,yc,_c,xc,wc,Tc,Sc,Ec,Rc,Ac,Ic,mc],c:[Pr,gc]}=WC(this,[XC("rui-checkbox-group")],[[Li({...Ie,defaultValue:[]}),0,"value"],[Li({type:String,defaultValue:""}),0,"name"],[[Li({type:String,defaultValue:""}),Mo({selector:"[data-checkbox-group-root]",attr:"aria-label",map:gt})],0,"label"],[[Li({type:Boolean,reflect:!0,defaultValue:!1}),Mo({selector:"[data-checkbox-group-root]",attr:"aria-disabled",map:e=>e?"true":void 0})],0,"disabled"],[[Li({type:String,reflect:!0,defaultValue:"vertical"}),Mo({selector:"[data-checkbox-group-root]",attr:"data-orientation"})],0,"orientation"],[QC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[ZC(["value","name","disabled"]),2,"syncCheckboxes"],[JC({selector:"rui-checkbox",type:"rui-change"}),2,"onCheckboxChange"]],0,void 0,Dc))}constructor(...e){super(...e),Ic(this)}value=(mc(this),bc(this));name=(vc(this),yc(this));label=(_c(this),xc(this));disabled=(wc(this),Tc(this));orientation=(Sc(this),Ec(this));changeEvent=(Rc(this),Ac(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 ti)}static{gc()}};import{jsx as jr}from"@ecopages/jsx/jsx-runtime";function Vc({children:t,class:e,orientation:i="vertical",...r}){return jr("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 eD({options:t,children:e,value:i,orientation:r="vertical",...s}){let d=et(i),h=new Set(d);return jr(Pr,{...s,value:d,orientation:r,children:t==null?e:jr(Vc,{orientation:r,children:t.map(a=>jr(Mi,{value:a.value,disabled:a.disabled,checked:h.has(a.value),children:a.label}))})})}import{jsx as tD}from"@ecopages/jsx/jsx-runtime";function iD({children:t,variant:e="default",class:i,...r}){return tD("span",{...r,class:j("rui-chip",`rui-chip--${e}`,i),children:t})}import{jsx as kc}from"@ecopages/jsx/jsx-runtime";function rD({children:t,class:e,...i}){return kc("ul",{...i,class:j("rui-chip-list",e),children:t})}function nD({children:t,class:e,...i}){return kc("li",{...i,class:j("rui-chip-list__item",e),children:t})}import{RadiantElement as ud,bindTo as yD,customElement as _D,event as xD,onEvent as Pe,onUpdated as wD,prop as Ft,query as TD}from"@ecopages/radiant";function Pi(t){let e=t.previousElementSibling;return e?.tagName.toLowerCase()==="label"?e:t.parentElement?.querySelector("[data-rui-field-label]")??null}function Lo(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=Pi(t);if(r){Lo(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 oD="data-listbox-option-indicator";function jt(t){let e=t.getAttribute("data-label");return e||Mc(t).trim()}function Ce(t){return t.getAttribute("data-value")||jt(t)}function Mc(t){if(aD(t))return"";if(t.nodeType===Node.TEXT_NODE)return t.textContent??"";let e="";for(let i of t.childNodes)e+=Mc(i);return e}function aD(t){return t instanceof HTMLElement&&t.hasAttribute(oD)}var ii=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:jt(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?jt(i):e}};var sD={top:"bottom",bottom:"top",left:"right",right:"left"},lD=8,Po=new WeakMap;function uD(t){Po.has(t)&&(t.style.width="",t.style.minWidth="",t.style.maxWidth="",t.style.boxSizing="",Po.delete(t))}function cD(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 jc(t){return t==="top"||t==="bottom"?"y":"x"}function Lc(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 jc(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 dD(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 Pc(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 hD(t,e){return e==="center"?t:`${t}-${e}`}function fD(t,e,i,r){let{padding:s,width:d,height:h}=r;if(jc(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 pD(t,e,i,r,s={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:lD}){let{side:d,align:h}=cD(i),a=Lc(t,e,d,h,r),E=dD(a,e,d,s),A=d,S=a;if(E>0){let I=sD[d],T=Lc(t,e,I,h,r),K=Pc(t,e,d,s);Pc(t,e,I,s)>K&&(A=I,S=T)}return{coords:fD(S,e,A,s),placement:hD(A,h)}}function jo(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",Po.set(e,!0)):uD(e);let{coords:E,placement:A}=pD(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 Fr({anchor:t,floating:e,getPlacement:i,gap:r,matchAnchorWidth:s}){let d=()=>{e.hidden||jo(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 Fc(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 Fo(t,e,i){return i?!!(t?.contains(i)||e?.contains(i)):!1}function tt(t,e,i){return i instanceof Node?!Fo(t,e,i):!0}function Ke(t,e,i){return!Fo(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=Fc(e,this.config.portalContainer??document.body)):this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null),this.teardownFloating(),this.cleanupFloating=Fr({anchor:r,floating:e,getPlacement:this.config.getPlacement,gap:this.config.gap??8,matchAnchorWidth:this.config.matchAnchorWidth})}contains(e){return Fo(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 Bc(t){return t.filter(e=>!e.hidden&&e.getAttribute("aria-disabled")!=="true")}function Uc(t,e,i){return i===0?-1:e===1?t>=i-1?0:t+1:t<=0?i-1:t-1}function Bo(t,e){e?.removeAttribute("aria-activedescendant");for(let i of t)i.removeAttribute("data-active")}function zc(t,e,i,r,s){Bo(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 ri=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 Bc(this.config.getOptions())}clearActiveOption(){this.activeIndex=-1,this.visualFocus=!1,Bo(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,zc(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(Uc(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 qc,Kc,Gc,$c,Wc,Hc,Nc,Yc,Xc,Qc,Jc,Zc,ed,td,id,rd,nd,od,ad,sd;function mD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:ld(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ld(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:gD(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||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function gD(t){var e=bD(t,"string");return typeof e=="symbol"?e:e+""}function bD(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 ld(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 ji,cd=class extends ud{static{({e:[Gc,$c,Wc,Hc,Nc,Yc,Xc,Qc,Jc,Zc,ed,td,id,rd,nd,od,ad,sd,qc],c:[ji,Kc]}=mD(this,[_D("rui-combobox")],[[Ft({...Ie,defaultValue:[]}),0,"value"],[Ft({type:String,defaultValue:""}),0,"label"],[Ft({type:String,defaultValue:""}),0,"placeholder"],[[Ft({type:Boolean,reflect:!0,defaultValue:!1}),yD({selector:"[data-combobox-clear]",prop:"disabled"})],0,"disabled"],[Ft({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[Ft({type:Boolean,attribute:"should-close-on-select"}),0,"shouldCloseOnSelect"],[Ft({type:String,attribute:"trigger-kind",reflect:!0,defaultValue:"input"}),0,"triggerKind"],[xD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[TD({ref:"root"}),0,"rootTarget"],[wD(["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,ud))}constructor(...e){super(...e),sd(this)}value=(qc(this),Gc(this));label=($c(this),Wc(this));placeholder=(Hc(this),Nc(this));disabled=(Yc(this),Xc(this));selectionMode=(Qc(this),Jc(this));shouldCloseOnSelect=(Zc(this),ed(this));triggerKind=(td(this),id(this));changeEvent=(rd(this),nd(this));open=(od(this),!1);uid=re("rui-combobox");collection=new ii({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 ri({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.collection.getOptions(),getActiveDescendantHost:()=>this.getInput(),getOptionIdPrefix:()=>`${this.uid}-option`});rootTarget=ad(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 Pi(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=xr(jt(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=jt(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{Kc()}};import{jsx as ae,jsxs as qo}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Id,bindTo as CD,customElement as DD,event as OD,onEvent as Cd,onUpdated as VD,prop as oi}from"@ecopages/radiant";function ue(t,e){t.forEach((i,r)=>{let s=r===e?0:-1;i.tabIndex!==s&&(i.tabIndex=s)})}function ni(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 SD(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=SD(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=ni(e,E);return A?{handled:!0,index:E,item:A}:{handled:!1}}var dd,hd,fd,pd,md,gd,bd,vd,yd,_d,xd,wd,Td,Sd,Ed,Rd;function ED(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Ad(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ad(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:RD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ID(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function RD(t){var e=AD(t,"string");return typeof e=="symbol"?e:e+""}function AD(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 Ad(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 ID(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,Dd=class extends Id{static{({e:[fd,pd,md,gd,bd,vd,yd,_d,xd,wd,Td,Sd,Ed,Rd,dd],c:[Br,hd]}=ED(this,[DD("rui-listbox")],[[oi({...Ie,defaultValue:[]}),0,"value"],[oi({type:String,defaultValue:""}),0,"label"],[oi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[[oi({type:String,attribute:"selection-mode",defaultValue:"single"}),CD({selector:'[role="listbox"]',attr:"aria-multiselectable",map:e=>e==="multiple"?"true":void 0})],0,"selectionMode"],[oi({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[oi({type:Boolean,reflect:!0}),0,"bordered"],[OD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[VD(["value","label","disabled","embedded","selectionMode"]),2,"onPropsUpdated"],[Cd({selector:'[role="option"]',type:"click"}),2,"onOptionClick"],[Cd({selector:'[role="option"]',type:"keydown"}),2,"onOptionKeydown"]],0,void 0,Id))}value=(dd(this),fd(this));label=(pd(this),md(this));disabled=(gd(this),bd(this));selectionMode=(vd(this),yd(this));embedded=(_d(this),xd(this));bordered=(wd(this),Td(this));changeEvent=(Sd(this),Ed(this));uid=(Rd(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{hd()}};import{jsx as Bt,jsxs as kD}from"@ecopages/jsx/jsx-runtime";function Uo({value:t,label:e,children:i,class:r,disabled:s,...d}){return Bt("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 Od({children:t,class:e,...i}){return Bt("span",{...i,"data-listbox-option-indicator":!0,"aria-hidden":"true",class:j("rui-listbox__option-indicator",e),children:t??Bt(Ai,{})})}function MD(t,e){return e??!t}function LD({bordered:t,children:e,disabled:i,embedded:r,label:s,selectionMode:d="single"}){return Bt("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 ai({options:t,children:e,value:i,embedded:r,bordered:s,label:d,disabled:h,selectionMode:a="single",...E}){let A=MD(r,s),S=et(i),I=new Set(S);return Bt(Br,{...E,value:S,embedded:r,bordered:s,label:d,disabled:h,selectionMode:a,children:Bt(LD,{bordered:A,disabled:h,embedded:r,label:d,selectionMode:a,children:t!=null?t.map(T=>kD(Uo,{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"?Bt(Od,{}):null]})):e})})}import{RadiantElement as Qd,customElement as UD,event as Jd,onEvent as zo,onUpdated as zD,prop as Fi,state as qD}from"@ecopages/radiant";var Vd,kd,Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd,Gd,$d,Wd,Hd,Nd,Yd;function PD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Xd(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Xd(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:jD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return BD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function jD(t){var e=FD(t,"string");return typeof e=="symbol"?e:e+""}function FD(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 Xd(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 BD(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 Bi,Zd=class extends Qd{static{({e:[Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd,Gd,$d,Wd,Hd,Nd,Yd,Vd],c:[Bi,kd]}=PD(this,[UD("rui-tag-group")],[[Fi({...Ie,defaultValue:[]}),0,"value"],[Fi({type:String,defaultValue:""}),0,"label"],[Fi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Fi({type:String,attribute:"selection-mode",defaultValue:"multiple"}),0,"selectionMode"],[Fi({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[Jd({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Jd({name:"rui-remove",bubbles:!0,composed:!0}),0,"removeEvent"],[qD,0,"derivedItems"],[zD(["value","label","disabled","selectionMode","embedded","derivedItems"]),2,"onPropsUpdated"],[zo({selector:"[data-tag]",type:"click"}),2,"onTagClick"],[zo({selector:"[data-tag-remove]",type:"click"}),2,"onRemoveClick"],[zo({selector:"[data-tag]",type:"keydown"}),2,"onTagKeydown"]],0,void 0,Qd))}constructor(...e){super(...e),Yd(this)}value=(Vd(this),Md(this));label=(Ld(this),Pd(this));disabled=(jd(this),Fd(this));selectionMode=(Bd(this),Ud(this));embedded=(zd(this),qd(this));changeEvent=(Kd(this),Gd(this));removeEvent=($d(this),Wd(this));uid=(Hd(this),re("rui-tag-group"));derivedItems=Nd(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(vr()),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{kd()}};import{jsx as je,jsxs as KD}from"@ecopages/jsx/jsx-runtime";function th({children:t,class:e,...i}){return je("div",{...i,"data-tag-list":!0,class:j("rui-tag-group__list",e),children:t})}function ih({value:t,label:e,children:i,class:r,disabled:s,aria:d,...h}){return KD("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(rh,{})]})}function rh({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 eh({children:t}){return je("div",{class:"rui-tag-group","data-ref":"root",children:t})}function Ui({tags:t,children:e,value:i,...r}){return t!=null?je(Bi,{...r,value:i,children:je(eh,{children:je(th,{children:t.map(s=>je(ih,{value:s.value,label:typeof s.label=="string"?s.label:void 0,disabled:s.disabled,children:s.label}))})})}):je(Bi,{...r,value:i,children:je(eh,{children:e})})}function oh({children:t,class:e,...i}){return ae("div",{...i,class:j("rui-combobox__control",e),children:t})}function ah({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 sh({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 GD({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 lh({children:t,class:e,...i}){return ae("span",{...i,"data-combobox-value":!0,class:j("rui-combobox__value",e),children:t})}function uh({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 nh({children:t}){return ae("div",{class:"rui-combobox","data-ref":"root",children:t})}function $D({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(ji,{...r,value:s,children:qo(nh,{children:[qo(oh,{children:[h?ae(lh,{children:ae(Ui,{tags:d??[],label:"Selected options"})}):null,ae(ah,{placeholder:r.placeholder,disabled:r.disabled}),ae(sh,{})]}),ae(uh,{children:ae(ro,{children:qo(to,{children:[ae(ai,{embedded:!0,options:t,selectionMode:r.selectionMode,value:s}),ae(io,{children:"No results found."})]})})})]})}):ae(ji,{...r,value:s,children:ae(nh,{children:e})})}import{RadiantElement as Eh,bindTo as XD,customElement as QD,event as JD,onEvent as ZD,onUpdated as e1,prop as zi}from"@ecopages/radiant";function Ko(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 ch,dh,hh,fh,ph,mh,gh,bh,vh,yh,_h,xh,wh,Th;function WD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Sh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Sh(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:HD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return YD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function HD(t){var e=ND(t,"string");return typeof e=="symbol"?e:e+""}function ND(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 Sh(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 YD(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 t1="[data-cycle-value]",Go="button[data-cycle-toggle-button]",Ur,Rh=class extends Eh{static{({e:[hh,fh,ph,mh,gh,bh,vh,yh,_h,xh,wh,Th,ch],c:[Ur,dh]}=WD(this,[QD("rui-cycle-toggle")],[[zi({type:String,reflect:!0,defaultValue:""}),0,"value"],[zi({type:String,reflect:!0,defaultValue:"filled"}),0,"variant"],[zi({type:String,reflect:!0,defaultValue:"md"}),0,"size"],[zi({type:String,defaultValue:""}),0,"label"],[[zi({type:Boolean,reflect:!0,defaultValue:!1}),XD({selector:"button[data-cycle-toggle-button]",prop:"disabled"})],0,"disabled"],[JD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[e1(["value","label","disabled","size","variant"]),2,"onPropsUpdated"],[ZD({selector:Go,type:"click"}),2,"onButtonClick"]],0,void 0,Eh))}value=(ch(this),hh(this));variant=(fh(this),ph(this));size=(mh(this),gh(this));label=(bh(this),vh(this));disabled=(yh(this),_h(this));changeEvent=(xh(this),wh(this));childObserver=(Th(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(t1))}getEnabledItems(){return this.getItems().filter(e=>e.getAttribute("aria-disabled")!=="true")}getItemValue(e){return e?e.dataset.cycleValue??"":""}syncButtonLabel(e){let i=this.querySelector(Go);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(Go);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=Ko(i,this.value||void 0);r!==this.value&&(this.syncSelection(r),this.changeEvent.emit({value:this.value}))}onButtonClick(){this.cycle()}static{dh()}};import{jsx as zr}from"@ecopages/jsx/jsx-runtime";function i1({id:t,children:e,class:i,disabled:r,selected:s,...d}){return zr("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 Ah({children:t,variant:e="filled",size:i="md",disabled:r,class:s,...d}){return zr("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 r1({children:t,variant:e,size:i,disabled:r,...s}){return zr(Ur,{...s,variant:e,size:i,disabled:r,children:zr(Ah,{variant:e,size:i,disabled:r,children:t})})}import{jsx as ge,jsxs as Wo}from"@ecopages/jsx/jsx-runtime";var Ih={system:"System",light:"Light",dark:"Dark"},$o={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},n1={system:Wo("svg",{...$o,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:Wo("svg",{...$o,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",{...$o,children:ge("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"})})};function Ch({preference:t}){return n1[t]}function Dh({preference:t}){return Ih[t]}function o1({preference:t,showLabel:e=!0}){return Wo("span",{class:"inline-flex items-center gap-inline","aria-label":e?void 0:Ih[t],children:[ge(Ch,{preference:t}),e?ge(Dh,{preference:t}):void 0]})}import{RadiantElement as of,bindTo as bt,customElement as f1,event as p1,onEvent as vt,onUpdated as af,prop as it,query as m1,state as g1}from"@ecopages/radiant";function s1(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(`(max-width: ${639}px)`).matches}function qr(t){return t<=1||!s1()?t:1}function Kr(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 si=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(){l1(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 l1(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 Oh,Vh,kh,Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,Gh,$h,Wh,Hh,Nh,Yh,Xh,Qh,Jh,Zh,ef,tf,rf;function u1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:nf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||nf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:c1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return h1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function c1(t){var e=d1(t,"string");return typeof e=="symbol"?e:e+""}function d1(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 nf(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 h1(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 Gr,sf=class extends of{static{({e:[kh,Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,Gh,$h,Wh,Hh,Nh,Yh,Xh,Qh,Jh,Zh,ef,tf,rf,Oh],c:[Gr,Vh]}=u1(this,[f1("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"],[p1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[g1,bt({selector:"[data-date-field-trigger]",attr:"aria-expanded"})],0,"open"],[m1({ref:"popover"}),0,"popoverTarget"],[af(["value","min","max","label","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[af(["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,of))}value=(Oh(this),kh(this));min=(Mh(this),Lh(this));max=(Ph(this),jh(this));disabled=(Fh(this),Bh(this));readOnly=(Uh(this),zh(this));label=(qh(this),Kh(this));name=(Gh(this),$h(this));locale=(Wh(this),Hh(this));visibleMonths=(Nh(this),Yh(this));changeEvent=(Xh(this),Qh(this));open=(Jh(this),Zh(this,!1));uid=(ef(this),re("rui-date-field"));calendarPopover=new si({getHost:()=>this,getAnchor:()=>this.getToggle()?.parentElement??this,getFloating:()=>this.popoverTarget,getOpen:()=>this.open,getCalendar:()=>this.getCalendar(),getFocusIso:()=>this.isoValue||void 0});disposeMobileLayoutListener=null;popoverTarget=tf(this);onMediaChange=(rf(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(qr(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=Kr(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{Vh()}};import{Fragment as R1,jsx as De,jsxs as Mf}from"@ecopages/jsx/jsx-runtime";import{jsx as $r}from"@ecopages/jsx/jsx-runtime";import{customElement as x1,event as w1,onEvent as li,onUpdated as Df,prop as ui,registerSsrPreparationCallback as T1,state as Of}from"@ecopages/radiant";import{FormAssociatedElement as Vf}from"@ecopages/radiant/form-associated-element";function lf(t,e){let i=t.type,r=Ir(t),s=!e.useTextboxRole,d=s?"spinbutton":"textbox",h=!e.disabled&&!e.readOnly,a=Ar(i,e.segments);return{ariaLabel:wo(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?Ii(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 uf,cf,df,hf,ff,pf,mf,gf,bf,vf,yf,_f,xf,wf,Tf,Sf,Ef,Rf,Af,If;function b1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Cf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Cf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:v1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function v1(t){var e=y1(t,"string");return typeof e=="symbol"?e:e+""}function y1(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 Cf(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 _1(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 S1(){return typeof navigator>"u"?!1:/iPad|iPhone|iPod/.test(navigator.userAgent)}var Wr,kf=class extends Vf{static{({e:[df,hf,ff,pf,mf,gf,bf,vf,yf,_f,xf,wf,Tf,Sf,Ef,Rf,Af,If,uf],c:[Wr,cf]}=b1(this,[x1("rui-date-input")],[[ui({type:String,reflect:!0,defaultValue:""}),0,"value"],[ui({type:String,defaultValue:""}),0,"min"],[ui({type:String,defaultValue:""}),0,"max"],[ui({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[ui({type:String,defaultValue:""}),0,"label"],[ui({type:String,defaultValue:""}),0,"locale"],[w1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Of,0,"segments"],[Of,0,"focusedPart"],[Df(["value","locale"]),2,"syncSegmentsFromValue"],[Df("label"),2,"syncGroupLabel"],[li({selector:'[data-ref="root"]',type:"focusin"}),2,"onGroupFocusIn"],[li({selector:"[data-date-segment]",type:"focusin"}),2,"onSegmentFocusIn"],[li({selector:"[data-date-segment]",type:"focusout"}),2,"onSegmentFocusOut"],[li({selector:"[data-date-segment]",type:"keydown"}),2,"onSegmentKeyDown"],[li({selector:"[data-date-segment]",type:"beforeinput"}),2,"onSegmentBeforeInput"],[li({selector:"[data-date-segment]",type:"pointerdown"}),2,"onSegmentPointerDown"]],0,void 0,Vf))}value=(uf(this),df(this));min=(hf(this),ff(this));max=(pf(this),mf(this));readOnly=(gf(this),bf(this));label=(vf(this),yf(this));locale=(_f(this),xf(this));changeEvent=(wf(this),Tf(this));segments=(Sf(this),Ef(this,[]));focusedPart=(Rf(this),Af(this,null));uid=(If(this),re("rui-date-input"));buffer="";useTextboxRole=S1();pendingFocus=null;get resolvedLocale(){return ht(this.locale)}get isoValue(){return this.value??""}syncSegmentsFromValue(){this.segments=Rr(Dt(this.isoValue),this.resolvedLocale),this.buffer=""}get displaySegments(){return this.segments.length>0?this.segments:Rr(Dt(this.isoValue),this.resolvedLocale)}constructor(){super(),T1(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=vo(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=So(this.segments,e,i,this.buffer);if(this.segments=r.segments,this.buffer=r.enteredKeys,r.focusNext){this.focusPart(ei(this.segments,e,1));return}this.commit("edit")}handleBackspace(e){this.setFocusedPart(e);let i=Ro(this.segments,e);if(i.kind==="focus-previous"){this.focusPart(ei(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=To(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(Eo(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(ei(this.segments,i,-1));return}if(e.key==="ArrowRight"){e.preventDefault(),this.focusPart(ei(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 $r("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=lf(e,{disabled:this.effectiveDisabled,locale:this.resolvedLocale,readOnly:this.readOnly,segments:this.displaySegments,useTextboxRole:this.useTextboxRole});return $r("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:Ii(e)},r)}render(){return $r("div",{class:"rui-date-input","data-ref":"root",role:"group",children:$r("div",{class:"rui-date-input__segments",children:this.displaySegments.map((e,i)=>this.renderSegment(e,i))})})}static{cf()}};import{jsx as E1}from"@ecopages/jsx/jsx-runtime";function ci(t){return E1(Wr,{"data-rui-control":!0,"data-rui-control-type":"date","data-rui-aria-target":'[data-ref="root"]',...t})}function Lf({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 Pf({class:t,...e}){return De(ci,{...e,"data-date-field-input":!0,class:j("rui-date-field__input",t)})}function jf({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(Ri,{})})}function Ff({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 Bf(t){return De(Mt,{...t,"data-date-field-calendar":!0})}function A1(t){let{children:e,value:i,min:r,max:s,disabled:d,readOnly:h,label:a,name:E,locale:A}=t;return De(Gr,{"data-rui-aria-target":'[data-date-field-input] [data-ref="root"]',...t,children:e??Mf(R1,{children:[Mf(Lf,{children:[De(Pf,{value:i,min:r,max:s,disabled:d,readOnly:h,label:a,name:E,locale:A}),De(jf,{})]}),De(Ff,{children:De(Bf,{})})]})})}import{RadiantElement as mp,bindTo as rt,customElement as V1,event as k1,onEvent as yt,onUpdated as gp,prop as Ge,query as M1,state as L1}from"@ecopages/radiant";var Uf,zf,qf,Kf,Gf,$f,Wf,Hf,Nf,Yf,Xf,Qf,Jf,Zf,ep,tp,ip,rp,np,op,ap,sp,lp,up,cp,dp,hp,fp;function I1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:pp(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||pp(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:C1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return O1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function C1(t){var e=D1(t,"string");return typeof e=="symbol"?e:e+""}function D1(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 pp(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 O1(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 Hr,bp=class extends mp{static{({e:[qf,Kf,Gf,$f,Wf,Hf,Nf,Yf,Xf,Qf,Jf,Zf,ep,tp,ip,rp,np,op,ap,sp,lp,up,cp,dp,hp,fp,Uf],c:[Hr,zf]}=I1(this,[V1("rui-date-range-picker")],[[[Ge({type:String,reflect:!0,defaultValue:""}),rt({selector:"[data-range-calendar]",attr:"value"})],0,"value"],[[Ge({type:String,defaultValue:""}),rt([{selector:"[data-range-start]",attr:"min"},{selector:"[data-range-end]",attr:"min"},{selector:"[data-range-calendar]",attr:"min"}])],0,"min"],[[Ge({type:String,defaultValue:""}),rt([{selector:"[data-range-start]",attr:"max"},{selector:"[data-range-end]",attr:"max"},{selector:"[data-range-calendar]",attr:"max"}])],0,"max"],[[Ge({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"],[[Ge({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"],[[Ge({type:String,defaultValue:""}),rt([{selector:"[data-range-start]",attr:"locale"},{selector:"[data-range-end]",attr:"locale"},{selector:"[data-range-calendar]",attr:"locale"}])],0,"locale"],[[Ge({type:String,attribute:"start-name",defaultValue:""}),rt({selector:"[data-range-start]",attr:"name"})],0,"startName"],[[Ge({type:String,attribute:"end-name",defaultValue:""}),rt({selector:"[data-range-end]",attr:"name"})],0,"endName"],[Ge({type:String,defaultValue:""}),0,"name"],[Ge({type:Number,attribute:"visible-months",defaultValue:2}),0,"visibleMonths"],[k1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[L1,rt({selector:"[data-range-trigger]",attr:"aria-expanded"})],0,"open"],[M1({ref:"popover"}),0,"popoverTarget"],[gp(["value","min","max","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[gp(["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,mp))}value=(Uf(this),qf(this));min=(Kf(this),Gf(this));max=($f(this),Wf(this));disabled=(Hf(this),Nf(this));readOnly=(Yf(this),Xf(this));locale=(Qf(this),Jf(this));startName=(Zf(this),ep(this));endName=(tp(this),ip(this));name=(rp(this),np(this));visibleMonths=(op(this),ap(this));changeEvent=(sp(this),lp(this));open=(up(this),cp(this,!1));calendarPopover=(dp(this),new si({getHost:()=>this,getAnchor:()=>this.getToggle()?.parentElement??this,getFloating:()=>this.popoverTarget,getOpen:()=>this.open,getCalendar:()=>this.getCalendar(),getFocusIso:()=>Me(this.isoValue)?.start}));disposeMobileLayoutListener=null;popoverTarget=hp(this);onMediaChange=(fp(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&&!ft(e,r,s)||i&&!ft(i,r,s))return;let d=e&&i?Jt({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(qr(this.visibleMonths))))}initialize(){this.projectCompleteRangeOntoInputs(),this.syncToggle(),this.syncCalendar(),this.setOpen(!1)}onConnected(){this.disposeMobileLayoutListener=Kr(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?Jt({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{zf()}};import{Fragment as P1,jsx as pe,jsxs as Ho}from"@ecopages/jsx/jsx-runtime";function vp({children:t,class:e,...i}){return pe("div",{...i,class:j("rui-date-range-picker",e),children:pe("div",{class:"rui-date-range-picker__group","data-ref":"control",children:t})})}function yp({children:t,class:e,...i}){return pe("div",{...i,class:j("rui-date-range-picker__values",e),"data-ref":"values",children:t})}function _p({class:t,...e}){return pe(ci,{...e,"data-range-start":!0,class:j("rui-date-range-picker__input",t)})}function xp({class:t,...e}){return pe(ci,{...e,"data-range-end":!0,class:j("rui-date-range-picker__input",t)})}function wp({children:t="\u2013",class:e,...i}){return pe("span",{...i,class:j("rui-date-range-picker__separator",e),"aria-hidden":"true",children:t})}function Tp({children:t,class:e,aria:i,...r}){return pe("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??pe(Ri,{})})}function Sp({children:t,class:e,...i}){return pe("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 Ep(t){return pe(Mt,{...t,"data-range-calendar":!0})}function j1(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 pe(Hr,{"data-rui-aria-targets":'[data-range-start] [data-ref="root"],[data-range-end] [data-ref="root"]',...t,children:e??Ho(P1,{children:[Ho(vp,{children:[Ho(yp,{children:[pe(_p,{"aria-label":i,value:T?.start,min:d,max:h,disabled:a,readOnly:E,locale:A,name:S}),pe(wp,{}),pe(xp,{"aria-label":r,value:T?.end,min:d,max:h,disabled:a,readOnly:E,locale:A,name:I})]}),pe(Tp,{})]}),pe(Sp,{children:pe(Ep,{})})]})})}import{RadiantElement as Gp,bindTo as K1,bound as G1,customElement as $1,event as W1,onEvent as Yo,onUpdated as H1,prop as Xo,query as Qo}from"@ecopages/radiant";var Rp="a[href], button, input, select, textarea, [tabindex]";function F1(t){return!t.hasAttribute("disabled")&&t.getAttribute("tabindex")!=="-1"}function No(t){return Array.from(t.querySelectorAll(Rp)).filter(F1)}function Nr(t){return Array.from(t.querySelectorAll(Rp)).filter(e=>!e.hasAttribute("disabled"))}function di(t){return No(t)[0]}var Ap,Ip,Cp,Dp,Op,Vp,kp,Mp,Lp,Pp,jp,Fp,Bp,Up,zp,qp;function B1(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Kp(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Kp(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:U1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return q1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function U1(t){var e=z1(t,"string");return typeof e=="symbol"?e:e+""}function z1(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 Kp(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 q1(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 Ut,$p=class extends Gp{static{({e:[Cp,Dp,Op,Vp,kp,Mp,Lp,Pp,jp,Fp,Bp,Up,zp,qp,Ap],c:[Ut,Ip]}=B1(this,[$1("rui-dialog")],[[[Xo({type:Boolean,reflect:!0,defaultValue:!1}),K1({ref:"root",bool:"hidden",invert:!0})],0,"open"],[Xo({type:Boolean,reflect:!0,defaultValue:!1}),0,"alert"],[Xo({type:String,defaultValue:""}),0,"label"],[Qo({ref:"dialog"}),0,"dialogTarget"],[Qo({selector:"[data-dialog-title]"}),0,"titleTarget"],[Qo({selector:"[data-dialog-body]"}),0,"descriptionTarget"],[W1({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[G1,H1(["open","label"])],2,"syncOpenState"],[Yo({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[Yo({ref:"backdrop",type:"click"}),2,"onBackdropClick"],[Yo({selector:"[data-dialog-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Gp))}open=(Ap(this),Cp(this));alert=(Dp(this),Op(this));label=(Vp(this),kp(this));dialogTarget=(Mp(this),Lp(this));titleTarget=(Pp(this),jp(this));descriptionTarget=(Fp(this),Bp(this));closeEvent=(Up(this),zp(this));previouslyFocused=(qp(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?No(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{Ip()}};import{jsx as ve,jsxs as Hp}from"@ecopages/jsx/jsx-runtime";function Np({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 Yp({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 Xp({children:t,class:e,...i}){return ve("div",{...i,class:j("rui-dialog__actions",e),children:t})}function Qp({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 Wp({alert:t,children:e,open:i}){return Hp("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 N1({title:t,actions:e,children:i,open:r,alert:s,...d}){return t!=null||e!=null?ve(Ut,{...d,open:r,alert:s,children:Hp(Wp,{open:r,alert:s,children:[ve(Qp,{}),t!=null?ve(Np,{children:t}):null,i!=null?ve(Yp,{children:i}):null,e!=null?ve(Xp,{children:e}):null]})}):ve(Ut,{...d,open:r,alert:s,children:ve(Wp,{open:r,alert:s,children:i})})}var nt="__rui-dialog-host",Yr="rui-dialog-open",Xr="rui-dialog-close",Qr="rui-dialog-toggle",Jo="rui-dialog-action";function Jp(t){return"id"in t&&t.id!=null&&t.id!==""}var qi=!1,Jr=null,Ki=null,be=null;function ea(t){let e=t.trim();if(!e)return null;let i=document.getElementById(e);return i instanceof Ut?i:null}function Y1(){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(vr()),t}function X1(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 Q1(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 J1(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 Z1(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 Gi(){Ki?.remove(),Ki=null}function eO(t){Gi();let e=document.createElement("rui-dialog");e.id=nt,e.alert=!!t.alert,e.label=t.label??"",e.open=!0;let i=Z1(e.alert),r=i.querySelector('[data-ref="dialog"]');if(!r)throw new Error("Failed to create the dialog surface.");return r.append(Y1()),t.title&&r.append(X1(t.title)),t.body&&r.append(Q1(t.body)),t.actions?.length&&r.append(J1(t.actions)),e.append(i),(Jr??document.body).appendChild(e),Ki=e,e}function Zp(t){if(!(!be||be===t))if(be===nt)Gi();else{let e=ea(be);e&&(e.open=!1)}}function hi(t){_t();let e=ea(t);e&&(Zp(t),e.open=!0,be=t)}function tO(t){_t(),Zp(nt),eO(t),be=nt}function Zr(t){if(typeof t=="string"){hi(t);return}if(Jp(t)){hi(t.id);return}tO(t)}function fi(t){_t();let e=t??be;if(e){if(e===nt)Gi();else{let i=ea(e);i&&(i.open=!1)}be===e&&(be=null)}}function ta(t){if(_t(),be===t){fi(t);return}hi(t)}function em(t){let e=t.detail;if(typeof e=="string"){Zr(e);return}e&&typeof e=="object"&&Zr(e)}function tm(t){let e=t.detail;fi(e?.id)}function im(t){let e=t.detail;e?.id&&ta(e.id)}function rm(t){let e=t.target;if(!e?.closest)return;let i=e.closest("[data-dialog-action]");if(i&&Ki?.contains(i)){t.preventDefault();let h={value:i.getAttribute("data-dialog-action")||void 0||void 0};Ki.dispatchEvent(new CustomEvent(Jo,{detail:h,bubbles:!0,composed:!0})),i.getAttribute("data-dialog-action-close")!=="false"&&fi(nt);return}let r=e.closest("[data-dialog-open]");if(r){let d=r.getAttribute("data-dialog-open")?.trim();d&&(t.preventDefault(),hi(d));return}let s=e.closest("[data-dialog-close]");if(s){if(s.closest("rui-dialog")?.hasAttribute("open"))return;t.preventDefault(),fi()}}function nm(t){let e=t.target?.closest?.("rui-dialog");if(!e)return;let i=e.id||null;i&&be===i&&(i===nt&&Gi(),be=null)}function om(t={}){return qi?(t.mount&&(Jr=t.mount),Zo):(qi=!0,Jr=t.mount??document.body,document.addEventListener(Yr,em),document.addEventListener(Xr,tm),document.addEventListener(Qr,im),document.addEventListener("click",rm),document.addEventListener("rui-close",nm),Zo)}function _t(){qi||om()}function Zo(){qi&&(document.removeEventListener(Yr,em),document.removeEventListener(Xr,tm),document.removeEventListener(Qr,im),document.removeEventListener("click",rm),document.removeEventListener("rui-close",nm),Gi(),Jr=null,be=null,qi=!1)}function iO(){return be}function rO(t){_t(),Zr(t)}function nO(t){_t(),fi(t)}function oO(t){_t(),ta(t)}function aO(t){_t();let e=t?.trim()||void 0;return{open:r=>{if(e){hi(e);return}if(r!=null){if(typeof r=="string"){hi(r);return}Zr(r)}},close:r=>{fi(r??e)},toggle:r=>{let s=r??e;s&&ta(s)},get openId(){return be}}}import{RadiantElement as mm,bindTo as gm,bound as dO,customElement as hO,onEvent as fO,onUpdated as pO,prop as ia}from"@ecopages/radiant";var am,sm,lm,um,cm,dm,hm,fm;function sO(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:pm(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||pm(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:lO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return cO(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function lO(t){var e=uO(t,"string");return typeof e=="symbol"?e:e+""}function uO(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 pm(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 cO(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 zt,bm=class extends mm{static{({e:[lm,um,cm,dm,hm,fm,am],c:[zt,sm]}=sO(this,[hO("rui-disclosure")],[[[ia({type:Boolean,reflect:!0,defaultValue:!1}),gm([{selector:"[data-disclosure-trigger]",attr:"aria-expanded"},{selector:"[data-disclosure-panel]",attr:"data-state",map:e=>e?"open":"closed"}])],0,"open"],[ia({type:String,reflect:!0,defaultValue:""}),0,"value"],[[ia({type:Boolean,reflect:!0,defaultValue:!1}),gm({bool:"data-animated"})],0,"animated"],[fO({selector:"[data-disclosure-trigger]",type:"click"}),2,"onTriggerClick"],[[dO,pO(["open","animated"])],2,"syncExpanded"]],0,void 0,mm))}open=(am(this),lm(this));value=(um(this),cm(this));animated=(dm(this),hm(this));panelId=(fm(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{sm()}};import{RadiantElement as Em,customElement as yO,onEvent as Rm,onUpdated as _O,prop as Am}from"@ecopages/radiant";var vm,ym,_m,xm,wm,Tm;function mO(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Sm(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Sm(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:gO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return vO(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function gO(t){var e=bO(t,"string");return typeof e=="symbol"?e:e+""}function bO(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 Sm(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 vO(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 en,Im=class extends Em{static{({e:[_m,xm,wm,Tm,vm],c:[en,ym]}=mO(this,[yO("rui-disclosure-group")],[[Am({type:Boolean,reflect:!0,defaultValue:!1}),0,"multiple"],[Am({type:Boolean,reflect:!0,attribute:"animated",defaultValue:!1}),0,"animated"],[_O("animated"),2,"onAnimatedUpdated"],[Rm({selector:"rui-disclosure",type:"rui-disclosure-toggle"}),2,"onDisclosureToggle"],[Rm({selector:"[data-disclosure-trigger]",type:"keydown"}),2,"onTriggerKeydown"]],0,void 0,Em))}constructor(...e){super(...e),Tm(this)}multiple=(vm(this),_m(this));animated=(xm(this),wm(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 zt)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{ym()}};import{jsx as ye,jsxs as Dm}from"@ecopages/jsx/jsx-runtime";function Om({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 Vm({children:t,class:e,disabled:i,icon:r,iconPosition:s="start",...d}){let a=r!==null?r??ye(Om,{}):null;return Dm("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 km({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 Cm({children:t}){return ye("div",{class:"rui-disclosure","data-ref":"root",children:t})}function xO({trigger:t,icon:e,iconPosition:i,children:r,...s}){return t!=null?ye(zt,{...s,children:Dm(Cm,{children:[ye(Vm,{icon:e,iconPosition:i,children:t}),r!=null?ye(km,{children:r}):null]})}):ye(zt,{...s,children:ye(Cm,{children:r})})}function wO({children:t,...e}){return ye(en,{...e,children:ye("div",{class:"rui-disclosure-group","data-ref":"root",children:t})})}import{jsx as xt}from"@ecopages/jsx/jsx-runtime";function TO({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 SO({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 EO({children:t,class:e,...i}){return xt("header",{...i,class:j("rui-feed__header",e),children:t})}function RO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__content",e),children:t})}function AO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__actions",e),children:t})}function IO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline",e),children:t})}function CO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline-body",e),children:t})}function DO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__meta",e),children:t})}import{jsx as _g}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as vg,customElement as NO,onEvent as sn,onUpdated as fa,prop as qt,registerSsrPreparationCallback as YO}from"@ecopages/radiant";import{consumeContext as XO,onContextUpdate as QO,provideContext as JO}from"@ecopages/radiant/context";var ot="data-rui-control",ra="data-rui-field-managed",nn="data-rui-field-label",on="data-rui-field-description",pi="data-rui-field-error",na="data-default-value",oa="data-default-values",jm="data-rui-aria-target",Fm="data-rui-aria-targets",aa='[data-ref="field"]';function Bm(){return`[${ot}], ${sa()}`}function sa(){return Array.from(wt.keys()).join(", ")}function OO(t){return t.localName==="rui-listbox"&&(t.hasAttribute("embedded")||Reflect.get(t,"embedded")===!0)}var VO={"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 mi(t){return t.localName==="input"||t.localName==="textarea"}function Um(t){return t.localName==="input"}function zm(t){return t.localName==="textarea"}function la(t){return Reflect.get(t.constructor,"formAssociated")===!0}var tn={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)}},Mm={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 qm(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 Km(t,e){Reflect.set(t,"value",e)}var $i={read:t=>qm(t,Mr),write:Km},kO={read:t=>qm(t,Lr),write:Km},wt=new Map([["rui-checkbox",Lm],["rui-switch",Lm],["rui-combobox",{...$i,submission:"none"}],["rui-date-field",tn],["rui-date-input",{...tn,submission:"host"}],["rui-date-range-picker",tn],["rui-select",{...$i,submission:"none"}],["rui-radio-group",tn],["rui-checkbox-group",$i],["rui-listbox",$i],["rui-tag-group",$i],["rui-slider",{...kO,submission:"host"}],["rui-knob",{...Mm,submission:"host"}],["rui-number-field",{...Mm,submission:"host"}]]);function Gm(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(aa)??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 ua(t,e){let i=null;return Gm(t,r=>{if(!(i||!(r instanceof HTMLElement))){if(r.matches(e)){i=r;return}i=r.querySelector(e)}}),i}function Pm(t){let e=t.filter(i=>!OO(i));return e.length===0?null:e.find(i=>!e.some(r=>r!==i&&r.contains(i)))??null}function MO(t){let e=[];return Gm(t,i=>{i instanceof HTMLElement&&i.matches(Bm())&&e.push(i)}),e}function LO(t){let e=t.querySelector(aa);return e instanceof HTMLElement?Array.from(e.querySelectorAll(Bm())).filter(i=>t.contains(i)):[]}function gi(t){let e=Pm(LO(t));return e||Pm(MO(t))}function PO(t,e){let i=t.toLowerCase();wt.set(i,e)}function $m(t,e){let i=gi(t);if(!i||!(e.target instanceof Element)||e.target!==i&&!i.contains(e.target))return!1;let r=e.target.closest(sa());return r===i||r==null}function ca(t){if(Um(t)){let i=rn(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(zm(t))return t.value;let e=rn(t);return wt.get(e.localName)?.read(e)??e.getAttribute("value")??""}function an(t,e){if(Um(t)){let r=rn(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(zm(t)){t.value=e==null?"":String(e);return}let i=rn(t);wt.get(i.localName)?.write(i,e)}function rn(t){return t.hasAttribute(ot)?t.closest(sa())??t:t}function Wm(t){return ua(t,`[${nn}]`)}function Hm(t){return ua(t,`[${on}]`)}function Nm(t){return da(t)[0]??null}function da(t){let e=t.querySelector(aa);if(e instanceof HTMLElement){let s=Array.from(e.querySelectorAll(`[${pi}]`));if(s.length>0)return s}let i=Array.from(t.querySelectorAll(`[${pi}]`));if(i.length>0)return i;let r=ua(t,`[${pi}]`);return r?[r]:[]}function Ym(t,e,i){if(e&&mi(e)){let r=t&&wt.get(t.localName)?.submission;(t==null||t===e||!la(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 jO(t){let e=Reflect.get(t,"checked");return typeof e=="boolean"?e:t.hasAttribute("checked")}function FO(t){let e=t.getAttribute(Fm);if(e){let r=e.split(",")[0]?.trim();if(r)return t.querySelector(r)}let i=t.getAttribute(jm);return i?t.querySelector(i):null}function BO(t){let e=t.getAttribute(Fm);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(jm);if(i){let r=t.querySelector(i);return r?[r]:[]}return[]}function UO(t){if(mi(t))return t;let e=FO(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 zO(t)??t;let r=VO[t.localName];return r?t.querySelector(r)??t:t}function zO(t){let e=t.querySelectorAll('input[type="radio"]');return Array.from(e).find(jO)??e[0]}function Xm(t){let e=BO(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[UO(t)]}import{createContext as qO}from"@ecopages/radiant/context";var bi=qO(Symbol.for("rui-form-context"));import{createContext as KO}from"@ecopages/radiant/context";var ha=KO(Symbol.for("rui-field-context"));var Qm,Jm,Zm,eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,fg,pg,mg,gg;function GO(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:bg(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||bg(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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 HO(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function $O(t){var e=WO(t,"string");return typeof e=="symbol"?e:e+""}function WO(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 bg(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 HO(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 ZO(t){if(!t)return;let{validate:e,...i}=t;return i}var ln,yg=class extends vg{static{({e:[Zm,eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,fg,pg,mg,gg,Qm],c:[ln,Jm]}=GO(this,[NO("rui-field")],[[qt({type:String,reflect:!0,defaultValue:""}),0,"name"],[qt({type:Object}),0,"rules"],[qt({type:Object}),0,"defaultValue"],[qt({type:String,attribute:na}),0,"defaultValueData"],[qt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[qt({type:String,defaultValue:""}),0,"error"],[qt({type:Boolean,reflect:!0,defaultValue:!1}),0,"invalid"],[JO({context:ha,initialValue:{name:"",controlId:"",descriptionId:"",errorId:"",error:void 0,invalid:!1,required:!1},hydrate:Object,serialize:e=>({...e,rules:ZO(e.rules)})}),0,"fieldProvider"],[XO(bi),0,"formContextProvider"],[QO({context:bi,requestUpdate:!1}),2,"onFormContextChanged"],[fa(["name"]),2,"onNameUpdated"],[fa(["rules","defaultValue","defaultValueData"]),2,"onRulesUpdated"],[fa(["disabled","error","invalid"]),2,"onPresentationUpdated"],[sn({selector:"*",type:"rui-change"}),2,"onControlChange"],[sn({selector:"[data-rui-control]",type:"input",options:{capture:!0}}),2,"onControlInput"],[sn({selector:"[data-rui-control]",type:"change",options:{capture:!0}}),2,"onControlNativeChange"],[sn({selector:"[data-rui-control], rui-knob, rui-slider",type:"focusout"}),2,"onControlFocusOut"]],0,void 0,vg))}name=(Qm(this),Zm(this));rules=(eg(this),tg(this));defaultValue=(ig(this),rg(this));defaultValueData=(ng(this),og(this));disabled=(ag(this),sg(this));error=(lg(this),ug(this));invalid=(cg(this),dg(this));fieldProvider=(hg(this),fg(this));formContextProvider=(pg(this),mg(this));uid=(gg(this),re("rui-field"));resolveFieldName(){return(this.name||this.getAttribute("name")||"").trim()}unregister;unregisterPresentation;registeredWithForm=!1;pendingControlWrite;controlObserver;constructor(){super(),YO(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(na))}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=gi(this);return s?ca(s):void 0},setValue:s=>{let d=gi(this);if(d){an(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){$m(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=gi(this);i&&this.pendingControlWrite&&(an(i,this.pendingControlWrite.value),this.clearPendingControlWrite());let r=i?Xm(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();Ym(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=Hm(this);d&&(d.id=e,s.push(e));let h=Nm(this);return h&&(h.id=i),h&&r&&s.push(i),s}syncLabel(e,i){let r=Wm(this);if(!r||!i||(r.htmlFor=i.id,mi(i)))return;let s=r.id||`${this.uid}-label`;for(let d of e)Lo(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(ra,""),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&&la(e)&&Reflect.set(e,"disabled",!0)}disableAriaTarget(e){e.setAttribute("aria-disabled","true"),mi(e)&&(e.disabled=!0)}syncErrorPresentation(e){for(let i of da(this))i.textContent=e??"",i.hidden=!e,e&&i.removeAttribute("hidden")}publishFieldContext(e){let i=this.fieldProvider.getContext();eV(i,e)||this.fieldProvider.setContext(e)}static{Jm()}};function eV(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 tV({children:t,rules:e,defaultValue:i,defaultValueData:r,...s}){return _g(ln,{...s,"prop:rules":e,"prop:defaultValue":i,data:{defaultValue:r??(i!==void 0?JSON.stringify(i):void 0)},children:_g("div",{class:"rui-field","data-ref":"field",children:t})})}import{jsx as iV}from"@ecopages/jsx/jsx-runtime";function rV({children:t,class:e,...i}){return iV("p",{...i,[on]:"",class:j("rui-field__description",e),children:t})}import{jsx as nV}from"@ecopages/jsx/jsx-runtime";function oV({class:t,...e}){return nV("p",{...e,[pi]:"",class:j("rui-field__error",t),role:"alert",hidden:!0})}import{jsx as Qg}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Wg,customElement as mV,event as Hg,onEvent as ma,onUpdated as Ng,prop as Kt}from"@ecopages/radiant";import{provideContext as gV}from"@ecopages/radiant/context";function vi(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 aV(t,e,i,r){if(i)for(let s of[sV,lV,uV,cV]){let d=await s(e,i,r);if(d)return d}}function sV(t,e){let i=t==null||t===""||t===!1||Array.isArray(t)&&t.length===0;return e.required&&i?vi("This field is required",e.required)??"This field is required":void 0}function lV(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 vi(`Minimum value is ${at(e.min)}`,e.min);if(e.max!==void 0&&i>at(e.max))return vi(`Maximum value is ${at(e.max)}`,e.max)}}function uV(t,e){let i=t==null?"":String(t);if(e.minLength!==void 0&&i.length<at(e.minLength))return vi(`Minimum length is ${at(e.minLength)}`,e.minLength);if(e.maxLength!==void 0&&i.length>at(e.maxLength))return vi(`Maximum length is ${at(e.maxLength)}`,e.maxLength);if(e.pattern!==void 0&&!at(e.pattern).test(i))return vi("Invalid format",e.pattern)??"Invalid format"}async function cV(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 xg(t,e,i){let r=i??Object.keys(e.fields),s={};for(let d of r){let h=e.fields[d]?.rules,a=await aV(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 pa(){return(t,e,i)=>xg(t,e,i.names)}function wg(t){return typeof t=="function"?t:pa()}var Wi=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=wg(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=wg(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 Tg,Sg,Eg,Rg,Ag,Ig,Cg,Dg,Og,Vg,kg,Mg,Lg,Pg,jg,Fg,Bg,Ug,zg,qg,Kg,Gg;function dV(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:$g(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||$g(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:hV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return pV(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function hV(t){var e=fV(t,"string");return typeof e=="symbol"?e:e+""}function fV(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 $g(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 pV(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 Yg=()=>{},bV={register:()=>Yg,updateFieldOptions:()=>{},handleFieldChange:()=>{},handleFieldBlur:()=>{},subscribePresentation:()=>Yg},un,Xg=class extends Wg{static{({e:[Eg,Rg,Ag,Ig,Cg,Dg,Og,Vg,kg,Mg,Lg,Pg,jg,Fg,Bg,Ug,zg,qg,Kg,Gg,Tg],c:[un,Sg]}=dV(this,[mV("rui-form")],[[gV({context:bi,initialValue:{ready:!1,store:void 0,revision:0,fields:{},errors:{},actions:bV},hydrate:Object,serialize:({revision:e,fields:i,errors:r})=>({ready:!1,revision:e,fields:i,errors:r})}),0,"formProvider"],[Hg({name:"rui-submit",bubbles:!0,composed:!0}),0,"submitEvent"],[Hg({name:"rui-invalid",bubbles:!0,composed:!0}),0,"invalidEvent"],[Kt({type:Object,defaultValue:{}}),0,"defaultValues"],[Kt({type:String,attribute:oa}),0,"defaultValuesData"],[Kt({type:Object}),0,"resolver"],[Kt({type:String,reflect:!0,defaultValue:"onSubmit"}),0,"mode"],[Kt({type:String,reflect:!0,attribute:"revalidate-mode",defaultValue:"onChange"}),0,"reValidateMode"],[Kt({type:String,reflect:!0}),0,"action"],[Kt({type:String,reflect:!0}),0,"method"],[Ng(["defaultValues","defaultValuesData","mode","reValidateMode"]),2,"syncOptions"],[Ng(["resolver"]),2,"syncResolver"],[ma({selector:"button[type=submit]",type:"click"}),2,"onSubmitButtonClick"],[ma({ref:"form",type:"submit"}),2,"onNativeSubmit"],[ma({ref:"form",type:"reset"}),2,"onNativeReset"]],0,void 0,Wg))}formProvider=(Tg(this),Eg(this));submitEvent=(Rg(this),Ag(this));invalidEvent=(Ig(this),Cg(this));defaultValues=(Dg(this),Og(this));defaultValuesData=(Vg(this),kg(this));resolver=(Mg(this),Lg(this));mode=(Pg(this),jg(this));reValidateMode=(Fg(this),Bg(this));action=(Ug(this),zg(this));method=(qg(this),Kg(this));onSubmit=void Gg(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(oa);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 Wi({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{Sg()}};function vV({children:t,defaultValues:e,defaultValuesData:i,resolver:r,reValidateMode:s,onSubmit:d,action:h,method:a,...E}){return Qg(un,{...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:Qg("form",{class:"rui-form","data-ref":"form",noValidate:!0,action:h,method:a,children:t})})}import{RadiantElement as rb,customElement as TV,onEvent as SV,prop as EV}from"@ecopages/radiant";var Jg,Zg,eb,tb;function yV(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:ib(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ib(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:_V(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wV(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function _V(t){var e=xV(t,"string");return typeof e=="symbol"?e:e+""}function xV(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 ib(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 wV(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 cn,nb=class extends rb{static{({e:[eb,tb,Jg],c:[cn,Zg]}=yV(this,[TV("rui-grid")],[[EV({type:String,defaultValue:""}),0,"label"],[SV({selector:'[role="gridcell"]',type:"keydown"}),2,"onKeydown"]],0,void 0,rb))}constructor(...e){super(...e),tb(this)}label=(Jg(this),eb(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{Zg()}};import{jsx as dn}from"@ecopages/jsx/jsx-runtime";function RV({rows:t,label:e,children:i,...r}){let s=t!=null?t.map(d=>dn("div",{class:"rui-grid__row",role:"row",children:d.map(h=>dn("div",{class:"rui-grid__cell",role:"gridcell",tabindex:-1,children:h}))})):i;return dn(cn,{...r,label:e,children:dn("div",{class:"rui-grid","data-ref":"root",role:"grid","aria-label":e||void 0,children:s})})}import{jsx as fn}from"@ecopages/jsx/jsx-runtime";import{jsx as AV}from"@ecopages/jsx/jsx-runtime";function hn({as:t,children:e,...i}){return AV(t??"div",{...i,children:e})}import{jsx as IV}from"@ecopages/jsx/jsx-runtime";function ga(t){let{children:e,as:i="h2",size:r="md",class:s,...d}=t;return IV(hn,{as:i,...d,class:j("rui-headline",r!==!1&&`rui-headline--size-${r}`,s),children:e})}function CV(t,e,i){return j("rui-heading",`rui-heading--align-${t}`,`rui-heading--size-${e}`,i)}function DV(t){let{children:e,as:i="div",align:r="start",size:s="md",class:d,...h}=t;return fn(hn,{as:i,...h,class:CV(r,s,d),children:e})}function OV({children:t,class:e,...i}){return fn("p",{...i,class:j("rui-heading__eyebrow",e),children:t})}function VV(t){let{children:e,as:i="h2",class:r,...s}=t;return fn(ga,{as:i,size:!1,class:j("rui-heading__title",r),...s,children:e})}function kV({children:t,class:e,...i}){return fn("p",{...i,class:j("rui-heading__description",e),children:t})}import{jsx as Yi}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Cb,bindTo as FV,bound as Ni,customElement as BV,event as UV,onEvent as pn,onUpdated as zV,prop as Gt,query as qV}from"@ecopages/radiant";var Hi=0,ob=0;function ab(){Hi+=1}function ba(t=Date.now(),e=300){Hi=Math.max(0,Hi-1),Hi===0&&(ob=t+e)}function sb(t,e=Date.now()){return Hi>0||e<ob?0:t}var lb,ub,cb,db,hb,fb,pb,mb,gb,bb,vb,yb,_b,xb,wb,Tb,Sb,Eb,Rb,Ab;function MV(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Ib(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ib(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:LV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return jV(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function LV(t){var e=PV(t,"string");return typeof e=="symbol"?e:e+""}function PV(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 Ib(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 jV(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 va="Preview",Db=8,KV=500,mn,Ob=class extends Cb{static{({e:[cb,db,hb,fb,pb,mb,gb,bb,vb,yb,_b,xb,wb,Tb,Sb,Eb,Rb,Ab,lb],c:[mn,ub]}=MV(this,[BV("rui-hover-card")],[[Gt({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Gt({type:String,defaultValue:"bottom-start"}),0,"placement"],[Gt({type:Number,defaultValue:600}),0,"delay"],[Gt({type:Number,defaultValue:200}),0,"closeDelay"],[Gt({type:Boolean,defaultValue:!0}),0,"portal"],[Gt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[[Gt({type:String,attribute:"content-label",reflect:!0,defaultValue:va}),FV({ref:"content",attr:"aria-label"})],0,"contentLabel"],[qV({ref:"content"}),0,"contentTarget"],[UV({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[Ni,zV(["open","placement","portal","disabled"])],2,"syncCard"],[pn({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[pn({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[pn({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[pn({type:"keydown",ref:"trigger"}),2,"onHostKeydown"],[Ni,2,"onPointerEnter"],[Ni,2,"onPointerLeave"],[Ni,2,"onPointerDown"],[Ni,2,"onPointerUp"]],0,void 0,Cb))}open=(lb(this),cb(this));placement=(db(this),hb(this));delay=(fb(this),pb(this));closeDelay=(mb(this),gb(this));portal=(bb(this),vb(this));disabled=(yb(this),_b(this));contentLabel=(xb(this),wb(this));contentTarget=(Tb(this),Sb(this));openChangeEvent=(Eb(this),Rb(this));contentId=(Ab(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&&ba(),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?di(e)??e:di(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:Db,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:Db,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?ab():r&&ba(),i&&this.openChangeEvent.emit({open:e}),this.syncCard()}scheduleShow(e=!1){if(this.disabled||this.open)return;this.clearTimers(),this.openedByKeyboard=e;let i=sb(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=di(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)},KV))}onPointerUp(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}static{ub()}};function GV({children:t,class:e,...i}){return Yi("span",{class:"rui-hover-card__trigger","data-ref":"trigger",children:Yi("span",{...i,"data-hover-card-trigger":!0,class:j(e),children:t})})}function $V({children:t,class:e,...i}){return Yi("div",{...i,"data-ref":"content",class:j("rui-hover-card__content","rui-floating",e),role:"dialog",hidden:!0,children:t})}function WV({children:t,contentLabel:e=va,...i}){return Yi(mn,{contentLabel:e,...i,children:Yi("span",{class:"rui-hover-card",children:t})})}import{jsx as HV}from"@ecopages/jsx/jsx-runtime";function NV(t){let{class:e,type:i="text",mask:r,placeholder:s,"on:input":d,...h}=t,a=r?go(r):s;return HV("input",{...h,type:i,placeholder:a,"on:input":r?A=>{if(r){let S=A.target;S.value=bo(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 ya}from"@ecopages/jsx/jsx-runtime";function YV({children:t,class:e,...i}){return ya("div",{...i,role:"group",class:j("rui-input-group",e),children:t})}function XV({children:t,align:e="start",class:i,...r}){return ya("div",{...r,class:j("rui-input-group__addon",`rui-input-group__addon--${e}`,i),children:t})}function QV({children:t,class:e,...i}){return ya("span",{...i,class:j("rui-input-group__text",e),children:t})}import{bindTo as wv,customElement as sk,event as lk,onEvent as Qi,onUpdated as uk,prop as Oe,query as $t}from"@ecopages/radiant";import{FormAssociatedElement as Tv}from"@ecopages/radiant/form-associated-element";function JV(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 yi(t,e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.min(15,Math.round(e)):JV(t)}function $e(t,e){return Number.isFinite(t)?t.toFixed(e):""}function Xi(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 gn(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 Vb=120,_i=300,ZV=14,ek=_i+(360-_i)/2;function tk(t){return Math.min(100,Math.max(0,Number.isFinite(t)?Number(t):ZV))}function ik(t,e,i){return i.replace("{value}",$e(t,e))}function bn(t,e,i,r,s,d,h){let a=We(e,i,r),E=tk(s),A=50-E/2,S=2*Math.PI*A,I=_i/360*S,T=a.clamp(t),K=yi(r,h);return{startAngle:Vb,strokeWidth:E,radius:A,circumference:S,arcLength:I,progressLength:a.ratioFor(T)*I,valueText:ik(T,K,d)}}function _a(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-Vb+360)%360,h=d<=_i?d:d<=ek?_i:0;return r.valueFromRatio(h/_i)}var kb,Mb,Lb,Pb,jb,Fb,Bb,Ub,zb,qb,Kb,Gb,$b,Wb,Hb,Nb,Yb,Xb,Qb,Jb,Zb,ev,tv,iv,rv,nv,ov,av,sv,lv,uv,cv,dv,hv,fv,pv,mv,gv,bv,vv,yv,_v;function rk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:xv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||xv(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:nk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ak(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function nk(t){var e=ok(t,"string");return typeof e=="symbol"?e:e+""}function ok(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 xv(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 ak(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=50,vn,Sv=class extends Tv{static{({e:[Lb,Pb,jb,Fb,Bb,Ub,zb,qb,Kb,Gb,$b,Wb,Hb,Nb,Yb,Xb,Qb,Jb,Zb,ev,tv,iv,rv,nv,ov,av,sv,lv,uv,cv,dv,hv,fv,pv,mv,gv,bv,vv,yv,_v,kb],c:[vn,Mb]}=rk(this,[sk("rui-knob")],[[Oe({type:Number,reflect:!0,defaultValue:xa}),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}),wv({ref:"control",attr:"aria-readonly",map:e=>String(e)})],0,"readOnly"],[[Oe({type:String,defaultValue:""}),wv([{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"],[lk({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[$t({ref:"root"}),0,"rootTarget"],[$t({ref:"label"}),0,"labelTarget"],[$t({ref:"control"}),0,"controlTarget"],[$t({ref:"track"}),0,"trackTarget"],[$t({ref:"progress"}),0,"progressTarget"],[$t({ref:"centerValue"}),0,"centerValueTarget"],[$t({ref:"belowValue"}),0,"belowValueTarget"],[uk(["value","min","max","step","valuePrecision","disabled","readOnly","effectiveDisabled","name","label","size","strokeWidth","showValue","valuePosition","valueTemplate"]),2,"onPropsUpdated"],[Qi({ref:"control",type:"pointerdown"}),2,"onPointerDown"],[Qi({ref:"control",type:"pointermove"}),2,"onPointerMove"],[Qi({ref:"control",type:"pointerup"}),2,"onPointerUp"],[Qi({ref:"control",type:"pointercancel"}),2,"onPointerCancel"],[Qi({ref:"control",type:"keydown"}),2,"onKeydown"]],0,void 0,Tv))}value=(kb(this),Lb(this));min=(Pb(this),jb(this));max=(Fb(this),Bb(this));step=(Ub(this),zb(this));valuePrecision=(qb(this),Kb(this));readOnly=(Gb(this),$b(this));label=(Wb(this),Hb(this));size=(Nb(this),Yb(this));strokeWidth=(Xb(this),Qb(this));showValue=(Jb(this),Zb(this));valuePosition=(ev(this),tv(this));valueTemplate=(iv(this),rv(this));changeEvent=(nv(this),ov(this));rootTarget=(av(this),sv(this));labelTarget=(lv(this),uv(this));controlTarget=(cv(this),dv(this));trackTarget=(hv(this),fv(this));progressTarget=(pv(this),mv(this));centerValueTarget=(gv(this),bv(this));belowValueTarget=(vv(this),yv(this));activePointerId=(_v(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=bn(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),Xi(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),!Xi(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=_a(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=_a(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=gn(this.numericRange,this.value,e.key);i!=null&&(e.preventDefault(),this.lastEmitted=this.value,this.commitValue(i))}static{Mb()}};import{jsx as st,jsxs as wa}from"@ecopages/jsx/jsx-runtime";function ck({value:t=xa,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,...G}){let V=We(e,i,r),$=V.clamp(t),W=bn($,e,i,r,A,T,K);return st(dk,{props:G,value:$,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 dk({props:t,ring:e,range:i,...r}){return st(vn,{...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(hk,{knob:r,ring:e,range:i})})}function hk({knob:t,ring:e,range:i}){let r=t.valuePosition==="below";return wa("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(fk,{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 fk({knob:t,ring:e,range:i,valueBelow:r}){return wa("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:[wa("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 pk}from"@ecopages/jsx/jsx-runtime";function mk({children:t,htmlFor:e,class:i,...r}){return pk("label",{...r,[nn]:"",class:j("rui-label",i),for:e,children:t})}import{RadiantElement as Uv,bindTo as Tk,bound as Sk,customElement as Ek,event as zv,onEvent as Tt,onUpdated as Rk,prop as qv,query as Kv}from"@ecopages/radiant";var gk=200,bk=250,vk=6,xi=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)},gk);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:vk,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)},bk);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 Ev,Rv,Av,Iv,Cv,Dv,Ov,Vv,kv,Mv,Lv,Pv,jv,Fv;function yk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:_k(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function _k(t){var e=xk(t,"string");return typeof e=="symbol"?e:e+""}function xk(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 wk(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 Ak=6,Ji,Gv=class extends Uv{static{({e:[Av,Iv,Cv,Dv,Ov,Vv,kv,Mv,Lv,Pv,jv,Fv,Ev],c:[Ji,Rv]}=yk(this,[Ek("rui-menu-button")],[[[qv({type:Boolean,reflect:!0,defaultValue:!1}),Tk([{ref:"trigger",attr:"aria-expanded"},{ref:"menu",bool:"hidden",invert:!0}])],0,"open"],[qv({type:String,defaultValue:"bottom-start"}),0,"placement"],[Kv({ref:"trigger"}),0,"triggerTarget"],[Kv({ref:"menu"}),0,"menuTarget"],[zv({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[zv({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[Sk,Rk(["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,Uv))}open=(Ev(this),Av(this));placement=(Iv(this),Cv(this));triggerTarget=(Dv(this),Ov(this));menuTarget=(Vv(this),kv(this));changeEvent=(Mv(this),Lv(this));closeEvent=(Pv(this),jv(this));menuId=(Fv(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 xi({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:Ak,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{Rv()}};import{jsx as He,jsxs as $v}from"@ecopages/jsx/jsx-runtime";import{jsx as Ik}from"@ecopages/jsx/jsx-runtime";function Zi({orientation:t="horizontal",class:e,...i}){return Ik("hr",{...i,class:j("rui-separator",e),role:"separator","aria-orientation":t,"data-orientation":t})}import{Fragment as Ck,jsxs as Dk}from"@ecopages/jsx/jsx-runtime";function er(t,e){return t.map(i=>{if(i.type==="separator")return e.Separator({id:i.id});let r=!!i.items?.length;return Dk(Ck,{children:[e.Item({value:i.value,disabled:i.disabled,hasSubmenu:r,children:i.label}),r?e.Submenu({children:er(i.items??[],e)}):null]})})}function Wv({children:t,class:e,variant:i="filled",size:r="md",...s}){return $v(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 Hv({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 Nv({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 Yv({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 Ok({trigger:t,items:e,children:i,class:r,...s}){return t==null&&e==null?He(Ji,{...s,class:j("rui-menu-button",r),children:i}):$v(Ji,{...s,class:j("rui-menu-button",r),children:[He(Wv,{children:t}),He(Hv,{children:e?er(e,{Item:d=>He(Yv,{...d}),Submenu:d=>He(Nv,{...d}),Separator:d=>He(Zi,{},d.id)}):i})]})}import{RadiantElement as ry,customElement as Pk,event as jk,onEvent as St,prop as Fk}from"@ecopages/radiant";var Xv,Qv,Jv,Zv,ey,ty;function Vk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:iy(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||iy(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:kk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Lk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function kk(t){var e=Mk(t,"string");return typeof e=="symbol"?e:e+""}function Mk(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 iy(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 Lk(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 yn,ny=class extends ry{static{({e:[Jv,Zv,ey,ty,Xv],c:[yn,Qv]}=Vk(this,[Pk("rui-menubar")],[[Fk({type:String,defaultValue:""}),0,"label"],[jk({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,ry))}label=(Xv(this),Jv(this));changeEvent=(Zv(this),ey(this));openRoot=(ty(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 xi({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{Qv()}};import{jsx as Ne,jsxs as Bk}from"@ecopages/jsx/jsx-runtime";function oy({label:t,children:e,disabled:i}){let r=e!=null;return Bk("div",{class:"rui-menubar__root","data-ref":"menubar-root",children:[Ne("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?Ne("div",{class:"rui-menubar__menu rui-popover rui-floating","data-ref":"menu",role:"menu",hidden:!0,children:e}):null]})}function ay({children:t,value:e,disabled:i,hasSubmenu:r,class:s,...d}){return Ne("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 sy({children:t,class:e,...i}){return Ne("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 Uk({items:t,label:e,children:i,...r}){let s=t!=null?t.map(d=>Ne(oy,{label:d.label,disabled:d.disabled,children:d.items?.length?er(d.items,{Item:h=>Ne(ay,{...h}),Submenu:h=>Ne(sy,{...h}),Separator:h=>Ne(Zi,{},h.id)}):null})):i;return Ne(yn,{...r,label:e,children:Ne("div",{class:"rui-menubar","data-ref":"root",role:"menubar","aria-label":e||void 0,children:s})})}import{jsx as Ta,jsxs as Sa}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as xy,customElement as $k,onUpdated as Wk,prop as _n,state as Hk}from"@ecopages/radiant";var ly,uy,cy,dy,hy,fy,py,my,gy,by,vy,yy;function zk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:_y(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||_y(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:qk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Gk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function qk(t){var e=Kk(t,"string");return typeof e=="symbol"?e:e+""}function Kk(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 _y(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 Gk(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 Ea,wy=class extends xy{static{({e:[cy,dy,hy,fy,py,my,gy,by,vy,yy,ly],c:[Ea,uy]}=zk(this,[$k("rui-meter")],[[_n({type:Number,reflect:!0,defaultValue:0}),0,"value"],[_n({type:Number,defaultValue:0}),0,"min"],[_n({type:Number,defaultValue:100}),0,"max"],[_n({type:String,defaultValue:""}),0,"label"],[Hk,0,"percent"],[Wk(["value","min","max"]),2,"onRangeUpdated"]],0,void 0,xy))}value=(ly(this),cy(this));min=(dy(this),hy(this));max=(fy(this),py(this));label=(my(this),gy(this));percent=(by(this),vy(this,0));resolvedAriaLabel=(yy(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 Sa("div",{class:"rui-meter",children:[this.label?Ta("span",{class:"rui-meter__label",children:this.$.label}):null,Sa("meter",{class:"rui-meter__bar",min:this.$.min,max:this.$.max,value:this.$.value,"aria-label":this.resolvedAriaLabel,children:[this.$.percent,"%"]}),Ta("div",{class:"rui-meter__track",style:this.trackStyle,"aria-hidden":"true",children:Ta("div",{class:"rui-meter__fill"})}),Sa("span",{class:"rui-meter__value","aria-hidden":"true",children:[this.$.percent,"%"]})]})}static{uy()}};import{jsx as Wt}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as My,customElement as Jk,onEvent as Fe,prop as xn}from"@ecopages/radiant";var Ty,Sy,Ey,Ry,Ay,Iy,Cy,Dy,Oy,Vy;function Nk(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:ky(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ky(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:Yk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Qk(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Yk(t){var e=Xk(t,"string");return typeof e=="symbol"?e:e+""}function Xk(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 ky(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 Qk(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 Py=200,jy=150,Zk=8,wn,Ly=class extends My{static{({e:[Ey,Ry,Ay,Iy,Cy,Dy,Oy,Vy,Ty],c:[wn,Sy]}=Nk(this,[Jk("rui-navigation-menu")],[[xn({type:String,defaultValue:""}),0,"label"],[xn({type:Boolean,reflect:!0,attribute:"open-on-hover",defaultValue:!1}),0,"openOnHover"],[xn({type:Number,attribute:"hover-delay",defaultValue:Py}),0,"hoverDelay"],[xn({type:Number,attribute:"close-delay",defaultValue:jy}),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=(Ty(this),Ey(this));openOnHover=(Ry(this),Ay(this));hoverDelay=(Iy(this),Cy(this));closeDelay=(Dy(this),Oy(this));openValue=(Vy(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 Nr(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:Zk,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{Sy()}};function eM({children:t,class:e,...i}){return Wt("div",{...i,"data-ref":"bar",class:j("rui-navigation-menu__bar",e),children:t})}function tM({children:t,class:e,...i}){return Wt("div",{...i,"data-ref":"panels",class:j("rui-navigation-menu__panels",e),children:t})}function iM({children:t,label:e,...i}){return Wt(wn,{...i,label:e,children:Wt("nav",{class:"rui-navigation-menu","data-ref":"root","aria-label":e||void 0,children:t})})}function rM({children:t,value:e,variant:i="ghost",class:r,...s}){return Wt(Je,{...s,variant:i,class:r,"data-navigation-item":!0,"data-navigation-trigger":!0,"data-value":e,children:t})}function nM({children:t,href:e,class:i,...r}){return Wt("a",{...r,href:e,"data-navigation-item":!0,class:j("rui-button","rui-button--ghost","rui-button--md",i),children:t})}function oM({children:t,value:e,class:i,...r}){return Wt("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 Oa,customElement as dM,event as hM,onEvent as Ht,onUpdated as fM,prop as Ee,state as __}from"@ecopages/radiant";import{FormAssociatedElement as x_}from"@ecopages/radiant/form-associated-element";function Ra(t,e){return new Intl.NumberFormat(t,e)}function Aa(t,e,i){return Number.isFinite(t)?Ra(e,i).format(t):""}function Ia(t,e,i){let r=t.trim();if(!r)return null;let d=Ra(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 Ca(t){if(t)try{let e=JSON.parse(t);return aM(e)?(new Intl.NumberFormat(void 0,e),e):void 0}catch{return}}function aM(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Da(t,e,i,r){if(!Number.isFinite(t))return Number.isFinite(e)?e:0;if(!Number.isFinite(r)||r===0)return Fy(t,e,i);let s=Number.isFinite(e)?e:0,d=Math.round((t-s)/r)*r+s;return Fy(d,e,i)}function Fy(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 By,Uy,zy,qy,Ky,Gy,$y,Wy,Hy,Ny,Yy,Xy,Qy,Jy,Zy,e_,t_,i_,r_,n_,o_,a_,s_,l_,u_,c_,d_,h_,f_,p_,m_,g_,b_,v_;function sM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:y_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||y_(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:lM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return cM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function lM(t){var e=uM(t,"string");return typeof e=="symbol"?e:e+""}function uM(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 y_(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 cM(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 Tn,w_=class extends x_{static{({e:[zy,qy,Ky,Gy,$y,Wy,Hy,Ny,Yy,Xy,Qy,Jy,Zy,e_,t_,i_,r_,n_,o_,a_,s_,l_,u_,c_,d_,h_,f_,p_,m_,g_,b_,v_,By],c:[Tn,Uy]}=sM(this,[dM("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}),Oa({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}),Oa({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}),Oa({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"],[hM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[__,0,"decreaseDisabled"],[__,0,"increaseDisabled"],[fM(["value","defaultValue","minValue","maxValue","step","label","name","disabled","readOnly","effectiveDisabled","locale","formatOptions","commitBehavior"]),2,"onPropsUpdated"],[Ht({selector:'[data-number-field-action="decrement"]',type:"click"}),2,"decrement"],[Ht({selector:'[data-number-field-action="increment"]',type:"click"}),2,"increment"],[Ht({selector:"[data-number-field-input]",type:"focusin"}),2,"onInputFocus"],[Ht({selector:"[data-number-field-input]",type:"focusout"}),2,"onInputBlur"],[Ht({selector:"[data-number-field-input]",type:"input"}),2,"onInput"],[Ht({selector:"[data-number-field-input]",type:"keydown"}),2,"onKeydown"],[Ht({selector:"[data-number-field-input]",type:"wheel"}),2,"onWheel"]],0,void 0,x_))}value=(By(this),zy(this));defaultValue=(qy(this),Ky(this));minValue=(Gy(this),$y(this));maxValue=(Wy(this),Hy(this));step=(Ny(this),Yy(this));readOnly=(Xy(this),Qy(this));label=(Jy(this),Zy(this));locale=(e_(this),t_(this));formatOptions=(i_(this),r_(this));commitBehavior=(n_(this),o_(this));incrementAriaLabel=(a_(this),s_(this));decrementAriaLabel=(l_(this),u_(this));wheelDisabled=(c_(this),d_(this));changeEvent=(h_(this),f_(this));decreaseDisabled=(p_(this),m_(this,!1));increaseDisabled=(g_(this),b_(this,!1));editing=(v_(this),!1);draftValue="";initialized=!1;uid=re("rui-number-field");get resolvedLocale(){return ht(this.locale)}get resolvedFormatOptions(){return Ca(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=Aa(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=Da(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=Ia(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{Uy()}};import{jsx as Be,jsxs as T_}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 E_({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 R_({children:t,class:e,...i}){return Be("div",{...i,class:j("rui-number-field__steppers",e),children:t})}function A_({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 I_({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 pM(){return T_(S_,{children:[Be(E_,{}),T_(R_,{children:[Be(I_,{}),Be(A_,{})]})]})}function mM({children:t,...e}){return Be(Tn,{...e,children:Be("div",{class:"rui-number-field","data-ref":"root",children:t??Be(pM,{})})})}import{jsx as _e,jsxs as ka}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as G_,customElement as _M,event as xM,onEvent as wM,prop as tr}from"@ecopages/radiant";var C_,D_,O_,V_,k_,M_,L_,P_,j_,F_,B_,U_,z_,q_;function gM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:K_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||K_(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:bM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return yM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function bM(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 K_(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 yM(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 Va="Pagination";function Sn(t,e){return Math.min(Math.max(1,Math.floor(t)||1),e)}var En,$_=class extends G_{static{({e:[O_,V_,k_,M_,L_,P_,j_,F_,B_,U_,z_,q_,C_],c:[En,D_]}=gM(this,[_M("rui-pagination")],[[tr({type:String,defaultValue:Va}),0,"label"],[tr({type:Number,reflect:!0,defaultValue:1}),0,"page"],[tr({type:Number,attribute:"page-count",defaultValue:1}),0,"pageCount"],[tr({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[tr({type:Number,attribute:"sibling-count",defaultValue:1}),0,"siblingCount"],[xM({name:"rui-page-change",bubbles:!0,composed:!0}),0,"pageChangeEvent"],[wM({selector:"[data-pagination-page]",type:"click"}),2,"onPageClick"]],0,void 0,G_))}constructor(...e){super(...e),q_(this)}label=(C_(this),O_(this));page=(V_(this),k_(this));pageCount=(M_(this),L_(this));disabled=(P_(this),j_(this));siblingCount=(F_(this),B_(this));pageChangeEvent=(U_(this),z_(this));changePage(e){if(this.disabled)return;let i=Sn(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{D_()}};function TM(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 W_({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=Sn(e,I),K=Math.max(0,Math.floor(s)||0),G=TM(T,I,K);return _e("nav",{class:"rui-pagination__nav","aria-label":t,children:ka("ul",{class:"rui-pagination__list",children:[_e("li",{children:ka(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(Zn,{}),_e("span",{children:d})]})}),G.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:ka(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(eo,{})]})})]})})}function SM({children:t,label:e=Va,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 G=Math.max(1,Math.floor(r)||1),V=Sn(i,G),$=Math.max(0,Math.floor(d)||0);return _e(En,{...K,class:j("rui-pagination",T),label:e,page:V,pageCount:G,disabled:s,siblingCount:$,children:t??_e(W_,{label:e,page:V,pageCount:G,disabled:s,siblingCount:$,previousText:h,previousLabel:a,nextText:E,nextLabel:A,pageLabel:S,statusLabel:I})})}import{jsx as wi,jsxs as Ax}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Rn,bound as La,customElement as Ex,event as IM,onEvent as ir,onUpdated as Rx,prop as Et,query as Pa}from"@ecopages/radiant";import{isServer as CM}from"@ecopages/radiant/is-server";var H_,N_,Y_,X_,Q_,J_,Z_,ex,tx,ix,rx,nx,ox,ax,sx,lx,ux,cx,dx,hx,fx,px,mx,gx,bx,vx,yx,_x;function Sx(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:xx(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||xx(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:EM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return AM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function EM(t){var e=RM(t,"string");return typeof e=="symbol"?e:e+""}function RM(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 xx(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 AM(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 An,wx=class extends Rn{static{({e:[Y_,X_,Q_,J_,Z_,ex,tx,ix,rx,nx,ox,ax,sx,lx,ux,cx,dx,hx,fx,px,H_],c:[An,N_]}=Sx(this,[Ex("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"],[Pa({ref:"surface"}),0,"surfaceTarget"],[Pa({ref:"host"}),0,"hostTarget"],[IM({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[La,Rx(["open","placement","portal","matchAnchorWidth","offset","anchor"])],2,"syncPopover"],[ir({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[ir({ref:"host",type:"focusout"}),2,"onFocusOut"],[La,2,"onExternalAnchorClick"],[ir({document:!0,type:"keydown"}),2,"onDocumentKeydown"]],0,void 0,Rn))}open=(H_(this),Y_(this));placement=(X_(this),Q_(this));portal=(J_(this),Z_(this));matchAnchorWidth=(ex(this),tx(this));offset=(ix(this),rx(this));anchor=(nx(this),ox(this));variant=(ax(this),sx(this));surfaceTarget=(lx(this),ux(this));hostTarget=(cx(this),dx(this));openChangeEvent=(hx(this),fx(this));surfaceId=(px(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 Ma(i);let r=this.querySelector("[data-popover-trigger]");if(r instanceof HTMLElement)return Ma(r);let s=this.anchor.trim();if(s){let d=document.querySelector(s);if(d instanceof HTMLElement)return Ma(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{N_()}};var In,Tx=class extends Rn{static{({e:[bx,vx,yx,_x,mx],c:[In,gx]}=Sx(this,[Ex("rui-popover-trigger")],[[Et({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Pa({ref:"root"}),0,"rootTarget"],[[La,Rx(["open"])],2,"syncToPopover"],[ir({ref:"root",type:"click"}),2,"onHostClick"],[ir({selector:"rui-popover",type:"rui-open-change"}),2,"onPopoverOpenChange"]],0,void 0,Rn))}constructor(...e){super(...e),_x(this)}open=(mx(this),bx(this));rootTarget=(vx(this),yx(this));getPopover(){return this.querySelector("rui-popover")}onConnected(){this.syncToPopover()}syncToPopover(){if(CM)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{gx()}};function Ma(t){return t.querySelector('button, a[href], input, select, textarea, [role="button"]')??t}function DM({children:t,class:e,...i}){return wi("div",{...i,class:j(e),children:t})}function OM({trigger:t,children:e,variant:i="default",...r}){let s=i==="listbox"?"rui-popover--listbox":"";return wi(An,{...r,variant:i,children:Ax("div",{class:"rui-popover-host","data-ref":"host",children:[t!=null?wi("span",{"data-popover-trigger":!0,children:t}):null,wi("div",{"data-ref":"surface",class:`rui-popover rui-floating ${s}`.trim(),role:"dialog",children:e})]})})}function VM({trigger:t,children:e,...i}){return wi(In,{...i,children:Ax("div",{class:"rui-popover-trigger","data-ref":"root",children:[wi("span",{"data-popover-trigger":!0,children:t}),e]})})}import{RadiantElement as Kx,bindTo as Gx,customElement as jM,event as FM,onEvent as BM,onUpdated as UM,prop as Cn,query as zM}from"@ecopages/radiant";var Ix,Cx,Dx,Ox,Vx,kx,Mx,Lx,Px,jx,Fx,Bx,Ux,zx;function kM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:qx(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||qx(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:MM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return PM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function MM(t){var e=LM(t,"string");return typeof e=="symbol"?e:e+""}function LM(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 qx(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 PM(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 Dn,$x=class extends Kx{static{({e:[Dx,Ox,Vx,kx,Mx,Lx,Px,jx,Fx,Bx,Ux,zx,Ix],c:[Dn,Cx]}=kM(this,[jM("rui-radio-group")],[[Cn({type:String,reflect:!0,defaultValue:""}),0,"value"],[Cn({type:String,defaultValue:""}),0,"name"],[[Cn({type:String,defaultValue:""}),Gx({selector:"[data-radio-group-root]",attr:"aria-label",map:gt})],0,"label"],[[Cn({type:Boolean,reflect:!0,defaultValue:!1}),Gx({selector:"[data-radio-group-root]",attr:"aria-disabled",map:e=>e?"true":void 0})],0,"disabled"],[zM({selector:'input[type="radio"]',all:!0,cache:!1}),0,"radioTargets"],[FM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[UM(["value","name","disabled"]),2,"syncRadios"],[BM({selector:'input[type="radio"]',type:"change"}),2,"onRadioChange"]],0,void 0,Kx))}constructor(...e){super(...e),zx(this)}value=(Ix(this),Dx(this));name=(Ox(this),Vx(this));label=(kx(this),Mx(this));disabled=(Lx(this),Px(this));radioTargets=(jx(this),Fx(this));changeEvent=(Bx(this),Ux(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{Cx()}};import{jsx as Nt,jsxs as qM}from"@ecopages/jsx/jsx-runtime";function Wx({children:t,class:e,...i}){return Nt("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 Hx({children:t,value:e,name:i,disabled:r,class:s,...d}){return qM("label",{...d,class:j("rui-radio",s),children:[Nt("input",{type:"radio",class:"rui-radio__input",value:e,name:i,disabled:r,"data-disabled":r?"":void 0}),Nt("span",{class:"rui-radio__control","aria-hidden":"true"}),Nt("span",{class:"rui-radio__label",children:t})]})}function KM({options:t,children:e,...i}){return Nt(Dn,{...i,children:t==null?e:Nt(Wx,{children:t.map(r=>Nt(Hx,{value:r.value,disabled:r.disabled,children:r.label}))})})}import{RadiantElement as m0,bindTo as g0,customElement as NM,event as YM,onEvent as xe,onUpdated as XM,prop as Yt,query as QM}from"@ecopages/radiant";var Nx,Yx,Xx,Qx,Jx,Zx,e0,t0,i0,r0,n0,o0,a0,s0,l0,u0,c0,d0,h0,f0;function GM(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:p0(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||p0(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:$M(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return HM(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function $M(t){var e=WM(t,"string");return typeof e=="symbol"?e:e+""}function WM(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 p0(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 HM(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 On,b0=class extends m0{static{({e:[Xx,Qx,Jx,Zx,e0,t0,i0,r0,n0,o0,a0,s0,l0,u0,c0,d0,h0,f0,Nx],c:[On,Yx]}=GM(this,[NM("rui-select")],[[[Yt({...Ie,defaultValue:[]}),g0({selector:"[data-select-clear]",bool:"hidden",map:e=>e.length===0})],0,"value"],[Yt({type:String,defaultValue:""}),0,"label"],[Yt({type:String,defaultValue:""}),0,"placeholder"],[[Yt({type:Boolean,reflect:!0,defaultValue:!1}),g0([{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"],[Yt({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[Yt({type:Boolean,attribute:"should-close-on-select"}),0,"shouldCloseOnSelect"],[Yt({type:String,attribute:"trigger-kind",reflect:!0,defaultValue:"manual"}),0,"triggerKind"],[YM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[QM({ref:"root"}),0,"rootTarget"],[XM(["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,m0))}constructor(...e){super(...e),f0(this)}value=(Nx(this),Xx(this));label=(Qx(this),Jx(this));placeholder=(Zx(this),e0(this));disabled=(t0(this),i0(this));selectionMode=(r0(this),n0(this));shouldCloseOnSelect=(o0(this),a0(this));triggerKind=(s0(this),l0(this));changeEvent=(u0(this),c0(this));open=(d0(this),!1);uid=re("rui-select");collection=new ii({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 ri({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.collection.getOptions(),getActiveDescendantHost:()=>this.getActiveDescendantHost(),getOptionIdPrefix:()=>`${this.uid}-option`});rootTarget=h0(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 Pi(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{Yx()}};import{Fragment as JM,jsx as he,jsxs as v0}from"@ecopages/jsx/jsx-runtime";function y0({children:t,class:e,...i}){return he("div",{...i,class:j("rui-select__control",e),children:t})}function _0({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 x0({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 ZM({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 w0({children:t,class:e,...i}){return he("span",{...i,"data-select-value":!0,class:j("rui-select__value",e),children:t})}function T0({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 eL({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 tL(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 iL({children:t}){return he("div",{class:"rui-select","data-ref":"root",children:t})}function rL({options:t,children:e,value:i,...r}){let s=et(i),d=r.selectionMode==="multiple",h=t!=null?tL(t,i,r.placeholder):"",a=t?.filter(E=>s.includes(E.value)).map(E=>({value:E.value,label:E.label}));return he(On,{...r,value:s,children:he(iL,{children:t==null?e:v0(JM,{children:[v0(y0,{children:[he(_0,{disabled:r.disabled,children:he(w0,{children:d?he(Ui,{tags:a??[],label:"Selected options"}):h})}),he(x0,{})]}),he(T0,{children:he(ai,{embedded:!0,options:t,selectionMode:r.selectionMode,value:s})})]})})})}import{RadiantElement as Tw,bindTo as rr,bound as Sw,customElement as lL,event as ja,onEvent as nr,onUpdated as Fa,prop as me,query as kn,state as uL}from"@ecopages/radiant";import{isServer as cL}from"@ecopages/radiant/is-server";function Vn(t){return t.split(",").map(e=>e.trim()).filter(e=>e.length>0)}var S0,E0,R0,A0,I0,C0,D0,O0,V0,k0,M0,L0,P0,j0,F0,B0,U0,z0,q0,K0,G0,$0,W0,H0,N0,Y0,X0,Q0,J0,Z0,ew,tw,iw,rw,nw,ow,aw,sw,lw,uw,cw,dw,hw,fw,pw,mw,gw,bw,vw,yw,_w,xw;function nL(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:ww(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ww(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:oL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return sL(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function oL(t){var e=aL(t,"string");return typeof e=="symbol"?e:e+""}function aL(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 ww(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 sL(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 dL=256,hL=48,fL=200,pL=480,mL="b",Ew=8,Rw=32,Aw='[data-ref="menu-button"]';function gL(t){return t.metaKey||t.ctrlKey}function bL(){return typeof window<"u"&&typeof window.matchMedia=="function"}function Mn(t){return t==="left"||t==="right"}var Ln,Iw=class extends Tw{static{({e:[R0,A0,I0,C0,D0,O0,V0,k0,M0,L0,P0,j0,F0,B0,U0,z0,q0,K0,G0,$0,W0,H0,N0,Y0,X0,Q0,J0,Z0,ew,tw,iw,rw,nw,ow,aw,sw,lw,uw,cw,dw,hw,fw,pw,mw,gw,bw,vw,yw,_w,xw,S0],c:[Ln,E0]}=nL(this,[lL("rui-sidebar")],[[[me({type:String,reflect:!0,defaultValue:"sidebar"}),rr([{attr:"data-variant"},{ref:"root",attr:"data-variant"},{ref:"pane",attr:"data-variant"}])],0,"variant"],[[me({type:String,reflect:!0,defaultValue:"left"}),rr([{attr:"data-side"},{ref:"root",attr:"data-side"},{ref:"pane",attr:"data-side"}])],0,"side"],[[me({type:String,reflect:!0,defaultValue:"off"}),rr([{attr:"data-collapsible"},{ref:"root",attr:"data-collapsible"}])],0,"collapsible"],[me({type:Number,defaultValue:dL}),0,"defaultWidth"],[me({type:Number,reflect:!0,attribute:"width"}),0,"width"],[me({type:Number,defaultValue:fL}),0,"minWidth"],[me({type:Number,defaultValue:pL}),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"}),rr([{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"],[kn({ref:"root"}),0,"rootTarget"],[kn({ref:"pane"}),0,"paneTarget"],[kn({ref:"handle"}),0,"handleTarget"],[kn({ref:"scrim"}),0,"scrimTarget"],[ja({name:"rui-sidebar-toggle",bubbles:!0,composed:!0}),0,"toggleEvent"],[ja({name:"rui-sidebar-resize",bubbles:!0,composed:!0}),0,"resizeEvent"],[ja({name:"rui-sidebar-mobile-change",bubbles:!0,composed:!0}),0,"mobileChangeEvent"],[[uL,rr([{attr:"data-mobile"},{ref:"root",attr:"data-mobile"}])],0,"isMobile"],[Fa(["open","collapsible","variant","side","width","defaultWidth","defaultOpen","minWidth","maxWidth","isMobile","resizable","label"]),2,"onStateUpdated"],[Fa(["mobileBreakpoint"]),2,"onMobileBreakpointUpdated"],[Fa(["matchActive","matchMode","navigationEvents"]),2,"onMatchSettingsUpdated"],[Sw,2,"onPointerMove"],[Sw,2,"onPointerUp"],[nr({ref:"handle",type:"pointerdown"}),2,"onHandlePointerDown"],[nr({ref:"handle",type:"keydown"}),2,"onHandleKeydown"],[nr({ref:"scrim",type:"click"}),2,"onScrimClick"],[nr({selector:Aw,type:"click"}),2,"onMenuLinkClick"],[nr({document:!0,type:"keydown"}),2,"onHostKeydown"]],0,void 0,Tw))}variant=(S0(this),R0(this));side=(A0(this),I0(this));collapsible=(C0(this),D0(this));defaultWidth=(O0(this),V0(this));width=(k0(this),M0(this));minWidth=(L0(this),P0(this));maxWidth=(j0(this),F0(this));resizable=(B0(this),U0(this));defaultOpen=(z0(this),q0(this));mobileDefaultOpen=(K0(this),G0(this));open=($0(this),W0(this));mobileBreakpoint=(H0(this),N0(this));label=(Y0(this),X0(this));matchActive=(Q0(this),J0(this,!1));matchMode=(Z0(this),ew(this));scrollActiveOnMount=(tw(this),iw(this,!1));navigationEvents=(rw(this),nw(this,""));rootTarget=(ow(this),aw(this));paneTarget=(sw(this),lw(this));handleTarget=(uw(this),cw(this));scrimTarget=(dw(this),hw(this));toggleEvent=(fw(this),pw(this));resizeEvent=(mw(this),gw(this));mobileChangeEvent=(bw(this),vw(this));isMobile=(yw(this),_w(this,!1));mediaQuery=(xw(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",Mn(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(Aw)){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(cL||!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 Vn(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||!bL()){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"?hL: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=Mn(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=Mn(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=Mn(this.side),d=s?"ArrowLeft":"ArrowUp",h=s?"ArrowRight":"ArrowDown",a=r;if(i.key===d)a=r-(i.shiftKey?Rw:Ew);else if(i.key===h)a=r+(i.shiftKey?Rw:Ew);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}gL(i)&&i.key.toLowerCase()===mL&&(i.preventDefault(),this.toggle())}static{E0()}};import{RadiantElement as Xw,bindTo as Pn,customElement as wL,onEvent as TL,onUpdated as Qw,prop as or,query as SL,state as Ba}from"@ecopages/radiant";var Cw,Dw,Ow,Vw,kw,Mw,Lw,Pw,jw,Fw,Bw,Uw,zw,qw,Kw,Gw,$w,Ww,Hw,Nw;function vL(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:Yw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Yw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:yL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return xL(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function yL(t){var e=_L(t,"string");return typeof e=="symbol"?e:e+""}function _L(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 Yw(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 xL(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 Jw="Toggle sidebar",EL=["filled","outline","ghost"],RL=["sm","md","lg"];function eT({variant:t,size:e}){return`rui-button rui-button--${t} rui-button--${e} rui-sidebar__trigger`}function AL(t){return t==="inset"?"collapsed":"expanded"}var jn,Zw=class extends Xw{static{({e:[Ow,Vw,kw,Mw,Lw,Pw,jw,Fw,Bw,Uw,zw,qw,Kw,Gw,$w,Ww,Hw,Nw,Cw],c:[jn,Dw]}=vL(this,[wL("rui-sidebar-trigger")],[[or({type:String,defaultValue:""}),0,"controls"],[[or({type:String,attribute:"button-label",defaultValue:Jw}),Pn({ref:"button",attr:"aria-label",map:e=>e?.trim()||Jw})],0,"buttonLabel"],[or({type:String,reflect:!0,defaultValue:""}),0,"placement"],[or({type:String,defaultValue:"ghost"}),0,"variant"],[or({type:String,defaultValue:"md"}),0,"size"],[SL({ref:"button"}),0,"buttonTarget"],[[Ba,Pn([{attr:"data-sidebar-state"},{ref:"button",attr:"aria-expanded",map:e=>String(e==="expanded")}])],0,"sidebarState"],[[Ba,Pn({attr:"data-sidebar-mobile"})],0,"sidebarMobile"],[[Ba,Pn({attr:"data-sidebar-collapsible"})],0,"sidebarCollapsible"],[Qw(["controls","placement"]),2,"onTargetUpdated"],[Qw(["variant","size"]),2,"onPresentationUpdated"],[TL({ref:"button",type:"click"}),2,"onButtonClick"]],0,void 0,Xw))}controls=(Cw(this),Ow(this));buttonLabel=(Vw(this),kw(this));placement=(Mw(this),Lw(this));variant=(Pw(this),jw(this));size=(Fw(this),Bw(this));buttonTarget=(Uw(this),zw(this));sidebarState=(qw(this),Kw(this,"expanded"));sidebarMobile=(Gw(this),$w(this,null));sidebarCollapsible=(Ww(this),Hw(this,null));sidebarObserver=(Nw(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 EL)e.toggle(`rui-button--${i}`,i===this.variant);for(let i of RL)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=AL(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{Dw()}};import{jsx as we,jsxs as ar}from"@ecopages/jsx/jsx-runtime";function IL(){return ar("span",{class:"rui-sidebar__trigger-icon","aria-hidden":"true",children:[ar("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"})]}),ar("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"})]}),ar("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"})]}),ar("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 CL({children:t,triggerLabel:e,placement:i,variant:r="ghost",size:s="md",controls:d,...h}){return we(jn,{...h,"prop:buttonLabel":e,placement:i,variant:r,size:s,controls:d,children:we("button",{"data-ref":"button",type:"button",class:eT({variant:r,size:s}),children:t??we(IL,{})})})}import{jsx as se,jsxs as sr}from"@ecopages/jsx/jsx-runtime";function Ua(t,...e){let i={...t};for(let r of e)delete i[r];return i}function DL({layout:t="default",siteHeader:e,sidebar:i,children:r,class:s,...d}){return t==="docs"?sr("div",{...d,class:j("rui-sidebar-provider",s),"data-layout":t,children:[e?se("div",{class:"rui-sidebar-provider__site-header",children:e}):null,sr("div",{class:"rui-sidebar-provider__body",children:[i,r]})]}):sr("div",{...d,class:j("rui-sidebar-provider",s),"data-layout":t,children:[i,r]})}function OL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__header",e),children:t})}function VL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__content",e),children:t})}function kL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__footer",e),children:t})}function ML({class:t,...e}){return se("hr",{...e,role:"separator","aria-orientation":"horizontal",class:j("rui-sidebar__separator",t)})}function LL({children:t,class:e,...i}){return se("section",{...i,class:j("rui-sidebar__group",e),children:t})}function tT({children:t,class:e,...i}){return se("h2",{...i,class:j("rui-sidebar__group-label",e),children:t})}function PL({children:t,class:e,...i}){return se("button",{...i,type:"button",class:j("rui-sidebar__group-action",e),children:t})}function jL({label:t,action:e,class:i,...r}){return sr("div",{...r,class:j("rui-sidebar__group-header",i),children:[se(tT,{children:t}),e]})}function FL({children:t,class:e,...i}){return se("ul",{...i,role:"list",class:j("rui-sidebar__menu",e),children:t})}function BL({children:t,class:e,...i}){return se("li",{...i,class:j("rui-sidebar__menu-item",e),children:t})}function iT(t){if(t.href!==void 0){let{children:K,class:G,isActive:V,href:$,tooltip:W,aria:O,title:_,"aria-current":H,...N}=t;return se("a",{...Ua(N,"as"),aria:ne(O,typeof K=="string"?void 0:W),href:$,"data-ref":"menu-button",class:j("rui-sidebar__menu-button",V&&"rui-sidebar__menu-button--active",G),"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",{...Ua(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 UL(t){let{class:e,...i}=t;return se(iT,{class:j("rui-sidebar__menu-action",e),...i})}function zL({children:t,class:e,...i}){return se("main",{...i,class:j("rui-sidebar__inset",e),children:t})}function qL({children:t,open:e,label:i,...r}){return se(Ln,{...r,"prop:open":e,label:i,children:sr("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 NT,customElement as HL,event as NL,onEvent as lr,onUpdated as YL,prop as Ve,query as Rt}from"@ecopages/radiant";import{FormAssociatedElement as YT}from"@ecopages/radiant/form-associated-element";var rT,nT,oT,aT,sT,lT,uT,cT,dT,hT,fT,pT,mT,gT,bT,vT,yT,_T,xT,wT,TT,ST,ET,RT,AT,IT,CT,DT,OT,VT,kT,MT,LT,PT,jT,FT,BT,UT,zT,qT,KT,GT,$T,WT;function KL(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:HT(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||HT(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:GL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return WL(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function GL(t){var e=$L(t,"string");return typeof e=="symbol"?e:e+""}function $L(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 HT(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 WL(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 za=50,qa=25,Ka=75,QT=100;function JT(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 XL(t){return Array.isArray(t.value)?[...t.value]:typeof t.value=="number"?[t.value]:t.variant==="range"?[qa,Ka]:[za]}function ZT(t){let e=We(t.min,t.max,t.step);if(t.variant==="range"||t.values.length>=2){let i=t.values[0]??qa,r=t.values[1]??Ka;return JT(e,i,r,t.minDistance??0)}return[e.clamp(t.values[0]??za)]}function eS(t,e,i){let r=yi(e,i);return t.length===2?`${$e(t[0],r)} \u2013 ${$e(t[1],r)}`:$e(t[0],r)}function tS(t){let e=t.variant??"single",i=t.min??0,r=t.max??QT,s=t.step??1,d=t.minDistance??0,h=XL(t),a=ZT({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:yi(s,t.valuePrecision),readoutText:eS(a,s,t.valuePrecision),trackStyle:iS(a,E),isRange:a.length===2,valuePrecision:typeof t.valuePrecision=="number"&&Number.isFinite(t.valuePrecision)?t.valuePrecision:void 0}}function iS(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 Fn,XT=class extends YT{static{({e:[oT,aT,sT,lT,uT,cT,dT,hT,fT,pT,mT,gT,bT,vT,yT,_T,xT,wT,TT,ST,ET,RT,AT,IT,CT,DT,OT,VT,kT,MT,LT,PT,jT,FT,BT,UT,zT,qT,KT,GT,$T,WT,rT],c:[Fn,nT]}=KL(this,[HL("rui-slider")],[[Ve({type:String,defaultValue:"single"}),0,"variant"],[Ve({type:String,defaultValue:"horizontal"}),0,"orientation"],[Ve({type:Array,reflect:!0,defaultValue:[za],transform:Lr}),0,"value"],[Ve({type:Number,defaultValue:0}),0,"min"],[Ve({type:Number,defaultValue:QT}),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:""}),NT([{ref:"label",bool:"hidden",invert:!0},{ref:"label",text:!0}])],0,"label"],[[Ve({type:Boolean,attribute:"show-value",defaultValue:!1}),NT({selector:"[data-default-value]",bool:"hidden",invert:!0})],0,"showValue"],[Ve({type:Boolean,attribute:"value-title",defaultValue:!1}),0,"valueTitle"],[NL({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"],[YL(["value","min","max","step","valuePrecision","minDistance","variant","orientation","disabled","readOnly","effectiveDisabled","label","name","showValue","valueTitle"]),2,"onPropsUpdated"],[lr({ref:"rangeTrack",type:"pointerdown"}),2,"onPointerDown"],[lr({document:!0,type:"pointermove"}),2,"onPointerMove"],[lr({document:!0,type:"pointerup"}),2,"onPointerUp"],[lr({document:!0,type:"pointercancel"}),2,"onPointerCancel"],[lr({selector:"[data-thumb]",type:"keydown"}),2,"onThumbKeydown"]],0,void 0,YT))}variant=(rT(this),oT(this));orientation=(aT(this),sT(this));value=(lT(this),uT(this));min=(cT(this),dT(this));max=(hT(this),fT(this));step=(pT(this),mT(this));valuePrecision=(gT(this),bT(this));minDistance=(vT(this),yT(this));readOnly=(_T(this),xT(this));label=(wT(this),TT(this));showValue=(ST(this),ET(this));valueTitle=(RT(this),AT(this));changeEvent=(IT(this),CT(this));rootTarget=(DT(this),OT(this));headerTarget=(VT(this),kT(this));labelTarget=(MT(this),LT(this));rangeTrack=(PT(this),jT(this));valueTarget=(FT(this),BT(this));singleThumb=(UT(this),zT(this));rangeMinThumb=(qT(this),KT(this));rangeMaxThumb=(GT(this),$T(this));activeThumb=(WT(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):qa,s=i!==null?Number(i):Ka;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 yi(this.step,this.valuePrecision)}formatValue(e){return $e(e,this.resolvedValuePrecision)}formatValues(e){return eS(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 JT(this.numericRange,e,i,this.minDistance,r)}committedValues(){return ZT({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)=>Xi(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=iS(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=gn(this.numericRange,d,e.key);h!=null&&(e.preventDefault(),this.lastEmitted=s.join(","),this.moveThumb(r,h),this.commit())}static{nT()}};import{jsx as Ue,jsxs as Ga}from"@ecopages/jsx/jsx-runtime";function rS({children:t,class:e,...i}){return Ue("span",{...i,class:j("rui-slider__value",e),"data-ref":"value","aria-hidden":"true",children:t})}function QL({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=$e(S,h),K=$e(I,h);return Ue("div",{class:"rui-slider__range",children:Ga("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 JL({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,...G}){let V=tS({variant:t,value:S,min:a,max:E,step:A,minDistance:T,valuePrecision:I}),$=K??Ue(rS,{"data-default-value":!0,hidden:!r,children:V.readoutText}),W=!!K||r;return Ue(Fn,{...G,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(ZL,{seed:V,orientation:e,label:i,disabled:d,hasVisibleReadout:W,valueReadout:$})})}function ZL({seed:t,orientation:e,label:i,disabled:r,hasVisibleReadout:s,valueReadout:d}){return Ga("div",{class:j("rui-slider",t.isRange?"rui-slider--range":"rui-slider--single",e==="vertical"&&"rui-slider--vertical"),"data-ref":"root",children:[Ga("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(QL,{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 eP}from"@ecopages/jsx/jsx-runtime";function tP({size:t="md",aria:e,class:i,...r}){return eP("span",{...r,role:"status",aria:ne(e,"Loading"),class:j("rui-spinner",`rui-spinner--${t}`,i)})}import{RadiantElement as mS,bindTo as $a,customElement as aP,event as sP,onEvent as lP,prop as Wa}from"@ecopages/radiant";var nS,oS,aS,sS,lS,uS,cS,dS,hS,fS;function iP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:pS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||pS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:rP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return oP(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function rP(t){var e=nP(t,"string");return typeof e=="symbol"?e:e+""}function nP(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 pS(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 oP(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 Bn,gS=class extends mS{static{({e:[aS,sS,lS,uS,cS,dS,hS,fS,nS],c:[Bn,oS]}=iP(this,[aP("rui-switch")],[[[Wa({type:Boolean,reflect:!0,defaultValue:!1}),$a({ref:"input",prop:"checked"})],0,"checked"],[[Wa({type:Boolean,reflect:!0,defaultValue:!1}),$a({ref:"input",prop:"disabled"})],0,"disabled"],[[Wa({type:String,defaultValue:""}),$a({ref:"input",attr:"name",map:gt})],0,"name"],[sP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[lP({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,mS))}constructor(...e){super(...e),fS(this)}checked=(nS(this),aS(this));disabled=(sS(this),lS(this));name=(uS(this),cS(this));changeEvent=(dS(this),hS(this));onInputChange(e){let i=e.target;this.checked=i.checked,this.changeEvent.emit({checked:this.checked})}static{oS()}};import{jsx as ur,jsxs as uP}from"@ecopages/jsx/jsx-runtime";function cP({children:t,checked:e,disabled:i,name:r,...s}){return ur(Bn,{...s,checked:e,disabled:i,name:r,children:uP("label",{class:"rui-switch",children:[ur("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}),ur("span",{class:"rui-switch__track","aria-hidden":"true",children:ur("span",{class:"rui-switch__thumb"})}),ur("span",{class:"rui-switch__label",children:t})]})})}import{jsx as fe,jsxs as zS}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as FS,customElement as mP,event as Ha,onEvent as Ti,onUpdated as BS,prop as Si}from"@ecopages/radiant";var bS,vS,yS,_S,xS,wS,TS,SS,ES,RS,AS,IS,CS,DS,OS,VS,kS,MS,LS,PS;function dP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:jS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||jS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:hP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return pP(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function hP(t){var e=fP(t,"string");return typeof e=="symbol"?e:e+""}function fP(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 jS(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 pP(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 Un,US=class extends FS{static{({e:[yS,_S,xS,wS,TS,SS,ES,RS,AS,IS,CS,DS,OS,VS,kS,MS,LS,PS,bS],c:[Un,vS]}=dP(this,[mP("rui-table")],[[Si({type:String,defaultValue:""}),0,"label"],[Si({type:String,attribute:"aria-busy",defaultValue:"false"}),0,"ariaBusy"],[Si({type:String,attribute:"selection-mode",defaultValue:"none"}),0,"selectionMode"],[Si({...Ie,defaultValue:[]}),0,"value"],[Si({type:String,attribute:"sort-column",reflect:!0,defaultValue:""}),0,"sortColumn"],[Si({type:String,attribute:"sort-direction",reflect:!0,defaultValue:"ascending"}),0,"sortDirection"],[Ha({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Ha({name:"rui-sort-change",bubbles:!0,composed:!0}),0,"sortChangeEvent"],[Ha({name:"rui-row-action",bubbles:!0,composed:!0}),0,"rowActionEvent"],[BS(["value","selectionMode"]),2,"onSelectionUpdated"],[BS(["sortColumn","sortDirection"]),2,"onSortUpdated"],[Ti({selector:"[data-table-cell]",type:"click"}),2,"onCellClick"],[Ti({selector:"[data-table-cell]",type:"dblclick"}),2,"onCellDoubleClick"],[Ti({selector:"[data-table-cell]",type:"keydown"}),2,"onCellKeydown"],[Ti({selector:"rui-checkbox[data-table-select-row]",type:"rui-change"}),2,"onRowSelectionChange"],[Ti({selector:"rui-checkbox[data-table-select-all]",type:"rui-change"}),2,"onSelectAllChange"],[Ti({selector:"[data-table-sort]",type:"click"}),2,"onSortClick"]],0,void 0,FS))}label=(bS(this),yS(this));ariaBusy=(_S(this),xS(this));selectionMode=(wS(this),TS(this));value=(SS(this),ES(this));sortColumn=(RS(this),AS(this));sortDirection=(IS(this),CS(this));changeEvent=(DS(this),OS(this));sortChangeEvent=(VS(this),kS(this));rowActionEvent=(MS(this),LS(this));structureObserver=void PS(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{vS()}};function gP({children:t,class:e,...i}){return fe("div",{...i,role:"rowgroup",class:j("rui-table__header",e),children:fe("div",{class:"rui-table__row",role:"row",children:t})})}function bP({children:t,class:e,...i}){return fe("div",{...i,role:"rowgroup",class:j("rui-table__body",e),children:t})}function vP({children:t,class:e,...i}){return fe("div",{...i,role:"rowgroup",class:j("rui-table__footer",e),children:fe("div",{class:"rui-table__row",role:"row",children:t})})}function yP({id:t,allowsSorting:e=!1,isRowHeader:i=!1,children:r,class:s,...d}){return fe("div",{...d,role:"columnheader","data-table-column":t,"data-table-row-header":i?"":void 0,class:j("rui-table__column",s),children:e?zS("button",{type:"button","data-table-sort":t,class:"rui-table__sort",children:[fe("span",{children:r}),fe("span",{class:"rui-table__sort-indicator","aria-hidden":"true"})]}):r})}function _P({id:t,disabled:e,actionable:i,children:r,class:s,...d}){return fe("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 xP({isRowHeader:t=!1,children:e,class:i,...r}){return fe("div",{...r,role:t?"rowheader":"gridcell","data-table-cell":!0,tabindex:-1,class:j("rui-table__cell",i),children:e})}function wP({scope:t,label:e,class:i,...r}){let s=t==="all";return fe("div",{...r,role:s?"columnheader":"gridcell","data-table-cell":!0,"data-table-selection-cell":t,class:j("rui-table__selection-cell",i),children:fe(Mi,{"data-table-select-all":s?"":void 0,"data-table-select-row":s?void 0:"",children:fe("span",{class:"sr-only",children:e??(s?"Select all rows":"Select row")})})})}function TP({colSpan:t,children:e,class:i,...r}){let s=Math.max(1,Math.floor(t));return zS("div",{role:"row",class:"rui-table__row rui-table__row--empty",children:[fe("div",{...r,role:"gridcell","aria-colspan":s,class:j("rui-table__empty-state",i),children:fe("span",{class:"rui-table__empty-state-message",children:e})}),Array.from({length:s-1},(d,h)=>fe("div",{"aria-hidden":"true",class:"rui-table__empty-state-spacer"},h))]})}function SP({children:t,label:e,ariaBusy:i,selectionMode:r,value:s,...d}){return fe(Un,{...d,value:s,label:e,ariaBusy:i,selectionMode:r,children:fe("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 tE,customElement as CP,event as DP,onEvent as iE,onUpdated as OP,prop as zn}from"@ecopages/radiant";var qS,KS,GS,$S,WS,HS,NS,YS,XS,QS,JS,ZS;function EP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:eE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||eE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:RP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return IP(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function RP(t){var e=AP(t,"string");return typeof e=="symbol"?e:e+""}function AP(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 eE(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 IP(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 Na,rE=class extends tE{static{({e:[GS,$S,WS,HS,NS,YS,XS,QS,JS,ZS,qS],c:[Na,KS]}=EP(this,[CP("rui-tabs")],[[zn({type:String,reflect:!0,defaultValue:"boxed"}),0,"variant"],[zn({type:String,reflect:!0,defaultValue:""}),0,"value"],[zn({type:String,defaultValue:""}),0,"label"],[zn({type:Boolean,defaultValue:!0}),0,"automatic"],[DP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[OP(["value","label"]),2,"onPropsUpdated"],[iE({selector:'[role="tab"]',type:"click"}),2,"onTabClick"],[iE({selector:'[role="tab"]',type:"keydown"}),2,"onTabKeydown"]],0,void 0,tE))}variant=(qS(this),GS(this));value=($S(this),WS(this));label=(HS(this),NS(this));automatic=(YS(this),XS(this));changeEvent=(QS(this),JS(this));childObserver=(ZS(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{KS()}};import{jsx as qn}from"@ecopages/jsx/jsx-runtime";function VP({children:t,class:e,...i}){return qn("div",{...i,class:j("rui-tabs__list",e),role:"tablist",children:t})}function kP({id:t,children:e,class:i,disabled:r,selected:s,...d}){return qn("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 MP({children:t,class:e,...i}){return qn("div",{...i,class:j("rui-tabs__panels",e),children:t})}function LP({id:t,children:e,class:i,selected:r,hidden:s,...d}){return qn("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})}import{jsx as PP}from"@ecopages/jsx/jsx-runtime";function jP(t){let{class:e,rows:i=3,...r}=t;return PP("textarea",{...r,rows:i,[ot]:"","data-rui-control-type":"text",class:j("rui-textarea",e)})}import{jsx as ut,jsxs as DE}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as OE,bindTo as ts,bound as is,customElement as WP,onEvent as VE,onUpdated as rs,prop as Ye,query as HP}from"@ecopages/radiant";var cr="rui-toast-show",dr="rui-toast-dismiss",FP=["top-start","top-center","top-end","bottom-start","bottom-center","bottom-end"],hr=4e3,BP=356,Ya=14,Xa=24,Qa=3,Ja=3,fr=45,Za=200,pr="bottom-end";function lt(t){let[e,i]=t.split("-");return{y:e,x:i}}var UP=1;function zP(){return UP++}function nE(t,e){return typeof t=="function"?t(e):t}var es=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??zP(),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(nE(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(nE(i.error,d),{id:r,variant:"error",description:h,duration:i.duration,action:i.action,closeButton:i.closeButton,position:i.position})}),r}},le=new es;var oE,aE,sE,lE,uE,cE,dE,hE,fE,pE,mE,gE,bE,vE,yE,_E,xE,wE,TE,SE,EE,RE,AE,IE;function qP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:CE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||CE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:KP(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||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function KP(t){var e=GP(t,"string");return typeof e=="symbol"?e:e+""}function GP(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 CE(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 mr=new Map,Gn=new Map;function ns(t){return String(t)}function Kn(t){if(t==="")return;let e=ns(t);mr.delete(e),Gn.delete(e)}function NP(t){if(t==="")return;let e=ns(t),i=mr.get(e);i!=null&&(Gn.set(e,Math.max(0,i-Date.now())),mr.delete(e))}var Ei,kE=class extends OE{static{({e:[sE,lE,uE,cE,dE,hE,fE,pE,mE,gE,bE,vE,yE,_E,xE,wE,TE,SE,EE,RE,AE,IE,oE],c:[Ei,aE]}=qP(this,[WP("rui-toast")],[[Ye({type:String,reflect:!0,defaultValue:""}),0,"toastId"],[Ye({type:String,defaultValue:""}),0,"title"],[Ye({type:String,defaultValue:""}),0,"description"],[[Ye({type:String,reflect:!0,defaultValue:"default"}),ts({attr:"data-variant",map:e=>e??"default"})],0,"variant"],[Ye({type:Number,defaultValue:4e3}),0,"duration"],[[Ye({type:Boolean,defaultValue:!0}),ts({attr:"data-dismissible"})],0,"dismissible"],[Ye({type:Boolean,defaultValue:!1}),0,"closeButton"],[Ye({type:String,defaultValue:""}),0,"actionLabel"],[[Ye({type:String,defaultValue:pr}),ts([{attr:"data-y-position",map:e=>lt(e).y},{attr:"data-x-position",map:e=>lt(e).x}])],0,"position"],[Ye({type:Boolean,defaultValue:!1}),0,"markedDelete"],[HP({ref:"toast"}),0,"toastTarget"],[rs("position"),2,"onPositionUpdated"],[rs("duration"),2,"onDurationUpdated"],[rs("markedDelete"),2,"onMarkedDeleteUpdated"],[is,2,"onPointerDown"],[is,2,"onPointerMove"],[is,2,"onPointerUp"],[VE({selector:"[data-toast-close]",type:"click"}),2,"onCloseClick"],[VE({selector:"[data-toast-action]",type:"click"}),2,"onActionClick"]],0,void 0,OE))}toastId=(oE(this),sE(this));title=(lE(this),uE(this));description=(cE(this),dE(this));variant=(hE(this),fE(this));duration=(pE(this),mE(this));dismissible=(gE(this),bE(this));closeButton=(vE(this),yE(this));actionLabel=(_E(this),xE(this));position=(wE(this),TE(this));markedDelete=(SE(this),EE(this));toastTarget=(RE(this),AE(this));mounted=(IE(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?(NP(this.resolvedId),this.clearTimer()):this.startTimer())}onDurationUpdated(){!this.timerReady||!this.mounted||this.removed||this.held||(Kn(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=ns(e),r=Date.now(),s=Gn.get(i);if(Gn.delete(i),s==null){let d=mr.get(i);s=d!=null?d-r:this.duration}if(s<=0){Kn(e),this.beginRemove();return}mr.set(i,r+s),this.clearTimer(),this.timeoutId=setTimeout(()=>{Kn(e),this.beginRemove()},s)}beginRemove(){this.removed||(this.removed=!0,this.clearTimer(),Kn(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(Ai,{});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 DE("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,DE("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{aE()}};import{jsx as os}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as aR,bindTo as ZP,bound as $n,customElement as ej,onEvent as as,onUpdated as tj,prop as At,query as ij,state as rj}from"@ecopages/radiant";function ME(t,e,i){let r=0;for(let s=0;s<t;s+=1)r+=e[s]??0;return r+t*i}function LE(t,e){return t.length===0?0:t.reduce((r,s)=>r+s,0)+Math.max(0,t.length-1)*e}function PE(t,e,i){return e<=0?0:t+Math.max(0,e-1)*i}var jE,FE,BE,UE,zE,qE,KE,GE,$E,WE,HE,NE,YE,XE,QE,JE,ZE,eR,tR,iR,rR,nR;function YP(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:oR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||oR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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||N(t),{e:a,get c(){var n=[];return W&&[N(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 oR(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}function sR(t,e){return t instanceof Node&&e.contains(t)}var ss,lR=class extends aR{static{({e:[BE,UE,zE,qE,KE,GE,$E,WE,HE,NE,YE,XE,QE,JE,ZE,eR,tR,iR,rR,nR,jE],c:[ss,FE]}=YP(this,[ej("rui-toaster")],[[[At({type:String,reflect:!0,defaultValue:pr}),ZP([{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"],[ij({ref:"list"}),0,"listTarget"],[rj,0,"toasts"],[tj(["position","duration","visibleToasts","closeButton","expand","gap","offset","container"]),2,"onConfigUpdated"],[as({document:!0,type:cr}),2,"onDocumentShow"],[as({document:!0,type:dr}),2,"onDocumentDismiss"],[as({selector:"rui-toast",type:"rui-toast-mounted"}),2,"onToastMounted"],[$n,2,"onPointerOver"],[$n,2,"onPointerOut"],[$n,2,"onPointerDown"],[$n,2,"onPointerUp"]],0,void 0,aR))}position=(jE(this),BE(this));duration=(UE(this),zE(this));visibleToasts=(qE(this),KE(this));closeButton=(GE(this),$E(this));expand=(WE(this),HE(this));gap=(NE(this),YE(this));offset=(XE(this),QE(this));container=(JE(this),ZE(this));listTarget=(eR(this),tR(this));toasts=(iR(this),rR(this,[]));expanded=(nR(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,G=ME(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",`${G}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*G}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 $=Math.max(.7,1-S*.05);I.style.setProperty("--rui-toast-y",`translateY(${s*S*this.gap}px) scale(${$})`),I.style.height=`${E}px`,I.style.overflow="hidden"}}let A=Math.min(d,h.length);e.style.height=`${i?LE(a,this.gap):PE(E,A,this.gap)}px`}onPointerOver(e){sR(e.relatedTarget,this)||(this.expanded=!0,this.syncPauseState())}onPointerOut(e){sR(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 os("section",{class:"rui-toaster-region","aria-label":"Notifications","aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",tabIndex:-1,children:os("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 os(Ei,{"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{FE()}};import{jsx as nj}from"@ecopages/jsx/jsx-runtime";function oj({toastId:t,...e}){return nj(Ei,{...e,toastId:t!=null?String(t):void 0})}var aj=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 sj(t){document.dispatchEvent(new CustomEvent(cr,{detail:t,bubbles:!0,composed:!0}))}function lj(t){let e=t==null?{}:{id:t};document.dispatchEvent(new CustomEvent(dr,{detail:e,bubbles:!0,composed:!0}))}import{jsx as Wn,jsxs as pj}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as OR,bound as mj,customElement as gj,onUpdated as bj,prop as gr,state as VR}from"@ecopages/radiant";import{isServer as kR}from"@ecopages/radiant/is-server";function uR(t,e){try{return t.querySelector(e)}catch{return null}}function cR(t,e){try{return Array.from(t.querySelectorAll(e))}catch{return[]}}function uj(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}function dR(t,e,i=r=>document.getElementById(r)!==null){if(t.id)return e.add(t.id),t.id;let r=uj(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 hR(t,e){return t instanceof HTMLElement?t.getBoundingClientRect().top+e:e}function fR(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 pR,mR,gR,bR,vR,yR,_R,xR,wR,TR,SR,ER,RR,AR,IR,CR;function cj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:DR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||DR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:dj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return fj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function dj(t){var e=hj(t,"string");return typeof e=="symbol"?e:e+""}function hj(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 DR(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 fj(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,MR=class extends OR{static{({e:[gR,bR,vR,yR,_R,xR,wR,TR,SR,ER,RR,AR,IR,CR,pR],c:[ls,mR]}=cj(this,[gj("rui-toc")],[[gr({type:String,attribute:"target",defaultValue:""}),0,"target"],[gr({type:String,attribute:"heading-selector",defaultValue:"h2,h3"}),0,"headingSelector"],[gr({type:String,defaultValue:"On this page"}),0,"label"],[gr({type:Number,attribute:"scroll-offset",defaultValue:120}),0,"scrollOffset"],[gr({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[VR,0,"entries"],[VR,0,"activeId"],[bj(["target","headingSelector","scrollOffset","navigationEvents"]),2,"onScanSettingsUpdated"],[mj,2,"onLinkClick"]],0,void 0,OR))}target=(pR(this),gR(this,""));headingSelector=(bR(this),vR(this,"h2,h3"));label=(yR(this),_R(this,"On this page"));scrollOffset=(xR(this),wR(this,120));navigationEvents=(TR(this),SR(this,""));entries=(ER(this),RR(this,[]));activeId=(AR(this),IR(this,null));headings=(CR(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=cR(e,this.readConfiguredProp(this.headingSelector,"heading-selector")||"h2,h3");if(i.length===0)return;let r=new Set,s=i.map(d=>({id:dR(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?uR(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(kR||!this.isConnected)return;let e=()=>this.rebuild();for(let i of Vn(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(kR||!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 hR(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}`),fR(i,this.scrollRoot??window,this.resolvedScrollOffset(),r)}render(){return this.entries.length===0?null:pj("nav",{class:"rui-toc","aria-label":this.$.label,children:[this.label?Wn("p",{class:"rui-toc__label",children:this.$.label}):null,Wn("ul",{class:"rui-toc__list",children:this.entries.map(e=>Wn("li",{class:e.depth>=3?"rui-toc__item rui-toc__item--depth-3":"rui-toc__item",children:Wn("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{mR()}};import{RadiantElement as qR,customElement as wj,onEvent as KR,prop as GR}from"@ecopages/radiant";var LR,PR,jR,FR,BR,UR;function vj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:zR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||zR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:yj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return xj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function yj(t){var e=_j(t,"string");return typeof e=="symbol"?e:e+""}function _j(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 zR(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 xj(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,$R=class extends qR{static{({e:[jR,FR,BR,UR,LR],c:[Hn,PR]}=vj(this,[wj("rui-toolbar")],[[GR({type:String,defaultValue:""}),0,"label"],[GR({type:Boolean,reflect:!0,defaultValue:!1}),0,"exclusiveToggles"],[KR({type:"keydown",selector:"button, a[href], input, select, [tabindex]"}),2,"onKeydown"],[KR({type:"click",selector:"button[data-toggle][aria-pressed]",options:{capture:!0}}),2,"onToggleButtonClick"]],0,void 0,qR))}constructor(...e){super(...e),UR(this)}label=(LR(this),jR(this));exclusiveToggles=(FR(this),BR(this));getItems(){return Nr(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{PR()}};import{jsx as WR}from"@ecopages/jsx/jsx-runtime";function Tj({children:t,label:e,...i}){return WR(Hn,{...i,label:e,children:WR("div",{class:"rui-toolbar","data-ref":"root",role:"toolbar","aria-label":e||void 0,children:t})})}import{RadiantElement as nA,bindTo as Ij,bound as oA,customElement as Cj,onEvent as us,onUpdated as Dj,prop as cs,query as Oj}from"@ecopages/radiant";var HR,NR,YR,XR,QR,JR,ZR,eA,tA,iA;function Sj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:rA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||rA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:Ej(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Aj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Ej(t){var e=Rj(t,"string");return typeof e=="symbol"?e:e+""}function Rj(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 rA(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 Aj(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 aA=8,Nn,sA=class extends nA{static{({e:[YR,XR,QR,JR,ZR,eA,tA,iA,HR],c:[Nn,NR]}=Sj(this,[Cj("rui-tooltip")],[[[Ij({ref:"tooltip",text:!0}),cs({type:String,defaultValue:""})],0,"content"],[cs({type:String,defaultValue:"top"}),0,"placement"],[cs({type:Number,defaultValue:200}),0,"delay"],[Oj({ref:"tooltip"}),0,"tooltipTarget"],[Dj(["content","placement"]),2,"onDescribedPropsUpdated"],[us({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[us({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[us({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[oA,2,"onPointerEnter"],[oA,2,"onPointerLeave"]],0,void 0,nA))}content=(HR(this),YR(this));placement=(XR(this),QR(this));delay=(JR(this),ZR(this));tooltipTarget=(eA(this),tA(this));open=(iA(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 di(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=Fr({anchor:this.getAnchor(),floating:this.tooltipTarget,getPlacement:()=>this.placement,gap:aA}))}onDescribedPropsUpdated(){this.wireTrigger(),this.open&&this.tooltipTarget&&jo(this.getAnchor(),this.tooltipTarget,this.placement,aA)}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()}static{NR()}};import{jsx as ds,jsxs as Vj}from"@ecopages/jsx/jsx-runtime";function kj({children:t,content:e="",...i}){return ds(Nn,{content:e,...i,children:Vj("span",{class:"rui-tooltip",children:[ds("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:t}),ds("span",{class:"rui-tooltip__content rui-floating","data-ref":"tooltip",role:"tooltip",hidden:!0,children:e})]})})}import{RadiantElement as bA,customElement as Fj,event as Bj,onEvent as vA,onUpdated as Uj,prop as yA}from"@ecopages/radiant";var lA,uA,cA,dA,hA,fA,pA,mA;function Mj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:Lj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return jj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Lj(t){var e=Pj(t,"string");return typeof e=="symbol"?e:e+""}function Pj(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 jj(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 Yn,_A=class extends bA{static{({e:[cA,dA,hA,fA,pA,mA,lA],c:[Yn,uA]}=Mj(this,[Fj("rui-tree")],[[yA({type:String,defaultValue:""}),0,"label"],[yA({type:String,reflect:!0,defaultValue:""}),0,"value"],[Bj({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Uj("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=(fA(this),pA(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]&&ni(r,s+i)}focusVisibleItem(e){let i=this.getVisibleItems(),r=i.indexOf(e);r>=0&&ni(i,r)}static{uA()}};import{Fragment as xA,jsx as ct,jsxs as zj}from"@ecopages/jsx/jsx-runtime";var wA=({nodes:t})=>ct(xA,{children:t.map(e=>ct("li",{class:"rui-tree__item",children:e.children?.length?zj(xA,{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(wA,{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(wA,{nodes:t}):i;return ct(Yn,{...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 VA,customElement as Hj,event as Nj,onEvent as kA,onUpdated as Yj,prop as MA}from"@ecopages/radiant";var TA,SA,EA,RA,AA,IA,CA,DA;function Kj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:OA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||OA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:Gj(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||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Gj(t){var e=$j(t,"string");return typeof e=="symbol"?e:e+""}function $j(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 OA(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 Xn,LA=class extends VA{static{({e:[EA,RA,AA,IA,CA,DA,TA],c:[Xn,SA]}=Kj(this,[Hj("rui-treegrid")],[[MA({type:String,defaultValue:""}),0,"label"],[MA({type:String,reflect:!0,defaultValue:""}),0,"value"],[Nj({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Yj("value"),2,"onValueUpdated"],[kA({selector:'[role="gridcell"]',type:"click"}),2,"onCellClick"],[kA({selector:'[role="gridcell"]',type:"keydown"}),2,"onCellKeydown"]],0,void 0,VA))}label=(TA(this),EA(this));value=(RA(this),AA(this));changeEvent=(IA(this),CA(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&&ni(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=(DA(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{SA()}};import{Fragment as Xj,jsx as dt,jsxs as Qj}from"@ecopages/jsx/jsx-runtime";var PA=({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(PA,{rows:i.children,depth:e+1})},`${i.id}-group`)),r});function Jj({columns:t,rows:e,label:i,children:r,...s}){let d=t!=null&&e!=null?Qj(Xj,{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(PA,{rows:e})]}):r;return dt(Xn,{...s,label:i,children:dt("div",{class:"rui-treegrid","data-ref":"root",role:"treegrid","aria-label":i||void 0,children:d})})}import{RadiantElement as JA,bindTo as hs,bound as ZA,customElement as r2,event as n2,onEvent as eI,onUpdated as o2,prop as fs,query as tI}from"@ecopages/radiant";var jA,FA,BA,UA,zA,qA,KA,GA,$A,WA,HA,NA,YA,XA;function Zj(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,V=Object.create,$=[V(null),V(null)],W=e.length;function O(n,g,p){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,p?[l]:[]);return p?l:o}}function _(n,g,p,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,p,o,l,b,w,m,v,y,Y){function F(c){if(!Y(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:QA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||QA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=$[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");$[+m][o]=l<3?1:l}}for(var f=n,L=B.length-1;L>=0;L-=p?2:1){var Z=_(B[L],"A decorator","be",!0),ee=p?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,f,D),q.v=1,_(a,"class decorators","return")&&(f=a);else if(D.static=m,D.private=v,a=D.access={has:v?Y.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}),f=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof f=="object"&&f)(a=_(f.get,"accessor.get"))&&(u.get=a),(a=_(f.set,"accessor.set"))&&(u.set=a),(a=_(f.init,"accessor.init"))&&z.unshift(a);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(f,(y?"field":"method")+" decorators","return")&&(y?z.unshift(f):u[x]=f)}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])):G(n,o,u)),f}function N(n){return G(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 p=0;p<i.length;p++){var o=i[p],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:e2(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return i2(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||N(t),{e:a,get c(){var n=[];return W&&[N(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function e2(t){var e=t2(t,"string");return typeof e=="symbol"?e:e+""}function t2(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 QA(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 i2(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 ps(t){return t!=="vertical"}var Qn,iI=class extends JA{static{({e:[BA,UA,zA,qA,KA,GA,$A,WA,HA,NA,YA,XA,jA],c:[Qn,FA]}=Zj(this,[r2("rui-window-splitter")],[[[fs({type:Number,reflect:!0,defaultValue:50}),hs({ref:"separator",attr:"aria-valuenow"})],0,"value"],[[fs({type:String,defaultValue:"horizontal"}),hs({ref:"separator",attr:"aria-orientation",map:e=>ps(e)?"vertical":"horizontal"})],0,"orientation"],[[fs({type:String,defaultValue:"Split view"}),hs({ref:"separator",attr:"aria-label"})],0,"label"],[tI({ref:"primary"}),0,"primaryTarget"],[tI({ref:"separator"}),0,"separatorTarget"],[n2({name:"rui-splitter-change",bubbles:!0,composed:!0}),0,"changeEvent"],[o2(["value","orientation"]),2,"onPropsUpdated"],[eI({ref:"separator",type:"keydown"}),2,"onKeydown"],[eI({ref:"separator",type:"pointerdown"}),2,"onPointerDown"],[ZA,2,"onPointerMove"],[ZA,2,"onPointerUp"]],0,void 0,JA))}value=(jA(this),BA(this));orientation=(UA(this),zA(this));label=(qA(this),KA(this));primaryTarget=(GA(this),$A(this));separatorTarget=(WA(this),HA(this));changeEvent=(NA(this),YA(this));dragging=(XA(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=ps(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=ps(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{FA()}};import{jsx as Jn,jsxs as a2}from"@ecopages/jsx/jsx-runtime";function s2({primary:t,secondary:e,orientation:i="horizontal",...r}){return Jn(Qn,{...r,orientation:i,children:a2("div",{class:j("rui-window-splitter",i!=="vertical"?"rui-window-splitter--horizontal":"rui-window-splitter--vertical"),"data-ref":"root",children:[Jn("div",{"data-ref":"primary",class:"rui-window-splitter__pane",children:t}),Jn("div",{"data-ref":"separator",class:"rui-window-splitter__separator",role:"separator",tabindex:0,"aria-valuemin":It,"aria-valuemax":Ct}),Jn("div",{"data-ref":"secondary",class:"rui-window-splitter__pane",children:e})]})})}export{pr as DEFAULT_TOAST_POSITION,Wi as FormStore,jy as NAVIGATION_MENU_DEFAULT_CLOSE_DELAY,Py as NAVIGATION_MENU_DEFAULT_HOVER_DELAY,ot as RUI_CONTROL_ATTR,Jo as RUI_DIALOG_ACTION_EVENT,Xr as RUI_DIALOG_CLOSE_EVENT,nt as RUI_DIALOG_HOST_ID,Yr as RUI_DIALOG_OPEN_EVENT,Qr as RUI_DIALOG_TOGGLE_EVENT,on as RUI_FIELD_DESCRIPTION_ATTR,pi as RUI_FIELD_ERROR_ATTR,nn as RUI_FIELD_LABEL_ATTR,ra as RUI_FIELD_MANAGED_ATTR,dr as RUI_TOAST_DISMISS_EVENT,cr as RUI_TOAST_SHOW_EVENT,bI as RuiAlert,gI as RuiAlertDescription,_r as RuiAlertElement,pI as RuiAlertIcon,mI as RuiAlertTitle,ro as RuiAutocomplete,to as RuiAutocompleteCollection,wr as RuiAutocompleteElement,io as RuiAutocompleteEmpty,EI as RuiAutocompleteInput,II as RuiAvatar,DI as RuiBadge,jI as RuiBreadcrumb,Tr as RuiBreadcrumbElement,KI as RuiBreadcrumbEllipsis,BI as RuiBreadcrumbItem,UI as RuiBreadcrumbLink,FI as RuiBreadcrumbList,zI as RuiBreadcrumbPage,qI as RuiBreadcrumbSeparator,Je as RuiButton,HI as RuiButtonGroup,Mt as RuiCalendar,Mt as RuiCalendarElement,LC as RuiCarousel,Vr as RuiCarouselElement,Hu as RuiCarouselNext,Wu as RuiCarouselPrev,Nu as RuiCarouselRotation,$u as RuiCarouselSlide,Mi as RuiCheckbox,ti as RuiCheckboxElement,eD as RuiCheckboxGroup,Vc as RuiCheckboxGroupControl,Pr as RuiCheckboxGroupElement,iD as RuiChip,rD as RuiChipList,nD as RuiChipListItem,$D as RuiCombobox,GD as RuiComboboxClear,oh as RuiComboboxControl,ji as RuiComboboxElement,ah as RuiComboboxInput,uh as RuiComboboxListbox,sh as RuiComboboxTrigger,lh as RuiComboboxValue,r1 as RuiCycleToggle,Ah as RuiCycleToggleButton,Ur as RuiCycleToggleElement,i1 as RuiCycleToggleItem,A1 as RuiDateField,Bf as RuiDateFieldCalendar,Lf as RuiDateFieldControl,Gr as RuiDateFieldElement,Pf as RuiDateFieldInput,Ff as RuiDateFieldPopover,jf as RuiDateFieldToggle,ci as RuiDateInput,Wr as RuiDateInputElement,j1 as RuiDateRangePicker,Ep as RuiDateRangePickerCalendar,vp as RuiDateRangePickerControl,Hr as RuiDateRangePickerElement,xp as RuiDateRangePickerEndInput,yp as RuiDateRangePickerInputs,Sp as RuiDateRangePickerPopover,wp as RuiDateRangePickerSeparator,_p as RuiDateRangePickerStartInput,Tp as RuiDateRangePickerToggle,N1 as RuiDialog,Xp as RuiDialogActions,Yp as RuiDialogBody,Qp as RuiDialogClose,Ut as RuiDialogElement,Np as RuiDialogTitle,xO as RuiDisclosure,zt as RuiDisclosureElement,wO as RuiDisclosureGroup,en as RuiDisclosureGroupElement,Om as RuiDisclosureIcon,km as RuiDisclosurePanel,Vm as RuiDisclosureTrigger,TO as RuiFeed,SO as RuiFeedArticle,AO as RuiFeedArticleActions,RO as RuiFeedArticleContent,EO as RuiFeedArticleHeader,IO as RuiFeedByline,CO as RuiFeedBylineBody,DO as RuiFeedMeta,tV as RuiField,rV as RuiFieldDescription,ln as RuiFieldElement,oV as RuiFieldError,vV as RuiForm,un as RuiFormElement,RV as RuiGrid,cn as RuiGridElement,DV as RuiHeading,kV as RuiHeadingDescription,OV as RuiHeadingEyebrow,VV as RuiHeadingTitle,ga as RuiHeadline,WV as RuiHoverCard,$V as RuiHoverCardContent,mn as RuiHoverCardElement,GV as RuiHoverCardTrigger,Ri as RuiIconCalendar,Ai as RuiIconCheck,Xe as RuiIconChevronDown,Zn as RuiIconChevronLeft,eo as RuiIconChevronRight,Re as RuiIconX,NV as RuiInput,YV as RuiInputGroup,XV as RuiInputGroupAddon,QV as RuiInputGroupText,ck as RuiKnob,vn as RuiKnobElement,mk as RuiLabel,ai as RuiListbox,Br as RuiListboxElement,Uo as RuiListboxOption,Od as RuiListboxOptionIndicator,Ok as RuiMenuButton,Hv as RuiMenuButtonContent,Ji as RuiMenuButtonElement,Yv as RuiMenuButtonItem,Nv as RuiMenuButtonSubmenuContent,Wv as RuiMenuButtonTrigger,Uk as RuiMenubar,yn as RuiMenubarElement,oy as RuiMenubarMenu,ay as RuiMenubarMenuItem,sy as RuiMenubarSubmenuContent,Ea as RuiMeter,Ea as RuiMeterElement,iM as RuiNavigationMenu,eM as RuiNavigationMenuBar,wn as RuiNavigationMenuElement,nM as RuiNavigationMenuLink,oM as RuiNavigationMenuPanel,tM as RuiNavigationMenuPanels,rM as RuiNavigationMenuTrigger,mM as RuiNumberField,I_ as RuiNumberFieldDecrementButton,Tn as RuiNumberFieldElement,S_ as RuiNumberFieldGroup,A_ as RuiNumberFieldIncrementButton,E_ as RuiNumberFieldInput,R_ as RuiNumberFieldSteppers,SM as RuiPagination,En as RuiPaginationElement,W_ as RuiPaginationNav,OM as RuiPopover,DM as RuiPopoverContent,An as RuiPopoverElement,VM as RuiPopoverTrigger,In as RuiPopoverTriggerElement,Hx as RuiRadio,KM as RuiRadioGroup,Wx as RuiRadioGroupControl,Dn as RuiRadioGroupElement,rL as RuiSelect,ZM as RuiSelectClear,y0 as RuiSelectControl,On as RuiSelectElement,T0 as RuiSelectListbox,eL as RuiSelectSearch,x0 as RuiSelectToggle,_0 as RuiSelectTrigger,w0 as RuiSelectValue,Zi as RuiSeparator,qL as RuiSidebar,VL as RuiSidebarContent,Ln as RuiSidebarElement,kL as RuiSidebarFooter,LL as RuiSidebarGroup,PL as RuiSidebarGroupAction,jL as RuiSidebarGroupHeader,tT as RuiSidebarGroupLabel,OL as RuiSidebarHeader,zL as RuiSidebarInset,FL as RuiSidebarMenu,UL as RuiSidebarMenuAction,iT as RuiSidebarMenuButton,BL as RuiSidebarMenuItem,DL as RuiSidebarProvider,ML as RuiSidebarSeparator,CL as RuiSidebarTrigger,jn as RuiSidebarTriggerElement,JL as RuiSlider,Fn as RuiSliderElement,rS as RuiSliderValue,tP as RuiSpinner,cP as RuiSwitch,Bn as RuiSwitchElement,kP as RuiTab,VP as RuiTabList,LP as RuiTabPanel,MP as RuiTabPanels,SP as RuiTable,bP as RuiTableBody,xP as RuiTableCell,yP as RuiTableColumn,Un as RuiTableElement,TP as RuiTableEmptyState,vP as RuiTableFooter,gP as RuiTableHeader,_P as RuiTableRow,wP as RuiTableSelectionCell,Na as RuiTabs,Na as RuiTabsElement,ih as RuiTag,Ui as RuiTagGroup,Bi as RuiTagGroupElement,th as RuiTagList,rh as RuiTagRemove,jP as RuiTextarea,oj as RuiToast,Ei as RuiToastElement,ss as RuiToaster,ss as RuiToasterElement,ls as RuiToc,ls as RuiTocElement,Tj as RuiToolbar,Hn as RuiToolbarElement,kj as RuiTooltip,Nn as RuiTooltipElement,qj as RuiTree,Yn as RuiTreeElement,Jj as RuiTreegrid,Xn as RuiTreegridElement,s2 as RuiWindowSplitter,Qn as RuiWindowSplitterElement,Ja as TOAST_COLLAPSED_PEEK,Za as TOAST_EXIT_MS,Ya as TOAST_GAP,hr as TOAST_LIFETIME,FP as TOAST_POSITIONS,fr as TOAST_SWIPE_THRESHOLD,Xa as TOAST_VIEWPORT_OFFSET,Qa as TOAST_VISIBLE_AMOUNT,BP as TOAST_WIDTH,Dh as ThemeItemLabel,Ch as ThemePreferenceIcon,o1 as ThemePreferenceItemContent,Ct as WINDOW_SPLITTER_MAX,It as WINDOW_SPLITTER_MIN,nO as closeDialog,aO as createDialogHandle,pa as createRulesResolver,j as cx,Ko as cycleValue,lj as dismissToast,ha as fieldContext,gi as findFieldControl,bi as formContext,iO as getOpenDialogId,om as installDialogs,mi as isNativeTextControl,rO as openDialog,ca as readControlValue,PO as registerFieldControl,xg as runRulesResolver,sj as showToast,aj as toast,oO as toggleDialog,Zo as uninstallDialogs,ne as withDefaultAriaLabel,an as writeControlValue};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|