@webority/ui-elements 0.173.1 → 0.174.1

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 (165) hide show
  1. package/dist/{WuiCarousel-CFKmFVzc.js → WuiCarousel-B0yPDH5I.js} +1 -1
  2. package/dist/WuiCodeBlock-BJ14DaLH.js +1 -0
  3. package/dist/{WuiCommandPalette-BQCy0bon.js → WuiCommandPalette-u1XD5WMv.js} +2 -2
  4. package/dist/WuiCommentThread-ChTsQWet.js +1 -0
  5. package/dist/{WuiConsentBanner-DlAE3DTf.js → WuiConsentBanner-nTua-kEd.js} +1 -1
  6. package/dist/{WuiDataTable-B-JaTsrI.js → WuiDataTable-3Vd8EAMV.js} +1 -1
  7. package/dist/{WuiDatePicker-4tdWakGX.js → WuiDatePicker-CPr0Yni3.js} +1 -1
  8. package/dist/{WuiDateRange-D7LJuY2F.js → WuiDateRange-DvuE4wfG.js} +1 -1
  9. package/dist/{WuiDateTime-BSJfyZ0q.js → WuiDateTime-Vimu6grS.js} +1 -1
  10. package/dist/{WuiDrawer-D-XfW1kl.js → WuiDrawer-BsY0fs_u.js} +1 -1
  11. package/dist/WuiGantt-DJat5idS.js +1 -0
  12. package/dist/{WuiImageCrop-CIAjHOGk.js → WuiImageCrop-UakcSM2k.js} +1 -1
  13. package/dist/{WuiInlineEdit-C9FxCWCk.js → WuiInlineEdit-Bfe_m5px.js} +1 -1
  14. package/dist/{WuiLeadPopup-KyguGV-q.js → WuiLeadPopup-DaYZ2zCJ.js} +1 -1
  15. package/dist/{WuiLightbox-CBiqJmGE.js → WuiLightbox-CuzbFBck.js} +1 -1
  16. package/dist/WuiMentionInput-Dmtm3N62.js +1 -0
  17. package/dist/{WuiNotificationCenter-DZariS2K.js → WuiNotificationCenter-1Hw7W0st.js} +1 -1
  18. package/dist/{WuiOrgTree-CFxoY9Vr.js → WuiOrgTree-DYMNCGTh.js} +1 -1
  19. package/dist/{WuiOverflow-CXYk2ubC.js → WuiOverflow-fZKqdsr-.js} +1 -1
  20. package/dist/{WuiPhone-BI438y4S.js → WuiPhone-BEyz-J2q.js} +1 -1
  21. package/dist/{WuiRecordPager-DAyoD650.js → WuiRecordPager-BXoe4KfU.js} +1 -1
  22. package/dist/{WuiRelativeTime-CPzs4tjM.js → WuiRelativeTime-CSg9vzfk.js} +1 -1
  23. package/dist/{WuiSavedViews-BAqHgVj2.js → WuiSavedViews-OjB-ZiCo.js} +1 -1
  24. package/dist/WuiSelect-C_nfrNr5.js +1 -0
  25. package/dist/{WuiShortcuts-DWzmRKEG.js → WuiShortcuts-CRCctX82.js} +1 -1
  26. package/dist/{WuiShowMore-DyfGnrob.js → WuiShowMore-BoYCrYYf.js} +1 -1
  27. package/dist/{WuiSlider-LE2wquOo.js → WuiSlider-R_mTula0.js} +1 -1
  28. package/dist/{WuiSortable-DxwYjicc.js → WuiSortable-x8Mg0tOv.js} +1 -1
  29. package/dist/{WuiTimePicker-xrPYytjq.js → WuiTimePicker-Bcc1PfCT.js} +1 -1
  30. package/dist/{WuiTour-D-H5sMJS.js → WuiTour-C71Wmed-.js} +1 -1
  31. package/dist/WuiTree-BQk23SSF.js +1 -0
  32. package/dist/WuiTreePicker-DP1lCno3.js +1 -0
  33. package/dist/{WuiWizardStep-n8Ge5GDI.js → WuiWizardStep-Uag__kTu.js} +1 -1
  34. package/dist/buttonClass-C8BRtTk8.js +1 -0
  35. package/dist/{calendarMath-rI1aBVRd.js → calendarMath-CT99RyhR.js} +1 -1
  36. package/dist/chips-BaB5xZXq.js +2 -0
  37. package/dist/{country-B7jmc--B.js → country-T7AfpJpN.js} +1 -1
  38. package/dist/{customRule-BXJdj57A.js → customRule-BpwcjVLb.js} +1 -1
  39. package/dist/{dataTable-Bz6HxUx0.js → dataTable-VB3nBucm.js} +1 -1
  40. package/dist/drawerDiscard-DGmosZR2.js +1 -0
  41. package/dist/elements/carousel.js +1 -1
  42. package/dist/elements/code-block.js +1 -1
  43. package/dist/elements/command-palette.js +1 -1
  44. package/dist/elements/comment-thread.js +1 -1
  45. package/dist/elements/consent-banner.js +1 -1
  46. package/dist/elements/data-table.js +1 -1
  47. package/dist/elements/date-range.js +1 -1
  48. package/dist/elements/date-time.js +1 -1
  49. package/dist/elements/datepicker.js +1 -1
  50. package/dist/elements/drawer.js +1 -1
  51. package/dist/elements/filter-popover.js +1 -1
  52. package/dist/elements/gantt.js +1 -1
  53. package/dist/elements/image-crop.js +1 -1
  54. package/dist/elements/inline-edit.js +1 -1
  55. package/dist/elements/kanban.js +1 -1
  56. package/dist/elements/lead-popup.js +1 -1
  57. package/dist/elements/lightbox.js +1 -1
  58. package/dist/elements/mention-input.js +1 -1
  59. package/dist/elements/notification-center.js +1 -1
  60. package/dist/elements/org-tree.js +1 -1
  61. package/dist/elements/overflow.js +1 -1
  62. package/dist/elements/phone.js +1 -1
  63. package/dist/elements/record-pager.js +1 -1
  64. package/dist/elements/relative-time.js +1 -1
  65. package/dist/elements/saved-views.js +1 -1
  66. package/dist/elements/select.js +1 -1
  67. package/dist/elements/shortcuts.js +1 -1
  68. package/dist/elements/show-more.js +1 -1
  69. package/dist/elements/slider.js +1 -1
  70. package/dist/elements/sortable.js +1 -1
  71. package/dist/elements/timepicker.js +1 -1
  72. package/dist/elements/tour.js +1 -1
  73. package/dist/elements/tree-picker.js +1 -1
  74. package/dist/elements/tree.js +1 -1
  75. package/dist/elements/wizard.js +1 -1
  76. package/dist/fileViewer.g-DupSpQYS.js +1 -0
  77. package/dist/{fileViewerImage-ItX9j9U9.js → fileViewerImage-CCtdOYm3.js} +1 -1
  78. package/dist/{fileViewerMedia-BCqp2Z96.js → fileViewerMedia-Dbwn694I.js} +1 -1
  79. package/dist/{fileViewerPdf-aaI2R2nB.js → fileViewerPdf-Lu6vcnYW.js} +1 -1
  80. package/dist/{filterPopover-D7LGrhnO.js → filterPopover-DskHFNLi.js} +1 -1
  81. package/dist/{formatters-DikbTYA4.js → formatters-DTW53DjY.js} +1 -1
  82. package/dist/hasOwn-CJsplJ62.js +1 -0
  83. package/dist/helpers.js +1 -1
  84. package/dist/iconGlyphs.g-Dj8sa1HF.js +1 -0
  85. package/dist/{inlineEditText-C6g6qhye.js → inlineEditText-DRBhMnam.js} +1 -1
  86. package/dist/kanban-DlVHIpxL.js +1 -0
  87. package/dist/{kanbanModel-CuMgMnSc.js → kanbanModel-BzXK4SkM.js} +1 -1
  88. package/dist/{loader-B3lirubB.js → loader-C2hgZrCR.js} +1 -1
  89. package/dist/{notificationDays-grsj1DtM.js → notificationDays-wMr8rZko.js} +1 -1
  90. package/dist/{optionLabel-CmrOSHbD.js → optionLabel-CghX6DYo.js} +1 -1
  91. package/dist/{recents-BQ0fD7Y0.js → recents-B9efQ1Au.js} +1 -1
  92. package/dist/{relativeTime-vdCXtfKg.js → relativeTime-CNgauvqB.js} +1 -1
  93. package/dist/{search-DwboX91o.js → search-Cj1eEPIN.js} +1 -1
  94. package/dist/server.js +1 -1
  95. package/dist/{shortcutKeys-6iLc6oDR.js → shortcutKeys-BMTWgV2g.js} +1 -1
  96. package/dist/text.js +1 -1
  97. package/dist/textStore-DBplASiZ.js +1 -0
  98. package/dist/{themeTransition-D7HJ4A4m.js → themeTransition-CRnGw929.js} +1 -1
  99. package/dist/ui-calendar.global.js +1 -1
  100. package/dist/ui-calendar.js +1 -1
  101. package/dist/ui-chart.global.js +2 -2
  102. package/dist/ui-chart.js +2 -2
  103. package/dist/ui-consent-banner.global.js +1 -1
  104. package/dist/ui-elements/carousel.global.js +1 -1
  105. package/dist/ui-elements/code-block.global.js +1 -1
  106. package/dist/ui-elements/command-palette.global.js +2 -2
  107. package/dist/ui-elements/comment-thread.global.js +1 -1
  108. package/dist/ui-elements/consent-banner.global.js +1 -1
  109. package/dist/ui-elements/context-menu.global.js +1 -1
  110. package/dist/ui-elements/date-range.global.js +1 -1
  111. package/dist/ui-elements/date-time.global.js +1 -1
  112. package/dist/ui-elements/datepicker.global.js +1 -1
  113. package/dist/ui-elements/drawer.global.js +1 -1
  114. package/dist/ui-elements/dropdown.global.js +1 -1
  115. package/dist/ui-elements/entry-grid.global.js +1 -1
  116. package/dist/ui-elements/gantt.global.js +1 -1
  117. package/dist/ui-elements/glyphs.global.js +1 -1
  118. package/dist/ui-elements/image-crop.global.js +1 -1
  119. package/dist/ui-elements/inline-edit.global.js +1 -1
  120. package/dist/ui-elements/kanban.global.js +1 -1
  121. package/dist/ui-elements/lead-popup.global.js +1 -1
  122. package/dist/ui-elements/lightbox.global.js +1 -1
  123. package/dist/ui-elements/markdown.global.js +1 -1
  124. package/dist/ui-elements/org-tree.global.js +1 -1
  125. package/dist/ui-elements/phone.global.js +1 -1
  126. package/dist/ui-elements/popover.global.js +1 -1
  127. package/dist/ui-elements/saved-views.global.js +1 -1
  128. package/dist/ui-elements/select-chips.global.js +2 -2
  129. package/dist/ui-elements/select-recents.global.js +1 -1
  130. package/dist/ui-elements/select-search.global.js +1 -1
  131. package/dist/ui-elements/select-window.global.js +1 -1
  132. package/dist/ui-elements/slider.global.js +1 -1
  133. package/dist/ui-elements/sortable.global.js +1 -1
  134. package/dist/ui-elements/status-icon.global.js +1 -1
  135. package/dist/ui-elements/table-export.global.js +1 -1
  136. package/dist/ui-elements/timepicker.global.js +1 -1
  137. package/dist/ui-elements/tour.global.js +1 -1
  138. package/dist/ui-elements/tree-picker.global.js +1 -1
  139. package/dist/ui-elements/tree.global.js +1 -1
  140. package/dist/ui-elements/wizard.global.js +1 -1
  141. package/dist/ui-elements.global.js +1 -1
  142. package/dist/ui-elements.js +1 -1
  143. package/dist/ui-file-viewer.global.js +10 -10
  144. package/dist/ui-file-viewer.js +1 -1
  145. package/dist/ui-lead-popup.global.js +1 -1
  146. package/dist/ui-rich-text.global.js +51 -51
  147. package/dist/ui-rich-text.js +53 -53
  148. package/dist/ui-tour.global.js +1 -1
  149. package/package.json +5 -5
  150. package/types/global/shared.d.ts +2 -0
  151. package/types/hasOwn.d.ts +1 -0
  152. package/dist/WuiCodeBlock-fBc3Uwsw.js +0 -1
  153. package/dist/WuiCommentThread-B58UyYGD.js +0 -1
  154. package/dist/WuiGantt-XMvgsZsn.js +0 -1
  155. package/dist/WuiMentionInput-CktKQjQc.js +0 -1
  156. package/dist/WuiSelect-htggZB0v.js +0 -1
  157. package/dist/WuiTree-BnlK9fYL.js +0 -1
  158. package/dist/WuiTreePicker-Bx9nvRrC.js +0 -1
  159. package/dist/buttonClass-GtEi8hAY.js +0 -1
  160. package/dist/chips-DrTvHdbb.js +0 -2
  161. package/dist/drawerDiscard-B33Oc_Sv.js +0 -1
  162. package/dist/fileViewer.g-B6N9K2xi.js +0 -1
  163. package/dist/iconGlyphs.g-P04RJkSE.js +0 -1
  164. package/dist/kanban-CX6DyApZ.js +0 -1
  165. package/dist/textStore-opIEM4lu.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./devWarn-DXdRWZs3.js";import{t}from"./elementBase-Cxeyx0tU.js";import{n}from"./formMirror-9IpSgeZb.js";import{t as r}from"./hasOwn-CJsplJ62.js";import{n as i,t as a}from"./rtl-g7G8Bsib.js";import{a as o,r as s,t as c}from"./textStore-DBplASiZ.js";import{t as l}from"./treePicker.g-BR35ru5f.js";import{n as u}from"./buttonClass-C8BRtTk8.js";import{r as d}from"./dom-DMQu--xV.js";import{t as f}from"./iconGlyphs.g-Dj8sa1HF.js";var p={type:`none`},m={type:`open`},h=229;function g(e,t){switch(e.key){case`ArrowDown`:case`ArrowUp`:case`Enter`:case` `:return m;case`Backspace`:return t.searchEmpty&&t.mode===`multiple`?{type:`removeLastChip`}:p;default:return p}}function _(e,t){let n=t.row,r=n!==null&&!n.hasChildren,i=n!==null&&!n.disabled;switch(e.key){case`ArrowDown`:return{type:`move`,to:`next`};case`ArrowUp`:return{type:`move`,to:`prev`};case`Home`:return{type:`move`,to:`first`};case`End`:return{type:`move`,to:`last`};case`ArrowRight`:return n===null||!n.hasChildren?p:t.expanded?{type:`focusFirstChild`}:{type:`expand`};case`ArrowLeft`:return n?.hasChildren===!0&&t.expanded?{type:`collapse`}:t.hasParent?{type:`focusParent`}:p;case` `:return i?t.mode===`multiple`?{type:`toggle`}:r?{type:`choose`}:p:p;case`Enter`:return i?t.mode===`multiple`?{type:`toggle`}:r?{type:`choose`}:p:p;case`Escape`:return{type:`close`};default:{let t=e.ctrlKey!==!0&&e.metaKey!==!0&&e.altKey!==!0;return e.key.length===1&&t?{type:`typeahead`,char:e.key}:p}}}function v(e,t){return e.isComposing===!0||e.keyCode===h?p:t.open?_(e,t):g(e,t)}var y=/* @__PURE__ */ new WeakMap;function b(e){e.replaceChildren(),e.classList.add(`wui-tree-picker`);let t=d(`div`,{class:`search-wrap`},f(`search`,{size:18,className:`search-icon`})),n=d(`input`,{class:`input search-input wui-tree-picker-search`,type:`search`,"data-wui-action":`search`,autocomplete:`off`});t.append(n);let r=d(`ul`,{class:`wui-tree-picker-tree`,role:`tree`}),i=d(`p`,{class:`wui-tree-picker-nomatch`,role:`presentation`});i.hidden=!0;let a=d(`div`,{class:`wui-tree-picker-pane`});a.append(t,r,i);let o=d(`span`,{class:`wui-tree-picker-title`}),s=d(`span`,{class:`badge`}),c=d(`button`,{class:u(`neutral`,`ghost`,`sm`),type:`button`,"data-wui-action":`clear`}),l=d(`div`,{class:`wui-tree-picker-rail-head`}),p=d(`span`,{class:`d-inline-flex align-items-center gap-2`});p.append(o,s),l.append(p,c);let m=d(`div`,{class:`wui-tree-picker-rail-body`}),h=d(`div`,{class:`visually-hidden`,role:`status`,"aria-live":`polite`}),g=d(`div`,{class:`wui-tree-picker-rail`});g.append(l,m,h);let _=d(`div`,{class:`wui-tree-picker-surface`});return _.append(a,g),e.append(_),{surface:_,search:n,tree:r,noMatch:i,title:o,count:s,clear:c,body:m,status:h}}function x(e,t){let n=t.selection===`multiple`,r=/* @__PURE__ */ new Map,i=[];for(let e of t.rows){let a=t.checkOf(e),o=d(`li`,{class:`wui-tree-picker-item`,role:`treeitem`,tabindex:e.id===t.focusId?0:-1,"aria-level":e.level+1,"aria-labelledby":`${t.uid}-${e.index}`,"data-id":e.id}),s=t.expanded.has(e.id);e.hasChildren&&o.setAttribute(`aria-expanded`,String(s)),(e.disabled||t.disabled)&&o.setAttribute(`aria-disabled`,`true`),n?o.setAttribute(`aria-checked`,a===`mixed`?`mixed`:String(a===`checked`)):o.setAttribute(`aria-selected`,String(!e.hasChildren&&a===`checked`));let c=d(`div`,{class:`wui-tree-picker-row`,role:`presentation`});if(c.style.setProperty(`--wui-tree-picker-level`,String(e.level)),e.hasChildren){let t=d(`button`,{class:`wui-tree-picker-toggle`,type:`button`,tabindex:-1,"aria-hidden":`true`,"data-wui-action":`expand`,"data-id":e.id},f(`chevron-right`,{size:16}));c.append(t)}else c.append(d(`span`,{class:`wui-tree-picker-toggle`,"aria-hidden":`true`}));if(n){let n=d(`input`,{class:`form-check-input wui-tree-picker-check`,type:`checkbox`,tabindex:-1,"aria-hidden":`true`,"data-wui-action":`pick`,"data-id":e.id});n.checked=a===`checked`,n.indeterminate=a===`mixed`,n.disabled=e.disabled||t.disabled,c.append(n)}if(e.icon){let t=d(`span`,{class:`wui-tree-icon`,"aria-hidden":`true`},f(e.icon,{size:16}));c.append(t)}let l=d(`span`,{class:`wui-tree-picker-label`,id:`${t.uid}-${e.index}`,"data-wui-action":`pick`,"data-id":e.id});if(l.textContent=e.label,c.append(l),o.append(c),e.hasChildren&&s){let t=d(`ul`,{class:`wui-tree-picker-group`,role:`group`});o.append(t),r.set(e.id,t)}let u=e.parentId===null?void 0:r.get(e.parentId);u?u.append(o):i.push(o)}e.tree.replaceChildren(...i),n?e.tree.setAttribute(`aria-multiselectable`,`true`):e.tree.removeAttribute(`aria-multiselectable`)}function S(e,t){let n=d(`li`,{class:`wui-tree-picker-chosen-row`}),r=d(`span`,{class:`wui-tree-picker-chosen-label`});r.textContent=t.label;let i=d(`button`,{class:`btn btn-link btn-sm wui-tree-picker-remove`,type:`button`,"aria-label":c(e.text.removeLabel,{name:t.label}),"data-wui-action":`remove`,"data-id":t.id},f(`x`,{size:14}));return i.disabled=e.disabled,n.append(r,i),n}function C(e,t){let{text:n}=t;if(e.title.textContent=n.chosenTitle,e.count.textContent=String(t.chosen.length),e.clear.textContent=n.clearAllLabel,e.clear.disabled=t.disabled||t.chosen.length===0,t.chosen.length===0){let t=d(`div`,{class:`wui-tree-picker-empty`}),r=d(`div`,{class:`fw-semibold`});r.textContent=n.emptyTitle;let i=d(`div`,{class:`small text-body-secondary`});i.textContent=n.emptyText,t.append(r,i),e.body.replaceChildren(t);return}let r=/* @__PURE__ */ new Map;for(let e of t.chosen){let t=e.group??``,n=r.get(t)??{label:e.group,items:[]};n.items.push(e),r.set(t,n)}let i=[];for(let e of r.values()){let n=d(`div`,{class:`wui-tree-picker-chosen-group`});if(e.label!==null){let t=d(`div`,{class:`small text-body-secondary`});t.textContent=e.label,n.append(t)}let r=d(`ul`,{class:`list-unstyled m-0`});r.append(...e.items.map(e=>S(t,e))),n.append(r),i.push(n)}e.body.replaceChildren(...i)}function w(e){let t=document.activeElement;if(t===e.clear)return`clear`;if(!(t instanceof HTMLButtonElement))return null;let n=[...e.body.querySelectorAll(`[data-wui-action='remove']`)].indexOf(t);return n===-1?null:n}function T(e,t){if(t===null)return;let n=e.body.querySelectorAll(`[data-wui-action='remove']`),r=typeof t==`number`?n[Math.min(t,n.length-1)]:void 0;r?r.focus():e.search.focus()}function E(e,t){let n=y.get(e)??b(e);y.set(e,n);let{text:r}=t;n.surface.classList.toggle(`wui-tree-picker-invalid`,t.invalid),n.search.setAttribute(`aria-label`,r.searchLabel),n.search.placeholder=r.searchPlaceholder,n.search.disabled=t.disabled,n.search.value!==t.query&&(n.search.value=t.query),x(n,t);let i=t.query.trim()!==``;n.noMatch.hidden=!(i&&t.rows.length===0),n.noMatch.textContent=n.noMatch.hidden?``:c(r.noMatchText,{query:t.query.trim()});let a=w(n);C(n,t),T(n,a),n.status.textContent=t.status}var D=e=>(e.children?.length??0)>0,O=e=>!D(e)&&e.hasChildren!==!0;function k(e,t,n){let r=[];for(let i of e){if(t.has(i.id))throw Error(`Duplicate tree node id "${i.id}".`);t.add(i.id);let e=O(i)?i.disabled===!0?[]:[i.id]:k(i.children??[],t,n);n.set(i.id,e),r.push(...e)}return r}function A(e,t,n){let r=[],i=(e,a,o)=>{for(let s of e)r.push({id:s.id,label:s.label,icon:s.icon||null,parentId:a,level:o,index:r.length,hasChildren:D(s)||s.hasChildren===!0,disabled:s.disabled===!0,leafIds:t.get(s.id)??[]}),D(s)&&n(s.id)&&i(s.children??[],s.id,o+1)};return i(e,null,0),{rows:r,byId:new Map(r.map(e=>[e.id,e]))}}function j(e){let t=/* @__PURE__ */ new Map;return k(e,/* @__PURE__ */ new Set,t),{leavesById:t}}function M(e,t){let{leavesById:n}=j(e);return A(e,n,e=>t.has(e))}function N(e){let{leavesById:t}=j(e);return A(e,t,()=>!0)}function P(e,t){if(e.leafIds.length===0)return`unchecked`;let n=0;for(let r of e.leafIds)t.has(r)&&(n+=1);return n===0?`unchecked`:n===e.leafIds.length?`checked`:`mixed`}function F(e,t){let n=e.byId.get(t);if(n===void 0)throw Error(`Unknown tree node id "${t}".`);return n}function I(e,t,n,r){let i=F(N(e),r),a=[...n];if(t===`single`)return i.hasChildren||i.disabled?a:[r];if(!i.hasChildren)return i.disabled?a:a.includes(r)?a.filter(e=>e!==r):[...a,r];if(i.leafIds.length===0)return a;if(P(i,new Set(a))===`checked`){let e=new Set(i.leafIds);return a.filter(t=>!e.has(t))}let o=new Set(a);return[...a,...i.leafIds.filter(e=>!o.has(e))]}function L(e,t){let n=[],r=/* @__PURE__ */ new Set;for(let i of t){let t=e.byId.get(i);t===void 0||t.hasChildren||r.has(i)||(r.add(i),n.push(t))}return n}function R(e,t){return L(N(e),t).map(e=>e.id)}function z(){return[]}function B(e,t){return e.filter(e=>e!==t)}function V(e,t){return e===`single`?t[0]??``:[...t]}function H(e,t){let n=t.trim().toLowerCase();if(n===``)return{nodes:[...e],expanded:/* @__PURE__ */ new Set};let r=/* @__PURE__ */ new Set,i=e=>{if(D(e)){r.add(e.id);for(let t of e.children??[])i(t)}},a=e=>{if(e.label.toLowerCase().includes(n))return i(e),e;let t=(e.children??[]).flatMap(e=>{let t=a(e);return t===null?[]:[t]});return t.length===0?null:(r.add(e.id),{...e,children:t})};return{nodes:e.flatMap(e=>{let t=a(e);return t===null?[]:[t]}),expanded:r}}var U=[`nodes`,`values`,`selection`,`name`],W={chosenTitle:`chosen-title`,clearAllLabel:`clear-all-label`,emptyTitle:`empty-title`,emptyText:`empty-text`,noMatchText:`no-match-text`,removeLabel:`remove-label`,searchLabel:`search-label`,searchPlaceholder:`search-placeholder`,selectedText:`selected-text`},G=600,K=0;function q(e){return Array.isArray(e)}var J=class extends t{_uid;_nodes;_hasNodes;_valuesSet;_pending;_values;_expanded;_query;_focusId;_rows;_ready;_typed;_unsubscribe;_onClick;_onInput;_onKeyDown;_onFocusIn;static get observedAttributes(){return[`selection`,`name`,`disabled`,`invalid`,`aria-label`,`aria-labelledby`,...Object.values(W)]}constructor(){super(),this._uid=`wui-tree-picker-${++K}`,this._nodes=[],this._hasNodes=!1,this._valuesSet=!1,this._pending=null,this._values=[],this._expanded=/* @__PURE__ */ new Set,this._query=``,this._focusId=null,this._rows=[],this._ready=!1,this._typed={text:``,at:0},this._unsubscribe=null,this._onClick=e=>this._handleClick(e),this._onInput=e=>this._handleInput(e),this._onKeyDown=e=>this._handleKeyDown(e),this._onFocusIn=e=>{let t=this._rowIdFrom(e.target);t!==null&&t!==this._focusId&&this._setRoving(t)}}connectedCallback(){let e=/* @__PURE__ */ new Map;for(let t of U)r(this,t)&&(e.set(t,Reflect.get(this,t)),Reflect.deleteProperty(this,t));if(!this._ready){this._ready=!0;let e=this._readScript();e&&this._adopt(e)}for(let[t,n]of e)Reflect.set(this,t,n);!this._valuesSet&&this._pending===null&&this.hasAttribute(`values`)&&(this._pending=this._readValuesAttribute(),this._hasNodes&&this._adopt(this._nodes)),this.addEventListener(`click`,this._onClick),this.addEventListener(`input`,this._onInput),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusin`,this._onFocusIn),this._unsubscribe=o(()=>this._render()),this._render(),this._syncForm()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this.removeEventListener(`input`,this._onInput),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusin`,this._onFocusIn),this._unsubscribe?.(),this._unsubscribe=null}attributeChangedCallback(e){e===`selection`&&this._normalise(),this._ready&&this.isConnected&&(this._render(),(e===`selection`||e===`name`)&&this._syncForm())}get nodes(){return[...this._nodes]}set nodes(e){this._adopt(e??[]),this._ready&&this.isConnected&&(this._render(),this._syncForm())}get values(){return[...this._values]}set values(e){this._valuesSet=!0,this._pending=null,this._values=(e??[]).map(String),this._normalise(),this._ready&&this.isConnected&&(this._render(),this._syncForm())}get selection(){return this.getAttribute(`selection`)===`single`?`single`:`multiple`}set selection(e){this.setAttribute(`selection`,String(e))}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,String(e))}_readScript(){let t=this.querySelector(`:scope > script[type='application/json']`);if(!t)return null;try{let n=JSON.parse(t.textContent??``);return q(n)?n:(e(`[@webority/ui-elements] <wui-tree-picker> JSON nodes must be an array.`),null)}catch(t){return e(`[@webority/ui-elements] <wui-tree-picker> could not read its JSON nodes:`,t instanceof Error?t.message:void 0),null}}_adopt(e){if(!q(e))throw Error(`<wui-tree-picker> nodes must be an array.`);let t=N(e),n=this._pending!==null&&!this._valuesSet?this._checkInitial(t.byId,this._pending):null;this._nodes=e,this._hasNodes=!0,n!==null&&(this._values=n,this._pending=null),this._normalise();let r=new Set(N(e).rows.map(e=>e.id));for(let e of[...this._expanded])r.has(e)||this._expanded.delete(e);this._focusId!==null&&!r.has(this._focusId)&&(this._focusId=null)}_readValuesAttribute(){let e=this.getAttribute(`values`)??``,t;try{t=JSON.parse(e)}catch{throw Error(`<wui-tree-picker> values must be a JSON array of leaf ids, got ${e}.`)}if(!Array.isArray(t)||!t.every(e=>typeof e==`string`))throw Error(`<wui-tree-picker> values must be a JSON array of leaf ids, got ${e}.`);if(this.selection===`single`&&t.length>1)throw Error(`<wui-tree-picker> single selection takes one value, got ${t.length}.`);return t}_checkInitial(e,t){for(let n of t){let t=e.get(n);if(t===void 0||t.hasChildren)throw Error(`<wui-tree-picker> values id "${n}" is not a leaf of the tree.`)}return[...new Set(t)]}_normalise(){if(!this._hasNodes)return;let e=R(this._nodes,this._values);this._values=this.selection===`single`?e.slice(0,1):e}_text(){let e=s(`treePicker`,l),t=t=>this.getAttribute(W[t])??e[t];return{chosenTitle:t(`chosenTitle`),clearAllLabel:t(`clearAllLabel`),emptyTitle:t(`emptyTitle`),emptyText:t(`emptyText`),noMatchText:t(`noMatchText`),removeLabel:t(`removeLabel`),searchLabel:t(`searchLabel`),searchPlaceholder:t(`searchPlaceholder`),selectedText:t(`selectedText`)}}_visible(){let e=H(this._nodes,this._query),t=new Set(this._expanded);for(let n of e.expanded)t.add(n);return M(e.nodes,t).rows}_isOpen(e){return this._expanded.has(e)?!0:this._query.trim()!==``&&H(this._nodes,this._query).expanded.has(e)}_render(){if(!this._ready)return;let e=document.activeElement,t=e instanceof HTMLElement&&this.contains(e)&&e.getAttribute(`role`)===`treeitem`,n=H(this._nodes,this._query),r=new Set(this._expanded);for(let e of n.expanded)r.add(e);let i=M(n.nodes,r).rows;this._rows=i,i.some(e=>e.id===this._focusId)||(this._focusId=i[0]?.id??null);let a=new Set(this._values),o=new Map(N(this._nodes).rows.map(e=>[e.id,e])),s=this._values.flatMap(e=>{let t=o.get(e);if(t===void 0)return[];let n=t.parentId===null?void 0:o.get(t.parentId);return[{id:e,label:t.label,group:n?.label??null}]}),l=this._text();E(this,{rows:i,checkOf:e=>P(o.get(e.id)??e,a),focusId:this._focusId,expanded:r,query:this._query,chosen:s,selection:this.selection,disabled:this.hasAttribute(`disabled`),invalid:this.hasAttribute(`invalid`),status:c(l.selectedText,{n:s.length}),text:l,uid:this._uid});let u=this.querySelector(`[role='tree']`),d=this.getAttribute(`aria-label`),f=d?null:this.getAttribute(`aria-labelledby`);d?u?.setAttribute(`aria-label`,d):u?.removeAttribute(`aria-label`),f?u?.setAttribute(`aria-labelledby`,f):u?.removeAttribute(`aria-labelledby`),t&&this._focusRow(this._focusId)}_syncForm(){n(this,this._values)}_emit(){this.dispatchEvent(new CustomEvent(`wui-tree-picker:change`,{detail:{values:[...this._values],value:V(this.selection,this._values)},bubbles:!0,composed:!0}))}_commit(e){let t=R(this._nodes,e);t.length===this._values.length&&t.every((e,t)=>e===this._values[t])||(this._values=t,this._render(),this._syncForm(),this._emit())}_rowItems(){return[...this.querySelectorAll(`[role='treeitem']`)]}_rowEl(e){return e===null?void 0:this._rowItems().find(t=>t.dataset.id===e)}_rowIdFrom(e){return!(e instanceof HTMLElement)||e.getAttribute(`role`)!==`treeitem`?null:e.dataset.id??null}_setRoving(e){let t=this._rowEl(this._focusId);t&&(t.tabIndex=-1),this._focusId=e;let n=this._rowEl(e);n&&(n.tabIndex=0)}_focusRow(e){e!==null&&(this._setRoving(e),this._rowEl(e)?.focus())}_pick(e){let t=this._rows.find(t=>t.id===e);t!==void 0&&(this._setRoving(e),this.selection===`single`&&t.hasChildren?this._toggleOpen(e):(this._commit(I(this._nodes,this.selection,this._values,e)),this._focusRow(e)))}_toggleOpen(e){this._expanded.has(e)?this._expanded.delete(e):this._expanded.add(e),this._render()}_handleClick(e){if(this.hasAttribute(`disabled`))return;let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-wui-action]`);if(!n||!this.contains(n))return;let r=n.dataset.id??``;switch(n.dataset.wuiAction){case`expand`:this._setRoving(r),this._toggleOpen(r),this._focusRow(r);break;case`pick`:this._pick(r);break;case`remove`:n.focus(),this._commit(B(this._values,r));break;case`clear`:n.focus(),this._commit(z())}}_handleInput(e){if(this.hasAttribute(`disabled`))return;let t=e.target;t instanceof HTMLInputElement&&t.dataset.wuiAction===`search`&&(this._query=t.value,this._render())}_handleKeyDown(e){if(this.hasAttribute(`disabled`))return;let t=e.target;if(!(t instanceof HTMLElement))return;let n={key:i(e.key,a(this)),shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,isComposing:e.isComposing,keyCode:e.keyCode};if(t instanceof HTMLInputElement&&t.dataset.wuiAction===`search`){this._searchKey(e,n);return}let r=this._rowIdFrom(t);if(r===null)return;let o=this._rows.find(e=>e.id===r);if(o===void 0)return;let s=v(n,{mode:this.selection,open:!0,searchEmpty:this._query===``,row:o,expanded:o.hasChildren&&this._isOpen(r),hasParent:o.parentId!==null});if(s.type!==`none`&&s.type!==`open`&&s.type!==`close`)switch(e.preventDefault(),s.type){case`move`:this._move(o,s.to);break;case`expand`:this._expanded.add(r),this._render();break;case`collapse`:this._expanded.delete(r),this._render();break;case`focusParent`:this._focusRow(o.parentId);break;case`focusFirstChild`:{let e=this._rows[o.index+1];e?.parentId===r&&this._focusRow(e.id);break}case`toggle`:case`choose`:this._pick(r);break;case`removeLastChip`:{let e=this._values[this._values.length-1];e!==void 0&&this._commit(B(this._values,e));break}case`typeahead`:this._typeahead(o,s.char)}}_searchKey(e,t){let n=v(t,{mode:this.selection,open:!1,searchEmpty:this._query===``,row:null,expanded:!1,hasParent:!1});if(n.type===`removeLastChip`){let t=this._values[this._values.length-1];if(t===void 0)return;e.preventDefault(),this._commit(B(this._values,t))}else n.type===`open`&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),this._focusRow(this._focusId??this._rows[0]?.id??null))}_move(e,t){let n=this._rows,r=t===`first`?n[0]:t===`last`?n[n.length-1]:n[e.index+(t===`next`?1:-1)];r&&this._focusRow(r.id)}_typeahead(e,t){let n=Date.now(),r=n-this._typed.at>G?t:this._typed.text+t;this._typed={text:r,at:n};let i=r.toLowerCase(),a=this._rows,o=r.length===1?e.index+1:e.index;for(let e=0;e<a.length;e++){let t=a[(o+e)%a.length];if(t?.label.toLowerCase().startsWith(i)){this._focusRow(t.id);return}}}};export{J as t};
