@ecopages/radiant-ui 0.1.0-rc.7 → 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.
Files changed (238) hide show
  1. package/README.md +11 -3
  2. package/dist/components/ui/alert/alert.d.ts +2 -4
  3. package/dist/components/ui/alert/alert.script.d.ts +25 -15
  4. package/dist/components/ui/autocomplete/autocomplete.css +1 -2
  5. package/dist/components/ui/autocomplete/autocomplete.d.ts +8 -3
  6. package/dist/components/ui/autocomplete/autocomplete.script.d.ts +29 -4
  7. package/dist/components/ui/avatar/avatar.css +10 -8
  8. package/dist/components/ui/avatar/avatar.d.ts +3 -1
  9. package/dist/components/ui/breadcrumb/breadcrumb.d.ts +11 -11
  10. package/dist/components/ui/breadcrumb/breadcrumb.script.d.ts +10 -10
  11. package/dist/components/ui/calendar/calendar.css +10 -5
  12. package/dist/components/ui/calendar/calendar.script.d.ts +24 -21
  13. package/dist/components/ui/calendar/index.js +1 -1
  14. package/dist/components/ui/calendar/index.js.map +3 -3
  15. package/dist/components/ui/carousel/carousel-autoplay.d.ts +22 -0
  16. package/dist/components/ui/carousel/carousel-swipe.d.ts +17 -0
  17. package/dist/components/ui/carousel/carousel-window.d.ts +63 -0
  18. package/dist/components/ui/carousel/carousel.css +71 -18
  19. package/dist/components/ui/carousel/carousel.d.ts +8 -4
  20. package/dist/components/ui/carousel/carousel.script.d.ts +73 -40
  21. package/dist/components/ui/carousel/index.js +1 -1
  22. package/dist/components/ui/carousel/index.js.map +4 -4
  23. package/dist/components/ui/checkbox/checkbox.d.ts +11 -0
  24. package/dist/components/ui/checkbox/checkbox.script.d.ts +31 -8
  25. package/dist/components/ui/checkbox/index.js +1 -1
  26. package/dist/components/ui/checkbox/index.js.map +4 -4
  27. package/dist/components/ui/checkbox-group/checkbox-group.d.ts +4 -2
  28. package/dist/components/ui/checkbox-group/checkbox-group.script.d.ts +39 -20
  29. package/dist/components/ui/checkbox-group/index.js +1 -1
  30. package/dist/components/ui/checkbox-group/index.js.map +4 -4
  31. package/dist/components/ui/combobox/combobox.css +9 -1
  32. package/dist/components/ui/combobox/combobox.d.ts +12 -4
  33. package/dist/components/ui/combobox/combobox.script.d.ts +74 -25
  34. package/dist/components/ui/combobox/index.d.ts +2 -2
  35. package/dist/components/ui/combobox/index.js +1 -1
  36. package/dist/components/ui/combobox/index.js.map +4 -4
  37. package/dist/components/ui/cycle-toggle/cycle-toggle.d.ts +6 -2
  38. package/dist/components/ui/cycle-toggle/cycle-toggle.script.d.ts +35 -4
  39. package/dist/components/ui/cycle-toggle/index.js +1 -1
  40. package/dist/components/ui/cycle-toggle/index.js.map +3 -3
  41. package/dist/components/ui/date-field/date-field.css +13 -17
  42. package/dist/components/ui/date-field/date-field.d.ts +10 -8
  43. package/dist/components/ui/date-field/date-field.script.d.ts +35 -52
  44. package/dist/components/ui/date-field/index.js +1 -1
  45. package/dist/components/ui/date-field/index.js.map +4 -4
  46. package/dist/components/ui/date-input/date-input-segment-dom.d.ts +24 -0
  47. package/dist/components/ui/date-input/date-input.css +50 -0
  48. package/dist/components/ui/date-input/date-input.d.ts +8 -0
  49. package/dist/components/ui/date-input/date-input.script.d.ts +137 -0
  50. package/dist/components/ui/date-input/index.d.ts +2 -0
  51. package/dist/components/ui/date-input/index.js +2 -0
  52. package/dist/components/ui/date-input/index.js.map +7 -0
  53. package/dist/components/ui/date-range-picker/date-range-picker.css +18 -19
  54. package/dist/components/ui/date-range-picker/date-range-picker.d.ts +11 -9
  55. package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +42 -51
  56. package/dist/components/ui/date-range-picker/index.js +1 -1
  57. package/dist/components/ui/date-range-picker/index.js.map +4 -4
  58. package/dist/components/ui/dialog/dialog.css +18 -14
  59. package/dist/components/ui/dialog/dialog.d.ts +6 -0
  60. package/dist/components/ui/dialog/dialog.script.d.ts +43 -10
  61. package/dist/components/ui/dialog/index.js +1 -1
  62. package/dist/components/ui/dialog/index.js.map +4 -4
  63. package/dist/components/ui/disclosure/disclosure-group.script.d.ts +19 -3
  64. package/dist/components/ui/disclosure/disclosure.css +3 -6
  65. package/dist/components/ui/disclosure/disclosure.d.ts +23 -7
  66. package/dist/components/ui/disclosure/disclosure.script.d.ts +31 -7
  67. package/dist/components/ui/disclosure/index.d.ts +1 -1
  68. package/dist/components/ui/disclosure/index.js +1 -1
  69. package/dist/components/ui/disclosure/index.js.map +4 -4
  70. package/dist/components/ui/field/field-description.d.ts +1 -0
  71. package/dist/components/ui/field/field-error.d.ts +2 -2
  72. package/dist/components/ui/field/field.d.ts +4 -4
  73. package/dist/components/ui/field/field.script.d.ts +54 -24
  74. package/dist/components/ui/field/index.js +1 -1
  75. package/dist/components/ui/field/index.js.map +4 -4
  76. package/dist/components/ui/form/control-protocol.d.ts +38 -1
  77. package/dist/components/ui/form/form-context.d.ts +3 -0
  78. package/dist/components/ui/form/form.d.ts +6 -0
  79. package/dist/components/ui/form/form.script.d.ts +29 -12
  80. package/dist/components/ui/form/index.d.ts +2 -1
  81. package/dist/components/ui/form/index.js +1 -1
  82. package/dist/components/ui/form/index.js.map +4 -4
  83. package/dist/components/ui/grid/grid.d.ts +4 -3
  84. package/dist/components/ui/grid/grid.script.d.ts +19 -11
  85. package/dist/components/ui/hover-card/hover-card.css +12 -101
  86. package/dist/components/ui/hover-card/hover-card.d.ts +7 -2
  87. package/dist/components/ui/hover-card/hover-card.script.d.ts +36 -5
  88. package/dist/components/ui/hover-card/index.js +1 -1
  89. package/dist/components/ui/hover-card/index.js.map +4 -4
  90. package/dist/components/ui/input/index.js +1 -1
  91. package/dist/components/ui/input/index.js.map +4 -4
  92. package/dist/components/ui/input/input.css +1 -1
  93. package/dist/components/ui/knob/index.js +1 -1
  94. package/dist/components/ui/knob/index.js.map +3 -3
  95. package/dist/components/ui/knob/knob.css +6 -1
  96. package/dist/components/ui/knob/knob.d.ts +4 -4
  97. package/dist/components/ui/knob/knob.script.d.ts +55 -20
  98. package/dist/components/ui/label/index.js +1 -1
  99. package/dist/components/ui/label/index.js.map +4 -4
  100. package/dist/components/ui/label/label.d.ts +2 -1
  101. package/dist/components/ui/listbox/index.d.ts +2 -2
  102. package/dist/components/ui/listbox/index.js +1 -1
  103. package/dist/components/ui/listbox/index.js.map +4 -4
  104. package/dist/components/ui/listbox/listbox.css +14 -0
  105. package/dist/components/ui/listbox/listbox.d.ts +16 -2
  106. package/dist/components/ui/listbox/listbox.script.d.ts +55 -12
  107. package/dist/components/ui/menu-button/index.js +1 -1
  108. package/dist/components/ui/menu-button/index.js.map +4 -4
  109. package/dist/components/ui/menu-button/menu-button.d.ts +2 -2
  110. package/dist/components/ui/menu-button/menu-button.script.d.ts +30 -27
  111. package/dist/components/ui/menubar/index.js +1 -1
  112. package/dist/components/ui/menubar/index.js.map +4 -4
  113. package/dist/components/ui/menubar/menubar.script.d.ts +41 -15
  114. package/dist/components/ui/meter/index.js +1 -1
  115. package/dist/components/ui/meter/index.js.map +3 -3
  116. package/dist/components/ui/meter/meter.css +27 -2
  117. package/dist/components/ui/meter/meter.script.d.ts +19 -14
  118. package/dist/components/ui/navigation-menu/index.d.ts +1 -1
  119. package/dist/components/ui/navigation-menu/index.js +1 -1
  120. package/dist/components/ui/navigation-menu/index.js.map +4 -4
  121. package/dist/components/ui/navigation-menu/navigation-menu.css +32 -34
  122. package/dist/components/ui/navigation-menu/navigation-menu.d.ts +34 -5
  123. package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +93 -12
  124. package/dist/components/ui/number-field/index.js +1 -1
  125. package/dist/components/ui/number-field/index.js.map +4 -4
  126. package/dist/components/ui/number-field/number-field.css +1 -1
  127. package/dist/components/ui/number-field/number-field.d.ts +8 -19
  128. package/dist/components/ui/number-field/number-field.script.d.ts +30 -9
  129. package/dist/components/ui/pagination/index.d.ts +1 -1
  130. package/dist/components/ui/pagination/index.js +1 -1
  131. package/dist/components/ui/pagination/index.js.map +3 -3
  132. package/dist/components/ui/pagination/pagination.css +50 -13
  133. package/dist/components/ui/pagination/pagination.d.ts +33 -9
  134. package/dist/components/ui/pagination/pagination.script.d.ts +29 -9
  135. package/dist/components/ui/popover/index.js +1 -1
  136. package/dist/components/ui/popover/index.js.map +4 -4
  137. package/dist/components/ui/popover/popover.d.ts +17 -1
  138. package/dist/components/ui/popover/popover.script.d.ts +57 -9
  139. package/dist/components/ui/radio-group/index.js +1 -1
  140. package/dist/components/ui/radio-group/index.js.map +4 -4
  141. package/dist/components/ui/radio-group/radio-group.d.ts +2 -2
  142. package/dist/components/ui/radio-group/radio-group.script.d.ts +35 -16
  143. package/dist/components/ui/select/index.d.ts +2 -2
  144. package/dist/components/ui/select/index.js +1 -1
  145. package/dist/components/ui/select/index.js.map +4 -4
  146. package/dist/components/ui/select/select.css +8 -6
  147. package/dist/components/ui/select/select.d.ts +18 -9
  148. package/dist/components/ui/select/select.script.d.ts +74 -26
  149. package/dist/components/ui/shared/calendar-popover-behavior.d.ts +27 -0
  150. package/dist/components/ui/shared/control-toggle.css +8 -4
  151. package/dist/components/ui/shared/field-label.d.ts +5 -0
  152. package/dist/components/ui/shared/listbox-host-controller.d.ts +41 -0
  153. package/dist/components/ui/shared/listbox-option.d.ts +4 -0
  154. package/dist/components/ui/shared/multi-value.d.ts +23 -1
  155. package/dist/components/ui/shared/numeric-range.d.ts +8 -0
  156. package/dist/components/ui/shared/popover.css +10 -99
  157. package/dist/components/ui/sidebar/index.d.ts +2 -1
  158. package/dist/components/ui/sidebar/index.js +1 -1
  159. package/dist/components/ui/sidebar/index.js.map +4 -4
  160. package/dist/components/ui/sidebar/sidebar-trigger.d.ts +12 -0
  161. package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +52 -31
  162. package/dist/components/ui/sidebar/sidebar.css +67 -61
  163. package/dist/components/ui/sidebar/sidebar.d.ts +9 -4
  164. package/dist/components/ui/sidebar/sidebar.script.d.ts +42 -20
  165. package/dist/components/ui/slider/index.js +1 -1
  166. package/dist/components/ui/slider/index.js.map +4 -4
  167. package/dist/components/ui/slider/slider.css +5 -5
  168. package/dist/components/ui/slider/slider.d.ts +20 -10
  169. package/dist/components/ui/slider/slider.script.d.ts +103 -27
  170. package/dist/components/ui/switch/index.js +1 -1
  171. package/dist/components/ui/switch/index.js.map +4 -4
  172. package/dist/components/ui/switch/switch.css +28 -22
  173. package/dist/components/ui/switch/switch.d.ts +13 -0
  174. package/dist/components/ui/switch/switch.script.d.ts +34 -8
  175. package/dist/components/ui/table/index.js +1 -1
  176. package/dist/components/ui/table/index.js.map +4 -4
  177. package/dist/components/ui/table/table.d.ts +9 -7
  178. package/dist/components/ui/table/table.script.d.ts +55 -12
  179. package/dist/components/ui/tabs/tabs.css +18 -12
  180. package/dist/components/ui/tabs/tabs.d.ts +7 -4
  181. package/dist/components/ui/tabs/tabs.script.d.ts +39 -9
  182. package/dist/components/ui/tag-group/index.js +1 -1
  183. package/dist/components/ui/tag-group/index.js.map +4 -4
  184. package/dist/components/ui/tag-group/tag-group.d.ts +19 -7
  185. package/dist/components/ui/tag-group/tag-group.script.d.ts +58 -10
  186. package/dist/components/ui/textarea/index.js +1 -1
  187. package/dist/components/ui/textarea/index.js.map +4 -4
  188. package/dist/components/ui/textarea/textarea.css +1 -1
  189. package/dist/components/ui/toast/index.js +1 -1
  190. package/dist/components/ui/toast/index.js.map +4 -4
  191. package/dist/components/ui/toast/toast.css +35 -32
  192. package/dist/components/ui/toast/toast.script.d.ts +17 -31
  193. package/dist/components/ui/toast/toaster.script.d.ts +24 -12
  194. package/dist/components/ui/toc/toc.script.d.ts +19 -8
  195. package/dist/components/ui/toolbar/toolbar.d.ts +5 -0
  196. package/dist/components/ui/toolbar/toolbar.script.d.ts +24 -4
  197. package/dist/components/ui/tooltip/index.js +1 -1
  198. package/dist/components/ui/tooltip/index.js.map +4 -4
  199. package/dist/components/ui/tooltip/tooltip.css +14 -94
  200. package/dist/components/ui/tooltip/tooltip.d.ts +7 -0
  201. package/dist/components/ui/tooltip/tooltip.script.d.ts +36 -6
  202. package/dist/components/ui/tree/tree.d.ts +4 -3
  203. package/dist/components/ui/tree/tree.script.d.ts +28 -15
  204. package/dist/components/ui/treegrid/treegrid.d.ts +5 -3
  205. package/dist/components/ui/treegrid/treegrid.script.d.ts +33 -14
  206. package/dist/components/ui/window-splitter/index.d.ts +1 -1
  207. package/dist/components/ui/window-splitter/index.js +1 -1
  208. package/dist/components/ui/window-splitter/index.js.map +3 -3
  209. package/dist/components/ui/window-splitter/window-splitter.d.ts +10 -1
  210. package/dist/components/ui/window-splitter/window-splitter.script.d.ts +26 -8
  211. package/dist/index.d.ts +2 -0
  212. package/dist/index.js +1 -1
  213. package/dist/index.js.map +4 -4
  214. package/dist/lib/icons/check.d.ts +3 -0
  215. package/dist/lib/icons/chevron-down.d.ts +0 -1
  216. package/dist/lib/icons/index.d.ts +2 -0
  217. package/dist/lib/icons/x.d.ts +5 -0
  218. package/dist/lib/intl-date/index.d.ts +4 -2
  219. package/dist/lib/intl-date/segment-editing.d.ts +34 -0
  220. package/dist/lib/intl-date/segments.d.ts +26 -4
  221. package/dist/lib/non-empty.d.ts +6 -0
  222. package/dist/lib/unique-id.d.ts +11 -0
  223. package/dist/lib/viewport/breakpoints.d.ts +6 -0
  224. package/dist/lib/viewport/mobile-layout.d.ts +15 -0
  225. package/dist/styles/primitives.css +14 -11
  226. package/dist/styles/radiant-ui-core.css +10 -0
  227. package/dist/styles/radiant-ui.css +40 -11
  228. package/dist/styles/style-dependencies.json +38 -13
  229. package/dist/styles/styles.css +485 -252
  230. package/dist/styles/tailwind.css +40 -101
  231. package/dist/styles/tokens/presets/colors/aurora.css +2 -0
  232. package/dist/styles/tokens/presets/colors/basalt.css +2 -0
  233. package/dist/styles/tokens/presets/colors/ember.css +2 -0
  234. package/dist/styles/tokens/presets/colors/glacier.css +2 -0
  235. package/dist/styles/tokens/semantic.css +1 -0
  236. package/dist/styles/tokens/system.css +11 -3
  237. package/dist/styles/tokens/typography/default.css +8 -0
  238. package/package.json +27 -13
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 P(...e){return e.filter(Boolean).join(" ")}import{RadiantElement as Uo,bound as bA,customElement as vA,event as yA,onEvent as _A,prop as Ki}from"@ecopages/radiant";var Ro,Io,Co,Do,Oo,ko,Mo,Vo,jo,Lo,Po,Bo;function pA(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Fo(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Fo(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:fA(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return gA(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function fA(e){var t=mA(e,"string");return typeof t=="symbol"?t:t+""}function mA(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 Fo(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 gA(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 qo,zo=class extends Uo{static{({e:[Co,Do,Oo,ko,Mo,Vo,jo,Lo,Po,Bo,Ro],c:[qo,Io]}=pA(this,[vA("rui-alert")],[[Ki({type:String,reflect:!0,defaultValue:"info"}),0,"variant"],[Ki({type:String,reflect:!0,defaultValue:"inline"}),0,"layout"],[Ki({type:Boolean,reflect:!0,defaultValue:!1}),0,"dismissible"],[Ki({type:String,attribute:"close-label",defaultValue:"Dismiss"}),0,"closeLabel"],[yA({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[bA,2,"dismiss"],[_A({selector:"[data-alert-close]",type:"click"}),2,"onCloseClick"]],0,void 0,Uo))}constructor(...t){super(...t),Bo(this)}variant=(Ro(this),Co(this));layout=(Do(this),Oo(this));dismissible=(ko(this),Mo(this));closeLabel=(Vo(this),jo(this));closeEvent=(Lo(this),Po(this));dismiss(){this.isConnected&&(this.closeEvent.emit({reason:"dismiss"}),this.remove())}onCloseClick(t){t.stopPropagation(),this.dismissible&&this.dismiss()}static{Io()}};import{jsx as Ut,jsxs as Ko}from"@ecopages/jsx/jsx-runtime";var xA={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 wA({variant:e="info",class:t,children:i,...r}){if(i!=null)return Ut("span",{...r,class:P("rui-alert__icon",t),children:i});let l=xA[e],p=Array.isArray(l)?l:[l];return Ut("span",{...r,class:P("rui-alert__icon",t),"aria-hidden":"true",children:Ut("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:p.map(d=>Ut("path",{d}))})})}function SA({children:e,class:t,...i}){return Ut("p",{...i,class:P("rui-alert__title",t),children:e})}function TA({children:e,class:t,...i}){return Ut("div",{...i,class:P("rui-alert__description",t),children:e})}function EA({children:e,variant:t="info",layout:i="inline",dismissible:r=!1,closeLabel:l="Dismiss",class:p,slot:d,...a}){return Ut("rui-alert",{slot:d,variant:t,layout:i,dismissible:r,"close-label":l,children:Ko("div",{...a,class:P("rui-alert",`rui-alert--${t}`,`rui-alert--${i}`,r&&"rui-alert--dismissible",p),role:"alert",children:[e,r?Ut("button",{type:"button",class:"rui-alert__close","data-alert-close":!0,"aria-label":l||"Dismiss",children:Ko("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:[Ut("path",{d:"M18 6 6 18"}),Ut("path",{d:"m6 6 12 12"})]})}):null]})})}import{RadiantElement as Qo,customElement as DA,onEvent as OA,onUpdated as kA,prop as Jo}from"@ecopages/radiant";function $i(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 p=e.slice(l,l+t.length);if(r.compare(p,t)===0)return!0}return!1}var $o,Wo,Go,Ho,Yo,No;function AA(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Xo(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Xo(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:RA(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return CA(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function RA(e){var t=IA(e,"string");return typeof t=="symbol"?t:t+""}function IA(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 Xo(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 CA(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 ta,Zo=class extends Qo{static{({e:[Go,Ho,Yo,No,$o],c:[ta,Wo]}=AA(this,[DA("rui-autocomplete")],[[Jo({type:String,defaultValue:"base"}),0,"sensitivity"],[Jo({type:String,attribute:"input-value",defaultValue:""}),0,"inputValue"],[kA(["sensitivity","inputValue"]),2,"onPropsUpdated"],[OA({selector:"[data-autocomplete-input]",type:"input"}),2,"onInput"]],0,void 0,Qo))}sensitivity=($o(this),Go(this));inputValue=(Ho(this),Yo(this));externalInput=(No(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 p of i){let d=$i(this.getItemText(p),t,this.sensitivity);p.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{Wo()}};import{jsx as Oe}from"@ecopages/jsx/jsx-runtime";function MA({placeholder:e,class:t,disabled:i,...r}){return Oe("input",{...r,type:"search","data-autocomplete-input":!0,class:P("rui-autocomplete__input",t),placeholder:e,disabled:i,autocomplete:"off"})}function Fr({children:e,class:t,...i}){return Oe("div",{...i,"data-autocomplete-collection":!0,class:P("rui-autocomplete__collection",t),children:e})}function Ur({children:e,class:t,...i}){return Oe("div",{...i,"data-autocomplete-empty":!0,class:P("rui-autocomplete__empty",t),children:e})}function VA({children:e}){return Oe("div",{class:"rui-autocomplete","data-ref":"root",children:e})}function zr({children:e,...t}){return Oe("rui-autocomplete",{...t,children:Oe(VA,{children:e})})}import{jsx as qr}from"@ecopages/jsx/jsx-runtime";function Ot(...e){for(let t of e)if(t!==void 0)return t}function jA(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 LA({src:e,alt:t="",fallback:i,size:r="md",class:l,children:p,role:d,aria:a,...E}){let R=i??(t?jA(t):void 0);return qr("span",{...E,aria:nt(a,e?void 0:t||i),class:P("rui-avatar",`rui-avatar--${r}`,l),role:Ot(d,e?void 0:"img"),children:e?qr("img",{class:"rui-avatar__image",src:e,alt:t}):qr("span",{class:"rui-avatar__fallback","aria-hidden":t||i?"true":void 0,children:p??R??"?"})})}import{jsx as PA}from"@ecopages/jsx/jsx-runtime";function BA({children:e,variant:t="filled",class:i,...r}){return PA("span",{...r,class:P("rui-badge",`rui-badge--${t}`,i),children:e})}import{RadiantElement as sa,customElement as KA,prop as la}from"@ecopages/radiant";var ea,ia,ra,na,oa;function FA(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:aa(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||aa(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:UA(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return qA(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function UA(e){var t=zA(e,"string");return typeof t=="symbol"?t:t+""}function zA(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 aa(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 qA(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,ua=class extends sa{static{({e:[ia,ra,na,oa],c:[ca,ea]}=FA(this,[KA("rui-breadcrumb")],[[la({type:String,defaultValue:"Breadcrumb"}),0,"label"],[la({type:String,defaultValue:"/"}),0,"separator"]],0,void 0,sa))}constructor(...t){super(...t),oa(this)}label=ia(this);separator=(ra(this),na(this));static{ea()}};import{jsx as Zt,jsxs as $A}from"@ecopages/jsx/jsx-runtime";function WA({children:e,label:t,separator:i,...r}){return Zt("rui-breadcrumb",{...r,label:t,separator:i,children:Zt("nav",{class:"rui-breadcrumb","aria-label":t||"Breadcrumb",style:{"--rui-breadcrumb-separator":JSON.stringify(i||"/")},children:e})})}function GA({children:e,class:t,...i}){return Zt("ol",{...i,class:P("rui-breadcrumb__list",t),children:e})}function HA({children:e,class:t,...i}){return Zt("li",{...i,class:P("rui-breadcrumb__item",t),children:e})}function YA({children:e,href:t,class:i,...r}){return Zt("a",{...r,class:P("rui-breadcrumb__link",i),href:t,children:e})}function NA({children:e,class:t,...i}){return Zt("span",{...i,class:P("rui-breadcrumb__page",t),"aria-current":"page",children:e})}function XA({children:e,class:t,...i}){return Zt("li",{...i,class:P("rui-breadcrumb__separator",t),role:"presentation","aria-hidden":"true",children:e})}function QA({label:e="More",class:t,...i}){return $A("span",{...i,class:P("rui-breadcrumb__ellipsis",t),role:"presentation","aria-hidden":"true",children:[Zt("span",{"aria-hidden":"true",children:"\u2026"}),Zt("span",{class:"rui-breadcrumb__ellipsis-label",children:e})]})}import{jsx as da}from"@ecopages/jsx/jsx-runtime";function JA(e,t,i){if(e!==void 0)return e;if(t)return i}function ZA(e,t){if(typeof e=="function"){e(t);return}e!=null&&typeof e=="object"&&"handleEvent"in e&&e.handleEvent(t)}function te(e){if(e.href!==void 0){let{href:$,target:L,rel:W,download:G,children:O,class:_,variant:H,size:Y,square:n,...g}=e;return da("a",{...g,href:$,target:L,rel:W,download:G,class:P("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:p,type:d="button",disabled:a,pressed:E,defaultPressed:R=!1,toggle:S=!1,"on:click":D,...A}=e,K=$=>{if(S&&E===void 0){let L=$.currentTarget,W=L.getAttribute("aria-pressed")!=="true";L.setAttribute("aria-pressed",String(W))}ZA(D,$)};return da("button",{...A,type:d,class:P("rui-button",`rui-button--${t??"filled"}`,`rui-button--${i??"md"}`,r&&"rui-button--square",l),disabled:a,"aria-pressed":JA(E,S,R),"data-toggle":S&&E===void 0?"":void 0,"on:click":S||D?K:void 0,children:p})}import{jsx as tR}from"@ecopages/jsx/jsx-runtime";function eR({children:e,orientation:t="horizontal",class:i,...r}){return tR("div",{...r,role:"group","aria-orientation":t,class:P("rui-button-group",`rui-button-group--${t}`,i),children:e})}import{jsx as _t,jsxs as on}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as ns,customElement as SR,event as TR,onEvent as ye,onUpdated as ER,prop as oe,state as ae}from"@ecopages/radiant";function zt(e){if(!e)return;let t=e.split(",").map(i=>i.trim()).filter(Boolean);return t.length>1?t:t[0]}function kt(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]),p=new Date(i,r,l);return p.getFullYear()!==i||p.getMonth()!==r||p.getDate()!==l?null:p}function Mt(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 Kr(e,t,i){return!(t&&e<t||i&&e>i)}function ve(e,t){return e.localeCompare(t)}function ke(e,t){return ve(e,t)<=0?{start:e,end:t}:{start:t,end:e}}function Et(e){if(!e)return null;let[t,i]=e.split("/");return!t||!i?null:ke(t,i)}function Ze(e){if(!e)return"";let t=ke(e.start,e.end);return`${t.start}/${t.end}`}function Me(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean).sort(ve):[]}function $r(e){return[...new Set(e)].sort(ve).join(",")}function Wr(e,t){let i=new Set(e);return i.has(t)?i.delete(t):i.add(t),[...i].sort(ve)}function ha(e,t){let i=ke(t.start,t.end);return ve(e,i.start)>=0&&ve(e,i.end)<=0}function Gr(e,t,i){if(t==="single"){let R=i.singleIso===e;return{isSelected:R,isRangeStart:R,isRangeEnd:R,isRangeMiddle:!1}}if(t==="multiple"){let R=i.multipleIsos?.includes(e)??!1;return{isSelected:R,isRangeStart:R,isRangeEnd:R,isRangeMiddle:!1}}let r=i.range;if(!r)return{isSelected:!1,isRangeStart:!1,isRangeEnd:!1,isRangeMiddle:!1};let l=ke(r.start,r.end),p=ha(e,l),d=e===l.start,a=e===l.end;return{isSelected:p,isRangeStart:d,isRangeEnd:a,isRangeMiddle:p&&!d&&!a}}function Hr(e,t,i){return t.anchor?{committed:ke(t.anchor,i),draft:{anchor:null,hover:null}}:{committed:e,draft:{anchor:i,hover:i}}}function Wi(e){let t=iR(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 iR(e){return Array.isArray(e)?e[0]??navigator.language:e??navigator.language}function rR(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function nR(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function oR(e){let t=e.selectionMode??"single",i=e.value??"";if(t==="multiple")return{mode:t,multipleIsos:Me(i)};if(t==="range"){let r=Et(i);if(e.rangeDraft?.anchor){let l=e.rangeDraft.hover??e.rangeDraft.anchor;return{mode:t,range:aR(e.rangeDraft.anchor,l)}}return{mode:t,range:r}}return{mode:t,singleIso:i||void 0}}function aR(e,t){return e.localeCompare(t)<=0?{start:e,end:t}:{start:t,end:e}}function Yr(e,t,i){let r=Wi(i.locale),l=rR(i.today??new Date),p=oR(i),a=(new Date(e,t,1).getDay()-r+7)%7,E=new Date(e,t,1-a),R=[],S=new Date(E);for(let D=0;D<6;D+=1){let A=[];for(let K=0;K<7;K+=1){let $=Mt(S),L=Gr($,p.mode,{singleIso:p.singleIso,multipleIsos:p.multipleIsos,range:p.range});A.push({date:new Date(S),iso:$,inMonth:S.getMonth()===t,isToday:nR(S,l),isSelected:L.isSelected,isDisabled:!Kr($,i.min,i.max),isRangeStart:L.isRangeStart,isRangeEnd:L.isRangeEnd,isRangeMiddle:L.isRangeMiddle}),S.setDate(S.getDate()+1)}if(R.push(A),D>=4&&S.getMonth()!==t&&S.getDate()>7)break}return R}function Gi(e,t,i){let r=new Date(e,t+i,1);return{year:r.getFullYear(),month:r.getMonth()}}function Nr(e,t,i){let r=Math.max(1,Math.min(i,12));return Array.from({length:r},(l,p)=>{let d=Gi(e,t,p);return{year:d.year,month:d.month,offset:p}})}var pa=new Map;function sR(e,t){return`${JSON.stringify(e??null)}|${JSON.stringify(t)}`}function Vt(e,t){let i=sR(e,t),r=pa.get(i);if(r)return r;let l=new Intl.DateTimeFormat(e,t);return pa.set(i,l),l}function ti(e,t,i="medium"){return Vt(t,{dateStyle:i}).format(e)}function Xr(e,t){return Vt(t,{month:"long",year:"numeric"}).format(e)}function Qr(e,t){let i=Vt(e,{weekday:"narrow"}),r=[];for(let l=0;l<7;l+=1){let p=(t+l)%7,d=new Date(2024,0,p===0?7:p);r.push(i.format(d))}return r}function Jr(e){return new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"day")}var lR={0:"digit",a:"letter","*":"any"},uR=/\p{L}/u;function cR(e,t){let i=t?.[e];if(i instanceof RegExp)return{kind:"any",pattern:i};if(i)return{kind:i};let r=lR[e];return r?{kind:r}:null}function fa(e,t,i){return i?i.test(e):t==="digit"?/\d/.test(e):t==="letter"?uR.test(e):e.length>0}function ma(e,t,i=!1){let r=[],l=0;for(;l<e.length;){let p=e[l];if(p==="\\"){let a=e[l+1];a&&r.push({type:"literal",value:a}),l+=2;continue}if(p==="{"){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(p==="["){let a=dR(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(p==="]")break;let d=cR(p,t);if(d){r.push({type:"input",definition:p,kind:d.kind,pattern:d.pattern,optional:i}),l+=1;continue}r.push({type:"literal",value:p}),l+=1}return r}function dR(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 ei(e,t){return ma(e,t)}function Hi(e,t={}){return e.filter(i=>i.type==="input"&&(!t.requiredOnly||!i.optional)).length}function Zr(e,t){let i=ei(e,t),r="";for(let l of i){if(l.type==="literal"||l.type==="fixed"){r+=l.value;continue}r+="_"}return r}function ga(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 p=e[r];fa(p,l.kind,l.pattern)&&(i+=p,r+=1)}return i}function ba(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 p=e[i];if(!fa(p,l.kind,l.pattern)){if(l.optional)continue;break}r+=p,i+=1}return r}function hR(e){return e.every(t=>t.type!=="input"||t.kind==="digit")}function pR(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 ii(e,t,i){let r=ei(t,i),l=Hi(r),p=ga(e,r);return p.length===0&&/\S/.test(e)&&hR(r)&&(p=pR(e,r)),p.length>l&&(p=p.slice(0,l)),ba(p,r)}var tn=new Date(2001,8,3);function Yi(e){return Vt(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(tn).filter(t=>t.type==="year"||t.type==="month"||t.type==="day").map(t=>t.type)}function Ve(e){let t=Vt(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(tn),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 en(e){return Vt(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(tn).map(i=>i.type==="literal"?i.value:i.type==="year"?"yyyy":i.type==="month"?"mm":i.type==="day"?"dd":"").join("")}function je(e){return e.replace(/\D/g,"")}function Ni(e,t){return ii(je(e),t)}function ri(e){return Hi(ei(e),{requiredOnly:!0})}function fR(e){return e>=100?e:e>=69?1900+e:2e3+e}function rn(e,t){let i=Yi(t),r=0,l={};for(let p of i){let d=p==="year"?4:2,a=e.slice(r,r+d);if(a.length<d)return null;let E=Number(a);p==="year"&&(E=fR(E)),l[p]=E,r+=d}return l}function nn(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 mR=new Date(2001,8,3);function va(e){return Vt(e,{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(mR).filter(i=>i.type==="year"||i.type==="month"||i.type==="day").map(i=>i.type)}function ya(e){return e>=100?e:e>=69?1900+e:2e3+e}function _a(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 ni(e,t){let i=(e??"").trim();if(!i)return null;let r=kt(i);if(r)return r;let l=gR(i,t);if(l)return l;let p=vR(i,t);if(p)return p;let d=va(t),a=i.match(/\d+/g);if(!a||a.length<3)return null;let E={day:0,month:0,year:0};for(let R=0;R<3;R+=1){let S=d[R];if(!S)return null;let D=Number(a[R]);S==="year"&&(D=ya(D)),E[S]=D}return _a(E)}function gR(e,t){let i=Ve(t),r=je(e);return r.length<ri(i)?null:nn(rn(r,t)??{})}function bR(e){let t=new Map;for(let i of["short","long"])for(let r=0;r<12;r+=1){let l=Vt(e,{month:i}).formatToParts(new Date(2020,r,1)).find(p=>p.type==="month")?.value;l&&t.set(l.toLowerCase(),r+1)}return t}function vR(e,t){let i=bR(t),r=e.toLowerCase();for(let[l,p]of i){if(r.indexOf(l)<0)continue;let a=e.match(/\d+/g);if(!a||a.length<2)continue;let E=a.find(A=>A.length===4)??a[a.length-1],R=a.find(A=>A!==E&&Number(A)<=31);if(!R||!E)continue;let S=ya(Number(E)),D=Number(R);return _a({year:S,month:p,day:D})}return null}var xa,wa,Sa,Ta,Ea,Aa,Ra,Ia,Ca,Da,Oa,ka,Ma,Va,ja,La,Pa,Ba,Fa,Ua,za,qa,Ka,$a,Wa,Ga,Ha,Ya,Na,Xa,Qa,Ja,Za,ts,es,is;function yR(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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: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=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:_R(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wR(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function _R(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 rs(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 wR(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 as,os=class extends ns{static{({e:[Sa,Ta,Ea,Aa,Ra,Ia,Ca,Da,Oa,ka,Ma,Va,ja,La,Pa,Ba,Fa,Ua,za,qa,Ka,$a,Wa,Ga,Ha,Ya,Na,Xa,Qa,Ja,Za,ts,es,is,xa],c:[as,wa]}=yR(this,[SR("rui-calendar")],[[oe({type:String,reflect:!0,defaultValue:""}),0,"value"],[oe({type:String,defaultValue:""}),0,"min"],[oe({type:String,defaultValue:""}),0,"max"],[oe({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[oe({type:String,defaultValue:""}),0,"locale"],[oe({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[oe({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[oe({type:String,attribute:"page-behavior",defaultValue:"visible"}),0,"pageBehavior"],[TR({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[ae,0,"viewYear"],[ae,0,"viewMonth"],[ae,0,"focusedIso"],[ae,0,"weekdayLabels"],[ae,0,"monthPanels"],[ae,0,"todayLabel"],[ae,0,"rangeAnchor"],[ae,0,"rangeHover"],[ER(["value","min","max","disabled","locale","selectionMode","visibleMonths","pageBehavior"]),2,"onPropsUpdated"],[ye({selector:"[data-calendar-prev-month]",type:"click"}),2,"onPrevMonth"],[ye({selector:"[data-calendar-next-month]",type:"click"}),2,"onNextMonth"],[ye({selector:"[data-calendar-today]",type:"click"}),2,"onTodayClick"],[ye({selector:"[data-calendar-day]",type:"click"}),2,"onDayClick"],[ye({selector:"[data-calendar-day]",type:"pointerenter"}),2,"onDayPointerEnter"],[ye({selector:"[data-calendar-grid]",type:"pointerleave"}),2,"onGridPointerLeave"],[ye({selector:"[data-calendar-day]",type:"keydown"}),2,"onDayKeydown"]],0,void 0,ns))}constructor(...t){super(...t),is(this)}value=(xa(this),Sa(this));min=(Ta(this),Ea(this));max=(Aa(this),Ra(this));disabled=(Ia(this),Ca(this));locale=(Da(this),Oa(this));selectionMode=(ka(this),Ma(this));visibleMonths=(Va(this),ja(this));pageBehavior=(La(this),Pa(this));changeEvent=(Ba(this),Fa(this));viewYear=(Ua(this),za(this,new Date().getFullYear()));viewMonth=(qa(this),Ka(this,new Date().getMonth()));focusedIso=($a(this),Wa(this,""));weekdayLabels=(Ga(this),Ha(this,[]));monthPanels=(Ya(this),Na(this,[]));todayLabel=(Xa(this),Qa(this,""));rangeAnchor=(Ja(this),Za(this,null));rangeHover=(ts(this),es(this,null));get resolvedLocale(){return zt(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"?Et(this.value)?.start??"":this.selectionMode==="multiple"?Me(this.value)[0]??"":this.value,i=kt(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=Mt(r)}refreshGrid(){this.weekdayLabels=Qr(this.resolvedLocale,Wi(this.resolvedLocale)),this.monthPanels=Nr(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:Xr(i,this.resolvedLocale),weeks:Yr(t.year,t.month,this.monthOptions)}}),this.todayLabel=Jr(this.resolvedLocale)}moveMonth(t){let i=Gi(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,p=i[l];if(p){if(!this.isMonthVisible(p.date)){this.viewYear=p.date.getFullYear(),this.viewMonth=p.date.getMonth(),this.focusedIso=p.iso,this.refreshGrid(),this.focusFocusedDay();return}this.focusedIso=p.iso,this.focusDayInCurrentGrid(p.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(p=>!p.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=kt(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(),p=new Date(r.getFullYear(),r.getMonth(),Math.min(i.getDate(),l));this.viewYear=p.getFullYear(),this.viewMonth=p.getMonth(),this.focusedIso=Mt(p),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=$r(Wr(Me(this.value),t));i!==this.value&&(this.value=i,this.emitChange(i),this.refreshGrid())}selectRange(t){if(!this.isIsoAllowed(t))return;let i=Hr(Et(this.value),{anchor:this.rangeAnchor,hover:this.rangeHover},t);if(this.rangeAnchor=i.draft.anchor,this.rangeHover=i.draft.hover,i.committed){let r=Ze(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(Mt(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 on("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:[_t("div",{class:"rui-calendar__months",children:this.monthPanels.map((r,l)=>on("div",{class:"rui-calendar__month-panel","data-calendar-month-panel":!0,children:[on("div",{class:"rui-calendar__header",children:[l===0?_t("button",{type:"button",class:"rui-calendar__nav","data-calendar-prev-month":!0,"aria-label":"Previous month",disabled:this.disabled,children:"\u2039"}):_t("span",{class:"rui-calendar__nav-spacer","aria-hidden":"true"}),_t("div",{class:"rui-calendar__month","aria-live":"polite",children:r.label}),l===t-1?_t("button",{type:"button",class:"rui-calendar__nav","data-calendar-next-month":!0,"aria-label":"Next month",disabled:this.disabled,children:"\u203A"}):_t("span",{class:"rui-calendar__nav-spacer","aria-hidden":"true"})]}),l===0?_t("div",{class:"rui-calendar__weekdays",role:"row",children:this.weekdayLabels.map(p=>_t("div",{class:"rui-calendar__weekday",role:"columnheader","aria-hidden":"true",children:p}))}):null,_t("div",{class:"rui-calendar__grid",role:"grid","data-calendar-grid":!0,children:r.weeks.map(p=>_t("div",{class:"rui-calendar__week",role:"row",children:p.map(d=>_t("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()}))}))})]}))}),_t("div",{class:"rui-calendar__footer",children:_t("button",{type:"button",class:"rui-calendar__today","data-calendar-today":!0,disabled:this.disabled,children:this.todayLabel})})]})}static{wa()}};import{jsx as AR}from"@ecopages/jsx/jsx-runtime";function oi({children:e,...t}){return AR("rui-calendar",{...t,children:e})}import{RadiantElement as ks,customElement as OR,onEvent as xt,onUpdated as an,prop as jt}from"@ecopages/radiant";var ss,ls,us,cs,ds,hs,ps,fs,ms,gs,bs,vs,ys,_s,xs,ws,Ss,Ts,Es,As,Rs,Is,Cs,Ds;function RR(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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 X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Os(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:IR(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return DR(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function IR(e){var t=CR(e,"string");return typeof t=="symbol"?t:t+""}function CR(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 DR(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 _e={label:"Carousel",transition:"none",controlsVariant:"toolbar"},kR=48,Vs,Ms=class extends ks{static{({e:[us,cs,ds,hs,ps,fs,ms,gs,bs,vs,ys,_s,xs,ws,Ss,Ts,Es,As,Rs,Is,Cs,Ds,ss],c:[Vs,ls]}=RR(this,[OR("rui-carousel")],[[jt({type:String,defaultValue:_e.label}),0,"label"],[jt({type:Number,reflect:!0,defaultValue:0}),0,"index"],[jt({type:Boolean,reflect:!0,defaultValue:!1}),0,"autoplay"],[jt({type:Number,defaultValue:4e3}),0,"interval"],[jt({type:String,defaultValue:_e.transition}),0,"transition"],[jt({type:String,defaultValue:_e.controlsVariant,attribute:"controls-variant"}),0,"controlsVariant"],[jt({type:Boolean,defaultValue:!1}),0,"showIndicators"],[jt({type:Boolean,defaultValue:!1}),0,"showRotationControl"],[jt({type:Boolean,defaultValue:!0}),0,"loop"],[jt({type:Boolean,defaultValue:!0}),0,"wrap"],[jt({type:Number,defaultValue:0}),0,"slideCount"],[an(["index","transition","loop","wrap","controlsVariant"]),2,"onSlideStateUpdated"],[an(["autoplay","showRotationControl","interval"]),2,"onAutoplayUpdated"],[an(["showIndicators"]),2,"onIndicatorsUpdated"],[xt({selector:'[data-carousel-action="prev"]',type:"click"}),2,"prev"],[xt({selector:'[data-carousel-action="next"]',type:"click"}),2,"next"],[xt({selector:'[data-carousel-action="rotation"]',type:"click"}),2,"toggleRotation"],[xt({selector:"[data-carousel-indicator]",type:"click"}),2,"onIndicatorClick"],[xt({selector:"[data-carousel-indicator]",type:"keydown"}),2,"onIndicatorKeydown"],[xt({ref:"root",type:"pointerenter"}),2,"onRootPointerEnter"],[xt({ref:"root",type:"pointerleave"}),2,"onRootPointerLeave"],[xt({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[xt({ref:"root",type:"focusout"}),2,"onRootFocusOut"],[xt({ref:"viewport",type:"pointerdown"}),2,"onViewportPointerDown"],[xt({ref:"viewport",type:"pointermove"}),2,"onViewportPointerMove"],[xt({ref:"viewport",type:"pointerup"}),2,"onViewportPointerUp"],[xt({ref:"viewport",type:"pointercancel"}),2,"onViewportPointerCancel"]],0,void 0,ks))}label=(ss(this),us(this));index=(cs(this),ds(this));autoplay=(hs(this),ps(this));interval=(fs(this),ms(this));transition=(gs(this),bs(this));controlsVariant=(vs(this),ys(this));showIndicators=(_s(this),xs(this));showRotationControl=(ws(this),Ss(this));loop=(Ts(this),Es(this));wrap=(As(this),Rs(this));slideCount=(Is(this),Cs(this));timer=(Ds(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,p)=>{let d=p===i,a=`${p+1} of ${r}`;this.showIndicators?(this.slidePanelId(l,p),l.setAttribute("role","tabpanel"),l.setAttribute("aria-labelledby",this.tabId(p)),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.querySelector(".rui-carousel__track");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 p of this.querySelectorAll('[data-carousel-action="prev"]'))this.shouldWrap?p.removeAttribute("disabled"):p.disabled=r;for(let p of this.querySelectorAll('[data-carousel-action="next"]'))this.shouldWrap?p.removeAttribute("disabled"):p.disabled=l}syncIndicators(){let t=this.querySelector('[data-ref="indicators"]');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,R=i[a];R&&(d.id=this.tabId(a),d.setAttribute("aria-controls",this.slidePanelId(R,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.querySelector('[data-ref="viewport"]');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.querySelectorAll('[data-ref="indicators"] [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)<kR||Math.abs(i)<=Math.abs(r))&&(i<0?this.next():this.prev())}onViewportPointerCancel(t){this.swipePointerId===t.pointerId&&(this.swipePointerId=null)}static{ls()}};import{jsx as ot,jsxs as xe}from"@ecopages/jsx/jsx-runtime";function js({id:e,children:t,class:i,...r}){return ot("div",{...r,class:P("rui-carousel__slide",i),"data-slide":e,children:t})}function MR(){return xe("span",{class:"rui-carousel__nav-label",children:[ot("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})}function VR(){return xe("span",{class:"rui-carousel__nav-label",children:["Next",ot("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})}function Ls({children:e,class:t,disabled:i,overlay:r,aria:l,...p}){return ot("button",{...p,aria:nt(l,"Previous slide"),type:"button","data-carousel-action":"prev","data-ref":"prev",class:P("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"}):MR())})}function Ps({children:e,class:t,disabled:i,overlay:r,aria:l,...p}){return ot("button",{...p,aria:nt(l,"Next slide"),type:"button","data-carousel-action":"next","data-ref":"next",class:P("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"}):VR())})}function Bs({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:P("rui-carousel__rotation rui-button rui-button--ghost rui-button--sm",i&&"rui-carousel__rotation--overlay",t),"aria-pressed":!1,children:e??"Play"})}function jR({autoplay:e,children:t,controlsVariant:i,label:r,next:l,prev:p,rotation:d,showIndicators:a,showRotationControl:E,transition:R}){let S=i==="overlay",D=e||E,A=p??ot(Ls,{overlay:S}),K=l??ot(Ps,{overlay:S}),$=D?d??ot(Bs,{overlay:S}):null,L=a?ot("div",{class:P("rui-carousel__indicators",S&&"rui-carousel__indicators--overlay"),"data-ref":"indicators",role:"tablist","aria-label":"Choose slide to display"}):null,W=xe("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:A}),ot("div",{class:"rui-carousel__toolbar-center",children:L}),ot("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--end",children:K})]}),G=S?xe("div",{class:"rui-carousel__overlay-chrome",children:[D?ot("div",{class:"rui-carousel__overlay-rotation",children:$}):null,xe("div",{class:"rui-carousel__controls rui-carousel__controls--overlay",children:[A,K]}),L]}):null;return xe("section",{class:P("rui-carousel",`rui-carousel--${R}`,`rui-carousel--controls-${i}`),"data-ref":"root","aria-roledescription":"carousel","aria-label":r,children:[ot("div",{class:"rui-carousel__stage",children:xe("div",{class:"rui-carousel__viewport","data-ref":"viewport",children:[ot("div",{class:"rui-carousel__track",children:t}),G]})}),S?null:ot("div",{class:"rui-carousel__footer",children:W})]})}function LR({slides:e,children:t,prev:i,next:r,rotation:l,label:p=_e.label,transition:d=_e.transition,controlsVariant:a=_e.controlsVariant,showIndicators:E,showRotationControl:R,autoplay:S,...D}){let A=e??[],K=e!=null?A.map($=>ot(js,{id:$.id,children:$.children})):t;return ot("rui-carousel",{...D,label:p,transition:d,controlsVariant:a,showIndicators:E,showRotationControl:R,autoplay:S,slideCount:A.length,children:ot(jR,{autoplay:S,controlsVariant:a,label:p,next:r,prev:i,rotation:l,showIndicators:E,showRotationControl:R,transition:d,children:K})})}import{RadiantElement as il,bound as zR,customElement as qR,event as KR,onEvent as $R,onUpdated as WR,prop as ai,query as GR}from"@ecopages/radiant";var Fs,Us,zs,qs,Ks,$s,Ws,Gs,Hs,Ys,Ns,Xs,Qs,Js,Zs,tl;function PR(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:el(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||el(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:BR(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return UR(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function BR(e){var t=FR(e,"string");return typeof t=="symbol"?t:t+""}function FR(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 el(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 UR(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 sn="on",Xi,rl=class extends il{static{({e:[zs,qs,Ks,$s,Ws,Gs,Hs,Ys,Ns,Xs,Qs,Js,Zs,tl,Fs],c:[Xi,Us]}=PR(this,[qR("rui-checkbox")],[[ai({type:Boolean,reflect:!0,defaultValue:!1}),0,"checked"],[ai({type:Boolean,reflect:!0,defaultValue:!1}),0,"indeterminate"],[ai({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ai({type:String,defaultValue:sn}),0,"value"],[ai({type:String,defaultValue:""}),0,"name"],[GR({ref:"input"}),0,"inputTarget"],[KR({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[zR,WR(["checked","indeterminate","disabled","value","name"])],2,"syncInputState"],[$R({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,il))}constructor(...t){super(...t),tl(this)}checked=(Fs(this),zs(this));indeterminate=(qs(this),Ks(this));disabled=($s(this),Ws(this));value=(Gs(this),Hs(this));name=(Ys(this),Ns(this));inputTarget=(Xs(this),Qs(this));changeEvent=(Js(this),Zs(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{Us()}};import{jsx as Qi,jsxs as HR}from"@ecopages/jsx/jsx-runtime";function si({children:e,checked:t,disabled:i,indeterminate:r,name:l,value:p=sn,...d}){return Qi("rui-checkbox",{...d,checked:t,disabled:i,indeterminate:r,name:l,value:p,"data-disabled":i?"":void 0,children:HR("label",{class:"rui-checkbox",children:[Qi("input",{type:"checkbox","data-ref":"input","data-rui-control":!0,"data-rui-control-type":"boolean",class:"rui-checkbox__input",checked:t,disabled:i,value:p,name:l||void 0,"aria-checked":r?"mixed":void 0}),Qi("span",{class:"rui-checkbox__control","aria-hidden":"true"}),Qi("span",{class:"rui-checkbox__label",children:e})]})})}import{RadiantElement as yl,customElement as JR,event as ZR,onEvent as tI,onUpdated as eI,prop as li}from"@ecopages/radiant";function qt(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function Lt(e){return e.join(",")}var nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ml,gl,bl;function YR(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:vl(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||vl(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:NR(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return QR(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function NR(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 vl(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 QR(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 xl,_l=class extends yl{static{({e:[al,sl,ll,ul,cl,dl,hl,pl,fl,ml,gl,bl,nl],c:[xl,ol]}=YR(this,[JR("rui-checkbox-group")],[[li({type:String,reflect:!0,defaultValue:""}),0,"value"],[li({type:String,defaultValue:""}),0,"name"],[li({type:String,defaultValue:""}),0,"label"],[li({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[li({type:String,reflect:!0,defaultValue:"vertical"}),0,"orientation"],[ZR({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[eI(["value","name","label","disabled","orientation"]),2,"syncCheckboxes"],[tI({selector:"rui-checkbox",type:"rui-change"}),2,"onCheckboxChange"]],0,void 0,yl))}constructor(...t){super(...t),bl(this)}value=(nl(this),al(this));name=(sl(this),ll(this));label=(ul(this),cl(this));disabled=(dl(this),hl(this));orientation=(pl(this),fl(this));changeEvent=(ml(this),gl(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(qt(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=Lt(i),this.changeEvent.emit({value:this.value})}getCheckboxes(){return Array.from(this.querySelectorAll("rui-checkbox")).filter(t=>t instanceof Xi)}static{ol()}};import{jsx as Ji}from"@ecopages/jsx/jsx-runtime";function wl({children:e,class:t,orientation:i="vertical",...r}){return Ji("div",{...r,"data-checkbox-group-root":!0,"data-orientation":i,class:P("rui-checkbox-group",t),role:"group","data-rui-control":!0,"data-rui-control-type":"text",children:e})}function iI(e){if(e!==void 0)return Array.isArray(e)?Lt(e):e}function rI({options:e,children:t,value:i,orientation:r="vertical",...l}){let p=iI(i),d=new Set(qt(p??""));return Ji("rui-checkbox-group",{...l,value:p,orientation:r,children:e==null?t:Ji(wl,{orientation:r,children:e.map(a=>Ji(si,{value:a.value,disabled:a.disabled,checked:d.has(a.value),children:a.label}))})})}import{jsx as nI}from"@ecopages/jsx/jsx-runtime";function oI({children:e,variant:t="default",class:i,...r}){return nI("span",{...r,class:P("rui-chip",`rui-chip--${t}`,i),children:e})}import{jsx as Sl}from"@ecopages/jsx/jsx-runtime";function aI({children:e,class:t,...i}){return Sl("ul",{...i,class:P("rui-chip-list",t),children:e})}function sI({children:e,class:t,...i}){return Sl("li",{...i,class:P("rui-chip-list__item",t),children:e})}import{RadiantElement as Yl,customElement as yI,event as _I,onEvent as ee,onUpdated as xI,prop as ci,query as wI}from"@ecopages/radiant";function ui(e){let t=e.previousElementSibling;return t?.tagName.toLowerCase()==="label"?t:e.parentElement?.querySelector("[data-rui-field-label], label.rui-label")??null}function se(e,t,i){if(!t||t.hasAttribute("data-rui-field-managed"))return;let r=ui(e);if(r){r.id||(r.id=i.labelId),r.htmlFor||(r.htmlFor=i.controlId),t.setAttribute("aria-labelledby",r.id),t.removeAttribute("aria-label");return}if(i.label){t.setAttribute("aria-label",i.label),t.removeAttribute("aria-labelledby");return}t.removeAttribute("aria-label"),t.removeAttribute("aria-labelledby")}var lI={top:"bottom",bottom:"top",left:"right",right:"left"},uI=8;function cI(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 Al(e){return e==="top"||e==="bottom"?"y":"x"}function Tl(e,t,i,r,l){let{width:p,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-p-l;break;case"right":a=e.right+l;break}return Al(i)==="y"?r==="start"?a=e.left:r==="end"?a=e.right-p:a=e.left+(e.width-p)/2:r==="start"?E=e.top:r==="end"?E=e.bottom-d:E=e.top+(e.height-d)/2,{x:a,y:E}}function dI(e,t,i,r){let{padding:l,width:p,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-(p-l))}function El(e,t,i,r){let{padding:l,width:p,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:p-l-t.width-e.right}function hI(e,t){return t==="center"?e:`${e}-${t}`}function pI(e,t,i,r){let{padding:l,width:p,height:d}=r;if(Al(i)==="y"){let E=Math.max(l,p-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 fI(e,t,i,r,l={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:uI}){let{side:p,align:d}=cI(i),a=Tl(e,t,p,d,r),E=dI(a,t,p,l),R=p,S=a;if(E>0){let D=lI[p],A=Tl(e,t,D,d,r),K=El(e,t,p,l);El(e,t,D,l)>K&&(R=D,S=A)}return{coords:pI(S,t,R,l),placement:hI(R,d)}}function ln(e,t,i,r,l={}){let{coords:p,placement:d}=fI(e.getBoundingClientRect(),{width:t.offsetWidth,height:t.offsetHeight},i,r);return Object.assign(t.style,{position:"fixed",left:`${p.x}px`,top:`${p.y}px`,right:"auto",bottom:"auto",visibility:"visible"}),l.matchAnchorWidth&&(t.style.width=`${e.offsetWidth}px`),t.setAttribute("data-placement",d),d}function Zi({anchor:e,floating:t,getPlacement:i,gap:r,matchAnchorWidth:l}){let p=()=>{t.hidden||ln(e,t,i(),r,{matchAnchorWidth:l})};p(),window.addEventListener("resize",p),window.addEventListener("scroll",p,!0);let d=new ResizeObserver(p);return d.observe(e),d.observe(t),()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",p,!0),d.disconnect()}}function Rl(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 un(e,t,i){return i?!!(e?.contains(i)||t?.contains(i)):!1}function Kt(e,t,i){return i instanceof Node?!un(e,t,i):!0}function le(e,t,i){return!un(e,t,i)}var lt=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=Rl(t,this.config.portalContainer??document.body)):this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null),this.teardownFloating(),this.cleanupFloating=Zi({anchor:r,floating:t,getPlacement:this.config.getPlacement,gap:this.config.gap??8,matchAnchorWidth:this.config.matchAnchorWidth})}contains(t){return un(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 Il(e){return e.filter(t=>!t.hidden&&t.getAttribute("aria-disabled")!=="true")}function Cl(e,t,i){return i===0?-1:t===1?e>=i-1?0:e+1:e<=0?i-1:e-1}function cn(e,t){t?.removeAttribute("aria-activedescendant");for(let i of e)i.removeAttribute("data-active")}function Dl(e,t,i,r,l){cn(e,r);let p=t[i];return!p||!r?null:(p.id||(p.id=`${l}-${i}`),p.setAttribute("data-active","true"),r.setAttribute("aria-activedescendant",p.id),p.scrollIntoView({block:"nearest"}),p)}var Le=class{config;popoverController;activeIndex=-1;visualFocus=!1;constructor(t){this.config=t,this.popoverController=new lt({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 Il(this.config.getOptions())}clearActiveOption(){this.activeIndex=-1,this.visualFocus=!1,cn(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,Dl(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(Cl(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 Kt(this.config.getAnchor(),this.popoverController.getFloatingElement(),t)}shouldDismissPointer(t){return le(this.config.getAnchor(),this.popoverController.getFloatingElement(),t)}destroy(){this.popoverController.destroy()}};var Ol,kl,Ml,Vl,jl,Ll,Pl,Bl,Fl,Ul,zl,ql,Kl,$l,Wl,Gl;function mI(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Hl(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Hl(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:gI(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return vI(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function gI(e){var t=bI(e,"string");return typeof t=="symbol"?t:t+""}function bI(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 Hl(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 vI(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 Xl,Nl=class extends Yl{static{({e:[Ml,Vl,jl,Ll,Pl,Bl,Fl,Ul,zl,ql,Kl,$l,Wl,Gl,Ol],c:[Xl,kl]}=mI(this,[yI("rui-combobox")],[[ci({type:String,reflect:!0,defaultValue:""}),0,"value"],[ci({type:String,defaultValue:""}),0,"label"],[ci({type:String,defaultValue:""}),0,"placeholder"],[ci({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ci({type:Boolean,reflect:!0,defaultValue:!1}),0,"openOnFocus"],[_I({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[wI({ref:"root"}),0,"rootTarget"],[xI(["value","label","placeholder","disabled","openOnFocus"]),2,"onPropsUpdated"],[ee({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[ee({ref:"root",type:"input"}),2,"onRootInput"],[ee({ref:"root",type:"keydown",options:{capture:!0}}),2,"onRootKeydown"],[ee({selector:"[data-combobox-trigger]",type:"click"}),2,"onTriggerClick"],[ee({selector:'[data-combobox-listbox] [role="option"]',type:"pointerover"}),2,"onOptionPointerOver"],[ee({selector:'[data-combobox-listbox] [role="option"]',type:"mousedown"}),2,"onOptionMouseDown"],[ee({selector:'[data-combobox-listbox] [role="option"]',type:"click"}),2,"onOptionClick"],[ee({ref:"root",type:"focusout"}),2,"onFocusOut"],[ee({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"]],0,void 0,Yl))}constructor(...t){super(...t),Gl(this)}value=(Ol(this),Ml(this));label=(Vl(this),jl(this));placeholder=(Ll(this),Pl(this));disabled=(Bl(this),Fl(this));openOnFocus=(Ul(this),zl(this));changeEvent=(ql(this),Kl(this));open=($l(this),!1);skipNextFocusOpen=!1;uid=Math.random().toString(36).slice(2,9);listboxBehavior=new Le({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.getOptions(),getActiveDescendantHost:()=>this.getInput(),getOptionIdPrefix:()=>`rui-combobox-option-${this.uid}`});rootTarget=Wl(this);get listboxId(){return`rui-combobox-list-${this.uid}`}get inputId(){return`rui-combobox-input-${this.uid}`}getInput(){return this.querySelector("[data-combobox-input]")}getTrigger(){return this.querySelector("[data-combobox-trigger]")}getListboxPopup(){return this.querySelector("[data-combobox-listbox]")}getListbox(){let t=this.querySelector("rui-listbox");return t instanceof HTMLElement?t.querySelector('[role="listbox"]')??t:this.getListboxPopup()}getListboxHost(){return this.querySelector("rui-listbox")}getOptions(){let t=this.getListbox();return t?Array.from(t.querySelectorAll('[role="option"]')):[]}getOptionLabel(t){return t.getAttribute("data-label")||t.textContent?.trim()||""}ensureOptionIds(){this.listboxBehavior.ensureOptionIds()}getAccessibleName(){return ui(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();se(this,t,{controlId:this.inputId,label:this.label,labelId:`rui-combobox-label-${this.uid}`})}syncTrigger(){let t=this.getTrigger(),i=this.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.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()),r&&(r.removeAttribute("role"),r.removeAttribute("aria-label")),this.placeholder&&!t.placeholder&&(t.placeholder=this.placeholder),this.disabled&&(t.disabled=!0),this.syncTrigger())}syncListboxHost(){let t=this.getListboxHost();t&&(t.embedded=!0,t.value=this.value)}syncOptionSelection(){for(let t of this.getOptions()){let r=(t.getAttribute("data-value")||this.getOptionLabel(t))===this.value&&this.value!=="";t.setAttribute("aria-selected",String(r))}}setVisualFocusCombobox(){this.listboxBehavior.clearActiveOption(),this.syncOptionSelection()}setOpen(t,i={}){let r=i.activate??"none";this.open=t;let l=this.getInput(),p=this.getListboxPopup();if(!(!l||!p)){if(l.setAttribute("aria-expanded",String(t)),p.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.getOptions()){let l=$i(this.getOptionLabel(r),i,"base");r.hidden=i.trim()!==""&&!l}}showAllOptions(){for(let t of this.getOptions())t.hidden=!1}syncFilter(){this.syncAutocompleteFilter()}select(t){if(t.getAttribute("aria-disabled")==="true")return;let i=t.getAttribute("data-value")||this.getOptionLabel(t),r=this.getOptionLabel(t)||i;this.value=i;let l=this.getInput();l&&(l.value=r),this.changeEvent.emit({value:i}),this.syncOptionSelection(),this.skipNextFocusOpen=!0,this.setOpen(!1),l?.focus()}syncFromValue(){let t=this.getInput();if(!t)return;let i=this.getOptions().find(l=>l.getAttribute("data-value")===this.value),r=i?this.getOptionLabel(i):this.value||"";t.value=r}initialize(){this.ensureOptionIds(),this.syncLabel(),this.syncInput(),this.syncListboxHost(),this.syncFromValue(),this.syncOptionSelection(),this.setOpen(!1)}onConnected(){this.initialize()}disconnectedCallback(){this.listboxBehavior.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.syncLabel(),this.syncInput(),this.syncListboxHost(),this.syncFromValue(),this.syncOptionSelection()}onRootFocusIn(t){if(this.isComboboxInput(t.target)){if(this.skipNextFocusOpen){this.skipNextFocusOpen=!1;return}this.openOnFocus&&(this.syncFilter(),this.setOpen(!0),this.setVisualFocusCombobox())}}onRootInput(t){if(!this.isComboboxInput(t.target))return;let i=t.target;this.syncFilter(),i.value.trim()!==""&&this.listboxBehavior.getVisibleOptions().length?this.setOpen(!0):i.value.trim()===""&&this.openOnFocus?this.setOpen(!0):(i.value.trim()===""||!this.listboxBehavior.getVisibleOptions().length)&&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=t.target.closest('[role="option"]');if(!i||i.getAttribute("aria-disabled")==="true"||i.hidden)return;let l=this.listboxBehavior.getVisibleOptions().indexOf(i);l>=0&&this.listboxBehavior.setActiveOption(l)}onOptionMouseDown(t){t.preventDefault()}onOptionClick(t){let i=t.target.closest('[role="option"]');i&&this.select(i)}onFocusOut(t){this.listboxBehavior.shouldDismissFocus(t.relatedTarget)&&this.setOpen(!1)}onDocumentPointerDown(t){this.open&&this.listboxBehavior.shouldDismissPointer(t.target)&&this.setOpen(!1)}static{kl()}};import{jsx as mt,jsxs as fn}from"@ecopages/jsx/jsx-runtime";import{jsx as tr,jsxs as SI}from"@ecopages/jsx/jsx-runtime";function di({class:e,size:t="sm",...i}){return SI("svg",{...i,class:P("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:[tr("path",{d:"M8 2v4"}),tr("path",{d:"M16 2v4"}),tr("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),tr("path",{d:"M3 10h18"})]})}import{jsx as Ql}from"@ecopages/jsx/jsx-runtime";function we({class:e,size:t="sm",...i}){return Ql("svg",{...i,class:P("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:Ql("path",{d:"m6 9 6 6 6-6"})})}import{jsx as Jl}from"@ecopages/jsx/jsx-runtime";function dn({class:e,size:t="sm",...i}){return Jl("svg",{...i,class:P("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:Jl("path",{d:"m15 18-6-6 6-6"})})}import{jsx as Zl}from"@ecopages/jsx/jsx-runtime";function hn({class:e,size:t="sm",...i}){return Zl("svg",{...i,class:P("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:Zl("path",{d:"m9 18 6-6-6-6"})})}import{RadiantElement as mu,customElement as CI,event as DI,onEvent as gu,onUpdated as OI,prop as hi}from"@ecopages/radiant";function st(e,t){e.forEach((i,r)=>{let l=r===t?0:-1;i.tabIndex!==l&&(i.tabIndex=l)})}function Pe(e,t){if(!e.length)return null;let i=Math.max(0,Math.min(e.length-1,t));return st(e,i),e[i]?.focus(),e[i]??null}function TI(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 ut(e){let{items:t,current:i,key:r,orientation:l="horizontal",wrap:p=!0}=e;if(!t.length||!i)return{handled:!1};let d=t.indexOf(i);if(d<0)return{handled:!1};let a=TI(r,l);if(!a)return{handled:!1};let E=d;a==="first"?E=0:a==="last"?E=t.length-1:a==="next"?E=p?(d+1)%t.length:Math.min(t.length-1,d+1):E=p?(d-1+t.length)%t.length:Math.max(0,d-1);let R=Pe(t,E);return R?{handled:!0,index:E,item:R}:{handled:!1}}var tu,eu,iu,ru,nu,ou,au,su,lu,uu,cu,du,hu,pu;function EI(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:fu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||fu(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:AI(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return II(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function AI(e){var t=RI(e,"string");return typeof t=="symbol"?t:t+""}function RI(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 fu(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 vu,bu=class extends mu{static{({e:[iu,ru,nu,ou,au,su,lu,uu,cu,du,hu,pu,tu],c:[vu,eu]}=EI(this,[CI("rui-listbox")],[[hi({type:String,reflect:!0,defaultValue:""}),0,"value"],[hi({type:String,defaultValue:""}),0,"label"],[hi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[hi({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[hi({type:Boolean,reflect:!0}),0,"bordered"],[DI({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[OI(["value","disabled","embedded"]),2,"onPropsUpdated"],[gu({selector:'[role="option"]',type:"click"}),2,"onOptionClick"],[gu({selector:'[role="option"]',type:"keydown"}),2,"onOptionKeydown"]],0,void 0,mu))}constructor(...t){super(...t),pu(this)}value=(tu(this),iu(this));label=(ru(this),nu(this));disabled=(ou(this),au(this));embedded=(su(this),lu(this));bordered=(uu(this),cu(this));changeEvent=(du(this),hu(this));onConnected(){this.sync()}onPropsUpdated(){this.sync()}getOptions(){return Array.from(this.querySelectorAll('[role="option"]'))}sync(){let t=this.getOptions();for(let i of t){let r=i.getAttribute("data-value")===this.value;i.setAttribute("aria-selected",String(r)),i.tabIndex=this.embedded?-1:r||!this.value&&i===t[0]?0:-1}}select(t){this.disabled||t.getAttribute("aria-disabled")==="true"||(this.value=t.getAttribute("data-value")||t.textContent?.trim()||"",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=ut({items:i,current:r,key:t.key,orientation:"vertical"});l.handled&&(t.preventDefault(),this.select(l.item))}static{eu()}};import{jsx as Se}from"@ecopages/jsx/jsx-runtime";function pn({value:e,label:t,children:i,class:r,disabled:l,...p}){return Se("div",{...p,class:P("rui-listbox__option",r),role:"option","data-value":e,"data-label":t,"aria-disabled":l?"true":void 0,tabindex:-1,children:i})}function kI(e,t){return t??!e}function yu({bordered:e,children:t,disabled:i,label:r}){return Se("div",{class:P("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,children:t})}function Be({options:e,children:t,embedded:i,bordered:r,label:l,disabled:p,...d}){let a=kI(i,r);return e!=null?Se("rui-listbox",{...d,embedded:i,bordered:r,label:l,disabled:p,children:Se(yu,{bordered:a,disabled:p,label:l,children:e.map(E=>Se(pn,{value:E.value,label:typeof E.label=="string"?E.label:void 0,disabled:E.disabled,children:E.label}))})}):Se("rui-listbox",{...d,embedded:i,bordered:r,label:l,disabled:p,children:Se(yu,{bordered:a,disabled:p,label:l,children:t})})}function xu({children:e,class:t,...i}){return mt("div",{...i,class:P("rui-combobox__control",t),children:e})}function wu({placeholder:e,disabled:t,class:i,...r}){return mt("input",{...r,type:"text","data-combobox-input":!0,"data-autocomplete-input":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:P("rui-combobox__input",i),placeholder:e,disabled:t,autocomplete:"off"})}function Su({children:e,class:t,aria:i,disabled:r,...l}){return mt("button",{...l,aria:nt(i,"Show suggestions"),type:"button","data-combobox-trigger":!0,class:P("rui-control-toggle",t),disabled:r,tabIndex:-1,children:e??mt(we,{})})}function Tu({children:e,class:t,...i}){return mt("div",{...i,"data-combobox-listbox":!0,class:P("rui-combobox__listbox rui-popover rui-popover--listbox rui-floating",t),children:e})}function _u({children:e}){return mt("div",{class:"rui-combobox","data-ref":"root",children:e})}function MI({options:e,children:t,...i}){return e!=null?mt("rui-combobox",{...i,children:fn(_u,{children:[fn(xu,{children:[mt(wu,{placeholder:i.placeholder,disabled:i.disabled}),mt(Su,{})]}),mt(Tu,{children:mt(zr,{children:fn(Fr,{children:[mt(Be,{embedded:!0,options:e}),mt(Ur,{children:"No results found."})]})})})]})}):mt("rui-combobox",{...i,children:mt(_u,{children:t})})}import{RadiantElement as Uu,customElement as BI,event as FI,onEvent as UI,onUpdated as zI,prop as pi}from"@ecopages/radiant";function mn(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 Eu,Au,Ru,Iu,Cu,Du,Ou,ku,Mu,Vu,ju,Lu,Pu,Bu;function VI(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Fu(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Fu(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:jI(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return PI(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function jI(e){var t=LI(e,"string");return typeof t=="symbol"?t:t+""}function LI(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 Fu(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 PI(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 qI="[data-cycle-value]",gn="button[data-cycle-toggle-button]",qu,zu=class extends Uu{static{({e:[Ru,Iu,Cu,Du,Ou,ku,Mu,Vu,ju,Lu,Pu,Bu,Eu],c:[qu,Au]}=VI(this,[BI("rui-cycle-toggle")],[[pi({type:String,reflect:!0,defaultValue:""}),0,"value"],[pi({type:String,reflect:!0,defaultValue:"filled"}),0,"variant"],[pi({type:String,reflect:!0,defaultValue:"md"}),0,"size"],[pi({type:String,defaultValue:""}),0,"label"],[pi({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[FI({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[zI(["value","label","disabled","size","variant"]),2,"onPropsUpdated"],[UI({selector:gn,type:"click"}),2,"onButtonClick"]],0,void 0,Uu))}value=(Eu(this),Ru(this));variant=(Iu(this),Cu(this));size=(Du(this),Ou(this));label=(ku(this),Mu(this));disabled=(Vu(this),ju(this));changeEvent=(Lu(this),Pu(this));childObserver=(Bu(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(qI))}getEnabledItems(){return this.getItems().filter(t=>t.getAttribute("aria-disabled")!=="true")}getItemValue(t){return t?t.dataset.cycleValue??"":""}syncButtonLabel(t){let i=this.querySelector(gn);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(gn);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],p=this.getItemValue(l);this.value=p;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=mn(i,this.value||void 0);r!==this.value&&(this.syncSelection(r),this.changeEvent.emit({value:this.value}))}onButtonClick(){this.cycle()}static{Au()}};import{jsx as er}from"@ecopages/jsx/jsx-runtime";function KI({id:e,children:t,class:i,disabled:r,selected:l,...p}){return er("span",{...p,class:P("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 Ku({children:e,variant:t="filled",size:i="md",disabled:r,class:l,...p}){return er("button",{...p,type:"button",class:P("rui-button","rui-cycle-toggle__button",`rui-button--${t}`,`rui-button--${i}`,l),disabled:r,"data-cycle-toggle-button":!0,children:e})}function $I({children:e,variant:t,size:i,disabled:r,...l}){return er("rui-cycle-toggle",{...l,variant:t,size:i,disabled:r,children:er(Ku,{variant:t,size:i,disabled:r,children:e})})}import{jsx as pt,jsxs as vn}from"@ecopages/jsx/jsx-runtime";var $u={system:"System",light:"Light",dark:"Dark"},bn={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},WI={system:vn("svg",{...bn,children:[pt("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),pt("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),pt("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]}),light:vn("svg",{...bn,children:[pt("circle",{cx:"12",cy:"12",r:"4"}),pt("path",{d:"M12 2v2"}),pt("path",{d:"M12 20v2"}),pt("path",{d:"m4.93 4.93 1.41 1.41"}),pt("path",{d:"m17.66 17.66 1.41 1.41"}),pt("path",{d:"M2 12h2"}),pt("path",{d:"M20 12h2"}),pt("path",{d:"m6.34 17.66-1.41 1.41"}),pt("path",{d:"m19.07 4.93-1.41 1.41"})]}),dark:pt("svg",{...bn,children:pt("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"})})};function Wu({preference:e}){return WI[e]}function Gu({preference:e}){return $u[e]}function GI({preference:e,showLabel:t=!0}){return vn("span",{class:"inline-flex items-center gap-inline","aria-label":t?void 0:$u[e],children:[pt(Wu,{preference:e}),t?pt(Gu,{preference:e}):void 0]})}import{RadiantElement as Dc,customElement as QI,event as JI,onEvent as $t,onUpdated as Oc,prop as At,query as ZI,state as yn}from"@ecopages/radiant";var Hu,Yu,Nu,Xu,Qu,Ju,Zu,tc,ec,ic,rc,nc,oc,ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Sc,Tc,Ec,Ac,Rc,Ic;function HI(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Cc(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Cc(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:YI(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return XI(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function YI(e){var t=NI(e,"string");return typeof t=="symbol"?t:t+""}function NI(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 Cc(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 XI(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 Mc,kc=class extends Dc{static{({e:[Nu,Xu,Qu,Ju,Zu,tc,ec,ic,rc,nc,oc,ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,bc,vc,yc,_c,xc,wc,Sc,Tc,Ec,Ac,Rc,Ic,Hu],c:[Mc,Yu]}=HI(this,[QI("rui-date-field")],[[At({type:String,reflect:!0,defaultValue:""}),0,"value"],[At({type:String,defaultValue:""}),0,"min"],[At({type:String,defaultValue:""}),0,"max"],[At({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[At({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[At({type:String,defaultValue:""}),0,"label"],[At({type:String,defaultValue:""}),0,"name"],[At({type:String,defaultValue:""}),0,"placeholder"],[At({type:String,defaultValue:""}),0,"locale"],[At({type:String,attribute:"date-style",defaultValue:"medium"}),0,"dateStyle"],[At({type:Boolean,reflect:!0,defaultValue:!0}),0,"masked"],[At({type:Number,attribute:"visible-months",defaultValue:1}),0,"visibleMonths"],[JI({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[yn,0,"displayValue"],[yn,0,"editing"],[yn,0,"open"],[ZI({ref:"popover"}),0,"popoverTarget"],[Oc(["value","min","max","label","placeholder","disabled","readOnly","locale","dateStyle","masked","visibleMonths"]),2,"onPropsUpdated"],[Oc(["open"]),2,"onOpenUpdated"],[$t({selector:"[data-date-field-input]",type:"focusin"}),2,"onInputFocus"],[$t({selector:"[data-date-field-input]",type:"input"}),2,"onInput"],[$t({selector:"[data-date-field-input]",type:"change"}),2,"onInputChange"],[$t({selector:"[data-date-field-input]",type:"keydown"}),2,"onInputKeydown"],[$t({selector:"[data-date-field-input], [data-date-field-trigger], [data-date-field-popover]",type:"focusout"}),2,"onRootFocusOut"],[$t({ref:"trigger",type:"pointerdown"}),2,"onTriggerPointerDown"],[$t({ref:"trigger",type:"click"}),2,"onTriggerClick"],[$t({selector:"[data-date-field-popover]",type:"mousedown"}),2,"onPopoverMouseDown"],[$t({selector:"[data-date-field-calendar]",type:"rui-change"}),2,"onCalendarChange"],[$t({selector:"[data-date-field-input], [data-date-field-trigger], [data-date-field-calendar]",type:"keydown"}),2,"onRootKeydown"]],0,void 0,Dc))}constructor(...t){super(...t),Ic(this)}value=(Hu(this),Nu(this));min=(Xu(this),Qu(this));max=(Ju(this),Zu(this));disabled=(tc(this),ec(this));readOnly=(ic(this),rc(this));label=(nc(this),oc(this));name=(ac(this),sc(this));placeholder=(lc(this),uc(this));locale=(cc(this),dc(this));dateStyle=(hc(this),pc(this));masked=(fc(this),mc(this));visibleMonths=(gc(this),bc(this));changeEvent=(vc(this),yc(this));displayValue=(_c(this),xc(this,""));editing=(wc(this),Sc(this,!1));open=(Tc(this),Ec(this,!1));uid=(Ac(this),Math.random().toString(36).slice(2,9));popoverController=null;suppressPopoverDismiss=!1;popoverTarget=Rc(this);get isoValue(){return this.value??""}get resolvedLocale(){return zt(this.locale)}get inputId(){return`rui-date-field-input-${this.uid}`}get resolvedPlaceholder(){return this.placeholder||en(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();se(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=kt(t);return i?ti(i,this.resolvedLocale,this.dateStyle):""}formatForEditing(t){if(!t)return"";if(!this.masked)return this.formatForDisplay(t);let i=kt(t);if(!i)return"";let r=Ve(this.resolvedLocale),l=tC(i,this.resolvedLocale);return Ni(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=ni(i,this.resolvedLocale);if(!r){this.syncDisplayValue();return}this.commitValue(Mt(r))}handleMaskedInput(t){let i=Ve(this.resolvedLocale),r=je(t),l=Ni(r,i);return r.length>=ri(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 lt({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;Kt(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{Yu()}};function tC(e,t){let i=Yi(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 eC,jsx as Rt,jsxs as Vc}from"@ecopages/jsx/jsx-runtime";function jc({children:e,class:t,...i}){return Rt("div",{...i,class:P("rui-date-field",t),children:Rt("div",{class:"rui-date-field__group",children:e})})}function Lc({class:e,...t}){return Rt("input",{...t,type:"text","data-date-field-input":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:P("rui-date-field__input",e),autocomplete:"off"})}function Pc({children:e,class:t,aria:i,...r}){return Rt("button",{...r,aria:nt(i,"Open calendar"),type:"button","data-ref":"trigger","data-date-field-trigger":!0,class:P("rui-control-toggle",t),"aria-haspopup":"dialog",children:e??Rt(di,{})})}function Bc({children:e,class:t,...i}){return Rt("div",{...i,"data-ref":"popover","data-date-field-popover":!0,class:P("rui-date-field__popover rui-popover rui-floating",t),hidden:!0,role:"dialog",children:e})}function Fc(e){return Rt(oi,{...e,"data-date-field-calendar":!0})}function iC({children:e,...t}){return Rt("rui-date-field",{...t,children:e??Vc(eC,{children:[Vc(jc,{children:[Rt(Lc,{}),Rt(Pc,{})]}),Rt(Bc,{children:Rt(Fc,{})})]})})}import{RadiantElement as Rd,customElement as sC,event as lC,onEvent as Wt,onUpdated as Id,prop as wt,query as uC,state as ir}from"@ecopages/radiant";var Uc,zc,qc,Kc,$c,Wc,Gc,Hc,Yc,Nc,Xc,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;function rC(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Ad(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ad(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:nC(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return aC(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function nC(e){var t=oC(e,"string");return typeof t=="symbol"?t:t+""}function oC(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 Ad(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 aC(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 Dd,Cd=class extends Rd{static{({e:[qc,Kc,$c,Wc,Gc,Hc,Yc,Nc,Xc,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,Uc],c:[Dd,zc]}=rC(this,[sC("rui-date-range-picker")],[[wt({type:String,reflect:!0,defaultValue:""}),0,"value"],[wt({type:String,defaultValue:""}),0,"min"],[wt({type:String,defaultValue:""}),0,"max"],[wt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[wt({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[wt({type:String,defaultValue:""}),0,"locale"],[wt({type:String,attribute:"placeholder-start",defaultValue:""}),0,"placeholderStart"],[wt({type:String,attribute:"placeholder-end",defaultValue:""}),0,"placeholderEnd"],[wt({type:String,attribute:"start-name",defaultValue:""}),0,"startName"],[wt({type:String,attribute:"end-name",defaultValue:""}),0,"endName"],[wt({type:String,defaultValue:""}),0,"name"],[wt({type:String,attribute:"date-style",defaultValue:"medium"}),0,"dateStyle"],[wt({type:Number,attribute:"visible-months",defaultValue:2}),0,"visibleMonths"],[lC({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[ir,0,"open"],[ir,0,"startDisplay"],[ir,0,"endDisplay"],[ir,0,"editing"],[uC({ref:"popover"}),0,"popoverTarget"],[Id(["value","min","max","disabled","readOnly","locale","dateStyle","startName","endName","visibleMonths"]),2,"onPropsUpdated"],[Id(["open"]),2,"onOpenUpdated"],[Wt({ref:"trigger",type:"pointerdown"}),2,"onTriggerPointerDown"],[Wt({ref:"trigger",type:"click"}),2,"onTriggerClick"],[Wt({selector:"[data-range-start]",type:"focus"}),2,"onStartFocus"],[Wt({selector:"[data-range-end]",type:"focus"}),2,"onEndFocus"],[Wt({selector:"[data-range-start], [data-range-end]",type:"blur"}),2,"onInputBlur"],[Wt({selector:"[data-range-start], [data-range-end]",type:"input"}),2,"onInput"],[Wt({selector:"[data-range-popover]",type:"mousedown"}),2,"onPopoverMouseDown"],[Wt({selector:"[data-range-calendar]",type:"rui-change"}),2,"onCalendarChange"],[Wt({selector:"[data-range-start], [data-range-end], [data-range-trigger], [data-range-calendar]",type:"keydown"}),2,"onRootKeydown"],[Wt({selector:"[data-range-start], [data-range-end], [data-range-trigger], [data-range-popover]",type:"focusout"}),2,"onRootFocusOut"]],0,void 0,Rd))}constructor(...t){super(...t),Ed(this)}value=(Uc(this),qc(this));min=(Kc(this),$c(this));max=(Wc(this),Gc(this));disabled=(Hc(this),Yc(this));readOnly=(Nc(this),Xc(this));locale=(Qc(this),Jc(this));placeholderStart=(Zc(this),td(this));placeholderEnd=(ed(this),id(this));startName=(rd(this),nd(this));endName=(od(this),ad(this));name=(sd(this),ld(this));dateStyle=(ud(this),cd(this));visibleMonths=(dd(this),hd(this));changeEvent=(pd(this),fd(this));open=(md(this),gd(this,!1));startDisplay=(bd(this),vd(this,""));endDisplay=(yd(this),_d(this,""));editing=(xd(this),wd(this,null));popoverController=(Sd(this),null);suppressPopoverDismiss=!1;popoverTarget=Td(this);get resolvedLocale(){return zt(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=kt(t);return i?ti(i,this.resolvedLocale,this.dateStyle):""}syncDisplayValues(){if(this.editing==="start"||this.editing==="end")return;let t=Et(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?Ze({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=ni(i,this.resolvedLocale);return r?Mt(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=Et(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=Et(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 lt({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=Et(this.isoValue),i=this.getStartInput();i&&(i.value=t?.start?this.formatIso(t.start):"")}onEndFocus(){this.editing="end";let t=Et(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;Kt(this,this.popoverTarget,r)&&this.setOpen(!1)})}static{zc()}};import{Fragment as cC,jsx as dt,jsxs as _n}from"@ecopages/jsx/jsx-runtime";function Od({children:e,class:t,...i}){return dt("div",{...i,class:P("rui-date-range-picker",t),children:dt("div",{class:"rui-date-range-picker__group",children:e})})}function kd({children:e,class:t,...i}){return dt("div",{...i,class:P("rui-date-range-picker__values",t),children:e})}function Md({class:e,...t}){return dt("input",{...t,type:"text","data-range-start":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:P("rui-date-range-picker__input",e),autocomplete:"off"})}function Vd({class:e,...t}){return dt("input",{...t,type:"text","data-range-end":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:P("rui-date-range-picker__input",e),autocomplete:"off"})}function jd({children:e="\u2013",class:t,...i}){return dt("span",{...i,class:P("rui-date-range-picker__separator",t),"aria-hidden":"true",children:e})}function Ld({children:e,class:t,aria:i,...r}){return dt("button",{...r,aria:nt(i,"Open calendar"),type:"button","data-ref":"trigger","data-range-trigger":!0,class:P("rui-control-toggle",t),"aria-haspopup":"dialog",children:e??dt(di,{})})}function Pd({children:e,class:t,...i}){return dt("div",{...i,"data-ref":"popover","data-range-popover":!0,class:P("rui-date-range-picker__popover rui-popover rui-floating",t),hidden:!0,role:"dialog",children:e})}function Bd(e){return dt(oi,{...e,"data-range-calendar":!0})}function dC({children:e,startLabel:t="Start date",endLabel:i="End date",...r}){return dt("rui-date-range-picker",{...r,children:e??_n(cC,{children:[_n(Od,{children:[_n(kd,{children:[dt(Md,{"aria-label":t}),dt(jd,{}),dt(Vd,{"aria-label":i})]}),dt(Ld,{})]}),dt(Pd,{children:dt(Bd,{})})]})})}import{RadiantElement as oh,bound as bC,customElement as vC,event as yC,onEvent as wn,onUpdated as _C,prop as Sn,query as nr}from"@ecopages/radiant";var Fd="a[href], button, input, select, textarea, [tabindex]";function hC(e){return!e.hasAttribute("disabled")&&e.getAttribute("tabindex")!=="-1"}function xn(e){return Array.from(e.querySelectorAll(Fd)).filter(hC)}function rr(e){return Array.from(e.querySelectorAll(Fd)).filter(t=>!t.hasAttribute("disabled"))}function Fe(e){return xn(e)[0]}var Ud,zd,qd,Kd,$d,Wd,Gd,Hd,Yd,Nd,Xd,Qd,Jd,Zd,th,eh,ih,rh;function pC(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:nh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||nh(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return gC(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function fC(e){var t=mC(e,"string");return typeof t=="symbol"?t:t+""}function mC(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 nh(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 gC(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 sh,ah=class extends oh{static{({e:[qd,Kd,$d,Wd,Gd,Hd,Yd,Nd,Xd,Qd,Jd,Zd,th,eh,ih,rh,Ud],c:[sh,zd]}=pC(this,[vC("rui-dialog")],[[Sn({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Sn({type:Boolean,reflect:!0,defaultValue:!1}),0,"alert"],[Sn({type:String,defaultValue:""}),0,"label"],[nr({ref:"root"}),0,"rootTarget"],[nr({ref:"dialog"}),0,"dialogTarget"],[nr({selector:"[data-dialog-title]"}),0,"titleTarget"],[nr({selector:"[data-dialog-body]"}),0,"descriptionTarget"],[yC({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[bC,_C(["open","label"])],2,"syncOpenState"],[wn({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[wn({ref:"backdrop",type:"click"}),2,"onBackdropClick"],[wn({selector:"[data-dialog-close]",type:"click"}),2,"onCloseClick"]],0,void 0,oh))}open=(Ud(this),qd(this));alert=(Kd(this),$d(this));label=(Wd(this),Gd(this));rootTarget=(Hd(this),Yd(this));dialogTarget=(Nd(this),Xd(this));titleTarget=(Qd(this),Jd(this));descriptionTarget=(Zd(this),th(this));closeEvent=(eh(this),ih(this));previouslyFocused=(rh(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?xn(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],p=document.activeElement;t.shiftKey&&p===r?(t.preventDefault(),l.focus()):!t.shiftKey&&p===l&&(t.preventDefault(),r.focus())}onBackdropClick(){this.dismiss("backdrop")}onCloseClick(){this.dismiss("dismiss")}static{zd()}};import{jsx as St,jsxs as uh}from"@ecopages/jsx/jsx-runtime";function ch({children:e,class:t,...i}){return St("div",{...i,"data-dialog-title":!0,"data-ref":"title",class:P("rui-dialog__title",t),children:e})}function dh({children:e,class:t,...i}){return St("div",{...i,"data-dialog-body":!0,"data-ref":"description",class:P("rui-dialog__body",t),children:e})}function hh({children:e,class:t,...i}){return St("div",{...i,class:P("rui-dialog__actions",t),children:e})}function ph({children:e,class:t,aria:i,...r}){return St("button",{...r,aria:nt(i,"Close"),type:"button","data-dialog-close":!0,"data-ref":"close",class:P("rui-dialog__close",t),children:e??"\xD7"})}function lh({alert:e,children:t,open:i}){return uh("div",{"data-ref":"root",class:"rui-dialog",hidden:i?void 0:!0,children:[St("div",{"data-ref":"backdrop",class:"rui-dialog__backdrop"}),St("div",{"data-ref":"dialog",class:"rui-dialog__surface",tabindex:-1,role:e?"alertdialog":"dialog","aria-modal":"true",children:t})]})}function xC({title:e,actions:t,children:i,open:r,alert:l,...p}){return e!=null||t!=null?St("rui-dialog",{...p,open:r,alert:l,children:uh(lh,{open:r,alert:l,children:[St(ph,{}),e!=null?St(ch,{children:e}):null,i!=null?St(dh,{children:i}):null,t!=null?St(hh,{children:t}):null]})}):St("rui-dialog",{...p,open:r,alert:l,children:St(lh,{open:r,alert:l,children:i})})}var ie="__rui-dialog-host",or="rui-dialog-open",ar="rui-dialog-close",sr="rui-dialog-toggle",Tn="rui-dialog-action";function fh(e){return"id"in e&&e.id!=null&&e.id!==""}var fi=!1,lr=null,mi=null,gt=null;function An(e){let t=e.trim();if(!t)return null;let i=document.getElementById(t);return i?.localName==="rui-dialog"?i:null}function wC(){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.textContent="\xD7",e}function SC(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 TC(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 EC(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 AC(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 gi(){mi?.remove(),mi=null}function RC(e){gi();let t=document.createElement("rui-dialog");t.id=ie,t.alert=!!e.alert,t.label=e.label??"",t.open=!0;let i=AC(t.alert),r=i.querySelector('[data-ref="dialog"]');if(!r)throw new Error("Failed to create the dialog surface.");return r.append(wC()),e.title&&r.append(SC(e.title)),e.body&&r.append(TC(e.body)),e.actions?.length&&r.append(EC(e.actions)),t.append(i),(lr??document.body).appendChild(t),mi=t,t}function mh(e){if(!(!gt||gt===e))if(gt===ie)gi();else{let t=An(gt);t&&(t.open=!1)}}function Ue(e){ue();let t=An(e);t&&(mh(e),t.open=!0,gt=e)}function IC(e){ue(),mh(ie),RC(e),gt=ie}function ur(e){if(typeof e=="string"){Ue(e);return}if(fh(e)){Ue(e.id);return}IC(e)}function ze(e){ue();let t=e??gt;if(t){if(t===ie)gi();else{let i=An(t);i&&(i.open=!1)}gt===t&&(gt=null)}}function Rn(e){if(ue(),gt===e){ze(e);return}Ue(e)}function gh(e){let t=e.detail;if(typeof t=="string"){ur(t);return}t&&typeof t=="object"&&ur(t)}function bh(e){let t=e.detail;ze(t?.id)}function vh(e){let t=e.detail;t?.id&&Rn(t.id)}function yh(e){let t=e.target;if(!t?.closest)return;let i=t.closest("[data-dialog-action]");if(i&&mi?.contains(i)){e.preventDefault();let d={value:i.getAttribute("data-dialog-action")||void 0||void 0};mi.dispatchEvent(new CustomEvent(Tn,{detail:d,bubbles:!0,composed:!0})),i.getAttribute("data-dialog-action-close")!=="false"&&ze(ie);return}let r=t.closest("[data-dialog-open]");if(r){let p=r.getAttribute("data-dialog-open")?.trim();p&&(e.preventDefault(),Ue(p));return}let l=t.closest("[data-dialog-close]");if(l){if(l.closest("rui-dialog")?.hasAttribute("open"))return;e.preventDefault(),ze()}}function _h(e){let t=e.target?.closest?.("rui-dialog");if(!t)return;let i=t.id||null;i&&gt===i&&(i===ie&&gi(),gt=null)}function xh(e={}){return fi?(e.mount&&(lr=e.mount),En):(fi=!0,lr=e.mount??document.body,document.addEventListener(or,gh),document.addEventListener(ar,bh),document.addEventListener(sr,vh),document.addEventListener("click",yh),document.addEventListener("rui-close",_h),En)}function ue(){fi||xh()}function En(){fi&&(document.removeEventListener(or,gh),document.removeEventListener(ar,bh),document.removeEventListener(sr,vh),document.removeEventListener("click",yh),document.removeEventListener("rui-close",_h),gi(),lr=null,gt=null,fi=!1)}function CC(){return gt}function DC(e){ue(),ur(e)}function OC(e){ue(),ze(e)}function kC(e){ue(),Rn(e)}function MC(e){ue();let t=e?.trim()||void 0;return{open:r=>{if(t){Ue(t);return}if(r!=null){if(typeof r=="string"){Ue(r);return}ur(r)}},close:r=>{ze(r??t)},toggle:r=>{let l=r??t;l&&Rn(l)},get openId(){return gt}}}import{RadiantElement as Oh,bound as BC,customElement as FC,onEvent as UC,onUpdated as zC,prop as In}from"@ecopages/radiant";var wh,Sh,Th,Eh,Ah,Rh,Ih,Ch;function VC(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Dh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Dh(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:jC(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return PC(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function jC(e){var t=LC(e,"string");return typeof t=="symbol"?t:t+""}function LC(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 Dh(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 PC(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 cr,kh=class extends Oh{static{({e:[Th,Eh,Ah,Rh,Ih,Ch,wh],c:[cr,Sh]}=VC(this,[FC("rui-disclosure")],[[In({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[In({type:String,reflect:!0,defaultValue:""}),0,"value"],[In({type:Boolean,reflect:!0,defaultValue:!1}),0,"animated"],[UC({selector:"[data-disclosure-trigger]",type:"click"}),2,"onTriggerClick"],[[BC,zC(["open","animated"])],2,"syncExpanded"]],0,void 0,Oh))}open=(wh(this),Th(this));value=(Eh(this),Ah(this));animated=(Rh(this),Ih(this));panelId=(Ch(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{Sh()}};import{RadiantElement as Uh,customElement as GC,onEvent as zh,onUpdated as HC,prop as qh}from"@ecopages/radiant";var Mh,Vh,jh,Lh,Ph,Bh;function qC(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Fh(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Fh(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:KC(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return WC(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function KC(e){var t=$C(e,"string");return typeof t=="symbol"?t:t+""}function $C(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 Fh(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 WC(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 $h,Kh=class extends Uh{static{({e:[jh,Lh,Ph,Bh,Mh],c:[$h,Vh]}=qC(this,[GC("rui-disclosure-group")],[[qh({type:Boolean,reflect:!0,defaultValue:!1}),0,"multiple"],[qh({type:Boolean,reflect:!0,attribute:"animated",defaultValue:!1}),0,"animated"],[HC("animated"),2,"onAnimatedUpdated"],[zh({selector:"rui-disclosure",type:"rui-disclosure-toggle"}),2,"onDisclosureToggle"],[zh({selector:"[data-disclosure-trigger]",type:"keydown"}),2,"onTriggerKeydown"]],0,void 0,Uh))}constructor(...t){super(...t),Bh(this)}multiple=(Mh(this),jh(this));animated=(Lh(this),Ph(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));st(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 cr)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 p=this.getDisclosureForTrigger(r);if(!p)return;let d=t.key==="ArrowRight";if(p.open===d){t.preventDefault();return}if(t.preventDefault(),p.open=d,d&&!this.multiple)for(let a of this.querySelectorAll("rui-disclosure"))a!==p&&(a.open=!1);return}ut({items:i,current:r,key:t.key,orientation:"vertical",wrap:!0}).handled&&t.preventDefault()}static{Vh()}};import{jsx as Tt,jsxs as Gh}from"@ecopages/jsx/jsx-runtime";function Hh({variant:e="chevron",class:t,...i}){return Tt("span",{...i,class:P("rui-disclosure__icon",`rui-disclosure__icon--${e}`,t),"data-disclosure-icon":!0,"aria-hidden":"true"})}function Yh({children:e,class:t,disabled:i,icon:r,iconPosition:l="start",...p}){let a=r!==null?r??Tt(Hh,{}):null;return Gh("button",{...p,type:"button","data-disclosure-trigger":!0,class:P("rui-disclosure__trigger",l==="end"&&"rui-disclosure__trigger--icon-end",t),disabled:i,children:[l==="start"?a:null,Tt("span",{class:"rui-disclosure__label",children:e}),l==="end"?a:null]})}function Nh({children:e,class:t,...i}){return Tt("div",{...i,"data-disclosure-panel":!0,"data-ref":"panel",class:P("rui-disclosure__panel",t),children:Tt("div",{class:"rui-disclosure__panel-inner",children:e})})}function Wh({children:e}){return Tt("div",{class:"rui-disclosure","data-ref":"root",children:e})}function YC({trigger:e,children:t,...i}){return e!=null?Tt("rui-disclosure",{...i,children:Gh(Wh,{children:[Tt(Yh,{children:e}),t!=null?Tt(Nh,{children:t}):null]})}):Tt("rui-disclosure",{...i,children:Tt(Wh,{children:t})})}function NC({children:e,...t}){return Tt("rui-disclosure-group",{...t,children:Tt("div",{class:"rui-disclosure-group","data-ref":"root",children:e})})}import{jsx as ce}from"@ecopages/jsx/jsx-runtime";function XC({children:e,label:t,class:i,aria:r,...l}){return ce("div",{...l,aria:nt(r,t),role:"feed",class:P("rui-feed",i),children:e})}function QC({children:e,posinset:t,setsize:i,labelledBy:r,describedBy:l,tabindex:p=0,class:d,"aria-posinset":a,"aria-setsize":E,"aria-labelledby":R,"aria-describedby":S,...D}){return ce("article",{...D,class:P("rui-feed__article",d),tabindex:p,"aria-posinset":Ot(a,t),"aria-setsize":Ot(E,i),"aria-labelledby":Ot(R,r),"aria-describedby":Ot(S,l),children:e})}function JC({children:e,class:t,...i}){return ce("header",{...i,class:P("rui-feed__header",t),children:e})}function ZC({children:e,class:t,...i}){return ce("div",{...i,class:P("rui-feed__content",t),children:e})}function tD({children:e,class:t,...i}){return ce("div",{...i,class:P("rui-feed__actions",t),children:e})}function eD({children:e,class:t,...i}){return ce("div",{...i,class:P("rui-feed__byline",t),children:e})}function iD({children:e,class:t,...i}){return ce("div",{...i,class:P("rui-feed__byline-body",t),children:e})}function rD({children:e,class:t,...i}){return ce("div",{...i,class:P("rui-feed__meta",t),children:e})}import{jsx as kp}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Cp,customElement as vD,onEvent as gr,onUpdated as Pn,prop as Te,registerSsrPreparationCallback as yD}from"@ecopages/radiant";import{consumeContext as _D,onContextUpdate as xD,provideContext as wD}from"@ecopages/radiant/context";var Pt="data-rui-control",Cn="data-rui-field-managed",fr="data-rui-field-label",mr="data-rui-field-description",qe="data-rui-field-error",Dn="data-default-value",On="data-default-values",bi=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"]),Zh=`[${Pt}], ${Array.from(bi).join(", ")}`,nD={"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 vi(e){return e.localName==="input"||e.localName==="textarea"}function tp(e){return e.localName==="input"}function ep(e){return e.localName==="textarea"}var de={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)}},dr={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)}},Xh={read:e=>e.querySelector('input[type="checkbox"]')?.checked??e.hasAttribute("checked"),write:(e,t)=>{t?e.setAttribute("checked",""):e.removeAttribute("checked")}};function Qh(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 oD(e){return Reflect.get(e,"variant")==="range"||e.getAttribute("variant")==="range"}var aD={read:e=>oD(e)?[Qh(e,"rangeMin","range-min"),Qh(e,"rangeMax","range-max")]:dr.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}dr.write(e,t)}},hr=new Map([["rui-checkbox",Xh],["rui-switch",Xh],["rui-combobox",de],["rui-date-field",de],["rui-date-range-picker",de],["rui-select",de],["rui-radio-group",de],["rui-checkbox-group",de],["rui-listbox",de],["rui-tag-group",de],["rui-slider",aD],["rui-knob",dr],["rui-number-field",dr]]);function ip(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 p=e.querySelector(".rui-field")??e;for(let a of Array.from(p.children))l(a);for(let a of p.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 kn(e,t){let i=null;return ip(e,r=>{if(!(i||!(r instanceof HTMLElement))){if(r.matches(t)){i=r;return}i=r.querySelector(t)}}),i}function sD(e){if(e.length===0)return null;if(e.length===1)return e[0];let t=e.find(d=>bi.has(d.localName)),i=e.find(d=>d.hasAttribute(Pt));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"]')),p=l.length>0?l:e.filter(d=>d.isConnected);return p[p.length-1]??e[e.length-1]}function lD(e){let t=e.querySelector(".rui-field");return t instanceof HTMLElement?Array.from(t.querySelectorAll(Zh)).filter(i=>e.contains(i)):[]}function yi(e){let t=sD(lD(e));if(t)return t;let i=null;if(ip(e,l=>{if(i)return;let p=Jh(l);p&&(i=p)}),i)return i;let r=e.querySelector(".rui-field")??e;return Jh(r)}function Jh(e){return e instanceof HTMLElement?e.matches(`[${Pt}]`)||bi.has(e.localName)?e:e.querySelector(Zh):null}function Mn(e){if(tp(e)){let i=pr(e),r=i===e?void 0:hr.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(ep(e))return e.value;let t=pr(e);return hr.get(t.localName)?.read(t)??t.getAttribute("value")??""}function Vn(e,t){if(tp(e)){let r=pr(e),l=r===e?void 0:hr.get(r.localName);if(l){l.write(r,t);return}if(e.type==="checkbox"){e.checked=!!t;let p=e.closest("rui-checkbox, rui-switch");p&&(t?p.setAttribute("checked",""):p.removeAttribute("checked"));return}e.value=t==null?"":String(t);return}if(ep(e)){e.value=t==null?"":String(t);return}let i=pr(e);hr.get(i.localName)?.write(i,t)}function pr(e){return e.hasAttribute(Pt)?e.closest(Array.from(bi).join(","))??e:e}function rp(e){return kn(e,`[${fr}], label.rui-label`)}function np(e){return kn(e,`[${mr}]`)}function op(e){return jn(e)[0]??null}function jn(e){let t=e.querySelector(".rui-field");if(t instanceof HTMLElement){let l=Array.from(t.querySelectorAll(`[${qe}]`)),p=l.filter(d=>d.getClientRects().length>0);if(p.length>0)return p;if(l.length>0)return l}let i=Array.from(e.querySelectorAll(`[${qe}]`));if(i.length>0)return i;let r=kn(e,`[${qe}]`);return r?[r]:[]}function ap(e,t,i){i&&(t&&vi(t)&&(t.name=i),e&&e!==t&&bi.has(e.localName)&&e.setAttribute("name",i))}function uD(e){let t=Reflect.get(e,"checked");return typeof t=="boolean"?t:e.hasAttribute("checked")}function cD(e){if(vi(e)||e.hasAttribute(Pt))return e;if(e.localName==="rui-slider")return e.querySelector("[data-thumb]:not([hidden])")??e;let t=e.querySelector(`[${Pt}]`);if(t)return t;if(e.localName==="rui-radio-group")return dD(e)??e;let i=nD[e.localName];return i?e.querySelector(i)??e:e}function dD(e){let t=e.querySelectorAll('input[type="radio"]');return Array.from(t).find(uD)??t[0]}function sp(e){if(e.localName==="rui-slider"){let t=Array.from(e.querySelectorAll("[data-thumb]:not([hidden])"));return t.length>0?t:[e]}return[cD(e)]}import{createContext as hD}from"@ecopages/radiant/context";var Ke=hD(Symbol.for("rui-form-context"));import{createContext as pD}from"@ecopages/radiant/context";var Ln=pD(Symbol.for("rui-field-context"));var lp,up,cp,dp,hp,pp,fp,mp,gp,bp,vp,yp,_p,xp,wp,Sp,Tp,Ep,Ap,Rp;function fD(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Ip(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ip(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return bD(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function mD(e){var t=gD(e,"string");return typeof t=="symbol"?t:t+""}function gD(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 Ip(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 bD(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 SD(e){if(!e)return;let{validate:t,...i}=e;return i}var Op,Dp=class extends Cp{static{({e:[cp,dp,hp,pp,fp,mp,gp,bp,vp,yp,_p,xp,wp,Sp,Tp,Ep,Ap,Rp,lp],c:[Op,up]}=fD(this,[vD("rui-field")],[[Te({type:String,reflect:!0,defaultValue:""}),0,"name"],[Te({type:Object}),0,"rules"],[Te({type:Object}),0,"defaultValue"],[Te({type:String,attribute:Dn}),0,"defaultValueData"],[Te({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Te({type:String,defaultValue:""}),0,"error"],[Te({type:Boolean,reflect:!0,defaultValue:!1}),0,"invalid"],[wD({context:Ln,initialValue:{name:"",controlId:"",descriptionId:"",errorId:"",error:void 0,invalid:!1,required:!1},hydrate:Object,serialize:t=>({...t,rules:SD(t.rules)})}),0,"fieldProvider"],[_D(Ke),0,"formContextProvider"],[xD({context:Ke,requestUpdate:!1}),2,"onFormContextChanged"],[Pn(["name"]),2,"onNameUpdated"],[Pn(["rules","defaultValue","defaultValueData"]),2,"onRulesUpdated"],[Pn(["disabled","error","invalid"]),2,"onPresentationUpdated"],[gr({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"],[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,Cp))}name=(lp(this),cp(this));rules=(dp(this),hp(this));defaultValue=(pp(this),fp(this));defaultValueData=(mp(this),gp(this));disabled=(bp(this),vp(this));error=(yp(this),_p(this));invalid=(xp(this),wp(this));fieldProvider=(Sp(this),Tp(this));formContextProvider=(Ep(this),Ap(this));uid=(Rp(this),Math.random().toString(36).slice(2,9));resolveFieldName(){return(this.name||this.getAttribute("name")||"").trim()}unregister;unregisterPresentation;registeredWithForm=!1;constructor(){super(),yD(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(Dn))}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=yi(this);return l?Mn(l):void 0},setValue:l=>{let p=yi(this);p&&Vn(p,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=yi(this),r=i?sp(i):[],l=r[0]??null,p=l?.id||`rui-field-control-${this.uid}`,d=`rui-field-desc-${this.uid}`,a=`rui-field-error-${this.uid}`,E=this.resolveErrorMessage(t),R=this.resolveInvalid(t),S=this.isRequired(),D=this.resolveFieldName();ap(i,l,D);let A=this.syncDescriptions(d,a,E);this.syncAriaTargets(r,p,A,R,S);let K=rp(this);K&&l&&(K.htmlFor=l.id),this.syncErrorPresentation(E);let $={name:D,controlId:l?.id??p,descriptionId:d,errorId:a,error:E,invalid:R,required:S};this.publishFieldContext($)}syncDescriptions(t,i,r){let l=[],p=np(this);p&&(p.id=t,l.push(t));let d=op(this);return d&&(d.id=i),d&&r&&l.push(i),l}syncAriaTargets(t,i,r,l,p){for(let[d,a]of t.entries())a.id||(a.id=d===0?i:`${i}-${d}`),a.setAttribute(Cn,""),a.setAttribute("aria-invalid",String(l)),a.toggleAttribute("aria-required",p),p&&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"),vi(t)&&(t.disabled=!0)}syncErrorPresentation(t){for(let i of jn(this))i.textContent=t??"",i.hidden=!t,t&&i.removeAttribute("hidden")}publishFieldContext(t){let i=this.fieldProvider.getContext();TD(i,t)||this.fieldProvider.setContext(t)}static{up()}};function TD(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 ED({children:e,rules:t,defaultValue:i,defaultValueData:r,...l}){return kp("rui-field",{...l,"prop:rules":t,"prop:defaultValue":i,data:{defaultValue:r??(i!==void 0?JSON.stringify(i):void 0)},children:kp("div",{class:"rui-field",children:e})})}import{jsx as AD}from"@ecopages/jsx/jsx-runtime";function RD({children:e,class:t,...i}){return AD("p",{...i,[mr]:"",class:P("rui-field__description",t),children:e})}import{jsx as ID}from"@ecopages/jsx/jsx-runtime";function CD({class:e,...t}){return ID("p",{...t,[qe]:"",class:P("rui-field__error",e),role:"alert",hidden:!0})}import{jsx as df}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as of,customElement as FD,event as af,onEvent as Fn,onUpdated as sf,prop as Ee}from"@ecopages/radiant";import{provideContext as UD}from"@ecopages/radiant/context";function $e(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 re(e){return typeof e=="object"&&e!==null&&"value"in e?e.value:e}async function DD(e,t,i,r){if(i)for(let l of[OD,kD,MD,VD]){let p=await l(t,i,r);if(p)return p}}function OD(e,t){let i=e==null||e===""||e===!1||Array.isArray(e)&&e.length===0;return t.required&&i?$e("This field is required",t.required)??"This field is required":void 0}function kD(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<re(t.min))return $e(`Minimum value is ${re(t.min)}`,t.min);if(t.max!==void 0&&i>re(t.max))return $e(`Maximum value is ${re(t.max)}`,t.max)}}function MD(e,t){let i=e==null?"":String(e);if(t.minLength!==void 0&&i.length<re(t.minLength))return $e(`Minimum length is ${re(t.minLength)}`,t.minLength);if(t.maxLength!==void 0&&i.length>re(t.maxLength))return $e(`Maximum length is ${re(t.maxLength)}`,t.maxLength);if(t.pattern!==void 0&&!re(t.pattern).test(i))return $e("Invalid format",t.pattern)??"Invalid format"}async function VD(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 p=await l(e,i);if(p!==!0&&p!==void 0)return p===!1?"Invalid value":String(p)}}async function Mp(e,t,i){let r=i??Object.keys(t.fields),l={};for(let p of r){let d=t.fields[p]?.rules,a=await DD(p,e[p],d,e);a&&(l[p]={type:"validation",message:a})}return Object.keys(l).length>0?{values:{},errors:l}:{values:e,errors:{}}}function Bn(){return(e,t,i)=>Mp(e,t,i.names)}function Vp(e){return typeof e=="function"?e:Bn()}var _i=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=Vp(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=Vp(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,p={...this.errors};return l?p[t]={type:"validation",message:l}:delete p[t],this.errors=p,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 jp,Lp,Pp,Bp,Fp,Up,zp,qp,Kp,$p,Wp,Gp,Hp,Yp,Np,Xp,Qp,Jp,Zp,tf,ef,rf;function jD(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:nf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||nf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:LD(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return BD(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function LD(e){var t=PD(e,"string");return typeof t=="symbol"?t:t+""}function PD(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 nf(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 BD(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 lf=()=>{},zD={register:()=>lf,updateFieldOptions:()=>{},handleFieldChange:()=>{},handleFieldBlur:()=>{},subscribePresentation:()=>lf},cf,uf=class extends of{static{({e:[Pp,Bp,Fp,Up,zp,qp,Kp,$p,Wp,Gp,Hp,Yp,Np,Xp,Qp,Jp,Zp,tf,ef,rf,jp],c:[cf,Lp]}=jD(this,[FD("rui-form")],[[UD({context:Ke,initialValue:{ready:!1,revision:0,fields:{},errors:{},actions:zD}}),0,"formProvider"],[af({name:"rui-submit",bubbles:!0,composed:!0}),0,"submitEvent"],[af({name:"rui-invalid",bubbles:!0,composed:!0}),0,"invalidEvent"],[Ee({type:Object,defaultValue:{}}),0,"defaultValues"],[Ee({type:String,attribute:On}),0,"defaultValuesData"],[Ee({type:Object}),0,"resolver"],[Ee({type:String,reflect:!0,defaultValue:"onSubmit"}),0,"mode"],[Ee({type:String,reflect:!0,attribute:"revalidate-mode",defaultValue:"onChange"}),0,"reValidateMode"],[Ee({type:String,reflect:!0}),0,"action"],[Ee({type:String,reflect:!0}),0,"method"],[sf(["defaultValues","defaultValuesData","mode","reValidateMode"]),2,"syncOptions"],[sf(["resolver"]),2,"syncResolver"],[Fn({selector:"button[type=submit]",type:"click"}),2,"onSubmitButtonClick"],[Fn({ref:"form",type:"submit"}),2,"onNativeSubmit"],[Fn({ref:"form",type:"reset"}),2,"onNativeReset"]],0,void 0,of))}formProvider=(jp(this),Pp(this));submitEvent=(Bp(this),Fp(this));invalidEvent=(Up(this),zp(this));defaultValues=(qp(this),Kp(this));defaultValuesData=($p(this),Wp(this));resolver=(Gp(this),Hp(this));mode=(Yp(this),Np(this));reValidateMode=(Xp(this),Qp(this));action=(Jp(this),Zp(this));method=(tf(this),ef(this));onSubmit=void rf(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")??this.querySelector("form.rui-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(On);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 _i({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),p=t.shouldDisplayFieldError(r);i[r]={error:p?l:void 0,invalid:!!(p&&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 p of this.presentationListeners)p(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{Lp()}};function qD({children:e,defaultValues:t,defaultValuesData:i,resolver:r,reValidateMode:l,onSubmit:p,action:d,method:a,...E}){return df("rui-form",{...E,action:d,method:a,reValidateMode:l,"attr:revalidate-mode":l,"prop:defaultValues":t,"prop:resolver":r,"prop:onSubmit":p,data:{defaultValues:i??(t!==void 0?JSON.stringify(t):void 0)},children:df("form",{class:"rui-form","data-ref":"form",noValidate:!0,action:d,method:a,children:e})})}import{RadiantElement as bf,customElement as HD,onEvent as YD,prop as ND}from"@ecopages/radiant";var hf,pf,ff,mf;function KD(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:gf(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||gf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:$D(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return GD(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function $D(e){var t=WD(e,"string");return typeof t=="symbol"?t:t+""}function WD(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 gf(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 GD(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 yf,vf=class extends bf{static{({e:[ff,mf,hf],c:[yf,pf]}=KD(this,[HD("rui-grid")],[[ND({type:String,defaultValue:""}),0,"label"],[YD({selector:'[role="gridcell"]',type:"keydown"}),2,"onKeydown"]],0,void 0,bf))}constructor(...t){super(...t),mf(this)}label=(hf(this),ff(this));onConnected(){let t=Array.from(this.querySelectorAll('[role="gridcell"]'));st(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,p=i.indexOf(l),d=Array.from(l.querySelectorAll('[role="gridcell"]')),a=d.indexOf(r),E=p,R=a;switch(t.key){case"ArrowRight":R=Math.min(d.length-1,a+1);break;case"ArrowLeft":R=Math.max(0,a-1);break;case"ArrowDown":E=Math.min(i.length-1,p+1);break;case"ArrowUp":E=Math.max(0,p-1);break;case"Home":R=0;break;case"End":R=d.length-1;break;default:return}t.preventDefault();let S=i[E],D=Array.from(S.querySelectorAll('[role="gridcell"]')),A=D[Math.min(R,D.length-1)],K=Array.from(this.querySelectorAll('[role="gridcell"]'));st(K,K.indexOf(A)),A.focus()}static{pf()}};import{jsx as br}from"@ecopages/jsx/jsx-runtime";function XD({rows:e,label:t,children:i,...r}){let l=e!=null?e.map(p=>br("div",{class:"rui-grid__row",role:"row",children:p.map(d=>br("div",{class:"rui-grid__cell",role:"gridcell",tabindex:-1,children:d}))})):i;return br("rui-grid",{...r,label:t,children:br("div",{class:"rui-grid","data-ref":"root",role:"grid","aria-label":t||void 0,children:l})})}import{jsx as yr}from"@ecopages/jsx/jsx-runtime";import{jsx as QD}from"@ecopages/jsx/jsx-runtime";function vr({as:e,children:t,...i}){return QD(e??"div",{...i,children:t})}import{jsx as JD}from"@ecopages/jsx/jsx-runtime";function Un(e){let{children:t,as:i="h2",size:r="md",class:l,...p}=e;return JD(vr,{as:i,...p,class:P("rui-headline",r!==!1&&`rui-headline--size-${r}`,l),children:t})}function ZD(e,t,i){return P("rui-heading",`rui-heading--align-${e}`,`rui-heading--size-${t}`,i)}function t1(e){let{children:t,as:i="div",align:r="start",size:l="md",class:p,...d}=e;return yr(vr,{as:i,...d,class:ZD(r,l,p),children:t})}function e1({children:e,class:t,...i}){return yr("p",{...i,class:P("rui-heading__eyebrow",t),children:e})}function i1(e){let{children:t,as:i="h2",class:r,...l}=e;return yr(Un,{as:i,size:!1,class:P("rui-heading__title",r),...l,children:t})}function r1({children:e,class:t,...i}){return yr("p",{...i,class:P("rui-heading__description",t),children:e})}import{jsx as Si}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as $f,bound as wi,customElement as l1,event as u1,onEvent as _r,onUpdated as c1,prop as Ae,query as d1}from"@ecopages/radiant";var xi=0,_f=0;function xf(){xi+=1}function zn(e=Date.now(),t=300){xi=Math.max(0,xi-1),xi===0&&(_f=e+t)}function wf(e,t=Date.now()){return xi>0||t<_f?0:e}var Sf,Tf,Ef,Af,Rf,If,Cf,Df,Of,kf,Mf,Vf,jf,Lf,Pf,Bf,Ff,Uf,zf,qf;function n1(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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 X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Kf(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:o1(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return s1(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function o1(e){var t=a1(e,"string");return typeof t=="symbol"?t:t+""}function a1(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 s1(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 qn="Preview",Wf=8,h1=500,Hf,Gf=class extends $f{static{({e:[Ef,Af,Rf,If,Cf,Df,Of,kf,Mf,Vf,jf,Lf,Pf,Bf,Ff,Uf,zf,qf,Sf],c:[Hf,Tf]}=n1(this,[l1("rui-hover-card")],[[Ae({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[Ae({type:String,defaultValue:"bottom-start"}),0,"placement"],[Ae({type:Number,defaultValue:600}),0,"delay"],[Ae({type:Number,defaultValue:200}),0,"closeDelay"],[Ae({type:Boolean,defaultValue:!0}),0,"portal"],[Ae({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Ae({type:String,attribute:"content-label",reflect:!0,defaultValue:qn}),0,"contentLabel"],[d1({ref:"content"}),0,"contentTarget"],[u1({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[wi,c1(["open","placement","portal","disabled","contentLabel"])],2,"syncCard"],[_r({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[_r({type:"focusin",selector:".rui-hover-card__trigger"}),2,"onFocusIn"],[_r({type:"focusout",selector:".rui-hover-card__trigger"}),2,"onFocusOut"],[_r({type:"keydown",selector:".rui-hover-card__trigger"}),2,"onHostKeydown"],[wi,2,"onPointerEnter"],[wi,2,"onPointerLeave"],[wi,2,"onPointerDown"],[wi,2,"onPointerUp"]],0,void 0,$f))}open=(Sf(this),Ef(this));placement=(Af(this),Rf(this));delay=(If(this),Cf(this));closeDelay=(Df(this),Of(this));portal=(kf(this),Mf(this));disabled=(Vf(this),jf(this));contentLabel=(Lf(this),Pf(this));contentTarget=(Bf(this),Ff(this));openChangeEvent=(Uf(this),zf(this));contentId=(qf(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&&zn(),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?Fe(t)??t:Fe(this)??this}getFloatingElement(){return this.controller?.getFloatingElement()??this.contentTarget}ensureController(){return this.controller||(this.controller=new lt({getAnchor:()=>this.getAnchor(),getFloating:()=>this.contentTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:Wf,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:Wf,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?xf():r&&zn(),i&&this.openChangeEvent.emit({open:t}),this.syncCard()}scheduleShow(t=!1){if(this.disabled||this.open)return;this.clearTimers(),this.openedByKeyboard=t;let i=wf(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){!this.open||t.key!=="Escape"||(t.preventDefault(),this.setOpen(!1),this.getAnchor()?.focus())}onFocusIn(){this.scheduleShow(!0)}onFocusOut(t){Kt(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=Fe(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)},h1))}onPointerUp(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}static{Tf()}};function p1({children:e,class:t,...i}){return Si("span",{class:"rui-hover-card__trigger",children:Si("span",{...i,"data-hover-card-trigger":!0,class:P(t),children:e})})}function f1({children:e,class:t,...i}){return Si("div",{...i,"data-ref":"content",class:P("rui-hover-card__content","rui-floating",t),role:"dialog",children:e})}function m1({children:e,contentLabel:t=qn,...i}){return Si("rui-hover-card",{contentLabel:t,...i,children:Si("span",{class:"rui-hover-card",children:e})})}import{jsx as g1}from"@ecopages/jsx/jsx-runtime";function b1(e){let{class:t,type:i="text",mask:r,placeholder:l,"on:input":p,...d}=e,a=r?Zr(r):l;return g1("input",{...d,type:i,placeholder:a,"on:input":r?R=>{if(r){let S=R.target;S.value=ii(S.value,r)}typeof p=="function"?p(R):p!=null&&typeof p=="object"&&"handleEvent"in p&&p.handleEvent(R)}:p,inputmode:r?"numeric":void 0,[Pt]:"","data-rui-control-type":"text",class:P("rui-input",t)})}import{jsx as Kn}from"@ecopages/jsx/jsx-runtime";function v1({children:e,class:t,...i}){return Kn("div",{...i,role:"group",class:P("rui-input-group",t),children:e})}function y1({children:e,align:t="start",class:i,...r}){return Kn("div",{...r,class:P("rui-input-group__addon",`rui-input-group__addon--${t}`,i),children:e})}function _1({children:e,class:t,...i}){return Kn("span",{...i,class:P("rui-input-group__text",t),children:e})}import{RadiantElement as $m,customElement as D1,event as O1,onEvent as Ti,onUpdated as k1,prop as yt,query as pe}from"@ecopages/radiant";function x1(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 xr(e,t){return typeof t=="number"&&Number.isFinite(t)&&t>=0?Math.min(15,Math.round(t)):x1(e)}function wr(e,t){return Number.isFinite(e)?e.toFixed(t):""}function he(e,t,i){let r=Number.isFinite(e)?e:0,l=Number.isFinite(t)?t:100,p=Math.min(r,l),d=Math.max(r,l),a=Number.isFinite(i)&&i>0?i:1,E=d-p,R=S=>{let D=Number.isFinite(S)?S:p,A=p+Math.round((D-p)/a)*a;return Math.min(d,Math.max(p,A))};return{lowerBound:p,upperBound:d,step:a,clamp:R,ratioFor:S=>E===0?0:(R(S)-p)/E,valueFromRatio:S=>{let D=Math.min(1,Math.max(0,Number.isFinite(S)?S:0));return R(p+D*E)}}}function Sr(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 Yf=120,We=300,w1=14,S1=We+(360-We)/2;function T1(e){return Math.min(100,Math.max(0,Number.isFinite(e)?Number(e):w1))}function E1(e,t,i){return i.replace("{value}",wr(e,t))}function Tr(e,t,i,r,l,p,d){let a=he(t,i,r),E=T1(l),R=50-E/2,S=2*Math.PI*R,D=We/360*S,A=a.clamp(e),K=xr(r,d);return{startAngle:Yf,strokeWidth:E,radius:R,circumference:S,arcLength:D,progressLength:a.ratioFor(A)*D,valueText:E1(A,K,p)}}function $n(e,t,i,r){if(i.width===0||i.height===0)return null;let p=(Math.atan2(t-(i.top+i.height/2),e-(i.left+i.width/2))*180/Math.PI-Yf+360)%360,d=p<=We?p:p<=S1?We:0;return r.valueFromRatio(d/We)}var Nf,Xf,Qf,Jf,Zf,tm,em,im,rm,nm,om,am,sm,lm,um,cm,dm,hm,pm,fm,mm,gm,bm,vm,ym,_m,xm,wm,Sm,Tm,Em,Am,Rm,Im,Cm,Dm,Om,km,Mm,Vm,jm,Lm,Pm,Bm,Fm,Um,zm,qm;function A1(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Km(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Km(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:R1(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return C1(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function R1(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 Km(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 Gm,Wm=class extends $m{static{({e:[Qf,Jf,Zf,tm,em,im,rm,nm,om,am,sm,lm,um,cm,dm,hm,pm,fm,mm,gm,bm,vm,ym,_m,xm,wm,Sm,Tm,Em,Am,Rm,Im,Cm,Dm,Om,km,Mm,Vm,jm,Lm,Pm,Bm,Fm,Um,zm,qm,Nf],c:[Gm,Xf]}=A1(this,[D1("rui-knob")],[[yt({type:Number,reflect:!0,defaultValue:50}),0,"value"],[yt({type:Number,defaultValue:0}),0,"min"],[yt({type:Number,defaultValue:100}),0,"max"],[yt({type:Number,defaultValue:1}),0,"step"],[yt({type:Number,attribute:"value-precision",defaultValue:Number.NaN}),0,"valuePrecision"],[yt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[yt({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[yt({type:String,defaultValue:""}),0,"label"],[yt({type:String,defaultValue:""}),0,"name"],[yt({type:Number}),0,"size"],[yt({type:Number,attribute:"stroke-width",defaultValue:14}),0,"strokeWidth"],[yt({type:Boolean,attribute:"show-value",defaultValue:!0}),0,"showValue"],[yt({type:String,attribute:"value-position",defaultValue:"center"}),0,"valuePosition"],[yt({type:String,attribute:"value-template",defaultValue:"{value}"}),0,"valueTemplate"],[O1({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[pe({ref:"root"}),0,"rootTarget"],[pe({ref:"label"}),0,"labelTarget"],[pe({ref:"control"}),0,"controlTarget"],[pe({ref:"track"}),0,"trackTarget"],[pe({ref:"progress"}),0,"progressTarget"],[pe({ref:"centerValue"}),0,"centerValueTarget"],[pe({ref:"belowValue"}),0,"belowValueTarget"],[pe({ref:"input"}),0,"inputTarget"],[k1(["value","min","max","step","valuePrecision","disabled","readOnly","name","label","size","strokeWidth","showValue","valuePosition","valueTemplate"]),2,"onPropsUpdated"],[Ti({ref:"control",type:"pointerdown"}),2,"onPointerDown"],[Ti({ref:"control",type:"pointermove"}),2,"onPointerMove"],[Ti({ref:"control",type:"pointerup"}),2,"onPointerUp"],[Ti({ref:"control",type:"pointercancel"}),2,"onPointerCancel"],[Ti({ref:"control",type:"keydown"}),2,"onKeydown"]],0,void 0,$m))}value=(Nf(this),Qf(this));min=(Jf(this),Zf(this));max=(tm(this),em(this));step=(im(this),rm(this));valuePrecision=(nm(this),om(this));disabled=(am(this),sm(this));readOnly=(lm(this),um(this));label=(cm(this),dm(this));name=(hm(this),pm(this));size=(fm(this),mm(this));strokeWidth=(gm(this),bm(this));showValue=(vm(this),ym(this));valuePosition=(_m(this),xm(this));valueTemplate=(wm(this),Sm(this));changeEvent=(Tm(this),Em(this));rootTarget=(Am(this),Rm(this));labelTarget=(Im(this),Cm(this));controlTarget=(Dm(this),Om(this));trackTarget=(km(this),Mm(this));progressTarget=(Vm(this),jm(this));centerValueTarget=(Lm(this),Pm(this));belowValueTarget=(Bm(this),Fm(this));inputTarget=(Um(this),zm(this));activePointerId=(qm(this),null);lastEmitted=null;onConnected(){this.syncPresentation()}onPropsUpdated(){this.syncPresentation()}get numericRange(){return he(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=Tr(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=$n(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=$n(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=Sr(this.numericRange,this.value,t.key);i!=null&&(t.preventDefault(),this.lastEmitted=this.value,this.commitValue(i))}static{Xf()}};import{jsx as Gt,jsxs as Wn}from"@ecopages/jsx/jsx-runtime";function M1({value:e=50,min:t=0,max:i=100,step:r=1,disabled:l=!1,readOnly:p=!1,label:d,name:a,size:E,strokeWidth:R=14,showValue:S=!0,valuePosition:D="center",valueTemplate:A="{value}",valuePrecision:K,...$}){let L=he(t,i,r),W=L.clamp(e),G=Tr(W,t,i,r,R,A,K);return Gt(V1,{props:$,value:W,min:t,max:i,step:r,disabled:l,readOnly:p,label:d,name:a,size:E,strokeWidth:R,showValue:S,valuePosition:D,valueTemplate:A,valuePrecision:K,ring:G,range:L})}function V1({props:e,ring:t,range:i,...r}){return Gt("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:Gt(j1,{knob:r,ring:t,range:i})})}function j1({knob:e,ring:t,range:i}){let r=e.valuePosition==="below";return Wn("div",{class:r?"rui-knob rui-knob--value-below":"rui-knob","data-ref":"root",children:[Gt("span",{class:"rui-knob__label","data-ref":"label",hidden:!e.label,children:e.label}),Gt(L1,{knob:e,ring:t,range:i,valueBelow:r}),Gt("span",{class:"rui-knob__value rui-knob__value--below","data-ref":"belowValue","aria-hidden":"true",hidden:!e.showValue||!r,children:t.valueText}),Gt("input",{"data-ref":"input",type:"hidden",name:e.name||void 0,value:e.value})]})}function L1({knob:e,ring:t,range:i,valueBelow:r}){return Wn("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:[Wn("svg",{class:"rui-knob__svg",viewBox:"0 0 100 100","aria-hidden":"true",children:[Gt("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)`}),Gt("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)`})]}),Gt("span",{class:"rui-knob__value","data-ref":"centerValue","aria-hidden":"true",hidden:!e.showValue||r,children:t.valueText})]})}import{jsx as P1}from"@ecopages/jsx/jsx-runtime";function B1({children:e,htmlFor:t,class:i,...r}){return P1("label",{...r,[fr]:"",class:P("rui-label",i),htmlFor:t,children:e})}import{RadiantElement as lg,bound as G1,customElement as H1,event as ug,onEvent as fe,onUpdated as Y1,prop as cg,query as dg}from"@ecopages/radiant";var F1=200,U1=250,z1=6,Ge=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)},F1);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 p=l.call(this,{item:i,items:this.getFocusableItems(r),menu:r,submenu:this.getSubmenu(i)});return p&&t.key!=="Tab"&&t.preventDefault(),p}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 lt({getAnchor:()=>t,getFloating:()=>r,getOpen:()=>t.getAttribute("aria-expanded")==="true",getPlacement:()=>"right-start",gap:z1,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)},U1);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 Hm,Ym,Nm,Xm,Qm,Jm,Zm,tg,eg,ig,rg,ng,og,ag;function q1(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:sg(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||sg(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:K1(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return W1(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function K1(e){var t=$1(e,"string");return typeof t=="symbol"?t:t+""}function $1(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 sg(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 W1(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 N1=6,pg,hg=class extends lg{static{({e:[Nm,Xm,Qm,Jm,Zm,tg,eg,ig,rg,ng,og,ag,Hm],c:[pg,Ym]}=q1(this,[H1("rui-menu-button")],[[cg({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[cg({type:String,defaultValue:"bottom-start"}),0,"placement"],[dg({ref:"trigger"}),0,"triggerTarget"],[dg({ref:"menu"}),0,"menuTarget"],[ug({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[ug({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[[G1,Y1(["open","placement"])],2,"syncOpenState"],[fe({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[fe({ref:"trigger",type:"click"}),2,"onTriggerClick"],[fe({ref:"trigger",type:"keydown"}),2,"onTriggerKeydown"],[fe({ref:"menu",type:"keydown"}),2,"onMenuKeydown"],[fe({ref:"menu",type:"pointerover"}),2,"onMenuPointerOver"],[fe({ref:"menu",type:"pointerout"}),2,"onMenuPointerOut"],[fe({ref:"menu",type:"focusout"}),2,"onMenuFocusOut"],[fe({selector:'[role="menuitem"]',type:"click"}),2,"onItemClick"]],0,void 0,lg))}open=(Hm(this),Nm(this));placement=(Xm(this),Qm(this));triggerTarget=(Jm(this),Zm(this));menuTarget=(tg(this),eg(this));changeEvent=(ig(this),rg(this));closeEvent=(ng(this),og(this));menuId=(ag(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 Ge({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 lt({getAnchor:()=>this.triggerTarget,getFloating:()=>this.menuTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:N1,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 p=this.getItems();p[p.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;le(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{Ym()}};import{jsx as Ht,jsxs as fg}from"@ecopages/jsx/jsx-runtime";import{jsx as X1}from"@ecopages/jsx/jsx-runtime";function Ei({orientation:e="horizontal",class:t,...i}){return X1("hr",{...i,class:P("rui-separator",t),role:"separator","aria-orientation":e,"data-orientation":e})}import{Fragment as Q1,jsxs as J1}from"@ecopages/jsx/jsx-runtime";function Ai(e,t){return e.map(i=>{if(i.type==="separator")return t.Separator({id:i.id});let r=!!i.items?.length;return J1(Q1,{children:[t.Item({value:i.value,disabled:i.disabled,hasSubmenu:r,children:i.label}),r?t.Submenu({children:Ai(i.items??[],t)}):null]})})}function mg({children:e,class:t,variant:i="filled",size:r="md",...l}){return fg(te,{...l,variant:i,size:r,"data-ref":"trigger",class:P("rui-menu-button__trigger",t),"aria-haspopup":"menu",children:[e,Ht(we,{class:"rui-menu-button__chevron"})]})}function gg({children:e,class:t,...i}){return Ht("div",{...i,"data-ref":"menu",class:P("rui-menu-button__menu","rui-popover","rui-floating",t),role:"menu",children:e})}function bg({children:e,class:t,...i}){return Ht("div",{...i,"data-ref":"submenu-menu",class:P("rui-menu-button__menu","rui-menu-button__submenu","rui-popover","rui-floating",t),role:"menu",hidden:!0,children:e})}function vg({children:e,value:t,disabled:i,hasSubmenu:r,class:l,...p}){return Ht("button",{...p,type:"button",class:P("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 Z1({trigger:e,items:t,children:i,class:r,...l}){return e==null&&t==null?Ht("rui-menu-button",{...l,class:P("rui-menu-button",r),children:i}):fg("rui-menu-button",{...l,class:P("rui-menu-button",r),children:[Ht(mg,{children:e}),Ht(gg,{children:t?Ai(t,{Item:p=>Ht(vg,{...p}),Submenu:p=>Ht(bg,{...p}),Separator:p=>Ht(Ei,{},p.id)}):i})]})}import{RadiantElement as Ag,customElement as nO,event as oO,onEvent as me,prop as aO}from"@ecopages/radiant";var yg,_g,xg,wg,Sg,Tg;function tO(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Eg(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Eg(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:eO(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return rO(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function eO(e){var t=iO(e,"string");return typeof t=="symbol"?t:t+""}function iO(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 Eg(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 rO(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 Ig,Rg=class extends Ag{static{({e:[xg,wg,Sg,Tg,yg],c:[Ig,_g]}=tO(this,[nO("rui-menubar")],[[aO({type:String,defaultValue:""}),0,"label"],[oO({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[me({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[me({selector:'[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]',type:"keydown"}),2,"onTopKeydown"],[me({selector:'[data-ref="root"] > [data-ref="menubar-root"] > [role="menuitem"]',type:"click"}),2,"onTopClick"],[me({selector:'[role="menu"] > [role="menuitem"]',type:"keydown"}),2,"onMenuKeydown"],[me({selector:'[role="menu"] > [role="menuitem"]',type:"click"}),2,"onMenuItemClick"],[me({selector:'[role="menuitem"]',type:"pointerover"}),2,"onPointerOver"],[me({selector:'[role="menuitem"]',type:"pointerout"}),2,"onPointerOut"],[me({selector:'[role="menuitem"]',type:"focusout"}),2,"onFocusOut"]],0,void 0,Ag))}label=(yg(this),xg(this));changeEvent=(wg(this),Sg(this));openRoot=(Tg(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(){st(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 Ge({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 lt({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&&le(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=ut({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 p=ut({items:this.getTopItems(),current:l,key:t.key,orientation:"horizontal"});p.handled&&this.getMenuFor(p.item)&&this.openMenu(p.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{_g()}};import{jsx as Yt,jsxs as sO}from"@ecopages/jsx/jsx-runtime";function Cg({label:e,children:t,disabled:i}){let r=t!=null;return sO("div",{class:"rui-menubar__root","data-ref":"menubar-root",children:[Yt("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?Yt("div",{class:"rui-menubar__menu rui-popover rui-floating","data-ref":"menu",role:"menu",hidden:!0,children:t}):null]})}function Dg({children:e,value:t,disabled:i,hasSubmenu:r,class:l,...p}){return Yt("button",{...p,type:"button",class:P("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 Og({children:e,class:t,...i}){return Yt("div",{...i,"data-ref":"submenu-menu",class:P("rui-menubar__menu","rui-menubar__submenu","rui-popover","rui-floating",t),role:"menu",hidden:!0,children:e})}function lO({items:e,label:t,children:i,...r}){let l=e!=null?e.map(p=>Yt(Cg,{label:p.label,disabled:p.disabled,children:p.items?.length?Ai(p.items,{Item:d=>Yt(Dg,{...d}),Submenu:d=>Yt(Og,{...d}),Separator:d=>Yt(Ei,{},d.id)}):null})):i;return Yt("rui-menubar",{...r,label:t,children:Yt("div",{class:"rui-menubar","data-ref":"root",role:"menubar","aria-label":t||void 0,children:l})})}import{jsx as pO,jsxs as Gn}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Wg,customElement as fO,onUpdated as mO,prop as Er,state as gO}from"@ecopages/radiant";var kg,Mg,Vg,jg,Lg,Pg,Bg,Fg,Ug,zg,qg,Kg;function uO(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:$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=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:cO(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return hO(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function cO(e){var t=dO(e,"string");return typeof t=="symbol"?t:t+""}function dO(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 $g(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 hO(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 Hg,Gg=class extends Wg{static{({e:[Vg,jg,Lg,Pg,Bg,Fg,Ug,zg,qg,Kg,kg],c:[Hg,Mg]}=uO(this,[fO("rui-meter")],[[Er({type:Number,reflect:!0,defaultValue:0}),0,"value"],[Er({type:Number,defaultValue:0}),0,"min"],[Er({type:Number,defaultValue:100}),0,"max"],[Er({type:String,defaultValue:""}),0,"label"],[gO,0,"percent"],[mO(["value","min","max"]),2,"onRangeUpdated"]],0,void 0,Wg))}value=(kg(this),Vg(this));min=(jg(this),Lg(this));max=(Pg(this),Bg(this));label=(Fg(this),Ug(this));percent=(zg(this),qg(this,0));resolvedAriaLabel=(Kg(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 Gn("div",{class:"rui-meter",children:[this.label?pO("span",{class:"rui-meter__label",children:this.$.label}):null,Gn("meter",{class:"rui-meter__bar",min:this.$.min,max:this.$.max,value:this.$.value,"aria-label":this.resolvedAriaLabel,children:[this.$.percent,"%"]}),Gn("span",{class:"rui-meter__value","aria-hidden":"true",children:[this.$.percent,"%"]})]})}static{Mg()}};import{jsx as bO}from"@ecopages/jsx/jsx-runtime";function vO(e){return bO("rui-meter",{...e})}import{jsx as Re}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Zg,customElement as SO,onEvent as He,prop as TO}from"@ecopages/radiant";var Yg,Ng,Xg,Qg;function yO(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Jg(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Jg(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:_O(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return wO(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function _O(e){var t=xO(e,"string");return typeof t=="symbol"?t:t+""}function xO(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 Jg(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 wO(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 eb,tb=class extends Zg{static{({e:[Xg,Qg,Yg],c:[eb,Ng]}=yO(this,[SO("rui-navigation-menu")],[[TO({type:String,defaultValue:""}),0,"label"],[He({document:!0,type:"click"}),2,"onDocumentClick"],[He({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[He({ref:"root",type:"keydown"}),2,"onRootKeydown"],[He({selector:"[data-navigation-trigger]",type:"click"}),2,"onTriggerClick"],[He({selector:"[data-navigation-item]",type:"keydown"}),2,"onBarItemKeydown"],[He({selector:"[data-navigation-panel]",type:"keydown"}),2,"onPanelKeydown"]],0,void 0,Zg))}label=(Yg(this),Xg(this));openValue=(Qg(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));st(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 rr(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=ut({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 p=document.activeElement instanceof HTMLElement?document.activeElement:null;if(!p||!r.contains(p))return;if(t.key==="Escape"){t.preventDefault(),this.closeMenu(!0);return}let d=this.getPanelFocusables(r);if(t.key==="ArrowUp"&&p===d[0]){t.preventDefault(),this.getTrigger(l)?.focus();return}!d.length||!ut({items:d,current:p,key:t.key,orientation:"vertical",wrap:!1}).handled||t.preventDefault()}static{Ng()}};function EO({children:e,class:t,...i}){return Re("div",{...i,"data-ref":"bar",class:P("rui-navigation-menu__bar",t),children:e})}function AO({children:e,class:t,...i}){return Re("div",{...i,"data-ref":"panels",class:P("rui-navigation-menu__panels",t),children:e})}function RO({children:e,label:t,...i}){return Re("rui-navigation-menu",{...i,label:t,children:Re("nav",{class:"rui-navigation-menu","data-ref":"root","aria-label":t||void 0,children:e})})}function IO({children:e,value:t,variant:i="ghost",class:r,...l}){return Re(te,{...l,variant:i,class:r,"data-navigation-item":!0,"data-navigation-trigger":!0,"data-value":t,children:e})}function CO({children:e,href:t,class:i,...r}){return Re("a",{...r,href:t,"data-navigation-item":!0,class:P("rui-button","rui-button--ghost","rui-button--md",i),children:e})}function DO({children:e,value:t,class:i,...r}){return Re("div",{...r,class:i,"data-navigation-panel":!0,"data-value":t,children:e})}import{RadiantElement as qb,customElement as LO,event as PO,onEvent as Ie,onUpdated as BO,prop as bt,state as Kb}from"@ecopages/radiant";function Hn(e,t){return new Intl.NumberFormat(e,t)}function Yn(e,t,i){return Number.isFinite(e)?Hn(t,i).format(e):""}function Nn(e,t,i){let r=e.trim();if(!r)return null;let p=Hn(t,i).formatToParts(1234.5),d=p.find(S=>S.type==="decimal")?.value??".",a=p.find(S=>S.type==="group")?.value??",",E=r.replaceAll(a,"").replace(d,".").replace(/[^\d.-]/g,""),R=Number(E);return Number.isFinite(R)?R:null}function Xn(e){if(e)try{let t=JSON.parse(e);return OO(t)?(new Intl.NumberFormat(void 0,t),t):void 0}catch{return}}function OO(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Qn(e,t,i,r){if(!Number.isFinite(e))return Number.isFinite(t)?t:0;if(!Number.isFinite(r)||r===0)return ib(e,t,i);let l=Number.isFinite(t)?t:0,p=Math.round((e-l)/r)*r+l;return ib(p,t,i)}function ib(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 rb,nb,ob,ab,sb,lb,ub,cb,db,hb,pb,fb,mb,gb,bb,vb,yb,_b,xb,wb,Sb,Tb,Eb,Ab,Rb,Ib,Cb,Db,Ob,kb,Mb,Vb,jb,Lb,Pb,Bb,Fb,Ub;function kO(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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: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=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return jO(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function MO(e){var t=VO(e,"string");return typeof t=="symbol"?t:t+""}function VO(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 zb(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 jO(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 Wb,$b=class extends qb{static{({e:[ob,ab,sb,lb,ub,cb,db,hb,pb,fb,mb,gb,bb,vb,yb,_b,xb,wb,Sb,Tb,Eb,Ab,Rb,Ib,Cb,Db,Ob,kb,Mb,Vb,jb,Lb,Pb,Bb,Fb,Ub,rb],c:[Wb,nb]}=kO(this,[LO("rui-number-field")],[[bt({type:Number,reflect:!0}),0,"value"],[bt({type:Number,attribute:"default-value"}),0,"defaultValue"],[bt({type:Number,attribute:"min-value",defaultValue:Number.NEGATIVE_INFINITY}),0,"minValue"],[bt({type:Number,attribute:"max-value",defaultValue:Number.POSITIVE_INFINITY}),0,"maxValue"],[bt({type:Number,defaultValue:1}),0,"step"],[bt({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[bt({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[bt({type:String,defaultValue:""}),0,"label"],[bt({type:String,defaultValue:""}),0,"name"],[bt({type:String,defaultValue:""}),0,"locale"],[bt({type:String,attribute:"format-options",defaultValue:""}),0,"formatOptions"],[bt({type:String,attribute:"commit-behavior",defaultValue:"snap"}),0,"commitBehavior"],[bt({type:String,attribute:"increment-aria-label",defaultValue:""}),0,"incrementAriaLabel"],[bt({type:String,attribute:"decrement-aria-label",defaultValue:""}),0,"decrementAriaLabel"],[bt({type:Boolean,attribute:"wheel-disabled",defaultValue:!1}),0,"wheelDisabled"],[PO({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Kb,0,"decreaseDisabled"],[Kb,0,"increaseDisabled"],[BO(["value","defaultValue","minValue","maxValue","step","label","disabled","readOnly","locale","formatOptions","commitBehavior"]),2,"onPropsUpdated"],[Ie({selector:'[data-number-field-action="decrement"]',type:"click"}),2,"decrement"],[Ie({selector:'[data-number-field-action="increment"]',type:"click"}),2,"increment"],[Ie({selector:"[data-number-field-input]",type:"focus"}),2,"onInputFocus"],[Ie({selector:"[data-number-field-input]",type:"blur"}),2,"onInputBlur"],[Ie({selector:"[data-number-field-input]",type:"input"}),2,"onInput"],[Ie({selector:"[data-number-field-input]",type:"keydown"}),2,"onKeydown"],[Ie({selector:"[data-number-field-input]",type:"wheel"}),2,"onWheel"]],0,void 0,qb))}value=(rb(this),ob(this));defaultValue=(ab(this),sb(this));minValue=(lb(this),ub(this));maxValue=(cb(this),db(this));step=(hb(this),pb(this));disabled=(fb(this),mb(this));readOnly=(gb(this),bb(this));label=(vb(this),yb(this));name=(_b(this),xb(this));locale=(wb(this),Sb(this));formatOptions=(Tb(this),Eb(this));commitBehavior=(Ab(this),Rb(this));incrementAriaLabel=(Ib(this),Cb(this));decrementAriaLabel=(Db(this),Ob(this));wheelDisabled=(kb(this),Mb(this));changeEvent=(Vb(this),jb(this));decreaseDisabled=(Lb(this),Pb(this,!1));increaseDisabled=(Bb(this),Fb(this,!1));editing=(Ub(this),!1);draftValue="";initialized=!1;uid=Math.random().toString(36).slice(2,9);get resolvedLocale(){return zt(this.locale)}get resolvedFormatOptions(){return Xn(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();se(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=Yn(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=Qn(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=Nn(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{nb()}};import{jsx as It,jsxs as Gb}from"@ecopages/jsx/jsx-runtime";function Hb({children:e,class:t,...i}){return It("div",{...i,"data-number-field-group":!0,class:P("rui-number-field__group",t),children:e})}function Yb({class:e,disabled:t,readOnly:i,...r}){return It("input",{...r,type:"text","data-number-field-input":!0,"data-rui-control":!0,"data-rui-control-type":"number",class:P("rui-number-field__input",e),disabled:t,readOnly:i})}function Nb({children:e,class:t,...i}){return It("div",{...i,class:P("rui-number-field__steppers",t),children:e})}function Xb({children:e,class:t,aria:i,disabled:r,...l}){return It("button",{...l,aria:nt(i,"Increment"),type:"button","data-number-field-action":"increment",class:P("rui-number-field__stepper",t),disabled:r,tabIndex:-1,children:e??"+"})}function Qb({children:e,class:t,aria:i,disabled:r,...l}){return It("button",{...l,aria:nt(i,"Decrement"),type:"button","data-number-field-action":"decrement",class:P("rui-number-field__stepper",t),disabled:r,tabIndex:-1,children:e??"\u2212"})}function FO(){return Gb(Hb,{children:[It(Yb,{}),It("input",{type:"hidden","data-number-field-value":!0}),Gb(Nb,{children:[It(Qb,{}),It(Xb,{})]})]})}function UO({children:e,...t}){return It("rui-number-field",{...t,children:It("div",{class:"rui-number-field","data-ref":"root",children:e??It(FO,{})})})}import{jsx as Ct,jsxs as Rr}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as pv,customElement as WO,event as GO,onEvent as HO,prop as Ri}from"@ecopages/radiant";var Jb,Zb,tv,ev,iv,rv,nv,ov,av,sv,lv,uv,cv,dv;function zO(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:hv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||hv(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:qO(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return $O(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function qO(e){var t=KO(e,"string");return typeof t=="symbol"?t:t+""}function KO(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 hv(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 Jn="Pagination";function Ar(e,t){return Math.min(Math.max(1,Math.floor(e)||1),t)}var mv,fv=class extends pv{static{({e:[tv,ev,iv,rv,nv,ov,av,sv,lv,uv,cv,dv,Jb],c:[mv,Zb]}=zO(this,[WO("rui-pagination")],[[Ri({type:String,defaultValue:Jn}),0,"label"],[Ri({type:Number,reflect:!0,defaultValue:1}),0,"page"],[Ri({type:Number,attribute:"page-count",defaultValue:1}),0,"pageCount"],[Ri({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Ri({type:Number,attribute:"sibling-count",defaultValue:1}),0,"siblingCount"],[GO({name:"rui-page-change",bubbles:!0,composed:!0}),0,"pageChangeEvent"],[HO({selector:"[data-pagination-page]",type:"click"}),2,"onPageClick"]],0,void 0,pv))}constructor(...t){super(...t),dv(this)}label=(Jb(this),tv(this));page=(ev(this),iv(this));pageCount=(rv(this),nv(this));disabled=(ov(this),av(this));siblingCount=(sv(this),lv(this));pageChangeEvent=(uv(this),cv(this));changePage(t){if(this.disabled)return;let i=Ar(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{Zb()}};function YO(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),p=Math.min(t-1,e+i),d=[1];l>2&&d.push("start-ellipsis");for(let a=l;a<=p;a+=1)d.push(a);return p<t-1&&d.push("end-ellipsis"),d.push(t),d}function gv({label:e,page:t,pageCount:i,disabled:r=!1,siblingCount:l=1}){let p=Math.max(1,Math.floor(i)||1),d=Ar(t,p),a=Math.max(0,Math.floor(l)||0),E=YO(d,p,a);return Ct("nav",{class:"rui-pagination__nav","aria-label":e,children:Rr("ul",{class:"rui-pagination__list",children:[Ct("li",{children:Rr(te,{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:[Ct(dn,{}),Ct("span",{children:"Previous"})]})}),E.map(R=>typeof R=="number"?Ct("li",{class:P("rui-pagination__page",R===d&&"rui-pagination__page--current"),children:Ct(te,{variant:R===d?"filled":"ghost",size:"sm",square:!0,class:"rui-pagination__link","data-pagination-page":R,"aria-label":`Go to page ${R}`,"aria-current":R===d?"page":void 0,disabled:r,children:R})},R):Ct("li",{class:"rui-pagination__ellipsis","aria-hidden":"true",children:"\u2026"},R)),Rr("li",{class:"rui-pagination__status",children:[d," / ",p]}),Ct("li",{children:Rr(te,{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>=p,children:[Ct("span",{children:"Next"}),Ct(hn,{})]})})]})})}function NO({children:e,label:t=Jn,page:i=1,pageCount:r=1,disabled:l=!1,siblingCount:p=1,class:d,...a}){let E=Math.max(1,Math.floor(r)||1),R=Ar(i,E),S=Math.max(0,Math.floor(p)||0);return Ct("rui-pagination",{...a,class:P("rui-pagination",d),label:t,page:R,pageCount:E,disabled:l,siblingCount:S,children:e??Ct(gv,{label:t,page:R,pageCount:E,disabled:l,siblingCount:S})})}import{jsx as Ye,jsxs as Zv}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as Ir,bound as to,customElement as Nv,event as ZO,onEvent as Ii,onUpdated as Xv,prop as ge,query as eo}from"@ecopages/radiant";import{isServer as tk}from"@ecopages/radiant/is-server";var bv,vv,yv,_v,xv,wv,Sv,Tv,Ev,Av,Rv,Iv,Cv,Dv,Ov,kv,Mv,Vv,jv,Lv,Pv,Bv,Fv,Uv,zv,qv,Kv,$v;function Yv(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Wv(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Wv(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:XO(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return JO(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function XO(e){var t=QO(e,"string");return typeof t=="symbol"?t:t+""}function QO(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 Wv(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 JO(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 Qv,Gv=class extends Ir{static{({e:[yv,_v,xv,wv,Sv,Tv,Ev,Av,Rv,Iv,Cv,Dv,Ov,kv,Mv,Vv,jv,Lv,Pv,Bv,bv],c:[Qv,vv]}=Yv(this,[Nv("rui-popover")],[[ge({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[ge({type:String,defaultValue:"bottom"}),0,"placement"],[ge({type:Boolean,defaultValue:!0}),0,"portal"],[ge({type:Boolean,defaultValue:!1}),0,"matchAnchorWidth"],[ge({type:Number,defaultValue:8}),0,"offset"],[ge({type:String,defaultValue:""}),0,"anchor"],[ge({type:String,defaultValue:"default"}),0,"variant"],[eo({ref:"surface"}),0,"surfaceTarget"],[eo({ref:"host"}),0,"hostTarget"],[ZO({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[to,Xv(["open","placement","portal","matchAnchorWidth","offset","anchor"])],2,"syncPopover"],[Ii({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[Ii({ref:"host",type:"focusout"}),2,"onFocusOut"],[to,2,"onExternalAnchorClick"],[Ii({document:!0,type:"keydown"}),2,"onDocumentKeydown"]],0,void 0,Ir))}open=(bv(this),yv(this));placement=(_v(this),xv(this));portal=(wv(this),Sv(this));matchAnchorWidth=(Tv(this),Ev(this));offset=(Av(this),Rv(this));anchor=(Iv(this),Cv(this));variant=(Dv(this),Ov(this));surfaceTarget=(kv(this),Mv(this));hostTarget=(Vv(this),jv(this));openChangeEvent=(Lv(this),Pv(this));surfaceId=(Bv(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 Zn(i);let r=this.querySelector("[data-popover-trigger]");if(r instanceof HTMLElement)return Zn(r);let l=this.anchor.trim();if(l){let p=document.querySelector(l);if(p instanceof HTMLElement)return Zn(p)}return null}ensureController(){return this.controller||(this.controller=new lt({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;le(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,i)&&this.setOpen(!1)}onFocusOut(t){this.open&&Kt(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{vv()}};var Jv,Hv=class extends Ir{static{({e:[zv,qv,Kv,$v,Fv],c:[Jv,Uv]}=Yv(this,[Nv("rui-popover-trigger")],[[ge({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[eo({ref:"root"}),0,"rootTarget"],[[to,Xv(["open"])],2,"syncToPopover"],[Ii({ref:"root",type:"click"}),2,"onHostClick"],[Ii({selector:"rui-popover",type:"rui-open-change"}),2,"onPopoverOpenChange"]],0,void 0,Ir))}constructor(...t){super(...t),$v(this)}open=(Fv(this),zv(this));rootTarget=(qv(this),Kv(this));getPopover(){return this.querySelector("rui-popover")}onConnected(){this.syncToPopover()}syncToPopover(){if(tk)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{Uv()}};function Zn(e){return e.querySelector('button, a[href], input, select, textarea, [role="button"]')??e}function ek({children:e,class:t,...i}){return Ye("div",{...i,class:P(t),children:e})}function ik({trigger:e,children:t,variant:i="default",...r}){let l=i==="listbox"?"rui-popover--listbox":"";return Ye("rui-popover",{...r,variant:i,children:Zv("div",{class:"rui-popover-host","data-ref":"host",children:[e!=null?Ye("span",{"data-popover-trigger":!0,children:e}):null,Ye("div",{"data-ref":"surface",class:`rui-popover rui-floating ${l}`.trim(),role:"dialog",children:t})]})})}function rk({trigger:e,children:t,...i}){return Ye("rui-popover-trigger",{...i,children:Zv("div",{class:"rui-popover-trigger","data-ref":"root",children:[Ye("span",{"data-popover-trigger":!0,children:e}),t]})})}import{RadiantElement as py,customElement as lk,event as uk,onEvent as ck,onUpdated as dk,prop as Cr}from"@ecopages/radiant";var ty,ey,iy,ry,ny,oy,ay,sy,ly,uy,cy,dy;function nk(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:hy(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||hy(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:ok(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return sk(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function ok(e){var t=ak(e,"string");return typeof t=="symbol"?t:t+""}function ak(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 hy(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 sk(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 my,fy=class extends py{static{({e:[iy,ry,ny,oy,ay,sy,ly,uy,cy,dy,ty],c:[my,ey]}=nk(this,[lk("rui-radio-group")],[[Cr({type:String,reflect:!0,defaultValue:""}),0,"value"],[Cr({type:String,defaultValue:""}),0,"name"],[Cr({type:String,defaultValue:""}),0,"label"],[Cr({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[uk({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[dk(["value","name","label","disabled"]),2,"syncRadios"],[ck({selector:'input[type="radio"]',type:"change"}),2,"onRadioChange"]],0,void 0,py))}constructor(...t){super(...t),dy(this)}value=(ty(this),iy(this));name=(ry(this),ny(this));label=(oy(this),ay(this));disabled=(sy(this),ly(this));changeEvent=(uy(this),cy(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{ey()}};import{jsx as Ce,jsxs as hk}from"@ecopages/jsx/jsx-runtime";function gy({children:e,class:t,...i}){return Ce("div",{...i,"data-radio-group-root":!0,class:P("rui-radio-group",t),role:"radiogroup","data-rui-control":!0,"data-rui-control-type":"text",children:e})}function by({children:e,value:t,name:i,disabled:r,class:l,...p}){return hk("label",{...p,class:P("rui-radio",l),children:[Ce("input",{type:"radio",class:"rui-radio__input",value:t,name:i,disabled:r,"data-disabled":r?"":void 0}),Ce("span",{class:"rui-radio__control","aria-hidden":"true"}),Ce("span",{class:"rui-radio__label",children:e})]})}function pk({options:e,children:t,...i}){return Ce("rui-radio-group",{...i,children:e==null?t:Ce(gy,{children:e.map(r=>Ce(by,{value:r.value,disabled:r.disabled,children:r.label}))})})}import{RadiantElement as Py,customElement as vk,event as yk,onEvent as Bt,onUpdated as _k,prop as Ne,query as xk}from"@ecopages/radiant";var vy,yy,_y,xy,wy,Sy,Ty,Ey,Ay,Ry,Iy,Cy,Dy,Oy,ky,My,Vy,jy;function fk(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Ly(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Ly(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:mk(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return bk(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function mk(e){var t=gk(e,"string");return typeof t=="symbol"?t:t+""}function gk(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 Ly(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 bk(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 Fy,By=class extends Py{static{({e:[_y,xy,wy,Sy,Ty,Ey,Ay,Ry,Iy,Cy,Dy,Oy,ky,My,Vy,jy,vy],c:[Fy,yy]}=fk(this,[vk("rui-select")],[[Ne({type:String,reflect:!0,defaultValue:""}),0,"value"],[Ne({type:String,defaultValue:""}),0,"label"],[Ne({type:String,defaultValue:""}),0,"placeholder"],[Ne({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[Ne({type:String,attribute:"selection-mode",defaultValue:"single"}),0,"selectionMode"],[Ne({type:Boolean,attribute:"should-close-on-select"}),0,"shouldCloseOnSelect"],[yk({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[xk({ref:"root"}),0,"rootTarget"],[_k(["value","label","placeholder","disabled","selectionMode","shouldCloseOnSelect"]),2,"onPropsUpdated"],[Bt({selector:"[data-select-trigger], [data-select-toggle]",type:"click"}),2,"onTriggerClick"],[Bt({selector:"[data-select-trigger]",type:"keydown",options:{capture:!0}}),2,"onTriggerKeydown"],[Bt({selector:"[data-select-listbox] [data-autocomplete-input]",type:"keydown",options:{capture:!0}}),2,"onSearchKeydown"],[Bt({selector:"[data-select-listbox] [data-autocomplete-input]",type:"input"}),2,"onSearchInput"],[Bt({selector:"[data-select-value] rui-tag-group",type:"rui-remove"}),2,"onTagRemove"],[Bt({selector:"[data-select-value] [data-tag]",type:"click"}),2,"onTagClick"],[Bt({selector:'[data-select-listbox] [role="option"]',type:"pointerover"}),2,"onOptionPointerOver"],[Bt({selector:'[data-select-listbox] [role="option"]',type:"mousedown"}),2,"onOptionMouseDown"],[Bt({selector:'[data-select-listbox] [role="option"]',type:"click"}),2,"onOptionClick"],[Bt({ref:"root",type:"focusout"}),2,"onFocusOut"],[Bt({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"]],0,void 0,Py))}constructor(...t){super(...t),jy(this)}value=(vy(this),_y(this));label=(xy(this),wy(this));placeholder=(Sy(this),Ty(this));disabled=(Ey(this),Ay(this));selectionMode=(Ry(this),Iy(this));shouldCloseOnSelect=(Cy(this),Dy(this));changeEvent=(Oy(this),ky(this));open=(My(this),!1);uid=Math.random().toString(36).slice(2,9);listboxBehavior=new Le({getAnchor:()=>this.rootTarget,getFloating:()=>this.getListboxPopup(),getOpen:()=>this.open,getOptions:()=>this.getOptions(),getActiveDescendantHost:()=>this.getActiveDescendantHost(),getOptionIdPrefix:()=>`rui-select-option-${this.uid}`});rootTarget=Vy(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()}getSelectedValues(){return this.value?qt(this.value):[]}setSelectedValues(t){this.value=Lt(t)}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.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()})}getTagGroup(){let t=this.querySelector("[data-select-value] rui-tag-group");return!t||typeof t.setItems!="function"?null:t}hasTagGroup(){return this.getTagGroup()!=null}syncTagGroup(){let t=this.getTagGroup(),i=this.getValueElement();if(!t||!i)return;let r=this.getSelectedValues(),l=r.flatMap(p=>{let d=this.getOptions().find(a=>this.getOptionValue(a)===p);return d?[{value:p,label:this.getOptionLabel(d)}]:[]});t.embedded=!0,t.setItems(l),t.value=this.value,this.syncTagGroupPlaceholder(i,r.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){let i=new Set(this.getSelectedValues());i.has(t)&&(i.delete(t),this.setSelectedValues([...i]),this.syncValueDisplay(),this.syncOptionSelection(),this.syncTagGroup(),this.changeEvent.emit({value:this.value}))}getTrigger(){return this.querySelector("[data-select-trigger]")}getToggle(){return this.querySelector("[data-select-toggle]")}getValueElement(){return this.querySelector("[data-select-value]")}getListboxPopup(){return this.querySelector("[data-select-listbox]")}getListbox(){let t=this.querySelector("rui-listbox");return t?t.querySelector('[role="listbox"]'):this.getListboxPopup()}getListboxHost(){return this.querySelector("rui-listbox")}getOptions(){let t=this.getListbox();return t?Array.from(t.querySelectorAll('[role="option"]')):[]}getOptionLabel(t){return t.getAttribute("data-label")||t.textContent?.trim()||""}getOptionValue(t){return t.getAttribute("data-value")||this.getOptionLabel(t)}ensureOptionIds(){this.listboxBehavior.ensureOptionIds()}getAccessibleName(){return ui(this)?.textContent?.trim()||this.label||"Options"}syncLabel(){let t=this.getTrigger();se(this,t,{controlId:this.triggerId,label:this.label,labelId:`rui-select-label-${this.uid}`})}syncTrigger(){let t=this.getTrigger(),i=this.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.isMultiple()?i.setAttribute("aria-multiselectable","true"):i.removeAttribute("aria-multiselectable"),r&&(r.removeAttribute("role"),r.removeAttribute("aria-label"),r.removeAttribute("aria-multiselectable")),this.disabled&&(t.disabled=!0),this.syncToggle(),this.syncSearchInput())}syncToggle(){let t=this.getToggle();t&&(t.setAttribute("aria-expanded",String(this.open)),t.disabled=this.disabled)}syncListboxHost(){let t=this.getListboxHost();t&&(t.embedded=!0,this.isMultiple()||(t.value=this.value))}syncValueDisplay(){if(this.hasTagGroup()){this.syncTagGroup();return}let t=this.getValueElement();if(!t||t.childElementCount>0)return;let i=this.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()){let l=i.map(p=>{let d=this.getOptions().find(a=>this.getOptionValue(a)===p);return d?this.getOptionLabel(d):p});t.textContent=l.join(", ");return}let r=this.getOptions().find(l=>this.getOptionValue(l)===i[0]);t.textContent=r?this.getOptionLabel(r):i[0]}syncOptionSelection(){let t=new Set(this.getSelectedValues());for(let i of this.getOptions()){let r=this.getOptionValue(i),l=t.has(r);i.setAttribute("aria-selected",String(l))}}setOpen(t,i={}){let r=i.activate??"none";this.open=t;let l=this.getTrigger(),p=this.getListboxPopup();if(!(!l||!p)){if(l.setAttribute("aria-expanded",String(t)),p.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){if(t.getAttribute("aria-disabled")==="true")return;let i=this.getOptionValue(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.syncValueDisplay(),this.syncOptionSelection(),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.syncListboxHost(),this.syncValueDisplay(),this.syncOptionSelection(),this.setOpen(!1)}onConnected(){this.initialize()}disconnectedCallback(){this.listboxBehavior.destroy(),super.disconnectedCallback()}onPropsUpdated(){this.syncLabel(),this.syncTrigger(),this.syncListboxHost(),this.syncValueDisplay(),this.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)}onTagClick(t){t.target.closest("[data-tag-remove]")||t.stopPropagation()}onOptionPointerOver(t){if(!this.open)return;let i=t.target.closest('[role="option"]');if(!i||i.getAttribute("aria-disabled")==="true"||i.hidden)return;let l=this.listboxBehavior.getVisibleOptions().indexOf(i);l>=0&&this.listboxBehavior.setActiveOption(l)}onOptionMouseDown(t){t.preventDefault()}onOptionClick(t){let i=t.target.closest('[role="option"]');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{yy()}};import{Fragment as wk,jsx as vt,jsxs as Uy}from"@ecopages/jsx/jsx-runtime";function Ci(e,...t){let i={...e};for(let r of t)delete i[r];return i}function zy({children:e,class:t,...i}){return vt("div",{...i,class:P("rui-select__control",t),children:e})}function qy({children:e,class:t,disabled:i,...r}){return vt("button",{...Ci(r,"attr:type"),type:"button","data-select-trigger":!0,"data-rui-control":!0,"data-rui-control-type":"text",class:P("rui-select__trigger",t),disabled:i,children:e})}function Ky({children:e,class:t,aria:i,disabled:r,...l}){return vt("button",{...l,aria:nt(i,"Show options"),type:"button","data-select-toggle":!0,class:P("rui-control-toggle",t),disabled:r,tabIndex:-1,children:e??vt(we,{})})}function $y({children:e,class:t,...i}){return vt("span",{...i,"data-select-value":!0,class:P("rui-select__value",t),children:e})}function Wy({children:e,class:t,...i}){return vt("div",{...i,"data-select-listbox":!0,class:P("rui-select__listbox rui-popover rui-popover--listbox rui-floating",t),children:e})}function Sk({placeholder:e,class:t,disabled:i,...r}){return vt("input",{...r,type:"search","data-autocomplete-input":!0,class:P("rui-select__search",t),placeholder:e,disabled:i,autocomplete:"off"})}function Tk(e,t,i){let r=typeof t=="string"?t.trim():"",l=typeof i=="string"?i:"";if(!r)return l;let p=e?.find(d=>d.value===r);return p&&typeof p.label=="string"?p.label:r}function Ek({children:e}){return vt("div",{class:"rui-select","data-ref":"root",children:e})}function Ak({options:e,children:t,...i}){let r=e!=null?Tk(e,i.value,i.placeholder):"";return vt("rui-select",{...i,children:vt(Ek,{children:e==null?t:Uy(wk,{children:[Uy(zy,{children:[vt(qy,{children:vt($y,{children:r})}),vt(Ky,{})]}),vt(Wy,{children:vt(Be,{embedded:!0,options:e})})]})})})}import{RadiantElement as W_,bound as G_,customElement as Ok,event as io,onEvent as Di,onUpdated as ro,prop as ht,query as Or,state as kk}from"@ecopages/radiant";import{isServer as Mk}from"@ecopages/radiant/is-server";function Dr(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}var Gy,Hy,Yy,Ny,Xy,Qy,Jy,Zy,t_,e_,i_,r_,n_,o_,a_,s_,l_,u_,c_,d_,h_,p_,f_,m_,g_,b_,v_,y_,__,x_,w_,S_,T_,E_,A_,R_,I_,C_,D_,O_,k_,M_,V_,j_,L_,P_,B_,F_,U_,z_,q_,K_;function Rk(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:$_(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||$_(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:Ik(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Dk(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function Ik(e){var t=Ck(e,"string");return typeof t=="symbol"?t:t+""}function Ck(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 $_(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 Dk(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 Vk=256,jk=48,Lk=200,Pk=480,Bk=768,Fk="b",H_=8,Y_=32,N_="a.rui-sidebar__menu-button";function Uk(e){return e.metaKey||e.ctrlKey}function zk(){return typeof window<"u"&&typeof window.matchMedia=="function"}function kr(e){return e==="left"||e==="right"}var Q_,X_=class extends W_{static{({e:[Yy,Ny,Xy,Qy,Jy,Zy,t_,e_,i_,r_,n_,o_,a_,s_,l_,u_,c_,d_,h_,p_,f_,m_,g_,b_,v_,y_,__,x_,w_,S_,T_,E_,A_,R_,I_,C_,D_,O_,k_,M_,V_,j_,L_,P_,B_,F_,U_,z_,q_,K_,Gy],c:[Q_,Hy]}=Rk(this,[Ok("rui-sidebar")],[[ht({type:String,reflect:!0,defaultValue:"sidebar"}),0,"variant"],[ht({type:String,reflect:!0,defaultValue:"left"}),0,"side"],[ht({type:String,reflect:!0,defaultValue:"off"}),0,"collapsible"],[ht({type:Number,defaultValue:Vk}),0,"defaultWidth"],[ht({type:Number,reflect:!0,attribute:"width"}),0,"width"],[ht({type:Number,defaultValue:Lk}),0,"minWidth"],[ht({type:Number,defaultValue:Pk}),0,"maxWidth"],[ht({type:Boolean,defaultValue:!1}),0,"resizable"],[ht({type:Boolean,defaultValue:!0}),0,"defaultOpen"],[ht({type:Boolean,defaultValue:!1}),0,"mobileDefaultOpen"],[ht({type:Boolean,attribute:"open"}),0,"open"],[ht({type:Number,defaultValue:Bk}),0,"mobileBreakpoint"],[ht({type:String,defaultValue:"Sidebar"}),0,"label"],[ht({type:Boolean,reflect:!0,attribute:"match-active"}),0,"matchActive"],[ht({type:String,defaultValue:"pathname"}),0,"matchMode"],[ht({type:Boolean,attribute:"scroll-active-on-mount"}),0,"scrollActiveOnMount"],[ht({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[Or({ref:"root"}),0,"rootTarget"],[Or({ref:"pane"}),0,"paneTarget"],[Or({ref:"handle"}),0,"handleTarget"],[Or({ref:"scrim"}),0,"scrimTarget"],[io({name:"rui-sidebar-toggle",bubbles:!0,composed:!0}),0,"toggleEvent"],[io({name:"rui-sidebar-resize",bubbles:!0,composed:!0}),0,"resizeEvent"],[io({name:"rui-sidebar-mobile-change",bubbles:!0,composed:!0}),0,"mobileChangeEvent"],[kk,0,"isMobile"],[ro(["open","collapsible","variant","side","width","defaultWidth","defaultOpen","minWidth","maxWidth","isMobile","resizable","label"]),2,"onStateUpdated"],[ro(["mobileBreakpoint"]),2,"onMobileBreakpointUpdated"],[ro(["matchActive","matchMode","navigationEvents"]),2,"onMatchSettingsUpdated"],[G_,2,"onPointerMove"],[G_,2,"onPointerUp"],[Di({ref:"handle",type:"pointerdown"}),2,"onHandlePointerDown"],[Di({ref:"handle",type:"keydown"}),2,"onHandleKeydown"],[Di({ref:"scrim",type:"click"}),2,"onScrimClick"],[Di({selector:N_,type:"click"}),2,"onMenuLinkClick"],[Di({document:!0,type:"keydown"}),2,"onHostKeydown"]],0,void 0,W_))}variant=(Gy(this),Yy(this));side=(Ny(this),Xy(this));collapsible=(Qy(this),Jy(this));defaultWidth=(Zy(this),t_(this));width=(e_(this),i_(this));minWidth=(r_(this),n_(this));maxWidth=(o_(this),a_(this));resizable=(s_(this),l_(this));defaultOpen=(u_(this),c_(this));mobileDefaultOpen=(d_(this),h_(this));open=(p_(this),f_(this));mobileBreakpoint=(m_(this),g_(this));label=(b_(this),v_(this));matchActive=(y_(this),__(this,!1));matchMode=(x_(this),w_(this));scrollActiveOnMount=(S_(this),T_(this,!1));navigationEvents=(E_(this),A_(this,""));rootTarget=(R_(this),I_(this));paneTarget=(C_(this),D_(this));handleTarget=(O_(this),k_(this));scrimTarget=(M_(this),V_(this));toggleEvent=(j_(this),L_(this));resizeEvent=(P_(this),B_(this));mobileChangeEvent=(F_(this),U_(this));isMobile=(z_(this),q_(this,!1));mediaQuery=(K_(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=kr(this.side),i=this.isOpen(),r=i?"expanded":"collapsed",l=this.resizable&&this.collapsible==="off"&&i&&!this.isMobile,p=!(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 R=this.paneTarget;R&&(R.dataset.side=this.side,R.dataset.variant=this.variant,R.setAttribute("aria-label",this.label),p?R.setAttribute("inert",""):R.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(N_)){let p=this.isLinkActive(l,i);l.classList.toggle("rui-sidebar__menu-button--active",p),p?(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(Mk||!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 Dr(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||!zk()){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"?jk: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=kr(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=kr(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=kr(this.side),p=l?"ArrowLeft":"ArrowUp",d=l?"ArrowRight":"ArrowDown",a=r;if(i.key===p)a=r-(i.shiftKey?Y_:H_);else if(i.key===d)a=r+(i.shiftKey?Y_:H_);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}Uk(i)&&i.key.toLowerCase()===Fk&&(i.preventDefault(),this.toggle())}static{Hy()}};import{RadiantElement as mx,customElement as Gk,onEvent as Hk,onUpdated as gx,prop as Oi,query as Yk,state as Nk}from"@ecopages/radiant";var J_,Z_,tx,ex,ix,rx,nx,ox,ax,sx,lx,ux,cx,dx,hx,px;function qk(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:fx(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||fx(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:Kk(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Wk(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function Kk(e){var t=$k(e,"string");return typeof t=="symbol"?t:t+""}function $k(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 fx(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 Wk(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 vx,bx=class extends mx{static{({e:[tx,ex,ix,rx,nx,ox,ax,sx,lx,ux,cx,dx,hx,px,J_],c:[vx,Z_]}=qk(this,[Gk("rui-sidebar-trigger")],[[Oi({type:String,defaultValue:""}),0,"controls"],[Oi({type:String,attribute:"button-label",defaultValue:"Toggle sidebar"}),0,"buttonLabel"],[Oi({type:String,reflect:!0,defaultValue:""}),0,"placement"],[Oi({type:String,defaultValue:"ghost"}),0,"variant"],[Oi({type:String,defaultValue:"md"}),0,"size"],[Yk({ref:"button"}),0,"buttonTarget"],[Nk,0,"sidebarState"],[gx(["controls","buttonLabel","placement"]),2,"onBindingUpdated"],[gx(["variant","size"]),2,"onPresentationUpdated"],[Hk({selector:'[data-ref="button"]',type:"click"}),2,"onButtonClick"]],0,void 0,mx))}controls=(J_(this),tx(this));buttonLabel=(ex(this),ix(this));placement=(rx(this),nx(this));variant=(ox(this),ax(this));size=(sx(this),lx(this));buttonTarget=(ux(this),cx(this));sidebarState=(dx(this),hx(this,"expanded"));sidebarListener=(px(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{Z_()}};import{jsx as rt,jsxs as Nt}from"@ecopages/jsx/jsx-runtime";function Xk({layout:e="default",siteHeader:t,sidebar:i,children:r,class:l,...p}){return e==="docs"?Nt("div",{...p,class:P("rui-sidebar-provider",l),"data-layout":e,children:[t?rt("div",{class:"rui-sidebar-provider__site-header",children:t}):null,Nt("div",{class:"rui-sidebar-provider__body",children:[i,r]})]}):Nt("div",{...p,class:P("rui-sidebar-provider",l),"data-layout":e,children:[i,r]})}function Qk({children:e,class:t,...i}){return rt("div",{...i,class:P("rui-sidebar__header",t),children:e})}function Jk({children:e,class:t,...i}){return rt("div",{...i,class:P("rui-sidebar__content",t),children:e})}function Zk({children:e,class:t,...i}){return rt("div",{...i,class:P("rui-sidebar__footer",t),children:e})}function tM({class:e,...t}){return rt("hr",{...t,role:"separator","aria-orientation":"horizontal",class:P("rui-sidebar__separator",e)})}function eM({children:e,class:t,...i}){return rt("section",{...i,class:P("rui-sidebar__group",t),children:e})}function yx({children:e,class:t,...i}){return rt("h2",{...i,class:P("rui-sidebar__group-label",t),children:e})}function iM({children:e,class:t,...i}){return rt("button",{...i,type:"button",class:P("rui-sidebar__group-action",t),children:e})}function rM({label:e,action:t,class:i,...r}){return Nt("div",{...r,class:P("rui-sidebar__group-header",i),children:[rt(yx,{children:e}),t]})}function nM({children:e,class:t,...i}){return rt("ul",{...i,role:"list",class:P("rui-sidebar__menu",t),children:e})}function oM({children:e,class:t,...i}){return rt("li",{...i,class:P("rui-sidebar__menu-item",t),children:e})}function _x(e){if(e.href!==void 0){let{children:K,class:$,isActive:L,href:W,tooltip:G,aria:O,title:_,"aria-current":H,...Y}=e;return rt("a",{...Ci(Y,"as"),aria:nt(O,typeof K=="string"?void 0:G),href:W,class:P("rui-sidebar__menu-button",L&&"rui-sidebar__menu-button--active",$),"aria-current":L?"page":H,title:Ot(_,G),children:K})}let{children:t,class:i,isActive:r,type:l="button",tooltip:p,disabled:d,onClick:a,aria:E,title:R,"aria-current":S,"on:click":D,...A}=e;return rt("button",{...Ci(A,"as","href"),aria:nt(E,typeof t=="string"?void 0:p),type:l,class:P("rui-sidebar__menu-button",r&&"rui-sidebar__menu-button--active",i),"aria-current":r?"page":S,disabled:d,title:Ot(R,p),"on:click":Ot(D,a),children:t})}function aM(e){let{class:t,...i}=e;return rt(_x,{class:P("rui-sidebar__menu-action",t),...i})}function sM({children:e,class:t,...i}){return rt("main",{...i,class:P("rui-sidebar__inset",t),children:e})}function lM({children:e,open:t,label:i,...r}){return rt("rui-sidebar",{...r,"prop:open":t,label:i,children:Nt("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 uM(){return Nt("span",{class:"rui-sidebar__trigger-icon","aria-hidden":"true",children:[Nt("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"})]}),Nt("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"})]}),Nt("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"})]}),Nt("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 cM({children:e,class:t,triggerLabel:i,placement:r,variant:l="ghost",size:p="md",...d}){let a=i??"Toggle sidebar";return rt("rui-sidebar-trigger",{...d,class:P(t,r&&`rui-sidebar-trigger-placement--${r}`),"prop:buttonLabel":a,data:{buttonLabel:a},placement:r,variant:l,size:p,children:rt("button",{"data-ref":"button",type:"button",class:P("rui-button",`rui-button--${l}`,`rui-button--${p}`,"rui-sidebar__trigger"),children:e??rt(uM,{})})})}import{RadiantElement as T0,customElement as mM,event as gM,onEvent as ki,onUpdated as bM,prop as ft,query as Xt}from"@ecopages/radiant";var xx,wx,Sx,Tx,Ex,Ax,Rx,Ix,Cx,Dx,Ox,kx,Mx,Vx,jx,Lx,Px,Bx,Fx,Ux,zx,qx,Kx,$x,Wx,Gx,Hx,Yx,Nx,Xx,Qx,Jx,Zx,t0,e0,i0,r0,n0,o0,a0,s0,l0,u0,c0,d0,h0,p0,f0,m0,g0,b0,v0,y0,_0,x0,w0;function dM(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:S0(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||S0(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:hM(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return fM(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function hM(e){var t=pM(e,"string");return typeof t=="symbol"?t:t+""}function pM(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 S0(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 fM(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 A0,E0=class extends T0{static{({e:[Sx,Tx,Ex,Ax,Rx,Ix,Cx,Dx,Ox,kx,Mx,Vx,jx,Lx,Px,Bx,Fx,Ux,zx,qx,Kx,$x,Wx,Gx,Hx,Yx,Nx,Xx,Qx,Jx,Zx,t0,e0,i0,r0,n0,o0,a0,s0,l0,u0,c0,d0,h0,p0,f0,m0,g0,b0,v0,y0,_0,x0,w0,xx],c:[A0,wx]}=dM(this,[mM("rui-slider")],[[ft({type:String,defaultValue:"single"}),0,"variant"],[ft({type:String,defaultValue:"horizontal"}),0,"orientation"],[ft({type:Number,reflect:!0,defaultValue:50}),0,"value"],[ft({type:Number,reflect:!0,attribute:"range-min",defaultValue:25}),0,"rangeMin"],[ft({type:Number,reflect:!0,attribute:"range-max",defaultValue:75}),0,"rangeMax"],[ft({type:Number,defaultValue:0}),0,"min"],[ft({type:Number,defaultValue:100}),0,"max"],[ft({type:Number,defaultValue:1}),0,"step"],[ft({type:Number,attribute:"value-precision",defaultValue:Number.NaN}),0,"valuePrecision"],[ft({type:Number,defaultValue:0}),0,"minDistance"],[ft({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ft({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[ft({type:String,defaultValue:""}),0,"label"],[ft({type:String,defaultValue:""}),0,"name"],[ft({type:Boolean,attribute:"show-value",defaultValue:!1}),0,"showValue"],[ft({type:Boolean,attribute:"value-title",defaultValue:!1}),0,"valueTitle"],[gM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Xt({ref:"input"}),0,"inputTarget"],[Xt({ref:"maxInput"}),0,"maxInputTarget"],[Xt({ref:"root"}),0,"rootTarget"],[Xt({ref:"header"}),0,"headerTarget"],[Xt({ref:"label"}),0,"labelTarget"],[Xt({ref:"rangeTrack"}),0,"rangeTrack"],[Xt({ref:"value"}),0,"valueTarget"],[Xt({ref:"singleThumb"}),0,"singleThumb"],[Xt({ref:"rangeMinThumb"}),0,"rangeMinThumb"],[Xt({ref:"rangeMaxThumb"}),0,"rangeMaxThumb"],[bM(["value","rangeMin","rangeMax","min","max","step","valuePrecision","minDistance","variant","orientation","disabled","readOnly","label","name","showValue","valueTitle"]),2,"onPropsUpdated"],[ki({ref:"rangeTrack",type:"pointerdown"}),2,"onPointerDown"],[ki({document:!0,type:"pointermove"}),2,"onPointerMove"],[ki({document:!0,type:"pointerup"}),2,"onPointerUp"],[ki({document:!0,type:"pointercancel"}),2,"onPointerCancel"],[ki({selector:"[data-thumb]",type:"keydown"}),2,"onThumbKeydown"]],0,void 0,T0))}variant=(xx(this),Sx(this));orientation=(Tx(this),Ex(this));value=(Ax(this),Rx(this));rangeMin=(Ix(this),Cx(this));rangeMax=(Dx(this),Ox(this));min=(kx(this),Mx(this));max=(Vx(this),jx(this));step=(Lx(this),Px(this));valuePrecision=(Bx(this),Fx(this));minDistance=(Ux(this),zx(this));disabled=(qx(this),Kx(this));readOnly=($x(this),Wx(this));label=(Gx(this),Hx(this));name=(Yx(this),Nx(this));showValue=(Xx(this),Qx(this));valueTitle=(Jx(this),Zx(this));changeEvent=(t0(this),e0(this));inputTarget=(i0(this),r0(this));maxInputTarget=(n0(this),o0(this));rootTarget=(a0(this),s0(this));headerTarget=(l0(this),u0(this));labelTarget=(c0(this),d0(this));rangeTrack=(h0(this),p0(this));valueTarget=(f0(this),m0(this));singleThumb=(g0(this),b0(this));rangeMinThumb=(v0(this),y0(this));rangeMaxThumb=(_0(this),x0(this));activeThumb=(w0(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 he(this.min,this.max,this.step)}get resolvedValuePrecision(){return xr(this.step,this.valuePrecision)}formatValue(t){return wr(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,p=l.clamp(t),d=l.clamp(i);p>d&&([p,d]=[d,p]);let a=Math.max(0,this.minDistance);return d-p<a&&(r==="min"?p=l.clamp(d-a):d=l.clamp(p+a)),[p,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:p,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",p),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],p=`${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?p:"0%"),E?.style.setProperty("--rui-slider-fill-size",t.length===2?a:d),E?.style.setProperty("--rui-slider-value",p),E?.style.setProperty("--rui-slider-min",p),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,p]of i){let d=r[p];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),p=r??this.nearestThumb(l);this.pending=this.committedValues(),this.lastEmitted=this.pending.join(","),this.activeThumb=p,this.activePointerId=t.pointerId,this.rangeTrack?.setPointerCapture(t.pointerId),this.thumbFor(p)?.focus(),r||this.moveThumb(p,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(),p=r==="max"?l[l.length-1]:l[0],d=Sr(this.numericRange,p,t.key);d!=null&&(t.preventDefault(),this.lastEmitted=l.join(","),this.moveThumb(r,d),this.commit())}static{wx()}};import{jsx as Dt,jsxs as no}from"@ecopages/jsx/jsx-runtime";function R0({children:e,class:t,...i}){return Dt("span",{...i,class:P("rui-slider__value",t),"data-ref":"value","aria-hidden":"true",children:e})}function vM({disabled:e,min:t,max:i,label:r,variant:l}){let p=l!=="range";return Dt("div",{class:"rui-slider__range",children:no("div",{class:"rui-slider__range-track","data-ref":"rangeTrack",children:[Dt("div",{class:"rui-slider__range-fill","data-ref":"rangeFill"}),Dt("button",{type:"button",class:"rui-slider__thumb","data-ref":"singleThumb","data-thumb":"value",role:"slider",tabindex:e||!p?-1:0,"aria-label":r||"Value","aria-valuemin":t,"aria-valuemax":i,disabled:e||!p,hidden:!p}),Dt("button",{type:"button",class:"rui-slider__thumb","data-ref":"rangeMinThumb","data-thumb":"min",role:"slider",tabindex:e||p?-1:0,"aria-label":r?`${r} minimum`:"Minimum value","aria-valuemin":t,"aria-valuemax":i,disabled:e||p,hidden:p}),Dt("button",{type:"button",class:"rui-slider__thumb","data-ref":"rangeMaxThumb","data-thumb":"max",role:"slider",tabindex:e||p?-1:0,"aria-label":r?`${r} maximum`:"Maximum value","aria-valuemin":t,"aria-valuemax":i,disabled:e||p,hidden:p})]})})}function yM({values:e,variant:t="single",orientation:i="horizontal",label:r,showValue:l=!1,valueTitle:p=!1,disabled:d,name:a,min:E,max:R,children:S,...D}){let A=S??Dt(R0,{"data-default-value":!0,hidden:!l}),K=!!S||l;return Dt("rui-slider",{...D,variant:t,orientation:i,label:r,showValue:l,valueTitle:p,disabled:d,name:a,min:E,max:R,rangeMin:e?.[0],rangeMax:e?.[1],children:no("div",{class:P("rui-slider",t==="range"?"rui-slider--range":"rui-slider--single",i==="vertical"&&"rui-slider--vertical"),"data-ref":"root",children:[no("div",{class:"rui-slider__header","data-ref":"header",hidden:!r&&!K,children:[Dt("span",{class:"rui-slider__label","data-ref":"label",hidden:!r,children:r}),A]}),Dt(vM,{disabled:d,min:E,max:R,label:r,variant:t}),Dt("input",{type:"hidden","data-ref":"input",name:a||void 0}),Dt("input",{type:"hidden","data-ref":"maxInput"})]})})}import{jsx as _M}from"@ecopages/jsx/jsx-runtime";function xM({size:e="md",aria:t,class:i,...r}){return _M("span",{...r,role:"status",aria:nt(t,"Loading"),class:P("rui-spinner",`rui-spinner--${e}`,i)})}import{RadiantElement as z0,bound as AM,customElement as RM,event as IM,onEvent as CM,onUpdated as DM,prop as oo,query as OM}from"@ecopages/radiant";var I0,C0,D0,O0,k0,M0,V0,j0,L0,P0,B0,F0;function wM(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:U0(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||U0(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:SM(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return EM(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function SM(e){var t=TM(e,"string");return typeof t=="symbol"?t:t+""}function TM(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 U0(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 EM(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 K0,q0=class extends z0{static{({e:[D0,O0,k0,M0,V0,j0,L0,P0,B0,F0,I0],c:[K0,C0]}=wM(this,[RM("rui-switch")],[[oo({type:Boolean,reflect:!0,defaultValue:!1}),0,"checked"],[oo({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[oo({type:String,defaultValue:""}),0,"name"],[OM({ref:"input"}),0,"inputTarget"],[IM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[[AM,DM(["checked","disabled","name"])],2,"syncInputState"],[CM({ref:"input",type:"change"}),2,"onInputChange"]],0,void 0,z0))}constructor(...t){super(...t),F0(this)}checked=(I0(this),D0(this));disabled=(O0(this),k0(this));name=(M0(this),V0(this));inputTarget=(j0(this),L0(this));changeEvent=(P0(this),B0(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{C0()}};import{jsx as Mi,jsxs as kM}from"@ecopages/jsx/jsx-runtime";function MM({children:e,checked:t,disabled:i,name:r,...l}){return Mi("rui-switch",{...l,checked:t,disabled:i,name:r,children:kM("label",{class:"rui-switch",children:[Mi("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}),Mi("span",{class:"rui-switch__track","aria-hidden":"true",children:Mi("span",{class:"rui-switch__thumb"})}),Mi("span",{class:"rui-switch__label",children:e})]})})}import{jsx as ct,jsxs as mw}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as dw,customElement as BM,event as ao,onEvent as Xe,onUpdated as hw,prop as Qe}from"@ecopages/radiant";var $0,W0,G0,H0,Y0,N0,X0,Q0,J0,Z0,tw,ew,iw,rw,nw,ow,aw,sw,lw,uw;function VM(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:cw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||cw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:jM(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return PM(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function jM(e){var t=LM(e,"string");return typeof t=="symbol"?t:t+""}function LM(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 cw(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 PM(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 fw,pw=class extends dw{static{({e:[G0,H0,Y0,N0,X0,Q0,J0,Z0,tw,ew,iw,rw,nw,ow,aw,sw,lw,uw,$0],c:[fw,W0]}=VM(this,[BM("rui-table")],[[Qe({type:String,defaultValue:""}),0,"label"],[Qe({type:String,attribute:"aria-busy",defaultValue:"false"}),0,"ariaBusy"],[Qe({type:String,attribute:"selection-mode",defaultValue:"none"}),0,"selectionMode"],[Qe({type:String,reflect:!0,defaultValue:""}),0,"value"],[Qe({type:String,attribute:"sort-column",reflect:!0,defaultValue:""}),0,"sortColumn"],[Qe({type:String,attribute:"sort-direction",reflect:!0,defaultValue:"ascending"}),0,"sortDirection"],[ao({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[ao({name:"rui-sort-change",bubbles:!0,composed:!0}),0,"sortChangeEvent"],[ao({name:"rui-row-action",bubbles:!0,composed:!0}),0,"rowActionEvent"],[hw(["value","selectionMode"]),2,"onSelectionUpdated"],[hw(["sortColumn","sortDirection"]),2,"onSortUpdated"],[Xe({selector:"[data-table-cell]",type:"click"}),2,"onCellClick"],[Xe({selector:"[data-table-cell]",type:"dblclick"}),2,"onCellDoubleClick"],[Xe({selector:"[data-table-cell]",type:"keydown"}),2,"onCellKeydown"],[Xe({selector:"rui-checkbox[data-table-select-row]",type:"rui-change"}),2,"onRowSelectionChange"],[Xe({selector:"rui-checkbox[data-table-select-all]",type:"rui-change"}),2,"onSelectAllChange"],[Xe({selector:"[data-table-sort]",type:"click"}),2,"onSortClick"]],0,void 0,dw))}label=($0(this),G0(this));ariaBusy=(H0(this),Y0(this));selectionMode=(N0(this),X0(this));value=(Q0(this),J0(this));sortColumn=(Z0(this),tw(this));sortDirection=(ew(this),iw(this));changeEvent=(rw(this),nw(this));sortChangeEvent=(ow(this),aw(this));rowActionEvent=(sw(this),lw(this));structureObserver=void uw(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"?qt(this.value):this.value?[this.value]:[]}setSelectedIds(t){this.value=this.selectionMode==="multiple"?Lt(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 p=this.getRowCells(l).indexOf(r);return p<0?null:{rowId:l.getAttribute("data-table-row")??"",columnIndex:p}}syncSelectionState(){let t=new Set(this.selectedIds()),i=this.getSelectableRows(),r=this.selectionMode!=="none";for(let l of this.getRows()){let p=l.getAttribute("data-table-row")??"";r?l.setAttribute("aria-selected",String(t.has(p))):l.removeAttribute("aria-selected");let d=l.querySelector("rui-checkbox[data-table-select-row]");d&&(d.checked=r&&t.has(p),d.disabled=!r||l.getAttribute("aria-disabled")==="true")}for(let l of this.querySelectorAll("rui-checkbox[data-table-select-all]")){let p=i.filter(a=>t.has(a.getAttribute("data-table-row")??"")).length,d=this.selectionMode==="multiple";l.checked=d&&i.length>0&&p===i.length,l.indeterminate=d&&p>0&&p<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(p=>p.getAttribute("data-table-row")===i.rowId);if(l){let p=this.getRowCells(l)[i.columnIndex],d=p?t.indexOf(p):-1;d>=0&&(r=d)}}st(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),p=l[Math.min(Math.max(i,0),l.length-1)],d=r.indexOf(p);d<0||(st(r,d),p.focus(),p.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 p=this.getSelectableRows(),d=p.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(p[Math.min(d+1,p.length-1)]??l,E);return;case"ArrowUp":t.preventDefault(),this.focusCell(p[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 p=new Set(this.selectedIds());p.delete(l),this.setSelectedIds([...p]);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{W0()}};function FM({children:e,class:t,...i}){return ct("div",{...i,role:"rowgroup",class:P("rui-table__header",t),children:ct("div",{class:"rui-table__row",role:"row",children:e})})}function UM({children:e,class:t,...i}){return ct("div",{...i,role:"rowgroup",class:P("rui-table__body",t),children:e})}function zM({children:e,class:t,...i}){return ct("div",{...i,role:"rowgroup",class:P("rui-table__footer",t),children:ct("div",{class:"rui-table__row",role:"row",children:e})})}function qM({id:e,allowsSorting:t=!1,isRowHeader:i=!1,children:r,class:l,...p}){return ct("div",{...p,role:"columnheader","data-table-column":e,"data-table-row-header":i?"":void 0,class:P("rui-table__column",l),children:t?mw("button",{type:"button","data-table-sort":e,class:"rui-table__sort",children:[ct("span",{children:r}),ct("span",{class:"rui-table__sort-indicator","aria-hidden":"true"})]}):r})}function KM({id:e,disabled:t,actionable:i,children:r,class:l,...p}){return ct("div",{...p,role:"row","data-table-row":e,"data-table-actionable":i?"":void 0,"aria-disabled":t?"true":void 0,class:P("rui-table__row",l),children:r})}function $M({isRowHeader:e=!1,children:t,class:i,...r}){return ct("div",{...r,role:e?"rowheader":"gridcell","data-table-cell":!0,tabindex:-1,class:P("rui-table__cell",i),children:t})}function WM({scope:e,label:t,class:i,...r}){let l=e==="all";return ct("div",{...r,role:l?"columnheader":"gridcell","data-table-cell":!0,"data-table-selection-cell":e,class:P("rui-table__selection-cell",i),children:ct(si,{"data-table-select-all":l?"":void 0,"data-table-select-row":l?void 0:"",children:ct("span",{class:"sr-only",children:t??(l?"Select all rows":"Select row")})})})}function GM({colSpan:e,children:t,class:i,...r}){let l=Math.max(1,Math.floor(e));return mw("div",{role:"row",class:"rui-table__row rui-table__row--empty",children:[ct("div",{...r,role:"gridcell","aria-colspan":l,class:P("rui-table__empty-state",i),children:ct("span",{class:"rui-table__empty-state-message",children:t})}),Array.from({length:l-1},(p,d)=>ct("div",{"aria-hidden":"true",class:"rui-table__empty-state-spacer"},d))]})}function HM({children:e,label:t,ariaBusy:i,selectionMode:r,...l}){return ct("rui-table",{...l,label:t,ariaBusy:i,selectionMode:r,children:ct("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 Cw,customElement as JM,event as ZM,onEvent as Dw,onUpdated as tV,prop as Mr}from"@ecopages/radiant";var gw,bw,vw,yw,_w,xw,ww,Sw,Tw,Ew,Aw,Rw;function YM(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Iw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Iw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return QM(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function NM(e){var t=XM(e,"string");return typeof t=="symbol"?t:t+""}function XM(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 Iw(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 QM(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 kw,Ow=class extends Cw{static{({e:[vw,yw,_w,xw,ww,Sw,Tw,Ew,Aw,Rw,gw],c:[kw,bw]}=YM(this,[JM("rui-tabs")],[[Mr({type:String,reflect:!0,defaultValue:"boxed"}),0,"variant"],[Mr({type:String,reflect:!0,defaultValue:""}),0,"value"],[Mr({type:String,defaultValue:""}),0,"label"],[Mr({type:Boolean,defaultValue:!0}),0,"automatic"],[ZM({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[tV(["value","label"]),2,"onPropsUpdated"],[Dw({selector:'[role="tab"]',type:"click"}),2,"onTabClick"],[Dw({selector:'[role="tab"]',type:"keydown"}),2,"onTabKeydown"]],0,void 0,Cw))}variant=(gw(this),vw(this));value=(yw(this),_w(this));label=(xw(this),ww(this));automatic=(Sw(this),Tw(this));changeEvent=(Ew(this),Aw(this));childObserver=(Rw(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],p=this.getTabValue(l);this.value=p;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-/,""))===p;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=ut({items:i,current:r,key:t.key,orientation:"horizontal"});l.handled&&(t.preventDefault(),this.automatic&&this.activateTab(l.item))}static{bw()}};import{jsx as Vi}from"@ecopages/jsx/jsx-runtime";function eV({children:e,class:t,...i}){return Vi("div",{...i,class:P("rui-tabs__list",t),role:"tablist",children:e})}function iV({id:e,children:t,class:i,disabled:r,selected:l,...p}){return Vi("button",{...p,type:"button",class:P("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 rV({children:e,class:t,...i}){return Vi("div",{...i,class:P("rui-tabs__panels",t),children:e})}function nV({id:e,children:t,class:i,selected:r,hidden:l,...p}){return Vi("div",{...p,class:P("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 oV({children:e,...t}){return Vi("rui-tabs",{...t,children:e})}import{RadiantElement as Jw,customElement as cV,event as Zw,onEvent as so,onUpdated as dV,prop as ji,state as hV}from"@ecopages/radiant";var Mw,Vw,jw,Lw,Pw,Bw,Fw,Uw,zw,qw,Kw,$w,Ww,Gw,Hw,Yw,Nw,Xw;function aV(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:Qw(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||Qw(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:sV(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return uV(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function sV(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 Qw(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 uV(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 Jw{static{({e:[jw,Lw,Pw,Bw,Fw,Uw,zw,qw,Kw,$w,Ww,Gw,Hw,Yw,Nw,Xw,Mw],c:[eS,Vw]}=aV(this,[cV("rui-tag-group")],[[ji({type:String,reflect:!0,defaultValue:""}),0,"value"],[ji({type:String,defaultValue:""}),0,"label"],[ji({type:Boolean,reflect:!0,defaultValue:!1}),0,"disabled"],[ji({type:String,attribute:"selection-mode",defaultValue:"multiple"}),0,"selectionMode"],[ji({type:Boolean,reflect:!0,defaultValue:!1}),0,"embedded"],[Zw({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Zw({name:"rui-remove",bubbles:!0,composed:!0}),0,"removeEvent"],[hV,0,"managedItems"],[dV(["value","label","disabled","selectionMode","embedded","managedItems"]),2,"onPropsUpdated"],[so({selector:"[data-tag]",type:"click"}),2,"onTagClick"],[so({selector:"[data-tag-remove]",type:"click"}),2,"onRemoveClick"],[so({selector:"[data-tag]",type:"keydown"}),2,"onTagKeydown"]],0,void 0,Jw))}constructor(...t){super(...t),Xw(this)}value=(Mw(this),jw(this));label=(Lw(this),Pw(this));disabled=(Bw(this),Fw(this));selectionMode=(Uw(this),zw(this));embedded=(qw(this),Kw(this));changeEvent=($w(this),Ww(this));removeEvent=(Gw(this),Hw(this));uid=(Yw(this),Math.random().toString(36).slice(2,9));managedItems=Nw(this,[]);isMultiple(){return this.selectionMode==="multiple"}getSelectedValues(){return this.value?qt(this.value):[]}setSelectedValues(t){this.value=Lt(t)}getList(){let t=this.querySelector("[data-rui-managed-list]");return t||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 p=this.getTagValue(r),d=t.has(p);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.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.managedItems=t,this.value=Lt(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");r.type="button",r.setAttribute("data-tag-remove",""),r.className="rui-tag__remove",r.setAttribute("aria-label",`Remove ${t.label}`);let l=document.createElement("span");return l.setAttribute("aria-hidden","true"),l.textContent="\xD7",r.append(l),i.append(r),i}syncManagedList(){let t=this.querySelector('[data-ref="root"]');if(!t)return;let i=t.querySelector("[data-rui-managed-list]");if(this.managedItems.length===0){i?.remove();return}i||(i=document.createElement("div"),i.setAttribute("data-tag-list",""),i.setAttribute("data-rui-managed-list",""),i.className="rui-tag-group__list",t.appendChild(i)),i.replaceChildren(...this.managedItems.map(r=>this.createManagedTag(r))),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}ut({items:i,current:r,key:t.key,orientation:"horizontal"}).handled&&t.preventDefault()}static{Vw()}};import{jsx as Ft,jsxs as pV}from"@ecopages/jsx/jsx-runtime";function rS({children:e,class:t,...i}){return Ft("div",{...i,"data-tag-list":!0,class:P("rui-tag-group__list",t),children:e})}function nS({value:e,label:t,children:i,class:r,disabled:l,...p}){return pV("span",{...p,"data-tag":!0,"data-value":e,"data-label":t,class:P("rui-tag",r),"aria-disabled":l?"true":void 0,children:[i,Ft(oS,{})]})}function oS({children:e,class:t,aria:i,...r}){return Ft("button",{...r,aria:nt(i,"Remove"),type:"button","data-tag-remove":!0,class:P("rui-tag__remove",t),children:e??Ft("span",{"aria-hidden":"true",children:"\xD7"})})}function iS({children:e}){return Ft("div",{class:"rui-tag-group","data-ref":"root",children:e})}function fV({tags:e,children:t,...i}){return e!=null?Ft("rui-tag-group",{...i,children:Ft(iS,{children:Ft(rS,{children:e.map(r=>Ft(nS,{value:r.value,label:typeof r.label=="string"?r.label:void 0,disabled:r.disabled,children:r.label}))})})}):Ft("rui-tag-group",{...i,children:Ft(iS,{children:t})})}import{jsx as mV}from"@ecopages/jsx/jsx-runtime";function gV(e){let{class:t,rows:i=3,...r}=e;return mV("textarea",{...r,rows:i,[Pt]:"","data-rui-control-type":"text",class:P("rui-textarea",t)})}import{jsx as Je,jsxs as kS}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as MS,bound as go,customElement as TV,onEvent as VS,onUpdated as bo,prop as Qt,query as EV}from"@ecopages/radiant";var Li="rui-toast-show",Pi="rui-toast-dismiss",bV=["top-start","top-center","top-end","bottom-start","bottom-center","bottom-end"],Bi=4e3,lo=356,uo=14,co=24,ho=3,po=3,Fi=45,fo=200,Ui="bottom-end";function De(e){let[t,i]=e.split("-");return{y:t,x:i}}var vV=1;function yV(){return vV++}function aS(e,t){return typeof e=="function"?e(t):e}var mo=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??yV(),l=i.dismissible??!0,p=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 p>=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(p=>{let d=typeof i.description=="function"?i.description(p):i.description;this.create(aS(i.success,p),{id:r,variant:"success",description:d,duration:i.duration,action:i.action,closeButton:i.closeButton,position:i.position})}).catch(p=>{let d=typeof i.description=="function"?i.description(p):i.description;this.create(aS(i.error,p),{id:r,variant:"error",description:d,duration:i.duration,action:i.action,closeButton:i.closeButton,position:i.position})}),r}},at=new mo;var sS,lS,uS,cS,dS,hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,SS,TS,ES,AS,RS,IS,CS,DS;function _V(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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 X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||OS(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:xV(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return SV(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function xV(e){var t=wV(e,"string");return typeof t=="symbol"?t:t+""}function wV(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 SV(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 zi=new Map,jr=new Map;function vo(e){return String(e)}function Vr(e){if(e==="")return;let t=vo(e);zi.delete(t),jr.delete(t)}function AV(e){if(e==="")return;let t=vo(e),i=zi.get(t);i!=null&&(jr.set(t,Math.max(0,i-Date.now())),zi.delete(t))}var LS,jS=class extends MS{static{({e:[uS,cS,dS,hS,pS,fS,mS,gS,bS,vS,yS,_S,xS,wS,SS,TS,ES,AS,RS,IS,CS,DS,sS],c:[LS,lS]}=_V(this,[TV("rui-toast")],[[Qt({type:String,reflect:!0,defaultValue:""}),0,"toastId"],[Qt({type:String,defaultValue:""}),0,"title"],[Qt({type:String,defaultValue:""}),0,"description"],[Qt({type:String,reflect:!0,defaultValue:"default"}),0,"variant"],[Qt({type:Number,defaultValue:4e3}),0,"duration"],[Qt({type:Boolean,defaultValue:!0}),0,"dismissible"],[Qt({type:Boolean,defaultValue:!1}),0,"closeButton"],[Qt({type:String,defaultValue:""}),0,"actionLabel"],[Qt({type:String,defaultValue:Ui}),0,"position"],[Qt({type:Boolean,defaultValue:!1}),0,"markedDelete"],[EV({ref:"toast"}),0,"toastTarget"],[bo("position"),2,"onPositionUpdated"],[bo("duration"),2,"onDurationUpdated"],[bo("markedDelete"),2,"onMarkedDeleteUpdated"],[go,2,"onPointerDown"],[go,2,"onPointerMove"],[go,2,"onPointerUp"],[VS({selector:"[data-toast-close]",type:"click"}),2,"onCloseClick"],[VS({selector:"[data-toast-action]",type:"click"}),2,"onActionClick"]],0,void 0,MS))}toastId=(sS(this),uS(this));title=(cS(this),dS(this));description=(hS(this),pS(this));variant=(fS(this),mS(this));duration=(gS(this),bS(this));dismissible=(vS(this),yS(this));closeButton=(_S(this),xS(this));actionLabel=(wS(this),SS(this));position=(TS(this),ES(this));markedDelete=(AS(this),RS(this));toastTarget=(IS(this),CS(this));mounted=(DS(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&&at.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?(AV(this.resolvedId),this.clearTimer()):this.startTimer())}onDurationUpdated(){!this.timerReady||!this.mounted||this.removed||this.held||(Vr(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=vo(t),r=Date.now(),l=jr.get(i);if(jr.delete(i),l==null){let p=zi.get(i);l=p!=null?p-r:this.duration}if(l<=0){Vr(t),this.beginRemove();return}zi.set(i,r+l),this.clearTimer(),this.timeoutId=setTimeout(()=>{Vr(t),this.beginRemove()},l)}beginRemove(){this.removed||(this.removed=!0,this.clearTimer(),Vr(this.resolvedId),this.syncDomState(),this.markedDelete||at.dismiss(this.resolvedId),this.exitTimer=setTimeout(()=>{this.exitTimer=null,at.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}=De(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}=De(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(),at.getSnapshot().find(r=>r.id===this.resolvedId)?.action?.onClick(t),this.dismissible&&this.beginRemove()}syncDomState(){let{y:t,x:i}=De(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"\u2713";case"error":return"\u2715";case"warning":return"!";case"info":return"i";default:return""}}render(){let t=this.variant??"default",i=this.iconForVariant(),r=t!=="default";return kS("div",{ref:"toast",class:`rui-toast rui-toast--${t}`,role:"status","aria-live":"off","data-ref":"toast",children:[this.closeButton&&t!=="loading"?Je("button",{type:"button",class:"rui-toast__close","data-toast-close":!0,"aria-label":"Close toast",children:"\xD7"}):null,r?Je("span",{class:"rui-toast__icon","data-icon":!0,"aria-hidden":"true",children:t==="loading"?Je("span",{class:"rui-toast__loader"}):i}):null,kS("div",{class:"rui-toast__content",children:[Je("div",{class:"rui-toast__title","data-title":!0,children:this.$.title}),this.description?Je("div",{class:"rui-toast__description","data-description":!0,children:this.$.description}):null]}),this.actionLabel?Je("button",{type:"button",class:"rui-toast__action rui-button rui-button--outline rui-button--sm","data-toast-action":!0,children:this.$.actionLabel}):null]})}static{lS()}};import{jsx as yo}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as sT,bound as Lr,customElement as OV,onEvent as _o,onUpdated as kV,prop as be,state as MV}from"@ecopages/radiant";function PS(e,t,i){let r=0;for(let l=0;l<e;l+=1)r+=t[l]??0;return r+e*i}function BS(e,t){return e.length===0?0:e.reduce((r,l)=>r+l,0)+Math.max(0,e.length-1)*t}function FS(e,t,i){return t<=0?0:e+Math.max(0,t-1)*i}var US,zS,qS,KS,$S,WS,GS,HS,YS,NS,XS,QS,JS,ZS,tT,eT,iT,rT,nT,oT;function RV(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:aT(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||aT(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:IV(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return DV(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function IV(e){var t=CV(e,"string");return typeof t=="symbol"?t:t+""}function CV(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 aT(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 DV(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 lT(e,t){return e instanceof Node&&t.contains(e)}var cT,uT=class extends sT{static{({e:[qS,KS,$S,WS,GS,HS,YS,NS,XS,QS,JS,ZS,tT,eT,iT,rT,nT,oT,US],c:[cT,zS]}=RV(this,[OV("rui-toaster")],[[be({type:String,reflect:!0,defaultValue:Ui}),0,"position"],[be({type:Number,defaultValue:4e3}),0,"duration"],[be({type:Number,defaultValue:3}),0,"visibleToasts"],[be({type:Boolean,defaultValue:!1}),0,"closeButton"],[be({type:Boolean,defaultValue:!1}),0,"expand"],[be({type:Number,defaultValue:14}),0,"gap"],[be({type:Number,defaultValue:24}),0,"offset"],[be({type:String,reflect:!0,defaultValue:""}),0,"container"],[MV,0,"toasts"],[kV(["position","duration","visibleToasts","closeButton","expand","gap","offset","container"]),2,"onConfigUpdated"],[_o({document:!0,type:Li}),2,"onDocumentShow"],[_o({document:!0,type:Pi}),2,"onDocumentDismiss"],[_o({selector:"rui-toast",type:"rui-toast-mounted"}),2,"onToastMounted"],[Lr,2,"onPointerOver"],[Lr,2,"onPointerOut"],[Lr,2,"onPointerDown"],[Lr,2,"onPointerUp"]],0,void 0,sT))}position=(US(this),qS(this));duration=(KS(this),$S(this));visibleToasts=(WS(this),GS(this));closeButton=(HS(this),YS(this));expand=(NS(this),XS(this));gap=(QS(this),JS(this));offset=(ZS(this),tT(this));container=(eT(this),iT(this));toasts=(rT(this),nT(this,[]));expanded=(oT(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=at.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&&at.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;at.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}=De(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.querySelector(".rui-toaster");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.querySelector(".rui-toaster")?.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.querySelector(".rui-toast"),p=Math.round(l instanceof HTMLElement?l.offsetHeight:t.offsetHeight)||64;return t.style.height=i,t.style.overflow=r,this.measuring=!1,p}observeToasts(){let t=this.querySelector(".rui-toaster");if(!t)return;let i=[...t.querySelectorAll("rui-toast")],r=new Set;for(let l of i){let p=l.toastId;if(!p)continue;r.add(p);let d=l.querySelector(".rui-toast")??l;if(!this.observers.has(p)){let a=new ResizeObserver(()=>{if(this.measuring)return;let E=this.measureToast(l);this.heights.get(p)!==E&&(this.heights.set(p,E),this.patchStackLayout())});a.observe(d),this.observers.set(p,a)}this.heights.set(p,this.measureToast(l))}for(let[l,p]of[...this.observers])r.has(l)||(p.disconnect(),this.observers.delete(l),this.heights.delete(l))}patchStackLayout(){let t=this.querySelector(".rui-toaster");if(!t)return;let i=this.isStackExpanded(),{y:r}=De(this.position),l=r==="bottom"?-1:1,p=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 A=a[S]??64,K=S===0,$=PS(S,a,this.gap),L=S<p;if(D.dataset.index=String(S),D.dataset.front=String(K),D.dataset.expanded=String(i),D.dataset.visible=String(i||L),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",`${A}px`),D.style.setProperty("--gap",`${this.gap}px`),i)D.style.setProperty("--y",`translateY(${l*$}px)`),D.style.height=`${A}px`,D.style.overflow="visible";else if(!L)D.style.setProperty("--y",`translateY(${l*(p-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=`${A}px`,D.style.overflow="visible";else{let W=Math.max(.7,1-S*.05);D.style.setProperty("--y",`translateY(${l*S*this.gap}px) scale(${W})`),D.style.height=`${E}px`,D.style.overflow="hidden"}}let R=Math.min(p,d.length);t.style.height=`${i?BS(a,this.gap):FS(E,R,this.gap)}px`}onPointerOver(t){lT(t.relatedTarget,this)||(this.expanded=!0,this.syncPauseState())}onPointerOut(t){lT(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.querySelector(".rui-toaster")?.matches(":hover")||this.querySelector("rui-toast:hover")||(this.expanded=!1),this.syncPauseState()}render(){let t=this.filteredToasts();return yo("section",{class:"rui-toaster-region","aria-label":"Notifications","aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",tabIndex:-1,children:yo("ol",{class:"rui-toaster","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 yo("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{zS()}};import{jsx as dT}from"@ecopages/jsx/jsx-runtime";function VV({toastId:e,...t}){return dT("rui-toast",{...t,toastId:e!=null?String(e):void 0})}function jV({children:e,...t}){return dT("rui-toaster",{...t,children:e})}var LV=Object.assign((e,t)=>at.create(e,t),{message:(e,t)=>at.message(e,t),success:(e,t)=>at.success(e,t),error:(e,t)=>at.error(e,t),info:(e,t)=>at.info(e,t),warning:(e,t)=>at.warning(e,t),loading:(e,t)=>at.loading(e,t),promise:(e,t)=>at.promise(e,t),dismiss:e=>at.dismiss(e),clear:()=>at.clear()});function PV(e){document.dispatchEvent(new CustomEvent(Li,{detail:e,bubbles:!0,composed:!0}))}function BV(e){let t=e==null?{}:{id:e};document.dispatchEvent(new CustomEvent(Pi,{detail:t,bubbles:!0,composed:!0}))}import{jsx as Pr,jsxs as $V}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as VT,bound as WV,customElement as GV,onUpdated as HV,prop as qi,state as jT}from"@ecopages/radiant";import{isServer as LT}from"@ecopages/radiant/is-server";function hT(e,t){try{return e.querySelector(t)}catch{return null}}function pT(e,t){try{return Array.from(e.querySelectorAll(t))}catch{return[]}}function FV(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}function fT(e,t,i=r=>document.getElementById(r)!==null){if(e.id)return t.add(e.id),e.id;let r=FV(e.textContent||"")||"section",l=r,p=2;for(;t.has(l)||i(l);)l=`${r}-${p}`,p+=1;return e.id=l,t.add(l),l}function mT(e,t){return e instanceof HTMLElement?e.getBoundingClientRect().top+t:t}function gT(e,t,i,r){if(t instanceof HTMLElement){let l=t.getBoundingClientRect(),p=e.getBoundingClientRect();t.scrollTo({top:t.scrollTop+(p.top-l.top)-i,behavior:r});return}window.scrollTo({top:window.scrollY+e.getBoundingClientRect().top-i,behavior:r})}var bT,vT,yT,_T,xT,wT,ST,TT,ET,AT,RT,IT,CT,DT,OT,kT;function UV(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:MT(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||MT(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:zV(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return KV(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function zV(e){var t=qV(e,"string");return typeof t=="symbol"?t:t+""}function qV(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 MT(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 KV(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 BT,PT=class extends VT{static{({e:[yT,_T,xT,wT,ST,TT,ET,AT,RT,IT,CT,DT,OT,kT,bT],c:[BT,vT]}=UV(this,[GV("rui-toc")],[[qi({type:String,attribute:"target",defaultValue:""}),0,"target"],[qi({type:String,attribute:"heading-selector",defaultValue:"h2,h3"}),0,"headingSelector"],[qi({type:String,defaultValue:"On this page"}),0,"label"],[qi({type:Number,attribute:"scroll-offset",defaultValue:120}),0,"scrollOffset"],[qi({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[jT,0,"entries"],[jT,0,"activeId"],[HV(["target","headingSelector","scrollOffset","navigationEvents"]),2,"onScanSettingsUpdated"],[WV,2,"onLinkClick"]],0,void 0,VT))}target=(bT(this),yT(this,""));headingSelector=(_T(this),xT(this,"h2,h3"));label=(wT(this),ST(this,"On this page"));scrollOffset=(TT(this),ET(this,120));navigationEvents=(AT(this),RT(this,""));entries=(IT(this),CT(this,[]));activeId=(DT(this),OT(this,null));headings=(kT(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=pT(t,this.readConfiguredProp(this.headingSelector,"heading-selector")||"h2,h3");if(i.length===0)return;let r=new Set,l=i.map(p=>({id:fT(p,r),label:(p.textContent||"").trim(),depth:this.headingDepth(p)}));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?hT(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(LT||!this.isConnected)return;let t=()=>this.rebuild();for(let i of Dr(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(LT||!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 mT(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}`),gT(i,this.scrollRoot??window,this.resolvedScrollOffset(),r)}render(){return this.entries.length===0?null:$V("nav",{class:"rui-toc","aria-label":this.$.label,children:[this.label?Pr("p",{class:"rui-toc__label",children:this.$.label}):null,Pr("ul",{class:"rui-toc__list",children:this.entries.map(t=>Pr("li",{class:t.depth>=3?"rui-toc__item rui-toc__item--depth-3":"rui-toc__item",children:Pr("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{vT()}};import{jsx as YV}from"@ecopages/jsx/jsx-runtime";function NV(e){return YV("rui-toc",{...e})}import{RadiantElement as GT,customElement as tj,onEvent as HT,prop as YT}from"@ecopages/radiant";var FT,UT,zT,qT,KT,$T;function XV(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:WT(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||WT(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:QV(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return ZV(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function QV(e){var t=JV(e,"string");return typeof t=="symbol"?t:t+""}function JV(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 WT(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 ZV(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 XT,NT=class extends GT{static{({e:[zT,qT,KT,$T,FT],c:[XT,UT]}=XV(this,[tj("rui-toolbar")],[[YT({type:String,defaultValue:""}),0,"label"],[YT({type:Boolean,reflect:!0,defaultValue:!1}),0,"exclusiveToggles"],[HT({type:"keydown",selector:"button, a[href], input, select, [tabindex]"}),2,"onKeydown"],[HT({type:"click",selector:"button[data-toggle][aria-pressed]",options:{capture:!0}}),2,"onToggleButtonClick"]],0,void 0,GT))}constructor(...t){super(...t),$T(this)}label=(FT(this),zT(this));exclusiveToggles=(qT(this),KT(this));getItems(){return rr(this)}onConnected(){st(this.getItems(),0)}onKeydown(t){let i=this.getItems(),r=t.target.closest("button, a[href], input, select, [tabindex]");ut({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{UT()}};import{jsx as QT}from"@ecopages/jsx/jsx-runtime";function ej({children:e,label:t,...i}){return QT("rui-toolbar",{...i,label:t,children:QT("div",{class:"rui-toolbar","data-ref":"root",role:"toolbar","aria-label":t||void 0,children:e})})}import{jsx as xo,jsxs as aj}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as uE,bound as cE,customElement as sj,onEvent as wo,onUpdated as lj,prop as So,query as uj}from"@ecopages/radiant";var JT,ZT,tE,eE,iE,rE,nE,oE,aE,sE;function ij(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:lE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||lE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:rj(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return oj(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function rj(e){var t=nj(e,"string");return typeof t=="symbol"?t:t+""}function nj(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 lE(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 oj(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 dE=8,pE,hE=class extends uE{static{({e:[tE,eE,iE,rE,nE,oE,aE,sE,JT],c:[pE,ZT]}=ij(this,[sj("rui-tooltip")],[[So({type:String,defaultValue:""}),0,"content"],[So({type:String,defaultValue:"top"}),0,"placement"],[So({type:Number,defaultValue:200}),0,"delay"],[uj({ref:"tooltip"}),0,"tooltipTarget"],[lj(["content","placement"]),2,"onDescribedPropsUpdated"],[wo({document:!0,type:"keydown"}),2,"onDocumentKeydown"],[wo({type:"focusin",selector:".rui-tooltip__trigger"}),2,"onFocusIn"],[wo({type:"focusout",selector:".rui-tooltip__trigger"}),2,"onFocusOut"],[cE,2,"onPointerEnter"],[cE,2,"onPointerLeave"]],0,void 0,uE))}content=(JT(this),tE(this));placement=(eE(this),iE(this));delay=(rE(this),nE(this));tooltipTarget=(oE(this),aE(this));open=(sE(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 Fe(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=Zi({anchor:this.getAnchor(),floating:this.tooltipTarget,getPlacement:()=>this.placement,gap:dE}))}onDescribedPropsUpdated(){this.wireTrigger(),this.open&&this.tooltipTarget&&ln(this.getAnchor(),this.tooltipTarget,this.placement,dE)}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 aj("span",{class:"rui-tooltip",children:[xo("span",{class:"rui-tooltip__trigger",children:xo("slot",{})}),xo("span",{"data-ref":"tooltip",id:this.tooltipId,class:"rui-tooltip__content rui-floating",role:"tooltip",hidden:!0,children:this.$.content})]})}static{ZT()}};import{jsx as To,jsxs as cj}from"@ecopages/jsx/jsx-runtime";function dj({children:e,content:t="",...i}){return To("rui-tooltip",{content:t,...i,children:cj("span",{class:"rui-tooltip",children:[To("span",{class:"rui-tooltip__trigger",children:e}),To("span",{class:"rui-tooltip__content rui-floating","data-ref":"tooltip",role:"tooltip",hidden:!0,children:t})]})})}import{RadiantElement as SE,customElement as gj,event as bj,onEvent as TE,onUpdated as vj,prop as EE}from"@ecopages/radiant";var fE,mE,gE,bE,vE,yE,_E,xE;function hj(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:wE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||wE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:pj(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return mj(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function pj(e){var t=fj(e,"string");return typeof t=="symbol"?t:t+""}function fj(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 wE(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 mj(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 RE,AE=class extends SE{static{({e:[gE,bE,vE,yE,_E,xE,fE],c:[RE,mE]}=hj(this,[gj("rui-tree")],[[EE({type:String,defaultValue:""}),0,"label"],[EE({type:String,reflect:!0,defaultValue:""}),0,"value"],[bj({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[vj("value"),2,"onValueUpdated"],[TE({selector:'[role="treeitem"]',type:"click"}),2,"onClick"],[TE({selector:'[role="treeitem"]',type:"keydown"}),2,"onKeydown"]],0,void 0,SE))}label=(fE(this),gE(this));value=(bE(this),vE(this));changeEvent=(yE(this),_E(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,p)=>{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&&p===0&&(r=0)}),st(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=(xE(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 ut({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]&&Pe(r,l+i)}focusVisibleItem(t){let i=this.getVisibleItems(),r=i.indexOf(t);r>=0&&Pe(i,r)}static{mE()}};import{Fragment as IE,jsx as ne,jsxs as yj}from"@ecopages/jsx/jsx-runtime";var CE=({nodes:e})=>ne(IE,{children:e.map(t=>ne("li",{class:"rui-tree__item",children:t.children?.length?yj(IE,{children:[ne("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}),ne("ul",{role:"group",children:ne(CE,{nodes:t.children})})]}):ne("button",{type:"button",class:"rui-tree__node",role:"treeitem","data-value":t.id,"aria-selected":"false",tabindex:-1,children:t.label})}))});function _j({nodes:e,label:t,children:i,...r}){let l=e!=null?ne(CE,{nodes:e}):i;return ne("rui-tree",{...r,label:t,children:ne("ul",{class:"rui-tree","data-ref":"root",role:"tree","aria-label":t||void 0,"aria-multiselectable":"false",children:l})})}import{RadiantElement as FE,customElement as Ej,event as Aj,onEvent as UE,onUpdated as Rj,prop as zE}from"@ecopages/radiant";var DE,OE,kE,ME,VE,jE,LE,PE;function xj(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:BE(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||BE(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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:wj(w),b,b<2?[]:n?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return Tj(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function wj(e){var t=Sj(e,"string");return typeof t=="symbol"?t:t+""}function Sj(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 BE(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 Tj(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,qE=class extends FE{static{({e:[kE,ME,VE,jE,LE,PE,DE],c:[KE,OE]}=xj(this,[Ej("rui-treegrid")],[[zE({type:String,defaultValue:""}),0,"label"],[zE({type:String,reflect:!0,defaultValue:""}),0,"value"],[Aj({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[Rj("value"),2,"onValueUpdated"],[UE({selector:'[role="gridcell"]',type:"click"}),2,"onCellClick"],[UE({selector:'[role="gridcell"]',type:"keydown"}),2,"onCellKeydown"]],0,void 0,FE))}label=(DE(this),kE(this));value=(ME(this),VE(this));changeEvent=(jE(this),LE(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")??"",p=!!this.value&&l===this.value;for(let d of this.getRowCells(r))if(d.setAttribute("aria-selected",String(p)),p){let a=t.indexOf(d);a>=0&&(i=a)}}t.length>0&&st(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 p=this.getVisibleCells(),d=this.getRowCells(t),a=d[Math.min(Math.max(0,i),d.length-1)],E=p.indexOf(a);E>=0&&Pe(p,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),p=this.cellKeyHandlers[t.key];p&&(t.preventDefault(),p.call(this,l))}cellKeyHandlers=(PE(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{OE()}};import{Fragment as Eo,jsx as Jt,jsxs as $E}from"@ecopages/jsx/jsx-runtime";var WE=({rows:e})=>Jt(Eo,{children:e.map(t=>$E(Eo,{children:[Jt("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)=>Jt("div",{class:"rui-treegrid__cell",role:"gridcell",tabindex:-1,"data-col":r,"aria-selected":"false",children:i}))}),t.children?.length?Jt("div",{class:"rui-treegrid__group",role:"rowgroup",hidden:!(t.expanded??!1),children:Jt(WE,{rows:t.children})}):null]}))});function Ij({columns:e,rows:t,label:i,children:r,...l}){let p=e!=null&&t!=null?$E(Eo,{children:[Jt("div",{class:"rui-treegrid__row rui-treegrid__row--header",role:"row",children:e.map(d=>Jt("div",{class:"rui-treegrid__cell rui-treegrid__cell--header",role:"columnheader",children:d}))}),Jt(WE,{rows:t})]}):r;return Jt("rui-treegrid",{...l,label:i,children:Jt("div",{class:"rui-treegrid","data-ref":"root",role:"treegrid","aria-label":i||void 0,children:p})})}import{RadiantElement as sA,bound as lA,customElement as Mj,event as Vj,onEvent as uA,onUpdated as jj,prop as Ao,query as cA}from"@ecopages/radiant";var GE,HE,YE,NE,XE,QE,JE,ZE,tA,eA,iA,rA,nA,oA;function Cj(e,t,i,r,l,p){var d,a,E,R,S,D,A,K=Symbol.metadata||Symbol.for("Symbol.metadata"),$=Object.defineProperty,L=Object.create,W=[L(null),L(null)],G=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,N){function B(c){if(!N(c))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),X=g[3],U=!w,I=s===1,Q=s===3,J=s===4,k=s===2;function M(c,T,et){return function(j,it){return T&&(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:aA(function(){return X(this)},o,"get"),set:function(c){g[4](this,c)}}:u[x]=X,y||aA(u[x],o,k?"":x)):y||(u=Object.getOwnPropertyDescriptor(n,o)),!y&&!v){if((a=W[+m][o])&&(a^s)!==7)throw Error("Decorating two elements with the same name ("+u[x].name+") is not supported yet");W[+m][o]=s<3?1:s}}for(var h=n,V=F.length-1;V>=0;V-=f?2:1){var Z=_(F[V],"A decorator","be",!0),tt=f?F[V-1]:void 0,q={},C={kind:["field","accessor","method","getter","setter","class"][s],name:o,metadata:d,addInitializer:function(c,T){if(c.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(T,"An initializer","be",!0),b.push(T)}.bind(null,q)};if(U)a=Z.call(tt,h,C),q.v=1,_(a,"class decorators","return")&&(h=a);else if(C.static=m,C.private=v,a=C.access={has:v?N.bind():function(c){return o in c}},J||(a.get=v?k?function(c){return B(c),u.value}:M("get",0,B):function(c){return c[o]}),k||Q||(a.set=v?M("set",0,B):function(c,T){c[o]=T}),h=Z.call(tt,I?{get:u.get,set:u.set}:u[x],C),q.v=1,I){if(typeof h=="object"&&h)(a=_(h.get,"accessor.get"))&&(u.get=a),(a=_(h.set,"accessor.set"))&&(u.set=a),(a=_(h.init,"accessor.init"))&&z.unshift(a);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(h,(y?"field":"method")+" decorators","return")&&(y?z.unshift(h):u[x]=h)}return s<2&&w.push(O(z,m,1),O(b,m,0)),y||U||(v?I?w.splice(-1,0,M("get",m),M("set",m)):w.push(k?u[x]:_.call.bind(u[x])):$(n,o,u)),h}function Y(n){return $(n,K,{configurable:!0,enumerable:!0,value:d})}return p!==void 0&&(d=p[K]),d=L(d??null),S=[],D=function(n){n&&S.push(O(n))},A=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?R=R||[]:E=E||[],S,!!n,m,g,n&&m?function(y){return kj(y)===e}:l)}}},A(8,0),A(0,0),A(8,1),A(0,1),D(E),D(R),a=S,G||Y(e),{e:a,get c(){var n=[];return G&&[Y(e=H(e,[t],r,e.name,5,n)),O(n,1)]}}}function Dj(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 aA(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 hA,dA=class extends sA{static{({e:[YE,NE,XE,QE,JE,ZE,tA,eA,iA,rA,nA,oA,GE],c:[hA,HE]}=Cj(this,[Mj("rui-window-splitter")],[[Ao({type:Number,reflect:!0,defaultValue:50}),0,"value"],[Ao({type:String,defaultValue:"horizontal"}),0,"orientation"],[Ao({type:String,defaultValue:"Split view"}),0,"label"],[cA({ref:"primary"}),0,"primaryTarget"],[cA({ref:"separator"}),0,"separatorTarget"],[Vj({name:"rui-splitter-change",bubbles:!0,composed:!0}),0,"changeEvent"],[jj(["value","orientation","label"]),2,"onPropsUpdated"],[uA({ref:"separator",type:"keydown"}),2,"onKeydown"],[uA({ref:"separator",type:"pointerdown"}),2,"onPointerDown"],[lA,2,"onPointerMove"],[lA,2,"onPointerUp"]],0,void 0,sA))}value=(GE(this),YE(this));orientation=(NE(this),XE(this));label=(QE(this),JE(this));primaryTarget=(ZE(this),tA(this));separatorTarget=(eA(this),iA(this));changeEvent=(rA(this),nA(this));dragging=(oA(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{HE()}};import{jsx as Br,jsxs as Lj}from"@ecopages/jsx/jsx-runtime";function Pj({primary:e,secondary:t,orientation:i="horizontal",...r}){return Br("rui-window-splitter",{...r,orientation:i,children:Lj("div",{class:P("rui-window-splitter",i!=="vertical"?"rui-window-splitter--horizontal":"rui-window-splitter--vertical"),"data-ref":"root",children:[Br("div",{"data-ref":"primary",class:"rui-window-splitter__pane",children:e}),Br("div",{"data-ref":"separator",class:"rui-window-splitter__separator",role:"separator",tabindex:0}),Br("div",{"data-ref":"secondary",class:"rui-window-splitter__pane",children:t})]})})}export{Ui as DEFAULT_TOAST_POSITION,_i as FormStore,Pt as RUI_CONTROL_ATTR,Tn as RUI_DIALOG_ACTION_EVENT,ar as RUI_DIALOG_CLOSE_EVENT,ie as RUI_DIALOG_HOST_ID,or as RUI_DIALOG_OPEN_EVENT,sr as RUI_DIALOG_TOGGLE_EVENT,mr as RUI_FIELD_DESCRIPTION_ATTR,qe as RUI_FIELD_ERROR_ATTR,fr as RUI_FIELD_LABEL_ATTR,Cn as RUI_FIELD_MANAGED_ATTR,Pi as RUI_TOAST_DISMISS_EVENT,Li as RUI_TOAST_SHOW_EVENT,EA as RuiAlert,TA as RuiAlertDescription,qo as RuiAlertElement,wA as RuiAlertIcon,SA as RuiAlertTitle,zr as RuiAutocomplete,Fr as RuiAutocompleteCollection,ta as RuiAutocompleteElement,Ur as RuiAutocompleteEmpty,MA as RuiAutocompleteInput,LA as RuiAvatar,BA as RuiBadge,WA as RuiBreadcrumb,ca as RuiBreadcrumbElement,QA as RuiBreadcrumbEllipsis,HA as RuiBreadcrumbItem,YA as RuiBreadcrumbLink,GA as RuiBreadcrumbList,NA as RuiBreadcrumbPage,XA as RuiBreadcrumbSeparator,te as RuiButton,eR as RuiButtonGroup,oi as RuiCalendar,as as RuiCalendarElement,LR as RuiCarousel,Vs as RuiCarouselElement,Ps as RuiCarouselNext,Ls as RuiCarouselPrev,Bs as RuiCarouselRotation,js as RuiCarouselSlide,si as RuiCheckbox,Xi as RuiCheckboxElement,rI as RuiCheckboxGroup,wl as RuiCheckboxGroupControl,xl as RuiCheckboxGroupElement,oI as RuiChip,aI as RuiChipList,sI as RuiChipListItem,MI as RuiCombobox,xu as RuiComboboxControl,Xl as RuiComboboxElement,wu as RuiComboboxInput,Tu as RuiComboboxListbox,Su as RuiComboboxTrigger,$I as RuiCycleToggle,Ku as RuiCycleToggleButton,qu as RuiCycleToggleElement,KI as RuiCycleToggleItem,iC as RuiDateField,Fc as RuiDateFieldCalendar,jc as RuiDateFieldControl,Mc as RuiDateFieldElement,Lc as RuiDateFieldInput,Bc as RuiDateFieldPopover,Pc as RuiDateFieldToggle,dC as RuiDateRangePicker,Bd as RuiDateRangePickerCalendar,Od as RuiDateRangePickerControl,Dd as RuiDateRangePickerElement,Vd as RuiDateRangePickerEndInput,kd as RuiDateRangePickerInputs,Pd as RuiDateRangePickerPopover,jd as RuiDateRangePickerSeparator,Md as RuiDateRangePickerStartInput,Ld as RuiDateRangePickerToggle,xC as RuiDialog,hh as RuiDialogActions,dh as RuiDialogBody,ph as RuiDialogClose,sh as RuiDialogElement,ch as RuiDialogTitle,YC as RuiDisclosure,cr as RuiDisclosureElement,NC as RuiDisclosureGroup,$h as RuiDisclosureGroupElement,Hh as RuiDisclosureIcon,Nh as RuiDisclosurePanel,Yh as RuiDisclosureTrigger,XC as RuiFeed,QC as RuiFeedArticle,tD as RuiFeedArticleActions,ZC as RuiFeedArticleContent,JC as RuiFeedArticleHeader,eD as RuiFeedByline,iD as RuiFeedBylineBody,rD as RuiFeedMeta,ED as RuiField,RD as RuiFieldDescription,Op as RuiFieldElement,CD as RuiFieldError,qD as RuiForm,cf as RuiFormElement,XD as RuiGrid,yf as RuiGridElement,t1 as RuiHeading,r1 as RuiHeadingDescription,e1 as RuiHeadingEyebrow,i1 as RuiHeadingTitle,Un as RuiHeadline,m1 as RuiHoverCard,f1 as RuiHoverCardContent,Hf as RuiHoverCardElement,p1 as RuiHoverCardTrigger,b1 as RuiInput,v1 as RuiInputGroup,y1 as RuiInputGroupAddon,_1 as RuiInputGroupText,M1 as RuiKnob,Gm as RuiKnobElement,B1 as RuiLabel,Be as RuiListbox,vu as RuiListboxElement,pn as RuiListboxOption,Z1 as RuiMenuButton,gg as RuiMenuButtonContent,pg as RuiMenuButtonElement,vg as RuiMenuButtonItem,bg as RuiMenuButtonSubmenuContent,mg as RuiMenuButtonTrigger,lO as RuiMenubar,Ig as RuiMenubarElement,Cg as RuiMenubarMenu,Dg as RuiMenubarMenuItem,Og as RuiMenubarSubmenuContent,vO as RuiMeter,Hg as RuiMeterElement,RO as RuiNavigationMenu,EO as RuiNavigationMenuBar,eb as RuiNavigationMenuElement,CO as RuiNavigationMenuLink,DO as RuiNavigationMenuPanel,AO as RuiNavigationMenuPanels,IO as RuiNavigationMenuTrigger,UO as RuiNumberField,Qb as RuiNumberFieldDecrementButton,Wb as RuiNumberFieldElement,Hb as RuiNumberFieldGroup,Xb as RuiNumberFieldIncrementButton,Yb as RuiNumberFieldInput,Nb as RuiNumberFieldSteppers,NO as RuiPagination,mv as RuiPaginationElement,gv as RuiPaginationNav,ik as RuiPopover,ek as RuiPopoverContent,Qv as RuiPopoverElement,rk as RuiPopoverTrigger,Jv as RuiPopoverTriggerElement,by as RuiRadio,pk as RuiRadioGroup,gy as RuiRadioGroupControl,my as RuiRadioGroupElement,Ak as RuiSelect,zy as RuiSelectControl,Fy as RuiSelectElement,Wy as RuiSelectListbox,Sk as RuiSelectSearch,Ky as RuiSelectToggle,qy as RuiSelectTrigger,$y as RuiSelectValue,Ei as RuiSeparator,lM as RuiSidebar,Jk as RuiSidebarContent,Q_ as RuiSidebarElement,Zk as RuiSidebarFooter,eM as RuiSidebarGroup,iM as RuiSidebarGroupAction,rM as RuiSidebarGroupHeader,yx as RuiSidebarGroupLabel,Qk as RuiSidebarHeader,sM as RuiSidebarInset,nM as RuiSidebarMenu,aM as RuiSidebarMenuAction,_x as RuiSidebarMenuButton,oM as RuiSidebarMenuItem,Xk as RuiSidebarProvider,tM as RuiSidebarSeparator,cM as RuiSidebarTrigger,vx as RuiSidebarTriggerElement,yM as RuiSlider,A0 as RuiSliderElement,R0 as RuiSliderValue,xM as RuiSpinner,MM as RuiSwitch,K0 as RuiSwitchElement,iV as RuiTab,eV as RuiTabList,nV as RuiTabPanel,rV as RuiTabPanels,HM as RuiTable,UM as RuiTableBody,$M as RuiTableCell,qM as RuiTableColumn,fw as RuiTableElement,GM as RuiTableEmptyState,zM as RuiTableFooter,FM as RuiTableHeader,KM as RuiTableRow,WM as RuiTableSelectionCell,oV as RuiTabs,kw as RuiTabsElement,nS as RuiTag,fV as RuiTagGroup,eS as RuiTagGroupElement,rS as RuiTagList,oS as RuiTagRemove,gV as RuiTextarea,VV as RuiToast,LS as RuiToastElement,jV as RuiToaster,cT as RuiToasterElement,NV as RuiToc,BT as RuiTocElement,ej as RuiToolbar,XT as RuiToolbarElement,dj as RuiTooltip,pE as RuiTooltipElement,_j as RuiTree,RE as RuiTreeElement,Ij as RuiTreegrid,KE as RuiTreegridElement,Pj as RuiWindowSplitter,hA as RuiWindowSplitterElement,po as TOAST_COLLAPSED_PEEK,fo as TOAST_EXIT_MS,uo as TOAST_GAP,Bi as TOAST_LIFETIME,bV as TOAST_POSITIONS,Fi as TOAST_SWIPE_THRESHOLD,co as TOAST_VIEWPORT_OFFSET,ho as TOAST_VISIBLE_AMOUNT,lo as TOAST_WIDTH,Gu as ThemeItemLabel,Wu as ThemePreferenceIcon,GI as ThemePreferenceItemContent,OC as closeDialog,MC as createDialogHandle,Bn as createRulesResolver,P as cx,mn as cycleValue,BV as dismissToast,Ln as fieldContext,yi as findFieldControl,Ke as formContext,CC as getOpenDialogId,xh as installDialogs,vi as isNativeTextControl,DC as openDialog,Mn as readControlValue,Mp as runRulesResolver,PV as showToast,LV as toast,kC as toggleDialog,En as uninstallDialogs,nt as withDefaultAriaLabel,Vn 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