@ecopages/radiant-ui 0.1.0-rc.8 → 0.1.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 +9 -1
- package/dist/components/ui/autocomplete/autocomplete.css +1 -2
- package/dist/components/ui/avatar/avatar.css +10 -8
- package/dist/components/ui/avatar/avatar.d.ts +3 -1
- package/dist/components/ui/calendar/calendar.css +10 -5
- package/dist/components/ui/calendar/calendar.script.d.ts +1 -0
- package/dist/components/ui/calendar/index.js +1 -1
- package/dist/components/ui/calendar/index.js.map +3 -3
- package/dist/components/ui/carousel/carousel-autoplay.d.ts +22 -0
- package/dist/components/ui/carousel/carousel-swipe.d.ts +17 -0
- package/dist/components/ui/carousel/carousel-window.d.ts +63 -0
- package/dist/components/ui/carousel/carousel.css +71 -18
- package/dist/components/ui/carousel/carousel.d.ts +1 -1
- package/dist/components/ui/carousel/carousel.script.d.ts +49 -21
- package/dist/components/ui/carousel/index.js +1 -1
- package/dist/components/ui/carousel/index.js.map +4 -4
- package/dist/components/ui/checkbox/checkbox.script.d.ts +0 -3
- package/dist/components/ui/checkbox/index.js +1 -1
- package/dist/components/ui/checkbox/index.js.map +4 -4
- package/dist/components/ui/checkbox-group/checkbox-group.d.ts +0 -1
- package/dist/components/ui/checkbox-group/checkbox-group.script.d.ts +8 -7
- package/dist/components/ui/checkbox-group/index.js +1 -1
- package/dist/components/ui/checkbox-group/index.js.map +4 -4
- package/dist/components/ui/combobox/combobox.css +2 -2
- package/dist/components/ui/combobox/combobox.d.ts +1 -2
- package/dist/components/ui/combobox/combobox.script.d.ts +13 -6
- package/dist/components/ui/combobox/index.js +1 -1
- package/dist/components/ui/combobox/index.js.map +4 -4
- 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.css +13 -17
- package/dist/components/ui/date-field/date-field.d.ts +7 -5
- package/dist/components/ui/date-field/date-field.script.d.ts +16 -48
- 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-segment-dom.d.ts +24 -0
- package/dist/components/ui/date-input/date-input.css +50 -0
- package/dist/components/ui/date-input/date-input.d.ts +8 -0
- package/dist/components/ui/date-input/date-input.script.d.ts +137 -0
- package/dist/components/ui/date-input/index.d.ts +2 -0
- package/dist/components/ui/date-input/index.js +2 -0
- package/dist/components/ui/date-input/index.js.map +7 -0
- package/dist/components/ui/date-range-picker/date-range-picker.css +18 -19
- package/dist/components/ui/date-range-picker/date-range-picker.d.ts +8 -6
- package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +24 -47
- 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.css +18 -14
- package/dist/components/ui/dialog/dialog.script.d.ts +10 -3
- package/dist/components/ui/dialog/index.js +1 -1
- package/dist/components/ui/dialog/index.js.map +4 -4
- package/dist/components/ui/disclosure/disclosure.css +3 -6
- package/dist/components/ui/disclosure/disclosure.d.ts +15 -5
- package/dist/components/ui/disclosure/disclosure.script.d.ts +2 -2
- package/dist/components/ui/disclosure/index.d.ts +1 -1
- package/dist/components/ui/disclosure/index.js +1 -1
- package/dist/components/ui/disclosure/index.js.map +4 -4
- package/dist/components/ui/field/field.d.ts +1 -1
- package/dist/components/ui/field/field.script.d.ts +27 -4
- package/dist/components/ui/field/index.js +1 -1
- package/dist/components/ui/field/index.js.map +4 -4
- package/dist/components/ui/form/control-protocol.d.ts +38 -1
- package/dist/components/ui/form/form-context.d.ts +3 -0
- package/dist/components/ui/form/form.script.d.ts +7 -0
- package/dist/components/ui/form/index.d.ts +2 -1
- package/dist/components/ui/form/index.js +1 -1
- package/dist/components/ui/form/index.js.map +4 -4
- package/dist/components/ui/hover-card/hover-card.css +12 -101
- 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 +4 -4
- package/dist/components/ui/input/index.js +1 -1
- package/dist/components/ui/input/index.js.map +4 -4
- package/dist/components/ui/input/input.css +1 -1
- 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.css +6 -1
- package/dist/components/ui/knob/knob.d.ts +1 -1
- package/dist/components/ui/knob/knob.script.d.ts +25 -10
- package/dist/components/ui/label/index.js +1 -1
- package/dist/components/ui/label/index.js.map +4 -4
- package/dist/components/ui/listbox/index.js +1 -1
- package/dist/components/ui/listbox/index.js.map +4 -4
- package/dist/components/ui/listbox/listbox.d.ts +1 -2
- package/dist/components/ui/listbox/listbox.script.d.ts +7 -5
- package/dist/components/ui/menu-button/index.js +1 -1
- package/dist/components/ui/menu-button/index.js.map +4 -4
- package/dist/components/ui/menu-button/menu-button.script.d.ts +1 -1
- package/dist/components/ui/menubar/index.js +1 -1
- package/dist/components/ui/menubar/index.js.map +4 -4
- package/dist/components/ui/meter/index.js +1 -1
- package/dist/components/ui/meter/index.js.map +3 -3
- package/dist/components/ui/meter/meter.css +27 -2
- package/dist/components/ui/meter/meter.script.d.ts +14 -4
- package/dist/components/ui/navigation-menu/index.d.ts +1 -1
- package/dist/components/ui/navigation-menu/index.js +1 -1
- package/dist/components/ui/navigation-menu/index.js.map +4 -4
- package/dist/components/ui/navigation-menu/navigation-menu.css +32 -34
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +33 -4
- package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +71 -9
- package/dist/components/ui/number-field/index.js +1 -1
- package/dist/components/ui/number-field/index.js.map +4 -4
- package/dist/components/ui/number-field/number-field.css +1 -1
- package/dist/components/ui/number-field/number-field.d.ts +1 -1
- package/dist/components/ui/number-field/number-field.script.d.ts +7 -9
- package/dist/components/ui/pagination/index.d.ts +1 -1
- 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.css +50 -13
- package/dist/components/ui/pagination/pagination.d.ts +25 -6
- package/dist/components/ui/popover/index.js +1 -1
- package/dist/components/ui/popover/index.js.map +4 -4
- package/dist/components/ui/popover/popover.script.d.ts +5 -0
- package/dist/components/ui/radio-group/index.js +1 -1
- package/dist/components/ui/radio-group/index.js.map +4 -4
- package/dist/components/ui/radio-group/radio-group.script.d.ts +2 -1
- package/dist/components/ui/select/index.d.ts +1 -1
- package/dist/components/ui/select/index.js +1 -1
- package/dist/components/ui/select/index.js.map +4 -4
- package/dist/components/ui/select/select.css +4 -3
- package/dist/components/ui/select/select.d.ts +7 -5
- package/dist/components/ui/select/select.script.d.ts +32 -12
- package/dist/components/ui/shared/calendar-popover-behavior.d.ts +27 -0
- package/dist/components/ui/shared/listbox-host-controller.d.ts +5 -4
- package/dist/components/ui/shared/multi-value.d.ts +18 -8
- package/dist/components/ui/shared/numeric-range.d.ts +8 -0
- package/dist/components/ui/shared/popover.css +10 -99
- package/dist/components/ui/sidebar/index.d.ts +2 -1
- package/dist/components/ui/sidebar/index.js +1 -1
- package/dist/components/ui/sidebar/index.js.map +4 -4
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts +12 -0
- package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +42 -29
- package/dist/components/ui/sidebar/sidebar.css +67 -61
- package/dist/components/ui/sidebar/sidebar.d.ts +1 -7
- package/dist/components/ui/sidebar/sidebar.script.d.ts +12 -7
- package/dist/components/ui/slider/index.js +1 -1
- package/dist/components/ui/slider/index.js.map +4 -4
- package/dist/components/ui/slider/slider.css +5 -5
- package/dist/components/ui/slider/slider.d.ts +5 -6
- package/dist/components/ui/slider/slider.script.d.ts +72 -29
- package/dist/components/ui/switch/index.js +1 -1
- package/dist/components/ui/switch/index.js.map +4 -4
- package/dist/components/ui/switch/switch.css +28 -22
- package/dist/components/ui/switch/switch.script.d.ts +10 -3
- package/dist/components/ui/table/index.js +1 -1
- package/dist/components/ui/table/index.js.map +4 -4
- package/dist/components/ui/table/table.d.ts +5 -3
- package/dist/components/ui/table/table.script.d.ts +25 -10
- package/dist/components/ui/tabs/tabs.css +18 -12
- 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 +4 -4
- package/dist/components/ui/tag-group/tag-group.d.ts +7 -4
- package/dist/components/ui/tag-group/tag-group.script.d.ts +7 -5
- package/dist/components/ui/textarea/index.js +1 -1
- package/dist/components/ui/textarea/index.js.map +4 -4
- package/dist/components/ui/textarea/textarea.css +1 -1
- 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.css +35 -32
- package/dist/components/ui/toast/toast.script.d.ts +2 -1
- package/dist/components/ui/toast/toaster.script.d.ts +6 -0
- package/dist/components/ui/tooltip/index.js +1 -1
- package/dist/components/ui/tooltip/index.js.map +4 -4
- package/dist/components/ui/tooltip/tooltip.css +14 -94
- package/dist/components/ui/tooltip/tooltip.script.d.ts +9 -1
- package/dist/components/ui/window-splitter/index.d.ts +1 -1
- 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 -1
- package/dist/components/ui/window-splitter/window-splitter.script.d.ts +5 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/lib/icons/chevron-down.d.ts +0 -1
- package/dist/lib/intl-date/index.d.ts +4 -2
- package/dist/lib/intl-date/segment-editing.d.ts +34 -0
- package/dist/lib/intl-date/segments.d.ts +26 -4
- package/dist/lib/non-empty.d.ts +6 -0
- package/dist/lib/unique-id.d.ts +11 -0
- package/dist/lib/viewport/breakpoints.d.ts +6 -0
- package/dist/lib/viewport/mobile-layout.d.ts +15 -0
- package/dist/styles/primitives.css +10 -7
- package/dist/styles/radiant-ui-core.css +10 -0
- package/dist/styles/radiant-ui.css +40 -3
- package/dist/styles/style-dependencies.json +18 -6
- package/dist/styles/styles.css +456 -246
- package/dist/styles/tailwind.css +40 -93
- package/dist/styles/tokens/presets/colors/aurora.css +2 -0
- package/dist/styles/tokens/presets/colors/basalt.css +2 -0
- package/dist/styles/tokens/presets/colors/ember.css +2 -0
- package/dist/styles/tokens/presets/colors/glacier.css +2 -0
- package/dist/styles/tokens/semantic.css +1 -0
- package/dist/styles/tokens/system.css +11 -3
- package/dist/styles/tokens/typography/default.css +8 -0
- package/package.json +20 -10
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function nt(e,t){return t===void 0||e?.label!==void 0?e:{...e,label:t}}function L(...e){return e.filter(Boolean).join(" ")}import{jsx as Qi,jsxs as GR}from"@ecopages/jsx/jsx-runtime";function li({class:e,size:t="sm",...i}){return GR("svg",{...i,class:L("rui-icon",t==="md"&&"rui-icon--md",e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[Qi("path",{d:"M8 2v4"}),Qi("path",{d:"M16 2v4"}),Qi("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),Qi("path",{d:"M3 10h18"})]})}import{jsx as Uo}from"@ecopages/jsx/jsx-runtime";function ui({class:e,size:t="sm",...i}){return Uo("svg",{...i,class:L("rui-icon",t==="md"&&"rui-icon--md",e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Uo("path",{d:"m5 12 4 4L19 6"})})}import{jsx as zo}from"@ecopages/jsx/jsx-runtime";function we({class:e,size:t="sm",...i}){return zo("svg",{...i,class:L("rui-icon",t==="md"&&"rui-icon--md",e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:zo("path",{d:"m6 9 6 6 6-6"})})}import{jsx as qo}from"@ecopages/jsx/jsx-runtime";function Xr({class:e,size:t="sm",...i}){return qo("svg",{...i,class:L("rui-icon",t==="md"&&"rui-icon--md",e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:qo("path",{d:"m15 18-6-6 6-6"})})}import{jsx as Ko}from"@ecopages/jsx/jsx-runtime";function Nr({class:e,size:t="sm",...i}){return Ko("svg",{...i,class:L("rui-icon",t==="md"&&"rui-icon--md",e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Ko("path",{d:"m9 18 6-6-6-6"})})}import{jsx as $o,jsxs as WR}from"@ecopages/jsx/jsx-runtime";var Go="http://www.w3.org/2000/svg";function Rt({class:e,size:t="sm",...i}){return WR("svg",{...i,class:L("rui-icon",t==="md"&&"rui-icon--md",e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[$o("path",{d:"m18 6-12 12"}),$o("path",{d:"m6 6 12 12"})]})}function Ji(){let e=document.createElementNS(Go,"svg");e.setAttribute("class","rui-icon"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");for(let t of["m18 6-12 12","m6 6 12 12"]){let i=document.createElementNS(Go,"path");i.setAttribute("d",t),e.append(i)}return e}import{RadiantElement as oa,bound as QR,customElement as JR,event as ZR,onEvent as tA,prop as Zi}from"@ecopages/radiant";var Wo,Ho,Yo,Xo,No,Qo,Jo,Zo,ta,ea,ia,ra;function HR(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:na(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||na(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:YR(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return NR(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function YR(e){var t=XR(e,"string");return typeof t=="symbol"?t:t+""}function XR(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function na(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function NR(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var sa,aa=class extends oa{static{({e:[Yo,Xo,No,Qo,Jo,Zo,ta,ea,ia,ra,Wo],c:[sa,Ho]}=HR(this,[JR("rui-alert")],[[Zi({type:String,reflect:!0,defaultValue:"info"}),0,"variant"],[Zi({type:String,reflect:!0,defaultValue:"inline"}),0,"layout"],[Zi({type:Boolean,reflect:!0,defaultValue:!1}),0,"dismissible"],[Zi({type:String,attribute:"close-label",defaultValue:"Dismiss"}),0,"closeLabel"],[ZR({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[QR,2,"dismiss"],[tA({selector:"[data-alert-close]",type:"click"}),2,"onCloseClick"]],0,void 0,oa))}constructor(...t){super(...t),ra(this)}variant=(Wo(this),Yo(this));layout=(Xo(this),No(this));dismissible=(Qo(this),Jo(this));closeLabel=(Zo(this),ta(this));closeEvent=(ea(this),ia(this));dismiss(){this.isConnected&&(this.closeEvent.emit({reason:"dismiss"}),this.remove())}onCloseClick(t){t.stopPropagation(),this.dismissible&&this.dismiss()}static{Ho()}};import{jsx as Gt,jsxs as la}from"@ecopages/jsx/jsx-runtime";var eA={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 iA({variant:e="info",class:t,children:i,...r}){if(i!=null)return Gt("span",{...r,class:L("rui-alert__icon",t),children:i});let l=eA[e],h=Array.isArray(l)?l:[l];return Gt("span",{...r,class:L("rui-alert__icon",t),"aria-hidden":"true",children:Gt("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:h.map(d=>Gt("path",{d}))})})}function rA({children:e,class:t,...i}){return Gt("p",{...i,class:L("rui-alert__title",t),children:e})}function nA({children:e,class:t,...i}){return Gt("div",{...i,class:L("rui-alert__description",t),children:e})}function oA({children:e,variant:t="info",layout:i="inline",dismissible:r=!1,closeLabel:l="Dismiss",class:h,slot:d,...a}){return Gt("rui-alert",{slot:d,variant:t,layout:i,dismissible:r,"close-label":l,children:la("div",{...a,class:L("rui-alert",`rui-alert--${t}`,`rui-alert--${i}`,r&&"rui-alert--dismissible",h),role:"alert",children:[e,r?Gt("button",{type:"button",class:"rui-alert__close","data-alert-close":!0,"aria-label":l||"Dismiss",children:la("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:[Gt("path",{d:"M18 6 6 18"}),Gt("path",{d:"m6 6 12 12"})]})}):null]})})}import{RadiantElement as ga,customElement as cA,onEvent as dA,onUpdated as hA,prop as ba}from"@ecopages/radiant";function tr(e,t,i="base"){if(!t)return!0;if(i==="case")return e.includes(t);let r=new Intl.Collator(void 0,{sensitivity:i==="accent"?"accent":"base",usage:"search"});for(let l=0;l<=e.length-t.length;l+=1){let h=e.slice(l,l+t.length);if(r.compare(h,t)===0)return!0}return!1}var ua,ca,da,ha,pa,fa;function aA(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:ma(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||ma(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:sA(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return uA(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function sA(e){var t=lA(e,"string");return typeof t=="symbol"?t:t+""}function lA(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ma(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function uA(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var ya,va=class extends ga{static{({e:[da,ha,pa,fa,ua],c:[ya,ca]}=aA(this,[cA("rui-autocomplete")],[[ba({type:String,defaultValue:"base"}),0,"sensitivity"],[ba({type:String,attribute:"input-value",defaultValue:""}),0,"inputValue"],[hA(["sensitivity","inputValue"]),2,"onPropsUpdated"],[dA({selector:"[data-autocomplete-input]",type:"input"}),2,"onInput"]],0,void 0,ga))}sensitivity=(ua(this),da(this));inputValue=(ha(this),pa(this));externalInput=(fa(this),null);onExternalInput=()=>{this.applyFilter()};getInput(){let t=this.querySelector("[data-autocomplete-input]");return t||(this.closest("rui-combobox, rui-select")?.querySelector("[data-autocomplete-input]")??null)}bindExternalInput(){this.unbindExternalInput();let t=this.getInput();!t||this.contains(t)||(this.externalInput=t,t.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 t=this.getCollection();return t?Array.from(t.querySelectorAll('[role="option"], [data-tag], [role="menuitem"]')).filter(r=>this.contains(r)||t.contains(r)):[]}getItemText(t){return t.getAttribute("data-label")||t.textContent?.trim()||""}getQuery(){return this.inputValue?this.inputValue:this.getInput()?.value??""}applyFilter(){let t=this.getQuery(),i=this.getFilterableItems(),r=0;for(let h of i){let d=tr(this.getItemText(h),t,this.sensitivity);h.hidden=!d,d&&(r+=1)}let l=this.querySelector("[data-autocomplete-empty]");l&&l.toggleAttribute("hidden",r>0)}initialize(){this.applyFilter()}onConnected(){this.bindExternalInput(),this.initialize()}disconnectedCallback(){this.unbindExternalInput(),super.disconnectedCallback()}onPropsUpdated(){this.applyFilter()}onInput(){this.applyFilter()}static{ca()}};import{jsx as Be}from"@ecopages/jsx/jsx-runtime";function pA({placeholder:e,class:t,disabled:i,...r}){return Be("input",{...r,type:"search","data-autocomplete-input":!0,class:L("rui-autocomplete__input",t),placeholder:e,disabled:i,autocomplete:"off"})}function Qr({children:e,class:t,...i}){return Be("div",{...i,"data-autocomplete-collection":!0,class:L("rui-autocomplete__collection",t),children:e})}function Jr({children:e,class:t,...i}){return Be("div",{...i,"data-autocomplete-empty":!0,class:L("rui-autocomplete__empty",t),children:e})}function fA({children:e}){return Be("div",{class:"rui-autocomplete","data-ref":"root",children:e})}function Zr({children:e,...t}){return Be("rui-autocomplete",{...t,children:Be(fA,{children:e})})}import{jsx as tn}from"@ecopages/jsx/jsx-runtime";function Lt(...e){for(let t of e)if(t!==void 0)return t}function mA(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2).toUpperCase():`${t[0][0]??""}${t[1][0]??""}`.toUpperCase()}function gA({src:e,alt:t="",fallback:i,size:r="md",class:l,children:h,role:d,aria:a,...E}){let A=i??(t?mA(t):void 0);return tn("span",{...E,aria:nt(a,e?void 0:t||i),class:L("rui-avatar",`rui-avatar--${r}`,l),role:Lt(d,e?void 0:"img"),children:e?tn("img",{class:"rui-avatar__image",src:e,alt:t}):tn("span",{class:"rui-avatar__fallback","aria-hidden":t||i?"true":void 0,children:h??A??"?"})})}import{jsx as bA}from"@ecopages/jsx/jsx-runtime";function vA({children:e,variant:t="filled",class:i,...r}){return bA("span",{...r,class:L("rui-badge",`rui-badge--${t}`,i),children:e})}import{RadiantElement as Ra,customElement as SA,prop as Aa}from"@ecopages/radiant";var _a,xa,wa,Sa,Ta;function yA(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Ea(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Ea(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:_A(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wA(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function _A(e){var t=xA(e,"string");return typeof t=="symbol"?t:t+""}function xA(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ea(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function wA(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Ca,Ia=class extends Ra{static{({e:[xa,wa,Sa,Ta],c:[Ca,_a]}=yA(this,[SA("rui-breadcrumb")],[[Aa({type:String,defaultValue:"Breadcrumb"}),0,"label"],[Aa({type:String,defaultValue:"/"}),0,"separator"]],0,void 0,Ra))}constructor(...t){super(...t),Ta(this)}label=xa(this);separator=(wa(this),Sa(this));static{_a()}};import{jsx as re,jsxs as TA}from"@ecopages/jsx/jsx-runtime";function EA({children:e,label:t,separator:i,...r}){return re("rui-breadcrumb",{...r,label:t,separator:i,children:re("nav",{class:"rui-breadcrumb","aria-label":t||"Breadcrumb",style:{"--rui-breadcrumb-separator":JSON.stringify(i||"/")},children:e})})}function RA({children:e,class:t,...i}){return re("ol",{...i,class:L("rui-breadcrumb__list",t),children:e})}function AA({children:e,class:t,...i}){return re("li",{...i,class:L("rui-breadcrumb__item",t),children:e})}function IA({children:e,href:t,class:i,...r}){return re("a",{...r,class:L("rui-breadcrumb__link",i),href:t,children:e})}function CA({children:e,class:t,...i}){return re("span",{...i,class:L("rui-breadcrumb__page",t),"aria-current":"page",children:e})}function DA({children:e,class:t,...i}){return re("li",{...i,class:L("rui-breadcrumb__separator",t),role:"presentation","aria-hidden":"true",children:e})}function OA({label:e="More",class:t,...i}){return TA("span",{...i,class:L("rui-breadcrumb__ellipsis",t),role:"presentation","aria-hidden":"true",children:[re("span",{"aria-hidden":"true",children:"\u2026"}),re("span",{class:"rui-breadcrumb__ellipsis-label",children:e})]})}import{jsx as Da}from"@ecopages/jsx/jsx-runtime";function kA(e,t,i){if(e!==void 0)return e;if(t)return i}function VA(e,t){if(typeof e=="function"){e(t);return}e!=null&&typeof e=="object"&&"handleEvent"in e&&e.handleEvent(t)}function ne(e){if(e.href!==void 0){let{href:$,target:P,rel:G,download:W,children:O,class:_,variant:H,size:Y,square:n,...g}=e;return Da("a",{...g,href:$,target:P,rel:G,download:W,class:L("rui-button",`rui-button--${H??"filled"}`,`rui-button--${Y??"md"}`,n&&"rui-button--square",_),children:O})}let{variant:t,size:i,square:r,class:l,children:h,type:d="button",disabled:a,pressed:E,defaultPressed:A=!1,toggle:S=!1,"on:click":D,...T}=e,K=$=>{if(S&&E===void 0){let P=$.currentTarget,G=P.getAttribute("aria-pressed")!=="true";P.setAttribute("aria-pressed",String(G))}VA(D,$)};return Da("button",{...T,type:d,class:L("rui-button",`rui-button--${t??"filled"}`,`rui-button--${i??"md"}`,r&&"rui-button--square",l),disabled:a,"aria-pressed":kA(E,S,A),"data-toggle":S&&E===void 0?"":void 0,"on:click":S||D?K:void 0,children:h})}import{jsx as MA}from"@ecopages/jsx/jsx-runtime";function jA({children:e,orientation:t="horizontal",class:i,...r}){return MA("div",{...r,role:"group","aria-orientation":t,class:L("rui-button-group",`rui-button-group--${t}`,i),children:e})}import{jsx as xt,jsxs as bn}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Ss,customElement as rI,event as nI,onEvent as Te,onUpdated as oI,prop as ue,state as ce}from"@ecopages/radiant";function Wt(e){if(!e)return;let t=e.split(",").map(i=>i.trim()).filter(Boolean);return t.length>1?t:t[0]}function Pt(e){if(e==null)return null;let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(!t)return null;let i=Number(t[1]),r=Number(t[2])-1,l=Number(t[3]),h=new Date(i,r,l);return h.getFullYear()!==i||h.getMonth()!==r||h.getDate()!==l?null:h}function Bt(e){let t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${r}`}function en(e,t,i){return!(t&&e<t||i&&e>i)}function Se(e,t){return e.localeCompare(t)}function Fe(e,t){return Se(e,t)<=0?{start:e,end:t}:{start:t,end:e}}function At(e){if(!e)return null;let[t,i]=e.split("/");return!t||!i?null:Fe(t,i)}function ci(e){if(!e)return"";let t=Fe(e.start,e.end);return`${t.start}/${t.end}`}function Ue(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean).sort(Se):[]}function rn(e){return[...new Set(e)].sort(Se).join(",")}function nn(e,t){let i=new Set(e);return i.has(t)?i.delete(t):i.add(t),[...i].sort(Se)}function Oa(e,t){let i=Fe(t.start,t.end);return Se(e,i.start)>=0&&Se(e,i.end)<=0}function on(e,t,i){if(t==="single"){let A=i.singleIso===e;return{isSelected:A,isRangeStart:A,isRangeEnd:A,isRangeMiddle:!1}}if(t==="multiple"){let A=i.multipleIsos?.includes(e)??!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 l=Fe(r.start,r.end),h=Oa(e,l),d=e===l.start,a=e===l.end;return{isSelected:h,isRangeStart:d,isRangeEnd:a,isRangeMiddle:h&&!d&&!a}}function an(e,t,i){return t.anchor?{committed:Fe(t.anchor,i),draft:{anchor:null,hover:null}}:{committed:e,draft:{anchor:i,hover:i}}}function er(e){let t=LA(e);try{let r=new Intl.Locale(t).weekInfo;if(r?.firstDay!=null)return r.firstDay===7?0:r.firstDay}catch{}return t.startsWith("en-US")?0:1}function LA(e){return Array.isArray(e)?e[0]??navigator.language:e??navigator.language}function PA(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function BA(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function FA(e){let t=e.selectionMode??"single",i=e.value??"";if(t==="multiple")return{mode:t,multipleIsos:Ue(i)};if(t==="range"){let r=At(i);if(e.rangeDraft?.anchor){let l=e.rangeDraft.hover??e.rangeDraft.anchor;return{mode:t,range:UA(e.rangeDraft.anchor,l)}}return{mode:t,range:r}}return{mode:t,singleIso:i||void 0}}function UA(e,t){return e.localeCompare(t)<=0?{start:e,end:t}:{start:t,end:e}}function sn(e,t,i){let r=er(i.locale),l=PA(i.today??new Date),h=FA(i),a=(new Date(e,t,1).getDay()-r+7)%7,E=new Date(e,t,1-a),A=[],S=new Date(E);for(let D=0;D<6;D+=1){let T=[];for(let K=0;K<7;K+=1){let $=Bt(S),P=on($,h.mode,{singleIso:h.singleIso,multipleIsos:h.multipleIsos,range:h.range});T.push({date:new Date(S),iso:$,inMonth:S.getMonth()===t,isToday:BA(S,l),isSelected:P.isSelected,isDisabled:!en($,i.min,i.max),isRangeStart:P.isRangeStart,isRangeEnd:P.isRangeEnd,isRangeMiddle:P.isRangeMiddle}),S.setDate(S.getDate()+1)}if(A.push(T),D>=4&&S.getMonth()!==t&&S.getDate()>7)break}return A}function ir(e,t,i){let r=new Date(e,t+i,1);return{year:r.getFullYear(),month:r.getMonth()}}function ln(e,t,i){let r=Math.max(1,Math.min(i,12));return Array.from({length:r},(l,h)=>{let d=ir(e,t,h);return{year:d.year,month:d.month,offset:h}})}var ka=new Map;function zA(e,t){return`${JSON.stringify(e??null)}|${JSON.stringify(t)}`}function Ft(e,t){let i=zA(e,t),r=ka.get(i);if(r)return r;let l=new Intl.DateTimeFormat(e,t);return ka.set(i,l),l}function di(e,t,i="medium"){return Ft(t,{dateStyle:i}).format(e)}function un(e,t){return Ft(t,{month:"long",year:"numeric"}).format(e)}function cn(e,t){let i=Ft(e,{weekday:"narrow"}),r=[];for(let l=0;l<7;l+=1){let h=(t+l)%7,d=new Date(2024,0,h===0?7:h);r.push(i.format(d))}return r}function dn(e){return new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"day")}var qA={0:"digit",a:"letter","*":"any"},KA=/\p{L}/u;function $A(e,t){let i=t?.[e];if(i instanceof RegExp)return{kind:"any",pattern:i};if(i)return{kind:i};let r=qA[e];return r?{kind:r}:null}function Va(e,t,i){return i?i.test(e):t==="digit"?/\d/.test(e):t==="letter"?KA.test(e):e.length>0}function Ma(e,t,i=!1){let r=[],l=0;for(;l<e.length;){let h=e[l];if(h==="\\"){let a=e[l+1];a&&r.push({type:"literal",value:a}),l+=2;continue}if(h==="{"){let a=e.indexOf("}",l+1);if(a<0){r.push({type:"literal",value:"{"}),l+=1;continue}r.push({type:"fixed",value:e.slice(l+1,a)}),l=a+1;continue}if(h==="["){let a=GA(e,l+1);if(a<0){r.push({type:"literal",value:"["}),l+=1;continue}let E=Ma(e.slice(l+1,a),t,!0);r.push(...E),l=a+1;continue}if(h==="]")break;let d=$A(h,t);if(d){r.push({type:"input",definition:h,kind:d.kind,pattern:d.pattern,optional:i}),l+=1;continue}r.push({type:"literal",value:h}),l+=1}return r}function GA(e,t){let i=1;for(let r=t;r<e.length;r+=1)if(e[r]==="["&&e[r-1]!=="\\"&&(i+=1),e[r]==="]"&&e[r-1]!=="\\"&&(i-=1,i===0))return r;return-1}function hi(e,t){return Ma(e,t)}function rr(e,t={}){return e.filter(i=>i.type==="input"&&(!t.requiredOnly||!i.optional)).length}function hn(e,t){let i=hi(e,t),r="";for(let l of i){if(l.type==="literal"||l.type==="fixed"){r+=l.value;continue}r+="_"}return r}function ja(e,t){let i="",r=0;for(let l of t){if(l.type==="fixed"||l.type==="literal"){e.slice(r,r+l.value.length)===l.value&&(r+=l.value.length);continue}if(r>=e.length)continue;let h=e[r];Va(h,l.kind,l.pattern)&&(i+=h,r+=1)}return i}function La(e,t){if(!e)return"";let i=0,r="";for(let l of t){if(l.type==="fixed"||l.type==="literal"){r+=l.value;continue}if(i>=e.length){if(l.optional)continue;break}let h=e[i];if(!Va(h,l.kind,l.pattern)){if(l.optional)continue;break}r+=h,i+=1}return r}function WA(e){return e.every(t=>t.type!=="input"||t.kind==="digit")}function HA(e,t){let i=e.replace(/\D/g,""),r=t.filter(l=>l.type==="fixed").map(l=>l.value.replace(/\D/g,"")).join("");return r&&i.startsWith(r)?i.slice(r.length):i}function pi(e,t,i){let r=hi(t,i),l=rr(r),h=ja(e,r);return h.length===0&&/\S/.test(e)&&WA(r)&&(h=HA(e,r)),h.length>l&&(h=h.slice(0,l)),La(h,r)}var pn=new Date(2001,8,3);function nr(e){return Ft(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(pn).filter(t=>t.type==="year"||t.type==="month"||t.type==="day").map(t=>t.type)}function ze(e){let t=Ft(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(pn),i="";for(let r of t){if(r.type==="literal"){i+=r.value;continue}(r.type==="month"||r.type==="day"||r.type==="year")&&(i+=r.value.replace(/\d/g,"0"))}return i}function fn(e){return Ft(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(pn).map(i=>i.type==="literal"?i.value:i.type==="year"?"yyyy":i.type==="month"?"mm":i.type==="day"?"dd":"").join("")}function qe(e){return e.replace(/\D/g,"")}function or(e,t){return pi(qe(e),t)}function fi(e){return rr(hi(e),{requiredOnly:!0})}function YA(e){return e>=100?e:e>=69?1900+e:2e3+e}function mn(e,t){let i=nr(t),r=0,l={};for(let h of i){let d=h==="year"?4:2,a=e.slice(r,r+d);if(a.length<d)return null;let E=Number(a);h==="year"&&(E=YA(E)),l[h]=E,r+=d}return l}function gn(e){if(e.year==null||e.month==null||e.day==null)return null;let t=new Date(e.year,e.month-1,e.day);return t.getFullYear()!==e.year||t.getMonth()!==e.month-1||t.getDate()!==e.day?null:t}var XA=new Date(2001,8,3);function Pa(e){return Ft(e,{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(XA).filter(i=>i.type==="year"||i.type==="month"||i.type==="day").map(i=>i.type)}function Ba(e){return e>=100?e:e>=69?1900+e:2e3+e}function Fa(e){let t=e.year,i=e.month,r=e.day;if(!Number.isFinite(t)||!Number.isFinite(i)||!Number.isFinite(r))return null;let l=new Date(t,i-1,r);return l.getFullYear()!==t||l.getMonth()!==i-1||l.getDate()!==r?null:l}function mi(e,t){let i=(e??"").trim();if(!i)return null;let r=Pt(i);if(r)return r;let l=NA(i,t);if(l)return l;let h=JA(i,t);if(h)return h;let d=Pa(t),a=i.match(/\d+/g);if(!a||a.length<3)return null;let E={day:0,month:0,year:0};for(let A=0;A<3;A+=1){let S=d[A];if(!S)return null;let D=Number(a[A]);S==="year"&&(D=Ba(D)),E[S]=D}return Fa(E)}function NA(e,t){let i=ze(t),r=qe(e);return r.length<fi(i)?null:gn(mn(r,t)??{})}function QA(e){let t=new Map;for(let i of["short","long"])for(let r=0;r<12;r+=1){let l=Ft(e,{month:i}).formatToParts(new Date(2020,r,1)).find(h=>h.type==="month")?.value;l&&t.set(l.toLowerCase(),r+1)}return t}function JA(e,t){let i=QA(t),r=e.toLowerCase();for(let[l,h]of i){if(r.indexOf(l)<0)continue;let a=e.match(/\d+/g);if(!a||a.length<2)continue;let E=a.find(T=>T.length===4)??a[a.length-1],A=a.find(T=>T!==E&&Number(T)<=31);if(!A||!E)continue;let S=Ba(Number(E)),D=Number(A);return Fa({year:S,month:h,day:D})}return null}var Ua,za,qa,Ka,$a,Ga,Wa,Ha,Ya,Xa,Na,Qa,Ja,Za,ts,es,is,rs,ns,os,as,ss,ls,us,cs,ds,hs,ps,fs,ms,gs,bs,vs,ys,_s,xs;function ZA(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:ws(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||ws(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:tI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return iI(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function tI(e){var t=eI(e,"string");return typeof t=="symbol"?t:t+""}function eI(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ws(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function iI(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Es,Ts=class extends Ss{static{({e:[qa,Ka,$a,Ga,Wa,Ha,Ya,Xa,Na,Qa,Ja,Za,ts,es,is,rs,ns,os,as,ss,ls,us,cs,ds,hs,ps,fs,ms,gs,bs,vs,ys,_s,xs,Ua],c:[Es,za]}=ZA(this,[rI("rui-calendar")],[[ue({type:String,reflect:!0,defaultValue:""}),0,"value"],[ue({type:String,defaultValue:""}),0,"min"],[ue({type:String,defaultValue:""}),0,"max"],[ue({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ue({type:String,defaultValue:""}),0,"locale"],[ue({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[ue({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[ue({type:String,attribute:"page-behavior",defaultValue:"visible"}),0,"pageBehavior"],[nI({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[ce,0,"viewYear"],[ce,0,"viewMonth"],[ce,0,"focusedIso"],[ce,0,"weekdayLabels"],[ce,0,"monthPanels"],[ce,0,"todayLabel"],[ce,0,"rangeAnchor"],[ce,0,"rangeHover"],[oI(["value","min","max","disabled","locale","selectionMode","visibleMonths","pageBehavior"]),2,"onPropsUpdated"],[Te({selector:"[data-calendar-prev-month]",type:"click"}),2,"onPrevMonth"],[Te({selector:"[data-calendar-next-month]",type:"click"}),2,"onNextMonth"],[Te({selector:"[data-calendar-today]",type:"click"}),2,"onTodayClick"],[Te({selector:"[data-calendar-day]",type:"click"}),2,"onDayClick"],[Te({selector:"[data-calendar-day]",type:"pointerenter"}),2,"onDayPointerEnter"],[Te({selector:"[data-calendar-grid]",type:"pointerleave"}),2,"onGridPointerLeave"],[Te({selector:"[data-calendar-day]",type:"keydown"}),2,"onDayKeydown"]],0,void 0,Ss))}constructor(...t){super(...t),xs(this)}value=(Ua(this),qa(this));min=(Ka(this),$a(this));max=(Ga(this),Wa(this));disabled=(Ha(this),Ya(this));locale=(Xa(this),Na(this));selectionMode=(Qa(this),Ja(this));visibleMonths=(Za(this),ts(this));pageBehavior=(es(this),is(this));changeEvent=(rs(this),ns(this));viewYear=(os(this),as(this,new Date().getFullYear()));viewMonth=(ss(this),ls(this,new Date().getMonth()));focusedIso=(us(this),cs(this,""));weekdayLabels=(ds(this),hs(this,[]));monthPanels=(ps(this),fs(this,[]));todayLabel=(ms(this),gs(this,""));rangeAnchor=(bs(this),vs(this,null));rangeHover=(ys(this),_s(this,null));get resolvedLocale(){return Wt(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 t=this.selectionMode==="range"?At(this.value)?.start??"":this.selectionMode==="multiple"?Ue(this.value)[0]??"":this.value,i=Pt(t);if(i){this.viewYear=i.getFullYear(),this.viewMonth=i.getMonth(),this.focusedIso=t;return}let r=new Date;this.viewYear=r.getFullYear(),this.viewMonth=r.getMonth(),this.focusedIso=Bt(r)}refreshGrid(){this.weekdayLabels=cn(this.resolvedLocale,er(this.resolvedLocale)),this.monthPanels=ln(this.viewYear,this.viewMonth,this.visibleMonths).map(t=>{let i=new Date(t.year,t.month,1);return{year:t.year,month:t.month,label:un(i,this.resolvedLocale),weeks:sn(t.year,t.month,this.monthOptions)}}),this.todayLabel=dn(this.resolvedLocale)}moveMonth(t){let i=ir(this.viewYear,this.viewMonth,t);this.viewYear=i.year,this.viewMonth=i.month,this.refreshGrid()}getFlatDays(){return this.monthPanels.flatMap(t=>t.weeks.flat())}moveFocusedDay(t){let i=this.getFlatDays().filter(d=>!d.isDisabled);if(!i.length)return;let r=i.findIndex(d=>d.iso===this.focusedIso),l=r<0?Math.max(0,i.findIndex(d=>d.inMonth)):(r+t+i.length)%i.length,h=i[l];if(h){if(!this.isMonthVisible(h.date)){this.viewYear=h.date.getFullYear(),this.viewMonth=h.date.getMonth(),this.focusedIso=h.iso,this.refreshGrid(),this.focusFocusedDay();return}this.focusedIso=h.iso,this.focusDayInCurrentGrid(h.iso)}}isMonthVisible(t){let i=this.viewYear*12+this.viewMonth,r=i+this.visibleMonths-1,l=t.getFullYear()*12+t.getMonth();return l>=i&&l<=r}focusDayInCurrentGrid(t){let i=this.querySelector('[data-calendar-day][tabindex="0"]'),r=Array.from(this.querySelectorAll(`[data-calendar-day][data-iso="${t}"]:not(:disabled)`)),l=r.find(h=>!h.hasAttribute("data-outside"))??r[0];l&&(i&&i!==l&&(i.tabIndex=-1),l.tabIndex=0,l.focus())}focusFocusedDay(){requestAnimationFrame(()=>{this.focusDayInCurrentGrid(this.focusedIso)})}moveFocusedMonth(t){let i=Pt(this.focusedIso)??new Date(this.viewYear,this.viewMonth,1),r=new Date(i.getFullYear(),i.getMonth()+t,1),l=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),h=new Date(r.getFullYear(),r.getMonth(),Math.min(i.getDate(),l));this.viewYear=h.getFullYear(),this.viewMonth=h.getMonth(),this.focusedIso=Bt(h),this.refreshGrid(),this.focusFocusedDay()}isIsoAllowed(t){return!(this.min&&t<this.min||this.max&&t>this.max)}emitChange(t,i={}){this.changeEvent.emit({value:t,...i})}selectSingle(t){!this.isIsoAllowed(t)||t===this.value||(this.value=t,this.emitChange(t),this.refreshGrid())}selectMultiple(t){if(!this.isIsoAllowed(t))return;let i=rn(nn(Ue(this.value),t));i!==this.value&&(this.value=i,this.emitChange(i),this.refreshGrid())}selectRange(t){if(!this.isIsoAllowed(t))return;let i=an(At(this.value),{anchor:this.rangeAnchor,hover:this.rangeHover},t);if(this.rangeAnchor=i.draft.anchor,this.rangeHover=i.draft.hover,i.committed){let r=ci(i.committed);r!==this.value&&(this.value=r,this.emitChange(r,{start:i.committed.start,end:i.committed.end}))}this.refreshGrid()}selectIso(t){if(this.selectionMode==="multiple"){this.selectMultiple(t);return}if(this.selectionMode==="range"){this.selectRange(t);return}this.selectSingle(t)}previewRange(t){this.selectionMode!=="range"||!this.rangeAnchor||this.disabled||this.rangeHover!==t&&(this.rangeHover=t,this.refreshGrid())}clearRangePreview(){this.rangeHover&&(this.rangeHover=this.rangeAnchor,this.refreshGrid())}initialize(){this.syncViewFromValue(),this.refreshGrid()}onConnected(){this.initialize()}onPropsUpdated(){this.selectionMode!=="range"&&(this.rangeAnchor=null,this.rangeHover=null),this.syncViewFromValue(),this.refreshGrid()}onPrevMonth(t){t.preventDefault(),this.moveMonth(-this.pageDelta)}onNextMonth(t){t.preventDefault(),this.moveMonth(this.pageDelta)}onTodayClick(t){t.preventDefault(),this.selectIso(Bt(new Date))}onDayClick(t){let i=t.target.closest("[data-calendar-day]"),r=i?.getAttribute("data-iso");!r||i?.disabled||this.disabled||this.selectIso(r)}onDayPointerEnter(t){let i=t.target.closest("[data-calendar-day]"),r=i?.getAttribute("data-iso");!r||i?.disabled||this.previewRange(r)}onGridPointerLeave(){this.clearRangePreview()}onDayKeydown(t){if(this.disabled)return;let i=t.target.getAttribute("data-iso");if(i&&(this.focusedIso=i),t.key==="ArrowLeft"){t.preventDefault(),this.moveFocusedDay(-1);return}if(t.key==="ArrowRight"){t.preventDefault(),this.moveFocusedDay(1);return}if(t.key==="ArrowUp"){t.preventDefault(),this.moveFocusedDay(-7);return}if(t.key==="ArrowDown"){t.preventDefault(),this.moveFocusedDay(7);return}if(t.key==="PageUp"){t.preventDefault(),this.moveFocusedMonth(t.shiftKey?-12:-this.pageDelta);return}if(t.key==="PageDown"){t.preventDefault(),this.moveFocusedMonth(t.shiftKey?12:this.pageDelta);return}if(t.key==="Enter"||t.key===" "){t.preventDefault();let r=t.target,l=r.getAttribute("data-iso");l&&!r.disabled&&this.selectIso(l)}}dayDataAttributes(t){return{"data-range-start":t.isRangeStart?"true":void 0,"data-range-end":t.isRangeEnd?"true":void 0,"data-range-middle":t.isRangeMiddle?"true":void 0}}render(){let t=this.monthPanels.length,i=t>1;return bn("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:[xt("div",{class:"rui-calendar__months",children:this.monthPanels.map((r,l)=>bn("div",{class:"rui-calendar__month-panel","data-calendar-month-panel":!0,children:[bn("div",{class:"rui-calendar__header",children:[l===0?xt("button",{type:"button",class:"rui-calendar__nav","data-calendar-prev-month":!0,"aria-label":"Previous month",disabled:this.disabled,children:"\u2039"}):xt("span",{class:"rui-calendar__nav-spacer","aria-hidden":"true"}),xt("div",{class:"rui-calendar__month","aria-live":"polite",children:r.label}),l===t-1?xt("button",{type:"button",class:"rui-calendar__nav","data-calendar-next-month":!0,"aria-label":"Next month",disabled:this.disabled,children:"\u203A"}):xt("span",{class:"rui-calendar__nav-spacer","aria-hidden":"true"})]}),l===0?xt("div",{class:"rui-calendar__weekdays",role:"row",children:this.weekdayLabels.map(h=>xt("div",{class:"rui-calendar__weekday",role:"columnheader","aria-hidden":"true",children:h}))}):null,xt("div",{class:"rui-calendar__grid",role:"grid","data-calendar-grid":!0,children:r.weeks.map(h=>xt("div",{class:"rui-calendar__week",role:"row",children:h.map(d=>xt("button",{type:"button",class:"rui-calendar__day","data-calendar-day":!0,"data-iso":d.iso,role:"gridcell",disabled:this.disabled||d.isDisabled,tabIndex:d.iso===this.focusedIso?0:-1,"aria-selected":d.isSelected?"true":"false","aria-current":d.isToday?"date":void 0,"data-outside":d.inMonth?void 0:"true",...this.dayDataAttributes(d),children:d.date.getDate()}))}))})]}))}),xt("div",{class:"rui-calendar__footer",children:xt("button",{type:"button",class:"rui-calendar__today","data-calendar-today":!0,disabled:this.disabled,children:this.todayLabel})})]})}static{za()}};import{jsx as aI}from"@ecopages/jsx/jsx-runtime";function gi({children:e,...t}){return aI("rui-calendar",{...t,children:e})}import{RadiantElement as rl,customElement as dI,onEvent as wt,onUpdated as vn,prop as Ut,query as yn}from"@ecopages/radiant";var Rs,As,Is,Cs,Ds,Os,ks,Vs,Ms,js,Ls,Ps,Bs,Fs,Us,zs,qs,Ks,$s,Gs,Ws,Hs,Ys,Xs,Ns,Qs,Js,Zs,tl,el;function sI(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:il(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||il(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.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)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function lI(e){var t=uI(e,"string");return typeof t=="symbol"?t:t+""}function uI(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function il(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function cI(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Ee={label:"Carousel",transition:"none",controlsVariant:"toolbar"},hI=48,ol,nl=class extends rl{static{({e:[Is,Cs,Ds,Os,ks,Vs,Ms,js,Ls,Ps,Bs,Fs,Us,zs,qs,Ks,$s,Gs,Ws,Hs,Ys,Xs,Ns,Qs,Js,Zs,tl,el,Rs],c:[ol,As]}=sI(this,[dI("rui-carousel")],[[Ut({type:String,defaultValue:Ee.label}),0,"label"],[Ut({type:Number,reflect:!0,defaultValue:0}),0,"index"],[Ut({type:Boolean,reflect:!0,defaultValue:!1}),0,"autoplay"],[Ut({type:Number,defaultValue:4e3}),0,"interval"],[Ut({type:String,defaultValue:Ee.transition}),0,"transition"],[Ut({type:String,defaultValue:Ee.controlsVariant,attribute:"controls-variant"}),0,"controlsVariant"],[Ut({type:Boolean,defaultValue:!1}),0,"showIndicators"],[Ut({type:Boolean,defaultValue:!1}),0,"showRotationControl"],[Ut({type:Boolean,defaultValue:!0}),0,"loop"],[Ut({type:Boolean,defaultValue:!0}),0,"wrap"],[Ut({type:Number,defaultValue:0}),0,"slideCount"],[yn({ref:"track"}),0,"trackTarget"],[yn({ref:"indicators"}),0,"indicatorsTarget"],[yn({ref:"viewport"}),0,"viewportTarget"],[vn(["index","transition","loop","wrap","controlsVariant"]),2,"onSlideStateUpdated"],[vn(["autoplay","showRotationControl","interval"]),2,"onAutoplayUpdated"],[vn(["showIndicators"]),2,"onIndicatorsUpdated"],[wt({selector:'[data-carousel-action="prev"]',type:"click"}),2,"prev"],[wt({selector:'[data-carousel-action="next"]',type:"click"}),2,"next"],[wt({selector:'[data-carousel-action="rotation"]',type:"click"}),2,"toggleRotation"],[wt({selector:"[data-carousel-indicator]",type:"click"}),2,"onIndicatorClick"],[wt({selector:"[data-carousel-indicator]",type:"keydown"}),2,"onIndicatorKeydown"],[wt({ref:"root",type:"pointerenter"}),2,"onRootPointerEnter"],[wt({ref:"root",type:"pointerleave"}),2,"onRootPointerLeave"],[wt({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[wt({ref:"root",type:"focusout"}),2,"onRootFocusOut"],[wt({ref:"viewport",type:"pointerdown"}),2,"onViewportPointerDown"],[wt({ref:"viewport",type:"pointermove"}),2,"onViewportPointerMove"],[wt({ref:"viewport",type:"pointerup"}),2,"onViewportPointerUp"],[wt({ref:"viewport",type:"pointercancel"}),2,"onViewportPointerCancel"]],0,void 0,rl))}label=(Rs(this),Is(this));index=(Cs(this),Ds(this));autoplay=(Os(this),ks(this));interval=(Vs(this),Ms(this));transition=(js(this),Ls(this));controlsVariant=(Ps(this),Bs(this));showIndicators=(Fs(this),Us(this));showRotationControl=(zs(this),qs(this));loop=(Ks(this),$s(this));wrap=(Gs(this),Ws(this));slideCount=(Hs(this),Ys(this));trackTarget=(Xs(this),Ns(this));indicatorsTarget=(Qs(this),Js(this));viewportTarget=(Zs(this),tl(this));timer=(el(this),null);paused=!1;userOverrideReducedMotion=!1;swipePointerId=null;swipeStartX=0;swipeStartY=0;onConnected(){this.autoplay&&this.prefersReducedMotion()&&(this.paused=!0),this.sync(),this.syncAutoplay(),this.syncIndicators(),this.syncAriaLive()}disconnectedCallback(){this.stop(),super.disconnectedCallback()}onSlideStateUpdated(){this.sync(),this.syncIndicators(),this.syncAutoplay()}onAutoplayUpdated(){this.syncAutoplay(),this.syncRotationControl()}onIndicatorsUpdated(){this.syncIndicators()}prefersReducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}getCarouselId(){return this.id||"rui-carousel"}slidePanelId(t,i){let r=t.getAttribute("data-slide")??String(i),l=`${this.getCarouselId()}-panel-${r}`;return t.id=l,l}tabId(t){return`${this.getCarouselId()}-tab-${t}`}syncSlideAccessibility(t,i){let r=t.length;t.forEach((l,h)=>{let d=h===i,a=`${h+1} of ${r}`;this.showIndicators?(this.slidePanelId(l,h),l.setAttribute("role","tabpanel"),l.setAttribute("aria-labelledby",this.tabId(h)),l.setAttribute("aria-label",a),l.removeAttribute("aria-roledescription")):(l.setAttribute("role","group"),l.setAttribute("aria-roledescription","slide"),l.setAttribute("aria-label",a),l.removeAttribute("aria-labelledby"),l.removeAttribute("tabindex")),this.transition==="none"?l.hidden=!d:l.hidden=!1,l.setAttribute("aria-hidden",String(!d)),l.setAttribute("data-active",d?"true":"false")})}getSlides(){return Array.from(this.querySelectorAll("[data-slide]"))}get shouldWrap(){return this.wrap&&this.loop}normalizeIndex(t,i){return i<=0?0:this.shouldWrap?(t%i+i)%i:Math.min(Math.max(t,0),i-1)}sync(){let t=this.getSlides();if(!t.length)return;let i=this.normalizeIndex(this.index,t.length);i!==this.index&&(this.index=i);let r=this.trackTarget;r&&this.transition==="slide"&&r.style.setProperty("--rui-carousel-index",String(i)),this.syncSlideAccessibility(t,i),this.syncPrevNextDisabled(t.length,i)}syncPrevNextDisabled(t,i){let r=!this.shouldWrap&&t>0&&i<=0,l=!this.shouldWrap&&t>0&&i>=t-1;for(let h of this.querySelectorAll('[data-carousel-action="prev"]'))this.shouldWrap?h.removeAttribute("disabled"):h.disabled=r;for(let h of this.querySelectorAll('[data-carousel-action="next"]'))this.shouldWrap?h.removeAttribute("disabled"):h.disabled=l}syncIndicators(){let t=this.indicatorsTarget;if(!t)return;let i=this.getSlides(),r=this.normalizeIndex(this.index,i.length);Array.from(t.querySelectorAll("[data-carousel-indicator]")).length!==i.length&&t.replaceChildren(...i.map((d,a)=>{let E=document.createElement("button");return E.type="button",E.className="rui-carousel__indicator",E.id=this.tabId(a),E.setAttribute("role","tab"),E.setAttribute("data-carousel-indicator",String(a)),E.setAttribute("aria-controls",this.slidePanelId(d,a)),E.setAttribute("aria-label",`Slide ${a+1}`),E})),Array.from(t.querySelectorAll("[data-carousel-indicator]")).forEach((d,a)=>{let E=a===r,A=i[a];A&&(d.id=this.tabId(a),d.setAttribute("aria-controls",this.slidePanelId(A,a))),d.setAttribute("aria-selected",String(E)),d.tabIndex=E?0:-1})}syncRotationControl(){for(let t of this.querySelectorAll('[data-carousel-action="rotation"]')){let i=this.autoplay&&!this.paused;t.setAttribute("aria-pressed",String(i)),t.setAttribute("aria-label",i?"Pause rotation":"Start rotation")}}syncAriaLive(){let t=this.viewportTarget;if(!t)return;let i=this.autoplay&&!this.paused&&this.timer!==null;t.setAttribute("aria-live",i?"off":"polite"),t.setAttribute("aria-atomic","false")}canAutoplayRotate(){return!(!this.autoplay||this.paused||this.prefersReducedMotion()&&!this.userOverrideReducedMotion)}syncAutoplay(){this.canAutoplayRotate()?this.start():this.stop(),this.syncRotationControl(),this.syncAriaLive()}start(){let t=this.getSlides();if(!t.length)return;if(!this.shouldWrap&&this.index>=t.length-1){this.stop();return}this.stop();let i=Math.max(0,this.interval);this.timer=setInterval(()=>{let r=this.getSlides();if(r.length){if(!this.shouldWrap&&this.index>=r.length-1){this.stop(),this.syncAriaLive();return}this.goTo(this.index+1)}},i),this.syncAriaLive()}stop(){this.timer&&clearInterval(this.timer),this.timer=null,this.syncAriaLive()}goTo(t){let i=this.getSlides();i.length&&(this.index=this.normalizeIndex(t,i.length),this.sync(),this.syncIndicators())}userNavigate(t){this.paused=!0,this.stop(),this.goTo(this.index+t)}isSwipeExcludedTarget(t){return t instanceof Element?!!t.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(t){let i=t.target.closest("[data-carousel-indicator]");if(!i)return;let r=Number(i.getAttribute("data-carousel-indicator"));Number.isFinite(r)&&(this.paused=!0,this.stop(),this.goTo(r),i.focus())}onIndicatorKeydown(t){let i=this.getSlides();if(!i.length)return;let r=t.target.closest("[data-carousel-indicator]");if(!r)return;let l=Number(r.getAttribute("data-carousel-indicator"));if(!Number.isFinite(l))return;if(t.key==="ArrowRight")l=this.normalizeIndex(l+1,i.length);else if(t.key==="ArrowLeft")l=this.normalizeIndex(l-1,i.length);else if(t.key==="Home")l=0;else if(t.key==="End")l=i.length-1;else if(t.key===" "||t.key==="Enter"){t.preventDefault(),this.paused=!0,this.stop(),this.goTo(l);return}else return;t.preventDefault(),this.paused=!0,this.stop(),this.goTo(l),Array.from(this.indicatorsTarget?.querySelectorAll("[data-carousel-indicator]")??[])[l]?.focus()}onRootPointerEnter(t){this.autoplay&&t.pointerType==="mouse"&&this.stop()}onRootPointerLeave(t){this.autoplay&&!this.paused&&t.pointerType==="mouse"&&this.syncAutoplay()}onRootFocusIn(){this.autoplay&&this.stop()}onRootFocusOut(t){let i=t.relatedTarget;i&&this.contains(i)||this.autoplay&&!this.paused&&this.syncAutoplay()}onViewportPointerDown(t){t.button!==0||this.isSwipeExcludedTarget(t.target)||(this.swipePointerId=t.pointerId,this.swipeStartX=t.clientX,this.swipeStartY=t.clientY)}onViewportPointerMove(t){this.swipePointerId,t.pointerId}onViewportPointerUp(t){if(this.swipePointerId!==t.pointerId)return;let i=t.clientX-this.swipeStartX,r=t.clientY-this.swipeStartY;this.swipePointerId=null,!(Math.abs(i)<hI||Math.abs(i)<=Math.abs(r))&&(i<0?this.next():this.prev())}onViewportPointerCancel(t){this.swipePointerId===t.pointerId&&(this.swipePointerId=null)}static{As()}};import{jsx as ot,jsxs as Re}from"@ecopages/jsx/jsx-runtime";function al({id:e,children:t,class:i,...r}){return ot("div",{...r,class:L("rui-carousel__slide",i),"data-slide":e,children:t})}function pI(){return Re("span",{class:"rui-carousel__nav-label",children:[ot("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})}function fI(){return Re("span",{class:"rui-carousel__nav-label",children:["Next",ot("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})}function sl({children:e,class:t,disabled:i,overlay:r,aria:l,...h}){return ot("button",{...h,aria:nt(l,"Previous slide"),type:"button","data-carousel-action":"prev","data-ref":"prev",class:L("rui-carousel__nav rui-button rui-button--outline rui-button--sm",r?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",t),disabled:i,children:e??(r?ot("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}):pI())})}function ll({children:e,class:t,disabled:i,overlay:r,aria:l,...h}){return ot("button",{...h,aria:nt(l,"Next slide"),type:"button","data-carousel-action":"next","data-ref":"next",class:L("rui-carousel__nav rui-button rui-button--outline rui-button--sm",r?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",t),disabled:i,children:e??(r?ot("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"}):fI())})}function ul({children:e,class:t,overlay:i,aria:r,...l}){return ot("button",{...l,aria:nt(r,"Start rotation"),type:"button","data-carousel-action":"rotation","data-ref":"rotation",class:L("rui-carousel__rotation rui-button rui-button--ghost rui-button--sm",i&&"rui-carousel__rotation--overlay",t),"aria-pressed":!1,children:e??"Play"})}function mI({autoplay:e,children:t,controlsVariant:i,label:r,next:l,prev:h,rotation:d,showIndicators:a,showRotationControl:E,transition:A}){let S=i==="overlay",D=e||E,T=h??ot(sl,{overlay:S}),K=l??ot(ll,{overlay:S}),$=D?d??ot(ul,{overlay:S}):null,P=a?ot("div",{class:L("rui-carousel__indicators",S&&"rui-carousel__indicators--overlay"),"data-ref":"indicators",role:"tablist","aria-label":"Choose slide to display"}):null,G=Re("div",{class:"rui-carousel__toolbar",children:[D?ot("div",{class:"rui-carousel__toolbar-rotation",children:$}):null,ot("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--start",children:T}),ot("div",{class:"rui-carousel__toolbar-center",children:P}),ot("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--end",children:K})]}),W=S?Re("div",{class:"rui-carousel__overlay-chrome",children:[D?ot("div",{class:"rui-carousel__overlay-rotation",children:$}):null,Re("div",{class:"rui-carousel__controls rui-carousel__controls--overlay",children:[T,K]}),P]}):null;return Re("section",{class:L("rui-carousel",`rui-carousel--${A}`,`rui-carousel--controls-${i}`),"data-ref":"root","aria-roledescription":"carousel","aria-label":r,children:[ot("div",{class:"rui-carousel__stage",children:Re("div",{class:"rui-carousel__viewport","data-ref":"viewport",children:[ot("div",{class:"rui-carousel__track","data-ref":"track",children:t}),W]})}),S?null:ot("div",{class:"rui-carousel__footer",children:G})]})}function gI({slides:e,children:t,prev:i,next:r,rotation:l,label:h=Ee.label,transition:d=Ee.transition,controlsVariant:a=Ee.controlsVariant,showIndicators:E,showRotationControl:A,autoplay:S,...D}){let T=e??[],K=e!=null?T.map($=>ot(al,{id:$.id,children:$.children})):t;return ot("rui-carousel",{...D,label:h,transition:d,controlsVariant:a,showIndicators:E,showRotationControl:A,autoplay:S,slideCount:T.length,children:ot(mI,{autoplay:S,controlsVariant:a,label:h,next:r,prev:i,rotation:l,showIndicators:E,showRotationControl:A,transition:d,children:K})})}import{RadiantElement as Al,bound as xI,customElement as wI,event as SI,onEvent as TI,onUpdated as EI,prop as bi,query as RI}from"@ecopages/radiant";var cl,dl,hl,pl,fl,ml,gl,bl,vl,yl,_l,xl,wl,Sl,Tl,El;function bI(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Rl(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Rl(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:vI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _I(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function vI(e){var t=yI(e,"string");return typeof t=="symbol"?t:t+""}function yI(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rl(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function _I(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var _n="on",ar,Il=class extends Al{static{({e:[hl,pl,fl,ml,gl,bl,vl,yl,_l,xl,wl,Sl,Tl,El,cl],c:[ar,dl]}=bI(this,[wI("rui-checkbox")],[[bi({type:Boolean,reflect:!0,defaultValue:!1}),0,"checked"],[bi({type:Boolean,reflect:!0,defaultValue:!1}),0,"indeterminate"],[bi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[bi({type:String,defaultValue:_n}),0,"value"],[bi({type:String,defaultValue:""}),0,"name"],[RI({ref:"input"}),0,"inputTarget"],[SI({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[xI,EI(["checked","indeterminate","disabled","value","name"])],2,"syncInputState"],[TI({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,Al))}constructor(...t){super(...t),El(this)}checked=(cl(this),hl(this));indeterminate=(pl(this),fl(this));disabled=(ml(this),gl(this));value=(bl(this),vl(this));name=(yl(this),_l(this));inputTarget=(xl(this),wl(this));changeEvent=(Sl(this),Tl(this));onConnected(){this.syncInputState()}syncInputState(){let t=this.inputTarget;t&&(t.checked=this.checked,t.indeterminate=this.indeterminate,t.disabled=this.disabled,t.value=this.value,this.name?t.name=this.name:t.removeAttribute("name"),this.indeterminate?t.setAttribute("aria-checked","mixed"):t.removeAttribute("aria-checked"))}onInputChange(t){let i=t.target;this.checked=i.checked,i.indeterminate=this.indeterminate,this.changeEvent.emit({checked:this.checked,indeterminate:this.indeterminate})}static{dl()}};import{jsx as sr,jsxs as AI}from"@ecopages/jsx/jsx-runtime";function vi({children:e,checked:t,disabled:i,indeterminate:r,name:l,value:h=_n,...d}){return sr("rui-checkbox",{...d,checked:t,disabled:i,indeterminate:r,name:l,value:h,"data-disabled":i?"":void 0,children:AI("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:t,disabled:i,value:h,name:l||void 0,"aria-checked":r?"mixed":void 0}),sr("span",{class:"rui-checkbox__control","aria-hidden":"true"}),sr("span",{class:"rui-checkbox__label",children:e})]})})}import{RadiantElement as $l,customElement as kI,event as VI,onEvent as MI,onUpdated as jI,prop as yi}from"@ecopages/radiant";function St(e){return e?xn(e.split(",")):[]}function It(e){return e.join(",")}function de(e){if(e!=null)return typeof e!="string"?It(xn(e)):e}function Ae(e){return e==null?[]:typeof e!="string"?xn(e):St(e)}function xn(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}var Cl,Dl,Ol,kl,Vl,Ml,jl,Ll,Pl,Bl,Fl,Ul,zl,ql;function II(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Kl(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Kl(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:CI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return OI(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function CI(e){var t=DI(e,"string");return typeof t=="symbol"?t:t+""}function DI(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kl(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function OI(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Wl,Gl=class extends $l{static{({e:[Ol,kl,Vl,Ml,jl,Ll,Pl,Bl,Fl,Ul,zl,ql,Cl],c:[Wl,Dl]}=II(this,[kI("rui-checkbox-group")],[[yi({type:String,reflect:!0,defaultValue:""}),0,"value"],[yi({type:String,defaultValue:""}),0,"name"],[yi({type:String,defaultValue:""}),0,"label"],[yi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[yi({type:String,reflect:!0,defaultValue:"vertical"}),0,"orientation"],[VI({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[jI(["value","name","label","disabled","orientation"]),2,"syncCheckboxes"],[MI({selector:"rui-checkbox",type:"rui-change"}),2,"onCheckboxChange"]],0,void 0,$l))}constructor(...t){super(...t),ql(this)}value=(Cl(this),Ol(this));name=(kl(this),Vl(this));label=(Ml(this),jl(this));disabled=(Ll(this),Pl(this));orientation=(Bl(this),Fl(this));changeEvent=(Ul(this),zl(this));onConnected(){this.syncCheckboxes()}syncCheckboxes(){let t=this.querySelector("[data-checkbox-group-root]");t&&(this.label?t.setAttribute("aria-label",this.label):t.removeAttribute("aria-label"),this.disabled?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled"),t.setAttribute("data-orientation",this.orientation));let i=new Set(St(this.value)),r=this.name||this.getAttribute("name")||"";for(let l of this.getCheckboxes())l.checked=i.has(l.value),l.disabled=this.disabled||l.hasAttribute("data-disabled"),r&&(l.name=r)}onCheckboxChange(t){t.stopImmediatePropagation();let i=this.getCheckboxes().filter(r=>r.checked).map(r=>r.value);this.value=It(i),this.changeEvent.emit({value:this.value})}getCheckboxes(){return Array.from(this.querySelectorAll("rui-checkbox")).filter(t=>t instanceof ar)}static{Dl()}};import{jsx as lr}from"@ecopages/jsx/jsx-runtime";function Hl({children:e,class:t,orientation:i="vertical",...r}){return lr("div",{...r,"data-checkbox-group-root":!0,"data-orientation":i,class:L("rui-checkbox-group",t),role:"group","data-rui-control":!0,"data-rui-control-type":"text",children:e})}function LI({options:e,children:t,value:i,orientation:r="vertical",...l}){let h=de(i),d=new Set(St(h??""));return lr("rui-checkbox-group",{...l,value:h,orientation:r,children:e==null?t:lr(Hl,{orientation:r,children:e.map(a=>lr(vi,{value:a.value,disabled:a.disabled,checked:d.has(a.value),children:a.label}))})})}import{jsx as PI}from"@ecopages/jsx/jsx-runtime";function BI({children:e,variant:t="default",class:i,...r}){return PI("span",{...r,class:L("rui-chip",`rui-chip--${t}`,i),children:e})}import{jsx as Yl}from"@ecopages/jsx/jsx-runtime";function FI({children:e,class:t,...i}){return Yl("ul",{...i,class:L("rui-chip-list",t),children:e})}function UI({children:e,class:t,...i}){return Yl("li",{...i,class:L("rui-chip-list__item",t),children:e})}import{RadiantElement as Tu,customElement as tC,event as eC,onEvent as qt,onUpdated as iC,prop as Ce,query as rC}from"@ecopages/radiant";function _i(e){let t=e.previousElementSibling;return t?.tagName.toLowerCase()==="label"?t:e.parentElement?.querySelector("[data-rui-field-label]")??null}function wn(e,t,i){e.id||(e.id=i.labelId),e.htmlFor||(e.htmlFor=i.controlId),t.setAttribute("aria-labelledby",e.id),t.removeAttribute("aria-label")}function Ht(e,t,i){if(!t||t.hasAttribute("data-rui-field-managed"))return;let r=_i(e);if(r){wn(r,t,i);return}if(i.label){t.setAttribute("aria-label",i.label),t.removeAttribute("aria-labelledby");return}t.removeAttribute("aria-label"),t.removeAttribute("aria-labelledby")}var zI="data-listbox-option-indicator";function Ie(e){let t=e.getAttribute("data-label");return t||Xl(e).trim()}function Ct(e){return e.getAttribute("data-value")||Ie(e)}function Xl(e){if(qI(e))return"";if(e.nodeType===Node.TEXT_NODE)return e.textContent??"";let t="";for(let i of e.childNodes)t+=Xl(i);return t}function qI(e){return e instanceof HTMLElement&&e.hasAttribute(zI)}var Ke=class{config;constructor(t){this.config=t}getListboxHost(){return this.config.getRoot()?.querySelector("rui-listbox")??null}getListbox(){let t=this.getListboxHost();return t?t.querySelector('[role="listbox"]')??t:this.config.getPopup?.()??null}getOptions(){let t=this.getListbox();return t?Array.from(t.querySelectorAll('[role="option"]')):[]}getSelectedValues(){return St(this.config.getValue())}setSelectedValues(t){this.config.setValue(It(t))}toggleValue(t){if(this.config.getSelectionMode()==="multiple"){let i=new Set(this.getSelectedValues());i.has(t)?i.delete(t):i.add(t),this.setSelectedValues([...i]);return}this.setSelectedValues([t])}removeValue(t){let i=new Set(this.getSelectedValues());return i.delete(t)?(this.setSelectedValues([...i]),!0):!1}clearValues(){return this.config.getValue()?(this.setSelectedValues([]),!0):!1}findOption(t){return t instanceof Element?t.closest('[role="option"]')??null:null}isSelectableOption(t){return t!=null&&t.getAttribute("aria-disabled")!=="true"&&!t.hidden}syncListboxHost(){let t=this.getListboxHost();t&&(t.embedded=!0,t.selectionMode=this.config.getSelectionMode(),t.value=this.config.getValue())}syncOptionSelection(){let t=new Set(this.getSelectedValues());for(let i of this.getOptions())i.setAttribute("aria-selected",String(t.has(Ct(i))))}syncMultiselectable(t){if(t){if(this.config.getSelectionMode()==="multiple"){t.setAttribute("aria-multiselectable","true");return}t.removeAttribute("aria-multiselectable")}}getTagGroup(){let t=this.config.tagGroupSelector;if(!t)return null;let i=this.config.getRoot()?.querySelector(t)??null;return!i||typeof i.setItems!="function"?null:i}syncTagGroup(){let t=this.getTagGroup();if(!t)return;let i=this.getSelectedValues().flatMap(r=>{let l=this.getOptions().find(h=>Ct(h)===r);return l?[{value:r,label:Ie(l)}]:[]});t.embedded=!0,t.setItems(i),t.value=this.config.getValue()}labelForValue(t){let i=this.getOptions().find(r=>Ct(r)===t);return i?Ie(i):t}};var KI={top:"bottom",bottom:"top",left:"right",right:"left"},$I=8;function GI(e){let t=e.indexOf("-");if(t===-1)return{side:e,align:"center"};let i=e.slice(0,t),r=e.slice(t+1);return{side:i,align:r==="start"||r==="end"?r:"center"}}function Jl(e){return e==="top"||e==="bottom"?"y":"x"}function Nl(e,t,i,r,l){let{width:h,height:d}=t,a=0,E=0;switch(i){case"top":E=e.top-d-l;break;case"bottom":E=e.bottom+l;break;case"left":a=e.left-h-l;break;case"right":a=e.right+l;break}return Jl(i)==="y"?r==="start"?a=e.left:r==="end"?a=e.right-h:a=e.left+(e.width-h)/2:r==="start"?E=e.top:r==="end"?E=e.bottom-d:E=e.top+(e.height-d)/2,{x:a,y:E}}function WI(e,t,i,r){let{padding:l,width:h,height:d}=r;return i==="top"?Math.max(0,l-e.y):i==="bottom"?Math.max(0,e.y+t.height-(d-l)):i==="left"?Math.max(0,l-e.x):Math.max(0,e.x+t.width-(h-l))}function Ql(e,t,i,r){let{padding:l,width:h,height:d}=r;return i==="top"?e.top-l-t.height:i==="bottom"?d-l-t.height-e.bottom:i==="left"?e.left-l-t.width:h-l-t.width-e.right}function HI(e,t){return t==="center"?e:`${e}-${t}`}function YI(e,t,i,r){let{padding:l,width:h,height:d}=r;if(Jl(i)==="y"){let E=Math.max(l,h-l-t.width);return{x:Math.min(Math.max(e.x,l),E),y:e.y}}let a=Math.max(l,d-l-t.height);return{x:e.x,y:Math.min(Math.max(e.y,l),a)}}function XI(e,t,i,r,l={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:$I}){let{side:h,align:d}=GI(i),a=Nl(e,t,h,d,r),E=WI(a,t,h,l),A=h,S=a;if(E>0){let D=KI[h],T=Nl(e,t,D,d,r),K=Ql(e,t,h,l);Ql(e,t,D,l)>K&&(A=D,S=T)}return{coords:YI(S,t,A,l),placement:HI(A,d)}}function Sn(e,t,i,r,l={}){let{coords:h,placement:d}=XI(e.getBoundingClientRect(),{width:t.offsetWidth,height:t.offsetHeight},i,r);return Object.assign(t.style,{position:"fixed",left:`${h.x}px`,top:`${h.y}px`,right:"auto",bottom:"auto",visibility:"visible"}),l.matchAnchorWidth&&(t.style.width=`${e.offsetWidth}px`),t.setAttribute("data-placement",d),d}function ur({anchor:e,floating:t,getPlacement:i,gap:r,matchAnchorWidth:l}){let h=()=>{t.hidden||Sn(e,t,i(),r,{matchAnchorWidth:l})};h(),window.addEventListener("resize",h),window.addEventListener("scroll",h,!0);let d=new ResizeObserver(h);return d.observe(e),d.observe(t),()=>{window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0),d.disconnect()}}function Zl(e,t=document.body){let i=e.parentNode;if(!i)return{unmount:()=>{}};let r=document.createComment("rui-portal");return i.insertBefore(r,e),t.appendChild(e),{unmount:()=>{let l=r.parentNode;l&&(l.insertBefore(e,r),r.remove())}}}function Tn(e,t,i){return i?!!(e?.contains(i)||t?.contains(i)):!1}function zt(e,t,i){return i instanceof Node?!Tn(e,t,i):!0}function he(e,t,i){return!Tn(e,t,i)}var ut=class{config;cleanupFloating=null;portalHandle=null;floatingElement=null;constructor(t){this.config=t}updateConfig(t){this.config={...this.config,...t}}sync(){let t=this.resolveFloating();if(!t)return;if(!this.config.getOpen()){this.teardown(),t.toggleAttribute("hidden",!0);return}let r=this.config.getAnchor();if(!r)return;t.toggleAttribute("hidden",!1),this.config.portal!==!1?this.portalHandle||(this.portalHandle=Zl(t,this.config.portalContainer??document.body)):this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null),this.teardownFloating(),this.cleanupFloating=ur({anchor:r,floating:t,getPlacement:this.config.getPlacement,gap:this.config.gap??8,matchAnchorWidth:this.config.matchAnchorWidth})}contains(t){return Tn(this.config.getAnchor(),this.resolveFloating(),t)}getFloatingElement(){return this.resolveFloating()}teardown(){this.teardownFloating(),this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null)}destroy(){this.teardown(),this.floatingElement=null}resolveFloating(){let t=this.config.getFloating();return t&&(this.floatingElement=t),t??this.floatingElement}teardownFloating(){this.cleanupFloating?.(),this.cleanupFloating=null}};function tu(e){return e.filter(t=>!t.hidden&&t.getAttribute("aria-disabled")!=="true")}function eu(e,t,i){return i===0?-1:t===1?e>=i-1?0:e+1:e<=0?i-1:e-1}function En(e,t){t?.removeAttribute("aria-activedescendant");for(let i of e)i.removeAttribute("data-active")}function iu(e,t,i,r,l){En(e,r);let h=t[i];return!h||!r?null:(h.id||(h.id=`${l}-${i}`),h.setAttribute("data-active","true"),r.setAttribute("aria-activedescendant",h.id),h.scrollIntoView({block:"nearest"}),h)}var $e=class{config;popoverController;activeIndex=-1;visualFocus=!1;constructor(t){this.config=t,this.popoverController=new ut({getAnchor:t.getAnchor,getFloating:t.getFloating,getOpen:t.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((t,i)=>{t.id||(t.id=`${this.config.getOptionIdPrefix()}-${i}`)})}getVisibleOptions(){return tu(this.config.getOptions())}clearActiveOption(){this.activeIndex=-1,this.visualFocus=!1,En(this.config.getOptions(),this.config.getActiveDescendantHost())}setActiveOption(t){let i=this.getVisibleOptions();if(t<0||t>=i.length){this.clearActiveOption();return}this.activeIndex=t,this.visualFocus=!0,iu(this.config.getOptions(),i,t,this.config.getActiveDescendantHost(),this.config.getOptionIdPrefix())}moveActive(t,i){let r=this.getVisibleOptions();if(r.length){if(!this.config.getOpen()){i(t===1?"first":"last");return}if(this.visualFocus){this.setActiveOption(eu(this.activeIndex,t,r.length));return}this.setActiveOption(t===1?0:r.length-1)}}handleKeydown(t,i){if(t.ctrlKey||t.shiftKey||t.metaKey)return;this.keydownHandlers[t.key]?.call(this,t,i)}keydownHandlers={ArrowDown:this.handleArrowKey,ArrowUp:this.handleArrowKey,Escape:this.handleEscapeKey,Enter:this.handleActivationKey," ":this.handleActivationKey,Tab:this.handleTabKey};handleArrowKey(t,i){t.preventDefault(),t.stopPropagation();let r=t.key==="ArrowDown"?1:-1;if(t.altKey){this.handleModifiedArrow(r,i);return}this.moveActive(r,l=>i.onOpen(l))}handleModifiedArrow(t,i){t===1&&!i.isOpen&&i.onOpen(),t===-1&&i.isOpen&&i.onClose("arrow")}handleEscapeKey(t,i){t.preventDefault(),i.isOpen?i.onClose("escape"):i.onEscapeWhenClosed?.()}handleActivationKey(t,i){if(!(t.key===" "&&!i.canUseSpace)){if(!i.isOpen&&i.enterWhenClosed==="open"){t.preventDefault(),i.onOpen();return}if(i.isOpen){if(this.hasActiveOption()){t.preventDefault(),i.onSelectActive();return}t.key==="Enter"&&i.enterWithoutActive==="close"&&(t.preventDefault(),i.onClose("enter"))}}}handleTabKey(t,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(t){return zt(this.config.getAnchor(),this.popoverController.getFloatingElement(),t)}shouldDismissPointer(t){return he(this.config.getAnchor(),this.popoverController.getFloatingElement(),t)}destroy(){this.popoverController.destroy()}};var ru,nu,ou,au,su,lu,uu,cu,du,hu,pu,fu,mu,gu,bu,vu,yu,_u,xu,wu;function NI(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Su(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Su(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:QI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ZI(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function QI(e){var t=JI(e,"string");return typeof t=="symbol"?t:t+""}function JI(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Su(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function ZI(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Ru,Eu=class extends Tu{static{({e:[ou,au,su,lu,uu,cu,du,hu,pu,fu,mu,gu,bu,vu,yu,_u,xu,wu,ru],c:[Ru,nu]}=NI(this,[tC("rui-combobox")],[[Ce({type:String,reflect:!0,defaultValue:""}),0,"value"],[Ce({type:String,defaultValue:""}),0,"label"],[Ce({type:String,defaultValue:""}),0,"placeholder"],[Ce({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Ce({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[Ce({type:Boolean,attribute:"should-close-on-select"}),0,"shouldCloseOnSelect"],[Ce({type:String,attribute:"trigger-kind",reflect:!0,defaultValue:"input"}),0,"triggerKind"],[eC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[rC({ref:"root"}),0,"rootTarget"],[iC(["value","label","placeholder","disabled","triggerKind","selectionMode","shouldCloseOnSelect"]),2,"onPropsUpdated"],[qt({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[qt({ref:"root",type:"input"}),2,"onRootInput"],[qt({ref:"root",type:"keydown",options:{capture:!0}}),2,"onRootKeydown"],[qt({selector:"[data-combobox-trigger]",type:"click"}),2,"onTriggerClick"],[qt({selector:'[data-combobox-listbox] [role="option"]',type:"pointerover"}),2,"onOptionPointerOver"],[qt({selector:'[data-combobox-listbox] [role="option"]',type:"mousedown"}),2,"onOptionMouseDown"],[qt({selector:'[data-combobox-listbox] [role="option"]',type:"click"}),2,"onOptionClick"],[qt({selector:"[data-combobox-value] rui-tag-group",type:"rui-remove"}),2,"onTagRemove"],[qt({selector:"[data-combobox-clear]",type:"click"}),2,"onClearClick"],[qt({ref:"root",type:"focusout"}),2,"onFocusOut"],[qt({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"]],0,void 0,Tu))}constructor(...t){super(...t),wu(this)}value=(ru(this),ou(this));label=(au(this),su(this));placeholder=(lu(this),uu(this));disabled=(cu(this),du(this));selectionMode=(hu(this),pu(this));shouldCloseOnSelect=(fu(this),mu(this));triggerKind=(gu(this),bu(this));changeEvent=(vu(this),yu(this));open=(_u(this),!1);skipNextFocusOpen=!1;uid=Math.random().toString(36).slice(2,9);collection=new Ke({getRoot:()=>this,getSelectionMode:()=>this.selectionMode,getValue:()=>this.value,setValue:t=>{this.value=t},getPopup:()=>this.getListboxPopup(),tagGroupSelector:"[data-combobox-value] rui-tag-group"});listboxBehavior=new $e({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.collection.getOptions(),getActiveDescendantHost:()=>this.getInput(),getOptionIdPrefix:()=>`rui-combobox-option-${this.uid}`});rootTarget=xu(this);get listboxId(){return`rui-combobox-list-${this.uid}`}get inputId(){return`rui-combobox-input-${this.uid}`}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 _i(this)?.textContent?.trim()||this.label||"Suggestions"}isComboboxInput(t){return t instanceof HTMLElement&&t.localName==="input"&&t.hasAttribute("data-combobox-input")}syncLabel(){let t=this.getInput();Ht(this,t,{controlId:this.inputId,label:this.label,labelId:`rui-combobox-label-${this.uid}`})}syncTrigger(){let t=this.getTrigger(),i=this.collection.getListbox();!t||!i||(t.setAttribute("aria-expanded",String(this.open)),t.setAttribute("aria-controls",i.id||this.listboxId),t.tabIndex=-1,this.disabled&&(t.disabled=!0))}syncInput(){let t=this.getInput(),i=this.collection.getListbox(),r=this.getListboxPopup();!t||!i||(t.id||(t.id=this.inputId),i.id||(i.id=this.listboxId),t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","listbox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-expanded",String(this.open)),t.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&&(t.placeholder=this.isMultiple()&&this.collection.getSelectedValues().length?"":this.placeholder),this.disabled&&(t.disabled=!0),this.syncClear(),this.syncTrigger())}syncClear(){let t=this.getClear();t&&(t.hidden=this.collection.getSelectedValues().length===0&&!(this.getInput()?.value??""),t.disabled=this.disabled)}setVisualFocusCombobox(){this.listboxBehavior.clearActiveOption(),this.collection.syncOptionSelection()}setOpen(t,i={}){let r=i.activate??"none";this.open=t;let l=this.getInput(),h=this.getListboxPopup();if(!(!l||!h)){if(l.setAttribute("aria-expanded",String(t)),h.toggleAttribute("hidden",!t),this.syncTrigger(),!t){this.listboxBehavior.clearActiveOption(),this.listboxBehavior.syncPopoverPosition();return}if(this.ensureOptionIds(),this.listboxBehavior.syncPopoverPosition(),r==="first"){let d=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(d.length?0:-1);return}if(r==="last"){let d=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(d.length?d.length-1:-1);return}this.listboxBehavior.clearActiveOption()}}getAutocomplete(){return this.querySelector("rui-autocomplete")}syncAutocompleteFilter(){let t=this.getAutocomplete();if(t){t.syncFilter();return}let i=this.getInput()?.value??"";for(let r of this.collection.getOptions()){let l=tr(Ie(r),i,"base");r.hidden=i.trim()!==""&&!l}}showAllOptions(){for(let t of this.collection.getOptions())t.hidden=!1}syncFilter(){this.syncAutocompleteFilter()}select(t){if(!this.collection.isSelectableOption(t))return;let i=Ct(t),r=Ie(t)||i;this.collection.toggleValue(i);let l=this.getInput();l&&(l.value=this.isMultiple()?"":r),this.collection.syncTagGroup(),this.syncInput(),this.collection.syncOptionSelection(),this.changeEvent.emit({value:this.value}),this.closesOnSelect()&&(this.skipNextFocusOpen=!0,this.setOpen(!1)),this.syncFilter(),l?.focus()}syncFromValue(){let t=this.getInput();if(!t)return;if(this.isMultiple()){t.value="";return}let i=this.collection.getSelectedValues()[0]??"";t.value=i?this.collection.labelForValue(i):""}removeSelectedValue(t){this.collection.removeValue(t)&&(this.collection.syncTagGroup(),this.syncInput(),this.collection.syncOptionSelection(),this.changeEvent.emit({value:this.value}),this.getInput()?.focus())}clearSelection(){let t=this.getInput(),i=this.value!=="",r=!!t?.value;this.collection.clearValues(),t&&(t.value=""),this.syncFilter(),this.syncInput(),this.collection.syncTagGroup(),this.collection.syncOptionSelection(),i&&this.changeEvent.emit({value:""}),(r||i)&&t?.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(t){if(this.isComboboxInput(t.target)){if(this.skipNextFocusOpen){this.skipNextFocusOpen=!1;return}this.triggerKind==="focus"&&(this.syncFilter(),this.setOpen(!0),this.setVisualFocusCombobox())}}onRootInput(t){if(!this.isComboboxInput(t.target))return;let i=t.target;this.syncFilter();let r=i.value.trim()!=="",l=this.listboxBehavior.getVisibleOptions().length>0;r&&l&&(this.open||this.triggerKind!=="manual")?this.setOpen(!0):!r&&this.triggerKind==="focus"?this.setOpen(!0):(!r||!l)&&this.setOpen(!1),this.setVisualFocusCombobox()}onRootKeydown(t){this.isComboboxInput(t.target)&&this.handleInputKeydown(t)}handleInputKeydown(t){if(t.key==="Home"){let i=this.getInput();if(!i)return;t.preventDefault(),i.setSelectionRange(0,0),this.setVisualFocusCombobox();return}if(t.key==="End"){let i=this.getInput();if(!i)return;t.preventDefault();let r=i.value.length;i.setSelectionRange(r,r),this.setVisualFocusCombobox();return}(t.key==="ArrowDown"||t.key==="ArrowUp")&&(this.syncFilter(),this.listboxBehavior.getVisibleOptions().length||this.showAllOptions()),this.listboxBehavior.handleKeydown(t,{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(t){t.preventDefault();let i=this.getInput();!i||i.disabled||(this.open?(this.skipNextFocusOpen=!0,this.setOpen(!1)):(this.syncFilter(),this.setOpen(!0),this.setVisualFocusCombobox()),i.focus())}onOptionPointerOver(t){if(!this.open)return;let i=this.collection.findOption(t.target);if(!this.collection.isSelectableOption(i))return;let l=this.listboxBehavior.getVisibleOptions().indexOf(i);l>=0&&this.listboxBehavior.setActiveOption(l)}onOptionMouseDown(t){t.preventDefault()}onOptionClick(t){let i=this.collection.findOption(t.target);i&&this.select(i)}onTagRemove(t){let i=t.detail;i?.value&&this.removeSelectedValue(i.value)}onClearClick(t){t.preventDefault(),t.stopPropagation(),this.clearSelection()}onFocusOut(t){this.listboxBehavior.shouldDismissFocus(t.relatedTarget)&&this.setOpen(!1)}onDocumentPointerDown(t){this.open&&this.listboxBehavior.shouldDismissPointer(t.target)&&this.setOpen(!1)}static{nu()}};import{jsx as at,jsxs as In}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as $u,customElement as uC,event as cC,onEvent as Gu,onUpdated as dC,prop as We}from"@ecopages/radiant";function lt(e,t){e.forEach((i,r)=>{let l=r===t?0:-1;i.tabIndex!==l&&(i.tabIndex=l)})}function Ge(e,t){if(!e.length)return null;let i=Math.max(0,Math.min(e.length-1,t));return lt(e,i),e[i]?.focus(),e[i]??null}function nC(e,t){return e==="Home"?"first":e==="End"?"last":t==="horizontal"?e==="ArrowRight"?"next":e==="ArrowLeft"?"prev":null:e==="ArrowDown"?"next":e==="ArrowUp"?"prev":null}function ct(e){let{items:t,current:i,key:r,orientation:l="horizontal",wrap:h=!0}=e;if(!t.length||!i)return{handled:!1};let d=t.indexOf(i);if(d<0)return{handled:!1};let a=nC(r,l);if(!a)return{handled:!1};let E=d;a==="first"?E=0:a==="last"?E=t.length-1:a==="next"?E=h?(d+1)%t.length:Math.min(t.length-1,d+1):E=h?(d-1+t.length)%t.length:Math.max(0,d-1);let A=Ge(t,E);return A?{handled:!0,index:E,item:A}:{handled:!1}}var Au,Iu,Cu,Du,Ou,ku,Vu,Mu,ju,Lu,Pu,Bu,Fu,Uu,zu,qu;function oC(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Ku(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Ku(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:aC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return lC(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function aC(e){var t=sC(e,"string");return typeof t=="symbol"?t:t+""}function sC(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ku(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function lC(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Hu,Wu=class extends $u{static{({e:[Cu,Du,Ou,ku,Vu,Mu,ju,Lu,Pu,Bu,Fu,Uu,zu,qu,Au],c:[Hu,Iu]}=oC(this,[uC("rui-listbox")],[[We({type:String,reflect:!0,defaultValue:""}),0,"value"],[We({type:String,defaultValue:""}),0,"label"],[We({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[We({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[We({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[We({type:Boolean,reflect:!0}),0,"bordered"],[cC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[dC(["value","label","disabled","embedded","selectionMode"]),2,"onPropsUpdated"],[Gu({selector:'[role="option"]',type:"click"}),2,"onOptionClick"],[Gu({selector:'[role="option"]',type:"keydown"}),2,"onOptionKeydown"]],0,void 0,$u))}value=(Au(this),Cu(this));label=(Du(this),Ou(this));disabled=(ku(this),Vu(this));selectionMode=(Mu(this),ju(this));embedded=(Lu(this),Pu(this));bordered=(Bu(this),Fu(this));changeEvent=(Uu(this),zu(this));uid=(qu(this),Math.random().toString(36).slice(2,9));onConnected(){this.syncLabel(),this.sync()}onPropsUpdated(){this.syncLabel(),this.sync()}getOptions(){return Array.from(this.querySelectorAll('[role="option"]'))}syncLabel(){if(this.embedded)return;let t=this.querySelector('[role="listbox"]');t&&(t.id||(t.id=`rui-listbox-${this.uid}`),Ht(this,t,{controlId:t.id,label:this.label,labelId:`rui-listbox-label-${this.uid}`}))}getSelectedValues(){return St(this.value)}setSelectedValues(t){this.value=It(t)}tabIndexFor(t,i){return this.embedded?-1:t===i?0:-1}sync(){let t=this.getOptions(),i=new Set(this.getSelectedValues()),r=t.find(h=>i.has(Ct(h)))??t[0],l=this.querySelector('[role="listbox"]');l&&(this.selectionMode==="multiple"?l.setAttribute("aria-multiselectable","true"):l.removeAttribute("aria-multiselectable"));for(let h of t){let d=i.has(Ct(h));h.setAttribute("aria-selected",String(d)),h.tabIndex=this.tabIndexFor(h,r)}}select(t){if(this.disabled||t.getAttribute("aria-disabled")==="true")return;let i=Ct(t);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}),t.focus()}onOptionClick(t){if(this.embedded)return;let i=t.target.closest('[role="option"]');i&&this.contains(i)&&this.select(i)}onOptionKeydown(t){if(this.embedded)return;let i=this.getOptions(),r=t.target.closest('[role="option"]');if(!r)return;if(t.key==="Enter"||t.key===" "){t.preventDefault(),this.select(r);return}let l=ct({items:i,current:r,key:t.key,orientation:"vertical"});if(l.handled){if(t.preventDefault(),this.selectionMode==="multiple"){l.item.focus();return}this.select(l.item)}}static{Iu()}};import{jsx as De,jsxs as hC}from"@ecopages/jsx/jsx-runtime";function Rn({value:e,label:t,children:i,class:r,disabled:l,...h}){return De("div",{...h,class:L("rui-listbox__option",r),role:"option","data-value":e,"data-label":t,"aria-disabled":l?"true":void 0,tabindex:-1,children:i})}function Yu({children:e,class:t,...i}){return De("span",{...i,"data-listbox-option-indicator":!0,"aria-hidden":"true",class:L("rui-listbox__option-indicator",t),children:e??De(ui,{})})}function pC(e,t){return t??!e}function fC({bordered:e,children:t,disabled:i,label:r,selectionMode:l="single"}){return De("div",{class:L("rui-listbox",e&&"rui-listbox--bordered"),role:"listbox","data-rui-control":!0,"data-rui-control-type":"text","aria-label":r||void 0,"aria-disabled":i?"true":void 0,"aria-multiselectable":l==="multiple"?"true":void 0,children:t})}function He({options:e,children:t,value:i,embedded:r,bordered:l,label:h,disabled:d,selectionMode:a="single",...E}){let A=pC(r,l),S=de(i),D=new Set(Ae(i));return De("rui-listbox",{...E,value:S,embedded:r,bordered:l,label:h,disabled:d,selectionMode:a,children:De(fC,{bordered:A,disabled:d,label:h,selectionMode:a,children:e!=null?e.map(T=>hC(Rn,{value:T.value,label:typeof T.label=="string"?T.label:void 0,disabled:T.disabled,"aria-selected":D.has(T.value)?"true":void 0,children:[T.label,a==="multiple"?De(Yu,{}):null]})):t})})}import{RadiantElement as fc,customElement as yC,event as mc,onEvent as An,onUpdated as _C,prop as xi,state as xC}from"@ecopages/radiant";var Xu,Nu,Qu,Ju,Zu,tc,ec,ic,rc,nc,oc,ac,sc,lc,uc,cc,dc,hc;function mC(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:pc(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||pc(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:gC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return vC(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function gC(e){var t=bC(e,"string");return typeof t=="symbol"?t:t+""}function bC(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pc(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function vC(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var bc,gc=class extends fc{static{({e:[Qu,Ju,Zu,tc,ec,ic,rc,nc,oc,ac,sc,lc,uc,cc,dc,hc,Xu],c:[bc,Nu]}=mC(this,[yC("rui-tag-group")],[[xi({type:String,reflect:!0,defaultValue:""}),0,"value"],[xi({type:String,defaultValue:""}),0,"label"],[xi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[xi({type:String,attribute:"selection-mode",defaultValue:"multiple"}),0,"selectionMode"],[xi({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[mc({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[mc({name:"rui-remove",bubbles:!0,composed:!0}),0,"removeEvent"],[xC,0,"derivedItems"],[_C(["value","label","disabled","selectionMode","embedded","derivedItems"]),2,"onPropsUpdated"],[An({selector:"[data-tag]",type:"click"}),2,"onTagClick"],[An({selector:"[data-tag-remove]",type:"click"}),2,"onRemoveClick"],[An({selector:"[data-tag]",type:"keydown"}),2,"onTagKeydown"]],0,void 0,fc))}constructor(...t){super(...t),hc(this)}value=(Xu(this),Qu(this));label=(Ju(this),Zu(this));disabled=(tc(this),ec(this));selectionMode=(ic(this),rc(this));embedded=(nc(this),oc(this));changeEvent=(ac(this),sc(this));removeEvent=(lc(this),uc(this));uid=(cc(this),Math.random().toString(36).slice(2,9));derivedItems=dc(this,null);isMultiple(){return this.selectionMode==="multiple"}getSelectedValues(){return this.value?St(this.value):[]}setSelectedValues(t){this.value=It(t)}getList(){let t=this.querySelector("[data-rui-managed-list]");return t||(this.derivedItems!=null?null:this.querySelector("[data-tag-list]"))}getTags(){let t=this.getList();return t?Array.from(t.querySelectorAll("[data-tag]")):[]}getVisibleTags(){return this.getTags().filter(t=>!t.hidden&&t.getAttribute("aria-disabled")!=="true")}getTagValue(t){return t.getAttribute("data-value")||t.textContent?.trim()||""}getTagLabel(t){return t.getAttribute("data-label")||t.textContent?.trim()||""}ensureTagIds(){this.getTags().forEach((t,i)=>{t.id||(t.id=`rui-tag-${this.uid}-${i}`)})}syncList(){let t=this.getList();t&&(t.id||(t.id=`rui-tag-list-${this.uid}`),t.setAttribute("role","list"),t.setAttribute("aria-label",this.label||"Tags"),this.disabled?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled"))}syncTags(){let t=new Set(this.getSelectedValues());this.getTags().forEach((r,l)=>{r.setAttribute("role","listitem");let h=this.getTagValue(r),d=t.has(h);r.setAttribute("aria-selected",String(d)),r.tabIndex=l===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(t){if(this.disabled||this.embedded||t.getAttribute("aria-disabled")==="true")return;let i=this.getTagValue(t);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(t){let i=this.getTagValue(t),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(t){this.derivedItems=t,this.value=It(t.map(i=>i.value))}createManagedTag(t){let i=document.createElement("span");i.setAttribute("data-tag",""),i.setAttribute("data-value",t.value),i.setAttribute("data-label",t.label),i.className="rui-tag",i.textContent=t.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 ${t.label}`),r.append(Ji()),i.append(r),i}syncManagedList(){let t=this.querySelector('[data-ref="root"]');if(!t||this.derivedItems==null)return;t.querySelector("[data-tag-list]:not([data-rui-managed-list])")?.toggleAttribute("hidden",!0);let r=t.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",t.appendChild(r)),r.replaceChildren(...this.derivedItems.map(l=>this.createManagedTag(l))),this.ensureTagIds(),this.syncList(),this.syncTags()}onTagClick(t){let i=t.target;if(i.closest("[data-tag-remove]"))return;let r=i.closest("[data-tag]");r&&this.contains(r)&&this.selectTag(r)}onRemoveClick(t){t.stopPropagation();let r=t.target.closest("[data-tag]");r&&this.contains(r)&&this.removeTag(r)}onTagKeydown(t){let i=this.getVisibleTags(),r=t.target.closest("[data-tag]");if(!r)return;if(t.key==="Enter"||t.key===" "){t.preventDefault(),this.embedded||this.selectTag(r);return}if(t.key==="Backspace"||t.key==="Delete"){r.querySelector("[data-tag-remove]")&&(t.preventDefault(),this.removeTag(r));return}ct({items:i,current:r,key:t.key,orientation:"horizontal"}).handled&&t.preventDefault()}static{Nu()}};import{jsx as Kt,jsxs as wC}from"@ecopages/jsx/jsx-runtime";function yc({children:e,class:t,...i}){return Kt("div",{...i,"data-tag-list":!0,class:L("rui-tag-group__list",t),children:e})}function _c({value:e,label:t,children:i,class:r,disabled:l,...h}){return wC("span",{...h,"data-tag":!0,"data-value":e,"data-label":t,class:L("rui-tag",r),"aria-disabled":l?"true":void 0,children:[i,Kt(xc,{})]})}function xc({children:e,class:t,aria:i,...r}){return Kt("button",{...r,aria:nt(i,"Remove"),type:"button","data-tag-remove":!0,class:L("rui-tag__remove",t),children:e??Kt(Rt,{})})}function vc({children:e}){return Kt("div",{class:"rui-tag-group","data-ref":"root",children:e})}function wi({tags:e,children:t,...i}){return e!=null?Kt("rui-tag-group",{...i,children:Kt(vc,{children:Kt(yc,{children:e.map(r=>Kt(_c,{value:r.value,label:typeof r.label=="string"?r.label:void 0,disabled:r.disabled,children:r.label}))})})}):Kt("rui-tag-group",{...i,children:Kt(vc,{children:t})})}function Sc({children:e,class:t,...i}){return at("div",{...i,class:L("rui-combobox__control",t),children:e})}function Tc({placeholder:e,disabled:t,class:i,...r}){return at("input",{...r,type:"text","data-combobox-input":!0,"data-autocomplete-input":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:L("rui-combobox__input",i),placeholder:e,disabled:t,autocomplete:"off"})}function Ec({children:e,class:t,aria:i,disabled:r,...l}){return at("button",{...l,aria:nt(i,"Show suggestions"),type:"button","data-combobox-trigger":!0,class:L("rui-control-toggle",t),disabled:r,tabIndex:-1,children:e??at(we,{})})}function SC({children:e,class:t,aria:i,disabled:r,...l}){return at("button",{...l,aria:nt(i,"Clear selection"),type:"button","data-combobox-clear":!0,class:L("rui-control-clear",t),disabled:r,children:e??at(Rt,{})})}function Rc({children:e,class:t,...i}){return at("span",{...i,"data-combobox-value":!0,class:L("rui-combobox__value",t),children:e})}function Ac({children:e,class:t,...i}){return at("div",{...i,"data-combobox-listbox":!0,class:L("rui-combobox__listbox rui-popover rui-popover--listbox rui-floating",t),children:e})}function wc({children:e}){return at("div",{class:"rui-combobox","data-ref":"root",children:e})}function TC({options:e,children:t,value:i,...r}){let l=de(i),h=Ae(i),d=e?.filter(E=>h.includes(E.value)).map(E=>({value:E.value,label:E.label})),a=r.selectionMode==="multiple";return e!=null?at("rui-combobox",{...r,value:l,children:In(wc,{children:[In(Sc,{children:[a?at(Rc,{children:at(wi,{tags:d??[],label:"Selected options"})}):null,at(Tc,{placeholder:r.placeholder,disabled:r.disabled}),at(Ec,{})]}),at(Ac,{children:at(Zr,{children:In(Qr,{children:[at(He,{embedded:!0,options:e,selectionMode:r.selectionMode,value:l}),at(Jr,{children:"No results found."})]})})})]})}):at("rui-combobox",{...r,value:l,children:at(wc,{children:t})})}import{RadiantElement as Kc,customElement as CC,event as DC,onEvent as OC,onUpdated as kC,prop as Si}from"@ecopages/radiant";function Cn(e,t){if(e.length===0)throw new RangeError("cycleValue requires at least one value");let i=t===void 0?-1:e.indexOf(t);return i===-1?e[0]:e[(i+1)%e.length]}var Ic,Cc,Dc,Oc,kc,Vc,Mc,jc,Lc,Pc,Bc,Fc,Uc,zc;function EC(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:qc(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||qc(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:RC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return IC(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function RC(e){var t=AC(e,"string");return typeof t=="symbol"?t:t+""}function AC(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qc(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function IC(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var VC="[data-cycle-value]",Dn="button[data-cycle-toggle-button]",Gc,$c=class extends Kc{static{({e:[Dc,Oc,kc,Vc,Mc,jc,Lc,Pc,Bc,Fc,Uc,zc,Ic],c:[Gc,Cc]}=EC(this,[CC("rui-cycle-toggle")],[[Si({type:String,reflect:!0,defaultValue:""}),0,"value"],[Si({type:String,reflect:!0,defaultValue:"filled"}),0,"variant"],[Si({type:String,reflect:!0,defaultValue:"md"}),0,"size"],[Si({type:String,defaultValue:""}),0,"label"],[Si({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[DC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[kC(["value","label","disabled","size","variant"]),2,"onPropsUpdated"],[OC({selector:Dn,type:"click"}),2,"onButtonClick"]],0,void 0,Kc))}value=(Ic(this),Dc(this));variant=(Oc(this),kc(this));size=(Vc(this),Mc(this));label=(jc(this),Lc(this));disabled=(Pc(this),Bc(this));changeEvent=(Fc(this),Uc(this));childObserver=(zc(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 t=this.syncSelection(this.value||this.getItemValue(this.getEnabledItems()[0])||"");this.syncButtonPresentation(),this.syncButtonLabel(t)}getItems(){return Array.from(this.querySelectorAll(VC))}getEnabledItems(){return this.getItems().filter(t=>t.getAttribute("aria-disabled")!=="true")}getItemValue(t){return t?t.dataset.cycleValue??"":""}syncButtonLabel(t){let i=this.querySelector(Dn);if(!i)return;let r=t?.querySelector("[aria-label]")?.ariaLabel??t?.textContent?.trim();if(!this.label||!r){i.removeAttribute("aria-label");return}i.setAttribute("aria-label",`${this.label}: ${r}`)}syncButtonPresentation(){let t=this.querySelector(Dn);if(t){t.disabled=this.disabled;for(let i of Array.from(t.classList))i.startsWith("rui-button--")&&t.classList.remove(i);t.classList.add(`rui-button--${this.variant}`,`rui-button--${this.size}`)}}syncSelection(t){let i=this.getItems();if(!i.length)return;let r=this.getEnabledItems(),l=i.find(d=>this.getItemValue(d)===t&&r.includes(d))??r[0]??i[0],h=this.getItemValue(l);this.value=h;for(let d of i)d.hidden=d!==l;return l}cycle(){if(this.disabled)return;let i=this.getEnabledItems().map(l=>this.getItemValue(l)).filter(Boolean);if(!i.length)return;let r=Cn(i,this.value||void 0);r!==this.value&&(this.syncSelection(r),this.changeEvent.emit({value:this.value}))}onButtonClick(){this.cycle()}static{Cc()}};import{jsx as cr}from"@ecopages/jsx/jsx-runtime";function MC({id:e,children:t,class:i,disabled:r,selected:l,...h}){return cr("span",{...h,class:L("rui-cycle-toggle__item",i),"data-cycle-value":e,hidden:l===void 0?void 0:!l,"aria-disabled":r?"true":void 0,children:t})}function Wc({children:e,variant:t="filled",size:i="md",disabled:r,class:l,...h}){return cr("button",{...h,type:"button",class:L("rui-button","rui-cycle-toggle__button",`rui-button--${t}`,`rui-button--${i}`,l),disabled:r,"data-cycle-toggle-button":!0,children:e})}function jC({children:e,variant:t,size:i,disabled:r,...l}){return cr("rui-cycle-toggle",{...l,variant:t,size:i,disabled:r,children:cr(Wc,{variant:t,size:i,disabled:r,children:e})})}import{jsx as mt,jsxs as kn}from"@ecopages/jsx/jsx-runtime";var Hc={system:"System",light:"Light",dark:"Dark"},On={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},LC={system:kn("svg",{...On,children:[mt("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),mt("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),mt("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]}),light:kn("svg",{...On,children:[mt("circle",{cx:"12",cy:"12",r:"4"}),mt("path",{d:"M12 2v2"}),mt("path",{d:"M12 20v2"}),mt("path",{d:"m4.93 4.93 1.41 1.41"}),mt("path",{d:"m17.66 17.66 1.41 1.41"}),mt("path",{d:"M2 12h2"}),mt("path",{d:"M20 12h2"}),mt("path",{d:"m6.34 17.66-1.41 1.41"}),mt("path",{d:"m19.07 4.93-1.41 1.41"})]}),dark:mt("svg",{...On,children:mt("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"})})};function Yc({preference:e}){return LC[e]}function Xc({preference:e}){return Hc[e]}function PC({preference:e,showLabel:t=!0}){return kn("span",{class:"inline-flex items-center gap-inline","aria-label":t?void 0:Hc[e],children:[mt(Yc,{preference:e}),t?mt(Xc,{preference:e}):void 0]})}import{RadiantElement as Vd,customElement as qC,event as KC,onEvent as Yt,onUpdated as Md,prop as Dt,query as $C,state as Vn}from"@ecopages/radiant";var Nc,Qc,Jc,Zc,td,ed,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,gd,bd,vd,yd,_d,xd,wd,Sd,Td,Ed,Rd,Ad,Id,Cd,Dd,Od;function BC(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:kd(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||kd(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:FC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return zC(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function FC(e){var t=UC(e,"string");return typeof t=="symbol"?t:t+""}function UC(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kd(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function zC(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Ld,jd=class extends Vd{static{({e:[Jc,Zc,td,ed,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,gd,bd,vd,yd,_d,xd,wd,Sd,Td,Ed,Rd,Ad,Id,Cd,Dd,Od,Nc],c:[Ld,Qc]}=BC(this,[qC("rui-date-field")],[[Dt({type:String,reflect:!0,defaultValue:""}),0,"value"],[Dt({type:String,defaultValue:""}),0,"min"],[Dt({type:String,defaultValue:""}),0,"max"],[Dt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Dt({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[Dt({type:String,defaultValue:""}),0,"label"],[Dt({type:String,defaultValue:""}),0,"name"],[Dt({type:String,defaultValue:""}),0,"placeholder"],[Dt({type:String,defaultValue:""}),0,"locale"],[Dt({type:String,attribute:"date-style",defaultValue:"medium"}),0,"dateStyle"],[Dt({type:Boolean,reflect:!0,defaultValue:!0}),0,"masked"],[Dt({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[KC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Vn,0,"displayValue"],[Vn,0,"editing"],[Vn,0,"open"],[$C({ref:"popover"}),0,"popoverTarget"],[Md(["value","min","max","label","placeholder","disabled","readOnly","locale","dateStyle","masked","visibleMonths"]),2,"onPropsUpdated"],[Md(["open"]),2,"onOpenUpdated"],[Yt({selector:"[data-date-field-input]",type:"focusin"}),2,"onInputFocus"],[Yt({selector:"[data-date-field-input]",type:"input"}),2,"onInput"],[Yt({selector:"[data-date-field-input]",type:"change"}),2,"onInputChange"],[Yt({selector:"[data-date-field-input]",type:"keydown"}),2,"onInputKeydown"],[Yt({selector:"[data-date-field-input], [data-date-field-trigger], [data-date-field-popover]",type:"focusout"}),2,"onRootFocusOut"],[Yt({ref:"trigger",type:"pointerdown"}),2,"onTriggerPointerDown"],[Yt({ref:"trigger",type:"click"}),2,"onTriggerClick"],[Yt({selector:"[data-date-field-popover]",type:"mousedown"}),2,"onPopoverMouseDown"],[Yt({selector:"[data-date-field-calendar]",type:"rui-change"}),2,"onCalendarChange"],[Yt({selector:"[data-date-field-input], [data-date-field-trigger], [data-date-field-calendar]",type:"keydown"}),2,"onRootKeydown"]],0,void 0,Vd))}constructor(...t){super(...t),Od(this)}value=(Nc(this),Jc(this));min=(Zc(this),td(this));max=(ed(this),id(this));disabled=(rd(this),nd(this));readOnly=(od(this),ad(this));label=(sd(this),ld(this));name=(ud(this),cd(this));placeholder=(dd(this),hd(this));locale=(pd(this),fd(this));dateStyle=(md(this),gd(this));masked=(bd(this),vd(this));visibleMonths=(yd(this),_d(this));changeEvent=(xd(this),wd(this));displayValue=(Sd(this),Td(this,""));editing=(Ed(this),Rd(this,!1));open=(Ad(this),Id(this,!1));uid=(Cd(this),Math.random().toString(36).slice(2,9));popoverController=null;suppressPopoverDismiss=!1;popoverTarget=Dd(this);get isoValue(){return this.value??""}get resolvedLocale(){return Wt(this.locale)}get inputId(){return`rui-date-field-input-${this.uid}`}get resolvedPlaceholder(){return this.placeholder||fn(this.resolvedLocale)}getInput(){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 t=this.getInput();Ht(this,t,{controlId:this.inputId,label:this.label,labelId:`rui-date-field-label-${this.uid}`})}syncInput(){let t=this.getInput();if(!t)return;t.id||(t.id=this.inputId),t.name=this.name,t.disabled=this.disabled,t.readOnly=this.readOnly,t.inputMode=this.masked?"numeric":"text";let i=this.resolvedPlaceholder;i&&(t.placeholder=i)}syncToggle(){let t=this.getToggle();t&&(t.disabled=this.disabled||this.readOnly,t.setAttribute("aria-expanded",String(this.open)))}syncCalendar(){let t=this.getCalendar();t&&(t.setAttribute("selection-mode","single"),t.setAttribute("visible-months",String(this.visibleMonths)),t.setAttribute("value",this.isoValue),t.setAttribute("min",this.min),t.setAttribute("max",this.max),t.setAttribute("locale",this.locale),t.toggleAttribute("disabled",this.disabled))}formatForDisplay(t){if(!t)return"";let i=Pt(t);return i?di(i,this.resolvedLocale,this.dateStyle):""}formatForEditing(t){if(!t)return"";if(!this.masked)return this.formatForDisplay(t);let i=Pt(t);if(!i)return"";let r=ze(this.resolvedLocale),l=GC(i,this.resolvedLocale);return or(l,r)}syncDisplayValue(){if(this.editing)return;this.displayValue=this.formatForDisplay(this.isoValue);let t=this.getInput();t&&(t.value=this.displayValue)}isIsoAllowed(t){return!(this.min&&t<this.min||this.max&&t>this.max)}commitValue(t){if(t&&!this.isIsoAllowed(t)){this.syncDisplayValue();return}if(t===this.isoValue){this.syncDisplayValue();return}this.value=t,this.changeEvent.emit({value:t}),this.syncDisplayValue()}parseAndCommit(t){let i=(t??"").trim();if(!i){this.commitValue("");return}let r=mi(i,this.resolvedLocale);if(!r){this.syncDisplayValue();return}this.commitValue(Bt(r))}handleMaskedInput(t){let i=ze(this.resolvedLocale),r=qe(t),l=or(r,i);return r.length>=fi(i)&&this.parseAndCommit(l),l}initialize(){this.syncLabel(),this.syncInput(),this.syncDisplayValue(),this.syncToggle(),this.syncCalendar(),this.setOpen(!1)}setOpen(t){this.open=t,queueMicrotask(()=>{this.syncCalendar(),this.syncPopoverPosition(),t&&this.focusCalendarDay()})}focusCalendarDay(){requestAnimationFrame(()=>{if(!this.open)return;let t=this.getCalendar();((this.isoValue?t?.querySelector(`[data-calendar-day][data-iso="${this.isoValue}"]:not(:disabled)`):null)??t?.querySelector('[data-calendar-day][tabindex="0"]:not(:disabled), [data-calendar-day]:not(:disabled)'))?.focus()})}ensurePopoverController(){return this.popoverController||(this.popoverController=new ut({getAnchor:()=>this.getToggle()?.parentElement??this,getFloating:()=>this.popoverTarget,getOpen:()=>this.open,getPlacement:()=>"bottom-start",gap:4,portal:!1})),this.popoverController}syncPopoverPosition(){let t=this.popoverTarget;if(!t)return;t.hidden=!this.open;let i=this.ensurePopoverController();i.updateConfig({getOpen:()=>this.open}),i.sync()}onConnected(){this.initialize()}disconnectedCallback(){this.popoverController?.destroy(),this.popoverController=null,super.disconnectedCallback()}onPropsUpdated(){this.syncLabel(),this.syncInput(),this.syncDisplayValue(),this.syncToggle(),this.syncCalendar()}onOpenUpdated(){this.syncToggle(),this.syncPopoverPosition()}onInputFocus(){this.editing=!0;let t=this.getInput();t&&(t.value=this.isoValue?this.formatForEditing(this.isoValue):"",this.displayValue=t.value)}onInput(t){let i=t.target;if(this.masked){let r=this.handleMaskedInput(i.value);i.value=r,this.displayValue=r;return}this.displayValue=i.value}onInputChange(){let t=this.getInput();t&&this.parseAndCommit(t.value)}onInputKeydown(t){if(t.key==="Escape"){if(this.open){t.preventDefault(),this.setOpen(!1);return}this.editing=!1,this.syncDisplayValue()}}onRootFocusOut(t){let i=t.target,r=t.relatedTarget;if(i.matches("[data-date-field-input]")&&i.localName==="input"){let l=i;queueMicrotask(()=>{this.editing&&(this.editing=!1,this.parseAndCommit(l.value))})}queueMicrotask(()=>{if(this.suppressPopoverDismiss){this.suppressPopoverDismiss=!1;return}if(!this.open)return;let l=r instanceof Node?r:document.activeElement;zt(this,this.popoverTarget,l)&&this.setOpen(!1)})}onTriggerPointerDown(){this.suppressPopoverDismiss=!0}onTriggerClick(){this.disabled||this.readOnly||this.setOpen(!this.open)}onPopoverMouseDown(t){t.preventDefault()}onCalendarChange(t){let i=t.target;if(!(i instanceof HTMLElement)||!i.matches("[data-date-field-calendar]"))return;let r=t.detail;r?.value&&(this.commitValue(r.value),this.setOpen(!1))}onRootKeydown(t){t.key==="Escape"&&this.open&&(t.preventDefault(),this.setOpen(!1))}static{Qc()}};function GC(e,t){let i=nr(t),r={month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0"),year:String(e.getFullYear())};return i.map(l=>r[l]).join("")}import{Fragment as WC,jsx as Ot,jsxs as Pd}from"@ecopages/jsx/jsx-runtime";function Bd({children:e,class:t,...i}){return Ot("div",{...i,class:L("rui-date-field",t),children:Ot("div",{class:"rui-date-field__group",children:e})})}function Fd({class:e,...t}){return Ot("input",{...t,type:"text","data-date-field-input":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:L("rui-date-field__input",e),autocomplete:"off"})}function Ud({children:e,class:t,aria:i,...r}){return Ot("button",{...r,aria:nt(i,"Open calendar"),type:"button","data-ref":"trigger","data-date-field-trigger":!0,class:L("rui-control-toggle",t),"aria-haspopup":"dialog",children:e??Ot(li,{})})}function zd({children:e,class:t,...i}){return Ot("div",{...i,"data-ref":"popover","data-date-field-popover":!0,class:L("rui-date-field__popover rui-popover rui-floating",t),hidden:!0,role:"dialog",children:e})}function qd(e){return Ot(gi,{...e,"data-date-field-calendar":!0})}function HC({children:e,...t}){return Ot("rui-date-field",{...t,children:e??Pd(WC,{children:[Pd(Bd,{children:[Ot(Fd,{}),Ot(Ud,{})]}),Ot(zd,{children:Ot(qd,{})})]})})}import{RadiantElement as Dh,customElement as JC,event as ZC,onEvent as Xt,onUpdated as Oh,prop as Tt,query as tD,state as dr}from"@ecopages/radiant";var Kd,$d,Gd,Wd,Hd,Yd,Xd,Nd,Qd,Jd,Zd,th,eh,ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,bh,vh,yh,_h,xh,wh,Sh,Th,Eh,Rh,Ah,Ih;function YC(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Ch(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Ch(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:XC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return QC(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function XC(e){var t=NC(e,"string");return typeof t=="symbol"?t:t+""}function NC(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ch(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function QC(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Vh,kh=class extends Dh{static{({e:[Gd,Wd,Hd,Yd,Xd,Nd,Qd,Jd,Zd,th,eh,ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,bh,vh,yh,_h,xh,wh,Sh,Th,Eh,Rh,Ah,Ih,Kd],c:[Vh,$d]}=YC(this,[JC("rui-date-range-picker")],[[Tt({type:String,reflect:!0,defaultValue:""}),0,"value"],[Tt({type:String,defaultValue:""}),0,"min"],[Tt({type:String,defaultValue:""}),0,"max"],[Tt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Tt({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[Tt({type:String,defaultValue:""}),0,"locale"],[Tt({type:String,attribute:"placeholder-start",defaultValue:""}),0,"placeholderStart"],[Tt({type:String,attribute:"placeholder-end",defaultValue:""}),0,"placeholderEnd"],[Tt({type:String,attribute:"start-name",defaultValue:""}),0,"startName"],[Tt({type:String,attribute:"end-name",defaultValue:""}),0,"endName"],[Tt({type:String,defaultValue:""}),0,"name"],[Tt({type:String,attribute:"date-style",defaultValue:"medium"}),0,"dateStyle"],[Tt({type:Number,attribute:"visible-months",defaultValue:2}),0,"visibleMonths"],[ZC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[dr,0,"open"],[dr,0,"startDisplay"],[dr,0,"endDisplay"],[dr,0,"editing"],[tD({ref:"popover"}),0,"popoverTarget"],[Oh(["value","min","max","disabled","readOnly","locale","dateStyle","startName","endName","visibleMonths"]),2,"onPropsUpdated"],[Oh(["open"]),2,"onOpenUpdated"],[Xt({ref:"trigger",type:"pointerdown"}),2,"onTriggerPointerDown"],[Xt({ref:"trigger",type:"click"}),2,"onTriggerClick"],[Xt({selector:"[data-range-start]",type:"focus"}),2,"onStartFocus"],[Xt({selector:"[data-range-end]",type:"focus"}),2,"onEndFocus"],[Xt({selector:"[data-range-start], [data-range-end]",type:"blur"}),2,"onInputBlur"],[Xt({selector:"[data-range-start], [data-range-end]",type:"input"}),2,"onInput"],[Xt({selector:"[data-range-popover]",type:"mousedown"}),2,"onPopoverMouseDown"],[Xt({selector:"[data-range-calendar]",type:"rui-change"}),2,"onCalendarChange"],[Xt({selector:"[data-range-start], [data-range-end], [data-range-trigger], [data-range-calendar]",type:"keydown"}),2,"onRootKeydown"],[Xt({selector:"[data-range-start], [data-range-end], [data-range-trigger], [data-range-popover]",type:"focusout"}),2,"onRootFocusOut"]],0,void 0,Dh))}constructor(...t){super(...t),Ih(this)}value=(Kd(this),Gd(this));min=(Wd(this),Hd(this));max=(Yd(this),Xd(this));disabled=(Nd(this),Qd(this));readOnly=(Jd(this),Zd(this));locale=(th(this),eh(this));placeholderStart=(ih(this),rh(this));placeholderEnd=(nh(this),oh(this));startName=(ah(this),sh(this));endName=(lh(this),uh(this));name=(ch(this),dh(this));dateStyle=(hh(this),ph(this));visibleMonths=(fh(this),mh(this));changeEvent=(gh(this),bh(this));open=(vh(this),yh(this,!1));startDisplay=(_h(this),xh(this,""));endDisplay=(wh(this),Sh(this,""));editing=(Th(this),Eh(this,null));popoverController=(Rh(this),null);suppressPopoverDismiss=!1;popoverTarget=Ah(this);get resolvedLocale(){return Wt(this.locale)}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]")}formatIso(t){if(!t)return"";let i=Pt(t);return i?di(i,this.resolvedLocale,this.dateStyle):""}syncDisplayValues(){if(this.editing==="start"||this.editing==="end")return;let t=At(this.isoValue);this.startDisplay=this.formatIso(t?.start??""),this.endDisplay=this.formatIso(t?.end??"");let i=this.getStartInput(),r=this.getEndInput();i&&(i.value=this.startDisplay),r&&(r.value=this.endDisplay)}isIsoAllowed(t){return!(this.min&&t<this.min||this.max&&t>this.max)}commitRange(t,i){if(t&&!this.isIsoAllowed(t)){this.syncDisplayValues();return}if(i&&!this.isIsoAllowed(i)){this.syncDisplayValues();return}let r=t&&i?ci({start:t,end:i}):"";if(r===this.isoValue){this.syncDisplayValues();return}this.value=r,this.changeEvent.emit({value:r,start:t,end:i}),this.syncDisplayValues()}parseField(t){let i=(t??"").trim();if(!i)return"";let r=mi(i,this.resolvedLocale);return r?Bt(r):""}commitFromInputs(){let t=this.parseField(this.getStartInput()?.value??""),i=this.parseField(this.getEndInput()?.value??"");if(!t&&!i){this.commitRange("","");return}if(t&&i){this.commitRange(t,i);return}let r=At(this.isoValue);this.commitRange(t||r?.start||"",i||r?.end||"")}setOpen(t){this.open=t,queueMicrotask(()=>{this.syncCalendar(),this.syncPopoverPosition(),t&&this.focusCalendarDay()})}focusCalendarDay(){requestAnimationFrame(()=>{if(!this.open)return;let t=this.getCalendar(),i=At(this.isoValue)?.start;((i?t?.querySelector(`[data-calendar-day][data-iso="${i}"]:not(:disabled)`):null)??t?.querySelector('[data-calendar-day][tabindex="0"]:not(:disabled), [data-calendar-day]:not(:disabled)'))?.focus()})}ensurePopoverController(){return this.popoverController||(this.popoverController=new ut({getAnchor:()=>this.getToggle()?.parentElement??this,getFloating:()=>this.popoverTarget,getOpen:()=>this.open,getPlacement:()=>"bottom-start",gap:4,portal:!1})),this.popoverController}syncPopoverPosition(){let t=this.popoverTarget;if(!t)return;t.hidden=!this.open;let i=this.ensurePopoverController();i.updateConfig({getOpen:()=>this.open}),i.sync()}syncToggle(){let t=this.getToggle();t&&(t.disabled=this.disabled||this.readOnly,t.setAttribute("aria-expanded",String(this.open)))}syncCalendar(){let t=this.getCalendar();t&&(t.setAttribute("selection-mode","range"),t.setAttribute("visible-months",String(this.visibleMonths)),t.setAttribute("value",this.isoValue),t.setAttribute("min",this.min),t.setAttribute("max",this.max),t.setAttribute("locale",this.locale),t.toggleAttribute("disabled",this.disabled))}wireInputNames(){let t=this.getStartInput(),i=this.getEndInput();t&&(t.name=this.startName,t.disabled=this.disabled,t.readOnly=this.readOnly,t.placeholder=this.placeholderStart||"Start date"),i&&(i.name=this.endName,i.disabled=this.disabled,i.readOnly=this.readOnly,i.placeholder=this.placeholderEnd||"End date")}initialize(){this.wireInputNames(),this.syncDisplayValues(),this.syncToggle(),this.syncCalendar(),this.setOpen(!1)}onConnected(){this.initialize()}disconnectedCallback(){this.popoverController?.destroy(),this.popoverController=null,super.disconnectedCallback()}onPropsUpdated(){this.wireInputNames(),this.syncDisplayValues(),this.syncToggle(),this.syncCalendar()}onOpenUpdated(){this.syncToggle(),this.syncPopoverPosition()}onTriggerPointerDown(){this.suppressPopoverDismiss=!0}onTriggerClick(){this.disabled||this.readOnly||this.setOpen(!this.open)}onStartFocus(){this.editing="start";let t=At(this.isoValue),i=this.getStartInput();i&&(i.value=t?.start?this.formatIso(t.start):"")}onEndFocus(){this.editing="end";let t=At(this.isoValue),i=this.getEndInput();i&&(i.value=t?.end?this.formatIso(t.end):"")}onInputBlur(){this.editing=null,this.commitFromInputs()}onInput(t){let i=t.target;if(i.matches("[data-range-start]")){this.startDisplay=i.value;return}this.endDisplay=i.value}onPopoverMouseDown(t){t.preventDefault()}onCalendarChange(t){let i=t.target;if(!(i instanceof HTMLElement)||!i.matches("[data-range-calendar]"))return;let r=t.detail;!r?.start||!r.end||(this.commitRange(r.start,r.end),this.setOpen(!1))}onRootKeydown(t){t.key==="Escape"&&this.open&&(t.preventDefault(),this.setOpen(!1))}onRootFocusOut(t){let i=t.relatedTarget;queueMicrotask(()=>{if(this.suppressPopoverDismiss){this.suppressPopoverDismiss=!1;return}if(!this.open)return;let r=i instanceof Node?i:document.activeElement;zt(this,this.popoverTarget,r)&&this.setOpen(!1)})}static{$d()}};import{Fragment as eD,jsx as pt,jsxs as Mn}from"@ecopages/jsx/jsx-runtime";function Mh({children:e,class:t,...i}){return pt("div",{...i,class:L("rui-date-range-picker",t),children:pt("div",{class:"rui-date-range-picker__group",children:e})})}function jh({children:e,class:t,...i}){return pt("div",{...i,class:L("rui-date-range-picker__values",t),children:e})}function Lh({class:e,...t}){return pt("input",{...t,type:"text","data-range-start":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:L("rui-date-range-picker__input",e),autocomplete:"off"})}function Ph({class:e,...t}){return pt("input",{...t,type:"text","data-range-end":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:L("rui-date-range-picker__input",e),autocomplete:"off"})}function Bh({children:e="\u2013",class:t,...i}){return pt("span",{...i,class:L("rui-date-range-picker__separator",t),"aria-hidden":"true",children:e})}function Fh({children:e,class:t,aria:i,...r}){return pt("button",{...r,aria:nt(i,"Open calendar"),type:"button","data-ref":"trigger","data-range-trigger":!0,class:L("rui-control-toggle",t),"aria-haspopup":"dialog",children:e??pt(li,{})})}function Uh({children:e,class:t,...i}){return pt("div",{...i,"data-ref":"popover","data-range-popover":!0,class:L("rui-date-range-picker__popover rui-popover rui-floating",t),hidden:!0,role:"dialog",children:e})}function zh(e){return pt(gi,{...e,"data-range-calendar":!0})}function iD({children:e,startLabel:t="Start date",endLabel:i="End date",...r}){return pt("rui-date-range-picker",{...r,children:e??Mn(eD,{children:[Mn(Mh,{children:[Mn(jh,{children:[pt(Lh,{"aria-label":t}),pt(Bh,{}),pt(Ph,{"aria-label":i})]}),pt(Fh,{})]}),pt(Uh,{children:pt(zh,{})})]})})}import{RadiantElement as lp,bound as lD,customElement as uD,event as cD,onEvent as Ln,onUpdated as dD,prop as Pn,query as pr}from"@ecopages/radiant";var qh="a[href], button, input, select, textarea, [tabindex]";function rD(e){return!e.hasAttribute("disabled")&&e.getAttribute("tabindex")!=="-1"}function jn(e){return Array.from(e.querySelectorAll(qh)).filter(rD)}function hr(e){return Array.from(e.querySelectorAll(qh)).filter(t=>!t.hasAttribute("disabled"))}function Ye(e){return jn(e)[0]}var Kh,$h,Gh,Wh,Hh,Yh,Xh,Nh,Qh,Jh,Zh,tp,ep,ip,rp,np,op,ap;function nD(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:sp(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||sp(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:oD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return sD(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function oD(e){var t=aD(e,"string");return typeof t=="symbol"?t:t+""}function aD(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sp(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function sD(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var cp,up=class extends lp{static{({e:[Gh,Wh,Hh,Yh,Xh,Nh,Qh,Jh,Zh,tp,ep,ip,rp,np,op,ap,Kh],c:[cp,$h]}=nD(this,[uD("rui-dialog")],[[Pn({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Pn({type:Boolean,reflect:!0,defaultValue:!1}),0,"alert"],[Pn({type:String,defaultValue:""}),0,"label"],[pr({ref:"root"}),0,"rootTarget"],[pr({ref:"dialog"}),0,"dialogTarget"],[pr({selector:"[data-dialog-title]"}),0,"titleTarget"],[pr({selector:"[data-dialog-body]"}),0,"descriptionTarget"],[cD({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[lD,dD(["open","label"])],2,"syncOpenState"],[Ln({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[Ln({ref:"backdrop",type:"click"}),2,"onBackdropClick"],[Ln({selector:"[data-dialog-close]",type:"click"}),2,"onCloseClick"]],0,void 0,lp))}open=(Kh(this),Gh(this));alert=(Wh(this),Hh(this));label=(Yh(this),Xh(this));rootTarget=(Nh(this),Qh(this));dialogTarget=(Jh(this),Zh(this));titleTarget=(tp(this),ep(this));descriptionTarget=(ip(this),rp(this));closeEvent=(np(this),op(this));previouslyFocused=(ap(this),null);titleId=`rui-dialog-title-${Math.random().toString(36).slice(2,9)}`;descriptionId=`rui-dialog-desc-${Math.random().toString(36).slice(2,9)}`;onConnected(){this.syncOpenState()}syncOpenState(){this.rootTarget?.toggleAttribute("hidden",!this.open),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?jn(this.dialogTarget):[]}dismiss(t){this.open&&(this.open=!1,this.closeEvent.emit({reason:t}))}onDocumentKeydown(t){if(!this.open)return;if(t.key==="Escape"){t.preventDefault(),this.dismiss("escape");return}if(t.key!=="Tab")return;let i=this.getFocusable();if(!i.length){t.preventDefault(),this.dialogTarget.focus();return}let r=i[0],l=i[i.length-1],h=document.activeElement;t.shiftKey&&h===r?(t.preventDefault(),l.focus()):!t.shiftKey&&h===l&&(t.preventDefault(),r.focus())}onBackdropClick(){this.dismiss("backdrop")}onCloseClick(){this.dismiss("dismiss")}static{$h()}};import{jsx as yt,jsxs as hp}from"@ecopages/jsx/jsx-runtime";function pp({children:e,class:t,...i}){return yt("div",{...i,"data-dialog-title":!0,"data-ref":"title",class:L("rui-dialog__title",t),children:e})}function fp({children:e,class:t,...i}){return yt("div",{...i,"data-dialog-body":!0,"data-ref":"description",class:L("rui-dialog__body",t),children:e})}function mp({children:e,class:t,...i}){return yt("div",{...i,class:L("rui-dialog__actions",t),children:e})}function gp({children:e,class:t,aria:i,...r}){return yt("button",{...r,aria:nt(i,"Close"),type:"button","data-dialog-close":!0,"data-ref":"close",class:L("rui-dialog__close",t),children:e??yt(Rt,{})})}function dp({alert:e,children:t,open:i}){return hp("div",{"data-ref":"root",class:"rui-dialog",hidden:i?void 0:!0,children:[yt("div",{"data-ref":"backdrop",class:"rui-dialog__backdrop"}),yt("div",{"data-ref":"dialog",class:"rui-dialog__surface",tabindex:-1,role:e?"alertdialog":"dialog","aria-modal":"true",children:t})]})}function hD({title:e,actions:t,children:i,open:r,alert:l,...h}){return e!=null||t!=null?yt("rui-dialog",{...h,open:r,alert:l,children:hp(dp,{open:r,alert:l,children:[yt(gp,{}),e!=null?yt(pp,{children:e}):null,i!=null?yt(fp,{children:i}):null,t!=null?yt(mp,{children:t}):null]})}):yt("rui-dialog",{...h,open:r,alert:l,children:yt(dp,{open:r,alert:l,children:i})})}var oe="__rui-dialog-host",fr="rui-dialog-open",mr="rui-dialog-close",gr="rui-dialog-toggle",Bn="rui-dialog-action";function bp(e){return"id"in e&&e.id!=null&&e.id!==""}var Ti=!1,br=null,Ei=null,bt=null;function Un(e){let t=e.trim();if(!t)return null;let i=document.getElementById(t);return i?.localName==="rui-dialog"?i:null}function pD(){let e=document.createElement("button");return e.type="button",e.setAttribute("data-dialog-close",""),e.setAttribute("data-ref","close"),e.className="rui-dialog__close",e.setAttribute("aria-label","Close"),e.append(Ji()),e}function fD(e){let t=document.createElement("div");return t.setAttribute("data-dialog-title",""),t.setAttribute("data-ref","title"),t.className="rui-dialog__title",t.textContent=e,t}function mD(e){let t=document.createElement("div");t.setAttribute("data-dialog-body",""),t.setAttribute("data-ref","description"),t.className="rui-dialog__body";let i=document.createElement("p");return i.textContent=e,t.append(i),t}function gD(e){let t=document.createElement("div");t.className="rui-dialog__actions";for(let i of e){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,t.append(r)}return t}function bD(e){let t=document.createElement("div");t.dataset.ref="root",t.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",e?"alertdialog":"dialog"),r.setAttribute("aria-modal","true"),t.append(i,r),t}function Ri(){Ei?.remove(),Ei=null}function vD(e){Ri();let t=document.createElement("rui-dialog");t.id=oe,t.alert=!!e.alert,t.label=e.label??"",t.open=!0;let i=bD(t.alert),r=i.querySelector('[data-ref="dialog"]');if(!r)throw new Error("Failed to create the dialog surface.");return r.append(pD()),e.title&&r.append(fD(e.title)),e.body&&r.append(mD(e.body)),e.actions?.length&&r.append(gD(e.actions)),t.append(i),(br??document.body).appendChild(t),Ei=t,t}function vp(e){if(!(!bt||bt===e))if(bt===oe)Ri();else{let t=Un(bt);t&&(t.open=!1)}}function Xe(e){pe();let t=Un(e);t&&(vp(e),t.open=!0,bt=e)}function yD(e){pe(),vp(oe),vD(e),bt=oe}function vr(e){if(typeof e=="string"){Xe(e);return}if(bp(e)){Xe(e.id);return}yD(e)}function Ne(e){pe();let t=e??bt;if(t){if(t===oe)Ri();else{let i=Un(t);i&&(i.open=!1)}bt===t&&(bt=null)}}function zn(e){if(pe(),bt===e){Ne(e);return}Xe(e)}function yp(e){let t=e.detail;if(typeof t=="string"){vr(t);return}t&&typeof t=="object"&&vr(t)}function _p(e){let t=e.detail;Ne(t?.id)}function xp(e){let t=e.detail;t?.id&&zn(t.id)}function wp(e){let t=e.target;if(!t?.closest)return;let i=t.closest("[data-dialog-action]");if(i&&Ei?.contains(i)){e.preventDefault();let d={value:i.getAttribute("data-dialog-action")||void 0||void 0};Ei.dispatchEvent(new CustomEvent(Bn,{detail:d,bubbles:!0,composed:!0})),i.getAttribute("data-dialog-action-close")!=="false"&&Ne(oe);return}let r=t.closest("[data-dialog-open]");if(r){let h=r.getAttribute("data-dialog-open")?.trim();h&&(e.preventDefault(),Xe(h));return}let l=t.closest("[data-dialog-close]");if(l){if(l.closest("rui-dialog")?.hasAttribute("open"))return;e.preventDefault(),Ne()}}function Sp(e){let t=e.target?.closest?.("rui-dialog");if(!t)return;let i=t.id||null;i&&bt===i&&(i===oe&&Ri(),bt=null)}function Tp(e={}){return Ti?(e.mount&&(br=e.mount),Fn):(Ti=!0,br=e.mount??document.body,document.addEventListener(fr,yp),document.addEventListener(mr,_p),document.addEventListener(gr,xp),document.addEventListener("click",wp),document.addEventListener("rui-close",Sp),Fn)}function pe(){Ti||Tp()}function Fn(){Ti&&(document.removeEventListener(fr,yp),document.removeEventListener(mr,_p),document.removeEventListener(gr,xp),document.removeEventListener("click",wp),document.removeEventListener("rui-close",Sp),Ri(),br=null,bt=null,Ti=!1)}function _D(){return bt}function xD(e){pe(),vr(e)}function wD(e){pe(),Ne(e)}function SD(e){pe(),zn(e)}function TD(e){pe();let t=e?.trim()||void 0;return{open:r=>{if(t){Xe(t);return}if(r!=null){if(typeof r=="string"){Xe(r);return}vr(r)}},close:r=>{Ne(r??t)},toggle:r=>{let l=r??t;l&&zn(l)},get openId(){return bt}}}import{RadiantElement as Mp,bound as CD,customElement as DD,onEvent as OD,onUpdated as kD,prop as qn}from"@ecopages/radiant";var Ep,Rp,Ap,Ip,Cp,Dp,Op,kp;function ED(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Vp(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Vp(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.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)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function RD(e){var t=AD(e,"string");return typeof t=="symbol"?t:t+""}function AD(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vp(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function ID(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var yr,jp=class extends Mp{static{({e:[Ap,Ip,Cp,Dp,Op,kp,Ep],c:[yr,Rp]}=ED(this,[DD("rui-disclosure")],[[qn({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[qn({type:String,reflect:!0,defaultValue:""}),0,"value"],[qn({type:Boolean,reflect:!0,defaultValue:!1}),0,"animated"],[OD({selector:"[data-disclosure-trigger]",type:"click"}),2,"onTriggerClick"],[[CD,kD(["open","animated"])],2,"syncExpanded"]],0,void 0,Mp))}open=(Ep(this),Ap(this));value=(Ip(this),Cp(this));animated=(Dp(this),Op(this));panelId=(kp(this),`rui-disclosure-${Math.random().toString(36).slice(2,9)}`);onConnected(){this.syncAnimated(),this.syncExpanded()}syncAnimated(){this.toggleAttribute("data-animated",this.animated)}onTriggerClick(t){t.preventDefault(),this.toggle()}toggle(){let t=!this.open;this.open=t,this.dispatchEvent(new CustomEvent("rui-disclosure-toggle",{bubbles:!0,composed:!0,detail:{value:this.value,open:t}}))}syncExpanded(){this.syncAnimated();let t=this.querySelector("[data-disclosure-trigger]"),i=this.querySelector("[data-disclosure-panel]");if(!(!t||!i)){if(t.setAttribute("aria-expanded",String(this.open)),t.setAttribute("aria-controls",this.panelId),i.id=this.panelId,i.dataset.state=this.open?"open":"closed",this.animated){i.toggleAttribute("hidden",!1),i.setAttribute("aria-hidden",String(!this.open));return}i.toggleAttribute("hidden",!this.open),i.removeAttribute("aria-hidden")}}static{Rp()}};import{RadiantElement as Kp,customElement as PD,onEvent as $p,onUpdated as BD,prop as Gp}from"@ecopages/radiant";var Lp,Pp,Bp,Fp,Up,zp;function VD(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:qp(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||qp(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:MD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return LD(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function MD(e){var t=jD(e,"string");return typeof t=="symbol"?t:t+""}function jD(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qp(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function LD(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Hp,Wp=class extends Kp{static{({e:[Bp,Fp,Up,zp,Lp],c:[Hp,Pp]}=VD(this,[PD("rui-disclosure-group")],[[Gp({type:Boolean,reflect:!0,defaultValue:!1}),0,"multiple"],[Gp({type:Boolean,reflect:!0,attribute:"animated",defaultValue:!1}),0,"animated"],[BD("animated"),2,"onAnimatedUpdated"],[$p({selector:"rui-disclosure",type:"rui-disclosure-toggle"}),2,"onDisclosureToggle"],[$p({selector:"[data-disclosure-trigger]",type:"keydown"}),2,"onTriggerKeydown"]],0,void 0,Kp))}constructor(...t){super(...t),zp(this)}multiple=(Lp(this),Bp(this));animated=(Fp(this),Up(this));onConnected(){this.syncChildrenAnimated(),this.syncTriggers()}getTriggers(){return Array.from(this.querySelectorAll("[data-disclosure-trigger]"))}getDisclosureForTrigger(t){return t.closest("rui-disclosure")}syncTriggers(){let t=this.getTriggers();if(!t.length)return;let i=Math.max(0,t.findIndex(r=>r.tabIndex===0||r===document.activeElement));lt(t,i)}syncChildrenAnimated(){for(let t of this.querySelectorAll("rui-disclosure"))t.animated=this.animated}onAnimatedUpdated(){this.syncChildrenAnimated()}onDisclosureToggle(t){if(this.multiple||!t.detail?.open)return;let r=t.target;if(r instanceof yr)for(let l of this.querySelectorAll("rui-disclosure"))l!==r&&(l.open=!1)}onTriggerKeydown(t){let i=this.getTriggers(),r=t.target.closest("[data-disclosure-trigger]");if(!r)return;if(t.key==="ArrowLeft"||t.key==="ArrowRight"){let h=this.getDisclosureForTrigger(r);if(!h)return;let d=t.key==="ArrowRight";if(h.open===d){t.preventDefault();return}if(t.preventDefault(),h.open=d,d&&!this.multiple)for(let a of this.querySelectorAll("rui-disclosure"))a!==h&&(a.open=!1);return}ct({items:i,current:r,key:t.key,orientation:"vertical",wrap:!0}).handled&&t.preventDefault()}static{Pp()}};import{jsx as Et,jsxs as Xp}from"@ecopages/jsx/jsx-runtime";function Np({variant:e="chevron",class:t,...i}){return Et("span",{...i,class:L("rui-disclosure__icon",`rui-disclosure__icon--${e}`,t),"data-disclosure-icon":!0,"aria-hidden":"true"})}function Qp({children:e,class:t,disabled:i,icon:r,iconPosition:l="start",...h}){let a=r!==null?r??Et(Np,{}):null;return Xp("button",{...h,type:"button","data-disclosure-trigger":!0,class:L("rui-disclosure__trigger",l==="end"&&"rui-disclosure__trigger--icon-end",t),disabled:i,children:[l==="start"?a:null,Et("span",{class:"rui-disclosure__label",children:e}),l==="end"?a:null]})}function Jp({children:e,class:t,...i}){return Et("div",{...i,"data-disclosure-panel":!0,"data-ref":"panel",class:L("rui-disclosure__panel",t),children:Et("div",{class:"rui-disclosure__panel-inner",children:e})})}function Yp({children:e}){return Et("div",{class:"rui-disclosure","data-ref":"root",children:e})}function FD({trigger:e,children:t,...i}){return e!=null?Et("rui-disclosure",{...i,children:Xp(Yp,{children:[Et(Qp,{children:e}),t!=null?Et(Jp,{children:t}):null]})}):Et("rui-disclosure",{...i,children:Et(Yp,{children:t})})}function UD({children:e,...t}){return Et("rui-disclosure-group",{...t,children:Et("div",{class:"rui-disclosure-group","data-ref":"root",children:e})})}import{jsx as fe}from"@ecopages/jsx/jsx-runtime";function zD({children:e,label:t,class:i,aria:r,...l}){return fe("div",{...l,aria:nt(r,t),role:"feed",class:L("rui-feed",i),children:e})}function qD({children:e,posinset:t,setsize:i,labelledBy:r,describedBy:l,tabindex:h=0,class:d,"aria-posinset":a,"aria-setsize":E,"aria-labelledby":A,"aria-describedby":S,...D}){return fe("article",{...D,class:L("rui-feed__article",d),tabindex:h,"aria-posinset":Lt(a,t),"aria-setsize":Lt(E,i),"aria-labelledby":Lt(A,r),"aria-describedby":Lt(S,l),children:e})}function KD({children:e,class:t,...i}){return fe("header",{...i,class:L("rui-feed__header",t),children:e})}function $D({children:e,class:t,...i}){return fe("div",{...i,class:L("rui-feed__content",t),children:e})}function GD({children:e,class:t,...i}){return fe("div",{...i,class:L("rui-feed__actions",t),children:e})}function WD({children:e,class:t,...i}){return fe("div",{...i,class:L("rui-feed__byline",t),children:e})}function HD({children:e,class:t,...i}){return fe("div",{...i,class:L("rui-feed__byline-body",t),children:e})}function YD({children:e,class:t,...i}){return fe("div",{...i,class:L("rui-feed__meta",t),children:e})}import{jsx as Lf}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Vf,customElement as u1,onEvent as Rr,onUpdated as Qn,prop as Oe,registerSsrPreparationCallback as c1}from"@ecopages/radiant";import{consumeContext as d1,onContextUpdate as h1,provideContext as p1}from"@ecopages/radiant/context";var $t="data-rui-control",Kn="data-rui-field-managed",Sr="data-rui-field-label",Tr="data-rui-field-description",Qe="data-rui-field-error",$n="data-default-value",Gn="data-default-values",Er='[data-ref="field"]',Ai=new Set(["rui-combobox","rui-date-field","rui-date-range-picker","rui-select","rui-tag-group","rui-checkbox","rui-checkbox-group","rui-switch","rui-radio-group","rui-slider","rui-knob","rui-number-field","rui-listbox"]),rf=`[${$t}], ${Array.from(Ai).join(", ")}`,XD={"rui-combobox":"[data-combobox-input]","rui-date-field":"[data-date-field-input]","rui-date-range-picker":"[data-range-start]","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 Je(e){return e.localName==="input"||e.localName==="textarea"}function nf(e){return e.localName==="input"}function of(e){return e.localName==="textarea"}var me={read:e=>{let t=Reflect.get(e,"value");return typeof t=="string"?t:e.getAttribute("value")??""},write:(e,t)=>{let i=t==null?"":String(t);e.setAttribute("value",i),"value"in e&&Reflect.set(e,"value",i)}},_r={read:e=>{let t=Reflect.get(e,"value");if(typeof t=="number")return t;let i=e.getAttribute("value");return i==null||i===""?"":Number(i)},write:(e,t)=>{let i=t==null?"":String(t);e.setAttribute("value",i),"value"in e&&Reflect.set(e,"value",t)}},Zp={read:e=>e.querySelector('input[type="checkbox"]')?.checked??e.hasAttribute("checked"),write:(e,t)=>{t?e.setAttribute("checked",""):e.removeAttribute("checked")}};function tf(e,t,i){let r=Reflect.get(e,t);if(typeof r=="number"&&Number.isFinite(r))return r;let l=e.getAttribute(i);return l==null||l===""?"":Number(l)}function ND(e){return Reflect.get(e,"variant")==="range"||e.getAttribute("variant")==="range"}var QD={read:e=>ND(e)?[tf(e,"rangeMin","range-min"),tf(e,"rangeMax","range-max")]:_r.read(e),write:(e,t)=>{if(Array.isArray(t)&&t.length>=2){e.setAttribute("variant","range"),"variant"in e&&Reflect.set(e,"variant","range"),e.setAttribute("range-min",String(t[0])),e.setAttribute("range-max",String(t[1])),"rangeMin"in e&&Reflect.set(e,"rangeMin",t[0]),"rangeMax"in e&&Reflect.set(e,"rangeMax",t[1]);return}_r.write(e,t)}},xr=new Map([["rui-checkbox",Zp],["rui-switch",Zp],["rui-combobox",me],["rui-date-field",me],["rui-date-range-picker",me],["rui-select",me],["rui-radio-group",me],["rui-checkbox-group",me],["rui-listbox",me],["rui-tag-group",me],["rui-slider",QD],["rui-knob",_r],["rui-number-field",_r]]);function af(e,t){let i=e,r=new Set,l=a=>{r.has(a)||(r.add(a),t(a))};if(typeof i.getSlotElements=="function")for(let a of i.getSlotElements())l(a);let h=e.querySelector(Er)??e;for(let a of Array.from(h.children))l(a);for(let a of h.querySelectorAll("*"))l(a);for(let a of Array.from(e.children))l(a);let d=e.shadowRoot;if(d)for(let a of Array.from(d.children))l(a)}function Wn(e,t){let i=null;return af(e,r=>{if(!(i||!(r instanceof HTMLElement))){if(r.matches(t)){i=r;return}i=r.querySelector(t)}}),i}function JD(e){if(e.length===0)return null;if(e.length===1)return e[0];let t=e.find(d=>Ai.has(d.localName)),i=e.find(d=>d.hasAttribute($t));if(i)return i;if(t)return t;let r=document.activeElement;if(r instanceof HTMLElement){for(let d of e)if(d===r||d.contains(r))return d}let l=e.filter(d=>d.isConnected&&d.getClientRects().length>0&&!d.closest('[hidden],[aria-hidden="true"]')),h=l.length>0?l:e.filter(d=>d.isConnected);return h[h.length-1]??e[e.length-1]}function ZD(e){let t=e.querySelector(Er);return t instanceof HTMLElement?Array.from(t.querySelectorAll(rf)).filter(i=>e.contains(i)):[]}function Ii(e){let t=JD(ZD(e));if(t)return t;let i=null;if(af(e,l=>{if(i)return;let h=ef(l);h&&(i=h)}),i)return i;let r=e.querySelector(Er)??e;return ef(r)}function ef(e){return e instanceof HTMLElement?e.matches(`[${$t}]`)||Ai.has(e.localName)?e:e.querySelector(rf):null}function Hn(e){if(nf(e)){let i=wr(e),r=i===e?void 0:xr.get(i.localName);return r?r.read(i):e.type==="checkbox"?e.checked:e.type==="number"||e.type==="range"?e.value===""?"":Number(e.value):e.value}if(of(e))return e.value;let t=wr(e);return xr.get(t.localName)?.read(t)??t.getAttribute("value")??""}function Yn(e,t){if(nf(e)){let r=wr(e),l=r===e?void 0:xr.get(r.localName);if(l){l.write(r,t);return}if(e.type==="checkbox"){e.checked=!!t;let h=e.closest("rui-checkbox, rui-switch");h&&(t?h.setAttribute("checked",""):h.removeAttribute("checked"));return}e.value=t==null?"":String(t);return}if(of(e)){e.value=t==null?"":String(t);return}let i=wr(e);xr.get(i.localName)?.write(i,t)}function wr(e){return e.hasAttribute($t)?e.closest(Array.from(Ai).join(","))??e:e}function sf(e){return Wn(e,`[${Sr}]`)}function lf(e){return Wn(e,`[${Tr}]`)}function uf(e){return Xn(e)[0]??null}function Xn(e){let t=e.querySelector(Er);if(t instanceof HTMLElement){let l=Array.from(t.querySelectorAll(`[${Qe}]`)),h=l.filter(d=>d.getClientRects().length>0);if(h.length>0)return h;if(l.length>0)return l}let i=Array.from(e.querySelectorAll(`[${Qe}]`));if(i.length>0)return i;let r=Wn(e,`[${Qe}]`);return r?[r]:[]}function cf(e,t,i){i&&(t&&Je(t)&&(t.name=i),e&&e!==t&&Ai.has(e.localName)&&e.setAttribute("name",i))}function t1(e){let t=Reflect.get(e,"checked");return typeof t=="boolean"?t:e.hasAttribute("checked")}function e1(e){if(Je(e)||e.hasAttribute($t))return e;if(e.localName==="rui-slider")return e.querySelector("[data-thumb]:not([hidden])")??e;let t=e.querySelector(`[${$t}]`);if(t)return t;if(e.localName==="rui-radio-group")return i1(e)??e;let i=XD[e.localName];return i?e.querySelector(i)??e:e}function i1(e){let t=e.querySelectorAll('input[type="radio"]');return Array.from(t).find(t1)??t[0]}function df(e){if(e.localName==="rui-slider"){let t=Array.from(e.querySelectorAll("[data-thumb]:not([hidden])"));return t.length>0?t:[e]}return[e1(e)]}import{createContext as r1}from"@ecopages/radiant/context";var Ze=r1(Symbol.for("rui-form-context"));import{createContext as n1}from"@ecopages/radiant/context";var Nn=n1(Symbol.for("rui-field-context"));var hf,pf,ff,mf,gf,bf,vf,yf,_f,xf,wf,Sf,Tf,Ef,Rf,Af,If,Cf,Df,Of;function o1(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:kf(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||kf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:a1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return l1(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function a1(e){var t=s1(e,"string");return typeof t=="symbol"?t:t+""}function s1(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kf(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function l1(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}function f1(e){if(!e)return;let{validate:t,...i}=e;return i}var jf,Mf=class extends Vf{static{({e:[ff,mf,gf,bf,vf,yf,_f,xf,wf,Sf,Tf,Ef,Rf,Af,If,Cf,Df,Of,hf],c:[jf,pf]}=o1(this,[u1("rui-field")],[[Oe({type:String,reflect:!0,defaultValue:""}),0,"name"],[Oe({type:Object}),0,"rules"],[Oe({type:Object}),0,"defaultValue"],[Oe({type:String,attribute:$n}),0,"defaultValueData"],[Oe({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Oe({type:String,defaultValue:""}),0,"error"],[Oe({type:Boolean,reflect:!0,defaultValue:!1}),0,"invalid"],[p1({context:Nn,initialValue:{name:"",controlId:"",descriptionId:"",errorId:"",error:void 0,invalid:!1,required:!1},hydrate:Object,serialize:t=>({...t,rules:f1(t.rules)})}),0,"fieldProvider"],[d1(Ze),0,"formContextProvider"],[h1({context:Ze,requestUpdate:!1}),2,"onFormContextChanged"],[Qn(["name"]),2,"onNameUpdated"],[Qn(["rules","defaultValue","defaultValueData"]),2,"onRulesUpdated"],[Qn(["disabled","error","invalid"]),2,"onPresentationUpdated"],[Rr({selector:"[data-rui-control], rui-combobox, rui-date-field, rui-date-range-picker, rui-select, rui-tag-group, rui-checkbox, rui-checkbox-group, rui-switch, rui-radio-group, rui-slider, rui-knob, rui-number-field, rui-listbox",type:"rui-change"}),2,"onControlChange"],[Rr({selector:"[data-rui-control]",type:"input",options:{capture:!0}}),2,"onControlInput"],[Rr({selector:"[data-rui-control]",type:"change",options:{capture:!0}}),2,"onControlNativeChange"],[Rr({selector:"[data-rui-control], rui-knob, rui-slider",type:"focusout"}),2,"onControlFocusOut"]],0,void 0,Vf))}name=(hf(this),ff(this));rules=(mf(this),gf(this));defaultValue=(bf(this),vf(this));defaultValueData=(yf(this),_f(this));disabled=(xf(this),wf(this));error=(Sf(this),Tf(this));invalid=(Ef(this),Rf(this));fieldProvider=(Af(this),If(this));formContextProvider=(Cf(this),Df(this));uid=(Of(this),Math.random().toString(36).slice(2,9));resolveFieldName(){return(this.name||this.getAttribute("name")||"").trim()}unregister;unregisterPresentation;registeredWithForm=!1;constructor(){super(),c1(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,super.disconnectedCallback()}get currentFormContext(){return this.formContextProvider?.getContext()}parseJsonAttr(t){if(t)try{return JSON.parse(t)}catch{return}}readFieldRules(){let t=this.rules;return t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0?t:this.fieldProvider.getContext()?.rules}readDefaultValue(){return this.defaultValue!==void 0?this.defaultValue:this.parseJsonAttr(this.defaultValueData??this.getAttribute($n))}isRequired(){return!!this.readFieldRules()?.required}resolveErrorMessage(t){if(this.error)return this.error;let i=this.resolveFieldName();return i?(t??this.currentFormContext)?.fields[i]?.error:void 0}resolveInvalid(t){if(this.invalid||this.error)return!0;let i=this.resolveFieldName();return i?(t??this.currentFormContext)?.fields[i]?.invalid??!1:!1}connectToForm(){let t=this.resolveFieldName(),i=this.currentFormContext,r=i?.actions;if(!i?.ready||!r||!t){this.syncField();return}if(!this.registeredWithForm){this.registeredWithForm=!0,this.unregisterPresentation?.(),this.unregisterPresentation=r.subscribePresentation(l=>this.syncField(l)),this.unregister=r.register({name:t,rules:this.readFieldRules(),getRules:()=>this.readFieldRules(),defaultValue:this.readDefaultValue(),getValue:()=>{let l=Ii(this);return l?Hn(l):void 0},setValue:l=>{let h=Ii(this);h&&Yn(h,l)}});return}r.updateFieldOptions(t,{rules:this.readFieldRules(),defaultValue:this.readDefaultValue()}),this.syncField()}onFormContextChanged(t){if(!this.registeredWithForm){t.ready?this.connectToForm():this.syncField(t);return}this.syncField(t)}onNameUpdated(){this.unregister?.(),this.unregister=void 0,this.unregisterPresentation?.(),this.unregisterPresentation=void 0,this.registeredWithForm=!1,this.connectToForm()}onRulesUpdated(){this.connectToForm()}onPresentationUpdated(){this.syncField()}onControlChange(){let t=this.resolveFieldName();t&&this.currentFormContext?.actions.handleFieldChange(t)}onControlInput(){let t=this.resolveFieldName();t&&this.currentFormContext?.actions.handleFieldChange(t)}onControlNativeChange(){let t=this.resolveFieldName();t&&this.currentFormContext?.actions.handleFieldChange(t)}onControlFocusOut(){let t=this.resolveFieldName();t&&this.currentFormContext?.actions.handleFieldBlur(t)}syncField(t){let i=Ii(this),r=i?df(i):[],l=r[0]??null,h=l?.id||`rui-field-control-${this.uid}`,d=`rui-field-desc-${this.uid}`,a=`rui-field-error-${this.uid}`,E=this.resolveErrorMessage(t),A=this.resolveInvalid(t),S=this.isRequired(),D=this.resolveFieldName();cf(i,l,D);let T=this.syncDescriptions(d,a,E);this.syncAriaTargets(r,h,T,A,S),this.syncLabel(r,l),this.syncErrorPresentation(E);let K={name:D,controlId:l?.id??h,descriptionId:d,errorId:a,error:E,invalid:A,required:S};this.publishFieldContext(K)}syncDescriptions(t,i,r){let l=[],h=lf(this);h&&(h.id=t,l.push(t));let d=uf(this);return d&&(d.id=i),d&&r&&l.push(i),l}syncLabel(t,i){let r=sf(this);if(!r||!i||(r.htmlFor=i.id,Je(i)))return;let l=r.id||`rui-field-label-${this.uid}`;for(let h of t)wn(r,h,{controlId:h.id,labelId:l})}syncAriaTargets(t,i,r,l,h){for(let[d,a]of t.entries())a.id||(a.id=d===0?i:`${i}-${d}`),a.setAttribute(Kn,""),a.setAttribute("aria-invalid",String(l)),a.toggleAttribute("aria-required",h),h&&a.setAttribute("aria-required","true"),r.length?a.setAttribute("aria-describedby",r.join(" ")):a.removeAttribute("aria-describedby"),this.disabled&&this.disableAriaTarget(a)}disableAriaTarget(t){t.setAttribute("aria-disabled","true"),Je(t)&&(t.disabled=!0)}syncErrorPresentation(t){for(let i of Xn(this))i.textContent=t??"",i.hidden=!t,t&&i.removeAttribute("hidden")}publishFieldContext(t){let i=this.fieldProvider.getContext();m1(i,t)||this.fieldProvider.setContext(t)}static{pf()}};function m1(e,t){return e.name===t.name&&e.controlId===t.controlId&&e.descriptionId===t.descriptionId&&e.errorId===t.errorId&&e.error===t.error&&e.invalid===t.invalid&&e.required===t.required}function g1({children:e,rules:t,defaultValue:i,defaultValueData:r,...l}){return Lf("rui-field",{...l,"prop:rules":t,"prop:defaultValue":i,data:{defaultValue:r??(i!==void 0?JSON.stringify(i):void 0)},children:Lf("div",{class:"rui-field","data-ref":"field",children:e})})}import{jsx as b1}from"@ecopages/jsx/jsx-runtime";function v1({children:e,class:t,...i}){return b1("p",{...i,[Tr]:"",class:L("rui-field__description",t),children:e})}import{jsx as y1}from"@ecopages/jsx/jsx-runtime";function _1({class:e,...t}){return y1("p",{...t,[Qe]:"",class:L("rui-field__error",e),role:"alert",hidden:!0})}import{jsx as fm}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as lm,customElement as D1,event as um,onEvent as Zn,onUpdated as cm,prop as ke}from"@ecopages/radiant";import{provideContext as O1}from"@ecopages/radiant/context";function ti(e,t){if(!(t===void 0||t===!1))return typeof t=="string"?t:typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"?t.message:e}function ae(e){return typeof e=="object"&&e!==null&&"value"in e?e.value:e}async function x1(e,t,i,r){if(i)for(let l of[w1,S1,T1,E1]){let h=await l(t,i,r);if(h)return h}}function w1(e,t){let i=e==null||e===""||e===!1||Array.isArray(e)&&e.length===0;return t.required&&i?ti("This field is required",t.required)??"This field is required":void 0}function S1(e,t){let i=typeof e=="number"?e:typeof e=="string"&&e!==""?Number(e):void 0;if(!(i===void 0||Number.isNaN(i))){if(t.min!==void 0&&i<ae(t.min))return ti(`Minimum value is ${ae(t.min)}`,t.min);if(t.max!==void 0&&i>ae(t.max))return ti(`Maximum value is ${ae(t.max)}`,t.max)}}function T1(e,t){let i=e==null?"":String(e);if(t.minLength!==void 0&&i.length<ae(t.minLength))return ti(`Minimum length is ${ae(t.minLength)}`,t.minLength);if(t.maxLength!==void 0&&i.length>ae(t.maxLength))return ti(`Maximum length is ${ae(t.maxLength)}`,t.maxLength);if(t.pattern!==void 0&&!ae(t.pattern).test(i))return ti("Invalid format",t.pattern)??"Invalid format"}async function E1(e,t,i){if(!t.validate)return;let r=typeof t.validate=="function"?[t.validate]:Object.values(t.validate);for(let l of r){let h=await l(e,i);if(h!==!0&&h!==void 0)return h===!1?"Invalid value":String(h)}}async function Pf(e,t,i){let r=i??Object.keys(t.fields),l={};for(let h of r){let d=t.fields[h]?.rules,a=await x1(h,e[h],d,e);a&&(l[h]={type:"validation",message:a})}return Object.keys(l).length>0?{values:{},errors:l}:{values:e,errors:{}}}function Jn(){return(e,t,i)=>Pf(e,t,i.names)}function Bf(e){return typeof e=="function"?e:Jn()}var Ci=class{mode;reValidateMode;resolver;fields=new Map;listeners=new Set;revision=0;defaultValues;values;errors={};touched={};dirty={};isSubmitting=!1;isSubmitted=!1;constructor(t={}){this.mode=t.mode??"onSubmit",this.reValidateMode=t.reValidateMode??"onChange",this.resolver=Bf(t.resolver),this.defaultValues={...t.defaultValues??{}},this.values={...this.defaultValues,...t.values??{}}}updateOptions(t){t.mode!==void 0&&(this.mode=t.mode),t.reValidateMode!==void 0&&(this.reValidateMode=t.reValidateMode),t.resolver!==void 0&&(this.resolver=Bf(t.resolver)),t.defaultValues!==void 0&&(this.defaultValues={...t.defaultValues})}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.revision+=1;for(let t of this.listeners)t()}getRevision(){return this.revision}getRegisteredFieldNames(){return Array.from(this.fields.keys())}register(t){let i=this.fields.get(t.name),r={...t,rules:t.rules??i?.rules,defaultValue:t.defaultValue??i?.defaultValue,getRules:t.getRules??i?.getRules};return this.fields.set(t.name,r),this.values[t.name]===void 0&&r.defaultValue!==void 0&&(this.values={...this.values,[t.name]:r.defaultValue}),r.setValue(this.values[t.name]),()=>{this.fields.get(t.name)===r&&(this.fields.delete(t.name),this.notify())}}updateFieldOptions(t,i){let r=this.fields.get(t);r&&(i.rules!==void 0&&(r.rules=i.rules),i.defaultValue!==void 0&&(r.defaultValue=i.defaultValue))}getValues(){let t={...this.values};for(let[i,r]of this.fields)t[i]=r.getValue();return t}setValue(t,i,r){this.values={...this.values,[t]:i},this.fields.get(String(t))?.setValue(i),r?.shouldDirty&&(this.dirty={...this.dirty,[t]:!0}),r?.shouldTouch&&(this.touched={...this.touched,[t]:!0}),this.notify()}markTouched(t){this.touched={...this.touched,[t]:!0},this.notify()}markDirty(t){this.dirty={...this.dirty,[t]:!0},this.notify()}clearErrors(t){if(t){let i={...this.errors};delete i[t],this.errors=i,this.notify();return}this.errors={},this.notify()}getFieldError(t){return this.errors[t]?.message}getState(){let t=this.getValues(),i=Object.keys(this.errors).length;return{values:t,errors:this.errors,touched:this.touched,dirty:this.dirty,isSubmitting:this.isSubmitting,isSubmitted:this.isSubmitted,isValid:i===0}}async validateField(t){let i=this.getValues(),l=(await this.resolver(i,{fields:this.buildResolverFields()},{names:[t]})).errors[t]?.message,h={...this.errors};return l?h[t]={type:"validation",message:l}:delete h[t],this.errors=h,this.notify(),!l}async validateAll(){let t=this.getValues(),i=await this.resolver(t,{fields:this.buildResolverFields()},{});return this.errors=i.errors,this.notify(),Object.keys(this.errors).length===0}shouldValidate(t,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[t];case"onSubmit":return!1;default:return!1}}async handleFieldChange(t){let i=this.fields.get(t);if(!i)return;let r=i.getValue();this.values={...this.values,[t]:r},this.dirty={...this.dirty,[t]:!0},this.shouldValidate(t,"change")?await this.validateField(t):this.notify()}async handleFieldBlur(t){this.markTouched(t),this.shouldValidate(t,"blur")?await this.validateField(t):this.notify()}shouldDisplayFieldError(t){if(!this.errors[t]?.message)return!1;if(this.isSubmitted)return!0;switch(this.mode){case"all":return!!(this.dirty[t]||this.touched[t]);case"onChange":return!!this.dirty[t];case"onBlur":case"onTouched":return!!this.touched[t];default:return!1}}async handleSubmit(t,i){this.isSubmitting=!0,this.isSubmitted=!0;for(let l of this.fields.keys())this.touched={...this.touched,[l]:!0};this.notify();let r=await this.validateAll();if(this.isSubmitting=!1,this.notify(),r){await t(this.getValues());return}i?.(this.errors)}reset(t){let i=t??{...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 t={};for(let[i,r]of this.fields)r.defaultValue!==void 0&&(t[i]=r.defaultValue);return t}buildResolverFields(){let t={};for(let[i,r]of this.fields){let l=r.getRules?.()??r.rules;t[i]={rules:l}}return t}};var Ff,Uf,zf,qf,Kf,$f,Gf,Wf,Hf,Yf,Xf,Nf,Qf,Jf,Zf,tm,em,im,rm,nm,om,am;function R1(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:sm(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||sm(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:A1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return C1(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function A1(e){var t=I1(e,"string");return typeof t=="symbol"?t:t+""}function I1(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sm(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function C1(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var dm=()=>{},k1={register:()=>dm,updateFieldOptions:()=>{},handleFieldChange:()=>{},handleFieldBlur:()=>{},subscribePresentation:()=>dm},pm,hm=class extends lm{static{({e:[zf,qf,Kf,$f,Gf,Wf,Hf,Yf,Xf,Nf,Qf,Jf,Zf,tm,em,im,rm,nm,om,am,Ff],c:[pm,Uf]}=R1(this,[D1("rui-form")],[[O1({context:Ze,initialValue:{ready:!1,revision:0,fields:{},errors:{},actions:k1}}),0,"formProvider"],[um({name:"rui-submit",bubbles:!0,composed:!0}),0,"submitEvent"],[um({name:"rui-invalid",bubbles:!0,composed:!0}),0,"invalidEvent"],[ke({type:Object,defaultValue:{}}),0,"defaultValues"],[ke({type:String,attribute:Gn}),0,"defaultValuesData"],[ke({type:Object}),0,"resolver"],[ke({type:String,reflect:!0,defaultValue:"onSubmit"}),0,"mode"],[ke({type:String,reflect:!0,attribute:"revalidate-mode",defaultValue:"onChange"}),0,"reValidateMode"],[ke({type:String,reflect:!0}),0,"action"],[ke({type:String,reflect:!0}),0,"method"],[cm(["defaultValues","defaultValuesData","mode","reValidateMode"]),2,"syncOptions"],[cm(["resolver"]),2,"syncResolver"],[Zn({selector:"button[type=submit]",type:"click"}),2,"onSubmitButtonClick"],[Zn({ref:"form",type:"submit"}),2,"onNativeSubmit"],[Zn({ref:"form",type:"reset"}),2,"onNativeReset"]],0,void 0,lm))}formProvider=(Ff(this),zf(this));submitEvent=(qf(this),Kf(this));invalidEvent=($f(this),Gf(this));defaultValues=(Wf(this),Hf(this));defaultValuesData=(Yf(this),Xf(this));resolver=(Nf(this),Qf(this));mode=(Jf(this),Zf(this));reValidateMode=(tm(this),em(this));action=(im(this),rm(this));method=(nm(this),om(this));onSubmit=void am(this);store;unsubscribeStore;nativeFormId=`rui-form-native-${Math.random().toString(36).slice(2,9)}`;lastPublishedRevision=-1;lastPublishedContext;presentationListeners=new Set;formActions={register:t=>{let r=this.ensureStore().register(t);return this.publishFormContext({force:!0}),()=>{r(),this.publishFormContext({force:!0})}},updateFieldOptions:(t,i)=>{this.ensureStore().updateFieldOptions(t,i)},handleFieldChange:t=>{this.ensureStore().handleFieldChange(t).then(()=>this.publishFormContext({force:!0}))},handleFieldBlur:t=>{this.ensureStore().handleFieldBlur(t).then(()=>this.publishFormContext({force:!0}))},subscribePresentation:t=>(this.presentationListeners.add(t),this.lastPublishedContext&&t(this.lastPublishedContext),()=>this.presentationListeners.delete(t))};connectedCallback(){super.connectedCallback(),this.ensureStore(),this.publishFormContext({force:!0})}onConnected(){this.wireOrphanSubmitButtons()}queryNativeForm(){return this.getRef("form")}wireOrphanSubmitButtons(){let t=this.queryNativeForm();if(t){t.id||(t.id=this.nativeFormId);for(let i of this.querySelectorAll("button[type=submit]"))t.contains(i)||i.setAttribute("form",t.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 t=this.getAttribute("mode");return t||(this.mode??"onSubmit")}resolveReValidateMode(){let t=this.getAttribute("revalidate-mode");return t||(this.reValidateMode??"onChange")}resolveDefaultValues(){if(this.defaultValues&&Object.keys(this.defaultValues).length>0)return this.defaultValues;let t=this.defaultValuesData??this.getAttribute(Gn);if(!t)return this.defaultValues??{};try{let i=JSON.parse(t);return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}catch{return this.defaultValues??{}}}ensureStore(){return this.store?this.store:(this.store=new Ci({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(t){let i={};for(let r of t.getRegisteredFieldNames()){let l=t.getFieldError(r),h=t.shouldDisplayFieldError(r);i[r]={error:h?l:void 0,invalid:!!(h&&l)}}return i}publishFormContext(t){let i=this.store;if(!i)return;let r=i.getRevision();if(!t?.force&&r===this.lastPublishedRevision)return;this.lastPublishedRevision=r;let l={ready:!0,revision:r,fields:this.buildFieldPresentations(i),errors:{...i.errors},actions:this.formActions};this.lastPublishedContext=l,this.formProvider.setContext(l);for(let h of this.presentationListeners)h(l)}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(t){t.preventDefault(),this.runFormSubmit()}onNativeSubmit(t){t.preventDefault(),this.runFormSubmit()}onNativeReset(){this.store?.reset()}static{Uf()}};function V1({children:e,defaultValues:t,defaultValuesData:i,resolver:r,reValidateMode:l,onSubmit:h,action:d,method:a,...E}){return fm("rui-form",{...E,action:d,method:a,reValidateMode:l,"attr:revalidate-mode":l,"prop:defaultValues":t,"prop:resolver":r,"prop:onSubmit":h,data:{defaultValues:i??(t!==void 0?JSON.stringify(t):void 0)},children:fm("form",{class:"rui-form","data-ref":"form",noValidate:!0,action:d,method:a,children:e})})}import{RadiantElement as _m,customElement as B1,onEvent as F1,prop as U1}from"@ecopages/radiant";var mm,gm,bm,vm;function M1(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:ym(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||ym(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:j1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return P1(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function j1(e){var t=L1(e,"string");return typeof t=="symbol"?t:t+""}function L1(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ym(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function P1(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var wm,xm=class extends _m{static{({e:[bm,vm,mm],c:[wm,gm]}=M1(this,[B1("rui-grid")],[[U1({type:String,defaultValue:""}),0,"label"],[F1({selector:'[role="gridcell"]',type:"keydown"}),2,"onKeydown"]],0,void 0,_m))}constructor(...t){super(...t),vm(this)}label=(mm(this),bm(this));onConnected(){let t=Array.from(this.querySelectorAll('[role="gridcell"]'));lt(t,0)}getRows(){return Array.from(this.querySelectorAll('[role="row"]'))}onKeydown(t){let i=this.getRows(),r=t.target.closest('[role="gridcell"]');if(!r)return;let l=r.parentElement,h=i.indexOf(l),d=Array.from(l.querySelectorAll('[role="gridcell"]')),a=d.indexOf(r),E=h,A=a;switch(t.key){case"ArrowRight":A=Math.min(d.length-1,a+1);break;case"ArrowLeft":A=Math.max(0,a-1);break;case"ArrowDown":E=Math.min(i.length-1,h+1);break;case"ArrowUp":E=Math.max(0,h-1);break;case"Home":A=0;break;case"End":A=d.length-1;break;default:return}t.preventDefault();let S=i[E],D=Array.from(S.querySelectorAll('[role="gridcell"]')),T=D[Math.min(A,D.length-1)],K=Array.from(this.querySelectorAll('[role="gridcell"]'));lt(K,K.indexOf(T)),T.focus()}static{gm()}};import{jsx as Ar}from"@ecopages/jsx/jsx-runtime";function z1({rows:e,label:t,children:i,...r}){let l=e!=null?e.map(h=>Ar("div",{class:"rui-grid__row",role:"row",children:h.map(d=>Ar("div",{class:"rui-grid__cell",role:"gridcell",tabindex:-1,children:d}))})):i;return Ar("rui-grid",{...r,label:t,children:Ar("div",{class:"rui-grid","data-ref":"root",role:"grid","aria-label":t||void 0,children:l})})}import{jsx as Cr}from"@ecopages/jsx/jsx-runtime";import{jsx as q1}from"@ecopages/jsx/jsx-runtime";function Ir({as:e,children:t,...i}){return q1(e??"div",{...i,children:t})}import{jsx as K1}from"@ecopages/jsx/jsx-runtime";function to(e){let{children:t,as:i="h2",size:r="md",class:l,...h}=e;return K1(Ir,{as:i,...h,class:L("rui-headline",r!==!1&&`rui-headline--size-${r}`,l),children:t})}function $1(e,t,i){return L("rui-heading",`rui-heading--align-${e}`,`rui-heading--size-${t}`,i)}function G1(e){let{children:t,as:i="div",align:r="start",size:l="md",class:h,...d}=e;return Cr(Ir,{as:i,...d,class:$1(r,l,h),children:t})}function W1({children:e,class:t,...i}){return Cr("p",{...i,class:L("rui-heading__eyebrow",t),children:e})}function H1(e){let{children:t,as:i="h2",class:r,...l}=e;return Cr(to,{as:i,size:!1,class:L("rui-heading__title",r),...l,children:t})}function Y1({children:e,class:t,...i}){return Cr("p",{...i,class:L("rui-heading__description",t),children:e})}import{jsx as ki}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Hm,bound as Oi,customElement as Z1,event as tO,onEvent as Dr,onUpdated as eO,prop as Ve,query as iO}from"@ecopages/radiant";var Di=0,Sm=0;function Tm(){Di+=1}function eo(e=Date.now(),t=300){Di=Math.max(0,Di-1),Di===0&&(Sm=e+t)}function Em(e,t=Date.now()){return Di>0||t<Sm?0:e}var Rm,Am,Im,Cm,Dm,Om,km,Vm,Mm,jm,Lm,Pm,Bm,Fm,Um,zm,qm,Km,$m,Gm;function X1(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Wm(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Wm(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:N1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return J1(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function N1(e){var t=Q1(e,"string");return typeof t=="symbol"?t:t+""}function Q1(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wm(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function J1(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var io="Preview",Ym=8,rO=500,Nm,Xm=class extends Hm{static{({e:[Im,Cm,Dm,Om,km,Vm,Mm,jm,Lm,Pm,Bm,Fm,Um,zm,qm,Km,$m,Gm,Rm],c:[Nm,Am]}=X1(this,[Z1("rui-hover-card")],[[Ve({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Ve({type:String,defaultValue:"bottom-start"}),0,"placement"],[Ve({type:Number,defaultValue:600}),0,"delay"],[Ve({type:Number,defaultValue:200}),0,"closeDelay"],[Ve({type:Boolean,defaultValue:!0}),0,"portal"],[Ve({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Ve({type:String,attribute:"content-label",reflect:!0,defaultValue:io}),0,"contentLabel"],[iO({ref:"content"}),0,"contentTarget"],[tO({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[Oi,eO(["open","placement","portal","disabled","contentLabel"])],2,"syncCard"],[Dr({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[Dr({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[Dr({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[Dr({type:"keydown",ref:"trigger"}),2,"onHostKeydown"],[Oi,2,"onPointerEnter"],[Oi,2,"onPointerLeave"],[Oi,2,"onPointerDown"],[Oi,2,"onPointerUp"]],0,void 0,Hm))}open=(Rm(this),Im(this));placement=(Cm(this),Dm(this));delay=(Om(this),km(this));closeDelay=(Vm(this),Mm(this));portal=(jm(this),Lm(this));disabled=(Pm(this),Bm(this));contentLabel=(Fm(this),Um(this));contentTarget=(zm(this),qm(this));openChangeEvent=(Km(this),$m(this));contentId=(Gm(this),`rui-hover-card-${Math.random().toString(36).slice(2,9)}`);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&&eo(),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 t=this.querySelector("[data-hover-card-trigger]");return t instanceof HTMLElement?Ye(t)??t:Ye(this)??this}getFloatingElement(){return this.controller?.getFloatingElement()??this.contentTarget}ensureController(){return this.controller||(this.controller=new ut({getAnchor:()=>this.getAnchor(),getFloating:()=>this.contentTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:Ym,portal:this.portal})),this.controller}syncCard(){let t=this.getAnchor(),i=this.contentTarget;i&&(i.id=this.contentId,i.setAttribute("aria-label",this.contentLabel)),t&&(t.setAttribute("aria-controls",this.contentId),t.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:Ym,portal:this.portal}),r.sync(),this.syncContentPointerBridge()}syncContentPointerBridge(){let t=this.getFloatingElement();t&&(t.removeEventListener("pointerenter",this.onPointerEnter),t.removeEventListener("pointerleave",this.onPointerLeave),this.open&&(t.addEventListener("pointerenter",this.onPointerEnter),t.addEventListener("pointerleave",this.onPointerLeave)))}setOpen(t,i=!0){if(this.disabled&&t)return;if(this.open===t){this.syncCard();return}let r=this.open;this.open=t,t?Tm():r&&eo(),i&&this.openChangeEvent.emit({open:t}),this.syncCard()}scheduleShow(t=!1){if(this.disabled||this.open)return;this.clearTimers(),this.openedByKeyboard=t;let i=Em(this.delay);if(i<=0){this.setOpen(!0);return}this.showTimer=setTimeout(()=>this.setOpen(!0),i)}scheduleHide(){this.clearTimers();let t=this.closeDelay>0?this.closeDelay:0;if(t<=0){this.setOpen(!1);return}this.hideTimer=setTimeout(()=>this.setOpen(!1),t)}isTouchPointer(t){return t.pointerType==="touch"}onDocumentKeydown(t){if(!this.open||t.key!=="Escape")return;t.preventDefault();let i=this.getAnchor();this.setOpen(!1),i&&document.activeElement!==i&&i.focus()}onFocusIn(t){zt(this.getAnchor(),this.getFloatingElement(),t.relatedTarget)&&this.scheduleShow(!0)}onFocusOut(t){zt(this.getAnchor(),this.getFloatingElement(),t.relatedTarget)&&this.scheduleHide()}onHostKeydown(t){if(!this.open||t.key!=="Tab"||t.shiftKey||!this.openedByKeyboard)return;let i=this.getFloatingElement();if(!i)return;let r=Ye(i);r&&(t.preventDefault(),r.focus())}onPointerEnter(t){this.isTouchPointer(t)||this.scheduleShow()}onPointerLeave(t){this.isTouchPointer(t)||this.scheduleHide()}onPointerDown(t){this.disabled||!this.isTouchPointer(t)||(this.clearTimers(),this.longPressTimer=setTimeout(()=>{this.openedByKeyboard=!1,this.setOpen(!0)},rO))}onPointerUp(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}static{Am()}};function nO({children:e,class:t,...i}){return ki("span",{class:"rui-hover-card__trigger","data-ref":"trigger",children:ki("span",{...i,"data-hover-card-trigger":!0,class:L(t),children:e})})}function oO({children:e,class:t,...i}){return ki("div",{...i,"data-ref":"content",class:L("rui-hover-card__content","rui-floating",t),role:"dialog",hidden:!0,children:e})}function aO({children:e,contentLabel:t=io,...i}){return ki("rui-hover-card",{contentLabel:t,...i,children:ki("span",{class:"rui-hover-card",children:e})})}import{jsx as sO}from"@ecopages/jsx/jsx-runtime";function lO(e){let{class:t,type:i="text",mask:r,placeholder:l,"on:input":h,...d}=e,a=r?hn(r):l;return sO("input",{...d,type:i,placeholder:a,"on:input":r?A=>{if(r){let S=A.target;S.value=pi(S.value,r)}typeof h=="function"?h(A):h!=null&&typeof h=="object"&&"handleEvent"in h&&h.handleEvent(A)}:h,inputmode:r?"numeric":void 0,[$t]:"","data-rui-control-type":"text",class:L("rui-input",t)})}import{jsx as ro}from"@ecopages/jsx/jsx-runtime";function uO({children:e,class:t,...i}){return ro("div",{...i,role:"group",class:L("rui-input-group",t),children:e})}function cO({children:e,align:t="start",class:i,...r}){return ro("div",{...r,class:L("rui-input-group__addon",`rui-input-group__addon--${t}`,i),children:e})}function dO({children:e,class:t,...i}){return ro("span",{...i,class:L("rui-input-group__text",t),children:e})}import{RadiantElement as Hg,customElement as xO,event as wO,onEvent as Vi,onUpdated as SO,prop as _t,query as be}from"@ecopages/radiant";function hO(e){if(!Number.isFinite(e)||e<=0)return 0;let t=e.toString().match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);if(!t)return 0;let i=t[1]?.length??0,r=t[2]?Number(t[2]):0;return Math.min(15,Math.max(0,i-r))}function Or(e,t){return typeof t=="number"&&Number.isFinite(t)&&t>=0?Math.min(15,Math.round(t)):hO(e)}function kr(e,t){return Number.isFinite(e)?e.toFixed(t):""}function ge(e,t,i){let r=Number.isFinite(e)?e:0,l=Number.isFinite(t)?t:100,h=Math.min(r,l),d=Math.max(r,l),a=Number.isFinite(i)&&i>0?i:1,E=d-h,A=S=>{let D=Number.isFinite(S)?S:h,T=h+Math.round((D-h)/a)*a;return Math.min(d,Math.max(h,T))};return{lowerBound:h,upperBound:d,step:a,clamp:A,ratioFor:S=>E===0?0:(A(S)-h)/E,valueFromRatio:S=>{let D=Math.min(1,Math.max(0,Number.isFinite(S)?S:0));return A(h+D*E)}}}function Vr(e,t,i){switch(i){case"ArrowRight":case"ArrowUp":return e.clamp(t+e.step);case"ArrowLeft":case"ArrowDown":return e.clamp(t-e.step);case"Home":return e.lowerBound;case"End":return e.upperBound;case"PageUp":return e.clamp(t+e.step*10);case"PageDown":return e.clamp(t-e.step*10);default:return}}var Qm=120,ei=300,pO=14,fO=ei+(360-ei)/2;function mO(e){return Math.min(100,Math.max(0,Number.isFinite(e)?Number(e):pO))}function gO(e,t,i){return i.replace("{value}",kr(e,t))}function Mr(e,t,i,r,l,h,d){let a=ge(t,i,r),E=mO(l),A=50-E/2,S=2*Math.PI*A,D=ei/360*S,T=a.clamp(e),K=Or(r,d);return{startAngle:Qm,strokeWidth:E,radius:A,circumference:S,arcLength:D,progressLength:a.ratioFor(T)*D,valueText:gO(T,K,h)}}function no(e,t,i,r){if(i.width===0||i.height===0)return null;let h=(Math.atan2(t-(i.top+i.height/2),e-(i.left+i.width/2))*180/Math.PI-Qm+360)%360,d=h<=ei?h:h<=fO?ei:0;return r.valueFromRatio(d/ei)}var Jm,Zm,tg,eg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg,vg,yg,_g,xg,wg,Sg,Tg,Eg,Rg,Ag,Ig,Cg,Dg,Og,kg,Vg,Mg,jg,Lg,Pg,Bg,Fg,Ug,zg,qg,Kg,$g,Gg;function bO(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Wg(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Wg(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:vO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _O(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function vO(e){var t=yO(e,"string");return typeof t=="symbol"?t:t+""}function yO(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wg(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function _O(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Xg,Yg=class extends Hg{static{({e:[tg,eg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg,vg,yg,_g,xg,wg,Sg,Tg,Eg,Rg,Ag,Ig,Cg,Dg,Og,kg,Vg,Mg,jg,Lg,Pg,Bg,Fg,Ug,zg,qg,Kg,$g,Gg,Jm],c:[Xg,Zm]}=bO(this,[xO("rui-knob")],[[_t({type:Number,reflect:!0,defaultValue:50}),0,"value"],[_t({type:Number,defaultValue:0}),0,"min"],[_t({type:Number,defaultValue:100}),0,"max"],[_t({type:Number,defaultValue:1}),0,"step"],[_t({type:Number,attribute:"value-precision",defaultValue:Number.NaN}),0,"valuePrecision"],[_t({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[_t({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[_t({type:String,defaultValue:""}),0,"label"],[_t({type:String,defaultValue:""}),0,"name"],[_t({type:Number}),0,"size"],[_t({type:Number,attribute:"stroke-width",defaultValue:14}),0,"strokeWidth"],[_t({type:Boolean,attribute:"show-value",defaultValue:!0}),0,"showValue"],[_t({type:String,attribute:"value-position",defaultValue:"center"}),0,"valuePosition"],[_t({type:String,attribute:"value-template",defaultValue:"{value}"}),0,"valueTemplate"],[wO({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[be({ref:"root"}),0,"rootTarget"],[be({ref:"label"}),0,"labelTarget"],[be({ref:"control"}),0,"controlTarget"],[be({ref:"track"}),0,"trackTarget"],[be({ref:"progress"}),0,"progressTarget"],[be({ref:"centerValue"}),0,"centerValueTarget"],[be({ref:"belowValue"}),0,"belowValueTarget"],[be({ref:"input"}),0,"inputTarget"],[SO(["value","min","max","step","valuePrecision","disabled","readOnly","name","label","size","strokeWidth","showValue","valuePosition","valueTemplate"]),2,"onPropsUpdated"],[Vi({ref:"control",type:"pointerdown"}),2,"onPointerDown"],[Vi({ref:"control",type:"pointermove"}),2,"onPointerMove"],[Vi({ref:"control",type:"pointerup"}),2,"onPointerUp"],[Vi({ref:"control",type:"pointercancel"}),2,"onPointerCancel"],[Vi({ref:"control",type:"keydown"}),2,"onKeydown"]],0,void 0,Hg))}value=(Jm(this),tg(this));min=(eg(this),ig(this));max=(rg(this),ng(this));step=(og(this),ag(this));valuePrecision=(sg(this),lg(this));disabled=(ug(this),cg(this));readOnly=(dg(this),hg(this));label=(pg(this),fg(this));name=(mg(this),gg(this));size=(bg(this),vg(this));strokeWidth=(yg(this),_g(this));showValue=(xg(this),wg(this));valuePosition=(Sg(this),Tg(this));valueTemplate=(Eg(this),Rg(this));changeEvent=(Ag(this),Ig(this));rootTarget=(Cg(this),Dg(this));labelTarget=(Og(this),kg(this));controlTarget=(Vg(this),Mg(this));trackTarget=(jg(this),Lg(this));progressTarget=(Pg(this),Bg(this));centerValueTarget=(Fg(this),Ug(this));belowValueTarget=(zg(this),qg(this));inputTarget=(Kg(this),$g(this));activePointerId=(Gg(this),null);lastEmitted=null;onConnected(){this.syncPresentation()}onPropsUpdated(){this.syncPresentation()}get numericRange(){return ge(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(t){let i=Mr(t,this.min,this.max,this.step,this.strokeWidth,this.valueTemplate,this.valuePrecision),r=this.resolvedValuePosition;this.syncKnobLayout(r),this.syncControl(t,i.valueText),this.syncRing(i),this.syncReadout(i.valueText,r),this.syncFormValue(t)}syncKnobLayout(t){this.rootTarget?.classList.toggle("rui-knob--value-below",t==="below"),this.labelTarget?.toggleAttribute("hidden",!this.label),this.labelTarget&&(this.labelTarget.textContent=this.label),this.resolvedSize?this.style.setProperty("--rui-knob-size",`${this.resolvedSize}px`):this.style.removeProperty("--rui-knob-size")}syncControl(t,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(t)),r.setAttribute("aria-valuetext",i),this.label?r.setAttribute("aria-label",this.label):r.removeAttribute("aria-label"),r.setAttribute("aria-readonly",String(this.readOnly)),r.disabled=this.disabled)}syncRing(t){for(let i of[this.trackTarget,this.progressTarget])i?.setAttribute("r",String(t.radius)),i?.setAttribute("stroke-width",String(t.strokeWidth));this.trackTarget?.setAttribute("stroke-dasharray",`${t.arcLength} ${t.circumference}`),this.progressTarget?.setAttribute("stroke-dasharray",`${t.progressLength} ${t.circumference}`)}syncReadout(t,i){for(let[r,l]of[[this.centerValueTarget,this.showValue&&i==="center"],[this.belowValueTarget,this.showValue&&i==="below"]])r&&(r.textContent=t,r.toggleAttribute("hidden",!l))}syncFormValue(t){let i=this.inputTarget;i&&(i.value=String(t),this.name?i.name=this.name:i.removeAttribute("name"),i.disabled=this.disabled)}syncPresentation(){let t=this.numericRange.clamp(this.value);this.paint(t),this.value!==t&&(this.value=t)}commitValue(t){if(this.disabled||this.readOnly)return;let i=this.numericRange.clamp(t);this.paint(i),i!==this.value&&(this.value=i,this.lastEmitted!==i&&(this.lastEmitted=i,this.changeEvent.emit({value:i})))}onPointerDown(t){if(t.button!==0||this.disabled||this.readOnly)return;this.activePointerId=t.pointerId,this.lastEmitted=this.value,this.controlTarget.setPointerCapture(t.pointerId);let i=this.controlTarget.getBoundingClientRect(),r=no(t.clientX,t.clientY,i,this.numericRange);r!=null&&this.commitValue(r),t.preventDefault()}onPointerMove(t){if(t.pointerId!==this.activePointerId)return;let i=this.controlTarget.getBoundingClientRect(),r=no(t.clientX,t.clientY,i,this.numericRange);r!=null&&this.commitValue(r)}onPointerUp(t){t.pointerId===this.activePointerId&&(this.controlTarget.releasePointerCapture(t.pointerId),this.activePointerId=null)}onPointerCancel(t){t.pointerId===this.activePointerId&&(this.controlTarget.hasPointerCapture(t.pointerId)&&this.controlTarget.releasePointerCapture(t.pointerId),this.activePointerId=null)}onKeydown(t){if(this.disabled||this.readOnly)return;let i=Vr(this.numericRange,this.value,t.key);i!=null&&(t.preventDefault(),this.lastEmitted=this.value,this.commitValue(i))}static{Zm()}};import{jsx as Nt,jsxs as oo}from"@ecopages/jsx/jsx-runtime";function TO({value:e=50,min:t=0,max:i=100,step:r=1,disabled:l=!1,readOnly:h=!1,label:d,name:a,size:E,strokeWidth:A=14,showValue:S=!0,valuePosition:D="center",valueTemplate:T="{value}",valuePrecision:K,...$}){let P=ge(t,i,r),G=P.clamp(e),W=Mr(G,t,i,r,A,T,K);return Nt(EO,{props:$,value:G,min:t,max:i,step:r,disabled:l,readOnly:h,label:d,name:a,size:E,strokeWidth:A,showValue:S,valuePosition:D,valueTemplate:T,valuePrecision:K,ring:W,range:P})}function EO({props:e,ring:t,range:i,...r}){return Nt("rui-knob",{...e,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:Nt(RO,{knob:r,ring:t,range:i})})}function RO({knob:e,ring:t,range:i}){let r=e.valuePosition==="below";return oo("div",{class:r?"rui-knob rui-knob--value-below":"rui-knob","data-ref":"root",children:[Nt("span",{class:"rui-knob__label","data-ref":"label",hidden:!e.label,children:e.label}),Nt(AO,{knob:e,ring:t,range:i,valueBelow:r}),Nt("span",{class:"rui-knob__value rui-knob__value--below","data-ref":"belowValue","aria-hidden":"true",hidden:!e.showValue||!r,children:t.valueText}),Nt("input",{"data-ref":"input",type:"hidden",name:e.name||void 0,value:e.value})]})}function AO({knob:e,ring:t,range:i,valueBelow:r}){return oo("button",{type:"button",class:"rui-knob__control","data-ref":"control","data-knob-control":!0,role:"slider","aria-label":e.label||void 0,"aria-valuemin":i.lowerBound,"aria-valuemax":i.upperBound,"aria-valuenow":e.value,"aria-valuetext":t.valueText,"aria-readonly":e.readOnly,disabled:e.disabled,children:[oo("svg",{class:"rui-knob__svg",viewBox:"0 0 100 100","aria-hidden":"true",children:[Nt("circle",{class:"rui-knob__track","data-ref":"track",cx:"50",cy:"50",r:t.radius,fill:"none","stroke-width":t.strokeWidth,"stroke-dasharray":`${t.arcLength} ${t.circumference}`,transform:`rotate(${t.startAngle} 50 50)`}),Nt("circle",{class:"rui-knob__progress","data-ref":"progress",cx:"50",cy:"50",r:t.radius,fill:"none","stroke-width":t.strokeWidth,"stroke-dasharray":`${t.progressLength} ${t.circumference}`,transform:`rotate(${t.startAngle} 50 50)`})]}),Nt("span",{class:"rui-knob__value","data-ref":"centerValue","aria-hidden":"true",hidden:!e.showValue||r,children:t.valueText})]})}import{jsx as IO}from"@ecopages/jsx/jsx-runtime";function CO({children:e,htmlFor:t,class:i,...r}){return IO("label",{...r,[Sr]:"",class:L("rui-label",i),htmlFor:t,children:e})}import{RadiantElement as db,bound as PO,customElement as BO,event as hb,onEvent as ve,onUpdated as FO,prop as pb,query as fb}from"@ecopages/radiant";var DO=200,OO=250,kO=6,ii=class{config;popovers=new Map;openMenus=new Set;openTimers=new Map;closeTimers=new Map;constructor(t){this.config=t}sync(){for(let t of this.getMenus())for(let i of this.getDirectItems(t)){let r=this.getSubmenu(i);r&&(i.setAttribute("aria-haspopup","menu"),i.hasAttribute("aria-expanded")||i.setAttribute("aria-expanded","false"),r.id||(r.id=`rui-submenu-${Math.random().toString(36).slice(2,9)}`),i.setAttribute("aria-controls",r.id),r.hidden=i.getAttribute("aria-expanded")!=="true")}}handlePointerOver(t){let i=this.getDirectItem(t.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 l=setTimeout(()=>{this.openTimers.delete(i),this.openSubmenu(i,!1)},DO);this.openTimers.set(i,l)}handlePointerOut(t){let i=this.getDirectItem(t.target);if(!i)return;let r=t.relatedTarget,l=this.getSubmenu(i);l&&r&&l.contains(r)||r&&i.contains(r)||(this.cancelOpenFor(i),i.getAttribute("aria-expanded")==="true"&&this.scheduleClose(i))}handleFocusOut(t){let i=this.getDirectItem(t.target);if(!i||i.getAttribute("aria-expanded")!=="true")return;let r=this.getSubmenu(i),l=t.relatedTarget;r&&l&&r.contains(l)||this.closeSubmenu(i,!1)}handleKeydown(t){let i=this.getDirectItem(t.target),r=i?.parentElement;if(!i||!r||r.getAttribute("role")!=="menu")return!1;let l=this.keyHandlers[t.key];if(!l)return!1;let h=l.call(this,{item:i,items:this.getFocusableItems(r),menu:r,submenu:this.getSubmenu(i)});return h&&t.key!=="Tab"&&t.preventDefault(),h}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(t){return this.focusRelativeItem(t,1)}focusPreviousItem(t){return this.focusRelativeItem(t,-1)}focusRelativeItem(t,i){let r=t.items.indexOf(t.item);return r<0||!t.items.length?!1:(t.items[(r+i+t.items.length)%t.items.length]?.focus(),!0)}focusFirstItem(t){return t.items[0]?.focus(),!0}focusLastItem(t){return t.items.at(-1)?.focus(),!0}openNestedMenu(t){return t.submenu?(this.openSubmenu(t.item,!0),!0):!1}closeNestedMenu(t){if(this.getRootMenu()===t.menu)return!1;let i=this.getTriggerForMenu(t.menu);return i&&this.closeSubmenu(i,!0),!0}activateOrOpenItem(t){return t.submenu?this.openSubmenu(t.item,!0):this.config.onActivate(t.item),!0}closeRootMenu(){return this.config.onCloseRoot(!0),!0}closeMenuForTab(){return this.config.onCloseRoot(!1),!0}handleClick(t){let i=this.getDirectItem(t.target);return!i||this.isDisabled(i)?!1:this.getSubmenu(i)?(t.preventDefault(),this.closeSiblingBranches(i),this.openSubmenu(i,!1),!0):(this.config.onActivate(i),!0)}closeAll(){for(let t of Array.from(this.openMenus)){let i=this.getTriggerForMenu(t);i&&this.closeSubmenu(i,!1)}this.clearTimers()}getFocusableItems(t){return this.getDirectItems(t).filter(i=>!this.isDisabled(i))}destroy(){this.closeAll();for(let t of this.popovers.values())t.destroy();this.popovers.clear()}openSubmenu(t,i){let r=this.getSubmenu(t);if(!r||this.isDisabled(t))return;this.cancelOpenFor(t),this.cancelCloseFor(t),this.closeSiblingBranches(t),t.setAttribute("aria-expanded","true"),r.hidden=!1,this.openMenus.add(r);let l=this.popovers.get(r);l||(l=new ut({getAnchor:()=>t,getFloating:()=>r,getOpen:()=>t.getAttribute("aria-expanded")==="true",getPlacement:()=>"right-start",gap:kO,portal:!1}),this.popovers.set(r,l)),l.updateConfig({getAnchor:()=>t,getOpen:()=>t.getAttribute("aria-expanded")==="true"}),l.sync(),i&&this.getFocusableItems(r)[0]?.focus()}closeSubmenu(t,i){let r=this.getSubmenu(t);if(r){for(let l of this.getDirectItems(r))this.closeSubmenu(l,!1);this.cancelOpenFor(t),this.cancelCloseFor(t),t.setAttribute("aria-expanded","false"),r.hidden=!0,this.openMenus.delete(r),this.popovers.get(r)?.teardown(),i&&t.focus()}}closeSiblingBranches(t){let i=t.parentElement;if(i)for(let r of this.getDirectItems(i))r!==t&&r.getAttribute("aria-expanded")==="true"&&this.closeSubmenu(r,!1)}scheduleClose(t){this.cancelCloseFor(t);let i=setTimeout(()=>{this.closeTimers.delete(t),this.closeSubmenu(t,!1)},OO);this.closeTimers.set(t,i)}getMenus(){return Array.from(this.config.root.querySelectorAll('[role="menu"]'))}getRootMenu(){return this.config.getRootMenu()}getDirectItems(t){return Array.from(t.querySelectorAll('[role="menuitem"]')).filter(i=>i.closest('[role="menu"]')===t)}getDirectItem(t){if(!(t instanceof HTMLElement))return null;let i=t.closest('[role="menuitem"]');return i&&i.closest('[role="menu"]')&&this.config.root.contains(i)?i:null}getSubmenu(t){let i=t.nextElementSibling;return i instanceof HTMLElement&&i.getAttribute("role")==="menu"?i:null}getTriggerForMenu(t){let i=t.previousElementSibling;return i instanceof HTMLElement&&i.getAttribute("role")==="menuitem"?i:null}isDisabled(t){return t.getAttribute("aria-disabled")==="true"||t instanceof HTMLButtonElement&&t.disabled}cancelOpenFor(t){let i=this.openTimers.get(t);i&&clearTimeout(i),this.openTimers.delete(t)}cancelCloseFor(t){let i=this.closeTimers.get(t);i&&clearTimeout(i),this.closeTimers.delete(t)}cancelAncestorCloseTimers(t){let i=t.closest('[role="menu"]');for(;i;){let r=this.getTriggerForMenu(i);if(!r)return;this.cancelCloseFor(r),i=r.closest('[role="menu"]')}}clearTimers(){for(let t of this.openTimers.values())clearTimeout(t);for(let t of this.closeTimers.values())clearTimeout(t);this.openTimers.clear(),this.closeTimers.clear()}};var Ng,Qg,Jg,Zg,tb,eb,ib,rb,nb,ob,ab,sb,lb,ub;function VO(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:cb(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||cb(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:MO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return LO(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function MO(e){var t=jO(e,"string");return typeof t=="symbol"?t:t+""}function jO(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cb(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function LO(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var UO=6,gb,mb=class extends db{static{({e:[Jg,Zg,tb,eb,ib,rb,nb,ob,ab,sb,lb,ub,Ng],c:[gb,Qg]}=VO(this,[BO("rui-menu-button")],[[pb({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[pb({type:String,defaultValue:"bottom-start"}),0,"placement"],[fb({ref:"trigger"}),0,"triggerTarget"],[fb({ref:"menu"}),0,"menuTarget"],[hb({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[hb({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[PO,FO(["open","placement"])],2,"syncOpenState"],[ve({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[ve({ref:"trigger",type:"click"}),2,"onTriggerClick"],[ve({ref:"trigger",type:"keydown"}),2,"onTriggerKeydown"],[ve({ref:"menu",type:"keydown"}),2,"onMenuKeydown"],[ve({ref:"menu",type:"pointerover"}),2,"onMenuPointerOver"],[ve({ref:"menu",type:"pointerout"}),2,"onMenuPointerOut"],[ve({ref:"menu",type:"focusout"}),2,"onMenuFocusOut"],[ve({selector:'[role="menuitem"]',type:"click"}),2,"onItemClick"]],0,void 0,db))}open=(Ng(this),Jg(this));placement=(Zg(this),tb(this));triggerTarget=(eb(this),ib(this));menuTarget=(rb(this),nb(this));changeEvent=(ob(this),ab(this));closeEvent=(sb(this),lb(this));menuId=(ub(this),`rui-menu-${Math.random().toString(36).slice(2,9)}`);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 ii({root:this,getRootMenu:()=>this.menuTarget,onActivate:t=>this.activateItem(t),onCloseRoot:t=>this.setOpen(!1,t?"trigger":null)})),this.menuTree}getSearchInput(){return this.menuTarget?.querySelector("[data-autocomplete-input]")??null}ensurePopoverController(){return this.popoverController||(this.popoverController=new ut({getAnchor:()=>this.triggerTarget,getFloating:()=>this.menuTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:UO,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"),this.triggerTarget.setAttribute("aria-expanded",String(this.open)),this.menuTarget.toggleAttribute("hidden",!this.open);let t=this.ensureMenuTree();t.sync(),this.open||t.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 l=this.getSearchInput();if(l){l.focus();return}if(r==="first"&&this.getItems()[0]?.focus(),r==="last"){let h=this.getItems();h[h.length-1]?.focus()}}setOpen(t,i=null){let r=this.open;this.pendingFocus=i,this.open=t,r&&!t&&this.closeEvent.emit(),r===t&&this.syncOpenState()}onDocumentPointerDown(t){if(!this.open)return;let i=t.target;he(this.triggerTarget,this.menuTarget,i)&&this.setOpen(!1)}onTriggerClick(){this.setOpen(!this.open,this.open?null:"first")}onTriggerKeydown(t){switch(t.key){case"ArrowDown":case"Enter":case" ":t.preventDefault(),this.setOpen(!0,"first");break;case"ArrowUp":t.preventDefault(),this.setOpen(!0,"last");break;default:break}}onMenuKeydown(t){this.ensureMenuTree().handleKeydown(t)}onMenuPointerOver(t){this.ensureMenuTree().handlePointerOver(t)}onMenuPointerOut(t){this.ensureMenuTree().handlePointerOut(t)}onMenuFocusOut(t){this.ensureMenuTree().handleFocusOut(t)}onItemClick(t){this.ensureMenuTree().handleClick(t)}activateItem(t){let i=t.getAttribute("data-value")||t.textContent?.trim()||"";this.changeEvent.emit({value:i}),this.setOpen(!1,"trigger")}static{Qg()}};import{jsx as Qt,jsxs as bb}from"@ecopages/jsx/jsx-runtime";import{jsx as zO}from"@ecopages/jsx/jsx-runtime";function Mi({orientation:e="horizontal",class:t,...i}){return zO("hr",{...i,class:L("rui-separator",t),role:"separator","aria-orientation":e,"data-orientation":e})}import{Fragment as qO,jsxs as KO}from"@ecopages/jsx/jsx-runtime";function ji(e,t){return e.map(i=>{if(i.type==="separator")return t.Separator({id:i.id});let r=!!i.items?.length;return KO(qO,{children:[t.Item({value:i.value,disabled:i.disabled,hasSubmenu:r,children:i.label}),r?t.Submenu({children:ji(i.items??[],t)}):null]})})}function vb({children:e,class:t,variant:i="filled",size:r="md",...l}){return bb(ne,{...l,variant:i,size:r,"data-ref":"trigger",class:L("rui-menu-button__trigger",t),"aria-haspopup":"menu",children:[e,Qt(we,{class:"rui-menu-button__chevron"})]})}function yb({children:e,class:t,...i}){return Qt("div",{...i,"data-ref":"menu",class:L("rui-menu-button__menu","rui-popover","rui-floating",t),role:"menu",children:e})}function _b({children:e,class:t,...i}){return Qt("div",{...i,"data-ref":"submenu-menu",class:L("rui-menu-button__menu","rui-menu-button__submenu","rui-popover","rui-floating",t),role:"menu",hidden:!0,children:e})}function xb({children:e,value:t,disabled:i,hasSubmenu:r,class:l,...h}){return Qt("button",{...h,type:"button",class:L("rui-menu-button__item",l),role:"menuitem","data-value":t,"aria-haspopup":r?"menu":void 0,"aria-disabled":i?"true":void 0,disabled:i,tabIndex:-1,children:e})}function $O({trigger:e,items:t,children:i,class:r,...l}){return e==null&&t==null?Qt("rui-menu-button",{...l,class:L("rui-menu-button",r),children:i}):bb("rui-menu-button",{...l,class:L("rui-menu-button",r),children:[Qt(vb,{children:e}),Qt(yb,{children:t?ji(t,{Item:h=>Qt(xb,{...h}),Submenu:h=>Qt(_b,{...h}),Separator:h=>Qt(Mi,{},h.id)}):i})]})}import{RadiantElement as Cb,customElement as XO,event as NO,onEvent as ye,prop as QO}from"@ecopages/radiant";var wb,Sb,Tb,Eb,Rb,Ab;function GO(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Ib(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Ib(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:WO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return YO(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function WO(e){var t=HO(e,"string");return typeof t=="symbol"?t:t+""}function HO(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ib(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function YO(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Ob,Db=class extends Cb{static{({e:[Tb,Eb,Rb,Ab,wb],c:[Ob,Sb]}=GO(this,[XO("rui-menubar")],[[QO({type:String,defaultValue:""}),0,"label"],[NO({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[ye({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[ye({selector:'[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]',type:"keydown"}),2,"onTopKeydown"],[ye({selector:'[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]',type:"click"}),2,"onTopClick"],[ye({selector:'[role="menu"] > [role="menuitem"]',type:"keydown"}),2,"onMenuKeydown"],[ye({selector:'[role="menu"] > [role="menuitem"]',type:"click"}),2,"onMenuItemClick"],[ye({selector:'[role="menuitem"]',type:"pointerover"}),2,"onPointerOver"],[ye({selector:'[role="menuitem"]',type:"pointerout"}),2,"onPointerOut"],[ye({selector:'[role="menuitem"]',type:"focusout"}),2,"onFocusOut"]],0,void 0,Cb))}label=(wb(this),Tb(this));changeEvent=(Eb(this),Rb(this));openRoot=(Ab(this),null);popoverController=null;menuTree=null;getTopItems(){return Array.from(this.querySelectorAll('[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]'))}getMenuFor(t){return t.closest('[data-ref="menubar-root"]')?.querySelector(':scope > [role="menu"]')??null}onConnected(){lt(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 ii({root:this,getRootMenu:()=>this.getOpenMenuSurface(),onActivate:t=>this.activateItem(t),onCloseRoot:t=>this.closeOpenMenu(t)})),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 t=this.getOpenMenuAnchor(),i=this.getOpenMenuSurface();!t||!i||(this.popoverController||(this.popoverController=new ut({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(t=!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(),t&&i&&i.focus()}openMenu(t,i="first"){let r=t.closest('[data-ref="menubar-root"]'),l=this.getMenuFor(t);!r||!l||(this.openRoot&&this.openRoot!==r&&this.closeOpenMenu(),t.setAttribute("aria-expanded","true"),l.hidden=!1,this.openRoot=r,this.syncOpenMenuPosition(),this.ensureMenuTree().sync(),i==="first"&&this.ensureMenuTree().getFocusableItems(l)[0]?.focus())}onDocumentPointerDown(t){this.openRoot&&he(this.getOpenMenuAnchor(),this.getOpenMenuSurface(),t.target)&&this.closeOpenMenu()}onTopKeydown(t){let i=this.getTopItems(),r=t.target.closest('[role="menuitem"]');if(!r||!i.includes(r))return;if(t.key==="ArrowDown"||t.key==="Enter"||t.key===" "){this.getMenuFor(r)&&(t.preventDefault(),this.openMenu(r,"first"));return}if(t.key==="Escape"){t.preventDefault(),this.closeOpenMenu(!0);return}let l=ct({items:i,current:r,key:t.key,orientation:"horizontal"});l.handled&&(t.preventDefault(),this.openRoot&&(this.getMenuFor(l.item)?this.openMenu(l.item,"first"):this.closeOpenMenu()))}onTopClick(t){let i=t.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(t){let i=t.target.closest('[role="menu"]'),r=t.target.closest('[role="menuitem"]');if(!i||!r||!this.contains(i)||this.ensureMenuTree().handleKeydown(t)||t.key!=="ArrowLeft"&&t.key!=="ArrowRight")return;let l=this.getOpenMenuAnchor();if(!l)return;t.preventDefault();let h=ct({items:this.getTopItems(),current:l,key:t.key,orientation:"horizontal"});h.handled&&this.getMenuFor(h.item)&&this.openMenu(h.item,"first")}onMenuItemClick(t){this.ensureMenuTree().handleClick(t)}onPointerOver(t){let r=t.target?.closest('[data-ref="menubar-root"] > [role="menuitem"]');if(r&&this.getTopItems().includes(r)&&this.openRoot&&this.getMenuFor(r)){let l=r.closest('[data-ref="menubar-root"]');l&&l!==this.openRoot&&this.openMenu(r,null);return}this.ensureMenuTree().handlePointerOver(t)}onPointerOut(t){this.ensureMenuTree().handlePointerOut(t)}onFocusOut(t){this.ensureMenuTree().handleFocusOut(t)}activateItem(t){let i=t.getAttribute("data-value")||t.textContent?.trim()||"";this.changeEvent.emit({value:i}),this.closeOpenMenu(!0)}static{Sb()}};import{jsx as Jt,jsxs as JO}from"@ecopages/jsx/jsx-runtime";function kb({label:e,children:t,disabled:i}){let r=t!=null;return JO("div",{class:"rui-menubar__root","data-ref":"menubar-root",children:[Jt("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:e}),r?Jt("div",{class:"rui-menubar__menu rui-popover rui-floating","data-ref":"menu",role:"menu",hidden:!0,children:t}):null]})}function Vb({children:e,value:t,disabled:i,hasSubmenu:r,class:l,...h}){return Jt("button",{...h,type:"button",class:L("rui-menubar__menu-item",l),role:"menuitem","data-value":t,"aria-haspopup":r?"menu":void 0,"aria-disabled":i?"true":void 0,disabled:i,tabIndex:-1,children:e})}function Mb({children:e,class:t,...i}){return Jt("div",{...i,"data-ref":"submenu-menu",class:L("rui-menubar__menu","rui-menubar__submenu","rui-popover","rui-floating",t),role:"menu",hidden:!0,children:e})}function ZO({items:e,label:t,children:i,...r}){let l=e!=null?e.map(h=>Jt(kb,{label:h.label,disabled:h.disabled,children:h.items?.length?ji(h.items,{Item:d=>Jt(Vb,{...d}),Submenu:d=>Jt(Mb,{...d}),Separator:d=>Jt(Mi,{},d.id)}):null})):i;return Jt("rui-menubar",{...r,label:t,children:Jt("div",{class:"rui-menubar","data-ref":"root",role:"menubar","aria-label":t||void 0,children:l})})}import{jsx as nk,jsxs as ao}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Yb,customElement as ok,onUpdated as ak,prop as jr,state as sk}from"@ecopages/radiant";var jb,Lb,Pb,Bb,Fb,Ub,zb,qb,Kb,$b,Gb,Wb;function tk(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Hb(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Hb(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:ek(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return rk(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function ek(e){var t=ik(e,"string");return typeof t=="symbol"?t:t+""}function ik(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hb(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function rk(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Nb,Xb=class extends Yb{static{({e:[Pb,Bb,Fb,Ub,zb,qb,Kb,$b,Gb,Wb,jb],c:[Nb,Lb]}=tk(this,[ok("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"],[sk,0,"percent"],[ak(["value","min","max"]),2,"onRangeUpdated"]],0,void 0,Yb))}value=(jb(this),Pb(this));min=(Bb(this),Fb(this));max=(Ub(this),zb(this));label=(qb(this),Kb(this));percent=($b(this),Gb(this,0));resolvedAriaLabel=(Wb(this),this.$.label.map(t=>t||void 0));onRangeUpdated(){this.percent=this.max===this.min?0:Math.round((this.value-this.min)/(this.max-this.min)*100)}render(){return ao("div",{class:"rui-meter",children:[this.label?nk("span",{class:"rui-meter__label",children:this.$.label}):null,ao("meter",{class:"rui-meter__bar",min:this.$.min,max:this.$.max,value:this.$.value,"aria-label":this.resolvedAriaLabel,children:[this.$.percent,"%"]}),ao("span",{class:"rui-meter__value","aria-hidden":"true",children:[this.$.percent,"%"]})]})}static{Lb()}};import{jsx as lk}from"@ecopages/jsx/jsx-runtime";function uk(e){return lk("rui-meter",{...e})}import{jsx as Me}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as iv,customElement as fk,onEvent as ri,prop as mk}from"@ecopages/radiant";var Qb,Jb,Zb,tv;function ck(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:ev(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||ev(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:dk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return pk(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function dk(e){var t=hk(e,"string");return typeof t=="symbol"?t:t+""}function hk(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ev(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function pk(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var nv,rv=class extends iv{static{({e:[Zb,tv,Qb],c:[nv,Jb]}=ck(this,[fk("rui-navigation-menu")],[[mk({type:String,defaultValue:""}),0,"label"],[ri({document:!0,type:"click"}),2,"onDocumentClick"],[ri({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[ri({ref:"root",type:"keydown"}),2,"onRootKeydown"],[ri({selector:"[data-navigation-trigger]",type:"click"}),2,"onTriggerClick"],[ri({selector:"[data-navigation-item]",type:"keydown"}),2,"onBarItemKeydown"],[ri({selector:"[data-navigation-panel]",type:"keydown"}),2,"onPanelKeydown"]],0,void 0,iv))}label=(Qb(this),Zb(this));openValue=(tv(this),null);onConnected(){this.syncPanels(),this.syncBarRovingTabindex()}getBarItems(){return Array.from(this.querySelectorAll("[data-navigation-item]"))}syncBarRovingTabindex(){let t=this.getBarItems(),i=Math.max(0,t.findIndex(r=>r.tabIndex===0||r===document.activeElement));lt(t,i)}isBarTrigger(t){return t.hasAttribute("data-navigation-trigger")}getTriggers(){return Array.from(this.querySelectorAll("[data-navigation-trigger]"))}getPanel(t){return this.querySelector(`[data-navigation-panel][data-value="${t}"]`)}getTrigger(t){return this.querySelector(`[data-navigation-trigger][data-value="${t}"]`)}getPanels(){return Array.from(this.querySelectorAll("[data-navigation-panel]"))}getPanelFocusables(t){return hr(t)}focusPanelEntry(t){let i=this.getPanel(t);if(!i){this.getTrigger(t)?.focus();return}let r=this.getPanelFocusables(i);if(r.length>0){r[0].focus();return}i.hasAttribute("tabindex")||(i.tabIndex=-1),i.focus()}syncPanels(){for(let t of this.getPanels()){let i=t.getAttribute("data-value")??"",r=this.openValue===i;t.toggleAttribute("hidden",!r),t.dataset.state=r?"open":"closed",t.setAttribute("aria-hidden",String(!r));let l=this.getTrigger(i);l&&(l.setAttribute("aria-expanded",String(r)),t.setAttribute("role","region"),t.setAttribute("aria-labelledby",l.id||`${i}-trigger`),l.id||(l.id=`${i}-trigger`))}for(let t of this.getTriggers()){let i=t.getAttribute("data-value")??"",r=this.openValue===i;t.setAttribute("aria-expanded",String(r)),this.getPanel(i)?t.setAttribute("aria-haspopup","true"):t.removeAttribute("aria-haspopup")}}closeMenu(t=!1){let i=this.openValue;i&&(this.openValue=null,this.syncPanels(),t&&this.getTrigger(i)?.focus())}openPanel(t,i=!0){if(this.openValue===t){this.closeMenu(!0);return}this.openValue=t,this.syncPanels(),queueMicrotask(()=>{i?this.focusPanelEntry(t):this.getTrigger(t)?.focus()})}getEventElement(t){let i=t.target;return i instanceof Element?i:i instanceof Text?i.parentElement:null}isWithinOpenPanel(t){if(!this.openValue)return!1;let i=this.getPanel(this.openValue);return i?t.composedPath().some(r=>r instanceof Node&&i.contains(r)):!1}onDocumentClick(t){if(!this.openValue||this.isWithinOpenPanel(t))return;let i=this.getEventElement(t);i&&this.contains(i)||this.closeMenu()}onDocumentKeydown(t){if(t.key!=="Escape"||!this.openValue)return;let i=document.activeElement;i&&!this.contains(i)||(t.preventDefault(),this.closeMenu(!0))}onRootKeydown(t){t.key==="Escape"&&this.openValue&&(t.preventDefault(),this.closeMenu(!0))}onTriggerClick(t){let i=t.target.closest("[data-navigation-trigger]"),r=i?.getAttribute("data-value");!i||!r||(t.preventDefault(),this.openPanel(r))}onBarItemKeydown(t){let i=t.target.closest("[data-navigation-item]");if(!i||this.handleBarTriggerKeydown(t,i))return;let r=ct({items:this.getBarItems(),current:i,key:t.key,orientation:"horizontal",wrap:!1});r.handled&&(t.preventDefault(),this.syncMenuToBarItem(r.item))}handleBarTriggerKeydown(t,i){if(t.key==="Escape")return this.openValue&&(t.preventDefault(),this.closeMenu(!0)),!0;let r=i.getAttribute("data-value");return!this.isBarTrigger(i)||!r?!1:t.key==="Enter"||t.key===" "?(t.preventDefault(),this.openPanel(r),!0):t.key!=="ArrowDown"?!1:(t.preventDefault(),this.openValue===r?this.focusPanelEntry(r):this.openPanel(r),!0)}syncMenuToBarItem(t){if(!this.openValue)return;let i=t.getAttribute("data-value");this.isBarTrigger(t)&&i?this.openPanel(i):this.closeMenu(!1)}onPanelKeydown(t){let i=t.target;if(!(i instanceof Element))return;let r=i.closest("[data-navigation-panel]");if(!r||r.hidden)return;let l=r.getAttribute("data-value");if(!l||this.openValue!==l)return;let h=document.activeElement instanceof HTMLElement?document.activeElement:null;if(!h||!r.contains(h))return;if(t.key==="Escape"){t.preventDefault(),this.closeMenu(!0);return}let d=this.getPanelFocusables(r);if(t.key==="ArrowUp"&&h===d[0]){t.preventDefault(),this.getTrigger(l)?.focus();return}!d.length||!ct({items:d,current:h,key:t.key,orientation:"vertical",wrap:!1}).handled||t.preventDefault()}static{Jb()}};function gk({children:e,class:t,...i}){return Me("div",{...i,"data-ref":"bar",class:L("rui-navigation-menu__bar",t),children:e})}function bk({children:e,class:t,...i}){return Me("div",{...i,"data-ref":"panels",class:L("rui-navigation-menu__panels",t),children:e})}function vk({children:e,label:t,...i}){return Me("rui-navigation-menu",{...i,label:t,children:Me("nav",{class:"rui-navigation-menu","data-ref":"root","aria-label":t||void 0,children:e})})}function yk({children:e,value:t,variant:i="ghost",class:r,...l}){return Me(ne,{...l,variant:i,class:r,"data-navigation-item":!0,"data-navigation-trigger":!0,"data-value":t,children:e})}function _k({children:e,href:t,class:i,...r}){return Me("a",{...r,href:t,"data-navigation-item":!0,class:L("rui-button","rui-button--ghost","rui-button--md",i),children:e})}function xk({children:e,value:t,class:i,...r}){return Me("div",{...r,class:i,"data-navigation-panel":!0,"data-value":t,children:e})}import{RadiantElement as Gv,customElement as Ak,event as Ik,onEvent as je,onUpdated as Ck,prop as vt,state as Wv}from"@ecopages/radiant";function so(e,t){return new Intl.NumberFormat(e,t)}function lo(e,t,i){return Number.isFinite(e)?so(t,i).format(e):""}function uo(e,t,i){let r=e.trim();if(!r)return null;let h=so(t,i).formatToParts(1234.5),d=h.find(S=>S.type==="decimal")?.value??".",a=h.find(S=>S.type==="group")?.value??",",E=r.replaceAll(a,"").replace(d,".").replace(/[^\d.-]/g,""),A=Number(E);return Number.isFinite(A)?A:null}function co(e){if(e)try{let t=JSON.parse(e);return wk(t)?(new Intl.NumberFormat(void 0,t),t):void 0}catch{return}}function wk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ho(e,t,i,r){if(!Number.isFinite(e))return Number.isFinite(t)?t:0;if(!Number.isFinite(r)||r===0)return ov(e,t,i);let l=Number.isFinite(t)?t:0,h=Math.round((e-l)/r)*r+l;return ov(h,t,i)}function ov(e,t,i){let r=e;return Number.isFinite(t)&&(r=Math.max(t,r)),Number.isFinite(i)&&(r=Math.min(i,r)),r}var av,sv,lv,uv,cv,dv,hv,pv,fv,mv,gv,bv,vv,yv,_v,xv,wv,Sv,Tv,Ev,Rv,Av,Iv,Cv,Dv,Ov,kv,Vv,Mv,jv,Lv,Pv,Bv,Fv,Uv,zv,qv,Kv;function Sk(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:$v(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||$v(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:Tk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Rk(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function Tk(e){var t=Ek(e,"string");return typeof t=="symbol"?t:t+""}function Ek(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $v(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function Rk(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Yv,Hv=class extends Gv{static{({e:[lv,uv,cv,dv,hv,pv,fv,mv,gv,bv,vv,yv,_v,xv,wv,Sv,Tv,Ev,Rv,Av,Iv,Cv,Dv,Ov,kv,Vv,Mv,jv,Lv,Pv,Bv,Fv,Uv,zv,qv,Kv,av],c:[Yv,sv]}=Sk(this,[Ak("rui-number-field")],[[vt({type:Number,reflect:!0}),0,"value"],[vt({type:Number,attribute:"default-value"}),0,"defaultValue"],[vt({type:Number,attribute:"min-value",defaultValue:Number.NEGATIVE_INFINITY}),0,"minValue"],[vt({type:Number,attribute:"max-value",defaultValue:Number.POSITIVE_INFINITY}),0,"maxValue"],[vt({type:Number,defaultValue:1}),0,"step"],[vt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[vt({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[vt({type:String,defaultValue:""}),0,"label"],[vt({type:String,defaultValue:""}),0,"name"],[vt({type:String,defaultValue:""}),0,"locale"],[vt({type:String,attribute:"format-options",defaultValue:""}),0,"formatOptions"],[vt({type:String,attribute:"commit-behavior",defaultValue:"snap"}),0,"commitBehavior"],[vt({type:String,attribute:"increment-aria-label",defaultValue:""}),0,"incrementAriaLabel"],[vt({type:String,attribute:"decrement-aria-label",defaultValue:""}),0,"decrementAriaLabel"],[vt({type:Boolean,attribute:"wheel-disabled",defaultValue:!1}),0,"wheelDisabled"],[Ik({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Wv,0,"decreaseDisabled"],[Wv,0,"increaseDisabled"],[Ck(["value","defaultValue","minValue","maxValue","step","label","disabled","readOnly","locale","formatOptions","commitBehavior"]),2,"onPropsUpdated"],[je({selector:'[data-number-field-action="decrement"]',type:"click"}),2,"decrement"],[je({selector:'[data-number-field-action="increment"]',type:"click"}),2,"increment"],[je({selector:"[data-number-field-input]",type:"focus"}),2,"onInputFocus"],[je({selector:"[data-number-field-input]",type:"blur"}),2,"onInputBlur"],[je({selector:"[data-number-field-input]",type:"input"}),2,"onInput"],[je({selector:"[data-number-field-input]",type:"keydown"}),2,"onKeydown"],[je({selector:"[data-number-field-input]",type:"wheel"}),2,"onWheel"]],0,void 0,Gv))}value=(av(this),lv(this));defaultValue=(uv(this),cv(this));minValue=(dv(this),hv(this));maxValue=(pv(this),fv(this));step=(mv(this),gv(this));disabled=(bv(this),vv(this));readOnly=(yv(this),_v(this));label=(xv(this),wv(this));name=(Sv(this),Tv(this));locale=(Ev(this),Rv(this));formatOptions=(Av(this),Iv(this));commitBehavior=(Cv(this),Dv(this));incrementAriaLabel=(Ov(this),kv(this));decrementAriaLabel=(Vv(this),Mv(this));wheelDisabled=(jv(this),Lv(this));changeEvent=(Pv(this),Bv(this));decreaseDisabled=(Fv(this),Uv(this,!1));increaseDisabled=(zv(this),qv(this,!1));editing=(Kv(this),!1);draftValue="";initialized=!1;uid=Math.random().toString(36).slice(2,9);get resolvedLocale(){return Wt(this.locale)}get resolvedFormatOptions(){return co(this.formatOptions)}get inputId(){return`rui-number-field-input-${this.uid}`}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]")}getHiddenInput(){return this.querySelector("[data-number-field-value]")}syncLabel(){let t=this.getInput();Ht(this,t,{controlId:this.inputId,label:this.label,labelId:`rui-number-field-label-${this.uid}`})}syncInput(){let t=this.getInput(),i=this.getHiddenInput();if(!t)return;t.id||(t.id=this.inputId);let r=this.getNumericValue();t.setAttribute("role","spinbutton"),t.setAttribute("inputmode","decimal"),t.toggleAttribute("data-disabled",this.disabled),t.toggleAttribute("data-readonly",this.readOnly),Number.isFinite(this.minValue)?t.setAttribute("aria-valuemin",String(this.minValue)):t.removeAttribute("aria-valuemin"),Number.isFinite(this.maxValue)?t.setAttribute("aria-valuemax",String(this.maxValue)):t.removeAttribute("aria-valuemax"),t.setAttribute("aria-valuenow",String(r)),this.editing||(t.value=lo(r,this.resolvedLocale,this.resolvedFormatOptions)),i&&(i.value=String(r),this.name&&(i.name=this.name),i.disabled=this.disabled)}updateStepperState(){let t=this.getNumericValue();this.decreaseDisabled=this.disabled||this.readOnly||t<=this.minValue,this.increaseDisabled=this.disabled||this.readOnly||t>=this.maxValue,queueMicrotask(()=>this.syncSlottedSteppers())}syncSlottedSteppers(){let t=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",t)}commitValue(t,i=!1){let r=t;if((this.commitBehavior==="snap"||i)&&(r=ho(t,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 t=uo(this.draftValue,this.resolvedLocale,this.resolvedFormatOptions);if(t==null){this.editing=!1,this.syncInput();return}if(this.commitBehavior==="validate"&&(t<this.minValue||t>this.maxValue)){this.editing=!1,this.syncInput();return}this.commitValue(t)}initialize(){this.initialized||(this.initialized=!0,this.value==null&&this.defaultValue!=null&&(this.value=this.defaultValue),this.syncLabel(),this.syncInput(),this.updateStepperState())}onConnected(){this.initialize()}onPropsUpdated(){this.syncLabel(),this.syncInput(),this.updateStepperState()}decrement(t){t.preventDefault(),!this.decreaseDisabled&&this.commitValue(this.getNumericValue()-this.step,!0)}increment(t){t.preventDefault(),!this.increaseDisabled&&this.commitValue(this.getNumericValue()+this.step,!0)}onInputFocus(t){if(this.disabled||this.readOnly)return;let i=t.target;this.editing=!0,this.draftValue=String(this.getNumericValue()),i.value=this.draftValue,i.select()}onInputBlur(){this.editing&&this.commitDraft()}onInput(t){this.disabled||this.readOnly||(this.editing=!0,this.draftValue=t.target.value)}onKeydown(t){if(!(this.disabled||this.readOnly)){if(t.key==="ArrowUp"){t.preventDefault(),this.increment(t);return}if(t.key==="ArrowDown"){t.preventDefault(),this.decrement(t);return}if(t.key==="Home"&&Number.isFinite(this.minValue)){t.preventDefault(),this.commitValue(this.minValue,!0);return}if(t.key==="End"&&Number.isFinite(this.maxValue)){t.preventDefault(),this.commitValue(this.maxValue,!0);return}t.key==="Enter"&&(t.preventDefault(),this.commitDraft(),this.getInput()?.blur())}}onWheel(t){if(this.wheelDisabled||this.disabled||this.readOnly)return;let i=t.target;document.activeElement===i&&(t.preventDefault(),t.deltaY<0?this.increment(t):t.deltaY>0&&this.decrement(t))}static{sv()}};import{jsx as kt,jsxs as Xv}from"@ecopages/jsx/jsx-runtime";function Nv({children:e,class:t,...i}){return kt("div",{...i,"data-number-field-group":!0,class:L("rui-number-field__group",t),children:e})}function Qv({class:e,disabled:t,readOnly:i,...r}){return kt("input",{...r,type:"text","data-number-field-input":!0,"data-rui-control":!0,"data-rui-control-type":"number",class:L("rui-number-field__input",e),disabled:t,readOnly:i})}function Jv({children:e,class:t,...i}){return kt("div",{...i,class:L("rui-number-field__steppers",t),children:e})}function Zv({children:e,class:t,aria:i,disabled:r,...l}){return kt("button",{...l,aria:nt(i,"Increment"),type:"button","data-number-field-action":"increment",class:L("rui-number-field__stepper",t),disabled:r,tabIndex:-1,children:e??"+"})}function ty({children:e,class:t,aria:i,disabled:r,...l}){return kt("button",{...l,aria:nt(i,"Decrement"),type:"button","data-number-field-action":"decrement",class:L("rui-number-field__stepper",t),disabled:r,tabIndex:-1,children:e??"\u2212"})}function Dk(){return Xv(Nv,{children:[kt(Qv,{}),kt("input",{type:"hidden","data-number-field-value":!0}),Xv(Jv,{children:[kt(ty,{}),kt(Zv,{})]})]})}function Ok({children:e,...t}){return kt("rui-number-field",{...t,children:kt("div",{class:"rui-number-field","data-ref":"root",children:e??kt(Dk,{})})})}import{jsx as Vt,jsxs as Pr}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as gy,customElement as Lk,event as Pk,onEvent as Bk,prop as Li}from"@ecopages/radiant";var ey,iy,ry,ny,oy,ay,sy,ly,uy,cy,dy,hy,py,fy;function kk(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:my(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||my(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:Vk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return jk(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function Vk(e){var t=Mk(e,"string");return typeof t=="symbol"?t:t+""}function Mk(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function my(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function jk(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var po="Pagination";function Lr(e,t){return Math.min(Math.max(1,Math.floor(e)||1),t)}var vy,by=class extends gy{static{({e:[ry,ny,oy,ay,sy,ly,uy,cy,dy,hy,py,fy,ey],c:[vy,iy]}=kk(this,[Lk("rui-pagination")],[[Li({type:String,defaultValue:po}),0,"label"],[Li({type:Number,reflect:!0,defaultValue:1}),0,"page"],[Li({type:Number,attribute:"page-count",defaultValue:1}),0,"pageCount"],[Li({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Li({type:Number,attribute:"sibling-count",defaultValue:1}),0,"siblingCount"],[Pk({name:"rui-page-change",bubbles:!0,composed:!0}),0,"pageChangeEvent"],[Bk({selector:"[data-pagination-page]",type:"click"}),2,"onPageClick"]],0,void 0,gy))}constructor(...t){super(...t),fy(this)}label=(ey(this),ry(this));page=(ny(this),oy(this));pageCount=(ay(this),sy(this));disabled=(ly(this),uy(this));siblingCount=(cy(this),dy(this));pageChangeEvent=(hy(this),py(this));changePage(t){if(this.disabled)return;let i=Lr(t,Math.max(1,Math.floor(this.pageCount)||1));i!==this.page&&this.pageChangeEvent.emit({page:i})}onPageClick(t){let i=t.target.closest("[data-pagination-page]"),r=Number(i?.getAttribute("data-pagination-page"));Number.isInteger(r)&&this.changePage(r)}static{iy()}};function Fk(e,t,i){let r=i*2+5;if(t<=r)return Array.from({length:t},(a,E)=>E+1);let l=Math.max(2,e-i),h=Math.min(t-1,e+i),d=[1];l>2&&d.push("start-ellipsis");for(let a=l;a<=h;a+=1)d.push(a);return h<t-1&&d.push("end-ellipsis"),d.push(t),d}function yy({label:e,page:t,pageCount:i,disabled:r=!1,siblingCount:l=1}){let h=Math.max(1,Math.floor(i)||1),d=Lr(t,h),a=Math.max(0,Math.floor(l)||0),E=Fk(d,h,a);return Vt("nav",{class:"rui-pagination__nav","aria-label":e,children:Pr("ul",{class:"rui-pagination__list",children:[Vt("li",{children:Pr(ne,{variant:"ghost",size:"sm",class:"rui-pagination__link rui-pagination__link--previous","data-pagination-page":d-1,"aria-label":"Go to previous page",disabled:r||d<=1,children:[Vt(Xr,{}),Vt("span",{children:"Previous"})]})}),E.map(A=>typeof A=="number"?Vt("li",{class:L("rui-pagination__page",A===d&&"rui-pagination__page--current"),children:Vt(ne,{variant:A===d?"filled":"ghost",size:"sm",square:!0,class:"rui-pagination__link","data-pagination-page":A,"aria-label":`Go to page ${A}`,"aria-current":A===d?"page":void 0,disabled:r,children:A})},A):Vt("li",{class:"rui-pagination__ellipsis","aria-hidden":"true",children:"\u2026"},A)),Pr("li",{class:"rui-pagination__status",children:[d," / ",h]}),Vt("li",{children:Pr(ne,{variant:"ghost",size:"sm",class:"rui-pagination__link rui-pagination__link--next","data-pagination-page":d+1,"aria-label":"Go to next page",disabled:r||d>=h,children:[Vt("span",{children:"Next"}),Vt(Nr,{})]})})]})})}function Uk({children:e,label:t=po,page:i=1,pageCount:r=1,disabled:l=!1,siblingCount:h=1,class:d,...a}){let E=Math.max(1,Math.floor(r)||1),A=Lr(i,E),S=Math.max(0,Math.floor(h)||0);return Vt("rui-pagination",{...a,class:L("rui-pagination",d),label:t,page:A,pageCount:E,disabled:l,siblingCount:S,children:e??Vt(yy,{label:t,page:A,pageCount:E,disabled:l,siblingCount:S})})}import{jsx as ni,jsxs as i_}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Br,bound as mo,customElement as Jy,event as $k,onEvent as Pi,onUpdated as Zy,prop as _e,query as go}from"@ecopages/radiant";import{isServer as Gk}from"@ecopages/radiant/is-server";var _y,xy,wy,Sy,Ty,Ey,Ry,Ay,Iy,Cy,Dy,Oy,ky,Vy,My,jy,Ly,Py,By,Fy,Uy,zy,qy,Ky,$y,Gy,Wy,Hy;function Qy(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Yy(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Yy(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:zk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Kk(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function zk(e){var t=qk(e,"string");return typeof t=="symbol"?t:t+""}function qk(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yy(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function Kk(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var t_,Xy=class extends Br{static{({e:[wy,Sy,Ty,Ey,Ry,Ay,Iy,Cy,Dy,Oy,ky,Vy,My,jy,Ly,Py,By,Fy,Uy,zy,_y],c:[t_,xy]}=Qy(this,[Jy("rui-popover")],[[_e({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[_e({type:String,defaultValue:"bottom"}),0,"placement"],[_e({type:Boolean,defaultValue:!0}),0,"portal"],[_e({type:Boolean,defaultValue:!1}),0,"matchAnchorWidth"],[_e({type:Number,defaultValue:8}),0,"offset"],[_e({type:String,defaultValue:""}),0,"anchor"],[_e({type:String,defaultValue:"default"}),0,"variant"],[go({ref:"surface"}),0,"surfaceTarget"],[go({ref:"host"}),0,"hostTarget"],[$k({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[mo,Zy(["open","placement","portal","matchAnchorWidth","offset","anchor"])],2,"syncPopover"],[Pi({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[Pi({ref:"host",type:"focusout"}),2,"onFocusOut"],[mo,2,"onExternalAnchorClick"],[Pi({document:!0,type:"keydown"}),2,"onDocumentKeydown"]],0,void 0,Br))}open=(_y(this),wy(this));placement=(Sy(this),Ty(this));portal=(Ey(this),Ry(this));matchAnchorWidth=(Ay(this),Iy(this));offset=(Cy(this),Dy(this));anchor=(Oy(this),ky(this));variant=(Vy(this),My(this));surfaceTarget=(jy(this),Ly(this));hostTarget=(Py(this),By(this));openChangeEvent=(Fy(this),Uy(this));surfaceId=(zy(this),`rui-popover-${Math.random().toString(36).slice(2,9)}`);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 fo(i);let r=this.querySelector("[data-popover-trigger]");if(r instanceof HTMLElement)return fo(r);let l=this.anchor.trim();if(l){let h=document.querySelector(l);if(h instanceof HTMLElement)return fo(h)}return null}ensureController(){return this.controller||(this.controller=new ut({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 t=this.getAnchorElement(),i=this.surfaceTarget;i&&(i.id=this.surfaceId),t&&(t.setAttribute("aria-controls",this.surfaceId),t.setAttribute("aria-expanded",String(this.open))),this.syncExternalAnchorClick(t);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(t,i=!0){if(this.open===t){this.syncPopover();return}this.open=t,i&&this.openChangeEvent.emit({open:t}),this.syncPopover()}onDocumentPointerDown(t){if(!this.open)return;let i=t.target;he(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,i)&&this.setOpen(!1)}onFocusOut(t){this.open&&zt(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,t.relatedTarget)&&this.setOpen(!1)}usesExternalAnchor(){return!this.anchor.trim()||this.closest("rui-popover-trigger")?!1:!this.querySelector("[data-popover-trigger]")}syncExternalAnchorClick(t){if(!this.usesExternalAnchor()||!t){this.unbindExternalAnchorClick();return}this.anchorClickTarget!==t&&(this.unbindExternalAnchorClick(),t.addEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=t)}unbindExternalAnchorClick(){this.anchorClickTarget&&(this.anchorClickTarget.removeEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=null)}onExternalAnchorClick(){this.setOpen(!this.open)}onDocumentKeydown(t){if(!this.open||t.key!=="Escape")return;t.preventDefault(),this.setOpen(!1),this.getAnchorElement()?.focus()}static{xy()}};var e_,Ny=class extends Br{static{({e:[$y,Gy,Wy,Hy,qy],c:[e_,Ky]}=Qy(this,[Jy("rui-popover-trigger")],[[_e({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[go({ref:"root"}),0,"rootTarget"],[[mo,Zy(["open"])],2,"syncToPopover"],[Pi({ref:"root",type:"click"}),2,"onHostClick"],[Pi({selector:"rui-popover",type:"rui-open-change"}),2,"onPopoverOpenChange"]],0,void 0,Br))}constructor(...t){super(...t),Hy(this)}open=(qy(this),$y(this));rootTarget=(Gy(this),Wy(this));getPopover(){return this.querySelector("rui-popover")}onConnected(){this.syncToPopover()}syncToPopover(){if(Gk)return;let t=this.getPopover();!t||typeof t.setOpen!="function"||t.open!==this.open&&t.setOpen(this.open,!1)}onHostClick(t){if(!t.target?.closest("[data-popover-trigger]"))return;this.open=!this.open;let r=this.getPopover();r&&typeof r.setOpen=="function"&&r.setOpen(this.open)}onPopoverOpenChange(t){let i=this.getPopover();t.target===i&&(this.open=t.detail.open)}static{Ky()}};function fo(e){return e.querySelector('button, a[href], input, select, textarea, [role="button"]')??e}function Wk({children:e,class:t,...i}){return ni("div",{...i,class:L(t),children:e})}function Hk({trigger:e,children:t,variant:i="default",...r}){let l=i==="listbox"?"rui-popover--listbox":"";return ni("rui-popover",{...r,variant:i,children:i_("div",{class:"rui-popover-host","data-ref":"host",children:[e!=null?ni("span",{"data-popover-trigger":!0,children:e}):null,ni("div",{"data-ref":"surface",class:`rui-popover rui-floating ${l}`.trim(),role:"dialog",children:t})]})})}function Yk({trigger:e,children:t,...i}){return ni("rui-popover-trigger",{...i,children:i_("div",{class:"rui-popover-trigger","data-ref":"root",children:[ni("span",{"data-popover-trigger":!0,children:e}),t]})})}import{RadiantElement as g_,customElement as Zk,event as tV,onEvent as eV,onUpdated as iV,prop as Fr}from"@ecopages/radiant";var r_,n_,o_,a_,s_,l_,u_,c_,d_,h_,p_,f_;function Xk(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:m_(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||m_(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:Nk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Jk(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function Nk(e){var t=Qk(e,"string");return typeof t=="symbol"?t:t+""}function Qk(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m_(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function Jk(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var v_,b_=class extends g_{static{({e:[o_,a_,s_,l_,u_,c_,d_,h_,p_,f_,r_],c:[v_,n_]}=Xk(this,[Zk("rui-radio-group")],[[Fr({type:String,reflect:!0,defaultValue:""}),0,"value"],[Fr({type:String,defaultValue:""}),0,"name"],[Fr({type:String,defaultValue:""}),0,"label"],[Fr({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[tV({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[iV(["value","name","label","disabled"]),2,"syncRadios"],[eV({selector:'input[type="radio"]',type:"change"}),2,"onRadioChange"]],0,void 0,g_))}constructor(...t){super(...t),f_(this)}value=(r_(this),o_(this));name=(a_(this),s_(this));label=(l_(this),u_(this));disabled=(c_(this),d_(this));changeEvent=(h_(this),p_(this));onConnected(){this.syncRadios()}syncRadios(){let t=this.querySelector("[data-radio-group-root]");t&&(this.label?t.setAttribute("aria-label",this.label):t.removeAttribute("aria-label"),this.disabled?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled"));let i=this.querySelectorAll('input[type="radio"]'),r=this.name||this.getAttribute("name")||"rui-radio-group";for(let l of i)l.name=r,l.disabled=this.disabled||l.hasAttribute("data-disabled"),l.checked=this.value!==""&&l.value===this.value}onRadioChange(t){let i=t.target;i.checked&&(this.value=i.value,this.changeEvent.emit({value:this.value}))}static{n_()}};import{jsx as Le,jsxs as rV}from"@ecopages/jsx/jsx-runtime";function y_({children:e,class:t,...i}){return Le("div",{...i,"data-radio-group-root":!0,class:L("rui-radio-group",t),role:"radiogroup","data-rui-control":!0,"data-rui-control-type":"text",children:e})}function __({children:e,value:t,name:i,disabled:r,class:l,...h}){return rV("label",{...h,class:L("rui-radio",l),children:[Le("input",{type:"radio",class:"rui-radio__input",value:t,name:i,disabled:r,"data-disabled":r?"":void 0}),Le("span",{class:"rui-radio__control","aria-hidden":"true"}),Le("span",{class:"rui-radio__label",children:e})]})}function nV({options:e,children:t,...i}){return Le("rui-radio-group",{...i,children:e==null?t:Le(y_,{children:e.map(r=>Le(__,{value:r.value,disabled:r.disabled,children:r.label}))})})}import{RadiantElement as U_,customElement as uV,event as cV,onEvent as Mt,onUpdated as dV,prop as oi,query as hV}from"@ecopages/radiant";var x_,w_,S_,T_,E_,R_,A_,I_,C_,D_,O_,k_,V_,M_,j_,L_,P_,B_;function oV(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:F_(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||F_(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:aV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return lV(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function aV(e){var t=sV(e,"string");return typeof t=="symbol"?t:t+""}function sV(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F_(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function lV(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var q_,z_=class extends U_{static{({e:[S_,T_,E_,R_,A_,I_,C_,D_,O_,k_,V_,M_,j_,L_,P_,B_,x_],c:[q_,w_]}=oV(this,[uV("rui-select")],[[oi({type:String,reflect:!0,defaultValue:""}),0,"value"],[oi({type:String,defaultValue:""}),0,"label"],[oi({type:String,defaultValue:""}),0,"placeholder"],[oi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[oi({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[oi({type:Boolean,attribute:"should-close-on-select"}),0,"shouldCloseOnSelect"],[cV({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[hV({ref:"root"}),0,"rootTarget"],[dV(["value","label","placeholder","disabled","selectionMode","shouldCloseOnSelect"]),2,"onPropsUpdated"],[Mt({selector:"[data-select-trigger], [data-select-toggle]",type:"click"}),2,"onTriggerClick"],[Mt({selector:"[data-select-trigger]",type:"keydown",options:{capture:!0}}),2,"onTriggerKeydown"],[Mt({selector:"[data-select-listbox] [data-autocomplete-input]",type:"keydown",options:{capture:!0}}),2,"onSearchKeydown"],[Mt({selector:"[data-select-listbox] [data-autocomplete-input]",type:"input"}),2,"onSearchInput"],[Mt({selector:"[data-select-value] rui-tag-group",type:"rui-remove"}),2,"onTagRemove"],[Mt({selector:"[data-select-clear]",type:"click"}),2,"onClearClick"],[Mt({selector:"[data-select-value] [data-tag]",type:"click"}),2,"onTagClick"],[Mt({selector:'[data-select-listbox] [role="option"]',type:"pointerover"}),2,"onOptionPointerOver"],[Mt({selector:'[data-select-listbox] [role="option"]',type:"mousedown"}),2,"onOptionMouseDown"],[Mt({selector:'[data-select-listbox] [role="option"]',type:"click"}),2,"onOptionClick"],[Mt({ref:"root",type:"focusout"}),2,"onFocusOut"],[Mt({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"]],0,void 0,U_))}constructor(...t){super(...t),B_(this)}value=(x_(this),S_(this));label=(T_(this),E_(this));placeholder=(R_(this),A_(this));disabled=(I_(this),C_(this));selectionMode=(D_(this),O_(this));shouldCloseOnSelect=(k_(this),V_(this));changeEvent=(M_(this),j_(this));open=(L_(this),!1);uid=Math.random().toString(36).slice(2,9);collection=new Ke({getRoot:()=>this,getSelectionMode:()=>this.selectionMode,getValue:()=>this.value,setValue:t=>{this.value=t},getPopup:()=>this.getListboxPopup(),tagGroupSelector:"[data-select-value] rui-tag-group"});listboxBehavior=new $e({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.collection.getOptions(),getActiveDescendantHost:()=>this.getActiveDescendantHost(),getOptionIdPrefix:()=>`rui-select-option-${this.uid}`});rootTarget=P_(this);get listboxId(){return`rui-select-list-${this.uid}`}get triggerId(){return`rui-select-trigger-${this.uid}`}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 t=this.getSearchInput();!t||t.value===""||(t.value="",t.dispatchEvent(new Event("input",{bubbles:!0})))}syncSearchInput(){let t=this.getSearchInput(),i=this.getTrigger(),r=this.collection.getListbox();if(!(!t||!r||!i)){if(this.open){t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-expanded","true"),t.setAttribute("aria-controls",this.listboxId),i.removeAttribute("aria-activedescendant");return}t.removeAttribute("role"),t.removeAttribute("aria-autocomplete"),t.removeAttribute("aria-expanded"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-activedescendant")}}focusPopupInput(){queueMicrotask(()=>{this.getSearchInput()?.focus()})}hasTagGroup(){return this.collection.getTagGroup()!=null}syncTagGroup(){let t=this.getValueElement();this.collection.syncTagGroup(),!(!t||!this.hasTagGroup())&&this.syncTagGroupPlaceholder(t,this.collection.getSelectedValues().length)}syncTagGroupPlaceholder(t,i){let r=t.querySelector("[data-select-placeholder]");if(!this.placeholder){r?.remove();return}r||(r=document.createElement("span"),r.setAttribute("data-select-placeholder","true"),t.insertBefore(r,t.firstChild)),r.textContent=this.placeholder,r.hidden=i>0,t.toggleAttribute("data-placeholder",i===0)}removeSelectedValue(t){this.collection.removeValue(t)&&(this.syncValueDisplay(),this.collection.syncOptionSelection(),this.syncTagGroup(),this.syncClear(),this.changeEvent.emit({value:this.value}))}clearSelection(){this.collection.clearValues()&&(this.syncValueDisplay(),this.collection.syncOptionSelection(),this.syncTagGroup(),this.syncClear(),this.changeEvent.emit({value:""}),this.getTrigger()?.focus())}getTrigger(){return this.querySelector("[data-select-trigger]")}getToggle(){return this.querySelector("[data-select-toggle]")}getClear(){return this.querySelector("[data-select-clear]")}getValueElement(){return this.querySelector("[data-select-value]")}getListboxPopup(){return this.querySelector("[data-select-listbox]")}ensureOptionIds(){this.listboxBehavior.ensureOptionIds()}getAccessibleName(){return _i(this)?.textContent?.trim()||this.label||"Options"}syncLabel(){let t=this.getTrigger();Ht(this,t,{controlId:this.triggerId,label:this.label,labelId:`rui-select-label-${this.uid}`})}syncTrigger(){let t=this.getTrigger(),i=this.collection.getListbox(),r=this.getListboxPopup();!t||!i||(t.id||(t.id=this.triggerId),i.id||(i.id=this.listboxId),t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","listbox"),t.setAttribute("aria-autocomplete","none"),t.setAttribute("aria-expanded",String(this.open)),t.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.disabled&&(t.disabled=!0),this.syncToggle(),this.syncClear(),this.syncSearchInput())}syncClear(){let t=this.getClear();t&&(t.hidden=this.collection.getSelectedValues().length===0,t.disabled=this.disabled)}syncToggle(){let t=this.getToggle();t&&(t.setAttribute("aria-expanded",String(this.open)),t.disabled=this.disabled)}syncValueDisplay(){if(this.hasTagGroup()){this.syncTagGroup();return}let t=this.getValueElement();if(!t||t.childElementCount>0)return;let i=this.collection.getSelectedValues();if(i.length===0){t.textContent="",t.toggleAttribute("data-placeholder",!0),this.placeholder&&(t.textContent=this.placeholder);return}if(t.toggleAttribute("data-placeholder",!1),this.isMultiple()){t.textContent=i.map(r=>this.collection.labelForValue(r)).join(", ");return}t.textContent=this.collection.labelForValue(i[0])}setOpen(t,i={}){let r=i.activate??"none";this.open=t;let l=this.getTrigger(),h=this.getListboxPopup();if(!(!l||!h)){if(l.setAttribute("aria-expanded",String(t)),h.toggleAttribute("hidden",!t),!t){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 d=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(d.length?0:-1);return}if(r==="last"){let d=this.listboxBehavior.getVisibleOptions();this.listboxBehavior.setActiveOption(d.length?d.length-1:-1);return}this.listboxBehavior.clearActiveOption()}}selectOption(t){this.collection.isSelectableOption(t)&&(this.collection.toggleValue(Ct(t)),this.syncValueDisplay(),this.collection.syncOptionSelection(),this.syncClear(),this.changeEvent.emit({value:this.value}),this.closesOnSelect()&&(this.resetSearchFilter(),this.setOpen(!1),this.getTrigger()?.focus()))}handleListboxKeydown(t){this.listboxBehavior.handleKeydown(t,{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(t){this.handleListboxKeydown(t)}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()}onTriggerClick(t){t.preventDefault();let i=this.getTrigger();if(!(!i||i.disabled)){if(this.open?this.setOpen(!1):this.setOpen(!0),this.open&&this.hasSearchInput()){this.focusPopupInput();return}i.focus()}}onTriggerKeydown(t){this.handleTriggerKeydown(t)}onSearchKeydown(t){this.handleListboxKeydown(t)}onSearchInput(){this.open&&this.listboxBehavior.clearActiveOption()}onTagRemove(t){let i=t.detail;i?.value&&this.removeSelectedValue(i.value)}onClearClick(t){t.preventDefault(),t.stopPropagation(),this.clearSelection()}onTagClick(t){t.target.closest("[data-tag-remove]")||t.stopPropagation()}onOptionPointerOver(t){if(!this.open)return;let i=this.collection.findOption(t.target);if(!this.collection.isSelectableOption(i))return;let l=this.listboxBehavior.getVisibleOptions().indexOf(i);l>=0&&this.listboxBehavior.setActiveOption(l)}onOptionMouseDown(t){t.preventDefault()}onOptionClick(t){let i=this.collection.findOption(t.target);i&&this.selectOption(i)}onFocusOut(t){this.listboxBehavior.shouldDismissFocus(t.relatedTarget)&&this.setOpen(!1)}onDocumentPointerDown(t){this.open&&this.listboxBehavior.shouldDismissPointer(t.target)&&this.setOpen(!1)}static{w_()}};import{Fragment as pV,jsx as dt,jsxs as K_}from"@ecopages/jsx/jsx-runtime";function Bi(e,...t){let i={...e};for(let r of t)delete i[r];return i}function $_({children:e,class:t,...i}){return dt("div",{...i,class:L("rui-select__control",t),children:e})}function G_({children:e,class:t,disabled:i,...r}){return dt("button",{...Bi(r,"attr:type"),type:"button","data-select-trigger":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:L("rui-select__trigger",t),disabled:i,children:e})}function W_({children:e,class:t,aria:i,disabled:r,...l}){return dt("button",{...l,aria:nt(i,"Show options"),type:"button","data-select-toggle":!0,class:L("rui-control-toggle",t),disabled:r,tabIndex:-1,children:e??dt(we,{})})}function fV({children:e,class:t,aria:i,disabled:r,...l}){return dt("button",{...l,aria:nt(i,"Clear selection"),type:"button","data-select-clear":!0,class:L("rui-control-clear",t),disabled:r,children:e??dt(Rt,{})})}function H_({children:e,class:t,...i}){return dt("span",{...i,"data-select-value":!0,class:L("rui-select__value",t),children:e})}function Y_({children:e,class:t,...i}){return dt("div",{...i,"data-select-listbox":!0,class:L("rui-select__listbox rui-popover rui-popover--listbox rui-floating",t),children:e})}function mV({placeholder:e,class:t,disabled:i,...r}){return dt("input",{...r,type:"search","data-autocomplete-input":!0,class:L("rui-select__search",t),placeholder:e,disabled:i,autocomplete:"off"})}function gV(e,t,i){let r=Ae(t)[0]??"",l=typeof i=="string"?i:"";if(!r)return l;let h=e?.find(d=>d.value===r);return h&&typeof h.label=="string"?h.label:r}function bV({children:e}){return dt("div",{class:"rui-select","data-ref":"root",children:e})}function vV({options:e,children:t,value:i,...r}){let l=de(i),h=Ae(i),d=r.selectionMode==="multiple",a=e!=null?gV(e,i,r.placeholder):"",E=e?.filter(A=>h.includes(A.value)).map(A=>({value:A.value,label:A.label}));return dt("rui-select",{...r,value:l,children:dt(bV,{children:e==null?t:K_(pV,{children:[K_($_,{children:[dt(G_,{children:dt(H_,{children:d?dt(wi,{tags:E??[],label:"Selected options"}):a})}),dt(W_,{})]}),dt(Y_,{children:dt(He,{embedded:!0,options:e,selectionMode:r.selectionMode,value:l})})]})})})}import{RadiantElement as Yx,bound as Xx,customElement as SV,event as bo,onEvent as Fi,onUpdated as vo,prop as ft,query as zr,state as TV}from"@ecopages/radiant";import{isServer as EV}from"@ecopages/radiant/is-server";function Ur(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}var X_,N_,Q_,J_,Z_,tx,ex,ix,rx,nx,ox,ax,sx,lx,ux,cx,dx,hx,px,fx,mx,gx,bx,vx,yx,_x,xx,wx,Sx,Tx,Ex,Rx,Ax,Ix,Cx,Dx,Ox,kx,Vx,Mx,jx,Lx,Px,Bx,Fx,Ux,zx,qx,Kx,$x,Gx,Wx;function yV(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Hx(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Hx(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.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)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function _V(e){var t=xV(e,"string");return typeof t=="symbol"?t:t+""}function xV(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hx(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function wV(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var RV=256,AV=48,IV=200,CV=480,DV=768,OV="b",Nx=8,Qx=32,Jx='[data-ref="menu-button"]';function kV(e){return e.metaKey||e.ctrlKey}function VV(){return typeof window<"u"&&typeof window.matchMedia=="function"}function qr(e){return e==="left"||e==="right"}var t0,Zx=class extends Yx{static{({e:[Q_,J_,Z_,tx,ex,ix,rx,nx,ox,ax,sx,lx,ux,cx,dx,hx,px,fx,mx,gx,bx,vx,yx,_x,xx,wx,Sx,Tx,Ex,Rx,Ax,Ix,Cx,Dx,Ox,kx,Vx,Mx,jx,Lx,Px,Bx,Fx,Ux,zx,qx,Kx,$x,Gx,Wx,X_],c:[t0,N_]}=yV(this,[SV("rui-sidebar")],[[ft({type:String,reflect:!0,defaultValue:"sidebar"}),0,"variant"],[ft({type:String,reflect:!0,defaultValue:"left"}),0,"side"],[ft({type:String,reflect:!0,defaultValue:"off"}),0,"collapsible"],[ft({type:Number,defaultValue:RV}),0,"defaultWidth"],[ft({type:Number,reflect:!0,attribute:"width"}),0,"width"],[ft({type:Number,defaultValue:IV}),0,"minWidth"],[ft({type:Number,defaultValue:CV}),0,"maxWidth"],[ft({type:Boolean,defaultValue:!1}),0,"resizable"],[ft({type:Boolean,defaultValue:!0}),0,"defaultOpen"],[ft({type:Boolean,defaultValue:!1}),0,"mobileDefaultOpen"],[ft({type:Boolean,attribute:"open"}),0,"open"],[ft({type:Number,defaultValue:DV}),0,"mobileBreakpoint"],[ft({type:String,defaultValue:"Sidebar"}),0,"label"],[ft({type:Boolean,reflect:!0,attribute:"match-active"}),0,"matchActive"],[ft({type:String,defaultValue:"pathname"}),0,"matchMode"],[ft({type:Boolean,attribute:"scroll-active-on-mount"}),0,"scrollActiveOnMount"],[ft({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[zr({ref:"root"}),0,"rootTarget"],[zr({ref:"pane"}),0,"paneTarget"],[zr({ref:"handle"}),0,"handleTarget"],[zr({ref:"scrim"}),0,"scrimTarget"],[bo({name:"rui-sidebar-toggle",bubbles:!0,composed:!0}),0,"toggleEvent"],[bo({name:"rui-sidebar-resize",bubbles:!0,composed:!0}),0,"resizeEvent"],[bo({name:"rui-sidebar-mobile-change",bubbles:!0,composed:!0}),0,"mobileChangeEvent"],[TV,0,"isMobile"],[vo(["open","collapsible","variant","side","width","defaultWidth","defaultOpen","minWidth","maxWidth","isMobile","resizable","label"]),2,"onStateUpdated"],[vo(["mobileBreakpoint"]),2,"onMobileBreakpointUpdated"],[vo(["matchActive","matchMode","navigationEvents"]),2,"onMatchSettingsUpdated"],[Xx,2,"onPointerMove"],[Xx,2,"onPointerUp"],[Fi({ref:"handle",type:"pointerdown"}),2,"onHandlePointerDown"],[Fi({ref:"handle",type:"keydown"}),2,"onHandleKeydown"],[Fi({ref:"scrim",type:"click"}),2,"onScrimClick"],[Fi({selector:Jx,type:"click"}),2,"onMenuLinkClick"],[Fi({document:!0,type:"keydown"}),2,"onHostKeydown"]],0,void 0,Yx))}variant=(X_(this),Q_(this));side=(J_(this),Z_(this));collapsible=(tx(this),ex(this));defaultWidth=(ix(this),rx(this));width=(nx(this),ox(this));minWidth=(ax(this),sx(this));maxWidth=(lx(this),ux(this));resizable=(cx(this),dx(this));defaultOpen=(hx(this),px(this));mobileDefaultOpen=(fx(this),mx(this));open=(gx(this),bx(this));mobileBreakpoint=(vx(this),yx(this));label=(_x(this),xx(this));matchActive=(wx(this),Sx(this,!1));matchMode=(Tx(this),Ex(this));scrollActiveOnMount=(Rx(this),Ax(this,!1));navigationEvents=(Ix(this),Cx(this,""));rootTarget=(Dx(this),Ox(this));paneTarget=(kx(this),Vx(this));handleTarget=(Mx(this),jx(this));scrimTarget=(Lx(this),Px(this));toggleEvent=(Bx(this),Fx(this));resizeEvent=(Ux(this),zx(this));mobileChangeEvent=(qx(this),Kx(this));isMobile=($x(this),Gx(this,!1));mediaQuery=(Wx(this),null);mediaListener=t=>this.setMobile(t.matches);dragging=!1;dragStartCoord=0;dragStartSize=0;navigationCleanups=[];didScrollActiveOnMount=!1;openControlled=!1;mobileReady=!1;connectedCallback(){super.connectedCallback(),this.ensureWidthInitialized(),this.setAttribute("role","complementary"),this.setAttribute("aria-label",this.label),this.syncPresentation(),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.syncActiveLinksAfterRender(!0),this.mobileReady=!0}hydrate(){super.hydrate(),this.syncActiveLinksAfterRender(!0)}update(){super.update(),this.syncActiveLinksAfterRender(!1)}requestUpdate(){super.requestUpdate(),queueMicrotask(()=>{this.syncActiveLinksAfterRender(!1)})}disconnectedCallback(){this.endDrag(),this.unbindMobileMediaQuery(),this.detachNavigationListeners(),this.mobileReady=!1,super.disconnectedCallback()}syncActiveLinksAfterRender(t){let i=t&&this.scrollActiveOnMount&&!this.didScrollActiveOnMount;this.syncActiveLinks(i),i&&(this.didScrollActiveOnMount=!0)}syncPresentation(){let t=qr(this.side),i=this.isOpen(),r=i?"expanded":"collapsed",l=this.resizable&&this.collapsible==="off"&&i&&!this.isMobile,h=!(i||!this.isMobile&&this.collapsible==="icon"),d=this.paneWidth();this.setAttribute("data-state",r),this.setAttribute("data-collapsible",this.collapsible),this.setAttribute("data-variant",this.variant),this.setAttribute("data-side",this.side),this.setAttribute("data-mobile",String(this.isMobile)),this.setAttribute("data-pane-width",String(d));let a=this.rootTarget;a&&(a.dataset.state=r,a.dataset.collapsible=this.collapsible,a.dataset.variant=this.variant,a.dataset.side=this.side,a.dataset.mobile=String(this.isMobile));let E=this.scrimTarget;E&&E.toggleAttribute("hidden",!(this.isMobile&&i));let A=this.paneTarget;A&&(A.dataset.side=this.side,A.dataset.variant=this.variant,A.setAttribute("aria-label",this.label),h?A.setAttribute("inert",""):A.removeAttribute("inert"));let S=this.handleTarget;S&&(S.toggleAttribute("hidden",!l),l&&(S.setAttribute("aria-orientation",t?"vertical":"horizontal"),S.setAttribute("aria-valuenow",String(d)),S.setAttribute("aria-valuemin",String(this.minWidth)),S.setAttribute("aria-valuemax",String(this.maxWidth)),S.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(),this.syncActiveLinks(!1)}syncActiveLinks(t=!1){if(!this.matchActive||typeof window>"u"||typeof window.location>"u")return!1;let i=window.location.pathname,r=!1;for(let l of this.querySelectorAll(Jx)){let h=this.isLinkActive(l,i);l.classList.toggle("rui-sidebar__menu-button--active",h),h?(l.setAttribute("aria-current","page"),t&&!r&&(l.scrollIntoView({block:"nearest"}),r=!0)):l.removeAttribute("aria-current")}return r}isLinkActive(t,i){let r=t.pathname;return this.matchMode==="prefix"?i===r||i.startsWith(`${r}/`):r===i}attachNavigationListeners(){if(EV||!this.isConnected||!this.matchActive||typeof window>"u"||typeof window.addEventListener!="function")return;let t=()=>this.syncActiveLinks(!1);if(window.addEventListener("popstate",t),this.navigationCleanups.push(()=>window.removeEventListener("popstate",t)),typeof document<"u"&&typeof document.addEventListener=="function")for(let i of Ur(this.navigationEvents))document.addEventListener(i,t),this.navigationCleanups.push(()=>document.removeEventListener(i,t))}detachNavigationListeners(){for(let t of this.navigationCleanups)t();this.navigationCleanups=[]}unbindMobileMediaQuery(){this.mediaQuery?.removeEventListener("change",this.mediaListener),this.mediaQuery=null}bindMobileMediaQuery(){if(this.unbindMobileMediaQuery(),this.mobileBreakpoint<=0||!VV()){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(t){if(t===this.isMobile)return;let i=this.isMobile&&!t,r=!this.isMobile&&t;this.isMobile=t;let l=this.mobileReady&&!this.openControlled;l&&i&&this.collapsible==="off"&&!this.isOpen()?this.setOpen(!0):l&&r?this.setOpen(this.mobileDefaultOpen):this.syncPaneWidthVar(),this.mobileChangeEvent.emit({mobile:t})}clampWidth(t){return Math.min(this.maxWidth,Math.max(this.minWidth,t))}paneWidth(){return this.isOpen()?this.width&&this.width>0?this.width:this.defaultWidth:this.isMobile?0:this.collapsible==="icon"?AV:0}syncPaneWidthVar(t=this.paneWidth()){let i=this.rootTarget;i&&i.style.setProperty("--rui-sidebar-pane-width",`${t}px`),this.paneTarget&&(this.paneTarget.style.removeProperty("width"),this.paneTarget.style.removeProperty("height")),this.setAttribute("data-pane-width",String(t))}applyWidth(t,i){let r=this.clampWidth(t);this.width=r,this.syncPaneWidthVar(r),i&&this.resizeEvent.emit({width:r})}toggle(){this.setOpen(!this.isOpen())}setOpen(t){let i=this.isOpen();if(t===i){this.syncPresentation(),this.syncPaneWidthVar();return}this.open=t;let r=t?"expanded":"collapsed";this.syncPresentation(),this.syncPaneWidthVar(),this.toggleEvent.emit({open:t,state:r})}beginDrag(t){if(t.button!==0||this.collapsible!=="off")return;this.dragging=!0;let i=qr(this.side);this.dragStartCoord=i?t.clientX:t.clientY,this.dragStartSize=this.paneWidth(),this.handleTarget?.setPointerCapture(t.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(t){if(!this.dragging)return;let r=qr(this.side)?t.clientX:t.clientY,l=this.side==="right"?this.dragStartCoord-r:r-this.dragStartCoord;this.applyWidth(this.dragStartSize+l,!0)}onPointerUp(){this.endDrag()}onHandlePointerDown(t){t.preventDefault(),this.beginDrag(t)}onHandleKeydown(t){let i=t,r=this.paneWidth(),l=qr(this.side),h=l?"ArrowLeft":"ArrowUp",d=l?"ArrowRight":"ArrowDown",a=r;if(i.key===h)a=r-(i.shiftKey?Qx:Nx);else if(i.key===d)a=r+(i.shiftKey?Qx:Nx);else if(i.key==="Home")a=this.minWidth;else if(i.key==="End")a=this.maxWidth;else return;t.preventDefault(),this.applyWidth(a,!0)}onScrimClick(){this.isMobile&&this.setOpen(!1)}onMenuLinkClick(){this.isMobile&&this.setOpen(!1)}onHostKeydown(t){let i=t;if(i.key==="Escape"&&this.isMobile&&this.isOpen()){i.preventDefault(),this.setOpen(!1);return}kV(i)&&i.key.toLowerCase()===OV&&(i.preventDefault(),this.toggle())}static{N_()}};import{RadiantElement as v0,customElement as BV,onEvent as FV,onUpdated as y0,prop as Ui,query as UV,state as zV}from"@ecopages/radiant";var e0,i0,r0,n0,o0,a0,s0,l0,u0,c0,d0,h0,p0,f0,m0,g0;function MV(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:b0(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||b0(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:jV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return PV(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function jV(e){var t=LV(e,"string");return typeof t=="symbol"?t:t+""}function LV(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function b0(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function PV(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var x0,_0=class extends v0{static{({e:[r0,n0,o0,a0,s0,l0,u0,c0,d0,h0,p0,f0,m0,g0,e0],c:[x0,i0]}=MV(this,[BV("rui-sidebar-trigger")],[[Ui({type:String,defaultValue:""}),0,"controls"],[Ui({type:String,attribute:"button-label",defaultValue:"Toggle sidebar"}),0,"buttonLabel"],[Ui({type:String,reflect:!0,defaultValue:""}),0,"placement"],[Ui({type:String,defaultValue:"ghost"}),0,"variant"],[Ui({type:String,defaultValue:"md"}),0,"size"],[UV({ref:"button"}),0,"buttonTarget"],[zV,0,"sidebarState"],[y0(["controls","buttonLabel","placement"]),2,"onBindingUpdated"],[y0(["variant","size"]),2,"onPresentationUpdated"],[FV({ref:"button",type:"click"}),2,"onButtonClick"]],0,void 0,v0))}controls=(e0(this),r0(this));buttonLabel=(n0(this),o0(this));placement=(a0(this),s0(this));variant=(l0(this),u0(this));size=(c0(this),d0(this));buttonTarget=(h0(this),p0(this));sidebarState=(f0(this),m0(this,"expanded"));sidebarListener=(g0(this),null);attachedSidebar=null;initialSyncFrame=null;connectedCallback(){super.connectedCallback(),this.syncWithSidebar(),queueMicrotask(()=>queueMicrotask(()=>this.syncWithSidebar())),this.initialSyncFrame=requestAnimationFrame(()=>{this.initialSyncFrame=null,this.syncWithSidebar()})}disconnectedCallback(){this.initialSyncFrame!=null&&(cancelAnimationFrame(this.initialSyncFrame),this.initialSyncFrame=null),this.detachFromSidebar(),super.disconnectedCallback()}onBindingUpdated(){this.detachFromSidebar(),this.syncWithSidebar(),this.applyState(this.attachedSidebar?this.readState(this.attachedSidebar):"expanded")}onPresentationUpdated(){this.syncButtonPresentation()}resolveSidebar(){let t=this.controls?.trim();if(t){let r=document.getElementById(t);if(r)return r}let i=this.closest("rui-sidebar");return i?.id?i:null}syncWithSidebar(){let t=this.resolveSidebar();if(t===this.attachedSidebar){t&&this.applyState(this.readState(t));return}this.detachFromSidebar(),t&&(this.attachedSidebar=t,this.sidebarListener=i=>{let r=i.detail;this.applyState(r.state)},t.addEventListener("rui-sidebar-toggle",this.sidebarListener),this.applyState(this.readState(t)))}detachFromSidebar(){this.attachedSidebar&&this.sidebarListener&&this.attachedSidebar.removeEventListener("rui-sidebar-toggle",this.sidebarListener),this.attachedSidebar=null,this.sidebarListener=null}readState(t){return t.getAttribute("data-state")??"expanded"}resolvedPlacement(){if(this.classList.contains("rui-sidebar-trigger-placement--header"))return"header";if(this.classList.contains("rui-sidebar-trigger-placement--inset"))return"inset";let t=this.getAttribute("data-placement");return t==="header"||t==="inset"?t:this.placement}resolvedButtonLabel(t=this.sidebarState){if(this.resolvedPlacement()==="inset")return t==="expanded"?"Close navigation":"Open navigation";let i=this.getAttribute("data-button-label")?.trim();if(i)return i;let r=this.getAttribute("button-label")?.trim();return r||this.buttonLabel||"Toggle sidebar"}applyState(t){this.sidebarState=t;let i=this.buttonTarget;if(!i)return;let r=this.resolveSidebar(),l=this.resolvedButtonLabel(t);i.setAttribute("aria-expanded",String(t==="expanded")),i.setAttribute("data-sidebar-state",t),i.setAttribute("aria-label",l),r?.id?i.setAttribute("aria-controls",r.id):this.controls&&i.setAttribute("aria-controls",this.controls),this.syncButtonPresentation()}syncButtonPresentation(){let t=this.buttonTarget;t&&(t.className=`rui-button rui-button--${this.variant} rui-button--${this.size} rui-sidebar__trigger ${this.placementClass()}`.trim())}onButtonClick(t){t.preventDefault(),t.stopPropagation();let i=this.resolveSidebar();i&&typeof i.toggle=="function"&&i.toggle()}placementClass(){return this.resolvedPlacement()==="header"?"rui-sidebar__trigger--header":this.resolvedPlacement()==="inset"?"rui-sidebar__trigger--inset":""}static{i0()}};import{jsx as rt,jsxs as Zt}from"@ecopages/jsx/jsx-runtime";function qV({layout:e="default",siteHeader:t,sidebar:i,children:r,class:l,...h}){return e==="docs"?Zt("div",{...h,class:L("rui-sidebar-provider",l),"data-layout":e,children:[t?rt("div",{class:"rui-sidebar-provider__site-header",children:t}):null,Zt("div",{class:"rui-sidebar-provider__body",children:[i,r]})]}):Zt("div",{...h,class:L("rui-sidebar-provider",l),"data-layout":e,children:[i,r]})}function KV({children:e,class:t,...i}){return rt("div",{...i,class:L("rui-sidebar__header",t),children:e})}function $V({children:e,class:t,...i}){return rt("div",{...i,class:L("rui-sidebar__content",t),children:e})}function GV({children:e,class:t,...i}){return rt("div",{...i,class:L("rui-sidebar__footer",t),children:e})}function WV({class:e,...t}){return rt("hr",{...t,role:"separator","aria-orientation":"horizontal",class:L("rui-sidebar__separator",e)})}function HV({children:e,class:t,...i}){return rt("section",{...i,class:L("rui-sidebar__group",t),children:e})}function w0({children:e,class:t,...i}){return rt("h2",{...i,class:L("rui-sidebar__group-label",t),children:e})}function YV({children:e,class:t,...i}){return rt("button",{...i,type:"button",class:L("rui-sidebar__group-action",t),children:e})}function XV({label:e,action:t,class:i,...r}){return Zt("div",{...r,class:L("rui-sidebar__group-header",i),children:[rt(w0,{children:e}),t]})}function NV({children:e,class:t,...i}){return rt("ul",{...i,role:"list",class:L("rui-sidebar__menu",t),children:e})}function QV({children:e,class:t,...i}){return rt("li",{...i,class:L("rui-sidebar__menu-item",t),children:e})}function S0(e){if(e.href!==void 0){let{children:K,class:$,isActive:P,href:G,tooltip:W,aria:O,title:_,"aria-current":H,...Y}=e;return rt("a",{...Bi(Y,"as"),aria:nt(O,typeof K=="string"?void 0:W),href:G,"data-ref":"menu-button",class:L("rui-sidebar__menu-button",P&&"rui-sidebar__menu-button--active",$),"aria-current":P?"page":H,title:Lt(_,W),children:K})}let{children:t,class:i,isActive:r,type:l="button",tooltip:h,disabled:d,onClick:a,aria:E,title:A,"aria-current":S,"on:click":D,...T}=e;return rt("button",{...Bi(T,"as","href"),aria:nt(E,typeof t=="string"?void 0:h),type:l,"data-ref":"menu-button",class:L("rui-sidebar__menu-button",r&&"rui-sidebar__menu-button--active",i),"aria-current":r?"page":S,disabled:d,title:Lt(A,h),"on:click":Lt(D,a),children:t})}function JV(e){let{class:t,...i}=e;return rt(S0,{class:L("rui-sidebar__menu-action",t),...i})}function ZV({children:e,class:t,...i}){return rt("main",{...i,class:L("rui-sidebar__inset",t),children:e})}function tM({children:e,open:t,label:i,...r}){return rt("rui-sidebar",{...r,"prop:open":t,label:i,children:Zt("div",{class:"rui-sidebar","data-ref":"root",children:[rt("button",{"data-ref":"scrim",type:"button",class:"rui-sidebar__scrim",tabindex:-1,"aria-label":"Close sidebar",hidden:!0}),rt("div",{"data-ref":"pane",class:"rui-sidebar__pane","aria-label":i,children:e}),rt("div",{"data-ref":"handle",class:"rui-sidebar__handle",role:"separator",tabindex:0,hidden:!0,children:rt("span",{class:"rui-sidebar__handle-grip","aria-hidden":"true"})})]})})}function eM(){return Zt("span",{class:"rui-sidebar__trigger-icon","aria-hidden":"true",children:[Zt("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:[rt("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"}),rt("path",{d:"M9 3v18"}),rt("path",{d:"m14 15 3-3-3-3"})]}),Zt("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:[rt("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"}),rt("path",{d:"M9 3v18"}),rt("path",{d:"m14 9-3 3 3 3"})]}),Zt("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:[rt("path",{d:"M18 6 6 18"}),rt("path",{d:"m6 6 12 12"})]}),Zt("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:[rt("path",{d:"M4 6h16"}),rt("path",{d:"M4 12h16"}),rt("path",{d:"M4 18h16"})]})]})}function iM({children:e,class:t,triggerLabel:i,placement:r,variant:l="ghost",size:h="md",...d}){let a=i??"Toggle sidebar";return rt("rui-sidebar-trigger",{...d,class:L(t,r&&`rui-sidebar-trigger-placement--${r}`),"prop:buttonLabel":a,data:{buttonLabel:a},placement:r,variant:l,size:h,children:rt("button",{"data-ref":"button",type:"button",class:L("rui-button",`rui-button--${l}`,`rui-button--${h}`,"rui-sidebar__trigger"),children:e??rt(eM,{})})})}import{RadiantElement as Aw,customElement as sM,event as lM,onEvent as zi,onUpdated as uM,prop as gt,query as te}from"@ecopages/radiant";var T0,E0,R0,A0,I0,C0,D0,O0,k0,V0,M0,j0,L0,P0,B0,F0,U0,z0,q0,K0,$0,G0,W0,H0,Y0,X0,N0,Q0,J0,Z0,tw,ew,iw,rw,nw,ow,aw,sw,lw,uw,cw,dw,hw,pw,fw,mw,gw,bw,vw,yw,_w,xw,ww,Sw,Tw,Ew;function rM(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Rw(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Rw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:nM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return aM(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function nM(e){var t=oM(e,"string");return typeof t=="symbol"?t:t+""}function oM(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rw(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function aM(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Cw,Iw=class extends Aw{static{({e:[R0,A0,I0,C0,D0,O0,k0,V0,M0,j0,L0,P0,B0,F0,U0,z0,q0,K0,$0,G0,W0,H0,Y0,X0,N0,Q0,J0,Z0,tw,ew,iw,rw,nw,ow,aw,sw,lw,uw,cw,dw,hw,pw,fw,mw,gw,bw,vw,yw,_w,xw,ww,Sw,Tw,Ew,T0],c:[Cw,E0]}=rM(this,[sM("rui-slider")],[[gt({type:String,defaultValue:"single"}),0,"variant"],[gt({type:String,defaultValue:"horizontal"}),0,"orientation"],[gt({type:Number,reflect:!0,defaultValue:50}),0,"value"],[gt({type:Number,reflect:!0,attribute:"range-min",defaultValue:25}),0,"rangeMin"],[gt({type:Number,reflect:!0,attribute:"range-max",defaultValue:75}),0,"rangeMax"],[gt({type:Number,defaultValue:0}),0,"min"],[gt({type:Number,defaultValue:100}),0,"max"],[gt({type:Number,defaultValue:1}),0,"step"],[gt({type:Number,attribute:"value-precision",defaultValue:Number.NaN}),0,"valuePrecision"],[gt({type:Number,defaultValue:0}),0,"minDistance"],[gt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[gt({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[gt({type:String,defaultValue:""}),0,"label"],[gt({type:String,defaultValue:""}),0,"name"],[gt({type:Boolean,attribute:"show-value",defaultValue:!1}),0,"showValue"],[gt({type:Boolean,attribute:"value-title",defaultValue:!1}),0,"valueTitle"],[lM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[te({ref:"input"}),0,"inputTarget"],[te({ref:"maxInput"}),0,"maxInputTarget"],[te({ref:"root"}),0,"rootTarget"],[te({ref:"header"}),0,"headerTarget"],[te({ref:"label"}),0,"labelTarget"],[te({ref:"rangeTrack"}),0,"rangeTrack"],[te({ref:"value"}),0,"valueTarget"],[te({ref:"singleThumb"}),0,"singleThumb"],[te({ref:"rangeMinThumb"}),0,"rangeMinThumb"],[te({ref:"rangeMaxThumb"}),0,"rangeMaxThumb"],[uM(["value","rangeMin","rangeMax","min","max","step","valuePrecision","minDistance","variant","orientation","disabled","readOnly","label","name","showValue","valueTitle"]),2,"onPropsUpdated"],[zi({ref:"rangeTrack",type:"pointerdown"}),2,"onPointerDown"],[zi({document:!0,type:"pointermove"}),2,"onPointerMove"],[zi({document:!0,type:"pointerup"}),2,"onPointerUp"],[zi({document:!0,type:"pointercancel"}),2,"onPointerCancel"],[zi({selector:"[data-thumb]",type:"keydown"}),2,"onThumbKeydown"]],0,void 0,Aw))}variant=(T0(this),R0(this));orientation=(A0(this),I0(this));value=(C0(this),D0(this));rangeMin=(O0(this),k0(this));rangeMax=(V0(this),M0(this));min=(j0(this),L0(this));max=(P0(this),B0(this));step=(F0(this),U0(this));valuePrecision=(z0(this),q0(this));minDistance=(K0(this),$0(this));disabled=(G0(this),W0(this));readOnly=(H0(this),Y0(this));label=(X0(this),N0(this));name=(Q0(this),J0(this));showValue=(Z0(this),tw(this));valueTitle=(ew(this),iw(this));changeEvent=(rw(this),nw(this));inputTarget=(ow(this),aw(this));maxInputTarget=(sw(this),lw(this));rootTarget=(uw(this),cw(this));headerTarget=(dw(this),hw(this));labelTarget=(pw(this),fw(this));rangeTrack=(mw(this),gw(this));valueTarget=(bw(this),vw(this));singleThumb=(yw(this),_w(this));rangeMinThumb=(xw(this),ww(this));rangeMaxThumb=(Sw(this),Tw(this));activeThumb=(Ew(this),null);activePointerId=null;pending=null;lastEmitted="";onConnected(){this.syncChrome(),this.syncValues(this.committedValues())}onPropsUpdated(){this.activeThumb||(this.syncChrome(),this.syncValues(this.committedValues()))}get isRange(){return this.variant==="range"}get isVertical(){return this.orientation==="vertical"}get numericRange(){return ge(this.min,this.max,this.step)}get resolvedValuePrecision(){return Or(this.step,this.valuePrecision)}formatValue(t){return kr(t,this.resolvedValuePrecision)}formatValues(t){return t.length===2?`${this.formatValue(t[0])} \u2013 ${this.formatValue(t[1])}`:this.formatValue(t[0])}get defaultValueTarget(){return this.querySelector("[data-default-value]")}thumbFor(t){return t==="value"?this.singleThumb:t==="min"?this.rangeMinThumb:this.rangeMaxThumb}parseThumb(t){return this.isRange?t==="min"||t==="max"?t:null:t==="value"?t:null}constrainPair(t,i,r){let l=this.numericRange,h=l.clamp(t),d=l.clamp(i);h>d&&([h,d]=[d,h]);let a=Math.max(0,this.minDistance);return d-h<a&&(r==="min"?h=l.clamp(d-a):d=l.clamp(h+a)),[h,d]}committedValues(){return this.isRange?this.constrainPair(this.rangeMin,this.rangeMax):[this.numericRange.clamp(this.value)]}liveValues(){return this.pending??this.committedValues()}changeDetail(t){return t.length===2?{values:[t[0],t[1]]}:{value:t[0]}}emitIfChanged(t){let i=t.join(",");i!==this.lastEmitted&&(this.lastEmitted=i,this.changeEvent.emit(this.changeDetail(t)))}reflectValues(t){if(t.length===2){this.rangeMin!==t[0]&&(this.rangeMin=t[0]),this.rangeMax!==t[1]&&(this.rangeMax=t[1]);return}this.value!==t[0]&&(this.value=t[0])}syncValues(t){this.paint(t),this.reflectValues(t)}syncChrome(){this.syncRootChrome(),this.syncThumbChrome()}syncRootChrome(){let t=!!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.labelTarget?.toggleAttribute("hidden",!this.label),this.labelTarget&&(this.labelTarget.textContent=this.label),this.defaultValueTarget?.toggleAttribute("hidden",!this.showValue),this.headerTarget?.toggleAttribute("hidden",!this.label&&!t)}syncThumbChrome(){let t=this.disabled?-1:0,i=this.isVertical?"vertical":"horizontal",r=this.numericRange;for(let{id:l,label:h,visible:d}of this.getThumbChrome()){let a=this.thumbFor(l);a&&(a.toggleAttribute("hidden",!d),a.toggleAttribute("disabled",this.disabled||!d),a.setAttribute("tabindex",String(d?t:-1)),a.setAttribute("aria-label",h),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 t=this.isRange;return[{id:"value",label:this.label||"Value",visible:!t},{id:"min",label:this.label?`${this.label} minimum`:"Minimum value",visible:t},{id:"max",label:this.label?`${this.label} maximum`:"Maximum value",visible:t}]}paint(t){let i=this.numericRange,r=t[0],l=t.length===2?t[1]:t[0],h=`${i.ratioFor(r)*100}%`,d=`${i.ratioFor(l)*100}%`,a=`${(i.ratioFor(l)-i.ratioFor(r))*100}%`,E=this.rangeTrack;E?.style.setProperty("--rui-slider-fill-start",t.length===2?h:"0%"),E?.style.setProperty("--rui-slider-fill-size",t.length===2?a:d),E?.style.setProperty("--rui-slider-value",h),E?.style.setProperty("--rui-slider-min",h),E?.style.setProperty("--rui-slider-max",d),this.singleThumb&&(this.singleThumb.setAttribute("aria-valuenow",String(r)),this.singleThumb.setAttribute("aria-valuetext",this.formatValue(r))),this.rangeMinThumb&&(this.rangeMinThumb.setAttribute("aria-valuenow",String(r)),this.rangeMinThumb.setAttribute("aria-valuetext",this.formatValue(r)),this.rangeMinThumb.setAttribute("aria-valuemax",String(l))),this.rangeMaxThumb&&(this.rangeMaxThumb.setAttribute("aria-valuemin",String(r)),this.rangeMaxThumb.setAttribute("aria-valuenow",String(l)),this.rangeMaxThumb.setAttribute("aria-valuetext",this.formatValue(l))),this.valueTarget&&(this.valueTarget.textContent=this.formatValues(t)),this.syncInputs(t),this.syncValueTitle(t)}syncInputs(t){if(this.inputTarget&&(this.inputTarget.disabled=this.disabled,this.inputTarget.readOnly=this.readOnly,this.inputTarget.value=String(t[0]),this.name?this.inputTarget.name=this.name:this.inputTarget.removeAttribute("name")),!!this.maxInputTarget){if(this.maxInputTarget.disabled=this.disabled,this.maxInputTarget.readOnly=this.readOnly,t.length===2){this.maxInputTarget.value=String(t[1]),this.name?this.maxInputTarget.name=`${this.name}-max`:this.maxInputTarget.removeAttribute("name");return}this.maxInputTarget.value="",this.maxInputTarget.removeAttribute("name")}}syncValueTitle(t){let i=[[this.inputTarget,"input"],[this.maxInputTarget,"maxInput"],[this.rangeTrack,"track"],[this.singleThumb,"value"],[this.rangeMinThumb,"min"],[this.rangeMaxThumb,"max"]],r=this.getValueTitles(t);for(let[l,h]of i){let d=r[h];d?l?.setAttribute("title",d):l?.removeAttribute("title")}}getValueTitles(t){if(!this.valueTitle)return{};if(t.length===1){let l=this.formatValue(t[0]);return{input:l,value:l}}let[i,r]=t;return{input:this.formatValue(i),maxInput:this.formatValue(r),min:this.formatValue(i),max:this.formatValue(r),track:this.formatValues(t)}}valueFromPointer(t){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 l=this.isVertical?1-(t.clientY-r.top)/r.height:(t.clientX-r.left)/r.width;return this.numericRange.valueFromRatio(l)}nearestThumb(t){if(!this.isRange)return"value";let[i,r]=this.liveValues();return Math.abs(t-i)<=Math.abs(t-r)?"min":"max"}moveThumb(t,i){if(this.activeThumb=t,this.isRange){let l=this.pending??this.committedValues();this.pending=this.constrainPair(t==="min"?i:l[0],t==="max"?i:l[1],t)}else this.pending=[this.numericRange.clamp(i)];let r=this.pending;return this.paint(r),this.emitIfChanged(r),r}commit(){let t=this.liveValues();this.pending=null,this.activeThumb=null,this.activePointerId=null,this.syncValues(t)}revert(){this.pending=null,this.activeThumb=null,this.activePointerId=null,this.lastEmitted=this.committedValues().join(","),this.paint(this.committedValues())}releasePointer(t){let i=this.rangeTrack;i?.hasPointerCapture(t.pointerId)&&i.releasePointerCapture(t.pointerId)}onPointerDown(t){if(t.button!==0||this.disabled||this.readOnly)return;let i=t.target.closest("[data-thumb]"),r=this.parseThumb(i?.getAttribute("data-thumb")??null),l=this.valueFromPointer(t),h=r??this.nearestThumb(l);this.pending=this.committedValues(),this.lastEmitted=this.pending.join(","),this.activeThumb=h,this.activePointerId=t.pointerId,this.rangeTrack?.setPointerCapture(t.pointerId),this.thumbFor(h)?.focus(),r||this.moveThumb(h,l),t.preventDefault()}onPointerMove(t){!this.activeThumb||t.pointerId!==this.activePointerId||this.moveThumb(this.activeThumb,this.valueFromPointer(t))}onPointerUp(t){!this.activeThumb||t.pointerId!==this.activePointerId||(this.releasePointer(t),this.commit())}onPointerCancel(t){!this.activeThumb||t.pointerId!==this.activePointerId||(this.releasePointer(t),this.revert())}onThumbKeydown(t){if(this.disabled||this.readOnly)return;let i=t.target.closest("[data-thumb]"),r=this.parseThumb(i?.getAttribute("data-thumb")??null);if(!r)return;let l=this.committedValues(),h=r==="max"?l[l.length-1]:l[0],d=Vr(this.numericRange,h,t.key);d!=null&&(t.preventDefault(),this.lastEmitted=l.join(","),this.moveThumb(r,d),this.commit())}static{E0()}};import{jsx as jt,jsxs as yo}from"@ecopages/jsx/jsx-runtime";function Dw({children:e,class:t,...i}){return jt("span",{...i,class:L("rui-slider__value",t),"data-ref":"value","aria-hidden":"true",children:e})}function cM({disabled:e,min:t,max:i,label:r,variant:l}){let h=l!=="range";return jt("div",{class:"rui-slider__range",children:yo("div",{class:"rui-slider__range-track","data-ref":"rangeTrack",children:[jt("div",{class:"rui-slider__range-fill","data-ref":"rangeFill"}),jt("button",{type:"button",class:"rui-slider__thumb","data-ref":"singleThumb","data-thumb":"value",role:"slider",tabindex:e||!h?-1:0,"aria-label":r||"Value","aria-valuemin":t,"aria-valuemax":i,disabled:e||!h,hidden:!h}),jt("button",{type:"button",class:"rui-slider__thumb","data-ref":"rangeMinThumb","data-thumb":"min",role:"slider",tabindex:e||h?-1:0,"aria-label":r?`${r} minimum`:"Minimum value","aria-valuemin":t,"aria-valuemax":i,disabled:e||h,hidden:h}),jt("button",{type:"button",class:"rui-slider__thumb","data-ref":"rangeMaxThumb","data-thumb":"max",role:"slider",tabindex:e||h?-1:0,"aria-label":r?`${r} maximum`:"Maximum value","aria-valuemin":t,"aria-valuemax":i,disabled:e||h,hidden:h})]})})}function dM({values:e,variant:t="single",orientation:i="horizontal",label:r,showValue:l=!1,valueTitle:h=!1,disabled:d,name:a,min:E,max:A,children:S,...D}){let T=S??jt(Dw,{"data-default-value":!0,hidden:!l}),K=!!S||l;return jt("rui-slider",{...D,variant:t,orientation:i,label:r,showValue:l,valueTitle:h,disabled:d,name:a,min:E,max:A,rangeMin:e?.[0],rangeMax:e?.[1],children:yo("div",{class:L("rui-slider",t==="range"?"rui-slider--range":"rui-slider--single",i==="vertical"&&"rui-slider--vertical"),"data-ref":"root",children:[yo("div",{class:"rui-slider__header","data-ref":"header",hidden:!r&&!K,children:[jt("span",{class:"rui-slider__label","data-ref":"label",hidden:!r,children:r}),T]}),jt(cM,{disabled:d,min:E,max:A,label:r,variant:t}),jt("input",{type:"hidden","data-ref":"input",name:a||void 0}),jt("input",{type:"hidden","data-ref":"maxInput"})]})})}import{jsx as hM}from"@ecopages/jsx/jsx-runtime";function pM({size:e="md",aria:t,class:i,...r}){return hM("span",{...r,role:"status",aria:nt(t,"Loading"),class:L("rui-spinner",`rui-spinner--${e}`,i)})}import{RadiantElement as $w,bound as vM,customElement as yM,event as _M,onEvent as xM,onUpdated as wM,prop as _o,query as SM}from"@ecopages/radiant";var Ow,kw,Vw,Mw,jw,Lw,Pw,Bw,Fw,Uw,zw,qw;function fM(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:Kw(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||Kw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:mM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return bM(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function mM(e){var t=gM(e,"string");return typeof t=="symbol"?t:t+""}function gM(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kw(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function bM(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Ww,Gw=class extends $w{static{({e:[Vw,Mw,jw,Lw,Pw,Bw,Fw,Uw,zw,qw,Ow],c:[Ww,kw]}=fM(this,[yM("rui-switch")],[[_o({type:Boolean,reflect:!0,defaultValue:!1}),0,"checked"],[_o({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[_o({type:String,defaultValue:""}),0,"name"],[SM({ref:"input"}),0,"inputTarget"],[_M({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[vM,wM(["checked","disabled","name"])],2,"syncInputState"],[xM({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,$w))}constructor(...t){super(...t),qw(this)}checked=(Ow(this),Vw(this));disabled=(Mw(this),jw(this));name=(Lw(this),Pw(this));inputTarget=(Bw(this),Fw(this));changeEvent=(Uw(this),zw(this));onConnected(){this.syncInputState()}syncInputState(){let t=this.inputTarget;t&&(t.checked=this.checked,t.disabled=this.disabled,this.name?t.name=this.name:t.removeAttribute("name"))}onInputChange(t){let i=t.target;this.checked=i.checked,this.changeEvent.emit({checked:this.checked})}static{kw()}};import{jsx as qi,jsxs as TM}from"@ecopages/jsx/jsx-runtime";function EM({children:e,checked:t,disabled:i,name:r,...l}){return qi("rui-switch",{...l,checked:t,disabled:i,name:r,children:TM("label",{class:"rui-switch",children:[qi("input",{type:"checkbox",role:"switch","data-ref":"input","data-rui-control":!0,"data-rui-control-type":"boolean",class:"rui-switch__input",checked:t,disabled:i,name:r||void 0}),qi("span",{class:"rui-switch__track","aria-hidden":"true",children:qi("span",{class:"rui-switch__thumb"})}),qi("span",{class:"rui-switch__label",children:e})]})})}import{jsx as ht,jsxs as vS}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as fS,customElement as DM,event as xo,onEvent as ai,onUpdated as mS,prop as si}from"@ecopages/radiant";var Hw,Yw,Xw,Nw,Qw,Jw,Zw,tS,eS,iS,rS,nS,oS,aS,sS,lS,uS,cS,dS,hS;function RM(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:pS(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||pS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:AM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return CM(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function AM(e){var t=IM(e,"string");return typeof t=="symbol"?t:t+""}function IM(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pS(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function CM(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var bS,gS=class extends fS{static{({e:[Xw,Nw,Qw,Jw,Zw,tS,eS,iS,rS,nS,oS,aS,sS,lS,uS,cS,dS,hS,Hw],c:[bS,Yw]}=RM(this,[DM("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({type:String,reflect:!0,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"],[xo({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[xo({name:"rui-sort-change",bubbles:!0,composed:!0}),0,"sortChangeEvent"],[xo({name:"rui-row-action",bubbles:!0,composed:!0}),0,"rowActionEvent"],[mS(["value","selectionMode"]),2,"onSelectionUpdated"],[mS(["sortColumn","sortDirection"]),2,"onSortUpdated"],[ai({selector:"[data-table-cell]",type:"click"}),2,"onCellClick"],[ai({selector:"[data-table-cell]",type:"dblclick"}),2,"onCellDoubleClick"],[ai({selector:"[data-table-cell]",type:"keydown"}),2,"onCellKeydown"],[ai({selector:"rui-checkbox[data-table-select-row]",type:"rui-change"}),2,"onRowSelectionChange"],[ai({selector:"rui-checkbox[data-table-select-all]",type:"rui-change"}),2,"onSelectAllChange"],[ai({selector:"[data-table-sort]",type:"click"}),2,"onSortClick"]],0,void 0,fS))}label=(Hw(this),Xw(this));ariaBusy=(Nw(this),Qw(this));selectionMode=(Jw(this),Zw(this));value=(tS(this),eS(this));sortColumn=(iS(this),rS(this));sortDirection=(nS(this),oS(this));changeEvent=(aS(this),sS(this));sortChangeEvent=(lS(this),uS(this));rowActionEvent=(cS(this),dS(this));structureObserver=void hS(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(t=>!t.hidden&&t.getAttribute("aria-disabled")!=="true")}getRowCells(t){return Array.from(t.children).filter(i=>i instanceof HTMLElement&&i.hasAttribute("data-table-cell"))}getFocusableCells(){return this.getSelectableRows().flatMap(t=>this.getRowCells(t))}selectedIds(){return this.selectionMode==="multiple"?St(this.value):this.value?[this.value]:[]}setSelectedIds(t){this.value=this.selectionMode==="multiple"?It(t):t[0]??"",this.syncSelectionState(),this.changeEvent.emit({value:this.value})}getActiveCellPosition(){let t=this.getFocusableCells(),i=t.findIndex(d=>d.tabIndex===0),r=i>=0?t[i]:this.querySelector("[data-table-cell]:focus")??null;if(!r)return null;let l=r.closest("[data-table-row]");if(!l)return null;let h=this.getRowCells(l).indexOf(r);return h<0?null:{rowId:l.getAttribute("data-table-row")??"",columnIndex:h}}syncSelectionState(){let t=new Set(this.selectedIds()),i=this.getSelectableRows(),r=this.selectionMode!=="none";for(let l of this.getRows()){let h=l.getAttribute("data-table-row")??"";r?l.setAttribute("aria-selected",String(t.has(h))):l.removeAttribute("aria-selected");let d=l.querySelector("rui-checkbox[data-table-select-row]");d&&(d.checked=r&&t.has(h),d.disabled=!r||l.getAttribute("aria-disabled")==="true")}for(let l of this.querySelectorAll("rui-checkbox[data-table-select-all]")){let h=i.filter(a=>t.has(a.getAttribute("data-table-row")??"")).length,d=this.selectionMode==="multiple";l.checked=d&&i.length>0&&h===i.length,l.indeterminate=d&&h>0&&h<i.length,l.disabled=!d||i.length===0}}syncRovingTabindex(){let t=this.getFocusableCells();if(t.length===0)return;let i=this.getActiveCellPosition(),r=t.findIndex(l=>l.tabIndex===0);if(i){let l=this.getRows().find(h=>h.getAttribute("data-table-row")===i.rowId);if(l){let h=this.getRowCells(l)[i.columnIndex],d=h?t.indexOf(h):-1;d>=0&&(r=d)}}lt(t,r>=0?r:0)}syncSorting(){for(let t of this.querySelectorAll("[data-table-column]")){let i=t.getAttribute("data-table-column");i&&i===this.sortColumn?t.setAttribute("aria-sort",this.sortDirection):t.removeAttribute("aria-sort")}}isInteractiveTarget(t){return!!t.closest('button, input, select, textarea, a[href], [contenteditable="true"]')}selectRow(t,i=!1){if(this.selectionMode==="none"||t.getAttribute("aria-disabled")==="true")return;let r=t.getAttribute("data-table-row")??"";if(!r)return;if(this.selectionMode==="single"){this.setSelectedIds([r]);return}let l=new Set(this.selectedIds());i&&l.has(r)?l.delete(r):l.add(r),this.setSelectedIds([...l])}focusCell(t,i){let r=this.getFocusableCells(),l=this.getRowCells(t),h=l[Math.min(Math.max(i,0),l.length-1)],d=r.indexOf(h);d<0||(lt(r,d),h.focus(),h.scrollIntoView({block:"nearest",inline:"nearest"}))}activateRow(t){if(!t.hasAttribute("data-table-actionable")||t.getAttribute("aria-disabled")==="true")return;let i=t.getAttribute("data-table-row")??"";i&&this.rowActionEvent.emit({rowId:i})}onCellClick(t){let i=t.target;if(this.isInteractiveTarget(i))return;let r=i.closest("[data-table-cell]"),l=r?.closest("[data-table-row]");!r||!l||!this.contains(l)||(this.selectRow(l,this.selectionMode==="multiple"),this.focusCell(l,this.getRowCells(l).indexOf(r)))}onCellDoubleClick(t){let i=t.target;if(this.isInteractiveTarget(i))return;let r=i.closest("[data-table-row]");r&&this.contains(r)&&this.activateRow(r)}onCellKeydown(t){let i=t.target;if(this.isInteractiveTarget(i))return;let r=i.closest("[data-table-cell]"),l=r?.closest("[data-table-row]");if(!r||!l)return;let h=this.getSelectableRows(),d=h.indexOf(l),a=this.getRowCells(l),E=a.indexOf(r);switch(t.key){case"ArrowRight":t.preventDefault(),this.focusCell(l,E+1);return;case"ArrowLeft":t.preventDefault(),this.focusCell(l,E-1);return;case"ArrowDown":t.preventDefault(),this.focusCell(h[Math.min(d+1,h.length-1)]??l,E);return;case"ArrowUp":t.preventDefault(),this.focusCell(h[Math.max(d-1,0)]??l,E);return;case"Home":t.preventDefault(),this.focusCell(l,0);return;case"End":t.preventDefault(),this.focusCell(l,a.length-1);return;case" ":t.preventDefault(),this.selectRow(l,!0);return;case"Enter":t.preventDefault(),this.activateRow(l);return;default:return}}onRowSelectionChange(t){let r=t.target.closest("[data-table-row]");if(!r||!this.contains(r))return;let l=r.getAttribute("data-table-row")??"";if(!t.detail.checked){let h=new Set(this.selectedIds());h.delete(l),this.setSelectedIds([...h]);return}this.selectRow(r)}onSelectAllChange(t){this.selectionMode==="multiple"&&this.setSelectedIds(t.detail.checked?this.getSelectableRows().map(i=>i.getAttribute("data-table-row")??""):[])}onSortClick(t){let r=t.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{Yw()}};function OM({children:e,class:t,...i}){return ht("div",{...i,role:"rowgroup",class:L("rui-table__header",t),children:ht("div",{class:"rui-table__row",role:"row",children:e})})}function kM({children:e,class:t,...i}){return ht("div",{...i,role:"rowgroup",class:L("rui-table__body",t),children:e})}function VM({children:e,class:t,...i}){return ht("div",{...i,role:"rowgroup",class:L("rui-table__footer",t),children:ht("div",{class:"rui-table__row",role:"row",children:e})})}function MM({id:e,allowsSorting:t=!1,isRowHeader:i=!1,children:r,class:l,...h}){return ht("div",{...h,role:"columnheader","data-table-column":e,"data-table-row-header":i?"":void 0,class:L("rui-table__column",l),children:t?vS("button",{type:"button","data-table-sort":e,class:"rui-table__sort",children:[ht("span",{children:r}),ht("span",{class:"rui-table__sort-indicator","aria-hidden":"true"})]}):r})}function jM({id:e,disabled:t,actionable:i,children:r,class:l,...h}){return ht("div",{...h,role:"row","data-table-row":e,"data-table-actionable":i?"":void 0,"aria-disabled":t?"true":void 0,class:L("rui-table__row",l),children:r})}function LM({isRowHeader:e=!1,children:t,class:i,...r}){return ht("div",{...r,role:e?"rowheader":"gridcell","data-table-cell":!0,tabindex:-1,class:L("rui-table__cell",i),children:t})}function PM({scope:e,label:t,class:i,...r}){let l=e==="all";return ht("div",{...r,role:l?"columnheader":"gridcell","data-table-cell":!0,"data-table-selection-cell":e,class:L("rui-table__selection-cell",i),children:ht(vi,{"data-table-select-all":l?"":void 0,"data-table-select-row":l?void 0:"",children:ht("span",{class:"sr-only",children:t??(l?"Select all rows":"Select row")})})})}function BM({colSpan:e,children:t,class:i,...r}){let l=Math.max(1,Math.floor(e));return vS("div",{role:"row",class:"rui-table__row rui-table__row--empty",children:[ht("div",{...r,role:"gridcell","aria-colspan":l,class:L("rui-table__empty-state",i),children:ht("span",{class:"rui-table__empty-state-message",children:t})}),Array.from({length:l-1},(h,d)=>ht("div",{"aria-hidden":"true",class:"rui-table__empty-state-spacer"},d))]})}function FM({children:e,label:t,ariaBusy:i,selectionMode:r,...l}){return ht("rui-table",{...l,label:t,ariaBusy:i,selectionMode:r,children:ht("div",{class:"rui-table",role:"grid","aria-label":t||void 0,"aria-busy":i==="true"?"true":void 0,"aria-multiselectable":r==="multiple"?"true":void 0,children:e})})}import{RadiantElement as kS,customElement as $M,event as GM,onEvent as VS,onUpdated as WM,prop as Kr}from"@ecopages/radiant";var yS,_S,xS,wS,SS,TS,ES,RS,AS,IS,CS,DS;function UM(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:OS(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||OS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:zM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return KM(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function zM(e){var t=qM(e,"string");return typeof t=="symbol"?t:t+""}function qM(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OS(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function KM(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var jS,MS=class extends kS{static{({e:[xS,wS,SS,TS,ES,RS,AS,IS,CS,DS,yS],c:[jS,_S]}=UM(this,[$M("rui-tabs")],[[Kr({type:String,reflect:!0,defaultValue:"boxed"}),0,"variant"],[Kr({type:String,reflect:!0,defaultValue:""}),0,"value"],[Kr({type:String,defaultValue:""}),0,"label"],[Kr({type:Boolean,defaultValue:!0}),0,"automatic"],[GM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[WM(["value","label"]),2,"onPropsUpdated"],[VS({selector:'[role="tab"]',type:"click"}),2,"onTabClick"],[VS({selector:'[role="tab"]',type:"keydown"}),2,"onTabKeydown"]],0,void 0,kS))}variant=(yS(this),xS(this));value=(wS(this),SS(this));label=(TS(this),ES(this));automatic=(RS(this),AS(this));changeEvent=(IS(this),CS(this));childObserver=(DS(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(t){return t?t.dataset.tabValue??t.id.replace(/^tab-/,""):""}syncTablistLabel(){let t=this.querySelector('[role="tablist"]');!t||t.hasAttribute("aria-label")||!this.label||t.setAttribute("aria-label",this.label)}syncSelection(t){let i=this.getTabs(),r=this.getPanels();if(!i.length)return;let l=i.find(d=>this.getTabValue(d)===t)??i.find(d=>d.id===t)??i[0],h=this.getTabValue(l);this.value=h;for(let d of i){let a=d===l;d.setAttribute("aria-selected",String(a)),d.tabIndex=a?0:-1}for(let d of r){let E=(d.dataset.tabValue??d.id.replace(/^panel-/,""))===h;d.hidden=!E,d.hasAttribute("tabindex")||(d.tabIndex=0)}}activateTab(t){!t||t.getAttribute("aria-disabled")==="true"||(this.syncSelection(this.getTabValue(t)),this.changeEvent.emit({value:this.value}))}onTabClick(t){let i=t.target.closest('[role="tab"]');!i||!this.contains(i)||this.activateTab(i)}onTabKeydown(t){let i=this.getTabs(),r=t.target.closest('[role="tab"]');if(!r||!i.includes(r))return;if(t.key==="Enter"||t.key===" "){t.preventDefault(),this.activateTab(r);return}let l=ct({items:i,current:r,key:t.key,orientation:"horizontal"});l.handled&&(t.preventDefault(),this.automatic&&this.activateTab(l.item))}static{_S()}};import{jsx as Ki}from"@ecopages/jsx/jsx-runtime";function HM({children:e,class:t,...i}){return Ki("div",{...i,class:L("rui-tabs__list",t),role:"tablist",children:e})}function YM({id:e,children:t,class:i,disabled:r,selected:l,...h}){return Ki("button",{...h,type:"button",class:L("rui-tabs__tab",i),role:"tab",id:`tab-${e}`,"data-tab-value":e,"aria-controls":`panel-${e}`,"aria-selected":l?"true":"false",tabindex:l?0:-1,disabled:r,children:t})}function XM({children:e,class:t,...i}){return Ki("div",{...i,class:L("rui-tabs__panels",t),children:e})}function NM({id:e,children:t,class:i,selected:r,hidden:l,...h}){return Ki("div",{...h,class:L("rui-tabs__panel",i),role:"tabpanel",id:`panel-${e}`,"data-tab-value":e,"aria-labelledby":`tab-${e}`,tabindex:0,hidden:r===void 0?l:!r,children:t})}function QM({children:e,...t}){return Ki("rui-tabs",{...t,children:e})}import{jsx as JM}from"@ecopages/jsx/jsx-runtime";function ZM(e){let{class:t,rows:i=3,...r}=e;return JM("textarea",{...r,rows:i,[$t]:"","data-rui-control-type":"text",class:L("rui-textarea",t)})}import{jsx as se,jsxs as lT}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as uT,bound as Co,customElement as sj,onEvent as cT,onUpdated as Do,prop as ee,query as lj}from"@ecopages/radiant";var $i="rui-toast-show",Gi="rui-toast-dismiss",tj=["top-start","top-center","top-end","bottom-start","bottom-center","bottom-end"],Wi=4e3,wo=356,So=14,To=24,Eo=3,Ro=3,Hi=45,Ao=200,Yi="bottom-end";function Pe(e){let[t,i]=e.split("-");return{y:t,x:i}}var ej=1;function ij(){return ej++}function LS(e,t){return typeof e=="function"?e(t):e}var Io=class{subscribers=[];toasts=[];subscribe=t=>(this.subscribers.push(t),t(this.toasts),()=>{let i=this.subscribers.indexOf(t);i>=0&&this.subscribers.splice(i,1)});getSnapshot=()=>this.toasts;publish(){let t=this.toasts;for(let i of this.subscribers)i(t)}create=(t,i={})=>{let r=i.id??ij(),l=i.dismissible??!0,h=this.toasts.findIndex(a=>a.id===r),d={id:r,title:t,description:i.description,variant:i.variant??"default",duration:i.duration,action:i.action,dismissible:l,closeButton:i.closeButton,position:i.position,delete:!1};return h>=0?this.toasts=this.toasts.map(a=>a.id===r?{...a,...d,delete:!1}:a):this.toasts=[d,...this.toasts],this.publish(),r};dismiss=t=>{if(t==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===t);if(!i||i.delete)return;this.toasts=this.toasts.map(r=>r.id===t?{...r,delete:!0}:r)}this.publish()};remove=t=>{this.toasts=this.toasts.filter(i=>i.id!==t),this.publish()};clear=()=>{this.toasts.length!==0&&(this.toasts=[],this.publish())};message=(t,i)=>this.create(t,i);success=(t,i)=>this.create(t,{...i,variant:"success"});error=(t,i)=>this.create(t,{...i,variant:"error"});info=(t,i)=>this.create(t,{...i,variant:"info"});warning=(t,i)=>this.create(t,{...i,variant:"warning"});loading=(t,i)=>this.create(t,{...i,variant:"loading",duration:i?.duration??Number.POSITIVE_INFINITY});promise=(t,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 t=="function"?t():t).then(h=>{let d=typeof i.description=="function"?i.description(h):i.description;this.create(LS(i.success,h),{id:r,variant:"success",description:d,duration:i.duration,action:i.action,closeButton:i.closeButton,position:i.position})}).catch(h=>{let d=typeof i.description=="function"?i.description(h):i.description;this.create(LS(i.error,h),{id:r,variant:"error",description:d,duration:i.duration,action:i.action,closeButton:i.closeButton,position:i.position})}),r}},st=new Io;var PS,BS,FS,US,zS,qS,KS,$S,GS,WS,HS,YS,XS,NS,QS,JS,ZS,tT,eT,iT,rT,nT,oT,aT;function rj(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:sT(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||sT(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:nj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return aj(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function nj(e){var t=oj(e,"string");return typeof t=="symbol"?t:t+""}function oj(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sT(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function aj(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Xi=new Map,Gr=new Map;function Oo(e){return String(e)}function $r(e){if(e==="")return;let t=Oo(e);Xi.delete(t),Gr.delete(t)}function uj(e){if(e==="")return;let t=Oo(e),i=Xi.get(t);i!=null&&(Gr.set(t,Math.max(0,i-Date.now())),Xi.delete(t))}var hT,dT=class extends uT{static{({e:[FS,US,zS,qS,KS,$S,GS,WS,HS,YS,XS,NS,QS,JS,ZS,tT,eT,iT,rT,nT,oT,aT,PS],c:[hT,BS]}=rj(this,[sj("rui-toast")],[[ee({type:String,reflect:!0,defaultValue:""}),0,"toastId"],[ee({type:String,defaultValue:""}),0,"title"],[ee({type:String,defaultValue:""}),0,"description"],[ee({type:String,reflect:!0,defaultValue:"default"}),0,"variant"],[ee({type:Number,defaultValue:4e3}),0,"duration"],[ee({type:Boolean,defaultValue:!0}),0,"dismissible"],[ee({type:Boolean,defaultValue:!1}),0,"closeButton"],[ee({type:String,defaultValue:""}),0,"actionLabel"],[ee({type:String,defaultValue:Yi}),0,"position"],[ee({type:Boolean,defaultValue:!1}),0,"markedDelete"],[lj({ref:"toast"}),0,"toastTarget"],[Do("position"),2,"onPositionUpdated"],[Do("duration"),2,"onDurationUpdated"],[Do("markedDelete"),2,"onMarkedDeleteUpdated"],[Co,2,"onPointerDown"],[Co,2,"onPointerMove"],[Co,2,"onPointerUp"],[cT({selector:"[data-toast-close]",type:"click"}),2,"onCloseClick"],[cT({selector:"[data-toast-action]",type:"click"}),2,"onActionClick"]],0,void 0,uT))}toastId=(PS(this),FS(this));title=(US(this),zS(this));description=(qS(this),KS(this));variant=($S(this),GS(this));duration=(WS(this),HS(this));dismissible=(YS(this),XS(this));closeButton=(NS(this),QS(this));actionLabel=(JS(this),ZS(this));position=(tT(this),eT(this));markedDelete=(iT(this),rT(this));toastTarget=(nT(this),oT(this));mounted=(aT(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 t=this.mounted;if(this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointermove",this.onPointerMove),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointercancel",this.onPointerUp),t){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 t=this.resolvedId;t!==""&&this.removed&&st.remove(t),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(t){if(this.held===t){!t&&this.timerReady&&this.mounted&&!this.removed&&!this.timeoutId&&this.startTimer();return}this.held=t,!(!this.timerReady||!this.mounted||this.removed)&&(t||document.hidden?(uj(this.resolvedId),this.clearTimer()):this.startTimer())}onDurationUpdated(){!this.timerReady||!this.mounted||this.removed||this.held||($r(this.resolvedId),this.startTimer())}onMarkedDeleteUpdated(){this.markedDelete&&!this.removed&&this.beginRemove()}get resolvedId(){let t=this.toastId;if(t==null||t==="")return"";let i=Number(t);return Number.isFinite(i)&&String(i)===t?i:t}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 t=this.resolvedId,i=Oo(t),r=Date.now(),l=Gr.get(i);if(Gr.delete(i),l==null){let h=Xi.get(i);l=h!=null?h-r:this.duration}if(l<=0){$r(t),this.beginRemove();return}Xi.set(i,r+l),this.clearTimer(),this.timeoutId=setTimeout(()=>{$r(t),this.beginRemove()},l)}beginRemove(){this.removed||(this.removed=!0,this.clearTimer(),$r(this.resolvedId),this.syncDomState(),this.markedDelete||st.dismiss(this.resolvedId),this.exitTimer=setTimeout(()=>{this.exitTimer=null,st.remove(this.resolvedId)},200))}onPointerDown(t){!this.dismissible||this.variant==="loading"||t.button!==0||t.target?.closest("[data-toast-close], [data-toast-action], button, a")||(this.dragStartTime=Date.now(),this.pointerStart={x:t.clientX,y:t.clientY},this.swipeAxis=null,this.setPointerCapture(t.pointerId))}onPointerMove(t){if(!this.pointerStart)return;let i={x:t.clientX-this.pointerStart.x,y:t.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(t){return this.swiping?!0:Math.abs(t.x)<8&&Math.abs(t.y)<8?!1:(this.swiping=!0,this.syncDomState(),!0)}isSwipeReversing(t){let{x:i,y:r}=Pe(this.position);return this.swipeAxis==="y"?(r==="bottom"?t.y<0:t.y>0)&&Math.abs(t.y)<45:i!=="center"&&(i==="start"?t.x>0:t.x<0)&&Math.abs(t.x)<45}setSwipeTranslation(t){this.style.setProperty("--swipe-amount-x",`${t.x}px`),this.style.setProperty("--swipe-amount-y",`${t.y}px`)}resetSwipeTranslation(){this.setSwipeTranslation({x:0,y:0})}onPointerUp(t){if(!this.pointerStart)return;this.releaseToastPointer(t.pointerId);let i=this.readSwipe();this.swiping=!1,i&&this.dismissible&&this.shouldDismissSwipe(i)?this.dismissFromSwipe(i):this.cancelSwipe(),this.clearPointerState()}releaseToastPointer(t){try{this.releasePointerCapture(t)}catch{}}readSwipe(){if(this.swiping)return{x:Number.parseFloat(this.style.getPropertyValue("--swipe-amount-x")||"0"),y:Number.parseFloat(this.style.getPropertyValue("--swipe-amount-y")||"0")}}shouldDismissSwipe(t){let i=this.swipeAxis==="x"?t.x:t.y,r=this.dragStartTime?Date.now()-this.dragStartTime:0;return Math.abs(i)>=45||Math.abs(i)/Math.max(r,1)>.11}dismissFromSwipe(t){let{x:i,y:r}=Pe(this.position);this.swipeOutDirection=this.swipeAxis==="y"?r==="bottom"?"down":"up":i==="start"?"left":i==="end"?"right":t.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(t){t.stopPropagation(),this.dismissible&&this.beginRemove()}onActionClick(t){t.stopPropagation(),st.getSnapshot().find(r=>r.id===this.resolvedId)?.action?.onClick(t),this.dismissible&&this.beginRemove()}syncDomState(){let{y:t,x:i}=Pe(this.position);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.dataset.dismissible=String(this.dismissible),this.dataset.yPosition=t,this.dataset.xPosition=i,this.dataset.variant=this.variant??"default",this.swipeOutDirection?this.dataset.swipeDirection=this.swipeOutDirection:delete this.dataset.swipeDirection}iconForVariant(){switch(this.variant){case"success":return se(ui,{});case"error":return se(Rt,{});case"warning":return"!";case"info":return"i";default:return""}}render(){let t=this.variant??"default",i=this.iconForVariant(),r=t!=="default";return lT("div",{ref:"toast",class:`rui-toast rui-toast--${t}`,role:"status","aria-live":"off","data-ref":"toast",children:[this.closeButton&&t!=="loading"?se("button",{type:"button",class:"rui-toast__close","data-toast-close":!0,"aria-label":"Close toast",children:se(Rt,{})}):null,r?se("span",{class:"rui-toast__icon","data-icon":!0,"aria-hidden":"true",children:t==="loading"?se("span",{class:"rui-toast__loader"}):i}):null,lT("div",{class:"rui-toast__content",children:[se("div",{class:"rui-toast__title","data-title":!0,children:this.$.title}),this.description?se("div",{class:"rui-toast__description","data-description":!0,children:this.$.description}):null]}),this.actionLabel?se("button",{type:"button",class:"rui-toast__action rui-button rui-button--outline rui-button--sm","data-toast-action":!0,children:this.$.actionLabel}):null]})}static{BS()}};import{jsx as ko}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as FT,bound as Wr,customElement as fj,onEvent as Vo,onUpdated as mj,prop as xe,query as gj,state as bj}from"@ecopages/radiant";function pT(e,t,i){let r=0;for(let l=0;l<e;l+=1)r+=t[l]??0;return r+e*i}function fT(e,t){return e.length===0?0:e.reduce((r,l)=>r+l,0)+Math.max(0,e.length-1)*t}function mT(e,t,i){return t<=0?0:e+Math.max(0,t-1)*i}var gT,bT,vT,yT,_T,xT,wT,ST,TT,ET,RT,AT,IT,CT,DT,OT,kT,VT,MT,jT,LT,PT;function cj(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:BT(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||BT(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:dj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return pj(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function dj(e){var t=hj(e,"string");return typeof t=="symbol"?t:t+""}function hj(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BT(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function pj(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}function UT(e,t){return e instanceof Node&&t.contains(e)}var qT,zT=class extends FT{static{({e:[vT,yT,_T,xT,wT,ST,TT,ET,RT,AT,IT,CT,DT,OT,kT,VT,MT,jT,LT,PT,gT],c:[qT,bT]}=cj(this,[fj("rui-toaster")],[[xe({type:String,reflect:!0,defaultValue:Yi}),0,"position"],[xe({type:Number,defaultValue:4e3}),0,"duration"],[xe({type:Number,defaultValue:3}),0,"visibleToasts"],[xe({type:Boolean,defaultValue:!1}),0,"closeButton"],[xe({type:Boolean,defaultValue:!1}),0,"expand"],[xe({type:Number,defaultValue:14}),0,"gap"],[xe({type:Number,defaultValue:24}),0,"offset"],[xe({type:String,reflect:!0,defaultValue:""}),0,"container"],[gj({ref:"list"}),0,"listTarget"],[bj,0,"toasts"],[mj(["position","duration","visibleToasts","closeButton","expand","gap","offset","container"]),2,"onConfigUpdated"],[Vo({document:!0,type:$i}),2,"onDocumentShow"],[Vo({document:!0,type:Gi}),2,"onDocumentDismiss"],[Vo({selector:"rui-toast",type:"rui-toast-mounted"}),2,"onToastMounted"],[Wr,2,"onPointerOver"],[Wr,2,"onPointerOut"],[Wr,2,"onPointerDown"],[Wr,2,"onPointerUp"]],0,void 0,FT))}position=(gT(this),vT(this));duration=(yT(this),_T(this));visibleToasts=(xT(this),wT(this));closeButton=(ST(this),TT(this));expand=(ET(this),RT(this));gap=(AT(this),IT(this));offset=(CT(this),DT(this));container=(OT(this),kT(this));listTarget=(VT(this),MT(this));toasts=(jT(this),LT(this,[]));expanded=(PT(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=st.subscribe(t=>{this.toasts=t,t.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(t){let i=t.detail;i?.title&&st.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(t){let i=t.detail;st.dismiss(i?.id)}onToastMounted(){this.scheduleLayoutSync()}filteredToasts(){let t=this.toasts.filter(l=>(l.position??this.position)===this.position),i=[],r=[];for(let l of t)l.delete?r.push(l):i.push(l);return[...i.slice(0,this.visibleToasts),...r]}syncHostPosition(){let{y:t,x:i}=Pe(this.position);this.dataset.yPosition=t,this.dataset.xPosition=i,this.style.setProperty("--width",`${356}px`),this.style.setProperty("--gap",`${this.gap}px`),this.style.setProperty("--viewport-offset",`${this.offset}px`)}syncContainer(){let t=this.container.trim();if(!t){this.removeAttribute("data-contained"),this.style.position="";return}let i=this.closest(t)??document.querySelector(t);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 t=this.listTarget;t&&(t.style.height="0px",t.dataset.expanded="false"),this.dataset.expanded="false"}syncPauseState(){let t=this.isPaused();for(let i of this.querySelectorAll("rui-toast"))i.setPaused(t);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(t){this.measuring=!0;let i=t.style.height,r=t.style.overflow;t.style.height="auto",t.style.overflow="visible";let l=t.getRef("toast"),h=Math.round(l instanceof HTMLElement?l.offsetHeight:t.offsetHeight)||64;return t.style.height=i,t.style.overflow=r,this.measuring=!1,h}observeToasts(){let t=this.listTarget;if(!t)return;let i=[...t.querySelectorAll("rui-toast")],r=new Set;for(let l of i){let h=l.toastId;if(!h)continue;r.add(h);let d=l.getRef("toast")??l;if(!this.observers.has(h)){let a=new ResizeObserver(()=>{if(this.measuring)return;let E=this.measureToast(l);this.heights.get(h)!==E&&(this.heights.set(h,E),this.patchStackLayout())});a.observe(d),this.observers.set(h,a)}this.heights.set(h,this.measureToast(l))}for(let[l,h]of[...this.observers])r.has(l)||(h.disconnect(),this.observers.delete(l),this.heights.delete(l))}patchStackLayout(){let t=this.listTarget;if(!t)return;let i=this.isStackExpanded(),{y:r}=Pe(this.position),l=r==="bottom"?-1:1,h=Math.min(3,Math.max(1,this.visibleToasts));this.dataset.expanded=String(i),t.dataset.expanded=String(i),this.style.setProperty("--lift",String(l)),t.style.setProperty("--gap",`${this.gap}px`);let d=[...t.querySelectorAll("rui-toast")].filter(S=>S.dataset.mounted==="true"&&S.dataset.removed!=="true");if(d.length===0){t.style.height="0px";return}let a=d.map(S=>{let D=this.measureToast(S);return this.heights.set(S.toastId,D),D}),E=a[0]??64;this.style.setProperty("--front-toast-height",`${E}px`);for(let S=0;S<d.length;S+=1){let D=d[S];if(!D)continue;let T=a[S]??64,K=S===0,$=pT(S,a,this.gap),P=S<h;if(D.dataset.index=String(S),D.dataset.front=String(K),D.dataset.expanded=String(i),D.dataset.visible=String(i||P),D.style.setProperty("--z-index",String(d.length-S)),D.style.setProperty("--index",String(S)),D.style.setProperty("--offset",`${$}px`),D.style.setProperty("--initial-height",`${T}px`),D.style.setProperty("--gap",`${this.gap}px`),i)D.style.setProperty("--y",`translateY(${l*$}px)`),D.style.height=`${T}px`,D.style.overflow="visible";else if(!P)D.style.setProperty("--y",`translateY(${l*(h-1)*this.gap}px) scale(0.7)`),D.style.height=`${E}px`,D.style.overflow="hidden";else if(K)D.style.setProperty("--y","translateY(0px)"),D.style.height=`${T}px`,D.style.overflow="visible";else{let G=Math.max(.7,1-S*.05);D.style.setProperty("--y",`translateY(${l*S*this.gap}px) scale(${G})`),D.style.height=`${E}px`,D.style.overflow="hidden"}}let A=Math.min(h,d.length);t.style.height=`${i?fT(a,this.gap):mT(E,A,this.gap)}px`}onPointerOver(t){UT(t.relatedTarget,this)||(this.expanded=!0,this.syncPauseState())}onPointerOut(t){UT(t.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 t=this.filteredToasts();return ko("section",{class:"rui-toaster-region","aria-label":"Notifications","aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",tabIndex:-1,children:ko("ol",{class:"rui-toaster","data-ref":"list","data-rui-toaster":!0,"on:pointerover":this.onPointerOver,"on:pointerout":this.onPointerOut,"on:pointerdown":this.onPointerDown,children:t.map(i=>{let r=i.duration??(i.variant==="loading"?Number.POSITIVE_INFINITY:this.duration);return ko("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{bT()}};import{jsx as KT}from"@ecopages/jsx/jsx-runtime";function vj({toastId:e,...t}){return KT("rui-toast",{...t,toastId:e!=null?String(e):void 0})}function yj({children:e,...t}){return KT("rui-toaster",{...t,children:e})}var _j=Object.assign((e,t)=>st.create(e,t),{message:(e,t)=>st.message(e,t),success:(e,t)=>st.success(e,t),error:(e,t)=>st.error(e,t),info:(e,t)=>st.info(e,t),warning:(e,t)=>st.warning(e,t),loading:(e,t)=>st.loading(e,t),promise:(e,t)=>st.promise(e,t),dismiss:e=>st.dismiss(e),clear:()=>st.clear()});function xj(e){document.dispatchEvent(new CustomEvent($i,{detail:e,bubbles:!0,composed:!0}))}function wj(e){let t=e==null?{}:{id:e};document.dispatchEvent(new CustomEvent(Gi,{detail:t,bubbles:!0,composed:!0}))}import{jsx as Hr,jsxs as Ij}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as hE,bound as Cj,customElement as Dj,onUpdated as Oj,prop as Ni,state as pE}from"@ecopages/radiant";import{isServer as fE}from"@ecopages/radiant/is-server";function $T(e,t){try{return e.querySelector(t)}catch{return null}}function GT(e,t){try{return Array.from(e.querySelectorAll(t))}catch{return[]}}function Sj(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}function WT(e,t,i=r=>document.getElementById(r)!==null){if(e.id)return t.add(e.id),e.id;let r=Sj(e.textContent||"")||"section",l=r,h=2;for(;t.has(l)||i(l);)l=`${r}-${h}`,h+=1;return e.id=l,t.add(l),l}function HT(e,t){return e instanceof HTMLElement?e.getBoundingClientRect().top+t:t}function YT(e,t,i,r){if(t instanceof HTMLElement){let l=t.getBoundingClientRect(),h=e.getBoundingClientRect();t.scrollTo({top:t.scrollTop+(h.top-l.top)-i,behavior:r});return}window.scrollTo({top:window.scrollY+e.getBoundingClientRect().top-i,behavior:r})}var XT,NT,QT,JT,ZT,tE,eE,iE,rE,nE,oE,aE,sE,lE,uE,cE;function Tj(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:dE(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||dE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.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)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function Ej(e){var t=Rj(e,"string");return typeof t=="symbol"?t:t+""}function Rj(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dE(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function Aj(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var gE,mE=class extends hE{static{({e:[QT,JT,ZT,tE,eE,iE,rE,nE,oE,aE,sE,lE,uE,cE,XT],c:[gE,NT]}=Tj(this,[Dj("rui-toc")],[[Ni({type:String,attribute:"target",defaultValue:""}),0,"target"],[Ni({type:String,attribute:"heading-selector",defaultValue:"h2,h3"}),0,"headingSelector"],[Ni({type:String,defaultValue:"On this page"}),0,"label"],[Ni({type:Number,attribute:"scroll-offset",defaultValue:120}),0,"scrollOffset"],[Ni({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[pE,0,"entries"],[pE,0,"activeId"],[Oj(["target","headingSelector","scrollOffset","navigationEvents"]),2,"onScanSettingsUpdated"],[Cj,2,"onLinkClick"]],0,void 0,hE))}target=(XT(this),QT(this,""));headingSelector=(JT(this),ZT(this,"h2,h3"));label=(tE(this),eE(this,"On this page"));scrollOffset=(iE(this),rE(this,120));navigationEvents=(nE(this),oE(this,""));entries=(aE(this),sE(this,[]));activeId=(lE(this),uE(this,null));headings=(cE(this),[]);scrollRoot=null;scrollCleanup=null;navigationCleanups=[];pendingScrollTargetId=null;scrollRafPending=!1;scrollOffsetTolerance=4;readConfiguredProp(t,i){return t.trim()||this.getAttribute(i)?.trim()||""}readConfiguredNumber(t,i,r){if(Number.isFinite(t)&&t!==0)return t;let l=Number(this.getAttribute(i));return Number.isFinite(l)?l: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 t=this.resolveTarget();if(!t)return;let i=GT(t,this.readConfiguredProp(this.headingSelector,"heading-selector")||"h2,h3");if(i.length===0)return;let r=new Set,l=i.map(h=>({id:WT(h,r),label:(h.textContent||"").trim(),depth:this.headingDepth(h)}));this.headings=i,this.entries=l,this.scrollRoot=this.resolveScrollRoot(t),this.attachScrollListener(),this.updateActiveHeading()}resolveTarget(){let t=this.readConfiguredProp(this.target,"target");return t?$T(document,t):this.parentElement}resolvedScrollOffset(){return this.readConfiguredNumber(this.scrollOffset,"scroll-offset",120)}resolveScrollRoot(t){let i=t;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(t){let i=Number.parseInt(t.tagName.slice(1),10);return Number.isFinite(i)?i:2}attachNavigationListeners(){if(fE||!this.isConnected)return;let t=()=>this.rebuild();for(let i of Ur(this.readConfiguredProp(this.navigationEvents,"navigation-events")))document.addEventListener(i,t),this.navigationCleanups.push(()=>document.removeEventListener(i,t))}detachNavigationListeners(){for(let t of this.navigationCleanups)t();this.navigationCleanups=[]}attachScrollListener(){if(fE||!this.isConnected)return;let t=()=>{this.scrollRafPending||(this.scrollRafPending=!0,requestAnimationFrame(()=>{this.updateActiveHeading(),this.scrollRafPending=!1}))},i=this.scrollRoot??window;if(i===window){window.addEventListener("scroll",t,{passive:!0}),this.scrollCleanup=()=>window.removeEventListener("scroll",t);return}i.addEventListener("scroll",t,{passive:!0}),this.scrollCleanup=()=>i.removeEventListener("scroll",t)}detachScrollListener(){this.scrollCleanup?.(),this.scrollCleanup=null}isScrollAtBottom(){let t=this.scrollRoot??window;if(!(t instanceof HTMLElement)){let i=document.documentElement.scrollHeight,r=window.innerHeight;return i<=r+1?!1:window.scrollY+r>=i-10}return t.scrollHeight<=t.clientHeight+1?!1:t.scrollTop+t.clientHeight>=t.scrollHeight-10}activeLineY(){return HT(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 t=this.activeLineY(),i=null;for(let r of this.headings)if(r.getBoundingClientRect().top<=t)i=r.id;else break;this.setActiveId(i??this.headings[0].id)}setActiveId(t){this.activeId!==t&&(this.activeId=t)}findHeadingById(t){return this.headings.find(i=>i.id===t)??null}hasPendingScrollReachedTarget(t){return t.getBoundingClientRect().top<=this.activeLineY()}onLinkClick(t,i){let r=t;if(r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.button!==0)return;let l=this.findHeadingById(i);l&&(t.preventDefault(),this.pendingScrollTargetId=i,this.setActiveId(i),this.scrollToHeading(i,l))}scrollToHeading(t,i){let r=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth";window.history.replaceState(window.history.state,"",`${window.location.pathname}${window.location.search}#${t}`),YT(i,this.scrollRoot??window,this.resolvedScrollOffset(),r)}render(){return this.entries.length===0?null:Ij("nav",{class:"rui-toc","aria-label":this.$.label,children:[this.label?Hr("p",{class:"rui-toc__label",children:this.$.label}):null,Hr("ul",{class:"rui-toc__list",children:this.entries.map(t=>Hr("li",{class:t.depth>=3?"rui-toc__item rui-toc__item--depth-3":"rui-toc__item",children:Hr("a",{href:`#${t.id}`,class:t.id===this.activeId?"rui-toc__link rui-toc__link--active":"rui-toc__link","on:click":i=>this.onLinkClick(i,t.id),children:t.label})}))})]})}static{NT()}};import{jsx as kj}from"@ecopages/jsx/jsx-runtime";function Vj(e){return kj("rui-toc",{...e})}import{RadiantElement as TE,customElement as Bj,onEvent as EE,prop as RE}from"@ecopages/radiant";var bE,vE,yE,_E,xE,wE;function Mj(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:SE(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||SE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:jj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Pj(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function jj(e){var t=Lj(e,"string");return typeof t=="symbol"?t:t+""}function Lj(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SE(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function Pj(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var IE,AE=class extends TE{static{({e:[yE,_E,xE,wE,bE],c:[IE,vE]}=Mj(this,[Bj("rui-toolbar")],[[RE({type:String,defaultValue:""}),0,"label"],[RE({type:Boolean,reflect:!0,defaultValue:!1}),0,"exclusiveToggles"],[EE({type:"keydown",selector:"button, a[href], input, select, [tabindex]"}),2,"onKeydown"],[EE({type:"click",selector:"button[data-toggle][aria-pressed]",options:{capture:!0}}),2,"onToggleButtonClick"]],0,void 0,TE))}constructor(...t){super(...t),wE(this)}label=(bE(this),yE(this));exclusiveToggles=(_E(this),xE(this));getItems(){return hr(this)}onConnected(){lt(this.getItems(),0)}onKeydown(t){let i=this.getItems(),r=t.target.closest("button, a[href], input, select, [tabindex]");ct({items:i,current:r,key:t.key,orientation:"horizontal"}).handled&&t.preventDefault()}getToggleButtons(){return Array.from(this.querySelectorAll("button[data-toggle][aria-pressed]")).filter(t=>!t.disabled)}onToggleButtonClick(t){let i=t.target.closest("button[data-toggle][aria-pressed]");if(!i||i.disabled)return;t.stopImmediatePropagation();let r=i.getAttribute("aria-pressed")==="true";if(this.exclusiveToggles){for(let l of this.getToggleButtons())l.setAttribute("aria-pressed","false");r||i.setAttribute("aria-pressed","true");return}i.setAttribute("aria-pressed",String(!r))}static{vE()}};import{jsx as CE}from"@ecopages/jsx/jsx-runtime";function Fj({children:e,label:t,...i}){return CE("rui-toolbar",{...i,label:t,children:CE("div",{class:"rui-toolbar","data-ref":"root",role:"toolbar","aria-label":t||void 0,children:e})})}import{jsx as Mo,jsxs as $j}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as zE,bound as qE,customElement as Gj,onEvent as jo,onUpdated as Wj,prop as Lo,query as Hj}from"@ecopages/radiant";var DE,OE,kE,VE,ME,jE,LE,PE,BE,FE;function Uj(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:UE(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||UE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:zj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Kj(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function zj(e){var t=qj(e,"string");return typeof t=="symbol"?t:t+""}function qj(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UE(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function Kj(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var KE=8,GE,$E=class extends zE{static{({e:[kE,VE,ME,jE,LE,PE,BE,FE,DE],c:[GE,OE]}=Uj(this,[Gj("rui-tooltip")],[[Lo({type:String,defaultValue:""}),0,"content"],[Lo({type:String,defaultValue:"top"}),0,"placement"],[Lo({type:Number,defaultValue:200}),0,"delay"],[Hj({ref:"tooltip"}),0,"tooltipTarget"],[Wj(["content","placement"]),2,"onDescribedPropsUpdated"],[jo({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[jo({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[jo({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[qE,2,"onPointerEnter"],[qE,2,"onPointerLeave"]],0,void 0,zE))}content=(DE(this),kE(this));placement=(VE(this),ME(this));delay=(jE(this),LE(this));tooltipTarget=(PE(this),BE(this));open=(FE(this),!1);showTimer=null;hideTimer=null;tooltipId=`rui-tooltip-${Math.random().toString(36).slice(2,9)}`;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 Ye(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=ur({anchor:this.getAnchor(),floating:this.tooltipTarget,getPlacement:()=>this.placement,gap:KE}))}onDescribedPropsUpdated(){this.wireTrigger(),this.open&&this.tooltipTarget&&Sn(this.getAnchor(),this.tooltipTarget,this.placement,KE)}setOpen(t){this.clearTimers(),this.open=t,this.tooltipTarget&&(this.tooltipTarget.hidden=!t,t?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(t){!this.open||t.key!=="Escape"||this.setOpen(!1)}onFocusIn(){this.scheduleShow()}onFocusOut(t){let i=t.relatedTarget;i&&this.contains(i)||this.scheduleHide()}onPointerEnter(){this.scheduleShow()}onPointerLeave(){this.scheduleHide()}render(){return $j("span",{class:"rui-tooltip",children:[Mo("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:Mo("slot",{})}),Mo("span",{"data-ref":"tooltip",id:this.tooltipId,class:"rui-tooltip__content rui-floating",role:"tooltip",hidden:!0,children:this.$.content})]})}static{OE()}};import{jsx as Po,jsxs as Yj}from"@ecopages/jsx/jsx-runtime";function Xj({children:e,content:t="",...i}){return Po("rui-tooltip",{content:t,...i,children:Yj("span",{class:"rui-tooltip",children:[Po("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:e}),Po("span",{class:"rui-tooltip__content rui-floating","data-ref":"tooltip",role:"tooltip",hidden:!0,children:t})]})})}import{RadiantElement as eR,customElement as tL,event as eL,onEvent as iR,onUpdated as iL,prop as rR}from"@ecopages/radiant";var WE,HE,YE,XE,NE,QE,JE,ZE;function Nj(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:tR(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||tR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:Qj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Zj(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function Qj(e){var t=Jj(e,"string");return typeof t=="symbol"?t:t+""}function Jj(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tR(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function Zj(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var oR,nR=class extends eR{static{({e:[YE,XE,NE,QE,JE,ZE,WE],c:[oR,HE]}=Nj(this,[tL("rui-tree")],[[rR({type:String,defaultValue:""}),0,"label"],[rR({type:String,reflect:!0,defaultValue:""}),0,"value"],[eL({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[iL("value"),2,"onValueUpdated"],[iR({selector:'[role="treeitem"]',type:"click"}),2,"onClick"],[iR({selector:'[role="treeitem"]',type:"keydown"}),2,"onKeydown"]],0,void 0,eR))}label=(WE(this),YE(this));value=(XE(this),NE(this));changeEvent=(QE(this),JE(this));getVisibleItems(){return Array.from(this.querySelectorAll('[role="treeitem"]')).filter(t=>{let i=t.parentElement;for(;i&&i!==this;){if(i.getAttribute("role")==="group"&&i.hidden)return!1;i=i.parentElement}return!0})}getParentItem(t){let i=t.closest('[role="group"]');if(!i)return null;let r=i.previousElementSibling;return r?.getAttribute("role")==="treeitem"?r:null}getSiblingItems(t){let i=this.getParentItem(t),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 t=Array.from(this.querySelectorAll('[role="treeitem"]')),i=this.getVisibleItems(),r=0;t.forEach((l,h)=>{let d=l.getAttribute("data-value")||l.id||"",a=!!this.value&&d===this.value;if(l.setAttribute("aria-selected",String(a)),a){let E=i.indexOf(l);E>=0&&(r=E)}else!this.value&&h===0&&(r=0)}),lt(i,r)}syncExpanded(){let t=Array.from(this.querySelectorAll('[role="treeitem"]'));for(let i of t){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(t){let i=t.getAttribute("data-value")||t.id||t.textContent?.trim()||"";this.value=i,this.syncSelection(),this.changeEvent.emit({value:i}),t.focus()}setExpanded(t,i){t.setAttribute("aria-expanded",String(i));let r=t.nextElementSibling;r?.getAttribute("role")==="group"&&(r.hidden=!i),this.syncSelection()}onClick(t){let i=t.target.closest('[role="treeitem"]');!i||!this.contains(i)||(i.hasAttribute("aria-expanded")&&this.setExpanded(i,i.getAttribute("aria-expanded")!=="true"),this.select(i))}onKeydown(t){let i=t.target.closest('[role="treeitem"]');!i||!this.treeKeyHandlers[t.key]?.call(this,i,t)||t.preventDefault()}treeKeyHandlers=(ZE(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(t,i){return ct({items:this.getVisibleItems(),current:t,key:i.key,orientation:"vertical",wrap:!1}).handled}expandOrEnterChild(t){return t.getAttribute("aria-expanded")==="false"?(this.setExpanded(t,!0),!0):t.getAttribute("aria-expanded")!=="true"?!1:(this.focusAdjacentVisibleItem(t,1),!0)}collapseOrFocusParent(t){if(t.getAttribute("aria-expanded")==="true")return this.setExpanded(t,!1),!0;let i=this.getParentItem(t);return i&&this.focusVisibleItem(i),!!i}expandSiblings(t){for(let i of this.getSiblingItems(t))i.hasAttribute("aria-expanded")&&this.setExpanded(i,!0);return!0}toggleAndSelect(t){return t.hasAttribute("aria-expanded")&&this.setExpanded(t,t.getAttribute("aria-expanded")!=="true"),this.select(t),!0}selectTreeItem(t){return this.select(t),!0}focusAdjacentVisibleItem(t,i){let r=this.getVisibleItems(),l=r.indexOf(t);r[l+i]&&Ge(r,l+i)}focusVisibleItem(t){let i=this.getVisibleItems(),r=i.indexOf(t);r>=0&&Ge(i,r)}static{HE()}};import{Fragment as aR,jsx as le,jsxs as rL}from"@ecopages/jsx/jsx-runtime";var sR=({nodes:e})=>le(aR,{children:e.map(t=>le("li",{class:"rui-tree__item",children:t.children?.length?rL(aR,{children:[le("button",{type:"button",class:"rui-tree__node",role:"treeitem","data-value":t.id,"aria-expanded":t.expanded??!1,"aria-selected":"false",tabindex:-1,children:t.label}),le("ul",{role:"group",children:le(sR,{nodes:t.children})})]}):le("button",{type:"button",class:"rui-tree__node",role:"treeitem","data-value":t.id,"aria-selected":"false",tabindex:-1,children:t.label})}))});function nL({nodes:e,label:t,children:i,...r}){let l=e!=null?le(sR,{nodes:e}):i;return le("rui-tree",{...r,label:t,children:le("ul",{class:"rui-tree","data-ref":"root",role:"tree","aria-label":t||void 0,"aria-multiselectable":"false",children:l})})}import{RadiantElement as bR,customElement as uL,event as cL,onEvent as vR,onUpdated as dL,prop as yR}from"@ecopages/radiant";var lR,uR,cR,dR,hR,pR,fR,mR;function oL(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:gR(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||gR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:aL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return lL(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function aL(e){var t=sL(e,"string");return typeof t=="symbol"?t:t+""}function sL(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gR(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function lL(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var xR,_R=class extends bR{static{({e:[cR,dR,hR,pR,fR,mR,lR],c:[xR,uR]}=oL(this,[uL("rui-treegrid")],[[yR({type:String,defaultValue:""}),0,"label"],[yR({type:String,reflect:!0,defaultValue:""}),0,"value"],[cL({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[dL("value"),2,"onValueUpdated"],[vR({selector:'[role="gridcell"]',type:"click"}),2,"onCellClick"],[vR({selector:'[role="gridcell"]',type:"keydown"}),2,"onCellKeydown"]],0,void 0,bR))}label=(lR(this),cR(this));value=(dR(this),hR(this));changeEvent=(pR(this),fR(this));getDataRows(){return Array.from(this.querySelectorAll('[role="row"][data-row-id]'))}getVisibleRows(){return this.getDataRows().filter(t=>{let i=t.parentElement;for(;i&&i!==this;){if(i.getAttribute("role")==="rowgroup"&&i.hidden)return!1;i=i.parentElement}return!0})}getRowCells(t){return Array.from(t.children).filter(i=>i instanceof HTMLElement&&i.getAttribute("role")==="gridcell")}getVisibleCells(){return this.getVisibleRows().flatMap(t=>this.getRowCells(t))}getParentRow(t){let i=t.parentElement;if(!i||i.getAttribute("role")!=="rowgroup")return null;let r=i.previousElementSibling;return r?.getAttribute("role")==="row"?r:null}syncExpanded(){for(let t of this.getDataRows()){if(!t.hasAttribute("aria-expanded"))continue;let i=t.nextElementSibling;i?.getAttribute("role")==="rowgroup"&&(i.hidden=t.getAttribute("aria-expanded")==="false")}}syncSelection(){let t=this.getVisibleCells(),i=0;for(let r of this.getDataRows()){let l=r.getAttribute("data-row-id")??"",h=!!this.value&&l===this.value;for(let d of this.getRowCells(r))if(d.setAttribute("aria-selected",String(h)),h){let a=t.indexOf(d);a>=0&&(i=a)}}t.length>0&<(t,i)}onConnected(){this.syncExpanded(),this.syncSelection()}onValueUpdated(){this.syncSelection()}setExpanded(t,i){t.setAttribute("aria-expanded",String(i));let r=t.nextElementSibling;r?.getAttribute("role")==="rowgroup"&&(r.hidden=!i)}activateCell(t){let i=t.closest('[role="row"][data-row-id]');if(!i)return;let r=i.getAttribute("data-row-id")??"",l=this.getRowCells(i).indexOf(t);this.value=r,this.syncSelection(),this.changeEvent.emit({rowId:r,columnIndex:l}),t.focus()}focusCell(t,i){if(this.getVisibleRows().indexOf(t)<0)return;let h=this.getVisibleCells(),d=this.getRowCells(t),a=d[Math.min(Math.max(0,i),d.length-1)],E=h.indexOf(a);E>=0&&Ge(h,E)}onCellClick(t){let i=t.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(t){let i=t.target.closest('[role="gridcell"]'),r=i?.closest('[role="row"][data-row-id]');if(!i||!r)return;let l=this.createCellContext(i,r),h=this.cellKeyHandlers[t.key];h&&(t.preventDefault(),h.call(this,l))}cellKeyHandlers=(mR(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(t,i){return{cell:t,columnIndex:this.getRowCells(i).indexOf(t),row:i,rowCells:this.getRowCells(i),visibleRows:this.getVisibleRows()}}moveRight(t){this.setExpandedFromFirstCell(t,!0)||t.columnIndex<t.rowCells.length-1&&this.focusCell(t.row,t.columnIndex+1)}moveLeft(t){if(this.setExpandedFromFirstCell(t,!1))return;if(t.columnIndex>0){this.focusCell(t.row,t.columnIndex-1);return}let i=this.getParentRow(t.row);i&&this.focusCell(i,0)}moveDown(t){this.focusAdjacentRow(t,1)}moveUp(t){this.focusAdjacentRow(t,-1)}focusAdjacentRow(t,i){let r=t.visibleRows.indexOf(t.row),l=t.visibleRows[r+i];l&&this.focusCell(l,t.columnIndex)}focusFirstCell(t){this.focusCell(t.row,0)}focusLastCell(t){this.focusCell(t.row,t.rowCells.length-1)}expandAllRows(){for(let t of this.getDataRows())t.hasAttribute("aria-expanded")&&this.setExpanded(t,!0);this.syncSelection()}toggleOrActivateCell(t){this.toggleExpansionFromFirstCell(t)||this.activateCell(t.cell)}activateContextCell(t){this.activateCell(t.cell)}setExpandedFromFirstCell(t,i){let r=t.row.getAttribute("aria-expanded")==="true";return t.columnIndex!==0||!t.row.hasAttribute("aria-expanded")||r===i?!1:(this.setExpanded(t.row,i),this.syncSelection(),!0)}toggleExpansionFromFirstCell(t){return t.columnIndex!==0||!t.row.hasAttribute("aria-expanded")?!1:(this.setExpanded(t.row,t.row.getAttribute("aria-expanded")!=="true"),this.syncSelection(),!0)}static{uR()}};import{Fragment as Bo,jsx as ie,jsxs as wR}from"@ecopages/jsx/jsx-runtime";var SR=({rows:e})=>ie(Bo,{children:e.map(t=>wR(Bo,{children:[ie("div",{class:"rui-treegrid__row",role:"row","data-row-id":t.id,"aria-expanded":t.children?.length?t.expanded??!1:void 0,children:t.cells.map((i,r)=>ie("div",{class:"rui-treegrid__cell",role:"gridcell",tabindex:-1,"data-col":r,"aria-selected":"false",children:i}))}),t.children?.length?ie("div",{class:"rui-treegrid__group",role:"rowgroup",hidden:!(t.expanded??!1),children:ie(SR,{rows:t.children})}):null]}))});function hL({columns:e,rows:t,label:i,children:r,...l}){let h=e!=null&&t!=null?wR(Bo,{children:[ie("div",{class:"rui-treegrid__row rui-treegrid__row--header",role:"row",children:e.map(d=>ie("div",{class:"rui-treegrid__cell rui-treegrid__cell--header",role:"columnheader",children:d}))}),ie(SR,{rows:t})]}):r;return ie("rui-treegrid",{...l,label:i,children:ie("div",{class:"rui-treegrid","data-ref":"root",role:"treegrid","aria-label":i||void 0,children:h})})}import{RadiantElement as FR,bound as UR,customElement as bL,event as vL,onEvent as zR,onUpdated as yL,prop as Fo,query as qR}from"@ecopages/radiant";var TR,ER,RR,AR,IR,CR,DR,OR,kR,VR,MR,jR,LR,PR;function pL(e,t,i,r,l,h){var d,a,E,A,S,D,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,P=Object.create,G=[P(null),P(null)],W=t.length;function O(n,g,f){return function(o,s){g&&(s=o,o=e);for(var b=0;b<n.length;b++)s=n[b].apply(o,f?[s]:[]);return f?s: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,s,b,w,m,v,y,X){function B(c){if(!X(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),N=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function V(c,R,et){return function(j,it){return R&&(it=j,j=n),et&&et(j),u[c].call(j,it)}}if(!U){var u={},z=[],x=Q?"get":J||I?"set":"value";if(v?(y||I?u={get:BR(function(){return N(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=N,y||BR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=s<3?1:s}}for(var p=n,M=F.length-1;M>=0;M-=f?2:1){var Z=_(F[M],"A decorator","be",!0),tt=f?F[M-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,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(tt,p,C),q.v=1,_(a,"class decorators","return")&&(p=a);else if(C.static=m,C.private=v,a=C.access={has:v?X.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:V("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?V("set",0,B):function(c,R){c[o]=R}),p=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){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 s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,V("get",m),V("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:d})}return h!==void 0&&(d=h[K]),d=P(d??null),S=[],D=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],s=o[1],b=7&s;if((8&s)==n&&!b==g){var w=o[2],m=!!o[3],v=16&s;H(n?e:e.prototype,o,v,m?"#"+w:fL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return gL(y)===e}:l)}}},T(8,0),T(0,0),T(8,1),T(0,1),D(E),D(A),a=S,W||Y(e),{e:a,get c(){var n=[];return W&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function fL(e){var t=mL(e,"string");return typeof t=="symbol"?t:t+""}function mL(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BR(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function gL(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var $R,KR=class extends FR{static{({e:[RR,AR,IR,CR,DR,OR,kR,VR,MR,jR,LR,PR,TR],c:[$R,ER]}=pL(this,[bL("rui-window-splitter")],[[Fo({type:Number,reflect:!0,defaultValue:50}),0,"value"],[Fo({type:String,defaultValue:"horizontal"}),0,"orientation"],[Fo({type:String,defaultValue:"Split view"}),0,"label"],[qR({ref:"primary"}),0,"primaryTarget"],[qR({ref:"separator"}),0,"separatorTarget"],[vL({name:"rui-splitter-change",bubbles:!0,composed:!0}),0,"changeEvent"],[yL(["value","orientation","label"]),2,"onPropsUpdated"],[zR({ref:"separator",type:"keydown"}),2,"onKeydown"],[zR({ref:"separator",type:"pointerdown"}),2,"onPointerDown"],[UR,2,"onPointerMove"],[UR,2,"onPointerUp"]],0,void 0,FR))}value=(TR(this),RR(this));orientation=(AR(this),IR(this));label=(CR(this),DR(this));primaryTarget=(OR(this),kR(this));separatorTarget=(VR(this),MR(this));changeEvent=(jR(this),LR(this));dragging=(PR(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 t=this.separatorTarget,i=this.querySelector('[data-ref="root"]');if(!t||!i)return;let r=this.orientation!=="vertical";i.classList.toggle("rui-window-splitter--horizontal",r),i.classList.toggle("rui-window-splitter--vertical",!r),t.setAttribute("aria-orientation",r?"vertical":"horizontal"),t.setAttribute("aria-valuenow",String(this.value)),t.setAttribute("aria-valuemin","20"),t.setAttribute("aria-valuemax","80"),t.setAttribute("aria-label",this.label)}applySize(){if(!this.primaryTarget)return;let t=`${Math.min(80,Math.max(20,this.value))}%`;this.orientation==="vertical"?(this.primaryTarget.style.height=t,this.primaryTarget.style.width=""):(this.primaryTarget.style.width=t,this.primaryTarget.style.height="")}onKeydown(t){let i=t.shiftKey?10:2,r=this.orientation!=="vertical";r&&t.key==="ArrowLeft"||!r&&t.key==="ArrowUp"?(t.preventDefault(),this.updateValue(Math.max(20,this.value-i))):r&&t.key==="ArrowRight"||!r&&t.key==="ArrowDown"?(t.preventDefault(),this.updateValue(Math.min(80,this.value+i))):t.key==="Home"?(t.preventDefault(),this.updateValue(20)):t.key==="End"&&(t.preventDefault(),this.updateValue(80))}updateValue(t){t!==this.value&&(this.value=t,this.changeEvent.emit({value:t}))}onPointerDown(t){this.dragging=!0,this.separatorTarget.setPointerCapture(t.pointerId),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)}onPointerMove(t){if(!this.dragging)return;let i=this.getBoundingClientRect();this.orientation==="vertical"?this.updateValue(Math.min(80,Math.max(20,(t.clientY-i.top)/i.height*100))):this.updateValue(Math.min(80,Math.max(20,(t.clientX-i.left)/i.width*100)))}onPointerUp(){this.dragging=!1,document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp)}static{ER()}};import{jsx as Yr,jsxs as _L}from"@ecopages/jsx/jsx-runtime";function xL({primary:e,secondary:t,orientation:i="horizontal",...r}){return Yr("rui-window-splitter",{...r,orientation:i,children:_L("div",{class:L("rui-window-splitter",i!=="vertical"?"rui-window-splitter--horizontal":"rui-window-splitter--vertical"),"data-ref":"root",children:[Yr("div",{"data-ref":"primary",class:"rui-window-splitter__pane",children:e}),Yr("div",{"data-ref":"separator",class:"rui-window-splitter__separator",role:"separator",tabindex:0}),Yr("div",{"data-ref":"secondary",class:"rui-window-splitter__pane",children:t})]})})}export{Yi as DEFAULT_TOAST_POSITION,Ci as FormStore,$t as RUI_CONTROL_ATTR,Bn as RUI_DIALOG_ACTION_EVENT,mr as RUI_DIALOG_CLOSE_EVENT,oe as RUI_DIALOG_HOST_ID,fr as RUI_DIALOG_OPEN_EVENT,gr as RUI_DIALOG_TOGGLE_EVENT,Tr as RUI_FIELD_DESCRIPTION_ATTR,Qe as RUI_FIELD_ERROR_ATTR,Sr as RUI_FIELD_LABEL_ATTR,Kn as RUI_FIELD_MANAGED_ATTR,Gi as RUI_TOAST_DISMISS_EVENT,$i as RUI_TOAST_SHOW_EVENT,oA as RuiAlert,nA as RuiAlertDescription,sa as RuiAlertElement,iA as RuiAlertIcon,rA as RuiAlertTitle,Zr as RuiAutocomplete,Qr as RuiAutocompleteCollection,ya as RuiAutocompleteElement,Jr as RuiAutocompleteEmpty,pA as RuiAutocompleteInput,gA as RuiAvatar,vA as RuiBadge,EA as RuiBreadcrumb,Ca as RuiBreadcrumbElement,OA as RuiBreadcrumbEllipsis,AA as RuiBreadcrumbItem,IA as RuiBreadcrumbLink,RA as RuiBreadcrumbList,CA as RuiBreadcrumbPage,DA as RuiBreadcrumbSeparator,ne as RuiButton,jA as RuiButtonGroup,gi as RuiCalendar,Es as RuiCalendarElement,gI as RuiCarousel,ol as RuiCarouselElement,ll as RuiCarouselNext,sl as RuiCarouselPrev,ul as RuiCarouselRotation,al as RuiCarouselSlide,vi as RuiCheckbox,ar as RuiCheckboxElement,LI as RuiCheckboxGroup,Hl as RuiCheckboxGroupControl,Wl as RuiCheckboxGroupElement,BI as RuiChip,FI as RuiChipList,UI as RuiChipListItem,TC as RuiCombobox,SC as RuiComboboxClear,Sc as RuiComboboxControl,Ru as RuiComboboxElement,Tc as RuiComboboxInput,Ac as RuiComboboxListbox,Ec as RuiComboboxTrigger,Rc as RuiComboboxValue,jC as RuiCycleToggle,Wc as RuiCycleToggleButton,Gc as RuiCycleToggleElement,MC as RuiCycleToggleItem,HC as RuiDateField,qd as RuiDateFieldCalendar,Bd as RuiDateFieldControl,Ld as RuiDateFieldElement,Fd as RuiDateFieldInput,zd as RuiDateFieldPopover,Ud as RuiDateFieldToggle,iD as RuiDateRangePicker,zh as RuiDateRangePickerCalendar,Mh as RuiDateRangePickerControl,Vh as RuiDateRangePickerElement,Ph as RuiDateRangePickerEndInput,jh as RuiDateRangePickerInputs,Uh as RuiDateRangePickerPopover,Bh as RuiDateRangePickerSeparator,Lh as RuiDateRangePickerStartInput,Fh as RuiDateRangePickerToggle,hD as RuiDialog,mp as RuiDialogActions,fp as RuiDialogBody,gp as RuiDialogClose,cp as RuiDialogElement,pp as RuiDialogTitle,FD as RuiDisclosure,yr as RuiDisclosureElement,UD as RuiDisclosureGroup,Hp as RuiDisclosureGroupElement,Np as RuiDisclosureIcon,Jp as RuiDisclosurePanel,Qp as RuiDisclosureTrigger,zD as RuiFeed,qD as RuiFeedArticle,GD as RuiFeedArticleActions,$D as RuiFeedArticleContent,KD as RuiFeedArticleHeader,WD as RuiFeedByline,HD as RuiFeedBylineBody,YD as RuiFeedMeta,g1 as RuiField,v1 as RuiFieldDescription,jf as RuiFieldElement,_1 as RuiFieldError,V1 as RuiForm,pm as RuiFormElement,z1 as RuiGrid,wm as RuiGridElement,G1 as RuiHeading,Y1 as RuiHeadingDescription,W1 as RuiHeadingEyebrow,H1 as RuiHeadingTitle,to as RuiHeadline,aO as RuiHoverCard,oO as RuiHoverCardContent,Nm as RuiHoverCardElement,nO as RuiHoverCardTrigger,li as RuiIconCalendar,ui as RuiIconCheck,we as RuiIconChevronDown,Xr as RuiIconChevronLeft,Nr as RuiIconChevronRight,Rt as RuiIconX,lO as RuiInput,uO as RuiInputGroup,cO as RuiInputGroupAddon,dO as RuiInputGroupText,TO as RuiKnob,Xg as RuiKnobElement,CO as RuiLabel,He as RuiListbox,Hu as RuiListboxElement,Rn as RuiListboxOption,Yu as RuiListboxOptionIndicator,$O as RuiMenuButton,yb as RuiMenuButtonContent,gb as RuiMenuButtonElement,xb as RuiMenuButtonItem,_b as RuiMenuButtonSubmenuContent,vb as RuiMenuButtonTrigger,ZO as RuiMenubar,Ob as RuiMenubarElement,kb as RuiMenubarMenu,Vb as RuiMenubarMenuItem,Mb as RuiMenubarSubmenuContent,uk as RuiMeter,Nb as RuiMeterElement,vk as RuiNavigationMenu,gk as RuiNavigationMenuBar,nv as RuiNavigationMenuElement,_k as RuiNavigationMenuLink,xk as RuiNavigationMenuPanel,bk as RuiNavigationMenuPanels,yk as RuiNavigationMenuTrigger,Ok as RuiNumberField,ty as RuiNumberFieldDecrementButton,Yv as RuiNumberFieldElement,Nv as RuiNumberFieldGroup,Zv as RuiNumberFieldIncrementButton,Qv as RuiNumberFieldInput,Jv as RuiNumberFieldSteppers,Uk as RuiPagination,vy as RuiPaginationElement,yy as RuiPaginationNav,Hk as RuiPopover,Wk as RuiPopoverContent,t_ as RuiPopoverElement,Yk as RuiPopoverTrigger,e_ as RuiPopoverTriggerElement,__ as RuiRadio,nV as RuiRadioGroup,y_ as RuiRadioGroupControl,v_ as RuiRadioGroupElement,vV as RuiSelect,fV as RuiSelectClear,$_ as RuiSelectControl,q_ as RuiSelectElement,Y_ as RuiSelectListbox,mV as RuiSelectSearch,W_ as RuiSelectToggle,G_ as RuiSelectTrigger,H_ as RuiSelectValue,Mi as RuiSeparator,tM as RuiSidebar,$V as RuiSidebarContent,t0 as RuiSidebarElement,GV as RuiSidebarFooter,HV as RuiSidebarGroup,YV as RuiSidebarGroupAction,XV as RuiSidebarGroupHeader,w0 as RuiSidebarGroupLabel,KV as RuiSidebarHeader,ZV as RuiSidebarInset,NV as RuiSidebarMenu,JV as RuiSidebarMenuAction,S0 as RuiSidebarMenuButton,QV as RuiSidebarMenuItem,qV as RuiSidebarProvider,WV as RuiSidebarSeparator,iM as RuiSidebarTrigger,x0 as RuiSidebarTriggerElement,dM as RuiSlider,Cw as RuiSliderElement,Dw as RuiSliderValue,pM as RuiSpinner,EM as RuiSwitch,Ww as RuiSwitchElement,YM as RuiTab,HM as RuiTabList,NM as RuiTabPanel,XM as RuiTabPanels,FM as RuiTable,kM as RuiTableBody,LM as RuiTableCell,MM as RuiTableColumn,bS as RuiTableElement,BM as RuiTableEmptyState,VM as RuiTableFooter,OM as RuiTableHeader,jM as RuiTableRow,PM as RuiTableSelectionCell,QM as RuiTabs,jS as RuiTabsElement,_c as RuiTag,wi as RuiTagGroup,bc as RuiTagGroupElement,yc as RuiTagList,xc as RuiTagRemove,ZM as RuiTextarea,vj as RuiToast,hT as RuiToastElement,yj as RuiToaster,qT as RuiToasterElement,Vj as RuiToc,gE as RuiTocElement,Fj as RuiToolbar,IE as RuiToolbarElement,Xj as RuiTooltip,GE as RuiTooltipElement,nL as RuiTree,oR as RuiTreeElement,hL as RuiTreegrid,xR as RuiTreegridElement,xL as RuiWindowSplitter,$R as RuiWindowSplitterElement,Ro as TOAST_COLLAPSED_PEEK,Ao as TOAST_EXIT_MS,So as TOAST_GAP,Wi as TOAST_LIFETIME,tj as TOAST_POSITIONS,Hi as TOAST_SWIPE_THRESHOLD,To as TOAST_VIEWPORT_OFFSET,Eo as TOAST_VISIBLE_AMOUNT,wo as TOAST_WIDTH,Xc as ThemeItemLabel,Yc as ThemePreferenceIcon,PC as ThemePreferenceItemContent,wD as closeDialog,TD as createDialogHandle,Jn as createRulesResolver,L as cx,Cn as cycleValue,wj as dismissToast,Nn as fieldContext,Ii as findFieldControl,Ze as formContext,_D as getOpenDialogId,Tp as installDialogs,Je as isNativeTextControl,xD as openDialog,Hn as readControlValue,Pf as runRulesResolver,xj as showToast,_j as toast,SD as toggleDialog,Fn as uninstallDialogs,nt as withDefaultAriaLabel,Yn as writeControlValue};
|
|
1
|
+
function ne(t,e){return e===void 0||t?.label!==void 0?t:{...t,label:e}}function j(...t){return t.filter(Boolean).join(" ")}import{jsx as dr,jsxs as lI}from"@ecopages/jsx/jsx-runtime";function xi({class:t,size:e="sm",...i}){return lI("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 Ia}from"@ecopages/jsx/jsx-runtime";function wi({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:"m5 12 4 4L19 6"})})}import{jsx as Ca}from"@ecopages/jsx/jsx-runtime";function Qe({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:"m6 9 6 6 6-6"})})}import{jsx as Da}from"@ecopages/jsx/jsx-runtime";function fn({class:t,size:e="sm",...i}){return Da("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Da("path",{d:"m15 18-6-6 6-6"})})}import{jsx as Oa}from"@ecopages/jsx/jsx-runtime";function mn({class:t,size:e="sm",...i}){return Oa("svg",{...i,class:j("rui-icon",e==="md"&&"rui-icon--md",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:Oa("path",{d:"m9 18 6-6-6-6"})})}import{jsx as Va,jsxs as uI}from"@ecopages/jsx/jsx-runtime";var ka="http://www.w3.org/2000/svg";function Re({class:t,size:e="sm",...i}){return uI("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:[Va("path",{d:"m18 6-12 12"}),Va("path",{d:"m6 6 12 12"})]})}function hr(){let t=document.createElementNS(ka,"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(ka,"path");i.setAttribute("d",e),t.append(i)}return t}import{RadiantElement as Ha,bound as fI,customElement as mI,event as gI,onEvent as bI,prop as pr}from"@ecopages/radiant";var Ma,La,Pa,ja,Fa,Ba,Ua,za,qa,Ka,$a,Ga;function cI(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:Wa(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Wa(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:dI(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 dI(t){var e=hI(t,"string");return typeof e=="symbol"?e:e+""}function hI(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 Wa(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 Na,Ya=class extends Ha{static{({e:[Pa,ja,Fa,Ba,Ua,za,qa,Ka,$a,Ga,Ma],c:[Na,La]}=cI(this,[mI("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"],[gI({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[fI,2,"dismiss"],[bI({selector:"[data-alert-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Ha))}constructor(...e){super(...e),Ga(this)}variant=(Ma(this),Pa(this));layout=(ja(this),Fa(this));dismissible=(Ba(this),Ua(this));closeLabel=(za(this),qa(this));closeEvent=(Ka(this),$a(this));dismiss(){this.isConnected&&(this.closeEvent.emit({reason:"dismiss"}),this.remove())}onCloseClick(e){e.stopPropagation(),this.dismissible&&this.dismiss()}static{La()}};import{jsx as ze,jsxs as Xa}from"@ecopages/jsx/jsx-runtime";var vI={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 yI({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=vI[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 _I({children:t,class:e,...i}){return ze("p",{...i,class:j("rui-alert__title",e),children:t})}function xI({children:t,class:e,...i}){return ze("div",{...i,class:j("rui-alert__description",e),children:t})}function wI({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:Xa("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:Xa("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 ns,customElement as AI,onEvent as II,onUpdated as CI,prop as os}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 Qa,Ja,Za,es,ts,is;function TI(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:rs(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||rs(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:SI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return RI(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 SI(t){var e=EI(t,"string");return typeof e=="symbol"?e:e+""}function EI(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 rs(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 RI(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 ns{static{({e:[Za,es,ts,is,Qa],c:[ss,Ja]}=TI(this,[AI("rui-autocomplete")],[[os({type:String,defaultValue:"base"}),0,"sensitivity"],[os({type:String,attribute:"input-value",defaultValue:""}),0,"inputValue"],[CI(["sensitivity","inputValue"]),2,"onPropsUpdated"],[II({selector:"[data-autocomplete-input]",type:"input"}),2,"onInput"]],0,void 0,ns))}sensitivity=(Qa(this),Za(this));inputValue=(es(this),ts(this));externalInput=(is(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{Ja()}};import{jsx as Ht}from"@ecopages/jsx/jsx-runtime";function DI({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 OI({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(OI,{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 VI(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 kI({src:t,alt:e="",fallback:i,size:r="md",class:s,children:d,role:h,aria:a,...E}){let A=i??(e?VI(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 MI}from"@ecopages/jsx/jsx-runtime";function LI({children:t,variant:e="filled",class:i,...r}){return MI("span",{...r,class:j("rui-badge",`rui-badge--${e}`,i),children:t})}import{RadiantElement as fs,customElement as UI,prop as ms}from"@ecopages/radiant";var ls,us,cs,ds,hs;function PI(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: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=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:jI(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return BI(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 jI(t){var e=FI(t,"string");return typeof e=="symbol"?e:e+""}function FI(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 BI(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 bs,gs=class extends fs{static{({e:[us,cs,ds,hs],c:[bs,ls]}=PI(this,[UI("rui-breadcrumb")],[[ms({type:String,defaultValue:"Breadcrumb"}),0,"label"],[ms({type:String,defaultValue:"/"}),0,"separator"]],0,void 0,fs))}constructor(...e){super(...e),hs(this)}label=us(this);separator=(cs(this),ds(this));static{ls()}};import{jsx as Je,jsxs as zI}from"@ecopages/jsx/jsx-runtime";function qI({children:t,label:e,separator:i,...r}){return Je("rui-breadcrumb",{...r,label:e,separator:i,children:Je("nav",{class:"rui-breadcrumb","aria-label":e||"Breadcrumb",style:{"--rui-breadcrumb-separator":JSON.stringify(i||"/")},children:t})})}function KI({children:t,class:e,...i}){return Je("ol",{...i,class:j("rui-breadcrumb__list",e),children:t})}function $I({children:t,class:e,...i}){return Je("li",{...i,class:j("rui-breadcrumb__item",e),children:t})}function GI({children:t,href:e,class:i,...r}){return Je("a",{...r,class:j("rui-breadcrumb__link",i),href:e,children:t})}function WI({children:t,class:e,...i}){return Je("span",{...i,class:j("rui-breadcrumb__page",e),"aria-current":"page",children:t})}function HI({children:t,class:e,...i}){return Je("li",{...i,class:j("rui-breadcrumb__separator",e),role:"presentation","aria-hidden":"true",children:t})}function YI({label:t="More",class:e,...i}){return zI("span",{...i,class:j("rui-breadcrumb__ellipsis",e),role:"presentation","aria-hidden":"true",children:[Je("span",{"aria-hidden":"true",children:"\u2026"}),Je("span",{class:"rui-breadcrumb__ellipsis-label",children:t})]})}import{jsx as vs}from"@ecopages/jsx/jsx-runtime";function NI(t,e,i){if(t!==void 0)return t;if(e)return i}function XI(t,e){if(typeof t=="function"){t(e);return}t!=null&&typeof t=="object"&&"handleEvent"in t&&t.handleEvent(e)}function Ze(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 vs("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))}XI(I,$)};return vs("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":NI(E,S,A),"data-toggle":S&&E===void 0?"":void 0,"on:click":S||I?K:void 0,children:d})}import{jsx as QI}from"@ecopages/jsx/jsx-runtime";function JI({children:t,orientation:e="horizontal",class:i,...r}){return QI("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 bl,customElement as TC,event as SC,onEvent as kt,onUpdated as EC,prop as ft,registerSsrPreparationCallback as RC,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 et(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 ys(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=ys(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=ZI(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 ZI(t){return Array.isArray(t)?t[0]??navigator.language:t??navigator.language}function eC(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function tC(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function iC(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:rC(t.rangeDraft.anchor,s)}}return{mode:e,range:r}}return{mode:e,singleIso:i||void 0}}function rC(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=eC(i.today??new Date),d=iC(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 $=et(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:tC(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 _s=new Map;function nC(t,e){return`${JSON.stringify(t??null)}|${JSON.stringify(e)}`}function Vt(t,e){let i=nC(t,e),r=_s.get(i);if(r)return r;let s=new Intl.DateTimeFormat(t,e);return _s.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 oC={0:"digit",a:"letter","*":"any"},aC=/\p{L}/u;function sC(t,e){let i=e?.[t];if(i instanceof RegExp)return{kind:"any",pattern:i};if(i)return{kind:i};let r=oC[t];return r?{kind:r}:null}function xs(t,e,i){return i?i.test(t):e==="digit"?/\d/.test(t):e==="letter"?aC.test(t):t.length>0}function ws(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=lC(t,s+1);if(a<0){r.push({type:"literal",value:"["}),s+=1;continue}let E=ws(t.slice(s+1,a),e,!0);r.push(...E),s=a+1;continue}if(d==="]")break;let h=sC(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 lC(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 ws(t,e)}function Ts(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 Ss(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];xs(d,s.kind,s.pattern)&&(i+=d,r+=1)}return i}function Es(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(!xs(d,s.kind,s.pattern)){if(s.optional)continue;break}r+=d,i+=1}return r}function uC(t){return t.every(e=>e.type!=="input"||e.kind==="digit")}function cC(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=Ts(r),d=Ss(t,r);return d.length===0&&/\S/.test(t)&&uC(r)&&(d=cC(t,r)),d.length>s&&(d=d.slice(0,s)),Es(d,r)}var dC=new Date(2e3,0,1);function hC(t,e){return t==="year"?e==="year":t==="month"?e==="year"||e==="month":!0}function pC(t,e){let r=Vt(e,{[t]:t==="year"?"numeric":"2-digit"}).formatToParts(dC).find(s=>s.type===t);return r?r.value.replace(/\d/g,t==="year"?"y":t==="month"?"m":"d"):t==="year"?"yyyy":"mm"}function fC(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(!hC(r,a))return null;let E=t!=null;return{type:a,value:E?fC(a,t,e):"",placeholder:pC(a,e),isPlaceholder:!E,editable:!0}}).filter(h=>h!=null)}function mC(t){if(t.isPlaceholder||t.value==="")return null;let e=Number(t.value);return Number.isFinite(e)?e:null}function gC(t){return t>=100?t:t>=69?1900+t:2e3+t}function Rs(t){let e={};for(let r of t){if(!r.editable)continue;let s=mC(r);if(s==null)return null;e[r.type]=r.type==="year"?gC(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 As(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(As(t))return{kind:"empty"};let r=Rs(t);if(!r)return{kind:"incomplete"};let s=et(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 bC(t,e){return t.findIndex(i=>i.editable&&i.type===e)}function vC(t){return t.map(e=>({...e}))}function Ln(t,e,i){let r=vC(t),s=bC(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:Cs(t,e)}}function Cs(t,e){if(t==="month")return 12;if(t==="day"){let i=Is(e,"year"),r=Is(e,"month");return i!=null&&r!=null?new Date(i,r,0).getDate():31}return 9999}function Is(t,e){let i=t.find(r=>r.editable&&r.type===e);return!i||i.isPlaceholder||i.value===""?null:Number(i.value)}function Ds(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 Os(t,e){return Ln(t,e,{value:"",isPlaceholder:!0})}function Vs(t,e,i){return Ln(t,e,{value:Ds(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),Vs(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=Cs(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?Ds(e,E):String(E);return{segments:Ln(t,e,{value:I,isPlaceholder:!1}),enteredKeys:S?"":d,focusNext:S}}function ks(t){return t.filter(e=>e.editable).map(e=>e.type)}function Qt(t,e,i){let r=ks(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:Os(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 Ms,Ls,Ps,js,Fs,Bs,Us,zs,qs,Ks,$s,Gs,Ws,Hs,Ys,Ns,Xs,Qs,Js,Zs,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ml;function yC(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:gl(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||gl(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:_C(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wC(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 _C(t){var e=xC(t,"string");return typeof e=="symbol"?e:e+""}function xC(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 gl(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 wC(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 yl,vl=class extends bl{static{({e:[Ps,js,Fs,Bs,Us,zs,qs,Ks,$s,Gs,Ws,Hs,Ys,Ns,Xs,Qs,Js,Zs,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ml,Ms],c:[yl,Ls]}=yC(this,[TC("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"],[SC({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"],[EC(["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,bl))}value=(Ms(this),Ps(this));min=(js(this),Fs(this));max=(Bs(this),Us(this));disabled=(zs(this),qs(this));locale=(Ks(this),$s(this));selectionMode=(Gs(this),Ws(this));visibleMonths=(Hs(this),Ys(this));pageBehavior=(Ns(this),Xs(this));changeEvent=(Qs(this),Js(this));viewYear=(Zs(this),el(this,new Date().getFullYear()));viewMonth=(tl(this),il(this,new Date().getMonth()));focusedIso=(rl(this),nl(this,""));weekdayLabels=(ol(this),al(this,[]));monthPanels=(sl(this),ll(this,[]));todayLabel=(ul(this),cl(this,""));rangeAnchor=(dl(this),hl(this,null));rangeHover=(pl(this),fl(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=et(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=et(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(),ml(this),RC(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(et(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{Ls()}};import{jsx as AC}from"@ecopages/jsx/jsx-runtime";function Si({children:t,...e}){return AC("rui-calendar",{...e,children:t})}import{RadiantElement as au,bindTo as PC,customElement as jC,onEvent as Ae,onUpdated as Wn,prop as Se,query as wr}from"@ecopages/radiant";var IC=/^[A-Za-z][A-Za-z0-9_-]*$/;function _l(t){return IC.test(t)}function CC(t){let e=t.trim();if(_l(e))return e;let i=`rui-${e}`;return e&&_l(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`${CC(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 DC(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,DC(i,r)}onPointerCancel(e){this.pointerId===e.pointerId&&(this.pointerId=null)}};function Mt(t){return!Number.isFinite(t)||t<1?1:t}function xl(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 OC(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=OC(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 wl(t){let e=Mt(t);return e<=1?0:Math.ceil(e)-1}function Gn(t){let e=Mt(t.slidesPerView),i=xl(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=xl(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 Tl,Sl,El,Rl,Al,Il,Cl,Dl,Ol,Vl,kl,Ml,Ll,Pl,jl,Fl,Bl,Ul,zl,ql,Kl,$l,Gl,Wl,Hl,Yl,Nl,Xl,Ql,Jl,Zl,eu,tu,iu,ru,nu;function VC(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:ou(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ou(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:kC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return LC(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 kC(t){var e=MC(t,"string");return typeof e=="symbol"?e:e+""}function MC(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 ou(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 LC(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},lu,su=class extends au{static{({e:[El,Rl,Al,Il,Cl,Dl,Ol,Vl,kl,Ml,Ll,Pl,jl,Fl,Bl,Ul,zl,ql,Kl,$l,Gl,Wl,Hl,Yl,Nl,Xl,Ql,Jl,Zl,eu,tu,iu,ru,nu,Tl],c:[lu,Sl]}=VC(this,[jC("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"}),PC({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,au))}label=(Tl(this),El(this));index=(Rl(this),Al(this));autoplay=(Il(this),Cl(this));interval=(Dl(this),Ol(this));transition=(Vl(this),kl(this));controlsVariant=(Ml(this),Ll(this));showIndicators=(Pl(this),jl(this));showRotationControl=(Fl(this),Bl(this));loop=(Ul(this),zl(this));wrap=(ql(this),Kl(this));slidesPerView=($l(this),Gl(this));slidesPerGroup=(Wl(this),Hl(this));slideCount=(Yl(this),Nl(this));rootTarget=(Xl(this),Ql(this));trackTarget=(Jl(this),Zl(this));indicatorsTarget=(eu(this),tu(this));viewportTarget=(iu(this),ru(this));paused=(nu(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(wl(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{Sl()}};import{jsx as oe,jsxs as Lt}from"@ecopages/jsx/jsx-runtime";function uu({id:t,children:e,class:i,...r}){return oe("div",{...r,class:j("rui-carousel__slide",i),"data-slide":t,children:e})}function FC(){return Lt("span",{class:"rui-carousel__nav-label",children:[oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})}function BC(){return Lt("span",{class:"rui-carousel__nav-label",children:["Next",oe("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})}function cu({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"}):FC())})}function du({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"}):BC())})}function hu({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 UC({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(cu,{overlay:I}),$=s??oe(du,{overlay:I}),V=T?h??oe(hu,{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 zC({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(uu,{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(UC,{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 Iu,bindTo as Ii,customElement as WC,event as HC,onEvent as YC,prop as Ci}from"@ecopages/radiant";function gt(t){return t||void 0}var pu,fu,mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su,Eu,Ru;function qC(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:Au(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Au(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:KC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return GC(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 KC(t){var e=$C(t,"string");return typeof e=="symbol"?e:e+""}function $C(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 Au(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 GC(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,Cu=class extends Iu{static{({e:[mu,gu,bu,vu,yu,_u,xu,wu,Tu,Su,Eu,Ru,pu],c:[Tr,fu]}=qC(this,[WC("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"],[HC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[YC({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,Iu))}constructor(...e){super(...e),Ru(this)}checked=(pu(this),mu(this));indeterminate=(gu(this),bu(this));disabled=(vu(this),yu(this));value=(_u(this),xu(this));name=(wu(this),Tu(this));changeEvent=(Su(this),Eu(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{fu()}};import{jsx as Sr,jsxs as NC}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:NC("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 Yu,bindTo as Yn,customElement as iD,event as rD,onEvent as nD,onUpdated as oD,prop as Oi}from"@ecopages/radiant";function Du(t){return t?Vu(t.split(",")):[]}function XC(t){return t.join(",")}var Er={fromAttribute:t=>Du(t),toAttribute:t=>t.length>0?XC(t):null,fromProperty:t=>Array.isArray(t)?Vu(t.map(String)):typeof t=="string"?Du(t):[]},Ie={type:Array,reflect:!0,transform:Er};function tt(t){return Er.fromProperty?.(t)??[]}function Ou(t){return t?t.split(",").map(e=>Number(e.trim())).filter(e=>Number.isFinite(e)):[]}function QC(t){return t.join(",")}var Rr={fromAttribute:t=>Ou(t),toAttribute:t=>t.length>0?QC(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"?Ou(t):[]};function Vu(t){return[...new Set(t.map(e=>e.trim()).filter(Boolean))]}var ku,Mu,Lu,Pu,ju,Fu,Bu,Uu,zu,qu,Ku,$u,Gu,Wu;function JC(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:Hu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Hu(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:ZC(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return tD(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function ZC(t){var e=eD(t,"string");return typeof e=="symbol"?e:e+""}function eD(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 Hu(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 tD(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 Xu,Nu=class extends Yu{static{({e:[Lu,Pu,ju,Fu,Bu,Uu,zu,qu,Ku,$u,Gu,Wu,ku],c:[Xu,Mu]}=JC(this,[iD("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"],[rD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[oD(["value","name","disabled"]),2,"syncCheckboxes"],[nD({selector:"rui-checkbox",type:"rui-change"}),2,"onCheckboxChange"]],0,void 0,Yu))}constructor(...e){super(...e),Wu(this)}value=(ku(this),Lu(this));name=(Pu(this),ju(this));label=(Fu(this),Bu(this));disabled=(Uu(this),zu(this));orientation=(qu(this),Ku(this));changeEvent=($u(this),Gu(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{Mu()}};import{jsx as Ar}from"@ecopages/jsx/jsx-runtime";function Qu({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 aD({options:t,children:e,value:i,orientation:r="vertical",...s}){let d=tt(i),h=new Set(d);return Ar("rui-checkbox-group",{...s,value:d,orientation:r,children:t==null?e:Ar(Qu,{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 sD}from"@ecopages/jsx/jsx-runtime";function lD({children:t,variant:e="default",class:i,...r}){return sD("span",{...r,class:j("rui-chip",`rui-chip--${e}`,i),children:t})}import{jsx as Ju}from"@ecopages/jsx/jsx-runtime";function uD({children:t,class:e,...i}){return Ju("ul",{...i,class:j("rui-chip-list",e),children:t})}function cD({children:t,class:e,...i}){return Ju("li",{...i,class:j("rui-chip-list__item",e),children:t})}import{RadiantElement as Ic,bindTo as ED,customElement as RD,event as AD,onEvent as Pe,onUpdated as ID,prop as jt,query as CD}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 dD="data-listbox-option-indicator";function Pt(t){let e=t.getAttribute("data-label");return e||Zu(t).trim()}function Ce(t){return t.getAttribute("data-value")||Pt(t)}function Zu(t){if(hD(t))return"";if(t.nodeType===Node.TEXT_NODE)return t.textContent??"";let e="";for(let i of t.childNodes)e+=Zu(i);return e}function hD(t){return t instanceof HTMLElement&&t.hasAttribute(dD)}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 pD={top:"bottom",bottom:"top",left:"right",right:"left"},fD=8,Xn=new WeakMap;function mD(t){Xn.has(t)&&(t.style.width="",t.style.minWidth="",t.style.maxWidth="",t.style.boxSizing="",Xn.delete(t))}function gD(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 ic(t){return t==="top"||t==="bottom"?"y":"x"}function ec(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 ic(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 bD(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 tc(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 vD(t,e){return e==="center"?t:`${t}-${e}`}function yD(t,e,i,r){let{padding:s,width:d,height:h}=r;if(ic(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 _D(t,e,i,r,s={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:fD}){let{side:d,align:h}=gD(i),a=ec(t,e,d,h,r),E=bD(a,e,d,s),A=d,S=a;if(E>0){let I=pD[d],T=ec(t,e,I,h,r),K=tc(t,e,d,s);tc(t,e,I,s)>K&&(A=I,S=T)}return{coords:yD(S,e,A,s),placement:vD(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)):mD(e);let{coords:E,placement:A}=_D(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 rc(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 it(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=rc(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 nc(t){return t.filter(e=>!e.hidden&&e.getAttribute("aria-disabled")!=="true")}function oc(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 ac(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 nc(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,ac(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(oc(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 it(this.config.getAnchor(),this.popoverController.getFloatingElement(),e)}shouldDismissPointer(e){return Ke(this.config.getAnchor(),this.popoverController.getFloatingElement(),e)}destroy(){this.popoverController.destroy()}};var sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Tc,Sc,Ec,Rc;function xD(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:Ac(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ac(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:wD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return SD(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 wD(t){var e=TD(t,"string");return typeof e=="symbol"?e:e+""}function TD(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 Ac(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 SD(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 Dc,Cc=class extends Ic{static{({e:[uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Tc,Sc,Ec,Rc,sc],c:[Dc,lc]}=xD(this,[RD("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}),ED({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"],[AD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[CD({ref:"root"}),0,"rootTarget"],[ID(["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,Ic))}constructor(...e){super(...e),Rc(this)}value=(sc(this),uc(this));label=(cc(this),dc(this));placeholder=(hc(this),pc(this));disabled=(fc(this),mc(this));selectionMode=(gc(this),bc(this));shouldCloseOnSelect=(vc(this),yc(this));triggerKind=(_c(this),xc(this));changeEvent=(wc(this),Tc(this));open=(Sc(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=Ec(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{lc()}};import{jsx as ae,jsxs as io}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Yc,bindTo as LD,customElement as PD,event as jD,onEvent as Nc,onUpdated as FD,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 DD(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=DD(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 Oc,Vc,kc,Mc,Lc,Pc,jc,Fc,Bc,Uc,zc,qc,Kc,$c,Gc,Wc;function OD(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:Hc(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Hc(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:VD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return MD(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 VD(t){var e=kD(t,"string");return typeof e=="symbol"?e:e+""}function kD(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 Hc(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 MD(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 Qc,Xc=class extends Yc{static{({e:[kc,Mc,Lc,Pc,jc,Fc,Bc,Uc,zc,qc,Kc,$c,Gc,Wc,Oc],c:[Qc,Vc]}=OD(this,[PD("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"}),LD({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"],[jD({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[FD(["value","label","disabled","embedded","selectionMode"]),2,"onPropsUpdated"],[Nc({selector:'[role="option"]',type:"click"}),2,"onOptionClick"],[Nc({selector:'[role="option"]',type:"keydown"}),2,"onOptionKeydown"]],0,void 0,Yc))}value=(Oc(this),kc(this));label=(Mc(this),Lc(this));disabled=(Pc(this),jc(this));selectionMode=(Fc(this),Bc(this));embedded=(Uc(this),zc(this));bordered=(qc(this),Kc(this));changeEvent=($c(this),Gc(this));uid=(Wc(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{Vc()}};import{jsx as Ft,jsxs as BD}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 Jc({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 UD(t,e){return e??!t}function zD({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=UD(r,s),S=tt(i),I=new Set(S);return Ft("rui-listbox",{...E,value:S,embedded:r,bordered:s,label:d,disabled:h,selectionMode:a,children:Ft(zD,{bordered:A,disabled:h,embedded:r,label:d,selectionMode:a,children:t!=null?t.map(T=>BD(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(Jc,{}):null]})):e})})}import{RadiantElement as vd,customElement as WD,event as yd,onEvent as to,onUpdated as HD,prop as ki,state as YD}from"@ecopages/radiant";var Zc,ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,gd;function qD(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:bd(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||bd(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:KD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return GD(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 KD(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 bd(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 GD(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 xd,_d=class extends vd{static{({e:[td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,gd,Zc],c:[xd,ed]}=qD(this,[WD("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"],[yd({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[yd({name:"rui-remove",bubbles:!0,composed:!0}),0,"removeEvent"],[YD,0,"derivedItems"],[HD(["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,vd))}constructor(...e){super(...e),gd(this)}value=(Zc(this),td(this));label=(id(this),rd(this));disabled=(nd(this),od(this));selectionMode=(ad(this),sd(this));embedded=(ld(this),ud(this));changeEvent=(cd(this),dd(this));removeEvent=(hd(this),pd(this));uid=(fd(this),re("rui-tag-group"));derivedItems=md(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{ed()}};import{jsx as je,jsxs as ND}from"@ecopages/jsx/jsx-runtime";function Td({children:t,class:e,...i}){return je("div",{...i,"data-tag-list":!0,class:j("rui-tag-group__list",e),children:t})}function Sd({value:t,label:e,children:i,class:r,disabled:s,aria:d,...h}){return ND("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(Ed,{})]})}function Ed({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 wd({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(wd,{children:je(Td,{children:t.map(s=>je(Sd,{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(wd,{children:e})})}function Ad({children:t,class:e,...i}){return ae("div",{...i,class:j("rui-combobox__control",e),children:t})}function Id({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 Cd({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(Qe,{})})}function XD({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 Dd({children:t,class:e,...i}){return ae("span",{...i,"data-combobox-value":!0,class:j("rui-combobox__value",e),children:t})}function Od({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 Rd({children:t}){return ae("div",{class:"rui-combobox","data-ref":"root",children:t})}function QD({options:t,children:e,value:i,...r}){let s=tt(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(Rd,{children:[io(Ad,{children:[h?ae(Dd,{children:ae(Mi,{tags:d??[],label:"Selected options"})}):null,ae(Id,{placeholder:r.placeholder,disabled:r.disabled}),ae(Cd,{})]}),ae(Od,{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(Rd,{children:e})})}import{RadiantElement as Hd,bindTo as i1,customElement as r1,event as n1,onEvent as o1,onUpdated as a1,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 Vd,kd,Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd,$d,Gd;function JD(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:Wd(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Wd(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:ZD(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return 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 ZD(t){var e=e1(t,"string");return typeof e=="symbol"?e:e+""}function e1(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 Wd(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}var s1="[data-cycle-value]",no="button[data-cycle-toggle-button]",Nd,Yd=class extends Hd{static{({e:[Md,Ld,Pd,jd,Fd,Bd,Ud,zd,qd,Kd,$d,Gd,Vd],c:[Nd,kd]}=JD(this,[r1("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}),i1({selector:"button[data-cycle-toggle-button]",prop:"disabled"})],0,"disabled"],[n1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[a1(["value","label","disabled","size","variant"]),2,"onPropsUpdated"],[o1({selector:no,type:"click"}),2,"onButtonClick"]],0,void 0,Hd))}value=(Vd(this),Md(this));variant=(Ld(this),Pd(this));size=(jd(this),Fd(this));label=(Bd(this),Ud(this));disabled=(zd(this),qd(this));changeEvent=(Kd(this),$d(this));childObserver=(Gd(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(s1))}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{kd()}};import{jsx as Cr}from"@ecopages/jsx/jsx-runtime";function l1({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 Xd({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 u1({children:t,variant:e,size:i,disabled:r,...s}){return Cr("rui-cycle-toggle",{...s,variant:e,size:i,disabled:r,children:Cr(Xd,{variant:e,size:i,disabled:r,children:t})})}import{jsx as ge,jsxs as ao}from"@ecopages/jsx/jsx-runtime";var Qd={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},c1={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 Jd({preference:t}){return c1[t]}function Zd({preference:t}){return Qd[t]}function d1({preference:t,showLabel:e=!0}){return ao("span",{class:"inline-flex items-center gap-inline","aria-label":e?void 0:Qd[t],children:[ge(Jd,{preference:t}),e?ge(Zd,{preference:t}):void 0]})}import{RadiantElement as Ah,bindTo as bt,customElement as y1,event as _1,onEvent as vt,onUpdated as Ih,prop as rt,query as x1,state as w1}from"@ecopages/radiant";function p1(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(`(max-width: ${639}px)`).matches}function Dr(t){return t<=1||!p1()?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(){f1(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;it(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 f1(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 eh,th,ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,bh,vh,yh,_h,xh,wh,Th,Sh,Eh;function m1(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:Rh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Rh(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:g1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return v1(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 g1(t){var e=b1(t,"string");return typeof e=="symbol"?e:e+""}function b1(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 Rh(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 v1(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 Dh,Ch=class extends Ah{static{({e:[ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,bh,vh,yh,_h,xh,wh,Th,Sh,Eh,eh],c:[Dh,th]}=m1(this,[y1("rui-date-field")],[[[rt({type:String,reflect:!0,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"value"},{selector:"[data-date-field-calendar]",attr:"value"}])],0,"value"],[[rt({type:String,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"min"},{selector:"[data-date-field-calendar]",attr:"min"}])],0,"min"],[[rt({type:String,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"max"},{selector:"[data-date-field-calendar]",attr:"max"}])],0,"max"],[[rt({type:Boolean,reflect:!0,defaultValue:!1}),bt([{selector:"[data-date-field-input]",bool:"disabled"},{selector:"[data-date-field-calendar]",bool:"disabled"}])],0,"disabled"],[[rt({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),bt({selector:"[data-date-field-input]",bool:"read-only"})],0,"readOnly"],[rt({type:String,defaultValue:""}),0,"label"],[[rt({type:String,defaultValue:""}),bt({selector:"[data-date-field-input]",attr:"name"})],0,"name"],[[rt({type:String,defaultValue:""}),bt([{selector:"[data-date-field-input]",attr:"locale"},{selector:"[data-date-field-calendar]",attr:"locale"}])],0,"locale"],[rt({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[_1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[w1,bt({selector:"[data-date-field-trigger]",attr:"aria-expanded"})],0,"open"],[x1({ref:"popover"}),0,"popoverTarget"],[Ih(["value","min","max","label","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[Ih(["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,Ah))}value=(eh(this),ih(this));min=(rh(this),nh(this));max=(oh(this),ah(this));disabled=(sh(this),lh(this));readOnly=(uh(this),ch(this));label=(dh(this),hh(this));name=(ph(this),fh(this));locale=(mh(this),gh(this));visibleMonths=(bh(this),vh(this));changeEvent=(yh(this),_h(this));open=(xh(this),wh(this,!1));uid=(Th(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=Sh(this);onMediaChange=(Eh(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{th()}};import{Fragment as V1,jsx as De,jsxs as np}from"@ecopages/jsx/jsx-runtime";import{jsx as Vr}from"@ecopages/jsx/jsx-runtime";import{customElement as A1,event as I1,onEvent as ni,onUpdated as Zh,prop as oi,registerSsrPreparationCallback as C1,state as ep}from"@ecopages/radiant";import{FormAssociatedElement as tp}from"@ecopages/radiant/form-associated-element";function Oh(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"),contenteditable:h?"true":void 0,inputmode:h?"numeric":void 0,suppresscontenteditablewarning:h?"true":void 0,tabindex:e.disabled?void 0:0}}var Vh,kh,Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,$h,Gh,Wh,Hh,Yh,Nh,Xh,Qh;function T1(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:Jh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Jh(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:S1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return R1(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 S1(t){var e=E1(t,"string");return typeof e=="symbol"?e:e+""}function E1(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 Jh(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 R1(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 D1(){return typeof navigator>"u"?!1:/iPad|iPhone|iPod/.test(navigator.userAgent)}var rp,ip=class extends tp{static{({e:[Mh,Lh,Ph,jh,Fh,Bh,Uh,zh,qh,Kh,$h,Gh,Wh,Hh,Yh,Nh,Xh,Qh,Vh],c:[rp,kh]}=T1(this,[A1("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"],[I1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[ep,0,"segments"],[ep,0,"focusedPart"],[Zh(["value","locale"]),2,"syncSegmentsFromValue"],[Zh("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,tp))}value=(Vh(this),Mh(this));min=(Lh(this),Ph(this));max=(jh(this),Fh(this));readOnly=(Bh(this),Uh(this));label=(zh(this),qh(this));locale=(Kh(this),$h(this));changeEvent=(Gh(this),Wh(this));segments=(Hh(this),Yh(this,[]));focusedPart=(Nh(this),Xh(this,null));uid=(Qh(this),re("rui-date-input"));buffer="";useTextboxRole=D1();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(),C1(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=Oh(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,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{kh()}};import{jsx as O1}from"@ecopages/jsx/jsx-runtime";function ai({children:t,...e}){return O1("rui-date-input",{"data-rui-control":!0,"data-rui-control-type":"date","data-rui-aria-target":'[data-ref="root"]',...e,children:t})}function op({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 ap({class:t,...e}){return De(ai,{...e,"data-date-field-input":!0,class:j("rui-date-field__input",t)})}function sp({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 lp({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 up(t){return De(Si,{...t,"data-date-field-calendar":!0})}function k1(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??np(V1,{children:[np(op,{children:[De(ap,{value:i,min:r,max:s,disabled:d,readOnly:h,label:a,name:E,locale:A}),De(sp,{})]}),De(lp,{children:De(up,{})})]})})}import{RadiantElement as Bp,bindTo as nt,customElement as F1,event as B1,onEvent as yt,onUpdated as Up,prop as $e,query as U1,state as z1}from"@ecopages/radiant";var cp,dp,hp,pp,fp,mp,gp,bp,vp,yp,_p,xp,wp,Tp,Sp,Ep,Rp,Ap,Ip,Cp,Dp,Op,Vp,kp,Mp,Lp,Pp,jp;function M1(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:Fp(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Fp(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:L1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return j1(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 L1(t){var e=P1(t,"string");return typeof e=="symbol"?e:e+""}function P1(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 Fp(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 j1(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 qp,zp=class extends Bp{static{({e:[hp,pp,fp,mp,gp,bp,vp,yp,_p,xp,wp,Tp,Sp,Ep,Rp,Ap,Ip,Cp,Dp,Op,Vp,kp,Mp,Lp,Pp,jp,cp],c:[qp,dp]}=M1(this,[F1("rui-date-range-picker")],[[[$e({type:String,reflect:!0,defaultValue:""}),nt({selector:"[data-range-calendar]",attr:"value"})],0,"value"],[[$e({type:String,defaultValue:""}),nt([{selector:"[data-range-start]",attr:"min"},{selector:"[data-range-end]",attr:"min"},{selector:"[data-range-calendar]",attr:"min"}])],0,"min"],[[$e({type:String,defaultValue:""}),nt([{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}),nt([{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}),nt([{selector:"[data-range-start]",bool:"read-only"},{selector:"[data-range-end]",bool:"read-only"}])],0,"readOnly"],[[$e({type:String,defaultValue:""}),nt([{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:""}),nt({selector:"[data-range-start]",attr:"name"})],0,"startName"],[[$e({type:String,attribute:"end-name",defaultValue:""}),nt({selector:"[data-range-end]",attr:"name"})],0,"endName"],[$e({type:String,defaultValue:""}),0,"name"],[$e({type:Number,attribute:"visible-months",defaultValue:2}),0,"visibleMonths"],[B1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[z1,nt({selector:"[data-range-trigger]",attr:"aria-expanded"})],0,"open"],[U1({ref:"popover"}),0,"popoverTarget"],[Up(["value","min","max","disabled","readOnly","locale","visibleMonths"]),2,"onPropsUpdated"],[Up(["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,Bp))}value=(cp(this),hp(this));min=(pp(this),fp(this));max=(mp(this),gp(this));disabled=(bp(this),vp(this));readOnly=(yp(this),_p(this));locale=(xp(this),wp(this));startName=(Tp(this),Sp(this));endName=(Ep(this),Rp(this));name=(Ap(this),Ip(this));visibleMonths=(Cp(this),Dp(this));changeEvent=(Op(this),Vp(this));open=(kp(this),Mp(this,!1));calendarPopover=(Lp(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=Pp(this);onMediaChange=(jp(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{dp()}};import{Fragment as q1,jsx as fe,jsxs as so}from"@ecopages/jsx/jsx-runtime";function Kp({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 $p({children:t,class:e,...i}){return fe("div",{...i,class:j("rui-date-range-picker__values",e),"data-ref":"values",children:t})}function Gp({class:t,...e}){return fe(ai,{...e,"data-range-start":!0,class:j("rui-date-range-picker__input",t)})}function Wp({class:t,...e}){return fe(ai,{...e,"data-range-end":!0,class:j("rui-date-range-picker__input",t)})}function Hp({children:t="\u2013",class:e,...i}){return fe("span",{...i,class:j("rui-date-range-picker__separator",e),"aria-hidden":"true",children:t})}function Yp({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 Np({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 Xp(t){return fe(Si,{...t,"data-range-calendar":!0})}function K1(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(q1,{children:[so(Kp,{children:[so($p,{children:[fe(Gp,{"aria-label":i,value:T?.start,min:d,max:h,disabled:a,readOnly:E,locale:A,name:S}),fe(Hp,{}),fe(Wp,{"aria-label":r,value:T?.end,min:d,max:h,disabled:a,readOnly:E,locale:A,name:I})]}),fe(Yp,{})]}),fe(Np,{children:fe(Xp,{})})]})})}import{RadiantElement as gf,bindTo as N1,bound as X1,customElement as Q1,event as J1,onEvent as uo,onUpdated as Z1,prop as co,query as ho}from"@ecopages/radiant";var Qp="a[href], button, input, select, textarea, [tabindex]";function $1(t){return!t.hasAttribute("disabled")&&t.getAttribute("tabindex")!=="-1"}function lo(t){return Array.from(t.querySelectorAll(Qp)).filter($1)}function kr(t){return Array.from(t.querySelectorAll(Qp)).filter(e=>!e.hasAttribute("disabled"))}function si(t){return lo(t)[0]}var Jp,Zp,ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf,pf,ff;function G1(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:mf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||mf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:W1(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Y1(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function W1(t){var e=H1(t,"string");return typeof e=="symbol"?e:e+""}function H1(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 mf(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 Y1(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 vf,bf=class extends gf{static{({e:[ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf,pf,ff,Jp],c:[vf,Zp]}=G1(this,[Q1("rui-dialog")],[[[co({type:Boolean,reflect:!0,defaultValue:!1}),N1({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"],[J1({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[X1,Z1(["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,gf))}open=(Jp(this),ef(this));alert=(tf(this),rf(this));label=(nf(this),of(this));dialogTarget=(af(this),sf(this));titleTarget=(lf(this),uf(this));descriptionTarget=(cf(this),df(this));closeEvent=(hf(this),pf(this));previouslyFocused=(ff(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{Zp()}};import{jsx as ve,jsxs as _f}from"@ecopages/jsx/jsx-runtime";function xf({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 wf({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 Tf({children:t,class:e,...i}){return ve("div",{...i,class:j("rui-dialog__actions",e),children:t})}function Sf({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 yf({alert:t,children:e,open:i}){return _f("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 eO({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:_f(yf,{open:r,alert:s,children:[ve(Sf,{}),t!=null?ve(xf,{children:t}):null,i!=null?ve(wf,{children:i}):null,e!=null?ve(Tf,{children:e}):null]})}):ve("rui-dialog",{...d,open:r,alert:s,children:ve(yf,{open:r,alert:s,children:i})})}var ot="__rui-dialog-host",Mr="rui-dialog-open",Lr="rui-dialog-close",Pr="rui-dialog-toggle",po="rui-dialog-action";function Ef(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 tO(){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 iO(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 rO(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 nO(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 oO(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 aO(t){Fi();let e=document.createElement("rui-dialog");e.id=ot,e.alert=!!t.alert,e.label=t.label??"",e.open=!0;let i=oO(e.alert),r=i.querySelector('[data-ref="dialog"]');if(!r)throw new Error("Failed to create the dialog surface.");return r.append(tO()),t.title&&r.append(iO(t.title)),t.body&&r.append(rO(t.body)),t.actions?.length&&r.append(nO(t.actions)),e.append(i),(jr??document.body).appendChild(e),ji=e,e}function Rf(t){if(!(!be||be===t))if(be===ot)Fi();else{let e=mo(be);e&&(e.open=!1)}}function li(t){_t();let e=mo(t);e&&(Rf(t),e.open=!0,be=t)}function sO(t){_t(),Rf(ot),aO(t),be=ot}function Fr(t){if(typeof t=="string"){li(t);return}if(Ef(t)){li(t.id);return}sO(t)}function ui(t){_t();let e=t??be;if(e){if(e===ot)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 Af(t){let e=t.detail;if(typeof e=="string"){Fr(e);return}e&&typeof e=="object"&&Fr(e)}function If(t){let e=t.detail;ui(e?.id)}function Cf(t){let e=t.detail;e?.id&&go(e.id)}function Df(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(ot);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 Of(t){let e=t.target?.closest?.("rui-dialog");if(!e)return;let i=e.id||null;i&&be===i&&(i===ot&&Fi(),be=null)}function Vf(t={}){return Pi?(t.mount&&(jr=t.mount),fo):(Pi=!0,jr=t.mount??document.body,document.addEventListener(Mr,Af),document.addEventListener(Lr,If),document.addEventListener(Pr,Cf),document.addEventListener("click",Df),document.addEventListener("rui-close",Of),fo)}function _t(){Pi||Vf()}function fo(){Pi&&(document.removeEventListener(Mr,Af),document.removeEventListener(Lr,If),document.removeEventListener(Pr,Cf),document.removeEventListener("click",Df),document.removeEventListener("rui-close",Of),Fi(),jr=null,be=null,Pi=!1)}function lO(){return be}function uO(t){_t(),Fr(t)}function cO(t){_t(),ui(t)}function dO(t){_t(),go(t)}function hO(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 qf,bindTo as Kf,bound as bO,customElement as vO,onEvent as yO,onUpdated as _O,prop as bo}from"@ecopages/radiant";var kf,Mf,Lf,Pf,jf,Ff,Bf,Uf;function pO(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:zf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||zf(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:fO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return gO(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 fO(t){var e=mO(t,"string");return typeof e=="symbol"?e:e+""}function mO(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 zf(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 gO(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,$f=class extends qf{static{({e:[Lf,Pf,jf,Ff,Bf,Uf,kf],c:[Br,Mf]}=pO(this,[vO("rui-disclosure")],[[[bo({type:Boolean,reflect:!0,defaultValue:!1}),Kf([{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}),Kf({bool:"data-animated"})],0,"animated"],[yO({selector:"[data-disclosure-trigger]",type:"click"}),2,"onTriggerClick"],[[bO,_O(["open","animated"])],2,"syncExpanded"]],0,void 0,qf))}open=(kf(this),Lf(this));value=(Pf(this),jf(this));animated=(Ff(this),Bf(this));panelId=(Uf(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{Mf()}};import{RadiantElement as Jf,customElement as EO,onEvent as Zf,onUpdated as RO,prop as em}from"@ecopages/radiant";var Gf,Wf,Hf,Yf,Nf,Xf;function xO(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:Qf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Qf(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:wO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return SO(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 wO(t){var e=TO(t,"string");return typeof e=="symbol"?e:e+""}function TO(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 Qf(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 SO(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 im,tm=class extends Jf{static{({e:[Hf,Yf,Nf,Xf,Gf],c:[im,Wf]}=xO(this,[EO("rui-disclosure-group")],[[em({type:Boolean,reflect:!0,defaultValue:!1}),0,"multiple"],[em({type:Boolean,reflect:!0,attribute:"animated",defaultValue:!1}),0,"animated"],[RO("animated"),2,"onAnimatedUpdated"],[Zf({selector:"rui-disclosure",type:"rui-disclosure-toggle"}),2,"onDisclosureToggle"],[Zf({selector:"[data-disclosure-trigger]",type:"keydown"}),2,"onTriggerKeydown"]],0,void 0,Jf))}constructor(...e){super(...e),Xf(this)}multiple=(Gf(this),Hf(this));animated=(Yf(this),Nf(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{Wf()}};import{jsx as ye,jsxs as nm}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(Qe,{}):null)})}function am({children:t,class:e,disabled:i,icon:r,iconPosition:s="start",...d}){let a=r!==null?r??ye(om,{}):null;return nm("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 sm({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 rm({children:t}){return ye("div",{class:"rui-disclosure","data-ref":"root",children:t})}function AO({trigger:t,icon:e,iconPosition:i,children:r,...s}){return t!=null?ye("rui-disclosure",{...s,children:nm(rm,{children:[ye(am,{icon:e,iconPosition:i,children:t}),r!=null?ye(sm,{children:r}):null]})}):ye("rui-disclosure",{...s,children:ye(rm,{children:r})})}function IO({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 CO({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 DO({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 OO({children:t,class:e,...i}){return xt("header",{...i,class:j("rui-feed__header",e),children:t})}function VO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__content",e),children:t})}function kO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__actions",e),children:t})}function MO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline",e),children:t})}function LO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__byline-body",e),children:t})}function PO({children:t,class:e,...i}){return xt("div",{...i,class:j("rui-feed__meta",e),children:t})}import{jsx as Nm}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Wm,customElement as eV,onEvent as Gr,onUpdated as Io,prop as Bt,registerSsrPreparationCallback as tV}from"@ecopages/radiant";import{consumeContext as iV,onContextUpdate as rV,provideContext as nV}from"@ecopages/radiant/context";var at="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",dm="data-rui-aria-target",hm="data-rui-aria-targets",xo='[data-ref="field"]';function pm(){return`[${at}], ${wo()}`}function wo(){return Array.from(wt.keys()).join(", ")}function jO(t){return t.localName==="rui-listbox"&&(t.hasAttribute("embedded")||Reflect.get(t,"embedded")===!0)}var FO={"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 fm(t){return t.localName==="input"}function mm(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)}},lm={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)}},um={read:t=>t.querySelector('input[type="checkbox"]')?.checked??t.hasAttribute("checked"),write:(t,e)=>{e?t.setAttribute("checked",""):t.removeAttribute("checked")}};function gm(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 bm(t,e){Reflect.set(t,"value",e)}var Bi={read:t=>gm(t,Er),write:bm},BO={read:t=>gm(t,Rr),write:bm},wt=new Map([["rui-checkbox",um],["rui-switch",um],["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",{...BO,submission:"host"}],["rui-knob",{...lm,submission:"host"}],["rui-number-field",{...lm,submission:"host"}]]);function vm(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 vm(t,r=>{if(!(i||!(r instanceof HTMLElement))){if(r.matches(e)){i=r;return}i=r.querySelector(e)}}),i}function cm(t){let e=t.filter(i=>!jO(i));return e.length===0?null:e.find(i=>!e.some(r=>r!==i&&r.contains(i)))??null}function UO(t){let e=[];return vm(t,i=>{i instanceof HTMLElement&&i.matches(pm())&&e.push(i)}),e}function zO(t){let e=t.querySelector(xo);return e instanceof HTMLElement?Array.from(e.querySelectorAll(pm())).filter(i=>t.contains(i)):[]}function hi(t){let e=cm(zO(t));return e||cm(UO(t))}function qO(t,e){let i=t.toLowerCase();wt.set(i,e)}function ym(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(fm(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(mm(t))return t.value;let e=zr(t);return wt.get(e.localName)?.read(e)??e.getAttribute("value")??""}function $r(t,e){if(fm(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(mm(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(at)?t.closest(wo())??t:t}function _m(t){return So(t,`[${qr}]`)}function xm(t){return So(t,`[${Kr}]`)}function wm(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 Tm(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 KO(t){let e=Reflect.get(t,"checked");return typeof e=="boolean"?e:t.hasAttribute("checked")}function $O(t){let e=t.getAttribute(hm);if(e){let r=e.split(",")[0]?.trim();if(r)return t.querySelector(r)}let i=t.getAttribute(dm);return i?t.querySelector(i):null}function GO(t){let e=t.getAttribute(hm);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(dm);if(i){let r=t.querySelector(i);return r?[r]:[]}return[]}function WO(t){if(di(t))return t;let e=$O(t);if(e)return e;if(t.hasAttribute(at))return t;if(t.localName==="rui-slider")return Array.from(t.querySelectorAll("[data-thumb]")).find(d=>!d.hasAttribute("hidden"))??t;let i=t.querySelector(`[${at}]`);if(i)return i;if(t.localName==="rui-radio-group")return HO(t)??t;let r=FO[t.localName];return r?t.querySelector(r)??t:t}function HO(t){let e=t.querySelectorAll('input[type="radio"]');return Array.from(e).find(KO)??e[0]}function Sm(t){let e=GO(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[WO(t)]}import{createContext as YO}from"@ecopages/radiant/context";var pi=YO(Symbol.for("rui-form-context"));import{createContext as NO}from"@ecopages/radiant/context";var Ao=NO(Symbol.for("rui-field-context"));var Em,Rm,Am,Im,Cm,Dm,Om,Vm,km,Mm,Lm,Pm,jm,Fm,Bm,Um,zm,qm,Km,$m;function XO(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:Gm(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Gm(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:QO(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ZO(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 QO(t){var e=JO(t,"string");return typeof e=="symbol"?e:e+""}function JO(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 Gm(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 ZO(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 oV(t){if(!t)return;let{validate:e,...i}=t;return i}var Ym,Hm=class extends Wm{static{({e:[Am,Im,Cm,Dm,Om,Vm,km,Mm,Lm,Pm,jm,Fm,Bm,Um,zm,qm,Km,$m,Em],c:[Ym,Rm]}=XO(this,[eV("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"],[nV({context:Ao,initialValue:{name:"",controlId:"",descriptionId:"",errorId:"",error:void 0,invalid:!1,required:!1},hydrate:Object,serialize:e=>({...e,rules:oV(e.rules)})}),0,"fieldProvider"],[iV(pi),0,"formContextProvider"],[rV({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,Wm))}name=(Em(this),Am(this));rules=(Im(this),Cm(this));defaultValue=(Dm(this),Om(this));defaultValueData=(Vm(this),km(this));disabled=(Mm(this),Lm(this));error=(Pm(this),jm(this));invalid=(Fm(this),Bm(this));fieldProvider=(Um(this),zm(this));formContextProvider=(qm(this),Km(this));uid=($m(this),re("rui-field"));resolveFieldName(){return(this.name||this.getAttribute("name")||"").trim()}unregister;unregisterPresentation;registeredWithForm=!1;pendingControlWrite;controlObserver;constructor(){super(),tV(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){ym(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?Sm(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();Tm(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=xm(this);d&&(d.id=e,s.push(e));let h=wm(this);return h&&(h.id=i),h&&r&&s.push(i),s}syncLabel(e,i){let r=_m(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();aV(i,e)||this.fieldProvider.setContext(e)}static{Rm()}};function aV(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 sV({children:t,rules:e,defaultValue:i,defaultValueData:r,...s}){return Nm("rui-field",{...s,"prop:rules":e,"prop:defaultValue":i,data:{defaultValue:r??(i!==void 0?JSON.stringify(i):void 0)},children:Nm("div",{class:"rui-field","data-ref":"field",children:t})})}import{jsx as lV}from"@ecopages/jsx/jsx-runtime";function uV({children:t,class:e,...i}){return lV("p",{...i,[Kr]:"",class:j("rui-field__description",e),children:t})}import{jsx as cV}from"@ecopages/jsx/jsx-runtime";function dV({class:t,...e}){return cV("p",{...e,[ci]:"",class:j("rui-field__error",t),role:"alert",hidden:!0})}import{jsx as Ag}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as xg,customElement as xV,event as wg,onEvent as Do,onUpdated as Tg,prop as Ut}from"@ecopages/radiant";import{provideContext as wV}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 st(t){return typeof t=="object"&&t!==null&&"value"in t?t.value:t}async function hV(t,e,i,r){if(i)for(let s of[pV,fV,mV,gV]){let d=await s(e,i,r);if(d)return d}}function pV(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 fV(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<st(e.min))return fi(`Minimum value is ${st(e.min)}`,e.min);if(e.max!==void 0&&i>st(e.max))return fi(`Maximum value is ${st(e.max)}`,e.max)}}function mV(t,e){let i=t==null?"":String(t);if(e.minLength!==void 0&&i.length<st(e.minLength))return fi(`Minimum length is ${st(e.minLength)}`,e.minLength);if(e.maxLength!==void 0&&i.length>st(e.maxLength))return fi(`Maximum length is ${st(e.maxLength)}`,e.maxLength);if(e.pattern!==void 0&&!st(e.pattern).test(i))return fi("Invalid format",e.pattern)??"Invalid format"}async function gV(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 Xm(t,e,i){let r=i??Object.keys(e.fields),s={};for(let d of r){let h=e.fields[d]?.rules,a=await hV(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)=>Xm(t,e,i.names)}function Qm(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=Qm(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=Qm(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 Jm,Zm,eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg,vg,yg;function bV(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:_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=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:vV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return _V(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 vV(t){var e=yV(t,"string");return typeof e=="symbol"?e:e+""}function yV(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 _V(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 Sg=()=>{},TV={register:()=>Sg,updateFieldOptions:()=>{},handleFieldChange:()=>{},handleFieldBlur:()=>{},subscribePresentation:()=>Sg},Rg,Eg=class extends xg{static{({e:[eg,tg,ig,rg,ng,og,ag,sg,lg,ug,cg,dg,hg,pg,fg,mg,gg,bg,vg,yg,Jm],c:[Rg,Zm]}=bV(this,[xV("rui-form")],[[wV({context:pi,initialValue:{ready:!1,store:void 0,revision:0,fields:{},errors:{},actions:TV},hydrate:Object,serialize:({revision:e,fields:i,errors:r})=>({ready:!1,revision:e,fields:i,errors:r})}),0,"formProvider"],[wg({name:"rui-submit",bubbles:!0,composed:!0}),0,"submitEvent"],[wg({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"],[Tg(["defaultValues","defaultValuesData","mode","reValidateMode"]),2,"syncOptions"],[Tg(["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,xg))}formProvider=(Jm(this),eg(this));submitEvent=(tg(this),ig(this));invalidEvent=(rg(this),ng(this));defaultValues=(og(this),ag(this));defaultValuesData=(sg(this),lg(this));resolver=(ug(this),cg(this));mode=(dg(this),hg(this));reValidateMode=(pg(this),fg(this));action=(mg(this),gg(this));method=(bg(this),vg(this));onSubmit=void yg(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{Zm()}};function SV({children:t,defaultValues:e,defaultValuesData:i,resolver:r,reValidateMode:s,onSubmit:d,action:h,method:a,...E}){return Ag("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:Ag("form",{class:"rui-form","data-ref":"form",noValidate:!0,action:h,method:a,children:t})})}import{RadiantElement as kg,customElement as CV,onEvent as DV,prop as OV}from"@ecopages/radiant";var Ig,Cg,Dg,Og;function EV(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:RV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return IV(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 RV(t){var e=AV(t,"string");return typeof e=="symbol"?e:e+""}function AV(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 IV(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 Lg,Mg=class extends kg{static{({e:[Dg,Og,Ig],c:[Lg,Cg]}=EV(this,[CV("rui-grid")],[[OV({type:String,defaultValue:""}),0,"label"],[DV({selector:'[role="gridcell"]',type:"keydown"}),2,"onKeydown"]],0,void 0,kg))}constructor(...e){super(...e),Og(this)}label=(Ig(this),Dg(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{Cg()}};import{jsx as Wr}from"@ecopages/jsx/jsx-runtime";function VV({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 kV}from"@ecopages/jsx/jsx-runtime";function Hr({as:t,children:e,...i}){return kV(t??"div",{...i,children:e})}import{jsx as MV}from"@ecopages/jsx/jsx-runtime";function Oo(t){let{children:e,as:i="h2",size:r="md",class:s,...d}=t;return MV(Hr,{as:i,...d,class:j("rui-headline",r!==!1&&`rui-headline--size-${r}`,s),children:e})}function LV(t,e,i){return j("rui-heading",`rui-heading--align-${t}`,`rui-heading--size-${e}`,i)}function PV(t){let{children:e,as:i="div",align:r="start",size:s="md",class:d,...h}=t;return Yr(Hr,{as:i,...h,class:LV(r,s,d),children:e})}function jV({children:t,class:e,...i}){return Yr("p",{...i,class:j("rui-heading__eyebrow",e),children:t})}function FV(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 BV({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 ab,bindTo as $V,bound as qi,customElement as GV,event as WV,onEvent as Nr,onUpdated as HV,prop as zt,query as YV}from"@ecopages/radiant";var zi=0,Pg=0;function jg(){zi+=1}function Vo(t=Date.now(),e=300){zi=Math.max(0,zi-1),zi===0&&(Pg=t+e)}function Fg(t,e=Date.now()){return zi>0||e<Pg?0:t}var Bg,Ug,zg,qg,Kg,$g,Gg,Wg,Hg,Yg,Ng,Xg,Qg,Jg,Zg,eb,tb,ib,rb,nb;function UV(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:ob(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ob(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:zV(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return KV(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 zV(t){var e=qV(t,"string");return typeof e=="symbol"?e:e+""}function qV(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 ob(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 KV(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",sb=8,NV=500,ub,lb=class extends ab{static{({e:[zg,qg,Kg,$g,Gg,Wg,Hg,Yg,Ng,Xg,Qg,Jg,Zg,eb,tb,ib,rb,nb,Bg],c:[ub,Ug]}=UV(this,[GV("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}),$V({ref:"content",attr:"aria-label"})],0,"contentLabel"],[YV({ref:"content"}),0,"contentTarget"],[WV({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[qi,HV(["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,ab))}open=(Bg(this),zg(this));placement=(qg(this),Kg(this));delay=($g(this),Gg(this));closeDelay=(Wg(this),Hg(this));portal=(Yg(this),Ng(this));disabled=(Xg(this),Qg(this));contentLabel=(Jg(this),Zg(this));contentTarget=(eb(this),tb(this));openChangeEvent=(ib(this),rb(this));contentId=(nb(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:sb,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:sb,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?jg():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=Fg(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){it(this.getAnchor(),this.getFloatingElement(),e.relatedTarget)&&this.scheduleShow(!0)}onFocusOut(e){it(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)},NV))}onPointerUp(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}static{Ug()}};function XV({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 QV({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 JV({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 ZV}from"@ecopages/jsx/jsx-runtime";function ek(t){let{class:e,type:i="text",mask:r,placeholder:s,"on:input":d,...h}=t,a=r?Dn(r):s;return ZV("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,[at]:"","data-rui-control-type":"text",class:j("rui-input",e)})}import{jsx as Mo}from"@ecopages/jsx/jsx-runtime";function tk({children:t,class:e,...i}){return Mo("div",{...i,role:"group",class:j("rui-input-group",e),children:t})}function ik({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 rk({children:t,class:e,...i}){return Mo("span",{...i,class:j("rui-input-group__text",e),children:t})}import{bindTo as ev,customElement as pk,event as fk,onEvent as Gi,onUpdated as mk,prop as Oe,query as qt}from"@ecopages/radiant";import{FormAssociatedElement as tv}from"@ecopages/radiant/form-associated-element";function nk(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)):nk(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 cb=120,gi=300,ok=14,ak=gi+(360-gi)/2;function sk(t){return Math.min(100,Math.max(0,Number.isFinite(t)?Number(t):ok))}function lk(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=sk(s),A=50-E/2,S=2*Math.PI*A,I=gi/360*S,T=a.clamp(t),K=mi(r,h);return{startAngle:cb,strokeWidth:E,radius:A,circumference:S,arcLength:I,progressLength:a.ratioFor(T)*I,valueText:lk(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-cb+360)%360,h=d<=gi?d:d<=ak?gi:0;return r.valueFromRatio(h/gi)}var db,hb,pb,fb,mb,gb,bb,vb,yb,_b,xb,wb,Tb,Sb,Eb,Rb,Ab,Ib,Cb,Db,Ob,Vb,kb,Mb,Lb,Pb,jb,Fb,Bb,Ub,zb,qb,Kb,$b,Gb,Wb,Hb,Yb,Nb,Xb,Qb,Jb;function uk(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:Zb(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Zb(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:ck(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 ck(t){var e=dk(t,"string");return typeof e=="symbol"?e:e+""}function dk(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 Zb(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 Po=50,rv,iv=class extends tv{static{({e:[pb,fb,mb,gb,bb,vb,yb,_b,xb,wb,Tb,Sb,Eb,Rb,Ab,Ib,Cb,Db,Ob,Vb,kb,Mb,Lb,Pb,jb,Fb,Bb,Ub,zb,qb,Kb,$b,Gb,Wb,Hb,Yb,Nb,Xb,Qb,Jb,db],c:[rv,hb]}=uk(this,[pk("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}),ev({ref:"control",attr:"aria-readonly",map:e=>String(e)})],0,"readOnly"],[[Oe({type:String,defaultValue:""}),ev([{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"],[fk({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"],[mk(["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,tv))}value=(db(this),pb(this));min=(fb(this),mb(this));max=(gb(this),bb(this));step=(vb(this),yb(this));valuePrecision=(_b(this),xb(this));readOnly=(wb(this),Tb(this));label=(Sb(this),Eb(this));size=(Rb(this),Ab(this));strokeWidth=(Ib(this),Cb(this));showValue=(Db(this),Ob(this));valuePosition=(Vb(this),kb(this));valueTemplate=(Mb(this),Lb(this));changeEvent=(Pb(this),jb(this));rootTarget=(Fb(this),Bb(this));labelTarget=(Ub(this),zb(this));controlTarget=(qb(this),Kb(this));trackTarget=($b(this),Gb(this));progressTarget=(Wb(this),Hb(this));centerValueTarget=(Yb(this),Nb(this));belowValueTarget=(Xb(this),Qb(this));activePointerId=(Jb(this),null);lastEmitted=null;rangeCommitQueued=!1;onConnected(){this.syncPresentation()}formValue(){return this.name?String(this.numericRange.clamp(this.value)):null}formState(){return String(this.value)}restoreFormState(e){this.value=Number(e),this.syncPresentation()}onPropsUpdated(){this.syncPresentation()}get numericRange(){return We(this.min,this.max,this.step)}get resolvedSize(){return typeof this.size=="number"&&Number.isFinite(this.size)&&this.size>0?this.size:void 0}get resolvedValuePosition(){return this.valuePosition==="below"?"below":"center"}paint(e){let i=Qr(e,this.min,this.max,this.step,this.strokeWidth,this.valueTemplate,this.valuePrecision),r=this.resolvedValuePosition;this.syncKnobLayout(r),this.syncControlValues(e,i.valueText),this.syncRing(i),this.syncReadout(i.valueText,r)}syncKnobLayout(e){this.rootTarget?.classList.toggle("rui-knob--value-below",e==="below"),this.resolvedSize?this.style.setProperty("--rui-knob-size",`${this.resolvedSize}px`):this.style.removeProperty("--rui-knob-size")}syncControlValues(e,i){let r=this.controlTarget;r&&(r.setAttribute("aria-valuemin",String(this.numericRange.lowerBound)),r.setAttribute("aria-valuemax",String(this.numericRange.upperBound)),r.setAttribute("aria-valuenow",String(e)),r.setAttribute("aria-valuetext",i))}syncRing(e){for(let i of[this.trackTarget,this.progressTarget])i?.setAttribute("r",String(e.radius)),i?.setAttribute("stroke-width",String(e.strokeWidth));this.trackTarget?.setAttribute("stroke-dasharray",`${e.arcLength} ${e.circumference}`),this.progressTarget?.setAttribute("stroke-dasharray",`${e.progressLength} ${e.circumference}`)}syncReadout(e,i){for(let[r,s]of[[this.centerValueTarget,this.showValue&&i==="center"],[this.belowValueTarget,this.showValue&&i==="below"]])r&&(r.textContent=e,r.toggleAttribute("hidden",!s))}syncPresentation(){this.controlTarget&&(this.controlTarget.disabled=this.effectiveDisabled),this.paint(this.numericRange.clamp(this.value)),this.queueNormalizedValueCommit()}queueNormalizedValueCommit(){this.rangeCommitQueued||(this.rangeCommitQueued=!0,queueMicrotask(()=>{this.rangeCommitQueued=!1;let e=this.numericRange.clamp(this.value);this.paint(e),$i(this.value,e,this.step)||(this.value=e)}))}commitValue(e){if(this.effectiveDisabled||this.readOnly)return;let i=this.numericRange.clamp(e);this.paint(i),!$i(i,this.value,this.step)&&(this.value=i,this.lastEmitted!==i&&(this.lastEmitted=i,this.changeEvent.emit({value:i})))}onPointerDown(e){if(e.button!==0||this.effectiveDisabled||this.readOnly)return;this.activePointerId=e.pointerId,this.lastEmitted=this.value,this.controlTarget.setPointerCapture(e.pointerId);let i=this.controlTarget.getBoundingClientRect(),r=Lo(e.clientX,e.clientY,i,this.numericRange);r!=null&&this.commitValue(r),e.preventDefault()}onPointerMove(e){if(e.pointerId!==this.activePointerId)return;let i=this.controlTarget.getBoundingClientRect(),r=Lo(e.clientX,e.clientY,i,this.numericRange);r!=null&&this.commitValue(r)}onPointerUp(e){e.pointerId===this.activePointerId&&(this.controlTarget.releasePointerCapture(e.pointerId),this.activePointerId=null)}onPointerCancel(e){e.pointerId===this.activePointerId&&(this.controlTarget.hasPointerCapture(e.pointerId)&&this.controlTarget.releasePointerCapture(e.pointerId),this.activePointerId=null)}onKeydown(e){if(this.effectiveDisabled||this.readOnly)return;let i=Xr(this.numericRange,this.value,e.key);i!=null&&(e.preventDefault(),this.lastEmitted=this.value,this.commitValue(i))}static{hb()}};import{jsx as lt,jsxs as jo}from"@ecopages/jsx/jsx-runtime";function gk({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 lt(bk,{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 bk({props:t,ring:e,range:i,...r}){return lt("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:lt(vk,{knob:r,ring:e,range:i})})}function vk({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:[lt("span",{class:"rui-knob__label","data-ref":"label",hidden:!t.label,children:t.label}),lt(yk,{knob:t,ring:e,range:i,valueBelow:r}),lt("span",{class:"rui-knob__value rui-knob__value--below","data-ref":"belowValue","aria-hidden":"true",hidden:!t.showValue||!r,children:e.valueText})]})}function yk({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:[lt("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)`}),lt("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)`})]}),lt("span",{class:"rui-knob__value","data-ref":"centerValue","aria-hidden":"true",hidden:!t.showValue||r,children:e.valueText})]})}import{jsx as _k}from"@ecopages/jsx/jsx-runtime";function xk({children:t,htmlFor:e,class:i,...r}){return _k("label",{...r,[qr]:"",class:j("rui-label",i),htmlFor:e,children:t})}import{RadiantElement as yv,bindTo as Ck,bound as Dk,customElement as Ok,event as _v,onEvent as Tt,onUpdated as Vk,prop as xv,query as wv}from"@ecopages/radiant";var wk=200,Tk=250,Sk=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)},wk);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:Sk,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)},Tk);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 nv,ov,av,sv,lv,uv,cv,dv,hv,pv,fv,mv,gv,bv;function Ek(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:vv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||vv(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:Rk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Ik(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 Rk(t){var e=Ak(t,"string");return typeof e=="symbol"?e:e+""}function Ak(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 vv(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 Ik(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 kk=6,Sv,Tv=class extends yv{static{({e:[av,sv,lv,uv,cv,dv,hv,pv,fv,mv,gv,bv,nv],c:[Sv,ov]}=Ek(this,[Ok("rui-menu-button")],[[[xv({type:Boolean,reflect:!0,defaultValue:!1}),Ck([{ref:"trigger",attr:"aria-expanded"},{ref:"menu",bool:"hidden",invert:!0}])],0,"open"],[xv({type:String,defaultValue:"bottom-start"}),0,"placement"],[wv({ref:"trigger"}),0,"triggerTarget"],[wv({ref:"menu"}),0,"menuTarget"],[_v({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[_v({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[Dk,Vk(["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,yv))}open=(nv(this),av(this));placement=(sv(this),lv(this));triggerTarget=(uv(this),cv(this));menuTarget=(dv(this),hv(this));changeEvent=(pv(this),fv(this));closeEvent=(mv(this),gv(this));menuId=(bv(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:kk,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{ov()}};import{jsx as He,jsxs as Ev}from"@ecopages/jsx/jsx-runtime";import{jsx as Mk}from"@ecopages/jsx/jsx-runtime";function Wi({orientation:t="horizontal",class:e,...i}){return Mk("hr",{...i,class:j("rui-separator",e),role:"separator","aria-orientation":t,"data-orientation":t})}import{Fragment as Lk,jsxs as Pk}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 Pk(Lk,{children:[e.Item({value:i.value,disabled:i.disabled,hasSubmenu:r,children:i.label}),r?e.Submenu({children:Hi(i.items??[],e)}):null]})})}function Rv({children:t,class:e,variant:i="filled",size:r="md",...s}){return Ev(Ze,{...s,variant:i,size:r,"data-ref":"trigger",class:j("rui-menu-button__trigger",e),"aria-haspopup":"menu",children:[t,He(Qe,{class:"rui-menu-button__chevron"})]})}function Av({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 Iv({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 Cv({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 jk({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}):Ev("rui-menu-button",{...s,class:j("rui-menu-button",r),children:[He(Rv,{children:t}),He(Av,{children:e?Hi(e,{Item:d=>He(Cv,{...d}),Submenu:d=>He(Iv,{...d}),Separator:d=>He(Wi,{},d.id)}):i})]})}import{RadiantElement as jv,customElement as qk,event as Kk,onEvent as St,prop as $k}from"@ecopages/radiant";var Dv,Ov,Vv,kv,Mv,Lv;function Fk(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:Pv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Pv(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:Bk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return zk(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 Bk(t){var e=Uk(t,"string");return typeof e=="symbol"?e:e+""}function Uk(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Pv(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 zk(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 Bv,Fv=class extends jv{static{({e:[Vv,kv,Mv,Lv,Dv],c:[Bv,Ov]}=Fk(this,[qk("rui-menubar")],[[$k({type:String,defaultValue:""}),0,"label"],[Kk({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,jv))}label=(Dv(this),Vv(this));changeEvent=(kv(this),Mv(this));openRoot=(Lv(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{Ov()}};import{jsx as Ye,jsxs as Gk}from"@ecopages/jsx/jsx-runtime";function Uv({label:t,children:e,disabled:i}){let r=e!=null;return Gk("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 zv({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 qv({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 Wk({items:t,label:e,children:i,...r}){let s=t!=null?t.map(d=>Ye(Uv,{label:d.label,disabled:d.disabled,children:d.items?.length?Hi(d.items,{Item:h=>Ye(zv,{...h}),Submenu:h=>Ye(qv,{...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 iy,customElement as Qk,onUpdated as Jk,prop as Jr,state as Zk}from"@ecopages/radiant";var Kv,$v,Gv,Wv,Hv,Yv,Nv,Xv,Qv,Jv,Zv,ey;function Hk(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:ty(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||ty(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:Yk(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Xk(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 Yk(t){var e=Nk(t,"string");return typeof e=="symbol"?e:e+""}function Nk(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 ty(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 Xk(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 ny,ry=class extends iy{static{({e:[Gv,Wv,Hv,Yv,Nv,Xv,Qv,Jv,Zv,ey,Kv],c:[ny,$v]}=Hk(this,[Qk("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"],[Zk,0,"percent"],[Jk(["value","min","max"]),2,"onRangeUpdated"]],0,void 0,iy))}value=(Kv(this),Gv(this));min=(Wv(this),Hv(this));max=(Yv(this),Nv(this));label=(Xv(this),Qv(this));percent=(Jv(this),Zv(this,0));resolvedAriaLabel=(ey(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{$v()}};import{jsx as eM}from"@ecopages/jsx/jsx-runtime";function tM(t){return eM("rui-meter",{...t})}import{jsx as Kt}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as gy,customElement as aM,onEvent as Fe,prop as Zr}from"@ecopages/radiant";var oy,ay,sy,ly,uy,cy,dy,hy,py,fy;function iM(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:my(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||my(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:rM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return oM(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 rM(t){var e=nM(t,"string");return typeof e=="symbol"?e:e+""}function nM(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 my(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 oM(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 vy=200,yy=150,sM=8,_y,by=class extends gy{static{({e:[sy,ly,uy,cy,dy,hy,py,fy,oy],c:[_y,ay]}=iM(this,[aM("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:vy}),0,"hoverDelay"],[Zr({type:Number,attribute:"close-delay",defaultValue:yy}),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,gy))}label=(oy(this),sy(this));openOnHover=(ly(this),uy(this));hoverDelay=(cy(this),dy(this));closeDelay=(hy(this),py(this));openValue=(fy(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:sM,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{ay()}};function lM({children:t,class:e,...i}){return Kt("div",{...i,"data-ref":"bar",class:j("rui-navigation-menu__bar",e),children:t})}function uM({children:t,class:e,...i}){return Kt("div",{...i,"data-ref":"panels",class:j("rui-navigation-menu__panels",e),children:t})}function cM({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 dM({children:t,value:e,variant:i="ghost",class:r,...s}){return Kt(Ze,{...s,variant:i,class:r,"data-navigation-item":!0,"data-navigation-trigger":!0,"data-value":e,children:t})}function hM({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 pM({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 yM,event as _M,onEvent as $t,onUpdated as xM,prop as Ee,state as r_}from"@ecopages/radiant";import{FormAssociatedElement as n_}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 fM(e)?(new Intl.NumberFormat(void 0,e),e):void 0}catch{return}}function fM(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 xy(t,e,i);let s=Number.isFinite(e)?e:0,d=Math.round((t-s)/r)*r+s;return xy(d,e,i)}function xy(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 wy,Ty,Sy,Ey,Ry,Ay,Iy,Cy,Dy,Oy,Vy,ky,My,Ly,Py,jy,Fy,By,Uy,zy,qy,Ky,$y,Gy,Wy,Hy,Yy,Ny,Xy,Qy,Jy,Zy,e_,t_;function mM(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:i_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||i_(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:gM(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 gM(t){var e=bM(t,"string");return typeof e=="symbol"?e:e+""}function bM(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 i_(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 a_,o_=class extends n_{static{({e:[Sy,Ey,Ry,Ay,Iy,Cy,Dy,Oy,Vy,ky,My,Ly,Py,jy,Fy,By,Uy,zy,qy,Ky,$y,Gy,Wy,Hy,Yy,Ny,Xy,Qy,Jy,Zy,e_,t_,wy],c:[a_,Ty]}=mM(this,[yM("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"],[_M({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[r_,0,"decreaseDisabled"],[r_,0,"increaseDisabled"],[xM(["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,n_))}value=(wy(this),Sy(this));defaultValue=(Ey(this),Ry(this));minValue=(Ay(this),Iy(this));maxValue=(Cy(this),Dy(this));step=(Oy(this),Vy(this));readOnly=(ky(this),My(this));label=(Ly(this),Py(this));locale=(jy(this),Fy(this));formatOptions=(By(this),Uy(this));commitBehavior=(zy(this),qy(this));incrementAriaLabel=(Ky(this),$y(this));decrementAriaLabel=(Gy(this),Wy(this));wheelDisabled=(Hy(this),Yy(this));changeEvent=(Ny(this),Xy(this));decreaseDisabled=(Qy(this),Jy(this,!1));increaseDisabled=(Zy(this),e_(this,!1));editing=(t_(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{Ty()}};import{jsx as Be,jsxs as s_}from"@ecopages/jsx/jsx-runtime";function l_({children:t,class:e,...i}){return Be("div",{...i,"data-number-field-group":!0,class:j("rui-number-field__group",e),children:t})}function u_({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 c_({children:t,class:e,...i}){return Be("div",{...i,class:j("rui-number-field__steppers",e),children:t})}function d_({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 h_({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 wM(){return s_(l_,{children:[Be(u_,{}),s_(c_,{children:[Be(h_,{}),Be(d_,{})]})]})}function TM({children:t,...e}){return Be("rui-number-field",{...e,children:Be("div",{class:"rui-number-field","data-ref":"root",children:t??Be(wM,{})})})}import{jsx as _e,jsxs as Ho}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as I_,customElement as IM,event as CM,onEvent as DM,prop as Yi}from"@ecopages/radiant";var p_,f_,m_,g_,b_,v_,y_,__,x_,w_,T_,S_,E_,R_;function SM(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: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||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=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 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 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 Wo="Pagination";function en(t,e){return Math.min(Math.max(1,Math.floor(t)||1),e)}var D_,C_=class extends I_{static{({e:[m_,g_,b_,v_,y_,__,x_,w_,T_,S_,E_,R_,p_],c:[D_,f_]}=SM(this,[IM("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"],[CM({name:"rui-page-change",bubbles:!0,composed:!0}),0,"pageChangeEvent"],[DM({selector:"[data-pagination-page]",type:"click"}),2,"onPageClick"]],0,void 0,I_))}constructor(...e){super(...e),R_(this)}label=(p_(this),m_(this));page=(g_(this),b_(this));pageCount=(v_(this),y_(this));disabled=(__(this),x_(this));siblingCount=(w_(this),T_(this));pageChangeEvent=(S_(this),E_(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{f_()}};function OM(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 O_({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),$=OM(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(Ze,{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(Ze,{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(Ze,{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 VM({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(O_,{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 fx}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as tn,bound as No,customElement as cx,event as PM,onEvent as Ni,onUpdated as dx,prop as Et,query as Xo}from"@ecopages/radiant";import{isServer as jM}from"@ecopages/radiant/is-server";var V_,k_,M_,L_,P_,j_,F_,B_,U_,z_,q_,K_,$_,G_,W_,H_,Y_,N_,X_,Q_,J_,Z_,ex,tx,ix,rx,nx,ox;function ux(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:kM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return LM(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 kM(t){var e=MM(t,"string");return typeof e=="symbol"?e:e+""}function MM(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function 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 LM(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 hx,sx=class extends tn{static{({e:[M_,L_,P_,j_,F_,B_,U_,z_,q_,K_,$_,G_,W_,H_,Y_,N_,X_,Q_,J_,Z_,V_],c:[hx,k_]}=ux(this,[cx("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"],[PM({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[No,dx(["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=(V_(this),M_(this));placement=(L_(this),P_(this));portal=(j_(this),F_(this));matchAnchorWidth=(B_(this),U_(this));offset=(z_(this),q_(this));anchor=(K_(this),$_(this));variant=(G_(this),W_(this));surfaceTarget=(H_(this),Y_(this));hostTarget=(N_(this),X_(this));openChangeEvent=(Q_(this),J_(this));surfaceId=(Z_(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&&it(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{k_()}};var px,lx=class extends tn{static{({e:[ix,rx,nx,ox,ex],c:[px,tx]}=ux(this,[cx("rui-popover-trigger")],[[Et({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Xo({ref:"root"}),0,"rootTarget"],[[No,dx(["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),ox(this)}open=(ex(this),ix(this));rootTarget=(rx(this),nx(this));getPopover(){return this.querySelector("rui-popover")}onConnected(){this.syncToPopover()}syncToPopover(){if(jM)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{tx()}};function Yo(t){return t.querySelector('button, a[href], input, select, textarea, [role="button"]')??t}function FM({children:t,class:e,...i}){return vi("div",{...i,class:j(e),children:t})}function BM({trigger:t,children:e,variant:i="default",...r}){let s=i==="listbox"?"rui-popover--listbox":"";return vi("rui-popover",{...r,variant:i,children:fx("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 UM({trigger:t,children:e,...i}){return vi("rui-popover-trigger",{...i,children:fx("div",{class:"rui-popover-trigger","data-ref":"root",children:[vi("span",{"data-popover-trigger":!0,children:t}),e]})})}import{RadiantElement as Dx,bindTo as Ox,customElement as GM,event as WM,onEvent as HM,onUpdated as YM,prop as rn,query as NM}from"@ecopages/radiant";var mx,gx,bx,vx,yx,_x,xx,wx,Tx,Sx,Ex,Rx,Ax,Ix;function zM(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:Cx(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Cx(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:qM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return $M(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function qM(t){var e=KM(t,"string");return typeof e=="symbol"?e:e+""}function KM(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 Cx(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 $M(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 kx,Vx=class extends Dx{static{({e:[bx,vx,yx,_x,xx,wx,Tx,Sx,Ex,Rx,Ax,Ix,mx],c:[kx,gx]}=zM(this,[GM("rui-radio-group")],[[rn({type:String,reflect:!0,defaultValue:""}),0,"value"],[rn({type:String,defaultValue:""}),0,"name"],[[rn({type:String,defaultValue:""}),Ox({selector:"[data-radio-group-root]",attr:"aria-label",map:gt})],0,"label"],[[rn({type:Boolean,reflect:!0,defaultValue:!1}),Ox({selector:"[data-radio-group-root]",attr:"aria-disabled",map:e=>e?"true":void 0})],0,"disabled"],[NM({selector:'input[type="radio"]',all:!0,cache:!1}),0,"radioTargets"],[WM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[YM(["value","name","disabled"]),2,"syncRadios"],[HM({selector:'input[type="radio"]',type:"change"}),2,"onRadioChange"]],0,void 0,Dx))}constructor(...e){super(...e),Ix(this)}value=(mx(this),bx(this));name=(vx(this),yx(this));label=(_x(this),xx(this));disabled=(wx(this),Tx(this));radioTargets=(Sx(this),Ex(this));changeEvent=(Rx(this),Ax(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{gx()}};import{jsx as Gt,jsxs as XM}from"@ecopages/jsx/jsx-runtime";function Mx({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 Lx({children:t,value:e,name:i,disabled:r,class:s,...d}){return XM("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 QM({options:t,children:e,...i}){return Gt("rui-radio-group",{...i,children:t==null?e:Gt(Mx,{children:t.map(r=>Gt(Lx,{value:r.value,disabled:r.disabled,children:r.label}))})})}import{RadiantElement as r0,bindTo as n0,customElement as iL,event as rL,onEvent as xe,onUpdated as nL,prop as Wt,query as oL}from"@ecopages/radiant";var Px,jx,Fx,Bx,Ux,zx,qx,Kx,$x,Gx,Wx,Hx,Yx,Nx,Xx,Qx,Jx,Zx,e0,t0;function JM(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:i0(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||i0(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:ZM(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return tL(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 ZM(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 i0(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 tL(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 a0,o0=class extends r0{static{({e:[Fx,Bx,Ux,zx,qx,Kx,$x,Gx,Wx,Hx,Yx,Nx,Xx,Qx,Jx,Zx,e0,t0,Px],c:[a0,jx]}=JM(this,[iL("rui-select")],[[[Wt({...Ie,defaultValue:[]}),n0({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}),n0([{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"],[rL({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[oL({ref:"root"}),0,"rootTarget"],[nL(["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,r0))}constructor(...e){super(...e),t0(this)}value=(Px(this),Fx(this));label=(Bx(this),Ux(this));placeholder=(zx(this),qx(this));disabled=(Kx(this),$x(this));selectionMode=(Gx(this),Wx(this));shouldCloseOnSelect=(Hx(this),Yx(this));triggerKind=(Nx(this),Xx(this));changeEvent=(Qx(this),Jx(this));open=(Zx(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=e0(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{jx()}};import{Fragment as aL,jsx as he,jsxs as s0}from"@ecopages/jsx/jsx-runtime";function l0({children:t,class:e,...i}){return he("div",{...i,class:j("rui-select__control",e),children:t})}function u0({children:t,class:e,disabled:i,...r}){return he("div",{...r,"data-select-trigger":!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 c0({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(Qe,{})})}function sL({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 d0({children:t,class:e,...i}){return he("span",{...i,"data-select-value":!0,class:j("rui-select__value",e),children:t})}function h0({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 lL({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 uL(t,e,i){let r=tt(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 cL({children:t}){return he("div",{class:"rui-select","data-ref":"root",children:t})}function dL({options:t,children:e,value:i,...r}){let s=tt(i),d=r.selectionMode==="multiple",h=t!=null?uL(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(cL,{children:t==null?e:s0(aL,{children:[s0(l0,{children:[he(u0,{disabled:r.disabled,children:he(d0,{children:d?he(Mi,{tags:a??[],label:"Selected options"}):h})}),he(c0,{})]}),he(h0,{children:he(ii,{embedded:!0,options:t,selectionMode:r.selectionMode,value:s})})]})})})}import{RadiantElement as hw,bindTo as Xi,bound as pw,customElement as gL,event as Qo,onEvent as Qi,onUpdated as Jo,prop as me,query as on,state as bL}from"@ecopages/radiant";import{isServer as vL}from"@ecopages/radiant/is-server";function nn(t){return t.split(",").map(e=>e.trim()).filter(e=>e.length>0)}var p0,f0,m0,g0,b0,v0,y0,_0,x0,w0,T0,S0,E0,R0,A0,I0,C0,D0,O0,V0,k0,M0,L0,P0,j0,F0,B0,U0,z0,q0,K0,$0,G0,W0,H0,Y0,N0,X0,Q0,J0,Z0,ew,tw,iw,rw,nw,ow,aw,sw,lw,uw,cw;function hL(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:dw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||dw(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:pL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return mL(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 pL(t){var e=fL(t,"string");return typeof e=="symbol"?e:e+""}function fL(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 dw(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 mL(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 yL=256,_L=48,xL=200,wL=480,TL="b",fw=8,mw=32,gw='[data-ref="menu-button"]';function SL(t){return t.metaKey||t.ctrlKey}function EL(){return typeof window<"u"&&typeof window.matchMedia=="function"}function an(t){return t==="left"||t==="right"}var vw,bw=class extends hw{static{({e:[m0,g0,b0,v0,y0,_0,x0,w0,T0,S0,E0,R0,A0,I0,C0,D0,O0,V0,k0,M0,L0,P0,j0,F0,B0,U0,z0,q0,K0,$0,G0,W0,H0,Y0,N0,X0,Q0,J0,Z0,ew,tw,iw,rw,nw,ow,aw,sw,lw,uw,cw,p0],c:[vw,f0]}=hL(this,[gL("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:yL}),0,"defaultWidth"],[me({type:Number,reflect:!0,attribute:"width"}),0,"width"],[me({type:Number,defaultValue:xL}),0,"minWidth"],[me({type:Number,defaultValue:wL}),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"],[[bL,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"],[pw,2,"onPointerMove"],[pw,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:gw,type:"click"}),2,"onMenuLinkClick"],[Qi({document:!0,type:"keydown"}),2,"onHostKeydown"]],0,void 0,hw))}variant=(p0(this),m0(this));side=(g0(this),b0(this));collapsible=(v0(this),y0(this));defaultWidth=(_0(this),x0(this));width=(w0(this),T0(this));minWidth=(S0(this),E0(this));maxWidth=(R0(this),A0(this));resizable=(I0(this),C0(this));defaultOpen=(D0(this),O0(this));mobileDefaultOpen=(V0(this),k0(this));open=(M0(this),L0(this));mobileBreakpoint=(P0(this),j0(this));label=(F0(this),B0(this));matchActive=(U0(this),z0(this,!1));matchMode=(q0(this),K0(this));scrollActiveOnMount=($0(this),G0(this,!1));navigationEvents=(W0(this),H0(this,""));rootTarget=(Y0(this),N0(this));paneTarget=(X0(this),Q0(this));handleTarget=(J0(this),Z0(this));scrimTarget=(ew(this),tw(this));toggleEvent=(iw(this),rw(this));resizeEvent=(nw(this),ow(this));mobileChangeEvent=(aw(this),sw(this));isMobile=(lw(this),uw(this,!1));mediaQuery=(cw(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(gw)){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(vL||!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||!EL()){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"?_L: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?mw:fw);else if(i.key===h)a=r+(i.shiftKey?mw:fw);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}SL(i)&&i.key.toLowerCase()===TL&&(i.preventDefault(),this.toggle())}static{f0()}};import{RadiantElement as Uw,bindTo as sn,customElement as DL,onEvent as OL,onUpdated as zw,prop as Ji,query as VL,state as Zo}from"@ecopages/radiant";var yw,_w,xw,ww,Tw,Sw,Ew,Rw,Aw,Iw,Cw,Dw,Ow,Vw,kw,Mw,Lw,Pw,jw,Fw;function RL(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:Bw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Bw(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:AL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return CL(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 AL(t){var e=IL(t,"string");return typeof e=="symbol"?e:e+""}function IL(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 Bw(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 CL(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 qw="Toggle sidebar",kL=["filled","outline","ghost"],ML=["sm","md","lg"];function $w({variant:t,size:e}){return`rui-button rui-button--${t} rui-button--${e} rui-sidebar__trigger`}function LL(t){return t==="inset"?"collapsed":"expanded"}var Gw,Kw=class extends Uw{static{({e:[xw,ww,Tw,Sw,Ew,Rw,Aw,Iw,Cw,Dw,Ow,Vw,kw,Mw,Lw,Pw,jw,Fw,yw],c:[Gw,_w]}=RL(this,[DL("rui-sidebar-trigger")],[[Ji({type:String,defaultValue:""}),0,"controls"],[[Ji({type:String,attribute:"button-label",defaultValue:qw}),sn({ref:"button",attr:"aria-label",map:e=>e?.trim()||qw})],0,"buttonLabel"],[Ji({type:String,reflect:!0,defaultValue:""}),0,"placement"],[Ji({type:String,defaultValue:"ghost"}),0,"variant"],[Ji({type:String,defaultValue:"md"}),0,"size"],[VL({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"],[zw(["controls","placement"]),2,"onTargetUpdated"],[zw(["variant","size"]),2,"onPresentationUpdated"],[OL({ref:"button",type:"click"}),2,"onButtonClick"]],0,void 0,Uw))}controls=(yw(this),xw(this));buttonLabel=(ww(this),Tw(this));placement=(Sw(this),Ew(this));variant=(Rw(this),Aw(this));size=(Iw(this),Cw(this));buttonTarget=(Dw(this),Ow(this));sidebarState=(Vw(this),kw(this,"expanded"));sidebarMobile=(Mw(this),Lw(this,null));sidebarCollapsible=(Pw(this),jw(this,null));sidebarObserver=(Fw(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 kL)e.toggle(`rui-button--${i}`,i===this.variant);for(let i of ML)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=LL(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{_w()}};import{jsx as we,jsxs as Zi}from"@ecopages/jsx/jsx-runtime";function PL(){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 jL({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:$w({variant:r,size:s}),children:t??we(PL,{})})})}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 FL({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 BL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__header",e),children:t})}function UL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__content",e),children:t})}function zL({children:t,class:e,...i}){return se("div",{...i,class:j("rui-sidebar__footer",e),children:t})}function qL({class:t,...e}){return se("hr",{...e,role:"separator","aria-orientation":"horizontal",class:j("rui-sidebar__separator",t)})}function KL({children:t,class:e,...i}){return se("section",{...i,class:j("rui-sidebar__group",e),children:t})}function Ww({children:t,class:e,...i}){return se("h2",{...i,class:j("rui-sidebar__group-label",e),children:t})}function $L({children:t,class:e,...i}){return se("button",{...i,type:"button",class:j("rui-sidebar__group-action",e),children:t})}function GL({label:t,action:e,class:i,...r}){return er("div",{...r,class:j("rui-sidebar__group-header",i),children:[se(Ww,{children:t}),e]})}function WL({children:t,class:e,...i}){return se("ul",{...i,role:"list",class:j("rui-sidebar__menu",e),children:t})}function HL({children:t,class:e,...i}){return se("li",{...i,class:j("rui-sidebar__menu-item",e),children:t})}function Hw(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 YL(t){let{class:e,...i}=t;return se(Hw,{class:j("rui-sidebar__menu-action",e),...i})}function NL({children:t,class:e,...i}){return se("main",{...i,class:j("rui-sidebar__inset",e),children:t})}function XL({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 BT,customElement as tP,event as iP,onEvent as tr,onUpdated as rP,prop as Ve,query as Rt}from"@ecopages/radiant";import{FormAssociatedElement as UT}from"@ecopages/radiant/form-associated-element";var Yw,Nw,Xw,Qw,Jw,Zw,eT,tT,iT,rT,nT,oT,aT,sT,lT,uT,cT,dT,hT,pT,fT,mT,gT,bT,vT,yT,_T,xT,wT,TT,ST,ET,RT,AT,IT,CT,DT,OT,VT,kT,MT,LT,PT,jT;function QL(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:FT(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||FT(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:JL(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return eP(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 JL(t){var e=ZL(t,"string");return typeof e=="symbol"?e:e+""}function ZL(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 FT(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 eP(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,qT=100;function KT(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 nP(t){return Array.isArray(t.value)?[...t.value]:typeof t.value=="number"?[t.value]:t.variant==="range"?[ia,ra]:[ta]}function $T(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 KT(e,i,r,t.minDistance??0)}return[e.clamp(t.values[0]??ta)]}function GT(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 WT(t){let e=t.variant??"single",i=t.min??0,r=t.max??qT,s=t.step??1,d=t.minDistance??0,h=nP(t),a=$T({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:GT(a,s,t.valuePrecision),trackStyle:HT(a,E),isRange:a.length===2,valuePrecision:typeof t.valuePrecision=="number"&&Number.isFinite(t.valuePrecision)?t.valuePrecision:void 0}}function HT(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 YT,zT=class extends UT{static{({e:[Xw,Qw,Jw,Zw,eT,tT,iT,rT,nT,oT,aT,sT,lT,uT,cT,dT,hT,pT,fT,mT,gT,bT,vT,yT,_T,xT,wT,TT,ST,ET,RT,AT,IT,CT,DT,OT,VT,kT,MT,LT,PT,jT,Yw],c:[YT,Nw]}=QL(this,[tP("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: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:""}),BT([{ref:"label",bool:"hidden",invert:!0},{ref:"label",text:!0}])],0,"label"],[[Ve({type:Boolean,attribute:"show-value",defaultValue:!1}),BT({selector:"[data-default-value]",bool:"hidden",invert:!0})],0,"showValue"],[Ve({type:Boolean,attribute:"value-title",defaultValue:!1}),0,"valueTitle"],[iP({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"],[rP(["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,UT))}variant=(Yw(this),Xw(this));orientation=(Qw(this),Jw(this));value=(Zw(this),eT(this));min=(tT(this),iT(this));max=(rT(this),nT(this));step=(oT(this),aT(this));valuePrecision=(sT(this),lT(this));minDistance=(uT(this),cT(this));readOnly=(dT(this),hT(this));label=(pT(this),fT(this));showValue=(mT(this),gT(this));valueTitle=(bT(this),vT(this));changeEvent=(yT(this),_T(this));rootTarget=(xT(this),wT(this));headerTarget=(TT(this),ST(this));labelTarget=(ET(this),RT(this));rangeTrack=(AT(this),IT(this));valueTarget=(CT(this),DT(this));singleThumb=(OT(this),VT(this));rangeMinThumb=(kT(this),MT(this));rangeMaxThumb=(LT(this),PT(this));activeThumb=(jT(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 GT(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 KT(this.numericRange,e,i,this.minDistance,r)}committedValues(){return $T({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=HT(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{Nw()}};import{jsx as Ue,jsxs as na}from"@ecopages/jsx/jsx-runtime";function NT({children:t,class:e,...i}){return Ue("span",{...i,class:j("rui-slider__value",e),"data-ref":"value","aria-hidden":"true",children:t})}function oP({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 aP({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=WT({variant:t,value:S,min:a,max:E,step:A,minDistance:T,valuePrecision:I}),G=K??Ue(NT,{"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(sP,{seed:V,orientation:e,label:i,disabled:d,hasVisibleReadout:W,valueReadout:G})})}function sP({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(oP,{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 lP}from"@ecopages/jsx/jsx-runtime";function uP({size:t="md",aria:e,class:i,...r}){return lP("span",{...r,role:"status",aria:ne(e,"Loading"),class:j("rui-spinner",`rui-spinner--${t}`,i)})}import{RadiantElement as sS,bindTo as oa,customElement as fP,event as mP,onEvent as gP,prop as aa}from"@ecopages/radiant";var XT,QT,JT,ZT,eS,tS,iS,rS,nS,oS;function cP(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:aS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||aS(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:dP(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||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function dP(t){var e=hP(t,"string");return typeof e=="symbol"?e:e+""}function hP(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 aS(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 uS,lS=class extends sS{static{({e:[JT,ZT,eS,tS,iS,rS,nS,oS,XT],c:[uS,QT]}=cP(this,[fP("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"],[mP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[gP({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,sS))}constructor(...e){super(...e),oS(this)}checked=(XT(this),JT(this));disabled=(ZT(this),eS(this));name=(tS(this),iS(this));changeEvent=(rS(this),nS(this));onInputChange(e){let i=e.target;this.checked=i.checked,this.changeEvent.emit({checked:this.checked})}static{QT()}};import{jsx as ir,jsxs as bP}from"@ecopages/jsx/jsx-runtime";function vP({children:t,checked:e,disabled:i,name:r,...s}){return ir("rui-switch",{...s,checked:e,disabled:i,name:r,children:bP("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 LS}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as OS,customElement as TP,event as sa,onEvent as yi,onUpdated as VS,prop as _i}from"@ecopages/radiant";var cS,dS,hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,TS,SS,ES,RS,AS,IS,CS;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: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:_P(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wP(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 _P(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 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 wP(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,kS=class extends OS{static{({e:[hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,TS,SS,ES,RS,AS,IS,CS,cS],c:[MS,dS]}=yP(this,[TP("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"],[VS(["value","selectionMode"]),2,"onSelectionUpdated"],[VS(["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,OS))}label=(cS(this),hS(this));ariaBusy=(pS(this),fS(this));selectionMode=(mS(this),gS(this));value=(bS(this),vS(this));sortColumn=(yS(this),_S(this));sortDirection=(xS(this),wS(this));changeEvent=(TS(this),SS(this));sortChangeEvent=(ES(this),RS(this));rowActionEvent=(AS(this),IS(this));structureObserver=void CS(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{dS()}};function SP({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 EP({children:t,class:e,...i}){return pe("div",{...i,role:"rowgroup",class:j("rui-table__body",e),children:t})}function RP({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 AP({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?LS("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 IP({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 CP({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 DP({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 OP({colSpan:t,children:e,class:i,...r}){let s=Math.max(1,Math.floor(t));return LS("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 VP({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 NS,customElement as jP,event as FP,onEvent as XS,onUpdated as BP,prop as ln}from"@ecopages/radiant";var PS,jS,FS,BS,US,zS,qS,KS,$S,GS,WS,HS;function kP(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:YS(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||YS(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:MP(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||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function MP(t){var e=LP(t,"string");return typeof e=="symbol"?e:e+""}function LP(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 YS(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 JS,QS=class extends NS{static{({e:[FS,BS,US,zS,qS,KS,$S,GS,WS,HS,PS],c:[JS,jS]}=kP(this,[jP("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"],[FP({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[BP(["value","label"]),2,"onPropsUpdated"],[XS({selector:'[role="tab"]',type:"click"}),2,"onTabClick"],[XS({selector:'[role="tab"]',type:"keydown"}),2,"onTabKeydown"]],0,void 0,NS))}variant=(PS(this),FS(this));value=(BS(this),US(this));label=(zS(this),qS(this));automatic=(KS(this),$S(this));changeEvent=(GS(this),WS(this));childObserver=(HS(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{jS()}};import{jsx as rr}from"@ecopages/jsx/jsx-runtime";function UP({children:t,class:e,...i}){return rr("div",{...i,class:j("rui-tabs__list",e),role:"tablist",children:t})}function zP({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 qP({children:t,class:e,...i}){return rr("div",{...i,class:j("rui-tabs__panels",e),children:t})}function KP({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 $P({children:t,...e}){return rr("rui-tabs",{...e,children:t})}import{jsx as GP}from"@ecopages/jsx/jsx-runtime";function WP(t){let{class:e,rows:i=3,...r}=t;return GP("textarea",{...r,rows:i,[at]:"","data-rui-control-type":"text",class:j("rui-textarea",e)})}import{jsx as ct,jsxs as EE}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as RE,bindTo as fa,bound as ma,customElement as tj,onEvent as AE,onUpdated as ga,prop as Ne,query as ij}from"@ecopages/radiant";var nr="rui-toast-show",or="rui-toast-dismiss",HP=["top-start","top-center","top-end","bottom-start","bottom-center","bottom-end"],ar=4e3,YP=356,la=14,ua=24,ca=3,da=3,sr=45,ha=200,lr="bottom-end";function ut(t){let[e,i]=t.split("-");return{y:e,x:i}}var NP=1;function XP(){return NP++}function ZS(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??XP(),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(ZS(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(ZS(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 eE,tE,iE,rE,nE,oE,aE,sE,lE,uE,cE,dE,hE,pE,fE,mE,gE,bE,vE,yE,_E,xE,wE,TE;function QP(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:SE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||SE(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:JP(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ej(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 JP(t){var e=ZP(t,"string");return typeof e=="symbol"?e:e+""}function ZP(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 SE(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 ej(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 rj(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 CE,IE=class extends RE{static{({e:[iE,rE,nE,oE,aE,sE,lE,uE,cE,dE,hE,pE,fE,mE,gE,bE,vE,yE,_E,xE,wE,TE,eE],c:[CE,tE]}=QP(this,[tj("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=>ut(e).y},{attr:"data-x-position",map:e=>ut(e).x}])],0,"position"],[Ne({type:Boolean,defaultValue:!1}),0,"markedDelete"],[ij({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"],[AE({selector:"[data-toast-close]",type:"click"}),2,"onCloseClick"],[AE({selector:"[data-toast-action]",type:"click"}),2,"onActionClick"]],0,void 0,RE))}toastId=(eE(this),iE(this));title=(rE(this),nE(this));description=(oE(this),aE(this));variant=(sE(this),lE(this));duration=(uE(this),cE(this));dismissible=(dE(this),hE(this));closeButton=(pE(this),fE(this));actionLabel=(mE(this),gE(this));position=(bE(this),vE(this));markedDelete=(yE(this),_E(this));toastTarget=(xE(this),wE(this));mounted=(TE(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?(rj(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}=ut(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}=ut(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 ct(wi,{});case"error":return ct(Re,{});case"warning":return"!";case"info":return"i";default:return""}}render(){let e=this.variant??"default",i=this.iconForVariant(),r=e!=="default";return EE("div",{ref:"toast",class:`rui-toast rui-toast--${e}`,role:"status","aria-live":"off","data-ref":"toast",children:[this.closeButton&&e!=="loading"?ct("button",{type:"button",class:"rui-toast__close","data-toast-close":!0,"aria-label":"Close toast",children:ct(Re,{})}):null,r?ct("span",{class:"rui-toast__icon","data-icon":!0,"aria-hidden":"true",children:e==="loading"?ct("span",{class:"rui-toast__loader"}):i}):null,EE("div",{class:"rui-toast__content",children:[ct("div",{class:"rui-toast__title","data-title":!0,children:this.$.title}),this.description?ct("div",{class:"rui-toast__description","data-description":!0,children:this.$.description}):null]}),this.actionLabel?ct("button",{type:"button",class:"rui-toast__action rui-button rui-button--outline rui-button--sm","data-toast-action":!0,children:this.$.actionLabel}):null]})}static{tE()}};import{jsx as va}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as iR,bindTo as lj,bound as dn,customElement as uj,onEvent as ya,onUpdated as cj,prop as At,query as dj,state as hj}from"@ecopages/radiant";function DE(t,e,i){let r=0;for(let s=0;s<t;s+=1)r+=e[s]??0;return r+t*i}function OE(t,e){return t.length===0?0:t.reduce((r,s)=>r+s,0)+Math.max(0,t.length-1)*e}function VE(t,e,i){return e<=0?0:t+Math.max(0,e-1)*i}var kE,ME,LE,PE,jE,FE,BE,UE,zE,qE,KE,$E,GE,WE,HE,YE,NE,XE,QE,JE,ZE,eR;function nj(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:tR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||tR(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:oj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return sj(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 oj(t){var e=aj(t,"string");return typeof e=="symbol"?e:e+""}function aj(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 tR(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 sj(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 rR(t,e){return t instanceof Node&&e.contains(t)}var oR,nR=class extends iR{static{({e:[LE,PE,jE,FE,BE,UE,zE,qE,KE,$E,GE,WE,HE,YE,NE,XE,QE,JE,ZE,eR,kE],c:[oR,ME]}=nj(this,[uj("rui-toaster")],[[[At({type:String,reflect:!0,defaultValue:lr}),lj([{attr:"data-y-position",map:e=>ut(e).y},{attr:"data-x-position",map:e=>ut(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"],[dj({ref:"list"}),0,"listTarget"],[hj,0,"toasts"],[cj(["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,iR))}position=(kE(this),LE(this));duration=(PE(this),jE(this));visibleToasts=(FE(this),BE(this));closeButton=(UE(this),zE(this));expand=(qE(this),KE(this));gap=($E(this),GE(this));offset=(WE(this),HE(this));container=(YE(this),NE(this));listTarget=(XE(this),QE(this));toasts=(JE(this),ZE(this,[]));expanded=(eR(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}=ut(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,$=DE(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?OE(a,this.gap):VE(E,A,this.gap)}px`}onPointerOver(e){rR(e.relatedTarget,this)||(this.expanded=!0,this.syncPauseState())}onPointerOut(e){rR(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{ME()}};import{jsx as aR}from"@ecopages/jsx/jsx-runtime";function pj({toastId:t,...e}){return aR("rui-toast",{...e,toastId:t!=null?String(t):void 0})}function fj({children:t,...e}){return aR("rui-toaster",{...e,children:t})}var mj=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 gj(t){document.dispatchEvent(new CustomEvent(nr,{detail:t,bubbles:!0,composed:!0}))}function bj(t){let e=t==null?{}:{id:t};document.dispatchEvent(new CustomEvent(or,{detail:e,bubbles:!0,composed:!0}))}import{jsx as hn,jsxs as Tj}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as CR,bound as Sj,customElement as Ej,onUpdated as Rj,prop as cr,state as DR}from"@ecopages/radiant";import{isServer as OR}from"@ecopages/radiant/is-server";function sR(t,e){try{return t.querySelector(e)}catch{return null}}function lR(t,e){try{return Array.from(t.querySelectorAll(e))}catch{return[]}}function vj(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}function uR(t,e,i=r=>document.getElementById(r)!==null){if(t.id)return e.add(t.id),t.id;let r=vj(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 cR(t,e){return t instanceof HTMLElement?t.getBoundingClientRect().top+e:e}function dR(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 hR,pR,fR,mR,gR,bR,vR,yR,_R,xR,wR,TR,SR,ER,RR,AR;function yj(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:IR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||IR(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:_j(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wj(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function _j(t){var e=xj(t,"string");return typeof e=="symbol"?e:e+""}function xj(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 IR(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 kR,VR=class extends CR{static{({e:[fR,mR,gR,bR,vR,yR,_R,xR,wR,TR,SR,ER,RR,AR,hR],c:[kR,pR]}=yj(this,[Ej("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"],[DR,0,"entries"],[DR,0,"activeId"],[Rj(["target","headingSelector","scrollOffset","navigationEvents"]),2,"onScanSettingsUpdated"],[Sj,2,"onLinkClick"]],0,void 0,CR))}target=(hR(this),fR(this,""));headingSelector=(mR(this),gR(this,"h2,h3"));label=(bR(this),vR(this,"On this page"));scrollOffset=(yR(this),_R(this,120));navigationEvents=(xR(this),wR(this,""));entries=(TR(this),SR(this,[]));activeId=(ER(this),RR(this,null));headings=(AR(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=lR(e,this.readConfiguredProp(this.headingSelector,"heading-selector")||"h2,h3");if(i.length===0)return;let r=new Set,s=i.map(d=>({id:uR(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?sR(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(OR||!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(OR||!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 cR(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}`),dR(i,this.scrollRoot??window,this.resolvedScrollOffset(),r)}render(){return this.entries.length===0?null:Tj("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{pR()}};import{jsx as Aj}from"@ecopages/jsx/jsx-runtime";function Ij(t){return Aj("rui-toc",{...t})}import{RadiantElement as zR,customElement as kj,onEvent as qR,prop as KR}from"@ecopages/radiant";var MR,LR,PR,jR,FR,BR;function Cj(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:UR(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||UR(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:Dj(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Vj(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 Dj(t){var e=Oj(t,"string");return typeof e=="symbol"?e:e+""}function Oj(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 UR(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 Vj(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,$R=class extends zR{static{({e:[PR,jR,FR,BR,MR],c:[GR,LR]}=Cj(this,[kj("rui-toolbar")],[[KR({type:String,defaultValue:""}),0,"label"],[KR({type:Boolean,reflect:!0,defaultValue:!1}),0,"exclusiveToggles"],[qR({type:"keydown",selector:"button, a[href], input, select, [tabindex]"}),2,"onKeydown"],[qR({type:"click",selector:"button[data-toggle][aria-pressed]",options:{capture:!0}}),2,"onToggleButtonClick"]],0,void 0,zR))}constructor(...e){super(...e),BR(this)}label=(MR(this),PR(this));exclusiveToggles=(jR(this),FR(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{LR()}};import{jsx as WR}from"@ecopages/jsx/jsx-runtime";function Mj({children:t,label:e,...i}){return WR("rui-toolbar",{...i,label:e,children:WR("div",{class:"rui-toolbar","data-ref":"root",role:"toolbar","aria-label":e||void 0,children:t})})}import{jsx as _a,jsxs as Bj}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as nA,bound as oA,customElement as Uj,onEvent as xa,onUpdated as zj,prop as wa,query as qj}from"@ecopages/radiant";var HR,YR,NR,XR,QR,JR,ZR,eA,tA,iA;function Lj(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: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=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:Pj(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||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function Pj(t){var e=jj(t,"string");return typeof e=="symbol"?e:e+""}function jj(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 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 aA=8,lA,sA=class extends nA{static{({e:[NR,XR,QR,JR,ZR,eA,tA,iA,HR],c:[lA,YR]}=Lj(this,[Uj("rui-tooltip")],[[wa({type:String,defaultValue:""}),0,"content"],[wa({type:String,defaultValue:"top"}),0,"placement"],[wa({type:Number,defaultValue:200}),0,"delay"],[qj({ref:"tooltip"}),0,"tooltipTarget"],[zj(["content","placement"]),2,"onDescribedPropsUpdated"],[xa({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[xa({type:"focusin",ref:"trigger"}),2,"onFocusIn"],[xa({type:"focusout",ref:"trigger"}),2,"onFocusOut"],[oA,2,"onPointerEnter"],[oA,2,"onPointerLeave"]],0,void 0,nA))}content=(HR(this),NR(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 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:aA}))}onDescribedPropsUpdated(){this.wireTrigger(),this.open&&this.tooltipTarget&&Qn(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()}render(){return Bj("span",{class:"rui-tooltip",children:[_a("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:_a("slot",{})}),_a("span",{"data-ref":"tooltip",id:this.tooltipId,class:"rui-tooltip__content rui-floating",role:"tooltip",hidden:!0,children:this.$.content})]})}static{YR()}};import{jsx as Ta,jsxs as Kj}from"@ecopages/jsx/jsx-runtime";function $j({children:t,content:e="",...i}){return Ta("rui-tooltip",{content:e,...i,children:Kj("span",{class:"rui-tooltip",children:[Ta("span",{class:"rui-tooltip__trigger","data-ref":"trigger",children:t}),Ta("span",{class:"rui-tooltip__content rui-floating","data-ref":"tooltip",role:"tooltip",hidden:!0,children:e})]})})}import{RadiantElement as vA,customElement as Nj,event as Xj,onEvent as yA,onUpdated as Qj,prop as _A}from"@ecopages/radiant";var uA,cA,dA,hA,pA,fA,mA,gA;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:bA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||bA(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:Wj(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 Wj(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 bA(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 wA,xA=class extends vA{static{({e:[dA,hA,pA,fA,mA,gA,uA],c:[wA,cA]}=Gj(this,[Nj("rui-tree")],[[_A({type:String,defaultValue:""}),0,"label"],[_A({type:String,reflect:!0,defaultValue:""}),0,"value"],[Xj({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Qj("value"),2,"onValueUpdated"],[yA({selector:'[role="treeitem"]',type:"click"}),2,"onClick"],[yA({selector:'[role="treeitem"]',type:"keydown"}),2,"onKeydown"]],0,void 0,vA))}label=(uA(this),dA(this));value=(hA(this),pA(this));changeEvent=(fA(this),mA(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=(gA(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{cA()}};import{Fragment as TA,jsx as dt,jsxs as Jj}from"@ecopages/jsx/jsx-runtime";var SA=({nodes:t})=>dt(TA,{children:t.map(e=>dt("li",{class:"rui-tree__item",children:e.children?.length?Jj(TA,{children:[dt("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}),dt("ul",{role:"group",children:dt(SA,{nodes:e.children})})]}):dt("button",{type:"button",class:"rui-tree__node",role:"treeitem","data-value":e.id,"aria-selected":"false",tabindex:-1,children:e.label})}))});function Zj({nodes:t,label:e,children:i,...r}){let s=t!=null?dt(SA,{nodes:t}):i;return dt("rui-tree",{...r,label:e,children:dt("ul",{class:"rui-tree","data-ref":"root",role:"tree","aria-label":e||void 0,"aria-multiselectable":"false",children:s})})}import{RadiantElement as MA,customElement as n2,event as o2,onEvent as LA,onUpdated as a2,prop as PA}from"@ecopages/radiant";var EA,RA,AA,IA,CA,DA,OA,VA;function e2(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:kA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||kA(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:t2(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return r2(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 t2(t){var e=i2(t,"string");return typeof e=="symbol"?e:e+""}function i2(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 kA(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 r2(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 FA,jA=class extends MA{static{({e:[AA,IA,CA,DA,OA,VA,EA],c:[FA,RA]}=e2(this,[n2("rui-treegrid")],[[PA({type:String,defaultValue:""}),0,"label"],[PA({type:String,reflect:!0,defaultValue:""}),0,"value"],[o2({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[a2("value"),2,"onValueUpdated"],[LA({selector:'[role="gridcell"]',type:"click"}),2,"onCellClick"],[LA({selector:'[role="gridcell"]',type:"keydown"}),2,"onCellKeydown"]],0,void 0,MA))}label=(EA(this),AA(this));value=(IA(this),CA(this));changeEvent=(DA(this),OA(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")}}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.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=(VA(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{RA()}};import{Fragment as Sa,jsx as Xe,jsxs as BA}from"@ecopages/jsx/jsx-runtime";var UA=({rows:t})=>Xe(Sa,{children:t.map(e=>BA(Sa,{children:[Xe("div",{class:"rui-treegrid__row",role:"row","data-row-id":e.id,"aria-expanded":e.children?.length?e.expanded??!1:void 0,children:e.cells.map((i,r)=>Xe("div",{class:"rui-treegrid__cell",role:"gridcell",tabindex:-1,"data-col":r,"aria-selected":"false",children:i}))}),e.children?.length?Xe("div",{class:"rui-treegrid__group",role:"rowgroup",hidden:!(e.expanded??!1),children:Xe(UA,{rows:e.children})}):null]}))});function s2({columns:t,rows:e,label:i,children:r,...s}){let d=t!=null&&e!=null?BA(Sa,{children:[Xe("div",{class:"rui-treegrid__row rui-treegrid__row--header",role:"row",children:t.map(h=>Xe("div",{class:"rui-treegrid__cell rui-treegrid__cell--header",role:"columnheader",children:h}))}),Xe(UA,{rows:e})]}):r;return Xe("rui-treegrid",{...s,label:i,children:Xe("div",{class:"rui-treegrid","data-ref":"root",role:"treegrid","aria-label":i||void 0,children:d})})}import{RadiantElement as iI,bindTo as Ea,bound as rI,customElement as h2,event as p2,onEvent as nI,onUpdated as f2,prop as Ra,query as oI}from"@ecopages/radiant";var zA,qA,KA,$A,GA,WA,HA,YA,NA,XA,QA,JA,ZA,eI;function l2(t,e,i,r,s,d){var h,a,E,A,S,I,T,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,V=Object.create,G=[V(null),V(null)],W=e.length;function O(n,g,f){return function(o,l){g&&(l=o,o=t);for(var b=0;b<n.length;b++)l=n[b].apply(o,f?[l]:[]);return f?l:o}}function _(n,g,f,o){if(typeof n!="function"&&(o||n!==void 0))throw new TypeError(g+" must "+(f||"be")+" a function"+(o?"":" or undefined"));return n}function H(n,g,f,o,l,b,w,m,v,y,N){function F(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var B=[].concat(g[0]),X=g[3],U=!w,C=l===1,Q=l===3,J=l===4,k=l===2;function M(c,R,te){return function(P,ie){return R&&(ie=P,P=n),te&&te(P),u[c].call(P,ie)}}if(!U){var u={},z=[],x=Q?"get":J||C?"set":"value";if(v?(y||C?u={get:tI(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||tI(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=G[+m][o])&&(a^l)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");G[+m][o]=l<3?1:l}}for(var p=n,L=B.length-1;L>=0;L-=f?2:1){var Z=_(B[L],"A decorator","be",!0),ee=f?B[L-1]:void 0,q={},D={kind:["field","accessor","method","getter","setter","class"][l],name:o,metadata:h,addInitializer:function(c,R){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(R,"An initializer","be",!0),b.push(R)}.bind(null,q)};if(U)a=Z.call(ee,p,D),q.v=1,_(a,"class decorators","return")&&(p=a);else if(D.static=m,D.private=v,a=D.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return F(c),u.value}:M("get",0,F):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,F):function(c,R){c[o]=R}),p=Z.call(ee,C?{get:u.get,set:u.set}:u[x],D),q.v=1,C){if(typeof p=="object"&&p)(a=_(p.get,"accessor.get"))&&(u.get=a),(a=_(p.set,"accessor.set"))&&(u.set=a),(a=_(p.init,"accessor.init"))&&z.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(p,(y?"field":"method")+" decorators","return")&&(y?z.unshift(p):u[x]=p)}return l<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?C?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),p}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:h})}return d!==void 0&&(h=d[K]),h=V(h??null),S=[],I=function(n){n&&S.push(O(n))},T=function(n,g){for(var f=0;f<i.length;f++){var o=i[f],l=o[1],b=7&l;if((8&l)==n&&!b==g){var w=o[2],m=!!o[3],v=16&l;H(n?t:t.prototype,o,v,m?"#"+w:u2(w),b,b<2?[]:n?A=A||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return d2(y)===t}:s)}}},T(8,0),T(0,0),T(8,1),T(0,1),I(E),I(A),a=S,W||Y(t),{e:a,get c(){var n=[];return W&&[Y(t=H(t,[e],r,t.name,5,n)),O(n,1)]}}}function u2(t){var e=c2(t,"string");return typeof e=="symbol"?e:e+""}function c2(t,e){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var r=i.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tI(t,e,i){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:i?i+" "+e:e})}catch{}return t}function d2(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var It=20,Ct=80;function Aa(t){return t!=="vertical"}var sI,aI=class extends iI{static{({e:[KA,$A,GA,WA,HA,YA,NA,XA,QA,JA,ZA,eI,zA],c:[sI,qA]}=l2(this,[h2("rui-window-splitter")],[[[Ra({type:Number,reflect:!0,defaultValue:50}),Ea({ref:"separator",attr:"aria-valuenow"})],0,"value"],[[Ra({type:String,defaultValue:"horizontal"}),Ea({ref:"separator",attr:"aria-orientation",map:e=>Aa(e)?"vertical":"horizontal"})],0,"orientation"],[[Ra({type:String,defaultValue:"Split view"}),Ea({ref:"separator",attr:"aria-label"})],0,"label"],[oI({ref:"primary"}),0,"primaryTarget"],[oI({ref:"separator"}),0,"separatorTarget"],[p2({name:"rui-splitter-change",bubbles:!0,composed:!0}),0,"changeEvent"],[f2(["value","orientation"]),2,"onPropsUpdated"],[nI({ref:"separator",type:"keydown"}),2,"onKeydown"],[nI({ref:"separator",type:"pointerdown"}),2,"onPointerDown"],[rI,2,"onPointerMove"],[rI,2,"onPointerUp"]],0,void 0,iI))}value=(zA(this),KA(this));orientation=($A(this),GA(this));label=(WA(this),HA(this));primaryTarget=(YA(this),NA(this));separatorTarget=(XA(this),QA(this));changeEvent=(JA(this),ZA(this));dragging=(eI(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=Aa(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=Aa(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{qA()}};import{jsx as pn,jsxs as m2}from"@ecopages/jsx/jsx-runtime";function g2({primary:t,secondary:e,orientation:i="horizontal",...r}){return pn("rui-window-splitter",{...r,orientation:i,children:m2("div",{class:j("rui-window-splitter",i!=="vertical"?"rui-window-splitter--horizontal":"rui-window-splitter--vertical"),"data-ref":"root",children:[pn("div",{"data-ref":"primary",class:"rui-window-splitter__pane",children:t}),pn("div",{"data-ref":"separator",class:"rui-window-splitter__separator",role:"separator",tabindex:0,"aria-valuemin":It,"aria-valuemax":Ct}),pn("div",{"data-ref":"secondary",class:"rui-window-splitter__pane",children:e})]})})}export{lr as DEFAULT_TOAST_POSITION,Ui as FormStore,yy as NAVIGATION_MENU_DEFAULT_CLOSE_DELAY,vy as NAVIGATION_MENU_DEFAULT_HOVER_DELAY,at as RUI_CONTROL_ATTR,po as RUI_DIALOG_ACTION_EVENT,Lr as RUI_DIALOG_CLOSE_EVENT,ot 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,wI as RuiAlert,xI as RuiAlertDescription,Na as RuiAlertElement,yI as RuiAlertIcon,_I as RuiAlertTitle,vn as RuiAutocomplete,gn as RuiAutocompleteCollection,ss as RuiAutocompleteElement,bn as RuiAutocompleteEmpty,DI as RuiAutocompleteInput,kI as RuiAvatar,LI as RuiBadge,qI as RuiBreadcrumb,bs as RuiBreadcrumbElement,YI as RuiBreadcrumbEllipsis,$I as RuiBreadcrumbItem,GI as RuiBreadcrumbLink,KI as RuiBreadcrumbList,WI as RuiBreadcrumbPage,HI as RuiBreadcrumbSeparator,Ze as RuiButton,JI as RuiButtonGroup,Si as RuiCalendar,yl as RuiCalendarElement,zC as RuiCarousel,lu as RuiCarouselElement,du as RuiCarouselNext,cu as RuiCarouselPrev,hu as RuiCarouselRotation,uu as RuiCarouselSlide,Di as RuiCheckbox,Tr as RuiCheckboxElement,aD as RuiCheckboxGroup,Qu as RuiCheckboxGroupControl,Xu as RuiCheckboxGroupElement,lD as RuiChip,uD as RuiChipList,cD as RuiChipListItem,QD as RuiCombobox,XD as RuiComboboxClear,Ad as RuiComboboxControl,Dc as RuiComboboxElement,Id as RuiComboboxInput,Od as RuiComboboxListbox,Cd as RuiComboboxTrigger,Dd as RuiComboboxValue,u1 as RuiCycleToggle,Xd as RuiCycleToggleButton,Nd as RuiCycleToggleElement,l1 as RuiCycleToggleItem,k1 as RuiDateField,up as RuiDateFieldCalendar,op as RuiDateFieldControl,Dh as RuiDateFieldElement,ap as RuiDateFieldInput,lp as RuiDateFieldPopover,sp as RuiDateFieldToggle,ai as RuiDateInput,rp as RuiDateInputElement,K1 as RuiDateRangePicker,Xp as RuiDateRangePickerCalendar,Kp as RuiDateRangePickerControl,qp as RuiDateRangePickerElement,Wp as RuiDateRangePickerEndInput,$p as RuiDateRangePickerInputs,Np as RuiDateRangePickerPopover,Hp as RuiDateRangePickerSeparator,Gp as RuiDateRangePickerStartInput,Yp as RuiDateRangePickerToggle,eO as RuiDialog,Tf as RuiDialogActions,wf as RuiDialogBody,Sf as RuiDialogClose,vf as RuiDialogElement,xf as RuiDialogTitle,AO as RuiDisclosure,Br as RuiDisclosureElement,IO as RuiDisclosureGroup,im as RuiDisclosureGroupElement,om as RuiDisclosureIcon,sm as RuiDisclosurePanel,am as RuiDisclosureTrigger,CO as RuiFeed,DO as RuiFeedArticle,kO as RuiFeedArticleActions,VO as RuiFeedArticleContent,OO as RuiFeedArticleHeader,MO as RuiFeedByline,LO as RuiFeedBylineBody,PO as RuiFeedMeta,sV as RuiField,uV as RuiFieldDescription,Ym as RuiFieldElement,dV as RuiFieldError,SV as RuiForm,Rg as RuiFormElement,VV as RuiGrid,Lg as RuiGridElement,PV as RuiHeading,BV as RuiHeadingDescription,jV as RuiHeadingEyebrow,FV as RuiHeadingTitle,Oo as RuiHeadline,JV as RuiHoverCard,QV as RuiHoverCardContent,ub as RuiHoverCardElement,XV as RuiHoverCardTrigger,xi as RuiIconCalendar,wi as RuiIconCheck,Qe as RuiIconChevronDown,fn as RuiIconChevronLeft,mn as RuiIconChevronRight,Re as RuiIconX,ek as RuiInput,tk as RuiInputGroup,ik as RuiInputGroupAddon,rk as RuiInputGroupText,gk as RuiKnob,rv as RuiKnobElement,xk as RuiLabel,ii as RuiListbox,Qc as RuiListboxElement,eo as RuiListboxOption,Jc as RuiListboxOptionIndicator,jk as RuiMenuButton,Av as RuiMenuButtonContent,Sv as RuiMenuButtonElement,Cv as RuiMenuButtonItem,Iv as RuiMenuButtonSubmenuContent,Rv as RuiMenuButtonTrigger,Wk as RuiMenubar,Bv as RuiMenubarElement,Uv as RuiMenubarMenu,zv as RuiMenubarMenuItem,qv as RuiMenubarSubmenuContent,tM as RuiMeter,ny as RuiMeterElement,cM as RuiNavigationMenu,lM as RuiNavigationMenuBar,_y as RuiNavigationMenuElement,hM as RuiNavigationMenuLink,pM as RuiNavigationMenuPanel,uM as RuiNavigationMenuPanels,dM as RuiNavigationMenuTrigger,TM as RuiNumberField,h_ as RuiNumberFieldDecrementButton,a_ as RuiNumberFieldElement,l_ as RuiNumberFieldGroup,d_ as RuiNumberFieldIncrementButton,u_ as RuiNumberFieldInput,c_ as RuiNumberFieldSteppers,VM as RuiPagination,D_ as RuiPaginationElement,O_ as RuiPaginationNav,BM as RuiPopover,FM as RuiPopoverContent,hx as RuiPopoverElement,UM as RuiPopoverTrigger,px as RuiPopoverTriggerElement,Lx as RuiRadio,QM as RuiRadioGroup,Mx as RuiRadioGroupControl,kx as RuiRadioGroupElement,dL as RuiSelect,sL as RuiSelectClear,l0 as RuiSelectControl,a0 as RuiSelectElement,h0 as RuiSelectListbox,lL as RuiSelectSearch,c0 as RuiSelectToggle,u0 as RuiSelectTrigger,d0 as RuiSelectValue,Wi as RuiSeparator,XL as RuiSidebar,UL as RuiSidebarContent,vw as RuiSidebarElement,zL as RuiSidebarFooter,KL as RuiSidebarGroup,$L as RuiSidebarGroupAction,GL as RuiSidebarGroupHeader,Ww as RuiSidebarGroupLabel,BL as RuiSidebarHeader,NL as RuiSidebarInset,WL as RuiSidebarMenu,YL as RuiSidebarMenuAction,Hw as RuiSidebarMenuButton,HL as RuiSidebarMenuItem,FL as RuiSidebarProvider,qL as RuiSidebarSeparator,jL as RuiSidebarTrigger,Gw as RuiSidebarTriggerElement,aP as RuiSlider,YT as RuiSliderElement,NT as RuiSliderValue,uP as RuiSpinner,vP as RuiSwitch,uS as RuiSwitchElement,zP as RuiTab,UP as RuiTabList,KP as RuiTabPanel,qP as RuiTabPanels,VP as RuiTable,EP as RuiTableBody,CP as RuiTableCell,AP as RuiTableColumn,MS as RuiTableElement,OP as RuiTableEmptyState,RP as RuiTableFooter,SP as RuiTableHeader,IP as RuiTableRow,DP as RuiTableSelectionCell,$P as RuiTabs,JS as RuiTabsElement,Sd as RuiTag,Mi as RuiTagGroup,xd as RuiTagGroupElement,Td as RuiTagList,Ed as RuiTagRemove,WP as RuiTextarea,pj as RuiToast,CE as RuiToastElement,fj as RuiToaster,oR as RuiToasterElement,Ij as RuiToc,kR as RuiTocElement,Mj as RuiToolbar,GR as RuiToolbarElement,$j as RuiTooltip,lA as RuiTooltipElement,Zj as RuiTree,wA as RuiTreeElement,s2 as RuiTreegrid,FA as RuiTreegridElement,g2 as RuiWindowSplitter,sI as RuiWindowSplitterElement,da as TOAST_COLLAPSED_PEEK,ha as TOAST_EXIT_MS,la as TOAST_GAP,ar as TOAST_LIFETIME,HP as TOAST_POSITIONS,sr as TOAST_SWIPE_THRESHOLD,ua as TOAST_VIEWPORT_OFFSET,ca as TOAST_VISIBLE_AMOUNT,YP as TOAST_WIDTH,Zd as ThemeItemLabel,Jd as ThemePreferenceIcon,d1 as ThemePreferenceItemContent,Ct as WINDOW_SPLITTER_MAX,It as WINDOW_SPLITTER_MIN,cO as closeDialog,hO as createDialogHandle,Co as createRulesResolver,j as cx,ro as cycleValue,bj as dismissToast,Ao as fieldContext,hi as findFieldControl,pi as formContext,lO as getOpenDialogId,Vf as installDialogs,di as isNativeTextControl,uO as openDialog,Eo as readControlValue,qO as registerFieldControl,Xm as runRulesResolver,gj as showToast,mj as toast,dO as toggleDialog,fo as uninstallDialogs,ne as withDefaultAriaLabel,$r as writeControlValue};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|