@@ -1 +1 @@
1
- import{t as e}from"./elementBase-Cxeyx0tU.js";import{r as t}from"./dom-DMQu--xV.js";import{r as n,t as r}from"./textStore-opIEM4lu.js";import{n as i}from"./devWarn-DXdRWZs3.js";import{n as a,t as o}from"./buttonClass-GtEi8hAY.js";import{t as s}from"./iconGlyphs.g-P04RJkSE.js";import{n as c}from"./stepperHeader-yinJ_7Dk.js";import{t as l}from"./wizard.g-DOZSBUc5.js";var u=()=>n(`wizard`,l),d=`wui-wizard-step`,f=`:scope > [data-wui-glyphs]`,p=()=>({done:u().doneLabel,active:u().activeLabel,pending:u().pendingLabel,error:u().errorLabel,skipped:u().skippedLabel}),m=[`data-nav`,`data-step`,`data-close`],h=/* @__PURE__ */ new WeakSet,g=class extends e{_active;_skipped;_invalid;_finished;_rendered;_reflecting;_beforeNext;_header;_footer;_chromeInserted;_topBar;_onTopBarClick;_onHeaderClick;_onFooterClick;_known;_observer;_glyphs;_glyphObserver;static get observedAttributes(){return[`active`,`variant`,`orientation`,`align`,`icon-size`,`non-linear`,`hide-stepper`,`hide-connectors`,`disabled`,`skippable`,`label`,`back-label`,`next-label`,`skip-label`,`finish-label`,`top-bar`,`bar-title`,`close-label`]}constructor(){super(),this._active=0,this._skipped=/* @__PURE__ */ new Set,this._invalid=/* @__PURE__ */ new Set,this._finished=!1,this._rendered=!1,this._reflecting=!1,this._beforeNext=null,this._header=document.createElement(`nav`),this._header.className=`stepper wizard-stepper`,this._footer=document.createElement(`div`),this._footer.className=`form-actions wizard-footer form-actions-between`,this._chromeInserted=!1,this._topBar=null,this._onTopBarClick=e=>{let t=e.target;t instanceof Element&&t.closest(`[data-close]`)&&this.dispatchEvent(new CustomEvent(`wui-wizard:close`,{detail:{index:this._active},bubbles:!0}))},this._known=[],this._observer=null,this._glyphs=null,this._glyphObserver=null}get active(){return this._active}set active(e){let t=Number.parseInt(String(e),10);Number.isFinite(t)&&this._go(t,`set`)}get beforeNext(){return this._beforeNext}set beforeNext(e){this._beforeNext=typeof e==`function`?e:null}get _steps(){return[...this.querySelectorAll(`:scope > ${d}`)].filter(e=>e instanceof HTMLElement)}refresh(){this._rendered&&this._renderChrome()}connectedCallback(){if(this._rendered)this._wire(),this._onStepsMutated();else{let e=Number.parseInt(this.getAttribute(`active`)??``,10);this._active=Number.isFinite(e)&&e>=0?e:0,this.render()}}disconnectedCallback(){this._teardown()}attributeChangedCallback(e,t,n){if(this._rendered&&!this._reflecting){if(e===`active`){let e=Number.parseInt(n??``,10);Number.isFinite(e)&&this._go(e,`set`)}else this._renderChrome()}}render(){let e=this._steps;if(!this._chromeInserted){let t=e[0],n=e[e.length-1];t&&n?(this.insertBefore(this._header,t),n.after(this._footer)):(this.prepend(this._header),this.append(this._footer)),this._chromeInserted=!0}this._known=e,this._renderChrome(),this._rendered=!0,this._wire()}_renderChrome(){let e=this._reconcileSteps();this._placeChrome(e),this._clampActive(e),this._syncPanels(e);let t=this._focusedControl();this._syncTopBar(e),this._header.replaceChildren(...this._headerNodes(e)),this._footer.replaceChildren(...this._footerNodes(e)),this._header.hidden=this.hasAttribute(`hide-stepper`),this._restoreFocus(t)}_focusedControl(){let e=document.activeElement;if(!e||![this._topBar,this._header,this._footer].some(t=>t?.contains(e)))return null;let t=m.find(t=>e.hasAttribute(t));return t?{attr:t,value:e.getAttribute(t)}:null}_restoreFocus(e){if(e)for(let t of[this._topBar,this._header,this._footer]){let n=t&&[...t.querySelectorAll(`[${e.attr}]`)].find(t=>t.getAttribute(e.attr)===e.value);if(n){n instanceof HTMLElement&&!(n instanceof HTMLButtonElement&&n.disabled)&&n.focus({preventScroll:!0});return}}}_syncTopBar(e){if(!this.hasAttribute(`top-bar`)){this._topBar?.removeEventListener(`click`,this._onTopBarClick),this._topBar?.remove(),this._topBar=null;return}this._topBar||(this._topBar=document.createElement(`div`),this._topBar.className=`wui-wizard-topbar`,this._rendered&&this._topBar.addEventListener(`click`,this._onTopBarClick)),this._header.previousElementSibling!==this._topBar&&this.insertBefore(this._topBar,this._header);let n=this.getAttribute(`bar-title`)||``,i=this.getAttribute(`close-label`)||u().closeLabel,a=e.length?[t(`span`,{class:`wui-wizard-topbar-count`},r(u().stepOfText,{position:this._active+1,total:e.length}))]:[];this._topBar.replaceChildren(t(`span`,{class:`wui-wizard-topbar-title`},n||null),...a,t(`button`,{type:`button`,class:`wui-wizard-topbar-close`,"data-close":!0,"aria-label":i},this._glyph(`x`)))}_clampActive(e){let t=Math.max(0,e.length-1);this._active>t&&(this._active=t),this._active<0&&(this._active=0)}_reconcileSteps(){let e=this._steps,t=this._known;if(this._known=e,v(e,t))return e;let n=n=>new Set([...n].map(n=>{let r=t[n];return r?e.indexOf(r):-1}).filter(e=>e>=0));this._skipped=n(this._skipped),this._invalid=n(this._invalid);let r=t[this._active];if(!r)return e;let i=e.indexOf(r);if(i<0){let n=t=>e.includes(t),r=t.slice(this._active+1).find(n)??t.slice(0,this._active).reverse().find(n);i=r?e.indexOf(r):this._active}return i=Math.min(i,Math.max(0,e.length-1)),i!==this._active&&(this._active=i,this._reflectActive(i)),e}_placeChrome(e){let t=e[0],n=e[e.length-1];t&&n&&(this._header.nextElementSibling!==t&&this.insertBefore(this._header,t),this._footer.previousElementSibling!==n&&n.after(this._footer))}_onStepsMutated(){if(!this._rendered)return;let e=this._steps,t=!e.length||this._header.nextElementSibling===e[0]&&this._footer.previousElementSibling===e[e.length-1];this.querySelector(f)!==this._glyphs&&(this._watchGlyphs(),this._renderHeader()),t&&v(e,this._known)||(this._renderChrome(),this._observer?.takeRecords())}_syncPanels(e){e.forEach((e,t)=>{let n=t===this._active;e.classList.add(`wizard-panel`),e.hidden=!n,e.setAttribute(`role`,`tabpanel`),e.setAttribute(`aria-hidden`,n?`false`:`true`)})}_stepStatus(e,t){let n=e?.getAttribute(`status`);if(n){if(!_(n))throw Error(`wui-wizard: status "${n}" is not one of pending, active, done, error, skipped.`);return n}return this._invalid.has(t)?`error`:this._finished?`done`:t===this._active?`active`:t<this._active?this._skipped.has(t)?`skipped`:`done`:`pending`}_headerNodes(e){let n=this.getAttribute(`variant`)===`journey`,a=this.getAttribute(`variant`)===`icons`,o=this.getAttribute(`variant`)===`tiles`,s=this.getAttribute(`orientation`)===`vertical`,l=!this.hasAttribute(`hide-connectors`),d=this.getAttribute(`align`)===`start`;this._header.className=[`stepper`,`wizard-stepper`,n&&`stepper-journey`,a&&`stepper-icons`,o&&`wui-step-tiles`,s&&`stepper-vertical`,!l&&`wui-stepper-no-connectors`,d&&`wui-stepper-start`].filter(Boolean).join(` `),this._header.setAttribute(`aria-label`,this.getAttribute(`label`)||u().label);let f=this.hasAttribute(`non-linear`);for(let t of e)t.getAttribute(`label`)||h.has(t)||(h.add(t),i(`wui-wizard: a <wui-wizard-step> needs a label attribute; its header segment is empty.`));let m=c(e.map(e=>({label:e.getAttribute(`label`)||``,icon:e.getAttribute(`icon`)||void 0})),{statusOf:t=>this._stepStatus(e[t],t),journey:n,connectors:l}),g=p(),_=m.flatMap(i=>{let s=i.index,c=e[s];if(!c)return[];let l=i.status,d=c.getAttribute(`label`)||null,p=c.getAttribute(`description`)||``,m=s+1,h=`icon`in i.glyph?this._glyph(i.glyph.icon):i.glyph.number,_=i.className,v=i.current?`step`:void 0,y=f||s<this._active;if(o){let e=[t(`span`,{class:`step-circle`},h),t(`span`,{class:`step-text`},t(`span`,{class:`step-label`},d),t(`span`,{class:`wui-step-tile-state`},g[l]??null))],n=y?t(`button`,{type:`button`,class:`wui-step-tile-body`,"data-step":s,"aria-current":v},...e):t(`div`,{class:`wui-step-tile-body`,"aria-current":v},...e);return[t(`li`,{class:l===`pending`?`wui-step-tile`:`wui-step-tile ${l}`},n)]}let b=p?[t(`span`,{class:`step-desc`},p)]:[],x;x=n?[t(`span`,{class:`step-circle`},h),t(`span`,{class:`step-text`},t(`span`,{class:`step-index`},r(u().stepText,{position:m})),t(`span`,{class:`step-label`},d),...b)]:a?[t(`span`,{class:`step-circle`},h),t(`span`,{class:`step-index`},r(u().stepText,{position:m})),t(`span`,{class:`step-label`},d),...b]:[t(`span`,{class:`step-circle`},h),t(`span`,{class:`step-label`},d),...b];let S=y?t(`button`,{type:`button`,class:_,"data-step":s,"aria-current":v},...x):t(`div`,{class:_,"aria-current":v},...x);return i.line?[S,t(`span`,{class:`step-line${i.line.done?` done`:``}`,"aria-hidden":`true`})]:[S]});return o?[t(`ol`,null,..._)]:_}_footerNodes(e){let n=this._active,r=e.length-1,i=this.hasAttribute(`disabled`),c=e[n]?.hasAttribute(`optional`)||this.hasAttribute(`skippable`),l=this.getAttribute(`back-label`)||u().backLabel,d=this.getAttribute(`next-label`)||u().nextLabel,f=this.getAttribute(`skip-label`)||u().skipLabel,p=this.getAttribute(`finish-label`)||u().finishLabel,m=n>0?t(`button`,{type:`button`,class:a(`primary`,`soft`,`md`),"data-nav":`back`,disabled:i,"data-wui":o},s(`arrow-left`,{className:`me-2`}),l):t(`span`),h=c&&n<r?t(`button`,{type:`button`,class:a(`neutral`,`soft`,`md`),"data-nav":`skip`,disabled:i,"data-wui":o},f):null,g=n<r?t(`button`,{type:`button`,class:a(`primary`,`solid`,`md`),"data-nav":`next`,disabled:i,"data-wui":o},d,s(`arrow-right`,{className:`ms-2`})):t(`button`,{type:`button`,class:a(`primary`,`solid`,`md`),"data-nav":`finish`,disabled:i,"data-wui":o},p);return[m,t(`span`,{class:`wizard-footer-actions`},h,g)]}_wire(){this._teardown(),this._onHeaderClick=e=>{let t=e.target instanceof Element?e.target.closest(`[data-step]`):null;t instanceof HTMLElement&&this.contains(t)&&this._stepTo(Number.parseInt(t.dataset.step??``,10))},this._onFooterClick=e=>{let t=e.target instanceof Element?e.target.closest(`[data-nav]`):null;if(!(t instanceof HTMLElement)||!this.contains(t)||this.hasAttribute(`disabled`))return;let n=t.dataset.nav;n===`back`?this._back():n===`skip`?this._skip():(n===`next`||n===`finish`)&&this._next()},this._header.addEventListener(`click`,this._onHeaderClick),this._footer.addEventListener(`click`,this._onFooterClick),this._topBar?.addEventListener(`click`,this._onTopBarClick),this._observer=new MutationObserver(()=>this._onStepsMutated()),this._observer.observe(this,{childList:!0}),this._watchGlyphs()}_glyph(e){let t=this.querySelector(f),n=t&&[...t.children].find(t=>t.getAttribute(`data-icon`)===e);if(n)return n.cloneNode(!0);let r=Number.parseInt(this.getAttribute(`icon-size`)??``,10);return s(e,r>0?{size:r}:void 0)}_watchGlyphs(){this._glyphObserver?.disconnect(),this._glyphObserver=null,this._glyphs=this.querySelector(f),this._glyphs&&(this._glyphObserver=new MutationObserver(()=>this._renderHeader()),this._glyphObserver.observe(this._glyphs,{childList:!0,subtree:!0,attributes:!0,characterData:!0}))}_renderHeader(){if(!this._rendered)return;let e=this._focusedControl();this._header.replaceChildren(...this._headerNodes(this._steps)),this._restoreFocus(e)}_teardown(){this._header&&this._onHeaderClick&&this._header.removeEventListener(`click`,this._onHeaderClick),this._footer&&this._onFooterClick&&this._footer.removeEventListener(`click`,this._onFooterClick),this._topBar?.removeEventListener(`click`,this._onTopBarClick),this._observer?.disconnect(),this._observer=null,this._glyphObserver?.disconnect(),this._glyphObserver=null}_stepTo(e){this.hasAttribute(`disabled`)||!this.hasAttribute(`non-linear`)&&e>=this._active||this._go(e,`step`)}_back(){this._active>0&&this._go(this._active-1,`back`)}async _next(){this._reconcileSteps();let e=this._active,t=this._steps,n=e>=t.length-1,r=t[e];if(!this.dispatchEvent(new CustomEvent(`wui-wizard:beforechange`,{detail:n?{index:e,next:e,reason:`finish`}:{index:e,next:e+1,reason:`next`},cancelable:!0})))return this._flagInvalid(e);if(this._beforeNext){let i;try{i=await this._beforeNext(e)}catch{i=!1}if(this._reconcileSteps(),t=this._steps,e=r?t.indexOf(r):-1,e<0)return;if(n=e>=t.length-1,i===!1)return this._flagInvalid(e)}if(this._invalid.delete(e),this._skipped.delete(e),n)return this._finish();this._go(e+1,`next`)}_skip(){let e=this._active,t=this._steps;(t[e]?.hasAttribute(`optional`)||this.hasAttribute(`skippable`))&&(this._invalid.delete(e),this._skipped.add(e),this.dispatchEvent(new CustomEvent(`wui-wizard:skip`,{detail:{index:e}})),e>=t.length-1?this._finish():this._go(e+1,`skip`))}_flagInvalid(e){this._invalid.add(e),this._renderChrome(),this.dispatchEvent(new CustomEvent(`wui-wizard:invalid`,{detail:{index:e}}))}_finish(){this._invalid.delete(this._active),this._finished=!0,this._renderChrome(),this.dispatchEvent(new CustomEvent(`wui-wizard:finish`,{detail:{index:this._active}}))}_go(e,t){let n=this._reconcileSteps(),r=Math.max(0,n.length-1),i=Math.min(Math.max(e,0),r),a=this._active;this._finished=!1,this._invalid.delete(a),this._active=i,this._reflectActive(i),this._renderChrome(),t!==`silent`&&i!==a&&this.dispatchEvent(new CustomEvent(`wui-wizard:change`,{detail:{index:i,previous:a,reason:t}}))}_reflectActive(e){this._reflecting=!0,this.setAttribute(`active`,String(e)),this._reflecting=!1}},_=e=>e===`pending`||e===`active`||e===`done`||e===`error`||e===`skipped`,v=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),y=class extends e{static get observedAttributes(){return[`label`,`description`,`optional`,`icon`,`status`]}attributeChangedCallback(){let e=this.closest(`wui-wizard`);e&&`refresh`in e&&typeof e.refresh==`function`&&e.refresh()}};export{g as n,y as t};
1
+ import{t as e}from"./elementBase-Cxeyx0tU.js";import{r as t}from"./dom-DMQu--xV.js";import{r as n,t as r}from"./textStore-DBplASiZ.js";import{n as i}from"./devWarn-DXdRWZs3.js";import{n as a,t as o}from"./buttonClass-C8BRtTk8.js";import{t as s}from"./iconGlyphs.g-Dj8sa1HF.js";import{n as c}from"./stepperHeader-yinJ_7Dk.js";import{t as l}from"./wizard.g-DOZSBUc5.js";var u=()=>n(`wizard`,l),d=`wui-wizard-step`,f=`:scope > [data-wui-glyphs]`,p=()=>({done:u().doneLabel,active:u().activeLabel,pending:u().pendingLabel,error:u().errorLabel,skipped:u().skippedLabel}),m=[`data-nav`,`data-step`,`data-close`],h=/* @__PURE__ */ new WeakSet,g=class extends e{_active;_skipped;_invalid;_finished;_rendered;_reflecting;_beforeNext;_header;_footer;_chromeInserted;_topBar;_onTopBarClick;_onHeaderClick;_onFooterClick;_known;_observer;_glyphs;_glyphObserver;static get observedAttributes(){return[`active`,`variant`,`orientation`,`align`,`icon-size`,`non-linear`,`hide-stepper`,`hide-connectors`,`disabled`,`skippable`,`label`,`back-label`,`next-label`,`skip-label`,`finish-label`,`top-bar`,`bar-title`,`close-label`]}constructor(){super(),this._active=0,this._skipped=/* @__PURE__ */ new Set,this._invalid=/* @__PURE__ */ new Set,this._finished=!1,this._rendered=!1,this._reflecting=!1,this._beforeNext=null,this._header=document.createElement(`nav`),this._header.className=`stepper wizard-stepper`,this._footer=document.createElement(`div`),this._footer.className=`form-actions wizard-footer form-actions-between`,this._chromeInserted=!1,this._topBar=null,this._onTopBarClick=e=>{let t=e.target;t instanceof Element&&t.closest(`[data-close]`)&&this.dispatchEvent(new CustomEvent(`wui-wizard:close`,{detail:{index:this._active},bubbles:!0}))},this._known=[],this._observer=null,this._glyphs=null,this._glyphObserver=null}get active(){return this._active}set active(e){let t=Number.parseInt(String(e),10);Number.isFinite(t)&&this._go(t,`set`)}get beforeNext(){return this._beforeNext}set beforeNext(e){this._beforeNext=typeof e==`function`?e:null}get _steps(){return[...this.querySelectorAll(`:scope > ${d}`)].filter(e=>e instanceof HTMLElement)}refresh(){this._rendered&&this._renderChrome()}connectedCallback(){if(this._rendered)this._wire(),this._onStepsMutated();else{let e=Number.parseInt(this.getAttribute(`active`)??``,10);this._active=Number.isFinite(e)&&e>=0?e:0,this.render()}}disconnectedCallback(){this._teardown()}attributeChangedCallback(e,t,n){if(this._rendered&&!this._reflecting){if(e===`active`){let e=Number.parseInt(n??``,10);Number.isFinite(e)&&this._go(e,`set`)}else this._renderChrome()}}render(){let e=this._steps;if(!this._chromeInserted){let t=e[0],n=e[e.length-1];t&&n?(this.insertBefore(this._header,t),n.after(this._footer)):(this.prepend(this._header),this.append(this._footer)),this._chromeInserted=!0}this._known=e,this._renderChrome(),this._rendered=!0,this._wire()}_renderChrome(){let e=this._reconcileSteps();this._placeChrome(e),this._clampActive(e),this._syncPanels(e);let t=this._focusedControl();this._syncTopBar(e),this._header.replaceChildren(...this._headerNodes(e)),this._footer.replaceChildren(...this._footerNodes(e)),this._header.hidden=this.hasAttribute(`hide-stepper`),this._restoreFocus(t)}_focusedControl(){let e=document.activeElement;if(!e||![this._topBar,this._header,this._footer].some(t=>t?.contains(e)))return null;let t=m.find(t=>e.hasAttribute(t));return t?{attr:t,value:e.getAttribute(t)}:null}_restoreFocus(e){if(e)for(let t of[this._topBar,this._header,this._footer]){let n=t&&[...t.querySelectorAll(`[${e.attr}]`)].find(t=>t.getAttribute(e.attr)===e.value);if(n){n instanceof HTMLElement&&!(n instanceof HTMLButtonElement&&n.disabled)&&n.focus({preventScroll:!0});return}}}_syncTopBar(e){if(!this.hasAttribute(`top-bar`)){this._topBar?.removeEventListener(`click`,this._onTopBarClick),this._topBar?.remove(),this._topBar=null;return}this._topBar||(this._topBar=document.createElement(`div`),this._topBar.className=`wui-wizard-topbar`,this._rendered&&this._topBar.addEventListener(`click`,this._onTopBarClick)),this._header.previousElementSibling!==this._topBar&&this.insertBefore(this._topBar,this._header);let n=this.getAttribute(`bar-title`)||``,i=this.getAttribute(`close-label`)||u().closeLabel,a=e.length?[t(`span`,{class:`wui-wizard-topbar-count`},r(u().stepOfText,{position:this._active+1,total:e.length}))]:[];this._topBar.replaceChildren(t(`span`,{class:`wui-wizard-topbar-title`},n||null),...a,t(`button`,{type:`button`,class:`wui-wizard-topbar-close`,"data-close":!0,"aria-label":i},this._glyph(`x`)))}_clampActive(e){let t=Math.max(0,e.length-1);this._active>t&&(this._active=t),this._active<0&&(this._active=0)}_reconcileSteps(){let e=this._steps,t=this._known;if(this._known=e,v(e,t))return e;let n=n=>new Set([...n].map(n=>{let r=t[n];return r?e.indexOf(r):-1}).filter(e=>e>=0));this._skipped=n(this._skipped),this._invalid=n(this._invalid);let r=t[this._active];if(!r)return e;let i=e.indexOf(r);if(i<0){let n=t=>e.includes(t),r=t.slice(this._active+1).find(n)??t.slice(0,this._active).reverse().find(n);i=r?e.indexOf(r):this._active}return i=Math.min(i,Math.max(0,e.length-1)),i!==this._active&&(this._active=i,this._reflectActive(i)),e}_placeChrome(e){let t=e[0],n=e[e.length-1];t&&n&&(this._header.nextElementSibling!==t&&this.insertBefore(this._header,t),this._footer.previousElementSibling!==n&&n.after(this._footer))}_onStepsMutated(){if(!this._rendered)return;let e=this._steps,t=!e.length||this._header.nextElementSibling===e[0]&&this._footer.previousElementSibling===e[e.length-1];this.querySelector(f)!==this._glyphs&&(this._watchGlyphs(),this._renderHeader()),t&&v(e,this._known)||(this._renderChrome(),this._observer?.takeRecords())}_syncPanels(e){e.forEach((e,t)=>{let n=t===this._active;e.classList.add(`wizard-panel`),e.hidden=!n,e.setAttribute(`role`,`tabpanel`),e.setAttribute(`aria-hidden`,n?`false`:`true`)})}_stepStatus(e,t){let n=e?.getAttribute(`status`);if(n){if(!_(n))throw Error(`wui-wizard: status "${n}" is not one of pending, active, done, error, skipped.`);return n}return this._invalid.has(t)?`error`:this._finished?`done`:t===this._active?`active`:t<this._active?this._skipped.has(t)?`skipped`:`done`:`pending`}_headerNodes(e){let n=this.getAttribute(`variant`)===`journey`,a=this.getAttribute(`variant`)===`icons`,o=this.getAttribute(`variant`)===`tiles`,s=this.getAttribute(`orientation`)===`vertical`,l=!this.hasAttribute(`hide-connectors`),d=this.getAttribute(`align`)===`start`;this._header.className=[`stepper`,`wizard-stepper`,n&&`stepper-journey`,a&&`stepper-icons`,o&&`wui-step-tiles`,s&&`stepper-vertical`,!l&&`wui-stepper-no-connectors`,d&&`wui-stepper-start`].filter(Boolean).join(` `),this._header.setAttribute(`aria-label`,this.getAttribute(`label`)||u().label);let f=this.hasAttribute(`non-linear`);for(let t of e)t.getAttribute(`label`)||h.has(t)||(h.add(t),i(`wui-wizard: a <wui-wizard-step> needs a label attribute; its header segment is empty.`));let m=c(e.map(e=>({label:e.getAttribute(`label`)||``,icon:e.getAttribute(`icon`)||void 0})),{statusOf:t=>this._stepStatus(e[t],t),journey:n,connectors:l}),g=p(),_=m.flatMap(i=>{let s=i.index,c=e[s];if(!c)return[];let l=i.status,d=c.getAttribute(`label`)||null,p=c.getAttribute(`description`)||``,m=s+1,h=`icon`in i.glyph?this._glyph(i.glyph.icon):i.glyph.number,_=i.className,v=i.current?`step`:void 0,y=f||s<this._active;if(o){let e=[t(`span`,{class:`step-circle`},h),t(`span`,{class:`step-text`},t(`span`,{class:`step-label`},d),t(`span`,{class:`wui-step-tile-state`},g[l]??null))],n=y?t(`button`,{type:`button`,class:`wui-step-tile-body`,"data-step":s,"aria-current":v},...e):t(`div`,{class:`wui-step-tile-body`,"aria-current":v},...e);return[t(`li`,{class:l===`pending`?`wui-step-tile`:`wui-step-tile ${l}`},n)]}let b=p?[t(`span`,{class:`step-desc`},p)]:[],x;x=n?[t(`span`,{class:`step-circle`},h),t(`span`,{class:`step-text`},t(`span`,{class:`step-index`},r(u().stepText,{position:m})),t(`span`,{class:`step-label`},d),...b)]:a?[t(`span`,{class:`step-circle`},h),t(`span`,{class:`step-index`},r(u().stepText,{position:m})),t(`span`,{class:`step-label`},d),...b]:[t(`span`,{class:`step-circle`},h),t(`span`,{class:`step-label`},d),...b];let S=y?t(`button`,{type:`button`,class:_,"data-step":s,"aria-current":v},...x):t(`div`,{class:_,"aria-current":v},...x);return i.line?[S,t(`span`,{class:`step-line${i.line.done?` done`:``}`,"aria-hidden":`true`})]:[S]});return o?[t(`ol`,null,..._)]:_}_footerNodes(e){let n=this._active,r=e.length-1,i=this.hasAttribute(`disabled`),c=e[n]?.hasAttribute(`optional`)||this.hasAttribute(`skippable`),l=this.getAttribute(`back-label`)||u().backLabel,d=this.getAttribute(`next-label`)||u().nextLabel,f=this.getAttribute(`skip-label`)||u().skipLabel,p=this.getAttribute(`finish-label`)||u().finishLabel,m=n>0?t(`button`,{type:`button`,class:a(`primary`,`soft`,`md`),"data-nav":`back`,disabled:i,"data-wui":o},s(`arrow-left`,{className:`me-2`}),l):t(`span`),h=c&&n<r?t(`button`,{type:`button`,class:a(`neutral`,`soft`,`md`),"data-nav":`skip`,disabled:i,"data-wui":o},f):null,g=n<r?t(`button`,{type:`button`,class:a(`primary`,`solid`,`md`),"data-nav":`next`,disabled:i,"data-wui":o},d,s(`arrow-right`,{className:`ms-2`})):t(`button`,{type:`button`,class:a(`primary`,`solid`,`md`),"data-nav":`finish`,disabled:i,"data-wui":o},p);return[m,t(`span`,{class:`wizard-footer-actions`},h,g)]}_wire(){this._teardown(),this._onHeaderClick=e=>{let t=e.target instanceof Element?e.target.closest(`[data-step]`):null;t instanceof HTMLElement&&this.contains(t)&&this._stepTo(Number.parseInt(t.dataset.step??``,10))},this._onFooterClick=e=>{let t=e.target instanceof Element?e.target.closest(`[data-nav]`):null;if(!(t instanceof HTMLElement)||!this.contains(t)||this.hasAttribute(`disabled`))return;let n=t.dataset.nav;n===`back`?this._back():n===`skip`?this._skip():(n===`next`||n===`finish`)&&this._next()},this._header.addEventListener(`click`,this._onHeaderClick),this._footer.addEventListener(`click`,this._onFooterClick),this._topBar?.addEventListener(`click`,this._onTopBarClick),this._observer=new MutationObserver(()=>this._onStepsMutated()),this._observer.observe(this,{childList:!0}),this._watchGlyphs()}_glyph(e){let t=this.querySelector(f),n=t&&[...t.children].find(t=>t.getAttribute(`data-icon`)===e);if(n)return n.cloneNode(!0);let r=Number.parseInt(this.getAttribute(`icon-size`)??``,10);return s(e,r>0?{size:r}:void 0)}_watchGlyphs(){this._glyphObserver?.disconnect(),this._glyphObserver=null,this._glyphs=this.querySelector(f),this._glyphs&&(this._glyphObserver=new MutationObserver(()=>this._renderHeader()),this._glyphObserver.observe(this._glyphs,{childList:!0,subtree:!0,attributes:!0,characterData:!0}))}_renderHeader(){if(!this._rendered)return;let e=this._focusedControl();this._header.replaceChildren(...this._headerNodes(this._steps)),this._restoreFocus(e)}_teardown(){this._header&&this._onHeaderClick&&this._header.removeEventListener(`click`,this._onHeaderClick),this._footer&&this._onFooterClick&&this._footer.removeEventListener(`click`,this._onFooterClick),this._topBar?.removeEventListener(`click`,this._onTopBarClick),this._observer?.disconnect(),this._observer=null,this._glyphObserver?.disconnect(),this._glyphObserver=null}_stepTo(e){this.hasAttribute(`disabled`)||!this.hasAttribute(`non-linear`)&&e>=this._active||this._go(e,`step`)}_back(){this._active>0&&this._go(this._active-1,`back`)}async _next(){this._reconcileSteps();let e=this._active,t=this._steps,n=e>=t.length-1,r=t[e];if(!this.dispatchEvent(new CustomEvent(`wui-wizard:beforechange`,{detail:n?{index:e,next:e,reason:`finish`}:{index:e,next:e+1,reason:`next`},cancelable:!0})))return this._flagInvalid(e);if(this._beforeNext){let i;try{i=await this._beforeNext(e)}catch{i=!1}if(this._reconcileSteps(),t=this._steps,e=r?t.indexOf(r):-1,e<0)return;if(n=e>=t.length-1,i===!1)return this._flagInvalid(e)}if(this._invalid.delete(e),this._skipped.delete(e),n)return this._finish();this._go(e+1,`next`)}_skip(){let e=this._active,t=this._steps;(t[e]?.hasAttribute(`optional`)||this.hasAttribute(`skippable`))&&(this._invalid.delete(e),this._skipped.add(e),this.dispatchEvent(new CustomEvent(`wui-wizard:skip`,{detail:{index:e}})),e>=t.length-1?this._finish():this._go(e+1,`skip`))}_flagInvalid(e){this._invalid.add(e),this._renderChrome(),this.dispatchEvent(new CustomEvent(`wui-wizard:invalid`,{detail:{index:e}}))}_finish(){this._invalid.delete(this._active),this._finished=!0,this._renderChrome(),this.dispatchEvent(new CustomEvent(`wui-wizard:finish`,{detail:{index:this._active}}))}_go(e,t){let n=this._reconcileSteps(),r=Math.max(0,n.length-1),i=Math.min(Math.max(e,0),r),a=this._active;this._finished=!1,this._invalid.delete(a),this._active=i,this._reflectActive(i),this._renderChrome(),t!==`silent`&&i!==a&&this.dispatchEvent(new CustomEvent(`wui-wizard:change`,{detail:{index:i,previous:a,reason:t}}))}_reflectActive(e){this._reflecting=!0,this.setAttribute(`active`,String(e)),this._reflecting=!1}},_=e=>e===`pending`||e===`active`||e===`done`||e===`error`||e===`skipped`,v=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),y=class extends e{static get observedAttributes(){return[`label`,`description`,`optional`,`icon`,`status`]}attributeChangedCallback(){let e=this.closest(`wui-wizard`);e&&`refresh`in e&&typeof e.refresh==`function`&&e.refresh()}};export{g as n,y as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./hasOwn-CJsplJ62.js";var t=`AppButton`,n=/* @__PURE__ */ new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),r={solid:e=>`btn-${e}`,soft:e=>`btn-soft-${e}`,outline:e=>`btn-outline-${e}`,ghost:e=>`btn-ghost-${e}`,link:e=>`btn-link-${e}`,glass:()=>`btn-glass`};function i(t){return e(r,t)}function a(e=`primary`,t=`solid`,a=`md`){if(!n.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!i(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let o=r[t](e);return a===`md`?`btn ${o}`:`btn ${o} btn-${a}`}export{a as n,t};
@@ -1 +1 @@
1
- import{_ as e,g as t}from"./formatters-DikbTYA4.js";var n=e=>{let t=String(e??``).trim();return/^[0-6]$/.test(t)?Number(t):null},r=e=>n(e.getAttribute(`first-day`))??n(getComputedStyle(e).getPropertyValue(`--wui-first-day`))??1,i=e=>String(e).padStart(2,`0`),a=(e,t,n)=>`${e}-${i(t+1)}-${i(n)}`,o=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e||``);if(!t)return null;let[,n,r,i]=t;if(n===void 0||r===void 0||i===void 0)throw Error(`ISO date parts missing`);let a=+n,o=+r,s=+i;return o<1||o>12||s<1||s>_(a,o-1)?null:{y:a,m:o-1,d:s}},s=`dd-MMM-yyyy`,c=(n,r=s)=>{let a=o(n);if(!a)return``;let c={yyyy:a.y,MMMM:e(a.m),MMM:t(a.m),MM:i(a.m+1),dd:i(a.d),d:a.d};return(r||`dd-MMM-yyyy`).replace(/yyyy|MMMM|MMM|MM|dd|d/g,e=>String(c[e]))},l=e=>{let t=/^(\d{4})-(\d{2})$/.exec(e||``);if(!t)return null;let[,n,r]=t;if(n===void 0||r===void 0)throw Error(`ISO month parts missing`);let i=+r;return i<1||i>12?null:{y:+n,m:i-1}},u=(e,t)=>`${e}-${i(t+1)}`,d=`MMM yyyy`,f=(n,r=d)=>{let a=l(n);if(!a)return``;let o={yyyy:a.y,MMMM:e(a.m),MMM:t(a.m),MM:i(a.m+1)};return(r||`MMM yyyy`).replace(/yyyy|MMMM|MMM|MM/g,e=>String(o[e]))},p=e=>{let t=/^(\d{4})$/.exec(e||``);if(!t)return null;let[,n]=t;if(n===void 0)throw Error(`ISO year part missing`);return{y:+n}},m=e=>String(e).padStart(4,`0`),h=`yyyy`,g=(e,t=h)=>{let n=p(e);return n?(t||`yyyy`).replace(/yyyy/g,String(n.y)):``},_=(e,t)=>{let n=/* @__PURE__ */ new Date(0);return n.setFullYear(e,t+1,0),n.getDate()},v=(e,t)=>{for(;t<0;)t+=12,--e;for(;t>11;)t-=12,e+=1;return{y:e,m:t}};export{f as a,l as c,u as d,m as f,c as i,p as l,_ as n,g as o,r,o as s,v as t,a as u};
1
+ import{_ as e,g as t}from"./formatters-DTW53DjY.js";var n=e=>{let t=String(e??``).trim();return/^[0-6]$/.test(t)?Number(t):null},r=e=>n(e.getAttribute(`first-day`))??n(getComputedStyle(e).getPropertyValue(`--wui-first-day`))??1,i=e=>String(e).padStart(2,`0`),a=(e,t,n)=>`${e}-${i(t+1)}-${i(n)}`,o=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e||``);if(!t)return null;let[,n,r,i]=t;if(n===void 0||r===void 0||i===void 0)throw Error(`ISO date parts missing`);let a=+n,o=+r,s=+i;return o<1||o>12||s<1||s>_(a,o-1)?null:{y:a,m:o-1,d:s}},s=`dd-MMM-yyyy`,c=(n,r=s)=>{let a=o(n);if(!a)return``;let c={yyyy:a.y,MMMM:e(a.m),MMM:t(a.m),MM:i(a.m+1),dd:i(a.d),d:a.d};return(r||`dd-MMM-yyyy`).replace(/yyyy|MMMM|MMM|MM|dd|d/g,e=>String(c[e]))},l=e=>{let t=/^(\d{4})-(\d{2})$/.exec(e||``);if(!t)return null;let[,n,r]=t;if(n===void 0||r===void 0)throw Error(`ISO month parts missing`);let i=+r;return i<1||i>12?null:{y:+n,m:i-1}},u=(e,t)=>`${e}-${i(t+1)}`,d=`MMM yyyy`,f=(n,r=d)=>{let a=l(n);if(!a)return``;let o={yyyy:a.y,MMMM:e(a.m),MMM:t(a.m),MM:i(a.m+1)};return(r||`MMM yyyy`).replace(/yyyy|MMMM|MMM|MM/g,e=>String(o[e]))},p=e=>{let t=/^(\d{4})$/.exec(e||``);if(!t)return null;let[,n]=t;if(n===void 0)throw Error(`ISO year part missing`);return{y:+n}},m=e=>String(e).padStart(4,`0`),h=`yyyy`,g=(e,t=h)=>{let n=p(e);return n?(t||`yyyy`).replace(/yyyy/g,String(n.y)):``},_=(e,t)=>{let n=/* @__PURE__ */ new Date(0);return n.setFullYear(e,t+1,0),n.getDate()},v=(e,t)=>{for(;t<0;)t+=12,--e;for(;t>11;)t-=12,e+=1;return{y:e,m:t}};export{f as a,l as c,u as d,m as f,c as i,p as l,_ as n,g as o,r,o as s,v as t,a as u};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./dom-DMQu--xV.js";import{n as t,t as n}from"./fieldState-D-zQcXUS.js";import{t as r}from"./iconGlyphs.g-Dj8sa1HF.js";import{t as i}from"./imeSafeEnter-DPs9qL3S.js";import{s as a}from"./nativeOverlay-BHD2QV02.js";import{n as o,r as s,t as c}from"./optionLabel-CghX6DYo.js";import{r as l,t as u}from"./textStore-DBplASiZ.js";import{r as d}from"./search.g-B5d1s59A.js";import{t as ee}from"./customRule-BpwcjVLb.js";import{r as f}from"./WuiSelect-C_nfrNr5.js";var p={enter:`Enter`,comma:`,`,space:` `,tab:`Tab`},m={enter:`
2
+ `,comma:`,`,space:` `,tab:` `},te=e=>p[e],h=e=>m[e];function ne(e,t){let n=[String(e??``)];for(let e of t)n=n.flatMap(t=>t.split(e));return n.map(e=>e.trim()).filter(Boolean)}var re=(e,t)=>t.some(t=>String(e??``).includes(t)),g=()=>l(`select`,d),_=/* @__PURE__ */ new WeakMap;function v(e,t){if(e===null)throw TypeError(`The chip row needs ${t}, and it is not mounted.`);return e}function y(){let l,d,p=null,m=null,y=null,b=null,x=null,S=null,C=null,w=!1,T=()=>v(m,`the draft input`),E=()=>l.mode===`tag`,D=()=>Array.isArray(l.value)?l.value.slice():[],O=()=>(l.getAttribute(`separators`)||`enter,comma`).split(`,`).map(e=>e.trim()).filter(Boolean),ie=()=>new Set(O().map(te).filter(Boolean)),k=()=>{let e=parseInt(l.getAttribute(`max-tags`)??``,10)||0;return Math.max(e,0)},A=()=>{let e=k();return e>0&&D().length>=e},j=(e,t)=>!l.hasAttribute(`allow-duplicates`)&&e.some(e=>e.toLowerCase()===t.toLowerCase()),M=()=>{let e=_.get(l);return e||(e=/* @__PURE__ */ new Map,_.set(l,e)),e},N=e=>(l.options||[]).find(t=>String(t.value)===String(e))??M().get(String(e)),P=e=>{let t=M();for(let n of l.options||[])e.includes(String(n.value))&&t.set(String(n.value),n);for(let n of t.keys())e.includes(n)||t.delete(n)},F=e=>{let t=e.trim().toLowerCase();return(l.options||[]).find(e=>String(e.value??``).toLowerCase()===t||o(e).trim().toLowerCase()===t)},ae=e=>{for(let t of O()){let n=h(t)??t;if(re(e,[n]))return ne(e,[n])}return[e.trim()]},I=()=>m?m.value:l._query||``,oe=()=>E()||l.hasAttribute(`allow-custom`),se=()=>l.getAttribute(`placeholder`)||(E()?g().tagPlaceholder:g().placeholder),ce=()=>{let e=l.getAttribute(`aria-label`);if(e)return e;let t=l.closest(`label`)?.textContent?.trim();if(t)return t;let n=l.id;return(n?[...document.querySelectorAll(`label[for]`)].find(e=>e instanceof HTMLLabelElement&&e.htmlFor===n):void 0)?.textContent?.trim()||(E()?g().addTagsLabel:g().fallbackName)},L=()=>{m&&(m.setAttribute(`aria-expanded`,String(a(d.menu))),d.list.id&&m.setAttribute(`aria-controls`,d.list.id),m.setAttribute(`aria-label`,ce()))},le=()=>!t(l)&&!l.hasAttribute(`loading`),ue=e=>{w=!0,T().setAttribute(`aria-invalid`,`true`),l.setError(e)},R=()=>{w&&(w=!1,T().removeAttribute(`aria-invalid`),l.setError(null))},z=(e,{quiet:t=!1,strip:n=!1}={})=>{let r=D(),i=r.slice(),a=k(),o=[],s=``,c=!1;for(let t of e){let e=(n?t.trim().replace(/,+$/,``):t).trim();if(!e)continue;if(a&&i.length>=a)break;let r=F(e);if(r){if(r.disabled){o.push(e),s||=r.disabledHint||l.getAttribute(`invalid-message`)||g().invalidMessage;continue}j(i,String(r.value))||i.push(String(r.value));continue}let u=ee(l,e);u?(o.push(e),s||=u):j(i,e)||(i.push(e),c=!0)}i.length!==r.length&&(c?l.commit(i,{isCustom:!0}):l.commit(i)),T().value=o.join(`, `),s?t||ue(s):R()},B=e=>{n(l)||z([T().value],e)},V=e=>l.commit(D().filter(t=>t!==e)),H=()=>e(`span`,{class:`wui-select-placeholder`},l.getAttribute(`placeholder`)||g().placeholder),de=t=>{let n=N(t),i=e(`span`,{class:`chip chip-sm`}),a=e(`span`,{class:`chip-label`});if(a.replaceChildren(...n?c(n):[t]),i.append(a),le()){let a=n?o(n):s(t),c=e(`button`,{class:`chip-remove`,type:`button`,"data-remove":t,"aria-label":u(g().removeText,{text:a})}),l=r(`x`);l&&c.replaceChildren(l),i.append(c)}return i};function U(){if(!p)return;p.querySelector(`:scope > .chip-more`)?.remove();let t=[...p.querySelectorAll(`:scope > .chip`)].map(e=>{if(!(e instanceof HTMLElement))throw Error(`The chip row holds a node that is not an element.`);return e});for(let e of t)e.style.display=``;let n=t[t.length-1];if(!l.hasAttribute(`collapse-chips`)||!n)return;let r=p.clientWidth,i=e=>e.offsetLeft+e.offsetWidth;if(i(n)<=r)return;let a=e(`span`,{class:`chip chip-sm chip-more`});a.textContent=`+${t.length}`,n.after(a);let o=a.offsetWidth+6,s=0;for(let e of t)if(i(e)<=r-o)s+=1;else break;s<1&&(s=1);for(let e of t.slice(s))e.style.display=`none`;a.textContent=`+${t.length-s}`}function W(){if(!p)return!1;p.parentNode!==d.value&&d.value.append(p);for(let e of p.querySelectorAll(`:scope > .chip, :scope > .wui-select-placeholder`))e.remove();let e=D();P(e);let t=p,r=e=>{m?t.insertBefore(e,m):t.append(e)};E()||m||e.length||r(H());for(let t of e)r(de(t));return m&&(m.placeholder=E()||!e.length?se():``,m.disabled=l.hasAttribute(`disabled`),m.readOnly=n(l),L()),E()||(v(b,`the footer text`).textContent=(()=>{let t=l.getAttribute(`selected-text`);return t?t.replace(`{n}`,()=>String(e.length)):u(g().selectedText,{count:e.length})})(),v(x,`the clear-all button`).textContent=l.getAttribute(`clear-all-label`)||g().clearAllLabel),U(),!0}function fe(e){if(e.key===`Backspace`){let t=m?!I():!I()&&a(d.menu),n=D(),r=n[n.length-1];return!t||r===void 0?!1:(e.preventDefault(),V(r),!0)}if(!m)return!1;let t=m.value;if(e.key===`Escape`){if(!E())return!1;let n=a(d.menu);return!n&&!t?!1:(e.preventDefault(),n&&e.stopPropagation(),m.value=``,R(),l.closeMenu({focusControl:!1}),!0)}let n=!E()&&!t.trim(),r=ie();return i(e)&&r.has(`Enter`)?n||d.list.querySelector(`.is-active`)?!1:(e.preventDefault(),B(),!0):e.key===`,`&&r.has(`,`)?!n&&(e.preventDefault(),B({strip:!0}),!0):e.key===` `&&r.has(` `)&&t.trim()||e.key===`Tab`&&r.has(`Tab`)&&!n?(e.preventDefault(),B(),!0):!1}function pe(e){let t=String(e.value);if(E()||m&&!N(t))return z([t]),!0;let n=D();return n.includes(t)?l.commit(n.filter(e=>e!==t)):m?z([t]):l.commit([...n,t]),m?.value&&(m.value=``,R()),!0}function G(e){if(!m)return null;let t=String(e??``).trim().replace(/,+$/,``).trim();if(!t||A()||F(t)||j(D(),t))return null;let n=l.getAttribute(`create-label`)||g().createLabel;return{position:E()?`top`:`bottom`,label:n.replace(`{text}`,()=>t),value:t}}function K(e){let t=e.target,r=t instanceof Element?t.closest(`[data-remove]`):null;if(r instanceof HTMLElement){if(n(l))return;e.stopPropagation(),V(r.dataset.remove??``),m?.focus()}else m&&!n(l)&&m.focus()}function q(){R();let e=T().value.trim();E()||!e||a(d.menu)||(G(e)||f(l.options||[],e).length)&&l.openMenu()}function J(e){e.preventDefault(),n(l)||z(ae(e.clipboardData?.getData(`text/plain`)??``))}function Y(){T().value.trim()&&B({quiet:!0,strip:!0}),l.closeMenu({focusControl:!1})}function X(e){e.relatedTarget instanceof Node&&l.contains(e.relatedTarget)||Y()}function me(){return m?(Y(),!0):!1}function Z(){T().value.trim()&&B({strip:!0})}function Q(){n(l)||l.commit([])}function $(e){e.target!==m&&e.preventDefault()}function he(t,n,r={}){l=t,d=n,p=e(`div`,{class:`wui-select-chips`}),p.addEventListener(`click`,K),d.value.append(p),oe()&&(m=e(`input`,{class:`wui-select-draft`,type:`text`,autocomplete:`off`,role:`combobox`,"aria-autocomplete":`list`}),l.hasAttribute(`required`)&&m.setAttribute(`aria-required`,`true`),d.menu.addEventListener(`toggle`,L),p.append(m),m.value=r.carry?.draft??``,d.input=m,m.addEventListener(`input`,q),m.addEventListener(`paste`,J),m.addEventListener(`blur`,X),p.addEventListener(`mousedown`,$),S=l.closest(`form`),S?.addEventListener(`submit`,Z,!0)),E()||(y=e(`div`,{class:`wui-select-footer`}),b=document.createElement(`span`),x=e(`button`,{class:`wui-select-clear-all`,type:`button`}),x.addEventListener(`click`,Q),y.append(b,x),d.menu.append(y)),typeof ResizeObserver<`u`&&(C=new ResizeObserver(U),C.observe(p)),W()}function ge(){p?.removeEventListener(`click`,K),p?.removeEventListener(`mousedown`,$),m&&(m.removeEventListener(`input`,q),m.removeEventListener(`paste`,J),m.removeEventListener(`blur`,X),d.input=null),x&&x.removeEventListener(`click`,Q),S?.removeEventListener(`submit`,Z,!0),S=null,C?.disconnect(),C=null,d.menu.removeEventListener(`toggle`,L),y?.remove(),p?.remove(),p=null,m=null,y=null,w=!1}return{mount:he,onKey:fe,onPick:pe,renderValue:W,actionRow:G,onQuery:()=>!1,onBlur:me,teardown:ge}}export{y as default};
@@ -1 +1 @@
1
- import{t as e}from"./countries-DQL9nAUt.js";import{r as t}from"./textStore-opIEM4lu.js";import{r as n}from"./search.g-B5d1s59A.js";var r=()=>t(`select`,n),i=/^\+?\d+$/,a=e=>String(e??``).split(`,`).map(e=>e.trim().toUpperCase()).filter(Boolean),o=t=>{let n=a(t.getAttribute(`countries`)),i=n.length?new Set(n):null,o=e.filter(([e])=>!i||i.has(e)),s=new Map(o.map(e=>[e[0],e])),c=[...new Set(a(t.getAttribute(`suggested`)))].map(e=>s.get(e)).filter(e=>e!==void 0);if(!c.length)return o.map(e=>({tuple:e,group:null}));let l=new Set(c.map(e=>e[0])),u=t.getAttribute(`suggested-label`)||r().suggestedLabel,d=t.getAttribute(`all-countries-label`)||r().allCountriesLabel;return[...c.map(e=>({tuple:e,group:u})),...o.filter(e=>!l.has(e[0])).map(e=>({tuple:e,group:d}))]},s=({tuple:[e,t,n],group:r})=>({value:e,label:t,flag:e,meta:`+${n}`,...r?{group:r}:{}}),c=([,e,t],n)=>n?i.test(n)?t.startsWith(n.replace(`+`,``)):e.toLowerCase().includes(n):!0;function l(){let e,t=[];return{mount(n){e=n,t=o(n),n.setPartOptions(t.map(s))},onQuery(n){let r=n.trim().toLowerCase();return e.setPartOptions(t.filter(e=>c(e.tuple,r)).map(s)),!0},teardown(){}}}export{l as default};
1
+ import{t as e}from"./countries-DQL9nAUt.js";import{r as t}from"./textStore-DBplASiZ.js";import{r as n}from"./search.g-B5d1s59A.js";var r=()=>t(`select`,n),i=/^\+?\d+$/,a=e=>String(e??``).split(`,`).map(e=>e.trim().toUpperCase()).filter(Boolean),o=t=>{let n=a(t.getAttribute(`countries`)),i=n.length?new Set(n):null,o=e.filter(([e])=>!i||i.has(e)),s=new Map(o.map(e=>[e[0],e])),c=[...new Set(a(t.getAttribute(`suggested`)))].map(e=>s.get(e)).filter(e=>e!==void 0);if(!c.length)return o.map(e=>({tuple:e,group:null}));let l=new Set(c.map(e=>e[0])),u=t.getAttribute(`suggested-label`)||r().suggestedLabel,d=t.getAttribute(`all-countries-label`)||r().allCountriesLabel;return[...c.map(e=>({tuple:e,group:u})),...o.filter(e=>!l.has(e[0])).map(e=>({tuple:e,group:d}))]},s=({tuple:[e,t,n],group:r})=>({value:e,label:t,flag:e,meta:`+${n}`,...r?{group:r}:{}}),c=([,e,t],n)=>n?i.test(n)?t.startsWith(n.replace(`+`,``)):e.toLowerCase().includes(n):!0;function l(){let e,t=[];return{mount(n){e=n,t=o(n),n.setPartOptions(t.map(s))},onQuery(n){let r=n.trim().toLowerCase();return e.setPartOptions(t.filter(e=>c(e.tuple,r)).map(s)),!0},teardown(){}}}export{l as default};
@@ -1 +1 @@
1
- import{n as e}from"./devWarn-DXdRWZs3.js";import{r as t}from"./textStore-opIEM4lu.js";import{t as n}from"./customRule.g-Cfkl3_ZC.js";var r=/* @__PURE__ */ new Map,i=t=>{if(r.has(t))return r.get(t)??null;let n=null;try{n=RegExp(`^(?:${t})$`,`u`)}catch{e(`<wui-select> pattern is not a valid regular expression and is ignored: ${t}`)}return r.set(t,n),n},a=(e,r)=>{let a=e.getAttribute(`invalid-message`)||t(`customRule`,n).invalidMessage,o=e.getAttribute(`pattern`);if(o){let e=i(o);if(e&&!e.test(r))return a}let s=e.validate;if(typeof s!=`function`)return``;let c=s(r);return c===!0?``:typeof c==`string`&&c?c:a};export{a as t};
1
+ import{n as e}from"./devWarn-DXdRWZs3.js";import{r as t}from"./textStore-DBplASiZ.js";import{t as n}from"./customRule.g-Cfkl3_ZC.js";var r=/* @__PURE__ */ new Map,i=t=>{if(r.has(t))return r.get(t)??null;let n=null;try{n=RegExp(`^(?:${t})$`,`u`)}catch{e(`<wui-select> pattern is not a valid regular expression and is ignored: ${t}`)}return r.set(t,n),n},a=(e,r)=>{let a=e.getAttribute(`invalid-message`)||t(`customRule`,n).invalidMessage,o=e.getAttribute(`pattern`);if(o){let e=i(o);if(e&&!e.test(r))return a}let s=e.validate;if(typeof s!=`function`)return``;let c=s(r);return c===!0?``:typeof c==`string`&&c?c:a};export{a as t};
@@ -1 +1 @@
1
- import{f as e}from"./formatters-DikbTYA4.js";import{n as t,r as n,t as r}from"./textStore-opIEM4lu.js";import{t as i}from"./dataTable.g-DazoWWps.js";var a=48,o=1200,s=10,c=50,l=[`start`,`end`],u=8,d={comfortable:72,cozy:48,compact:40},f=()=>n(`dataTable`,i),p=e=>e?r(f().resizeColumnText,{label:e}):f().resizeColumnLabel,m=e=>r(f().resizeText,{px:e}),h=n=>t(f(),`groupRows`,n,{count:e(n,{decimals:0})}),g=e=>e?r(f().savedText,{label:e}):f().rowSavedText,_=t=>r(f().rowsSavedText,{n:e(t,{decimals:0})}),v=(e,t)=>`${e?r(f().wasNotSavedText,{label:e}):f().rowWasNotSavedText}${t?` ${t}`:``}`,y=t=>e(t,{decimals:0}),b=e=>Math.min(o,Math.max(48,Math.round(Number(e)||0)));function x(e,t,n=[]){let r=new Map(n.map(e=>[e,[]]));return e.forEach((e,n)=>{let i=t(e,n),a=r.get(i);a||(a=[],r.set(i,a)),a.push(e)}),[...r].filter(([,e])=>e.length>0).map(([e,t])=>({key:e,items:t}))}function S({scrollTop:e,viewport:t,rowHeight:n,count:r,overscan:i=8}){let a=n>0?n:d.cozy,o=Math.floor(Math.max(0,e)/a),s=Math.max(0,o-i);s-=s%2;let c=Math.min(r,o+Math.ceil(Math.max(0,t)/a)+i),l=Math.min(s,c);return{start:l,end:c,before:l*a,after:Math.max(0,r-c)*a}}var C=e=>`wui-widths:${e}`;function w(e){if(!e)return{};try{let t=JSON.parse(window.localStorage.getItem(C(e))||`{}`),n={};if(t&&typeof t==`object`)for(let[e,r]of Object.entries(t))Number.isFinite(r)&&(n[e]=b(r));return n}catch{return{}}}function T(e,t){if(e)try{Object.keys(t).length?window.localStorage.setItem(C(e),JSON.stringify(t)):window.localStorage.removeItem(C(e))}catch(e){if(!(e instanceof DOMException))throw e}}var E=(e,t)=>`--wui-pin-${e}-${t}`,D=`--wui-pin-at`,O=(e,t)=>`var(${E(e,t)}, 0px)`;function k(e){let t=e.map(()=>null),n=-1;e.forEach((e,t)=>{e===`start`&&(n=t)});let r=0;for(let i=0;i<=n;i++)(e[i]===`start`||e[i]===`lead`)&&(t[i]={side:`start`,ordinal:r++,edge:!1});let i=t[n];i&&(i.edge=!0);let a=-1;r=0;for(let n=e.length-1;n>=0;n--)e[n]===`end`&&(t[n]={side:`end`,ordinal:r++,edge:!1},a=n);let o=t[a];return o&&(o.edge=!0),t}var A=e=>e?`wui-pin-${e.side}${e.edge?` wui-pin-${e.side}-edge`:``}`:``,j=200,M=220,N=`cubic-bezier(0.22, 1, 0.36, 1)`,P=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,F=e=>e.getAttribute(`data-row-key`)??e;function I(e){let t=[...e];if(t.length>200)return null;let n=/* @__PURE__ */ new Map;for(let e of t)e.hidden||n.set(F(e),e.offsetTop);return n}function L(e,t){let n=[...e];if(!t||n.length>200||P())return 0;let r=0;for(let e of n){if(e.hidden||typeof e.animate!=`function`)continue;let n=t.get(F(e));if(n===void 0)continue;let i=n-e.offsetTop;Math.abs(i)<1||(e.animate([{transform:`translateY(${i}px)`},{transform:`translateY(0)`}],{duration:220,easing:N}),r++)}return r}function R(e,t){if(!e||!t)return!1;let n=new Set(t),r=new Set(e),i=e.filter(e=>n.has(e)),a=t.filter(e=>r.has(e));return i.some((e,t)=>e!==a[t])}var z=[`saving`,`error`],B=`data-wui-save-state`,V=`wui-row-save-error`,H=e=>{let t=e.querySelector(`:scope > .wui-name-cell`);return t instanceof HTMLTableCellElement?t:[...e.cells].find(e=>!e.matches(`.wui-select-cell, .wui-expand-cell`))??null};function U(e){let t=H(e);if(!t)return``;let n=t.querySelector(`.u-name`);if(n)return(n.textContent??``).trim();let r=``;for(let e of t.childNodes)e instanceof Element&&e.classList.contains(`wui-row-save-error`)||(r+=e.textContent??``);return r.replace(/\s+/g,` `).trim()}function W(e,t,n=``){if(t!==null&&!z.includes(t))throw Error(`A row's save state is ${z.join(` or `)} (or null to clear it), not "${t}".`);e.querySelector(`:scope > * > .${V}`)?.remove(),t===null?e.removeAttribute(B):e.setAttribute(B,t),t===`saving`?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`);let r=t===`error`&&n?H(e):null;if(r){let t=e.ownerDocument.createElement(`span`);t.className=V,t.textContent=n,r.append(t)}}function G(e,t){let n=[];if(!e)return n;for(let[r,i]of e){let e=t.get(r);i.state===`saving`&&e&&e.state!==`saving`&&n.push({label:e.label,ok:e.state!==`error`,message:e.message||``})}return n}function K(e){let t=e.filter(e=>e.ok),n=[],[r]=t;t.length===1&&r?n.push(g(r.label)):t.length>1&&n.push(_(t.length));for(let t of e)t.ok||n.push(v(t.label,t.message));return n.join(` `)}export{K as A,E as C,p as D,w as E,m as F,T as I,W as M,G as N,U as O,S as P,A as S,L as T,h as _,s as a,v as b,j as c,V as d,z as f,x as g,y as h,l as i,g as j,R as k,M as l,b as m,a as n,c as o,u as p,D as r,d as s,o as t,B as u,H as v,k as w,O as x,I as y};
1
+ import{f as e}from"./formatters-DTW53DjY.js";import{n as t,r as n,t as r}from"./textStore-DBplASiZ.js";import{t as i}from"./dataTable.g-DazoWWps.js";var a=48,o=1200,s=10,c=50,l=[`start`,`end`],u=8,d={comfortable:72,cozy:48,compact:40},f=()=>n(`dataTable`,i),p=e=>e?r(f().resizeColumnText,{label:e}):f().resizeColumnLabel,m=e=>r(f().resizeText,{px:e}),h=n=>t(f(),`groupRows`,n,{count:e(n,{decimals:0})}),g=e=>e?r(f().savedText,{label:e}):f().rowSavedText,_=t=>r(f().rowsSavedText,{n:e(t,{decimals:0})}),v=(e,t)=>`${e?r(f().wasNotSavedText,{label:e}):f().rowWasNotSavedText}${t?` ${t}`:``}`,y=t=>e(t,{decimals:0}),b=e=>Math.min(o,Math.max(48,Math.round(Number(e)||0)));function x(e,t,n=[]){let r=new Map(n.map(e=>[e,[]]));return e.forEach((e,n)=>{let i=t(e,n),a=r.get(i);a||(a=[],r.set(i,a)),a.push(e)}),[...r].filter(([,e])=>e.length>0).map(([e,t])=>({key:e,items:t}))}function S({scrollTop:e,viewport:t,rowHeight:n,count:r,overscan:i=8}){let a=n>0?n:d.cozy,o=Math.floor(Math.max(0,e)/a),s=Math.max(0,o-i);s-=s%2;let c=Math.min(r,o+Math.ceil(Math.max(0,t)/a)+i),l=Math.min(s,c);return{start:l,end:c,before:l*a,after:Math.max(0,r-c)*a}}var C=e=>`wui-widths:${e}`;function w(e){if(!e)return{};try{let t=JSON.parse(window.localStorage.getItem(C(e))||`{}`),n={};if(t&&typeof t==`object`)for(let[e,r]of Object.entries(t))Number.isFinite(r)&&(n[e]=b(r));return n}catch{return{}}}function T(e,t){if(e)try{Object.keys(t).length?window.localStorage.setItem(C(e),JSON.stringify(t)):window.localStorage.removeItem(C(e))}catch(e){if(!(e instanceof DOMException))throw e}}var E=(e,t)=>`--wui-pin-${e}-${t}`,D=`--wui-pin-at`,O=(e,t)=>`var(${E(e,t)}, 0px)`;function k(e){let t=e.map(()=>null),n=-1;e.forEach((e,t)=>{e===`start`&&(n=t)});let r=0;for(let i=0;i<=n;i++)(e[i]===`start`||e[i]===`lead`)&&(t[i]={side:`start`,ordinal:r++,edge:!1});let i=t[n];i&&(i.edge=!0);let a=-1;r=0;for(let n=e.length-1;n>=0;n--)e[n]===`end`&&(t[n]={side:`end`,ordinal:r++,edge:!1},a=n);let o=t[a];return o&&(o.edge=!0),t}var A=e=>e?`wui-pin-${e.side}${e.edge?` wui-pin-${e.side}-edge`:``}`:``,j=200,M=220,N=`cubic-bezier(0.22, 1, 0.36, 1)`,P=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,F=e=>e.getAttribute(`data-row-key`)??e;function I(e){let t=[...e];if(t.length>200)return null;let n=/* @__PURE__ */ new Map;for(let e of t)e.hidden||n.set(F(e),e.offsetTop);return n}function L(e,t){let n=[...e];if(!t||n.length>200||P())return 0;let r=0;for(let e of n){if(e.hidden||typeof e.animate!=`function`)continue;let n=t.get(F(e));if(n===void 0)continue;let i=n-e.offsetTop;Math.abs(i)<1||(e.animate([{transform:`translateY(${i}px)`},{transform:`translateY(0)`}],{duration:220,easing:N}),r++)}return r}function R(e,t){if(!e||!t)return!1;let n=new Set(t),r=new Set(e),i=e.filter(e=>n.has(e)),a=t.filter(e=>r.has(e));return i.some((e,t)=>e!==a[t])}var z=[`saving`,`error`],B=`data-wui-save-state`,V=`wui-row-save-error`,H=e=>{let t=e.querySelector(`:scope > .wui-name-cell`);return t instanceof HTMLTableCellElement?t:[...e.cells].find(e=>!e.matches(`.wui-select-cell, .wui-expand-cell`))??null};function U(e){let t=H(e);if(!t)return``;let n=t.querySelector(`.u-name`);if(n)return(n.textContent??``).trim();let r=``;for(let e of t.childNodes)e instanceof Element&&e.classList.contains(`wui-row-save-error`)||(r+=e.textContent??``);return r.replace(/\s+/g,` `).trim()}function W(e,t,n=``){if(t!==null&&!z.includes(t))throw Error(`A row's save state is ${z.join(` or `)} (or null to clear it), not "${t}".`);e.querySelector(`:scope > * > .${V}`)?.remove(),t===null?e.removeAttribute(B):e.setAttribute(B,t),t===`saving`?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`);let r=t===`error`&&n?H(e):null;if(r){let t=e.ownerDocument.createElement(`span`);t.className=V,t.textContent=n,r.append(t)}}function G(e,t){let n=[];if(!e)return n;for(let[r,i]of e){let e=t.get(r);i.state===`saving`&&e&&e.state!==`saving`&&n.push({label:e.label,ok:e.state!==`error`,message:e.message||``})}return n}function K(e){let t=e.filter(e=>e.ok),n=[],[r]=t;t.length===1&&r?n.push(g(r.label)):t.length>1&&n.push(_(t.length));for(let t of e)t.ok||n.push(v(t.label,t.message));return n.join(` `)}export{K as A,E as C,p as D,w as E,m as F,T as I,W as M,G as N,U as O,S as P,A as S,L as T,h as _,s as a,v as b,j as c,V as d,z as f,x as g,y as h,l as i,g as j,R as k,M as l,b as m,a as n,c as o,u as p,D as r,d as s,o as t,B as u,H as v,k as w,O as x,I as y};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./buttonClass-C8BRtTk8.js";import{i as n,n as r,r as i,t as a}from"./dom-DMQu--xV.js";import{t as o}from"./loader-C2hgZrCR.js";import{r as s,t as c}from"./textStore-DBplASiZ.js";import{t as l}from"./drawer.g-B-zYKBfQ.js";import{a as u,i as d,n as f,r as p,t as m}from"./tableSelect.g-Bmd-ExRE.js";import{M as h,O as ee,T as te,b as ne,j as re,y as ie}from"./dataTable-VB3nBucm.js";import{n as g,t as _}from"./devWarn-DXdRWZs3.js";import{t as ae}from"./hasOwn-CJsplJ62.js";import{t as oe}from"./svgNodes-CyPS2oFH.js";import{t as se}from"./serverHtml-BC6tAyAl.js";import{t as ce}from"./iconGlyphs.g-Dj8sa1HF.js";import{LIST_QUERY_RESERVED as le,SEARCH_PARAM as ue}from"./listQuery.js";import{t as de}from"./dataTable.g-DazoWWps.js";import{c as fe,d as v,u as pe}from"./wuiHttp-BWf9dDsZ.js";var y=()=>s(`tableSelect`,m),b=`wui-select-cell`,x=(e,t)=>{let n=e.createElement(`input`);return n.type=`checkbox`,n.className=`wui-check`,n.setAttribute(`aria-label`,t),n};function me(e=document){let t=e.createElement(`th`);return t.className=b,t.appendChild(x(e,y().selectAllLabel)),t}function he(e=document,{disabled:t=!1}={}){let n=e.createElement(`td`);n.className=b;let r=x(e,y().selectRowLabel);return r.disabled=t,n.appendChild(r),n}function S(e=document){let t=e.createElement(`td`);return t.className=b,t}var ge=e=>e.firstElementChild?.classList.contains(b),C=e=>e.matches(`.wui-group-row, .wui-virtual-spacer, .wui-row-expanded`),w=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n);function _e(e){for(let t of e){if(ge(t)||C(t))continue;let e=t.getAttribute(`data-row-selectable`)===`false`;t.insertBefore(he(t.ownerDocument,{disabled:e}),t.firstChild)}}function ve(e){let t=e.querySelector(`thead tr`);if(!(t instanceof HTMLTableRowElement))return null;ge(t)||t.insertBefore(me(e.ownerDocument),t.firstChild),_e(w(e,`tbody tr`,HTMLTableRowElement));for(let t of w(e,`tfoot tr`,HTMLTableRowElement))ge(t)||t.insertBefore(S(e.ownerDocument),t.firstChild);let n=t.querySelector(`.${b} .wui-check`);return n instanceof HTMLInputElement?n:null}function ye(e){let t=e.querySelector(`thead .${b} .wui-check`),n=w(e,`tbody tr .wui-check:not(:disabled)`,HTMLInputElement),r=n.length,i=n.filter(e=>e.checked).length;t instanceof HTMLInputElement&&(t.checked=r>0&&i===r,t.indeterminate=i>0&&i<r);for(let t of w(e,`tbody tr`,HTMLTableRowElement)){let e=t.querySelector(`.wui-check`);t.classList.toggle(`is-selected`,e instanceof HTMLInputElement&&e.checked)}return{selected:i,total:r}}var be=`tbody .${b} .wui-check:not(:disabled)`;function xe(e,t){let n=null,r=e=>e instanceof Element&&e.matches(`.wui-select-cell .wui-check:not(:disabled)`)&&!!e.closest(`tbody`);e.addEventListener(`mousedown`,e=>{e.shiftKey&&r(e.target)&&e.preventDefault()}),e.addEventListener(`click`,i=>{let a=i.target;if(r(a)){if(i.shiftKey&&n?.isConnected&&n!==a){let r=w(e,be,HTMLInputElement),i=r.indexOf(n),o=r.indexOf(a);if(i>=0&&o>=0){let e=[];for(let t of r.slice(Math.min(i,o),Math.max(i,o)+1))t!==a&&t.checked!==a.checked&&(t.checked=a.checked,e.push(t));e.length&&t?.(e,a.checked)}}n=a}})}var T=()=>s(`dataTable`,de),Se=5,Ce=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement||e instanceof HTMLFieldSetElement||e instanceof HTMLObjectElement||e instanceof HTMLOutputElement,we=e=>e instanceof HTMLObjectElement||e instanceof HTMLOutputElement?!1:e.disabled,Te=e=>Ce(e)&&`type`in e&&e.type===`hidden`,E=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n),D=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},O=(e,t,n)=>{let r=e.closest(t);return r instanceof n?r:null},Ee=e=>e.localName===`wui-select`,De=/* @__PURE__ */ new WeakMap,k=(e,t)=>{let n=Number(e);return Number.isInteger(n)?n:t},Oe=e=>({total:k(e.dataset.total,0),totalCapped:e.dataset.totalCapped===`true`,page:k(e.dataset.page,1),pageSize:k(e.dataset.pageSize,0),sortBy:e.dataset.sortBy||``,sortOrder:e.dataset.sortOrder===`desc`?`desc`:`asc`,pending:e.dataset.totalPending===`true`,rowCount:k(e.dataset.rowCount,0)}),ke=(e,t)=>{e&&P().toast(e,{variant:t})},Ae=(e,t)=>{if(!e)return;let n=new Set([...e.elements].filter(e=>!Te(e)||e.hasAttribute(`data-range-mirror`)).map(e=>e.getAttribute(`name`)).filter(e=>e&&!le.includes(e))),r=[...t].some(([e,t])=>t!==``&&n.has(e));for(let t of E(e,`[data-wui-filter-clear]`,HTMLElement))t.hidden=!r},je=new Intl.NumberFormat(`en-IN`),Me=(e,t)=>t?`${je.format(e)}+`:je.format(e),Ne=(e,t,n)=>{let r=e.closest(`.wui-list-card`),i=r?D(r,`.wui-list-card-count`,HTMLElement):null;i&&(i.textContent=Me(t,n))};function Pe(e=document){let t=E(e,`[data-wui-server]`,HTMLElement);e instanceof HTMLElement&&e.matches(`[data-wui-server]`)&&t.unshift(e);for(let e of t){if(De.has(e))continue;let t=Fe(e);De.set(e,t),e.hasAttribute(`data-load-first-page`)&&t.reload()}}function A(e){let t=e instanceof Element?O(e,`[data-wui-server]`,HTMLElement):null;return t&&De.get(t)||null}function Fe(i){let a=D(i,`.table-wrap`,HTMLElement),o=a?D(a,`:scope > table`,HTMLTableElement):null,s=i.dataset.src;if(!a||!o||!s)throw Error(`A server-paged table needs data-src and a .table-wrap > table: render it with <app-data-table src>.`);let l=D(a,`:scope > [data-wui-table-state]`,HTMLElement),u=D(i,`[data-wui-table-pager]`,HTMLElement),d=D(i,`[data-wui-table-status]`,HTMLElement),f={urlState:i.dataset.urlState!==`false`,refreshOnSuccess:i.dataset.refreshOnSuccess!==`false`,filtersForm:i.dataset.filtersForm||null,filtersRegion:i.dataset.filtersRegion||null,searchInput:i.dataset.searchInput||null,loadingText:i.dataset.loadingText||T().loadingText,errorText:i.dataset.errorText||T().errorText,timeoutMs:pe(i.getAttribute(`data-wui-timeout`))??3e4},p=new URL(s,window.location.href),m=i.dataset.totalSrc||null,ae=m===null?null:new URL(m,window.location.href),oe=/* @__PURE__ */ new Set([...p.searchParams.keys(),...ae?.searchParams.keys()??[]]),de=o.hasAttribute(`data-app-datatable-selectable`),y=/* @__PURE__ */ new Set,x=!1,me=fe(),he=new AbortController,S={signal:he.signal},ge=D(o,`:scope > tbody[data-wui-rows]`,HTMLTableSectionElement),C=n(ge,`A server-paged table needs its rows in <app-table-rows> (tbody[data-wui-rows]).`),w=Oe(C),be=null,De=null,je=e=>{let t=new URLSearchParams;for(let[n,r]of new URLSearchParams(e))oe.has(n)||t.append(n,r);return t},Pe=e=>je(new URL(e,window.location.href).search),A=e=>{let t=e.toString();return`${window.location.pathname}${t?`?${t}`:``}${window.location.hash}`},Fe=(e,t)=>{let n=new URL(e.href);for(let[e,r]of t)oe.has(e)||n.searchParams.append(e,r);return n.origin===window.location.origin?`${n.pathname}${n.search}`:n.href},Ie=e=>Fe(p,e),Le=(e,t)=>{let n=new URLSearchParams(e);return n.has(`page`)&&n.set(`page`,String(t.page)),n.has(`pageSize`)&&n.set(`pageSize`,String(t.pageSize)),n.has(`sortBy`)?t.sortBy?(n.set(`sortBy`,t.sortBy),n.set(`sortOrder`,t.sortOrder)):(n.delete(`sortBy`),n.delete(`sortOrder`)):n.delete(`sortOrder`),n},j=Le(f.urlState?je(window.location.search):new URLSearchParams,w);f.urlState&&A(j)!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,``,A(j));let M=(e,t)=>a.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t})),N=e=>{d&&(d.textContent=e)},ze=e=>{if(e.pending)return e.rowCount===0?T().emptyLabel:c(T().pageTextPending,{page:e.page});if(e.total===0)return T().emptyLabel;let t=e.pageSize>0?Math.max(1,Math.ceil(e.total/e.pageSize)):1,n=e.totalCapped?Me(e.total,!0):`${e.total}`;return c(e.total===1?T().pageTextOne:T().pageTextOther,{page:e.page,pages:t,total:n})},Be=()=>E(o,`:scope > thead > tr:first-child > th`,HTMLTableCellElement),Ve=e=>{if(de&&E(e,`:scope > tr:not(.wui-group-row, .wui-virtual-spacer)`,HTMLTableRowElement).some(e=>!e.dataset.rowKey))throw Error(`A selectable server-paged table needs data-row-key on every row, so a selection can span pages.`)},He=e=>{let t=i.dataset.activeRowKey;if(t!==void 0)for(let n of e){let e=n.classList.contains(`wui-row-active`),r=t!==``&&n.dataset.rowKey===t;n.classList.toggle(`wui-row-active`,r),r?n.setAttribute(`aria-current`,`true`):e&&n.removeAttribute(`aria-current`)}},Ue=e=>{if(de){_e(e);for(let t of e){let e=D(t,`.${b} .wui-check:not(:disabled)`,HTMLInputElement);e&&(x&&y.add(t.dataset.rowKey),e.checked=y.has(t.dataset.rowKey))}ye(o)}He(e);let t=Be();if(o.classList.contains(`wui-table-stack`))for(let n of e)[...n.cells].forEach((e,n)=>{let r=t[n]?.textContent?.trim();r&&!e.hasAttribute(`data-label`)&&e.setAttribute(`data-label`,r)});t.forEach((t,n)=>{if(t.classList.contains(`wui-col-hidden`))for(let t of e)t.cells[n]?.classList.add(`wui-col-hidden`)})},We=e=>Ue(E(e,`:scope > tr`,HTMLTableRowElement)),F=e=>{for(let t of e.querySelectorAll(`:scope > template[data-wui-pager], :scope > template[data-wui-empty], :scope > template[data-wui-filters]`))t.remove()},I=e=>e?.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),Ge=(e,t)=>{if(!l)return;let n=D(e,`:scope > template[data-wui-empty]`,HTMLTemplateElement);I(l),(t.pending?t.rowCount:t.total)===0&&n?(l.replaceChildren(n.content.cloneNode(!0)),l.hidden=!1):(l.replaceChildren(),l.hidden=!0)},Ke=e=>{u&&(I(u),u.replaceChildren(...e?[e.content.cloneNode(!0)]:[]),u.hidden=!1)},qe=e=>{let t=f.filtersRegion&&e?D(document,f.filtersRegion,HTMLElement):null;return t&&e&&(I(t),t.replaceChildren(e.content.cloneNode(!0))),t},Je=0,Ye=e=>{let t=Oe(e);t.pending&&Object.assign(t,{total:w.total,totalCapped:w.totalCapped});let n=t.sortBy!==w.sortBy||t.sortOrder!==w.sortOrder?ie(C.rows):null;Ke(D(e,`:scope > template[data-wui-pager]`,HTMLTemplateElement)),Ge(e,t);let r=qe(D(e,`:scope > template[data-wui-filters]`,HTMLTemplateElement));F(e),I(C),o.replaceChild(e,C),C=e,Je+=1;let i=x&&t.total!==w.total;return w=t,i&&(x=!1),a.removeAttribute(`data-wui-table-error`),We(e),nt(),te(e.rows,n),i&&U(),r},Xe=e=>{let t=D(se(`<table>${e}</table>`),`tbody[data-wui-rows]`,HTMLTableSectionElement);return t&&Ve(t),t?document.importNode(t,!0):null},Ze=(e,t=Be())=>{let n=document.createElement(`tr`);for(let r=0;r<e;r++){let e=t[r],i=e?.classList.contains(`text-center`),a=!i&&(e?.classList.contains(`num`)||e?.classList.contains(`text-end`)||e?.classList.contains(`wui-cell-end`)),o=document.createElement(`td`);i?o.classList.add(`text-center`):a&&o.classList.add(e?.classList.contains(`num`)?`num`:`wui-cell-end`);let s=document.createElement(`span`);s.className=`skeleton`,s.setAttribute(`aria-hidden`,`true`);let c=i?44:a?56:60;s.style.cssText=`display:block;width:${c}%;height:12px;border-radius:6px`,o.append(s),n.append(o)}return n},Qe=()=>{if(C.querySelector(`:scope > tr:not([data-wui-skeleton])`))return;let e=Math.max(1,Be().length);C.replaceChildren(...Array.from({length:Se},()=>{let t=Ze(e);return t.setAttribute(`data-wui-skeleton`,``),t})),a.removeAttribute(`data-wui-table-error`),l&&(l.hidden=!0)},$e=e=>{e?(a.setAttribute(`aria-busy`,`true`),Qe()):a.removeAttribute(`aria-busy`)},L=e=>e===`forbidden`?T().forbiddenMessage:e===`network`?T().networkMessage:e===`timeout`?T().timeoutMessage:f.errorText,et=n=>{let r=L(n);if(a.setAttribute(`data-wui-table-error`,n),u&&(u.hidden=!0),l){let i=document.createElement(`div`);i.className=`empty-state wui-empty-state-table wui-table-error`,i.setAttribute(`role`,`alert`);let a=document.createElement(`span`);a.className=`empty-state-icon`;let o=ce(n===`forbidden`?`lock`:`alert-circle`,{size:24});o&&a.replaceChildren(o);let s=document.createElement(`div`);s.className=`empty-state-title`,s.textContent=r;let c=document.createElement(`div`);c.className=`empty-state-action`;let u=document.createElement(`button`);u.type=`button`,u.className=e(`primary`,`outline`,`sm`),u.dataset.wui=t,u.setAttribute(`data-wui-table-retry`,``),u.textContent=T().retryLabel,c.append(u),i.append(a,s,c),I(l),l.replaceChildren(i),l.hidden=!1}N(r)},R=()=>f.filtersForm?D(document,f.filtersForm,HTMLFormElement):null,z=async(e,t=`none`,{quiet:n=!1}={})=>{let r=new URLSearchParams(e);n||(be={query:r,mode:t},$e(!0),N(f.loadingText)),M(`wui:table:loading`,{query:r.toString()});let o=await me.run(Ie(r),{timeoutMs:f.timeoutMs});if(o.kind===`aborted`||o.kind===`stale`||o.kind===`session`)return o;n||$e(!1);let s=null;if(o.ok)try{s=Xe(o.html)}catch(e){_(e)}if(!o.ok||!s){let e=o.ok?`server`:o.kind;return n?g(`A quiet server table refresh failed; the rows on screen are kept.`,e):et(e),M(`wui:table:error`,{status:o.status,kind:e,message:L(e)}),o}let c=Ye(s);return j=Le(r,w),Ae(R(),j),f.urlState&&t===`push`?window.history.pushState(window.history.state,``,A(j)):f.urlState&&t===`replace`&&window.history.replaceState(window.history.state,``,A(j)),n||N(ze(w)),P().refresh(a),c&&P().refresh(c),w.pending?tt():Ne(i,w.total,w.totalCapped),M(`wui:table:loaded`,{...w,query:j.toString()}),o},B=e=>(e.delete(`page`),e),tt=()=>{if(!ae||!w.pending)return;let e=Je;v(Fe(ae,j),{timeoutMs:f.timeoutMs}).then(t=>{if(e!==Je)return;if(!t.ok){g(`[@webority/ui-elements] A server table's total did not load; its pager keeps Previous and Next.`,t.kind);return}let n=D(se(t.html),`div[data-wui-total]`,HTMLElement);if(!n){g(`[@webority/ui-elements] A server table's count answer has no div[data-wui-total]; its pager keeps Previous and Next.`);return}if(k(n.dataset.page,-1)!==w.page||k(n.dataset.pageSize,-1)!==w.pageSize)return;let r=k(n.dataset.total,-1);if(r<0){g(`[@webority/ui-elements] A server table's count answer has no whole data-total; its pager keeps Previous and Next.`);return}let a=n.dataset.totalCapped===`true`,o=x&&r!==w.total;w={...w,total:r,totalCapped:a,pending:!1},o&&(x=!1);let s=D(n,`:scope > template[data-wui-pager]`,HTMLTemplateElement);s&&Ke(s);let c=qe(D(n,`:scope > template[data-wui-filters]`,HTMLTemplateElement));c&&P().refresh(c),Ne(i,w.total,w.totalCapped),N(ze(w)),o&&U(),M(`wui:table:total`,{total:r,totalCapped:a})})},V=()=>E(o,`:scope > thead th[data-sort-key]`,HTMLTableCellElement),nt=()=>{for(let e of V()){let t=e.dataset.sortKey===w.sortBy;e.setAttribute(`aria-sort`,t?w.sortOrder===`desc`?`descending`:`ascending`:`none`)}};for(let e of V())if(e.classList.add(`sortable`),e.tabIndex=0,!e.querySelector(`.sort-icon`)){let t=e.classList.contains(`num`)||e.classList.contains(`text-end`),n=document.createElement(`span`);n.className=t?`sort-icon wui-sort-lead`:`sort-icon`;let r=ce(`chevrons-up-down`,{size:14});r&&n.replaceChildren(r),t?e.prepend(n):e.append(n)}let H=e=>{let t=B(new URLSearchParams(j)),n=w.sortBy===e&&w.sortOrder===`asc`?`desc`:`asc`;return t.set(`sortBy`,e),t.set(`sortOrder`,n),z(t,`push`)};o.addEventListener(`click`,e=>{let t=e.target instanceof Element?O(e.target,`th[data-sort-key]`,HTMLTableCellElement):null;t&&o.tHead?.contains(t)&&H(t.dataset.sortKey??``)}),o.addEventListener(`keydown`,e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target instanceof Element?O(e.target,`th[data-sort-key]`,HTMLTableCellElement):null;t&&o.tHead?.contains(t)&&(e.preventDefault(),H(t.dataset.sortKey??``))});let U=()=>{ye(o);let e=x?{selected:w.total,total:w.total,allMatching:x}:{selected:y.size,total:w.total};o.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:e}))};de&&(xe(o,(e,t)=>{for(let n of e){let e=O(n,`tr`,HTMLTableRowElement)?.dataset.rowKey;e&&(t?y.add(e):y.delete(e))}t||(x=!1)}),o.addEventListener(`change`,e=>{let t=e.target;if(t instanceof HTMLInputElement&&t.matches(`.wui-select-cell .wui-check:not(:disabled)`)){if(t.checked||(x=!1),o.tHead?.contains(t))for(let e of E(C,`:scope > tr`,HTMLTableRowElement)){let n=D(e,`.${b} .wui-check:not(:disabled)`,HTMLInputElement);n&&(n.checked=t.checked,t.checked?y.add(e.dataset.rowKey):y.delete(e.dataset.rowKey))}else{let e=O(t,`tr`,HTMLTableRowElement)?.dataset.rowKey;if(!e)return;t.checked?y.add(e):y.delete(e)}U()}})),u&&(u.addEventListener(`click`,e=>{let t=e.target instanceof Element?O(e.target,`a[href]`,HTMLAnchorElement):null;!t||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),z(Pe(t.getAttribute(`href`)??``),`push`))}),u.addEventListener(`change`,e=>{let t=e.target;t instanceof HTMLSelectElement&&t.classList.contains(`tpg-select`)&&t.value&&(e.stopPropagation(),z(Pe(t.value),`push`))}));let rt=()=>{if(!f.searchInput)return null;let e=D(document,f.searchInput,HTMLElement);return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e:e?D(e,`input`,HTMLInputElement):null},W=()=>i.isConnected?!0:(he.abort(),clearTimeout(De??void 0),!1),it=(e,t)=>{let n=[...e.elements].filter(Ce),r=/* @__PURE__ */ new Set;for(let e of n)e.name&&!Te(e)&&r.add(e.name);let i=[];for(let e of n)if(e.name&&!we(e)){if(e instanceof HTMLInputElement&&e.matches(`input[type="hidden"][data-wui-carried]`))r.has(e.name)||i.push([e.name,e.value]);else if(e instanceof HTMLInputElement&&e.matches(`input[type=checkbox], input[type=radio]`))e.checked&&i.push([e.name,e.value]);else if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.matches(`[type=submit], [type=button], [type=reset], [type=image], [type=file]`)||i.push([e.name,e.value]);else if(e instanceof HTMLSelectElement)for(let t of e.selectedOptions)i.push([e.name,t.value])}return(t instanceof HTMLButtonElement||t instanceof HTMLInputElement)&&t.name&&!t.disabled&&i.push([t.name,t.value]),i},G=(e,t)=>{let n=new Set([...e.elements].filter(Ce).map(e=>e.name).filter(Boolean)),r=new URLSearchParams,i=e=>e!==`search`&&le.includes(e);for(let[e,t]of j)e!==`page`&&(i(e)||!n.has(e))&&r.append(e,t);for(let[n,a]of it(e,t))a===``||i(n)||oe.has(n)||r.append(n,a);let a=rt();if(a){r.delete(ue);let e=a.value.trim();e&&r.set(ue,e)}return z(r,`push`)},at=e=>f.filtersForm&&e.closest?.(f.filtersForm)||f.filtersRegion&&e.closest?.(f.filtersRegion)||null;document.addEventListener(`submit`,e=>{W()&&f.filtersForm&&e.target instanceof HTMLFormElement&&e.target.matches(f.filtersForm)&&(e.preventDefault(),G(e.target,e.submitter))},S),document.addEventListener(`change`,e=>{if(!W()||!f.filtersForm||!(e.target instanceof Element))return;let t=O(e.target,f.filtersForm,HTMLFormElement);!t||e.target===rt()||t.hasAttribute(`data-wui-apply-on-change`)||e.target.closest(`wui-filter-popover`)||G(t)},S);let ot=(e,t)=>{if(!e)return;let n=e=>t.get(e)??``;for(let r of E(e,`input[name]:not([type=hidden])`,HTMLInputElement))if(r.type===`checkbox`)r.checked=t.getAll(r.name).includes(r.value);else if(r.type===`radio`){let e=n(r.name)===r.value;if(r.checked===e)continue;r.checked=e,e&&r.dispatchEvent(new Event(`change`))}else r.value!==n(r.name)&&(r.value=n(r.name),r.dispatchEvent(new Event(`input`,{bubbles:!0})));for(let r of E(e,`select[name]`,HTMLSelectElement))if(!r.multiple)r.value=n(r.name);else for(let e of r.options)e.selected=t.getAll(r.name).includes(e.value);for(let r of[...e.querySelectorAll(`wui-select[name]`)].filter(Ee)){let e=r.getAttribute(`name`)??``;r.value=r.mode===`multiple`||r.mode===`tag`?t.getAll(e):n(e)}for(let t of e.querySelectorAll(`wui-date-range`)){let e=t.getAttribute(`start-name`)||t.getAttribute(`name`),r=t.getAttribute(`end-name`);t.value={start:e?n(e):``,end:r?n(r):``}}};document.addEventListener(`click`,e=>{if(!W())return;let t=e.target instanceof Element?O(e.target,`a[href]`,HTMLAnchorElement):null;if(!t||!at(t)||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let n=new URL(t.getAttribute(`href`)??``,window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname)return;e.preventDefault();let r=B(Pe(n.href));ot(t.closest(`form`),r),Ae(t.closest(`form`),r),z(r,`push`)},S),document.addEventListener(`input`,e=>{if(!W())return;let t=rt();t&&e.target===t&&(clearTimeout(De??void 0),De=setTimeout(()=>{if(!W())return;let e=B(new URLSearchParams(j)),n=t.value.trim();n?e.set(ue,n):e.delete(ue),e.toString()!==j.toString()&&z(e,`replace`)},300))},S),f.urlState&&window.addEventListener(`popstate`,()=>{if(!W())return;let e=je(window.location.search),t=rt();t&&(t.value=e.get(`search`)??``),Ae(R(),e),z(e,`none`)},S),document.addEventListener(`wui:modal:success`,()=>{W()&&f.refreshOnSuccess&&z(j,`none`)},S),l?.addEventListener(`click`,e=>{e.target instanceof Element&&e.target.closest(`[data-wui-table-retry]`)&&be&&z(be.query,be.mode)});let st=e=>[...C.rows].find(t=>t.dataset.rowKey===e)??null,K=e=>{if(!e?.trim())return null;let t=se(`<table><tbody>${e}</tbody></table>`);if(t.querySelector(`tbody[data-wui-rows]`))return null;let n=E(t,`table > tbody > tr[data-row-key]`,HTMLTableRowElement);return n.length?n.map(e=>document.importNode(e,!0)):null},ct=(e,t,n)=>{let r=n?e[0]:e.find(e=>e.dataset.rowKey===t.dataset.rowKey);if(!r)return null;let i=[];for(let n of e){let e=n===r?t:st(n.dataset.rowKey);e&&(I(e),e.replaceWith(n),i.push(n))}return Ue(i),P().refresh(a),r},lt=e=>e.message||(e.kind===`forbidden`?T().actionForbiddenMessage:T().actionFailedMessage),ut=e=>{e?.isConnected&&e.getAttribute(`data-wui-save-state`)===`saving`&&h(e,null)},dt=async({url:e,method:t=`POST`,body:n,key:i,row:o}={})=>{if(!e)throw Error("saveRow needs `url`: the handler that saves the row.");let s=i==null,c=s?null:st(String(i));if(!s&&!c)throw Error(`saveRow found no row with data-row-key="${i}" on this page.`);let u=Be().filter(e=>!e.classList.contains(b)),d=o===void 0?c??Ze(Math.max(1,u.length),u):r(o,HTMLTableRowElement,"saveRow's `row` is required to be a row element: the <tr> as it will read, not its HTML.");c&&d!==c?c.replaceWith(d):c||C.insertBefore(d,C.firstChild),d!==c&&Ue([d]),l&&!a.hasAttribute(`data-wui-table-error`)&&(l.hidden=!0),h(d,`saving`);let f=ee(d),p=await v(e,{method:t.toUpperCase(),body:n});if(p.kind===`session`)return!1;if(p.ok){let e=K(p.html),t=e&&d.isConnected?ct(e,d,s):null;return t?N(re(ee(t)||f)):(await z(j,`none`),ut(d)),Re(p,p.toastVariant||`success`),M(`wui:table:saved`,{key:t?.dataset.rowKey??(s?null:String(i)),added:s,status:p.status}),!0}let m=lt(p),te=d;return c&&d!==c&&d.isConnected?(d.replaceWith(c),te=c):s&&!o&&(d.remove(),te=null,l?.childElementCount&&!C.querySelector(`:scope > tr`)&&(l.hidden=!1)),te?.isConnected&&h(te,`error`,m),p.kind!==`aborted`&&ke(m,`danger`),N(ne(f,m)),M(`wui:table:failed`,{key:s?null:String(i),added:s,status:p.status,kind:p.kind,message:m}),!1},ft=async e=>{let t=e.dataset.url;if(!t)throw Error(`A data-wui-row-action button needs data-url: the handler the action posts to.`);let n=O(e,`tr`,HTMLTableRowElement),r=n?.dataset.rowKey??null,i=e.dataset.wuiRowAction||``,a=n?ee(n):``;e.disabled=!0,e.setAttribute(`aria-busy`,`true`),n&&h(n,`saving`);let o=await v(t,{method:(e.dataset.method||`post`).toUpperCase()});if(e.disabled=!1,e.removeAttribute(`aria-busy`),o.kind===`session`||o.kind===`aborted`)ut(n);else{if(o.ok){Re(o,o.toastVariant||`success`);let e=n?.isConnected?K(o.html):null,t=e&&n?ct(e,n,!1):null;t?N(re(ee(t)||a)):(await z(j,`none`),ut(n))}else{let e=lt(o);ke(e,`danger`),n?.isConnected&&h(n,`error`,e),N(ne(a,e))}M(`wui:table:action`,{action:i,key:r,ok:o.ok,status:o.status})}};return o.addEventListener(`click`,e=>{let t=e.target instanceof Element?O(e.target,`[data-wui-row-action]`,HTMLButtonElement):null;t&&C.contains(t)&&!t.disabled&&(e.preventDefault(),ft(t))}),Ve(C),F(C),de&&ve(o),We(C),nt(),w.pending&&(N(ze(w)),tt()),{el:i,reload:async e=>{let t=e?.quiet===!0;return t&&a.getAttribute(`aria-busy`)===`true`?null:z(j,`none`,{quiet:t})},query:()=>new URLSearchParams(j),setQuery:e=>{let t=new URLSearchParams(j);for(let[n,r]of Object.entries(e??{})){t.delete(n);for(let e of Array.isArray(r)?r:[r])e!=null&&e!==``&&t.append(n,String(e))}return e&&`page`in e||t.delete(`page`),z(t,`push`)},saveRow:dt,setActiveRow:e=>{i.dataset.activeRowKey=e==null?``:String(e),He(E(C,`:scope > tr`,HTMLTableRowElement))},selection:{keys:()=>[...y],count:()=>x?w.total:y.size,allMatching:()=>x,selectAllMatching:()=>{if(w.pending)g(`[@webority/ui-elements] select all matching needs the total; the table is still waiting for its count.`);else{x=!0;for(let e of E(C,`:scope > tr`,HTMLTableRowElement)){let t=D(e,`.${b} .wui-check`,HTMLInputElement);t?.disabled||(t&&(t.checked=!0),e.dataset.rowKey&&y.add(e.dataset.rowKey))}U()}},clear:()=>{x=!1,y.clear();for(let e of E(C,`:scope > tr > .${b} .wui-check:not(:disabled)`,HTMLInputElement))e.checked=!1;U()}}}}var Ie=8e3,Le=()=>s(`toast`,f),j=[`success`,`info`,`warning`,`danger`],M=e=>j.some(t=>t===e);function N(e){if(!M(e))throw RangeError(`Unknown toast variant "${e}".`);return e}function P(){return n(window.WUI,`window.WUI is not defined: the Razor behaviour script did not load on this page.`)}function Re(e,t=`success`){if(!e?.message)return;let n=e.toastAction;n?P().toast(e.message,{variant:N(t),duration:Ie,action:{label:n.label,onClick:()=>ze(n)}}):P().toast(e.message,{variant:N(t)})}async function ze(e){let t=await v(e.url,{method:e.method});if(t.kind!==`session`&&t.kind!==`aborted`){if(t.ok){Re(t,t.toastVariant||`success`);for(let e of document.querySelectorAll(`[data-wui-server]`))e instanceof HTMLElement&&e.dataset.refreshOnSuccess!==`false`&&A(e)?.reload()}else P().toast(t.message||Le().failedText,{variant:`danger`})}}var Be=`wui-remote-modal`,Ve=`wui-remote-drawer`,He=Object.freeze({sm:360,md:480,lg:640,xl:720}),Ue=`wui-modal-fullscreen`,We=`wui-modal-wide`,F=Object.freeze({sm:380,md:440,lg:640,xl:880,wide:1080}),I=()=>s(`modal`,p),Ge=e=>pe(e?.getAttribute(`data-wui-timeout`)??null)??3e4,Ke=`a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,qe=`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled]),[contenteditable="true"]`,Je=`[aria-invalid="true"], .is-invalid, .input-validation-error`,Ye=`invalid`,Xe=`.wui-error-summary, [data-wui-form-errors], .validation-summary-errors, [data-valmsg-summary]`,Ze=`[data-wui-modal-content]`,Qe=`[data-wui-pane-close], [data-wui-dismiss]`,$e=()=>i(`button`,{type:`button`,class:`wui-modal-close`,"data-wui-dismiss":!0,"aria-label":I().closeLabel},oe({width:18,height:18,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[[`path`,{d:`M18 6 6 18M6 6l12 12`}]])),L=/* @__PURE__ */ new WeakMap,et=/* @__PURE__ */ new WeakSet;function R(e,t){if(e==null)throw TypeError(`The remote modal needs ${t}, and the page does not have it.`);return e}var z=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:null},B=(e,t,n)=>R(z(e,t),n),tt=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),V=()=>Object.assign(/* @__PURE__ */ Error(`The remote modal load was aborted.`),{name:`AbortError`}),nt=e=>typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`,H=(e,t)=>{let n=e instanceof Element?e.closest(t):null;return n instanceof HTMLElement?n:null},U=e=>ae(F,e),rt=e=>ae(He,e);function W(e){if(e==null||e===``)return null;if(e===`fullscreen`)return{fullscreen:!0};if(U(e))return e===`wide`?{px:F.wide,wide:!0}:{px:F[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported modal size "${String(e)}". Use sm, md, lg, xl, wide, fullscreen or a px number.`)}var it=e=>{if(e.classList.contains(`wui-modal-fullscreen`))return{fullscreen:!0};if(e.classList.contains(`wui-modal-wide`))return{px:F.wide,wide:!0};let t=Number.parseInt(e.style.getPropertyValue(`--wui-modal-max-width`),10);return{px:t>0?t:F.md}},G=(e,t)=>{e.classList.toggle(Ue,!!t.fullscreen),e.classList.toggle(We,!t.fullscreen&&!!t.wide),t.fullscreen?e.style.removeProperty(`--wui-modal-max-width`):e.style.setProperty(`--wui-modal-max-width`,`${t.px}px`)},at=[`center`,`top`];function ot(e){if(e==null||e===``)return null;if(rt(e))return{px:He[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported drawer size "${String(e)}". Use sm, md, lg, xl or a px number.`)}var st=e=>e.container===`drawer`,K=e=>e.container===`pane`,ct=e=>e.container!==`modal`,lt=(e,t)=>st(e)?ot(t):W(t),ut=e=>{let t=typeof e==`string`?document.querySelector(e):e,n=t instanceof HTMLElement?t:null;return n?.matches(`[data-wui-pane-host]`)?n:null},dt=e=>K(e)?e.shell:B(e.shell,`.modal-dialog`,`a dialog frame`);function ft(e=`modal`){let t=e===`drawer`,n=t?Ve:Be,r=document.getElementById(n);if(r)return r;let a=document.createElement(`wui-modal`);a.id=n,a.setAttribute(`data-wui`,`AppModal`);let o=document.createElement(`dialog`);return o.className=t?`modal wui-modal-shell wui-remote-drawer`:`modal wui-modal-shell`,o.style.setProperty(`--wui-modal-max-width`,`${t?He.md:F.md}px`),o.replaceChildren(i(`div`,{class:t?`modal-dialog wui-remote-drawer-dialog`:`modal-dialog modal-dialog-centered wui-rb-dialog`},i(`div`,{class:`modal-content wui-modal`}))),a.append(o),document.body.appendChild(a),a}var pt=e=>i(`div`,{class:`wui-modal-header`},i(`div`,{class:`wui-modal-heading`},i(`div`,{class:`wui-modal-headtext`},i(`div`,{class:`wui-modal-title`},e))),$e()),mt=e=>i(`div`,{class:`modal-content wui-modal`,"aria-busy":`true`},pt(e),i(`div`,{class:`wui-modal-body`},i(`div`,{class:`wui-modal-loading`,role:`status`},i(`span`,{class:`visually-hidden`},I().loadingLabel),i(`div`,{class:`skeleton wui-modal-skeleton`}),i(`div`,{class:`skeleton wui-modal-skeleton`}),i(`div`,{class:`skeleton wui-modal-skeleton wui-modal-skeleton--short`})))),ht=(n,r)=>{let a={forbidden:I().forbiddenMessage,client:I().clientMessage,server:I().serverMessage,network:I().networkMessage,timeout:I().timeoutMessage};return i(`div`,{class:`modal-content wui-modal`,"data-wui-modal-error":r},pt(n),i(`div`,{class:`wui-modal-body`},i(`div`,{class:`wui-modal-state`,role:`alert`},i(`p`,{class:`wui-modal-state-title`},I().errorTitle),i(`p`,{class:`wui-modal-state-text`},a[r]||I().serverMessage),i(`div`,{class:`wui-modal-state-actions`},i(`button`,{type:`button`,class:e(`primary`,`soft`,`md`),"data-wui-dismiss":!0,"data-wui":t},I().closeLabel),i(`button`,{type:`button`,class:e(`primary`,`solid`,`md`),"data-wui-modal-retry":!0,"data-wui":t},I().retryLabel)))))},q=e=>z(e.shell,`.modal-content`),gt=e=>r(e.cloneNode(!0),HTMLElement,`a card copy is not an element`);function _t(e){e&&e.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0}))}function vt(e,t){let n=q(e),r=n?bt(n):/* @__PURE__ */ new Map;_t(n),n?n.replaceWith(t):dt(e).appendChild(t),xt(t,r),P().refresh()}var yt=`input[type="file"][name]`;function bt(e){let t=/* @__PURE__ */ new Map;for(let n of e.querySelectorAll(yt)){if(!(n instanceof HTMLInputElement))continue;let e=n.files;e&&e.length>0&&t.set(n.name,[...e])}return t}function xt(e,t){if(t.size!==0&&typeof DataTransfer<`u`)for(let n of e.querySelectorAll(yt)){if(!(n instanceof HTMLInputElement))continue;let e=t.get(n.name);if(!e)continue;let r=new DataTransfer;for(let t of e)r.items.add(t);n.files=r.files,n.dispatchEvent(new Event(`change`,{bubbles:!0}))}}var St=e=>K(e)?!e.shell.hidden:e.host.hasAttribute(`open`);function Ct(e,t,n=!1){let r=t?z(e,Je):null,i=r?r.matches(Ke)?r:z(r,Ke)||r:null;if(!i&&n)i=z(e,`[data-autofocus]`)||z(e,qe)||z(e,`.wui-modal-close`);else if(!i){let t=tt(e,Ke);i=z(e,`[data-autofocus]`)||t.find(e=>!e.classList.contains(`wui-modal-close`))||t[0]||e}r?i?.focus?.():i?.focus?.({preventScroll:!0})}function wt(e,t){let n=z(e.shell,`[data-wui-modal-live]`);n||(n=document.createElement(`div`),n.className=`visually-hidden`,n.setAttribute(`aria-live`,`assertive`),n.setAttribute(`data-wui-modal-live`,``),dt(e).appendChild(n)),n.textContent=``,n.textContent=t}var Tt=e=>{let t=z(e.shell,`[data-wui-modal-live]`);t&&(t.textContent=``)},Et=(e,t,n)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))};function Dt(e,t,n,r){let i={...r,container:e.container};Et(t,`wui:modal:${n}`,i),st(e)&&Et(t,`wui:drawer:${n}`,i),K(e)&&Et(t,`wui:pane:${n}`,i)}var Ot=e=>e.matches(`[data-wui-pane-host]`)?`pane`:B(e,`dialog`,`a dialog`).classList.contains(`wui-remote-drawer`)?`drawer`:`modal`,kt=e=>R(e.host.closest(`wui-modal`),`a wui-modal host`);function At(e){let t=L.get(e);if(t)return t;let n=Ot(e),r=n===`pane`?e:B(e,`dialog`,`a dialog`),a=q({shell:r}),o={host:e,shell:r,container:n,queue:fe(),defaultSize:it(r),defaultLabel:r.getAttribute(`aria-label`),placeholder:a?gt(a):i(`div`,{class:`modal-content wui-modal`}),remoteUrl:e.getAttribute(`data-wui-remote-url`),cache:e.getAttribute(`data-wui-remote-cache`)===`true`,loadedUrl:null,session:null};return L.set(e,o),e.addEventListener(`submit`,e=>Zt(o,e)),e.addEventListener(`click`,e=>{H(e.target,`[data-wui-modal-retry]`)&&o.session&&(e.preventDefault(),Lt(o,o.session))}),K(o)&&e.addEventListener(`click`,t=>{let n=H(t.target,Qe);n&&e.contains(n)&&o.session&&J(o,o.session,`dismissed`,null)}),e.addEventListener(`wui-modal-close`,t=>{t.target===e&&t instanceof CustomEvent&&qt(t.detail,`reason`)===`escape`&&e.querySelector(`form[data-wui-submitting]`)&&t.preventDefault()}),e.addEventListener(`wui-modal-closed`,t=>{t.target===e&&Pt(o)}),e.addEventListener(`wui-modal-opened`,t=>{if(t.target!==e)return;let n=q(o);o.session&&n?.matches(Ze)&&!n.contains(document.activeElement)&&Ct(n,!1,ct(o))}),o.remoteUrl&&e.addEventListener(`wui-modal-open`,t=>{t.target===e&&Ft(o,t)}),o}function jt(e,t,n){e.session&&(e.queue.abort(),e.session.resolveClosed({status:`dismissed`,detail:{replaced:!0}}));let r=()=>void 0,i=new Promise(e=>{r=e}),a={url:t,method:(n.method||`GET`).toUpperCase(),body:n.body,options:n,trigger:n.trigger||null,explicitSize:null,closing:null,resolveClosed:r,handle:{el:e.shell,closed:i,close:()=>J(e,a,`dismissed`,null),reload:()=>Lt(e,a)}};return e.session=a,a}function J(e,t,n,r){e.session===t&&(t.closing={status:n,detail:r},K(e)?Nt(e,t):Mt(e))}function Mt(e){let t=kt(e);t.dispatchEvent(new CustomEvent(`wui-modal-close`,{bubbles:!0,cancelable:!0,detail:{reason:`dismiss`}}))&&t.hide()}function Nt(e,t){let n=e.shell,{status:r,detail:i}=R(t.closing,`the closing state`),a=n.contains(document.activeElement);e.queue.abort(),e.session=null,_t(q(e)),n.replaceChildren(),n.hidden=!0,n.removeAttribute(`data-open`),t.resolveClosed({status:r,detail:i}),Dt(e,n,`closed`,{status:r,url:t.url}),a&&t.trigger?.isConnected&&t.trigger.focus?.()}function Pt(e){let t=e.session;if(e.queue.abort(),e.session=null,Tt(e),t){let n=t.closing||{status:`dismissed`,detail:null};t.resolveClosed({status:n.status,detail:n.detail}),Dt(e,e.shell,`closed`,{status:n.status,url:t.url});let r=document.activeElement;t.trigger?.isConnected&&(!r||r===document.body||e.shell.contains(r))&&t.trigger.focus?.()}e.cache||(vt(e,gt(e.placeholder)),e.loadedUrl=null,G(e.shell,e.defaultSize),e.defaultLabel?e.shell.setAttribute(`aria-label`,e.defaultLabel):e.shell.removeAttribute(`aria-label`))}function Ft(e,t){let n=qt(t instanceof CustomEvent?t.detail:null,`trigger`),r=n instanceof HTMLElement?n:null,i=r?.getAttribute(`data-wui-url`)||e.remoteUrl||``,a=jt(e,i,{trigger:r});a.explicitSize=It(e,r?.getAttribute(`data-wui-size`)),a.explicitSize&&G(e.shell,a.explicitSize),e.cache&&e.loadedUrl===i||(e.loadedUrl&&vt(e,gt(e.placeholder)),Lt(e,a,{keepPlaceholder:!0}))}function It(e,t){try{return lt(e,t)}catch(e){return _(e),null}}async function Lt(e,t,{keepPlaceholder:n=!1}={}){n||vt(e,mt(t.options.title||Rt(e)));let r=await e.queue.run(t.url,{method:t.method,body:t.body,navigate:t.options.navigate,timeoutMs:Ge(t.trigger)});if(e.session!==t||r.kind===`aborted`||r.kind===`stale`)return`aborted`;if(r.kind===`session`)return`session`;if(r.kind===`ok`&&Ht(e,t,r.html,!1))return e.loadedUrl=t.url,Dt(e,e.shell,`loaded`,{url:t.url,handle:t.handle}),`loaded`;let i=r.kind===`ok`||r.kind===`validation`?`server`:r.kind;return vt(e,ht(t.options.title||Rt(e),i)),St(e)&&Ct(R(q(e),`a card`),!1,ct(e)),Dt(e,e.shell,`error`,{url:t.url,kind:i,status:r.status}),`error`}var Rt=e=>q(e)?.querySelector(`.wui-modal-title`)?.textContent||e.shell.getAttribute(`aria-label`)||``,zt=`/_content/Webority.Ui.Razor/js/`,Bt=e=>new URL(e,window.location.href).pathname.includes(zt);function Vt(e){if([...document.scripts].some(t=>t.getAttribute(`src`)===e))return;let t=document.createElement(`script`);t.src=e,document.head.appendChild(t)}function Ht(e,t,n,r){let i=se(n),a=!1;for(let e of i.querySelectorAll(`script`)){if(e.getAttribute(`type`)===`application/json`)continue;let t=e.getAttribute(`src`);e.remove(),t&&Bt(t)?Vt(t):a=!0}a&&g(`WUI.modal: ${t.url} returned a fragment with script; it was removed. Keep page behaviour in the page.`);let o=z(i,Ze);if(!o)return _(`WUI.modal: ${t.url} did not answer with an <app-modal-content> fragment.`),!1;if(vt(e,o),r||Tt(e),!K(e)){G(e.shell,t.explicitSize||It(e,o.getAttribute(`data-wui-size`))||e.defaultSize);let n=o.getAttribute(`data-wui-title`);n&&e.shell.setAttribute(`aria-label`,n)}return St(e)&&Ct(o,r,ct(e)),!0}var Ut=`button[type="submit"], button:not([type]), input[type="submit"], input[type="image"]`;function Wt(e,t,n){let r=[...e.elements].filter(e=>e.matches(Ut));if(n){e.setAttribute(`data-wui-submitting`,``);let n=t&&r.includes(t)?t:r[0];for(let e of r)e.toggleAttribute(`data-wui-was-disabled`,e.disabled),e.disabled=!0;n&&(n.classList.add(`is-loading`),n.setAttribute(`aria-busy`,`true`),n.tagName===`BUTTON`&&n.prepend(i(`span`,{class:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`,"data-wui-submit-spinner":!0})))}else{e.removeAttribute(`data-wui-submitting`);for(let e of r)e.disabled=e.hasAttribute(`data-wui-was-disabled`),e.removeAttribute(`data-wui-was-disabled`),e.classList.remove(`is-loading`),e.removeAttribute(`aria-busy`),e.querySelector(`[data-wui-submit-spinner]`)?.remove()}}function Gt(e){for(let t of e.querySelectorAll(Xe))t.remove();for(let t of e.querySelectorAll(Je))t.removeAttribute(`aria-invalid`),t.classList.remove(`is-invalid`,`input-validation-error`);for(let t of e.querySelectorAll(`.field-error`))t.textContent=``}var Kt=/* @__PURE__ */ new Set(/* @__PURE__ */ `bad request.unauthorized.payment required.forbidden.not found.method not allowed.not acceptable.proxy authentication required.request timeout.conflict.gone.length required.precondition failed.payload too large.uri too long.unsupported media type.range not satisfiable.expectation failed.misdirected request.unprocessable content.unprocessable entity.locked.failed dependency.too early.upgrade required.precondition required.too many requests.request header fields too large.unavailable for legal reasons`.split(`.`)),qt=(e,t)=>{if(typeof e==`object`&&e&&t in e)return Reflect.get(e,t)};async function Jt(e){if(!e||e.status<400||e.status>499||!e.headers.get(`content-type`)?.toLowerCase().includes(`json`))return null;let t;try{t=JSON.parse(await e.text())}catch{return null}let n=e=>typeof e==`string`?e.trim():``,r=n(qt(t,`title`)),i=(e.statusText||``).trim().toLowerCase(),a=Kt.has(r.toLowerCase())||r.toLowerCase()===i;return n(qt(t,`message`))||n(qt(t,`detail`))||(r&&!a?r:null)}function Yt(e,t,n,r){let i={forbidden:I().forbiddenMessage,client:I().clientMessage,server:I().serverMessage,network:I().networkMessage,timeout:I().timeoutMessage},a=t.closest(`.wui-modal-body`)||t;a.querySelector(`[data-wui-modal-submit-error]`)?.remove(),Gt(a);let o=document.createElement(`div`);o.className=`alert alert-danger wui-modal-submit-error`,o.setAttribute(`role`,`alert`),o.setAttribute(`data-wui-modal-submit-error`,``),o.textContent=`${I().submitFailedMessage} ${r||i[n]||I().serverMessage}`,a.prepend(o),wt(e,o.textContent)}var Xt=(e,t)=>{let n=new URL(e,window.location.href);for(let[e,r]of t)typeof r==`string`&&n.searchParams.append(e,r);return n.origin===window.location.origin?n.pathname+n.search:n.href};async function Zt(e,t){let n=t.target,r=e.session;if(!(n instanceof HTMLFormElement)||!r||n.hasAttribute(`data-wui-native`)||!n.closest(Ze)||(t.preventDefault(),n.hasAttribute(`data-wui-submitting`)))return;let i=`submitter`in t&&(t.submitter instanceof HTMLButtonElement||t.submitter instanceof HTMLInputElement)?t.submitter:null,a=i?.getAttribute(`formaction`)||n.getAttribute(`action`)||r.url,o=(i?.getAttribute(`formmethod`)||n.getAttribute(`method`)||`GET`).toUpperCase(),s=new FormData(n);i?.name&&!s.has(i.name)&&s.append(i.name,i.value);let c=o===`GET`;Wt(n,i,!0);let l;try{l=await e.queue.run(c?Xt(a,s):a,{method:o,body:c?void 0:s,navigate:r.options.navigate,timeoutMs:Ge(r.trigger)})}catch(t){_(t),e.session===r&&n.isConnected&&(Wt(n,i,!1),Yt(e,n,`server`,null));return}if(e.session!==r)return;if(n.isConnected&&Wt(n,i,!1),l.kind===`ok`&&l.result===`success`){Qt(e,r,l);return}if(l.kind===`aborted`||l.kind===`stale`||l.kind===`session`)return;if(l.kind===`ok`&&l.html){let t=l.result===Ye;if(Ht(e,r,l.html,t)){if(t){let t=R(q(e),`a card`).querySelector(Xe)?.textContent?.replace(/\s+/g,` `).trim();wt(e,t||I().invalidMessage)}return}}let u=l.kind===`ok`||l.kind===`validation`?`server`:l.kind,d=await Jt(l.response);e.session===r&&Yt(e,n,u,d)}function Qt(e,t,n){let r=n.message,i=n.redirect||null,a=n.toastVariant||`success`;if(!dn(a))throw TypeError(`Unknown toast variant "${a}". Use ${un.join(`, `)}.`);let o={url:t.url,trigger:t.trigger,handle:t.handle,message:r,redirect:i,data:n.data??null,container:e.container};i&&!t.options.navigate?Mn(r,a):r&&P().toast(r,{variant:a}),Dt(e,t.trigger?.isConnected?t.trigger:document,`success`,o),t.options.onSuccess?.(o,t.handle),i&&(t.options.navigate||(e=>window.location.assign(e)))(i);let s=n.next;s&&!i?(t.url=s,t.method=`GET`,t.body=void 0,Lt(e,t)):n.keepOpen?n.html&&Ht(e,t,n.html,!1):J(e,t,`success`,o)}function $t(e){let t=H(e.target,`[data-wui-modal], [data-wui-drawer], [data-wui-pane]`);t&&(t.matches(`a[href]`)&&(e.ctrlKey||e.metaKey||e.shiftKey||e.button!==0)||(e.preventDefault(),t.hasAttribute(`data-wui-pane`)?sn(t.getAttribute(`data-wui-pane`)??``,{target:t.getAttribute(`data-wui-pane-target`),trigger:t}).catch(e=>{nt(e)||_(e)}):t.hasAttribute(`data-wui-modal`)?nn(t.getAttribute(`data-wui-modal`)??``,{size:t.getAttribute(`data-wui-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{nt(e)||_(e)}):an(t.getAttribute(`data-wui-drawer`)??``,{size:t.getAttribute(`data-wui-drawer-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{nt(e)||_(e)})))}function en(e){if(e.key!==`Escape`||e.defaultPrevented)return;let t=H(e.target,on);if(!t)return;let n=L.get(t),r=e.currentTarget;n?.session&&r instanceof Document&&!r.querySelector(`wui-modal[open]`)&&(t.querySelector(`form[data-wui-submitting]`)||(e.preventDefault(),J(n,n.session,`dismissed`,null)))}function tn(e=document){let t=e instanceof Document?e:R(e.ownerDocument,`an owner document`);et.has(t)||(et.add(t),t.addEventListener(`click`,$t),t.addEventListener(`keydown`,en));let n=tt(e,`wui-modal[data-wui-remote-url]`);e instanceof HTMLElement&&e.matches(`wui-modal[data-wui-remote-url]`)&&n.unshift(e);for(let e of n)At(e)}function nn(e,t={}){try{if(!e)throw TypeError(`WUI.modal.load: a fragment url is required.`);let n=t.container===`drawer`,r=n?ot(t.size):W(t.size),i=t.placement||`center`;if(!at.includes(i))throw TypeError(`WUI.modal.load: unsupported placement "${i}". Use center or top.`);if(t.signal?.aborted)return Promise.reject(V());let a=ft(n?`drawer`:`modal`);tn(document);let o=At(a),s=St(o),c=jt(o,e,t);c.explicitSize=r,G(o.shell,r||o.defaultSize),n||B(o.shell,`.modal-dialog`,`a dialog frame`).classList.toggle(`modal-dialog-centered`,i===`center`),t.title&&o.shell.setAttribute(`aria-label`,t.title),s||(a.toggleAttribute(`static`,t.staticBackdrop!==!1),a.toggleAttribute(`no-escape`,t.closeOnEscape===!1));let l=s?Promise.resolve():new Promise(e=>a.addEventListener(`wui-modal-opened`,()=>e(),{once:!0})),u=Lt(o,c);return s||kt(o).show(),rn(o,c,t,l,u,`WUI.modal.load`)}catch(e){return Promise.reject(e)}}function rn(e,t,n,r,i,a){let o=new Promise((r,i)=>{n.signal?.addEventListener(`abort`,()=>{e.session===t&&(e.queue.abort(),J(e,t,`dismissed`,{aborted:!0})),i(V())},{once:!0})}),s=Promise.all([r,i]).then(([,e])=>{if(e===`aborted`)throw V();if(e===`session`)throw Error(`${a}(${t.url}): the session expired; the browser is signing in again.`);return t.handle});return Promise.race([s,o])}function an(e,t={}){return nn(e,{...t,container:`drawer`,placement:void 0})}var on=`[data-wui-pane-host]`;function sn(e,t={}){try{if(!e)throw TypeError(`WUI.pane.load: a fragment url is required.`);let n=ut(t.target);if(!n)throw TypeError(`WUI.pane.load: the target is not an <app-detail-pane>.`);if(t.signal?.aborted)return Promise.reject(V());tn(document);let r=At(n),i=jt(r,e,t);n.hidden=!1,n.setAttribute(`data-open`,``);let a=Lt(r,i);return rn(r,i,t,Promise.resolve(),a,`WUI.pane.load`)}catch(e){return Promise.reject(e)}}function cn(e){let t=ut(e);if(!t)throw TypeError(`WUI.pane.close: the target is not an <app-detail-pane>.`);let n=L.get(t);n?.session&&J(n,n.session,`dismissed`,null)}var Y=`wuiConfirm`,ln=Object.freeze([`danger`]),un=Object.freeze([`success`,`info`,`warning`,`danger`]),dn=e=>un.some(t=>t===e),fn=`wui.flash`,X=()=>s(`confirmDialog`,d),pn=/* @__PURE__ */ new WeakSet,mn=/* @__PURE__ */ new WeakSet,hn=null,gn=null,_n=!1,vn=(e,t)=>{e&&P().toast(e,{variant:t})};function yn(){let r=document.getElementById(Y);if(r)return n(r.closest(`wui-modal`),`#${Y} must be a wui-modal.`);let a=document.createElement(`wui-modal`);a.id=Y;let o=document.createElement(`dialog`);return o.className=`modal wui-modal-shell`,o.style.setProperty(`--wui-modal-max-width`,`${F.md}px`),o.replaceChildren(i(`div`,{class:`modal-dialog modal-dialog-centered wui-rb-dialog`},i(`div`,{class:`modal-content wui-modal wui-confirm`},i(`div`,{class:`wui-modal-body`},i(`div`,{class:`wui-confirm-content`},i(`span`,{class:`wui-confirm-icon`},i(`wui-status-icon`,{tone:`info`,size:120})),i(`h3`,{class:`wui-confirm-title`,tabindex:-1,"data-autofocus":``}),i(`p`,{class:`wui-confirm-msg`}))),i(`div`,{class:`wui-modal-footer`},i(`div`,{class:`wui-confirm-actions`},i(`button`,{type:`button`,class:e(`primary`,`soft`,`md`),"data-wui-dismiss":``,"data-wui":t},X().cancelLabel),i(`button`,{type:`button`,class:e(`primary`,`solid`,`md`),"data-app-confirm":``,"data-wui":t})))))),a.append(o),document.body.appendChild(a),a}function bn(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!ln.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);xn({title:e.getAttribute(`data-wui-confirm-title`),message:e.getAttribute(`data-wui-confirm`),label:e.getAttribute(`data-wui-confirm-label`),danger:n===`danger`},t)}function xn({title:e,message:t,label:r,danger:i},a){let o=yn(),s=o.querySelector(`.wui-confirm-title`),c=o.querySelector(`[data-app-confirm]`);if(!s||!c)throw Error(`#${Y} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${Y}"> without confirm-href, or leave the dialog to the library.`);let l=o.querySelector(`.wui-confirm-msg`);l||(l=document.createElement(`p`),l.className=`wui-confirm-msg`,s.after(l));let u=e||X().confirmTitle;s.textContent=u,l.textContent=t,c.textContent=r||X().confirmLabel,c.classList.toggle(`btn-danger`,i),c.classList.toggle(`btn-primary`,!i),o.querySelector(`wui-status-icon`)?.setAttribute(`tone`,i?`delete`:`info`),n(o.querySelector(`dialog`),`#${Y} has no <dialog>.`).setAttribute(`aria-label`,u),gn=a,_n=!1,o.show()}var Sn=(e,t)=>{hn=e;try{t()}finally{hn=null}},Cn=(e,t)=>{let n=Reflect.get(e,t);if(n===void 0||typeof n==`string`)return n;throw TypeError(`confirmAction: ${t} must be text.`)},wn=e=>{if(typeof e!=`object`||!e)throw TypeError(`confirmAction: options must be an object with a message.`);let t=`message`in e?e.message:void 0;if(typeof t!=`string`)throw TypeError(`confirmAction: message must be text.`);return{title:Cn(e,`title`),message:t,label:Cn(e,`label`),tone:Cn(e,`tone`)}};function Tn(e,t,n){let{title:r,message:i,label:a,tone:o}=wn(t);if(o!=null&&!ln.includes(o))throw TypeError(`confirmAction: tone "${o}" is not supported. Use danger, or leave it off.`);Jn(e.ownerDocument),xn({title:r,message:i,label:a,danger:o===`danger`},()=>Sn(e,n))}var En=e=>`disabled`in e&&e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`,Dn=e=>{r(e,HTMLElement,`data-wui-confirm needs an HTML element to click.`).click()};function On(e){let t=a(e.target,`[data-wui-confirm]:not(form)`);t&&t!==hn&&!En(t)&&(e.preventDefault(),e.stopImmediatePropagation(),bn(t,()=>Sn(t,()=>Dn(t))))}function kn(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===hn||e.submitter&&e.submitter===hn||t.querySelector(`input[data-app-repeater-hidden]`))return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter instanceof HTMLButtonElement||e.submitter instanceof HTMLInputElement?e.submitter:null,r=n?.form===t?n:void 0;bn(t,()=>Sn(t,()=>t.requestSubmit(r)))}function An(e){let t=a(e.target,`#${Y} [data-app-confirm]`);t&&!t.hasAttribute(`disabled`)&&gn&&(_n=!0,n(t.closest(`wui-modal`),`#${Y} is missing around its confirm button.`).hide())}function jn(e){if(!(e.target instanceof Element)||e.target.id!==`wuiConfirm`)return;let t=_n?gn:null;gn=null,_n=!1,t?.()}function Mn(e,t){e&&window.sessionStorage.setItem(fn,JSON.stringify({message:e,variant:t}))}var Nn=e=>e===`forbidden`?X().forbiddenMessage:e===`network`?X().networkMessage:e===`timeout`?X().timeoutMessage:X().failedMessage;function Pn(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.getAttribute(`data-refresh-on-success`)!==`false`&&A(e)?.reload()}var Fn=(e,t)=>{`disabled`in e&&(e.disabled=t)};async function In(e){let t=e.getAttribute(`data-wui-post`);if(!t)throw Error(`A data-wui-post button needs the URL the action posts to.`);return Ln(t,e)}async function Ln(e,t,n){let r=t.getAttribute(`data-wui-post-reload`);if(r!==null&&r!==`page`)throw TypeError(`data-wui-post-reload="${r}" is not supported. Use page, or leave it off to reload the server tables.`);Fn(t,!0),t.setAttribute(`aria-busy`,`true`);let i=pe(t.getAttribute(`data-wui-timeout`))??3e4,a=await v(e,{method:`POST`,body:n,timeoutMs:i});if(a.kind===`session`||a.kind===`aborted`)return;let o=a.toastVariant||`success`;a.ok&&(a.redirect||r===`page`)?(Mn(a.message,o),a.redirect?window.location.assign(a.redirect):window.location.reload()):(Fn(t,!1),t.removeAttribute(`aria-busy`),a.ok?(Re(a,o),Pn()):vn(a.message||Nn(a.kind),`danger`))}function Rn(e,t){Fn(e,!1),e.removeAttribute(`aria-busy`),_(t),vn(X().failedMessage,`danger`)}function zn(e){let t=a(e.target,`[data-wui-post]`);t&&(e.preventDefault(),En(t)||t.getAttribute(`aria-busy`)===`true`||In(t).catch(e=>Rn(t,e)))}function Bn(e){let t=a(e.target,`form[data-wui-post-form]`);if(!(t instanceof HTMLFormElement)||e.defaultPrevented)return;e.preventDefault();let r=n(e.submitter||t.querySelector(`button:not(.repeater-add):not(.repeater-remove)`),`A data-wui-post-form needs a submit button to report its result on.`);if(r.getAttribute(`aria-busy`)===`true`)return;let i=new URL(n(t.getAttribute(`action`),`A data-wui-post-form needs an action attribute to post to.`),document.baseURI).href;Ln(i,r,new FormData(t)).catch(e=>Rn(r,e)),t.closest(`wui-dropdown`)?.hide()}var Vn=(e,t)=>{e.disabled=!1,e.removeAttribute(`aria-busy`),t&&h(t,null)};async function Hn(e,t){let n=e.dataset.url;if(!n)throw Error(`A data-wui-row-action button needs data-url: the handler the action posts to.`);e.disabled=!0,e.setAttribute(`aria-busy`,`true`),t&&h(t,`saving`);let r=pe(e.getAttribute(`data-wui-timeout`))??3e4,i=await v(n,{method:(e.dataset.method||`post`).toUpperCase(),timeoutMs:r});if(i.kind===`session`)return;if(i.kind===`aborted`){Vn(e,t);return}if(i.ok){Mn(i.message,i.toastVariant||`success`),i.redirect?window.location.assign(i.redirect):window.location.reload();return}let a=i.message||Nn(i.kind);e.disabled=!1,e.removeAttribute(`aria-busy`),t&&h(t,`error`,a),vn(a,`danger`)}function Un(e){let t=a(e.target,`[data-wui-row-action]`);if(!(t instanceof HTMLButtonElement)||t.closest(`[data-wui-server]`)||(e.preventDefault(),t.disabled||t.getAttribute(`aria-busy`)===`true`))return;let n=t.closest(`tr`);Hn(t,n).catch(e=>{Vn(t,n),_(e),vn(X().failedMessage,`danger`)})}function Wn(){let e=window.sessionStorage.getItem(fn);if(!e)return;window.sessionStorage.removeItem(fn);let t=JSON.parse(e);if(typeof t!=`object`||!t)throw TypeError(`stored flash is not an object.`);let n=`message`in t?t.message:void 0,r=`variant`in t?t.variant:void 0;if(typeof r!=`string`||!dn(r))throw TypeError(`stored flash variant "${String(r)}" is not supported.`);if(typeof n!=`string`)throw TypeError(`stored flash message is not text.`);vn(n,r)}function Gn(e){let t=e.querySelectorAll?[...e.querySelectorAll(`[data-wui-flash]`)]:[];e instanceof Element&&e.matches(`[data-wui-flash]`)&&t.unshift(e);for(let e of t){let t=e.getAttribute(`data-wui-flash-variant`)||`success`;if(!dn(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${un.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||(e.textContent??``).trim();e.remove(),vn(n,t)}}var Kn=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.form:null;function qn(e){if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-wui-auto-submit]`);if(!t)return;let n=Kn(e.target)||t.closest(`form`);n instanceof HTMLFormElement&&n.requestSubmit()}function Jn(e){mn.has(e)||(mn.add(e),e.addEventListener(`click`,An),e.addEventListener(`wui-modal-closed`,jn))}function Yn(e=document){let t=e instanceof Element?e.ownerDocument:e;pn.has(t)||(pn.add(t),t.addEventListener(`click`,On,!0),t.addEventListener(`submit`,kn,!0),Jn(t),t.addEventListener(`click`,zn),t.addEventListener(`click`,Un),t.addEventListener(`submit`,Bn),t.addEventListener(`change`,qn),Wn()),Gn(e)}var Xn=()=>s(`unsavedChanges`,u),Zn=`form[data-wui-unsaved]`,Qn=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,$n=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,er=/* @__PURE__ */ new Set([`submit`,`button`,`reset`,`image`]),tr=/* @__PURE__ */ new Set([`hidden`,`checkbox`,`radio`,`file`,`submit`,`button`,`reset`,`image`,`range`,`color`]),nr=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement||e instanceof HTMLFieldSetElement||e instanceof HTMLObjectElement||e instanceof HTMLOutputElement,rr=e=>nr(e)?e instanceof HTMLObjectElement||e instanceof HTMLOutputElement?!1:e.disabled:`disabled`in e&&!!e.disabled,ir=e=>`name`in e&&typeof e.name==`string`&&e.name!==``,ar=e=>typeof e==`object`&&!!e,or=e=>Array.isArray(e)&&e.every(e=>Array.isArray(e)&&typeof e[0]==`string`);function sr(e){let t=JSON.parse(e);if(!or(t))throw Error(`unsaved-changes snapshot is malformed`);return t}var Z=/* @__PURE__ */ new WeakMap,cr=/* @__PURE__ */ new WeakSet,lr=e=>`${e.name}:${e.size}:${e.lastModified}`,ur=e=>[...e.querySelectorAll(Zn)].filter(e=>e instanceof HTMLFormElement);function Q(e){let t=[];for(let n of e.elements)ir(n)&&!rr(n)&&(nr(n)&&er.has(n.type)||(n instanceof HTMLInputElement&&(n.type===`checkbox`||n.type===`radio`)?t.push([n.name,n.value,n.checked]):n instanceof HTMLInputElement&&n.type===`file`?t.push([n.name,[...n.files||[]].map(lr)]):n instanceof HTMLSelectElement&&n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):n instanceof HTMLFieldSetElement||n instanceof HTMLObjectElement?t.push([n.name,null]):t.push([n.name,`value`in n?n.value:null])));return JSON.stringify(t)}function dr(e){return Q(e)}function fr(e,t){let n=/* @__PURE__ */ new Map,r=sr(t);for(let e of r){let t=n.get(e[0]);t?t.push(e):n.set(e[0],[e])}let i=sr(Q(e)).map(e=>n.get(e[0])?.shift()??e);for(let e of n.values())i.push(...e);return JSON.stringify(i)}function pr(e){for(let t of e.elements)if(nr(t)&&t.name&&!rr(t)){if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!tr.has(t.type)){if(t.value.trim()!==``)return!0}else if(t instanceof HTMLInputElement&&t.type===`file`&&(t.files?.length??0)>0)return!0}return!1}var mr=e=>({saved:e.querySelector(Qn)&&pr(e)?null:Q(e),engaged:!1,discarded:!1});function hr(e){let t=Z.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&Q(e)!==t.saved}var gr=(e,t)=>ur(e).filter(e=>e!==t&&hr(e));function _r(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||Xn().message;Tn(e,{title:Xn().title,message:r,label:Xn().leaveLabel,tone:`danger`},()=>{for(let e of t){let t=Z.get(e);t&&(t.discarded=!0)}n()})}function vr(e){if(e.matches($n))return!1;let t=e.getAttribute(`target`);if(t&&t.toLowerCase()!==`_self`)return!1;let n=e.getAttribute(`href`);if(n===null)return!1;let r=new URL(n,window.location.href);if(r.protocol!==`http:`&&r.protocol!==`https:`)return!1;let i=window.location;return!(r.hash&&r.origin===i.origin&&r.pathname===i.pathname&&r.search===i.search)}function yr(e,t){if((t?.getAttribute(`formmethod`)||e.getAttribute(`method`)||`get`).toLowerCase()===`dialog`)return!1;let n=t?.getAttribute(`formtarget`)||e.getAttribute(`target`);return!n||n.toLowerCase()===`_self`}function br(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target,n=a(t,`a[href]`);if(!(n instanceof HTMLAnchorElement)||!vr(n))return;let r=gr(n.ownerDocument,null);r.length&&(e.preventDefault(),_r(n,r,()=>n.click()))}function xr(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!yr(t,e.submitter))return;let n=gr(t.ownerDocument,t);if(n.length){e.preventDefault();let r=e.submitter,i=(r instanceof HTMLButtonElement||r instanceof HTMLInputElement)&&r.form===t?r:void 0;_r(t,n,()=>t.requestSubmit(i));return}let r=Z.get(t);r&&(r.saved=Q(t),r.discarded=!1)}function Sr(e){gr(document,null).length&&(e.preventDefault(),e.returnValue=``)}function Cr(e){let t=e.target,n=a(t,Zn);return n instanceof HTMLFormElement?n:null}function wr(e){let t=Cr(e);if(!t)return;let n=Z.get(t);n&&!n.engaged&&(n.saved!==null&&(n.saved=Q(t)),n.engaged=!0)}function Tr(e){let t=Cr(e),n=t&&Z.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function Er(e){for(let t of ur(e)){let e=Z.get(t);e?.saved&&(e.saved=fr(t,e.saved))}}function Dr(e){let t=ar(e)?e.handle:void 0;return ar(t)?t.el:void 0}function Or(e){if(!(e instanceof CustomEvent))return;let t=Dr(e.detail);if(t instanceof Element)for(let e of ur(t))Ar(e)}function kr(e=document){let t=e instanceof Document?e:e.ownerDocument;if(!cr.has(t)){cr.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,wr,!0);for(let e of[`input`,`change`])t.addEventListener(e,Tr,!0);t.addEventListener(`click`,br),t.addEventListener(`submit`,xr),t.addEventListener(`wui:modal:success`,Or),t.addEventListener(o,()=>Er(t)),n(t.defaultView,`unsaved-changes guard needs a document with a window`).addEventListener(`beforeunload`,Sr)}let r=ur(e);e instanceof HTMLFormElement&&e.matches(Zn)&&r.unshift(e);for(let e of r)Z.has(e)||Z.set(e,mr(e))}function Ar(e){if(!(e instanceof HTMLFormElement)||!e.matches(Zn))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);Z.set(e,{saved:Q(e),engaged:!1,discarded:!1})}var jr=()=>s(`drawer`,l),Mr=`wui:drawer:discard`,Nr=`wui-drawer[confirm-discard]`,Pr=`wui-modal`,Fr=`data-wui-no-discard`,Ir=`.wui-drawer-discard`,Lr=`input, select, textarea`,Rr=e=>typeof e==`object`&&!!e||typeof e==`function`;function zr(e){let t=e.currentTarget;if(!(t instanceof Document))throw Error(`The discard guard is not wired on a document.`);return t}function Br(e,t){return a(e,t)}var Vr=e=>e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement,$=/* @__PURE__ */ new WeakMap,Hr=/* @__PURE__ */ new WeakSet,Ur=/* @__PURE__ */ new WeakSet;function Wr(n,r,i,a,o){let s=n.createElement(`button`);return s.type=`button`,s.className=e(r,i,`sm`),s.dataset.wui=t,s.setAttribute(a,``),s.textContent=o,s}function Gr(e,t){let n=e.createElement(`div`);n.className=`wui-drawer-discard`,n.setAttribute(`role`,`alert`);let r=e.createElement(`span`);return r.className=`wui-drawer-discard-text`,r.textContent=t,n.append(r,Wr(e,`danger`,`solid`,`data-wui-discard-confirm`,jr().discardLabel),Wr(e,`primary`,`soft`,`data-wui-discard-keep`,jr().keepLabel)),n}function Kr(e){if(!(e instanceof Element))return null;let t=e.closest(Nr);if(t)return t;let n=e.closest(Pr);return n&&Yr(n).length?n:null}function qr(e){return e.closest(Nr)??e.closest(Pr)}function Jr(e,t){return t.hasAttribute(Fr)||e.hasAttribute(Fr)?!1:t.hasAttribute(`confirm-discard`)||e.hasAttribute(`data-wui-confirm-discard`)?!0:(e.getAttribute(`method`)||`get`).toLowerCase()!==`get`}function Yr(e){return e.matches(Nr)?e.querySelectorAll(`form`):[...e.querySelectorAll(`form`)].filter(t=>Jr(t,e))}function Xr(e){let t=$.get(e);return t!=null&&dr(e)!==t}function Zr(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,n(e.querySelector(`.wui-drawer-panel`),`The drawer has no panel to hold its footer.`).append(t),Ur.add(t),t}function Qr(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-modal-footer`,(e.querySelector(`.wui-modal-body`)?.parentElement??e.querySelector(`.modal-content`)??e).append(t),Ur.add(t),t}function $r(e){let t=e.querySelector(`[data-wui-discard-confirm]`);if(!(t instanceof HTMLElement))throw Error(`The discard prompt has no confirm button.`);t.focus()}function ei(e,t,n){let r=e.querySelector(Ir);if(r){$r(r);return}let i=Gr(e.ownerDocument,t),a;if(e.matches(Nr))a=e.querySelector(`.wui-drawer-footer`)??Zr(e),a.prepend(i);else if(e.hasAttribute(`confirm-discard`))a=e.querySelector(`.wui-modal-footer`)??Qr(e),a.prepend(i);else{if(!n)throw Error(`A discard prompt needs the form that is dirty.`);a=n.querySelector(`.modal-footer`)??e.querySelector(`.wui-modal-footer`)??Qr(e),a.prepend(i)}a.classList.add(`wui-drawer-discarding`),$r(i)}function ti(e){let t=e.parentElement;if(e.remove(),!t)throw Error(`The discard prompt has no footer.`);t.classList.remove(`wui-drawer-discarding`),Ur.has(t)&&t.remove()}function ni(e){for(let t of Yr(e))for(let e of t.querySelectorAll(Lr))if(Vr(e)&&e.type!==`hidden`&&!e.disabled){e.focus({preventScroll:!0});return}}function ri(e){let t=Kr(e.target);if(t)for(let e of Yr(t))$.get(e)??$.set(e,dr(e))}function ii(e){for(let t of zr(e).querySelectorAll(`form`)){let e=$.get(t);e!=null&&$.set(t,fr(t,e))}}function ai(e){let t=e.target;t instanceof HTMLFormElement&&Kr(t)&&$.set(t,dr(t))}function oi(e){if(!Rr(e))return;let t=`handle`in e?e.handle:void 0;if(Rr(t))return`el`in t?t.el:void 0}function si(e){if(!(e instanceof CustomEvent))return;let t=e.detail,n=oi(t);if(n instanceof Element)for(let e of n.querySelectorAll(`form`))$.delete(e)}function ci(e){let t=e.target;t instanceof Element&&t.matches(Nr)&&[...Yr(t)].some(Xr)&&(e.preventDefault(),ei(t,t.getAttribute(`confirm-discard`),null))}function li(e){let t=e.target;if(!(t instanceof Element)||!t.matches(Pr))return;let n=[...Yr(t)].find(Xr);n&&(e.preventDefault(),ei(t,n.getAttribute(`data-wui-confirm-discard`)??t.getAttribute(`confirm-discard`)??jr().confirmDiscard,n))}function ui(e){let t=n(e.closest(Ir),`The discard button is outside its prompt.`),r=qr(t);if(ti(t),!r)throw Error(`The discard prompt is outside its drawer or modal.`);for(let e of Yr(r))$.set(e,dr(e));r.dispatchEvent(new CustomEvent(Mr,{bubbles:!0})),r.matches(Nr)?n(r.closest(`wui-drawer`),`The confirm-discard drawer is not a wui-drawer.`).hide():n(r.closest(`wui-modal`),`The discarded dialog is not a wui-modal.`).hide()}function di(e){let t=n(e.closest(Ir),`The keep button is outside its prompt.`),r=qr(t);if(ti(t),!r)throw Error(`The discard prompt is outside its drawer or modal.`);ni(r)}function fi(e){let t=Br(e.target,`[data-wui-discard-confirm]`);if(t){ui(t);return}let n=Br(e.target,`[data-wui-discard-keep]`);n&&di(n)}function pi(e=document){let t=e instanceof Document?e:e.ownerDocument;Hr.has(t)||(Hr.add(t),t.addEventListener(`focusin`,ri),t.addEventListener(`pointerdown`,ri),t.addEventListener(`submit`,ai),t.addEventListener(o,ii),t.addEventListener(`wui:modal:success`,si),t.addEventListener(`wui:modal:loaded`,si),t.addEventListener(`wui-drawer-close`,ci,!0),t.addEventListener(`wui-modal-close`,li),t.addEventListener(`click`,fi))}export{Pe as S,sn as _,kr as a,Re as b,ln as c,Tn as d,Yn as f,nn as g,an as h,dr as i,fn as l,tn as m,Gr as n,Ar as o,cn as p,pi as r,Y as s,Mr as t,un as u,Ie as v,A as x,ze as y};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiCarousel-CFKmFVzc.js";e(`wui-carousel`,t);export{t as WuiCarousel};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiCarousel-B0yPDH5I.js";e(`wui-carousel`,t);export{t as WuiCarousel};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiCodeBlock-fBc3Uwsw.js";e(`wui-code-block`,t);export{t as WuiCodeBlock};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiCodeBlock-BJ14DaLH.js";e(`wui-code-block`,t);export{t as WuiCodeBlock};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiCommandPalette-BQCy0bon.js";e(`wui-command-palette`,t);export{t as WuiCommandPalette};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiCommandPalette-u1XD5WMv.js";e(`wui-command-palette`,t);export{t as WuiCommandPalette};
@@ -1 +1 @@
1
- import{n as e,t}from"../commentText-NWsssKvj.js";import{n}from"../elementBase-Cxeyx0tU.js";import{t as r}from"../WuiCommentThread-B58UyYGD.js";import"./mention-input.js";n(`wui-comment-thread`,r);export{t as COMMENT_INTENTS,e as COMMENT_REACTIONS,r as WuiCommentThread};
1
+ import{n as e,t}from"../commentText-NWsssKvj.js";import{n}from"../elementBase-Cxeyx0tU.js";import{t as r}from"../WuiCommentThread-ChTsQWet.js";import"./mention-input.js";n(`wui-comment-thread`,r);export{t as COMMENT_INTENTS,e as COMMENT_REACTIONS,r as WuiCommentThread};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiConsentBanner-DlAE3DTf.js";e(`wui-consent-banner`,t);export{t as WuiConsentBanner};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiConsentBanner-nTua-kEd.js";e(`wui-consent-banner`,t);export{t as WuiConsentBanner};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDataTable-B-JaTsrI.js";import{A as n,C as r,E as i,I as a,M as o,N as s,O as c,P as l,S as u,T as d,a as f,c as p,d as m,f as h,g,h as _,i as v,k as y,l as b,m as x,n as S,o as C,p as w,r as T,s as E,t as D,u as O,v as k,w as A,x as j,y as M}from"../dataTable-Bz6HxUx0.js";e(`wui-data-table`,t);export{D as COLUMN_MAX_WIDTH,S as COLUMN_MIN_WIDTH,T as PIN_AT_VAR,v as PIN_SIDES,f as RESIZE_STEP,C as RESIZE_STEP_LARGE,E as ROW_HEIGHTS,p as ROW_MOVE_LIMIT,b as ROW_MOVE_MS,O as ROW_SAVE_ATTR,m as ROW_SAVE_ERROR_CLASS,h as ROW_SAVE_STATES,w as VIRTUAL_OVERSCAN,t as WuiDataTable,x as clampColumnWidth,_ as groupCount,g as groupItems,k as identityCell,M as measureRows,j as pinAtValue,u as pinClasses,r as pinOffsetVar,A as planPins,d as playRowMoves,i as readColumnWidths,c as rowLabel,y as rowOrderChanged,n as saveOutcomeText,o as setRowSaveState,s as settledRows,l as virtualRange,a as writeColumnWidths};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDataTable-3Vd8EAMV.js";import{A as n,C as r,E as i,I as a,M as o,N as s,O as c,P as l,S as u,T as d,a as f,c as p,d as m,f as h,g,h as _,i as v,k as y,l as b,m as x,n as S,o as C,p as w,r as T,s as E,t as D,u as O,v as k,w as A,x as j,y as M}from"../dataTable-VB3nBucm.js";e(`wui-data-table`,t);export{D as COLUMN_MAX_WIDTH,S as COLUMN_MIN_WIDTH,T as PIN_AT_VAR,v as PIN_SIDES,f as RESIZE_STEP,C as RESIZE_STEP_LARGE,E as ROW_HEIGHTS,p as ROW_MOVE_LIMIT,b as ROW_MOVE_MS,O as ROW_SAVE_ATTR,m as ROW_SAVE_ERROR_CLASS,h as ROW_SAVE_STATES,w as VIRTUAL_OVERSCAN,t as WuiDataTable,x as clampColumnWidth,_ as groupCount,g as groupItems,k as identityCell,M as measureRows,j as pinAtValue,u as pinClasses,r as pinOffsetVar,A as planPins,d as playRowMoves,i as readColumnWidths,c as rowLabel,y as rowOrderChanged,n as saveOutcomeText,o as setRowSaveState,s as settledRows,l as virtualRange,a as writeColumnWidths};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDateRange-D7LJuY2F.js";e(`wui-date-range`,t);export{t as WuiDateRange};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDateRange-DvuE4wfG.js";e(`wui-date-range`,t);export{t as WuiDateRange};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDateTime-BSJfyZ0q.js";e(`wui-date-time`,t);export{t as WuiDateTime};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDateTime-Vimu6grS.js";e(`wui-date-time`,t);export{t as WuiDateTime};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDatePicker-4tdWakGX.js";e(`wui-datepicker`,t);export{t as WuiDatePicker};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDatePicker-CPr0Yni3.js";e(`wui-datepicker`,t);export{t as WuiDatePicker};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDrawer-D-XfW1kl.js";e(`wui-drawer`,t);export{t as WuiDrawer};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiDrawer-BsY0fs_u.js";e(`wui-drawer`,t);export{t as WuiDrawer};
@@ -1 +1 @@
1
- import{n as e,t}from"../filterPopover-D7LGrhnO.js";e();export{t as FILTER_POPOVER_MAX_CHIPS};
1
+ import{n as e,t}from"../filterPopover-DskHFNLi.js";e();export{t as FILTER_POPOVER_MAX_CHIPS};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiGantt-XMvgsZsn.js";e(`wui-gantt`,t);export{t as WuiGantt};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiGantt-DJat5idS.js";e(`wui-gantt`,t);export{t as WuiGantt};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiImageCrop-CIAjHOGk.js";e(`wui-image-crop`,t);export{t as WuiImageCrop};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiImageCrop-UakcSM2k.js";e(`wui-image-crop`,t);export{t as WuiImageCrop};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{n as t,r as n,t as r}from"../inlineEditText-C6g6qhye.js";import{t as i}from"../WuiInlineEdit-C9FxCWCk.js";e(`wui-inline-edit`,i);export{r as INLINE_EDIT_SAVED_MS,t as INLINE_EDIT_TYPES,i as WuiInlineEdit,n as inlineEditText};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{n as t,r as n,t as r}from"../inlineEditText-DRBhMnam.js";import{t as i}from"../WuiInlineEdit-Bfe_m5px.js";e(`wui-inline-edit`,i);export{r as INLINE_EDIT_SAVED_MS,t as INLINE_EDIT_TYPES,i as WuiInlineEdit,n as inlineEditText};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../kanban-CX6DyApZ.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"../kanbanModel-CuMgMnSc.js";e(`wui-kanban`,t);export{m as KANBAN_DRAG_THRESHOLD_PX,l as KANBAN_LONG_PRESS_MS,f as KANBAN_PHONE_QUERY,o as KANBAN_STORAGE_PREFIX,n as KANBAN_SUMMARY_FORMATS,u as KANBAN_TONES,t as WuiKanban,p as kanbanCardLabel,r as kanbanOverflow,s as kanbanStorageKey,h as kanbanSummaryFormat,i as kanbanVisibleLimit,a as readKanbanCollapsed,d as sumKanbanValues,c as writeKanbanCollapsed};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../kanban-DlVHIpxL.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"../kanbanModel-BzXK4SkM.js";e(`wui-kanban`,t);export{m as KANBAN_DRAG_THRESHOLD_PX,l as KANBAN_LONG_PRESS_MS,f as KANBAN_PHONE_QUERY,o as KANBAN_STORAGE_PREFIX,n as KANBAN_SUMMARY_FORMATS,u as KANBAN_TONES,t as WuiKanban,p as kanbanCardLabel,r as kanbanOverflow,s as kanbanStorageKey,h as kanbanSummaryFormat,i as kanbanVisibleLimit,a as readKanbanCollapsed,d as sumKanbanValues,c as writeKanbanCollapsed};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiLeadPopup-KyguGV-q.js";e(`wui-lead-popup`,t);export{t as WuiLeadPopup};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiLeadPopup-DaYZ2zCJ.js";e(`wui-lead-popup`,t);export{t as WuiLeadPopup};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiLightbox-CBiqJmGE.js";e(`wui-lightbox`,t);export{t as WuiLightbox};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiLightbox-CuzbFBck.js";e(`wui-lightbox`,t);export{t as WuiLightbox};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{i as t,n,r,t as i}from"../mentionText-BJsw_opZ.js";import{n as a,r as o,t as s}from"../WuiMentionInput-CktKQjQc.js";e(`wui-mention-input`,o);export{i as MENTION_ID_PATTERN,s as MENTION_MAX_QUERY,a as MENTION_MAX_RESULTS,o as WuiMentionInput,n as mentionLabel,r as mentionTextFromValue,t as mentionValueFromText};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{i as t,n,r,t as i}from"../mentionText-BJsw_opZ.js";import{n as a,r as o,t as s}from"../WuiMentionInput-Dmtm3N62.js";e(`wui-mention-input`,o);export{i as MENTION_ID_PATTERN,s as MENTION_MAX_QUERY,a as MENTION_MAX_RESULTS,o as WuiMentionInput,n as mentionLabel,r as mentionTextFromValue,t as mentionValueFromText};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiNotificationCenter-DZariS2K.js";e(`wui-notification-center`,t);export{t as WuiNotificationCenter};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiNotificationCenter-1Hw7W0st.js";e(`wui-notification-center`,t);export{t as WuiNotificationCenter};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiOrgTree-CFxoY9Vr.js";e(`wui-org-tree`,t);export{t as WuiOrgTree};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiOrgTree-DYMNCGTh.js";e(`wui-org-tree`,t);export{t as WuiOrgTree};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiOverflow-CXYk2ubC.js";e(`wui-overflow`,t);export{t as WuiOverflow};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiOverflow-fZKqdsr-.js";e(`wui-overflow`,t);export{t as WuiOverflow};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiPhone-BI438y4S.js";e(`wui-phone`,t);export{t as WuiPhone};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiPhone-BEyz-J2q.js";e(`wui-phone`,t);export{t as WuiPhone};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiRecordPager-DAyoD650.js";e(`wui-record-pager`,t);export{t as WuiRecordPager};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiRecordPager-BXoe4KfU.js";e(`wui-record-pager`,t);export{t as WuiRecordPager};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiRelativeTime-CPzs4tjM.js";import{n,r}from"../relativeTime-vdCXtfKg.js";e(`wui-relative-time`,t);export{t as WuiRelativeTime,n as formatRelativeTime,r as relativeTimeTitle};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiRelativeTime-CSg9vzfk.js";import{n,r}from"../relativeTime-CNgauvqB.js";e(`wui-relative-time`,t);export{t as WuiRelativeTime,n as formatRelativeTime,r as relativeTimeTitle};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSavedViews-BAqHgVj2.js";e(`wui-saved-views`,t);export{t as WuiSavedViews};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSavedViews-OjB-ZiCo.js";e(`wui-saved-views`,t);export{t as WuiSavedViews};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSelect-htggZB0v.js";e(`wui-select`,t);export{t as WuiSelect};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSelect-C_nfrNr5.js";e(`wui-select`,t);export{t as WuiSelect};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiShortcuts-DWzmRKEG.js";e(`wui-shortcuts`,t);export{t as WuiShortcuts};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiShortcuts-CRCctX82.js";e(`wui-shortcuts`,t);export{t as WuiShortcuts};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiShowMore-DyfGnrob.js";e(`wui-show-more`,t);export{t as WuiShowMore};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiShowMore-BoYCrYYf.js";e(`wui-show-more`,t);export{t as WuiShowMore};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSlider-LE2wquOo.js";e(`wui-slider`,t);export{t as WuiSlider};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSlider-R_mTula0.js";e(`wui-slider`,t);export{t as WuiSlider};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSortable-DxwYjicc.js";e(`wui-sortable`,t);export{t as WuiSortable};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiSortable-x8Mg0tOv.js";e(`wui-sortable`,t);export{t as WuiSortable};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiTimePicker-xrPYytjq.js";e(`wui-timepicker`,t);export{t as WuiTimePicker};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiTimePicker-Bcc1PfCT.js";e(`wui-timepicker`,t);export{t as WuiTimePicker};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiTour-D-H5sMJS.js";e(`wui-tour`,t);export{t as WuiTour};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiTour-C71Wmed-.js";e(`wui-tour`,t);export{t as WuiTour};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiTreePicker-Bx9nvRrC.js";e(`wui-tree-picker`,t);export{t as WuiTreePicker};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiTreePicker-DP1lCno3.js";e(`wui-tree-picker`,t);export{t as WuiTreePicker};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiTree-BnlK9fYL.js";e(`wui-tree`,t);export{t as WuiTree};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{t}from"../WuiTree-BQk23SSF.js";e(`wui-tree`,t);export{t as WuiTree};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-Cxeyx0tU.js";import{n as t,t as n}from"../WuiWizardStep-n8Ge5GDI.js";e(`wui-wizard-step`,n),e(`wui-wizard`,t);export{t as WuiWizard,n as WuiWizardStep};
1
+ import{n as e}from"../elementBase-Cxeyx0tU.js";import{n as t,t as n}from"../WuiWizardStep-Uag__kTu.js";e(`wui-wizard-step`,n),e(`wui-wizard`,t);export{t as WuiWizard,n as WuiWizardStep};