@webority/ui-elements 0.175.0 → 0.177.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +1 -1
  2. package/dist/WuiCommentThread-e5t7HceL.js +1 -0
  3. package/dist/WuiDateRange-BnEJ2WpL.js +1 -0
  4. package/dist/WuiInlineEdit-p0cm_i90.js +1 -0
  5. package/dist/{WuiMarkdown-DsN4YbiZ.js → WuiMarkdown-DRtGPxQX.js} +1 -1
  6. package/dist/WuiMentionInput-DPpEVL2s.js +1 -0
  7. package/dist/WuiNotificationCenter-DuvGrqwr.js +1 -0
  8. package/dist/{WuiPhone-CBge7oVA.js → WuiPhone--w-taM5Q.js} +1 -1
  9. package/dist/{WuiSavedViews-OjB-ZiCo.js → WuiSavedViews-BKpnSd-Y.js} +1 -1
  10. package/dist/{WuiSelect-D89S-POU.js → WuiSelect-iUXaHKw5.js} +1 -1
  11. package/dist/{WuiSlider-R_mTula0.js → WuiSlider-CK7_l_R5.js} +1 -1
  12. package/dist/WuiTour-BgpMa8J5.js +1 -0
  13. package/dist/WuiTree-BjtuCasB.js +1 -0
  14. package/dist/{chips-_rw5Aev4.js → chips-xXgAvIFy.js} +1 -1
  15. package/dist/{httpFailure.g-DBKzEpAf.js → commentThread.g-C7L18Tvy.js} +1 -1
  16. package/dist/drawerDiscard-z1PsI4cx.js +1 -0
  17. package/dist/elements/comment-thread.js +1 -1
  18. package/dist/elements/date-range.js +1 -1
  19. package/dist/elements/inline-edit.js +1 -1
  20. package/dist/elements/kanban.js +1 -1
  21. package/dist/elements/markdown.js +1 -1
  22. package/dist/elements/mention-input.js +1 -1
  23. package/dist/elements/notification-center.js +1 -1
  24. package/dist/elements/phone.js +1 -1
  25. package/dist/elements/saved-views.js +1 -1
  26. package/dist/elements/select.js +1 -1
  27. package/dist/elements/slider.js +1 -1
  28. package/dist/elements/tour.js +1 -1
  29. package/dist/elements/tree.js +1 -1
  30. package/dist/helpers.js +1 -1
  31. package/dist/httpFailure.g-DjZzGxPj.js +1 -0
  32. package/dist/kanban-jQCTLG3Q.js +1 -0
  33. package/dist/{listboxKeyNav-DNtuh6Ob.js → listboxKeyNav-CNso9shL.js} +1 -1
  34. package/dist/{loader-C2hgZrCR.js → loader-DvNLnnaO.js} +1 -1
  35. package/dist/{search-D-lfoHy9.js → search-Bhn-bjLL.js} +1 -1
  36. package/dist/server.js +1 -1
  37. package/dist/text/en.json +2 -1
  38. package/dist/text.js +1 -1
  39. package/dist/themeTransition-TF0BqM20.js +1 -0
  40. package/dist/ui-calendar.global.js +1 -1
  41. package/dist/ui-calendar.js +1 -1
  42. package/dist/ui-elements/carousel.global.js +1 -1
  43. package/dist/ui-elements/code-block.global.js +1 -1
  44. package/dist/ui-elements/command-palette.global.js +1 -1
  45. package/dist/ui-elements/comment-thread.global.js +1 -1
  46. package/dist/ui-elements/consent-banner.global.js +1 -1
  47. package/dist/ui-elements/context-menu.global.js +1 -1
  48. package/dist/ui-elements/date-range.global.js +1 -1
  49. package/dist/ui-elements/date-time.global.js +1 -1
  50. package/dist/ui-elements/datepicker.global.js +1 -1
  51. package/dist/ui-elements/drawer.global.js +1 -1
  52. package/dist/ui-elements/dropdown.global.js +1 -1
  53. package/dist/ui-elements/entry-grid.global.js +1 -1
  54. package/dist/ui-elements/gantt.global.js +1 -1
  55. package/dist/ui-elements/glyphs.global.js +1 -1
  56. package/dist/ui-elements/image-crop.global.js +1 -1
  57. package/dist/ui-elements/inline-edit.global.js +1 -1
  58. package/dist/ui-elements/kanban.global.js +1 -1
  59. package/dist/ui-elements/lead-popup.global.js +1 -1
  60. package/dist/ui-elements/lightbox.global.js +1 -1
  61. package/dist/ui-elements/markdown.global.js +2 -2
  62. package/dist/ui-elements/org-tree.global.js +1 -1
  63. package/dist/ui-elements/phone.global.js +1 -1
  64. package/dist/ui-elements/popover.global.js +1 -1
  65. package/dist/ui-elements/saved-views.global.js +1 -1
  66. package/dist/ui-elements/select-chips.global.js +1 -1
  67. package/dist/ui-elements/select-recents.global.js +1 -1
  68. package/dist/ui-elements/select-search.global.js +1 -1
  69. package/dist/ui-elements/select-window.global.js +1 -1
  70. package/dist/ui-elements/slider.global.js +1 -1
  71. package/dist/ui-elements/sortable.global.js +1 -1
  72. package/dist/ui-elements/status-icon.global.js +1 -1
  73. package/dist/ui-elements/table-export.global.js +1 -1
  74. package/dist/ui-elements/timepicker.global.js +1 -1
  75. package/dist/ui-elements/tour.global.js +1 -1
  76. package/dist/ui-elements/tree-picker.global.js +1 -1
  77. package/dist/ui-elements/tree.global.js +1 -1
  78. package/dist/ui-elements/wizard.global.js +1 -1
  79. package/dist/ui-elements.global.js +1 -1
  80. package/dist/ui-elements.js +1 -1
  81. package/dist/ui-tour.global.js +1 -1
  82. package/dist/wuiHttp-Cw7V8u2w.js +1 -0
  83. package/package.json +6 -6
  84. package/types/calendarAdapter.d.ts +8 -21
  85. package/types/calendarEngine.d.ts +22 -0
  86. package/types/commandShortcut.d.ts +12 -0
  87. package/types/global/shared.d.ts +2 -0
  88. package/types/globals.d.ts +0 -4
  89. package/types/helpers.d.ts +1 -1
  90. package/types/listboxKeyNav.d.ts +2 -3
  91. package/types/razor-js/modules/api.d.ts +0 -5
  92. package/types/server/index.d.ts +1 -0
  93. package/types/server/shellParts.d.ts +6 -0
  94. package/types/server/wuiHttp.d.ts +6 -3
  95. package/types/server/wuiUpload.d.ts +15 -0
  96. package/types/text/web/httpFailure.g.d.ts +1 -0
  97. package/dist/WuiCommentThread-C5n933uz.js +0 -1
  98. package/dist/WuiDateRange-qTncGobM.js +0 -1
  99. package/dist/WuiInlineEdit-BwB-w61N.js +0 -1
  100. package/dist/WuiMentionInput-DJv-WwW6.js +0 -1
  101. package/dist/WuiNotificationCenter-1Hw7W0st.js +0 -1
  102. package/dist/WuiTour-BU00-6Lf.js +0 -1
  103. package/dist/WuiTree-CIOM1G59.js +0 -1
  104. package/dist/drawerDiscard-D_n8guAp.js +0 -1
  105. package/dist/kanban-DlVHIpxL.js +0 -1
  106. package/dist/themeTransition-DBv2olsl.js +0 -1
  107. package/dist/wuiHttp-BWf9dDsZ.js +0 -1
@@ -1 +1 @@
1
- import{n as e}from"./elementBase-Cxeyx0tU.js";import{n as ee}from"./filterPopover-DskHFNLi.js";import{t}from"./kanban-DlVHIpxL.js";import{n}from"./statusIcons-Cd3GJcBR.js";import{t as r}from"./WuiCarousel-B0yPDH5I.js";import{t as i}from"./WuiCodeBlock-BWYZ1S70.js";import{t as a}from"./WuiCommandPalette-u1XD5WMv.js";import{t as o}from"./WuiCommentThread-C5n933uz.js";import{t as s}from"./WuiConsentBanner-nTua-kEd.js";import{t as c}from"./WuiContextMenu-DEWYYFRG.js";import{t as l}from"./WuiDataTable-Ble3hl5L.js";import{t as u}from"./WuiDatePicker-3D33rzH4.js";import{t as d}from"./WuiDateRange-qTncGobM.js";import{t as f}from"./WuiDateTime-Vimu6grS.js";import{t as p}from"./WuiDock-2LGlbEFx.js";import{t as m}from"./WuiDrawer-BsY0fs_u.js";import{t as h}from"./WuiDropdown-6g074v1T.js";import{t as g}from"./WuiEntryGrid-DkW0tIDy.js";import{t as _}from"./WuiGantt-BqNhYIr6.js";import{t as v}from"./WuiHoverCard-DhJcIIM1.js";import{t as y}from"./WuiImageCrop-UakcSM2k.js";import{t as b}from"./WuiInlineEdit-BwB-w61N.js";import{t as x}from"./WuiLeadPopup-DaYZ2zCJ.js";import{t as S}from"./WuiLightbox-DpHJAMO3.js";import{t as C}from"./WuiMarkdown-DsN4YbiZ.js";import{r as w}from"./WuiMentionInput-DJv-WwW6.js";import{t as T}from"./WuiModal-DQbVJGUo.js";import{t as E}from"./WuiNavigationMenu-KdW7yuLn.js";import{t as D}from"./WuiNotificationCenter-1Hw7W0st.js";import{t as O}from"./WuiOnboardingChecklist-C-nllg2h.js";import{t as k}from"./WuiOrgTree-DWSk_LHd.js";import{t as A}from"./WuiOtp-Cc0formv.js";import{t as j}from"./WuiOverflow-fZKqdsr-.js";import{t as M}from"./WuiPhone-CBge7oVA.js";import{t as N}from"./WuiPopover-BvWKRNQY.js";import{t as P}from"./WuiRating-DIQfif9x.js";import{t as F}from"./WuiRecordPager-BXoe4KfU.js";import{t as I}from"./WuiRelativeTime-CSg9vzfk.js";import{t as L}from"./WuiSavedViews-OjB-ZiCo.js";import{t as R}from"./WuiSelect-D89S-POU.js";import{t as z}from"./WuiShortcuts-CRCctX82.js";import{t as B}from"./WuiShowMore-BoYCrYYf.js";import{t as V}from"./WuiSlider-R_mTula0.js";import{t as H}from"./WuiSortable-x8Mg0tOv.js";import{t as U}from"./WuiTimePicker-DYLFaWDc.js";import{t as W}from"./WuiTour-BU00-6Lf.js";import{t as G}from"./WuiTree-CIOM1G59.js";import{t as K}from"./WuiTreePicker-DLddmEgG.js";import{t as q}from"./WuiTruncate-BB4i8wHE.js";import{n as J,t as Y}from"./WuiWhatsNew-Dm4Yl68x.js";import{n as X,t as Z}from"./WuiWizardStep-gFtuUzsL.js";import{c as Q,f as te,l as ne,m as re,p as ie,s as ae,u as oe}from"./formatters-DTW53DjY.js";import{_ as se,r as ce}from"./themeTransition-DBv2olsl.js";import{t as le}from"./drawerDiscard-D_n8guAp.js";import{n as ue}from"./shortcutKeys-BMTWgV2g.js";function $(){ee(),e(`wui-select`,R),e(`wui-saved-views`,L),e(`wui-phone`,M),e(`wui-datepicker`,u),e(`wui-date-range`,d),e(`wui-date-time`,f),e(`wui-dock`,p),e(`wui-image-crop`,y),e(`wui-kanban`,t),e(`wui-lead-popup`,x),e(`wui-inline-edit`,b),e(`wui-consent-banner`,s),e(`wui-slider`,V),e(`wui-sortable`,H),e(`wui-timepicker`,U),e(`wui-tour`,W),e(`wui-tree`,G),e(`wui-tree-picker`,K),e(`wui-org-tree`,k),e(`wui-command-palette`,a),e(`wui-context-menu`,c),e(`wui-otp`,A),e(`wui-status-icon`,n),e(`wui-shortcuts`,z),e(`wui-record-pager`,F),e(`wui-carousel`,r),e(`wui-code-block`,i),e(`wui-markdown`,C),e(`wui-modal`,T),e(`wui-data-table`,l),e(`wui-drawer`,m),e(`wui-dropdown`,h),e(`wui-entry-grid`,g),e(`wui-gantt`,_),e(`wui-hover-card`,v),e(`wui-lightbox`,S),e(`wui-navigation-menu`,E),e(`wui-notification-center`,D),e(`wui-onboarding-checklist`,O),e(`wui-overflow`,j),e(`wui-popover`,N),e(`wui-rating`,P),e(`wui-relative-time`,I),e(`wui-show-more`,B),e(`wui-truncate`,q),e(`wui-whats-new`,J),e(`wui-mention-input`,w),e(`wui-comment-thread`,o),e(`wui-wizard-step`,Z),e(`wui-wizard`,X)}$();export{le as DISCARD_EVENT,se as ROW_DROP_EVENT,ue as SHORTCUT_EVENT,ce as THEME_CHANGE_EVENT,Y as WHATS_NEW_READ_EVENT,r as WuiCarousel,i as WuiCodeBlock,a as WuiCommandPalette,o as WuiCommentThread,s as WuiConsentBanner,c as WuiContextMenu,l as WuiDataTable,u as WuiDatePicker,d as WuiDateRange,f as WuiDateTime,p as WuiDock,m as WuiDrawer,h as WuiDropdown,g as WuiEntryGrid,_ as WuiGantt,v as WuiHoverCard,y as WuiImageCrop,b as WuiInlineEdit,t as WuiKanban,x as WuiLeadPopup,S as WuiLightbox,C as WuiMarkdown,w as WuiMentionInput,T as WuiModal,E as WuiNavigationMenu,D as WuiNotificationCenter,O as WuiOnboardingChecklist,k as WuiOrgTree,A as WuiOtp,j as WuiOverflow,M as WuiPhone,N as WuiPopover,P as WuiRating,F as WuiRecordPager,I as WuiRelativeTime,L as WuiSavedViews,R as WuiSelect,z as WuiShortcuts,B as WuiShowMore,V as WuiSlider,H as WuiSortable,n as WuiStatusIcon,U as WuiTimePicker,W as WuiTour,G as WuiTree,K as WuiTreePicker,q as WuiTruncate,J as WuiWhatsNew,X as WuiWizard,Z as WuiWizardStep,$ as defineWeborityElements,ae as formatCompact,Q as formatCurrency,ne as formatDate,oe as formatDateTime,te as formatNumber,ie as formatPercent,re as formatValue};
1
+ import{n as e}from"./elementBase-Cxeyx0tU.js";import{n as ee}from"./filterPopover-DskHFNLi.js";import{t}from"./kanban-jQCTLG3Q.js";import{n}from"./statusIcons-Cd3GJcBR.js";import{t as r}from"./WuiCarousel-B0yPDH5I.js";import{t as i}from"./WuiCodeBlock-BWYZ1S70.js";import{t as a}from"./WuiCommandPalette-u1XD5WMv.js";import{t as o}from"./WuiCommentThread-e5t7HceL.js";import{t as s}from"./WuiConsentBanner-nTua-kEd.js";import{t as c}from"./WuiContextMenu-DEWYYFRG.js";import{t as l}from"./WuiDataTable-Ble3hl5L.js";import{t as u}from"./WuiDatePicker-3D33rzH4.js";import{t as d}from"./WuiDateRange-BnEJ2WpL.js";import{t as f}from"./WuiDateTime-Vimu6grS.js";import{t as p}from"./WuiDock-2LGlbEFx.js";import{t as m}from"./WuiDrawer-BsY0fs_u.js";import{t as h}from"./WuiDropdown-6g074v1T.js";import{t as g}from"./WuiEntryGrid-DkW0tIDy.js";import{t as _}from"./WuiGantt-BqNhYIr6.js";import{t as v}from"./WuiHoverCard-DhJcIIM1.js";import{t as y}from"./WuiImageCrop-UakcSM2k.js";import{t as b}from"./WuiInlineEdit-p0cm_i90.js";import{t as x}from"./WuiLeadPopup-DaYZ2zCJ.js";import{t as S}from"./WuiLightbox-DpHJAMO3.js";import{t as C}from"./WuiMarkdown-DRtGPxQX.js";import{r as w}from"./WuiMentionInput-DPpEVL2s.js";import{t as T}from"./WuiModal-DQbVJGUo.js";import{t as E}from"./WuiNavigationMenu-KdW7yuLn.js";import{t as D}from"./WuiNotificationCenter-DuvGrqwr.js";import{t as O}from"./WuiOnboardingChecklist-C-nllg2h.js";import{t as k}from"./WuiOrgTree-DWSk_LHd.js";import{t as A}from"./WuiOtp-Cc0formv.js";import{t as j}from"./WuiOverflow-fZKqdsr-.js";import{t as M}from"./WuiPhone--w-taM5Q.js";import{t as N}from"./WuiPopover-BvWKRNQY.js";import{t as P}from"./WuiRating-DIQfif9x.js";import{t as F}from"./WuiRecordPager-BXoe4KfU.js";import{t as I}from"./WuiRelativeTime-CSg9vzfk.js";import{t as L}from"./WuiSavedViews-BKpnSd-Y.js";import{t as R}from"./WuiSelect-iUXaHKw5.js";import{t as z}from"./WuiShortcuts-CRCctX82.js";import{t as B}from"./WuiShowMore-BoYCrYYf.js";import{t as V}from"./WuiSlider-CK7_l_R5.js";import{t as H}from"./WuiSortable-x8Mg0tOv.js";import{t as U}from"./WuiTimePicker-DYLFaWDc.js";import{t as W}from"./WuiTour-BgpMa8J5.js";import{t as G}from"./WuiTree-BjtuCasB.js";import{t as K}from"./WuiTreePicker-DLddmEgG.js";import{t as q}from"./WuiTruncate-BB4i8wHE.js";import{n as J,t as Y}from"./WuiWhatsNew-Dm4Yl68x.js";import{n as X,t as Z}from"./WuiWizardStep-gFtuUzsL.js";import{c as Q,f as te,l as ne,m as re,p as ie,s as ae,u as oe}from"./formatters-DTW53DjY.js";import{_ as se,r as ce}from"./themeTransition-TF0BqM20.js";import{t as le}from"./drawerDiscard-z1PsI4cx.js";import{n as ue}from"./shortcutKeys-BMTWgV2g.js";function $(){ee(),e(`wui-select`,R),e(`wui-saved-views`,L),e(`wui-phone`,M),e(`wui-datepicker`,u),e(`wui-date-range`,d),e(`wui-date-time`,f),e(`wui-dock`,p),e(`wui-image-crop`,y),e(`wui-kanban`,t),e(`wui-lead-popup`,x),e(`wui-inline-edit`,b),e(`wui-consent-banner`,s),e(`wui-slider`,V),e(`wui-sortable`,H),e(`wui-timepicker`,U),e(`wui-tour`,W),e(`wui-tree`,G),e(`wui-tree-picker`,K),e(`wui-org-tree`,k),e(`wui-command-palette`,a),e(`wui-context-menu`,c),e(`wui-otp`,A),e(`wui-status-icon`,n),e(`wui-shortcuts`,z),e(`wui-record-pager`,F),e(`wui-carousel`,r),e(`wui-code-block`,i),e(`wui-markdown`,C),e(`wui-modal`,T),e(`wui-data-table`,l),e(`wui-drawer`,m),e(`wui-dropdown`,h),e(`wui-entry-grid`,g),e(`wui-gantt`,_),e(`wui-hover-card`,v),e(`wui-lightbox`,S),e(`wui-navigation-menu`,E),e(`wui-notification-center`,D),e(`wui-onboarding-checklist`,O),e(`wui-overflow`,j),e(`wui-popover`,N),e(`wui-rating`,P),e(`wui-relative-time`,I),e(`wui-show-more`,B),e(`wui-truncate`,q),e(`wui-whats-new`,J),e(`wui-mention-input`,w),e(`wui-comment-thread`,o),e(`wui-wizard-step`,Z),e(`wui-wizard`,X)}$();export{le as DISCARD_EVENT,se as ROW_DROP_EVENT,ue as SHORTCUT_EVENT,ce as THEME_CHANGE_EVENT,Y as WHATS_NEW_READ_EVENT,r as WuiCarousel,i as WuiCodeBlock,a as WuiCommandPalette,o as WuiCommentThread,s as WuiConsentBanner,c as WuiContextMenu,l as WuiDataTable,u as WuiDatePicker,d as WuiDateRange,f as WuiDateTime,p as WuiDock,m as WuiDrawer,h as WuiDropdown,g as WuiEntryGrid,_ as WuiGantt,v as WuiHoverCard,y as WuiImageCrop,b as WuiInlineEdit,t as WuiKanban,x as WuiLeadPopup,S as WuiLightbox,C as WuiMarkdown,w as WuiMentionInput,T as WuiModal,E as WuiNavigationMenu,D as WuiNotificationCenter,O as WuiOnboardingChecklist,k as WuiOrgTree,A as WuiOtp,j as WuiOverflow,M as WuiPhone,N as WuiPopover,P as WuiRating,F as WuiRecordPager,I as WuiRelativeTime,L as WuiSavedViews,R as WuiSelect,z as WuiShortcuts,B as WuiShowMore,V as WuiSlider,H as WuiSortable,n as WuiStatusIcon,U as WuiTimePicker,W as WuiTour,G as WuiTree,K as WuiTreePicker,q as WuiTruncate,J as WuiWhatsNew,X as WuiWizard,Z as WuiWizardStep,$ as defineWeborityElements,ae as formatCompact,Q as formatCurrency,ne as formatDate,oe as formatDateTime,te as formatNumber,ie as formatPercent,re as formatValue};
@@ -1 +1 @@
1
- var WeborityTour=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var n=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(n);var r=HTMLElement;function i(e){return getComputedStyle(e).direction===`rtl`}function a(e,t){return t?e===`ArrowRight`?`ArrowLeft`:e===`ArrowLeft`?`ArrowRight`:e:e}function o(e,t){s(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function s(e){if(!e?._reanchor)return;window.removeEventListener(`resize`,e._reanchor);let t=e._reanchorScroll;t&&window.removeEventListener(`scroll`,t,!0),e._reanchor=null,e._reanchorScroll=null}var c=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,l=`AppButton`,u=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),d={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 f(e){return c(d,e)}function p(e=`primary`,t=`solid`,n=`md`){if(!u.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!f(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=d[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}function m(e,t,...n){if(e.toLowerCase()===`svg`)throw Error(`make() builds HTML elements; use svgRoot for svg`);let r=document.createElement(e);for(let[e,n]of Object.entries(t??{}))n===!0?r.setAttribute(e,``):(typeof n==`string`||typeof n==`number`)&&r.setAttribute(e,String(n));let i=[];for(let e of n)e instanceof Node?i.push(e):(typeof e==`string`||typeof e==`number`)&&i.push(document.createTextNode(String(e)));return r.append(...i),r}var h=`data-wui-dismiss`,g=`data-wui-closing`,_=`[${h}]`,v=`(prefers-reduced-motion: reduce)`,y=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,b=new WeakSet,x=Symbol.for(`webority.ui.modal-stack`),ee=Symbol.for(`webority.ui.root-watches`);function te(e){let t=e;return t[ee]??=new Set,t[ee]}function ne(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(y))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${_},.wui-modal-back`))return t;n??=t}return n}function re(e){let t=[],n=new Map;for(let r of e.querySelectorAll(y))if(!(r.closest(`[hidden],[inert]`)||r.closest(`dialog`)!==e)&&!(r.tabIndex<0||r.getClientRects().length===0)){if(r instanceof HTMLInputElement&&r.type===`radio`&&r.name){let e=n.get(r.name);e?r.checked&&!e.checked&&(e.checked=r,t[t.indexOf(e.first)]=r):(n.set(r.name,{first:r,checked:r.checked?r:null}),t.push(r))}else t.push(r)}return t}function S(e){let t=e;return t[x]??=[],t[x]}function ie(e){C(e),S(e.ownerDocument).push(e)}function C(e){let t=S(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function w(e){for(let t of te(e)){let n=T(e);t.last!==n&&(t.last=n,t.listener(n))}}function ae(e){let t=Promise.allSettled(e.getAnimations().map(e=>e.finished));return new Promise(e=>{let n=window.setTimeout(e,400);t.then(()=>{window.clearTimeout(n),e()})})}function oe(e,t){let n=t.focus===`first-control`?ne(e):null,r=n??e,i=r===e&&!e.hasAttribute(`tabindex`);i&&e.setAttribute(`tabindex`,`-1`);let a=!t.escape&&!e.hasAttribute(`closedby`);a&&e.setAttribute(`closedby`,`none`),b.add(e);let o=()=>{if(ie(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw C(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),w(e.ownerDocument)},s=!1,c=n=>{if(n.key!==`Escape`||n.defaultPrevented||!t.escape||n.altKey||n.ctrlKey||n.metaKey)return;let r=e.ownerDocument;T(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&b.has(e)&&e.open&&(s=!1,t.onRequestClose(`escape`))},0)))},l=t=>{if(t.key!==`Tab`||t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)return;let n=e.ownerDocument;if(T(n)!==e||e.querySelector(`:popover-open`))return;t.preventDefault();let r=re(e),i=r[0],a=r[r.length-1];if(!i||!a){e.focus();return}let o=n.activeElement,s=o?r.findIndex(e=>e===o||e.contains(o)):-1;s<0?(t.shiftKey?a:i).focus():r[((t.shiftKey?s-1:s+1)+r.length)%r.length]?.focus()},u=e=>{s=!1,e.preventDefault(),t.escape&&t.onRequestClose(`escape`)},d=n=>{let r=n.target;if(!(r instanceof Element))return;let i=r.closest(_);if(i&&i.closest(`dialog`)===e){t.onRequestClose(`dismiss`);return}if(r!==e||!t.backdrop)return;let a=e.getBoundingClientRect();(n.clientX<a.left||n.clientX>a.right||n.clientY<a.top||n.clientY>a.bottom)&&t.onRequestClose(`backdrop`)},f=()=>{let n=s;s=!1,C(e),b.has(e)?(o(),n&&t.onRequestClose(`escape`)):w(e.ownerDocument)},p=e.ownerDocument;return p.addEventListener(`keydown`,c),p.addEventListener(`keydown`,l),e.addEventListener(`cancel`,u),e.addEventListener(`click`,d),e.addEventListener(`close`,f),o(),()=>{p.removeEventListener(`keydown`,c),p.removeEventListener(`keydown`,l),e.removeEventListener(`cancel`,u),e.removeEventListener(`click`,d),e.removeEventListener(`close`,f),b.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),C(e),w(e.ownerDocument)}}async function se(e){b.delete(e),e.setAttribute(g,``),!window.matchMedia(v).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await ae(e),e.close(),C(e),w(e.ownerDocument),e.removeAttribute(g)}function ce(e){if(le(e),!e.isConnected)throw Error(`nativeOverlay: raisePopover was given a panel that is not on the page; a caller whose overlay root can leave the page skips the raise until the panel moves to the new root`);e.hidePopover(),e.showPopover()}function le(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function T(e=document){let t=S(e);for(let e=t.length-1;e>=0;e--){let n=t[e];if(n?.isConnected&&n.hasAttribute(`open`))return n}return e.body}var ue=/\{([A-Za-z0-9_]+)\}/g,de=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,fe=new Map,pe=0,me=new Map;function E(e,t){let n=fe.get(e);if(n===void 0)return t;let r=me.get(e);if(r!==void 0&&r.version===pe&&r.english===t&&ge(r.merged,t))return r.merged;let i=he(e,n,t);return me.set(e,{version:pe,english:t,merged:i}),i}function he(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=de(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=D(t);for(let t of D(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function ge(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>de(e,t))}function D(e){return Array.from(e.matchAll(ue),e=>e[1]??``)}var O={backLabel:`Back`,doneLabel:`Done`,endMessage:`You know your way around now. Enjoy exploring.`,endTitle:`You're all set`,mediaPauseLabel:`Pause animation`,mediaPlayLabel:`Play animation`,nextLabel:`Next`,progressLabel:`Step {current} of {total}`,skipLabel:`Skip`},_e={advanceLabel:`Click {actionName} to continue.`},k=`data-advance`,A=`wui-tour-hint`,j=`wui-tour-pointer`,ve=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,ye=()=>E(`tourAdvance`,_e),M=(e,t)=>e?.advanceOn===`click`&&!!t,N=e=>(e??``).replace(/\s+/g,` `).trim(),be=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLMeterElement||e instanceof HTMLOutputElement||e instanceof HTMLProgressElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.labels:null,xe=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLFieldSetElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement?e.disabled:!1;function Se(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e instanceof HTMLInputElement&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(be(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=N(e);if(t)return t}return``}function Ce(e){for(let t of[e,...e.querySelectorAll(ve)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!xe(t))return t;return null}function P(e,t,n){let r=(e.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(e=>e&&e!==t);n&&r.push(t),r.length>0?e.setAttribute(`aria-describedby`,r.join(` `)):e.removeAttribute(`aria-describedby`)}function we(e,t){let n=e.querySelector(`.${A}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&P(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=A,i&&(n.id=i);let t=e.querySelector(`.wui-tour-actions`);if(!t)throw Error(`Tour card has no actions row.`);t.before(n)}n.textContent=t,i&&P(e,i,!0)}}function Te(e,t){let n=e.querySelector(`.${j}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=j,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var Ee=e=>getComputedStyle(e).animationName;function F(e,{layer:t,spot:n,card:r},i,a){let o=M(i,a);t.toggleAttribute(k,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(k)&&(n.removeAttribute(k),o&&Ee(n)),o&&n.setAttribute(k,``),Te(n,o);let s=r.querySelector(`.wui-tour-next`);if(!(s instanceof HTMLElement))throw Error(`Tour card has no next button.`);s.classList.toggle(`btn-primary`,!o),s.classList.toggle(`btn-link`,o);let c=o?N(i?.actionLabel)||Se(a):``,l=e.getAttribute(`advance-label`)||ye().advanceLabel,u=c?l.replace(/\{actionName\}/g,()=>c):``;return we(r,u),u}function De(e,t,n){if(!M(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function Oe(e,t,n,r){return e.contains(r)||M(t,n)&&n.contains(r)}function ke(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=M(r,i)?Ce(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i?.contains(n));e.preventDefault();let c=a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length];if(!c)throw Error(`Tour card has no focus stop.`);c.focus()}function Ae(e){return e.isComposing||e.keyCode===229}function je(e){return e.key===`Enter`&&!Ae(e)}var I=`http://www.w3.org/2000/svg`;function L(e){return e.map(Ne)}function Me(e,t){let n=document.createElementNS(I,`svg`);return R(n,e),n.append(...L(t)),n}function Ne(e){let[t,n,r]=e,i=document.createElementNS(I,t);return R(i,n),typeof r==`string`?i.append(document.createTextNode(r)):r&&i.append(...L(r)),i}function R(e,t){for(let[n,r]of Object.entries(t))r===!0?e.setAttribute(n,``):(typeof r==`string`||typeof r==`number`)&&e.setAttribute(n,String(r))}var Pe=2/3,Fe=1e3,Ie=new Set([`top`,`left`,`width`,`height`]),z=new WeakMap,B=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],Le=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,Re=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&Ie.has(e.transitionProperty),ze=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function Be(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,Fe);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function Ve(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?B(t,Re):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*Pe-r)}return n}function He(e){let t=Ve(e);t>0?e.style.setProperty(`--wui-tour-card-delay`,`${Math.round(t)}ms`):e.style.removeProperty(`--wui-tour-card-delay`),e.dataset.state=`entering`;let n={};z.set(e,n);let r=()=>{z.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=B(e,ze);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function Ue(e){return e.dataset.state=`leaving`,Be(B(e,Le))}function We(e){let t=e.shadowRoot?.querySelector(`.wui-tour-layer`),n=e.classList.contains(`wui-tour-layer`)?e:t instanceof HTMLElement?t:null;n&&(n.dataset.state=`leaving`);let r=n?Be(B(n,Le)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var Ge=2,V=12,H=8,Ke=4,U=20,qe=`(max-width: 575.98px)`,Je=[`bottom`,`top`,`right`,`left`],Ye=[`bottom`,`top`,`left`,`right`],Xe=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],Ze,W=(e,t,n)=>Math.max(t,Math.min(e,n)),G=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function Qe(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=it(e),r=e.offsetHeight+V;if(t.getBoundingClientRect().height+4+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+Ge}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function $e(e,t,n){let r=e.style,a=t.style,o=at(t);if(!n){r.top=`50%`,r.left=`50%`,r.width=`0px`,r.height=`0px`,r.boxShadow=`0 0 0 100vmax var(--color-scrim-strong)`;for(let e of Xe)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,o.hidden=!0,a.position=`fixed`,a.top=`50%`,a.left=`50%`,a.transform=`translate(-50%, -50%)`,a.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,a.transform=``,a.position=`fixed`;let s=n.getBoundingClientRect();r.top=`${s.top}px`,r.left=`${s.left}px`,r.width=`${s.width}px`,r.height=`${s.height}px`,et(r,n);let c=t.scrollTop;a.maxHeight=``;let l={width:t.offsetWidth,height:t.offsetHeight},u=it(t),d=u.bottom-u.top,f={bottom:u.bottom-s.bottom-V,top:s.top-V-u.top,right:u.right-s.right-V,left:s.left-V-u.left},p=window.matchMedia(qe).matches,m=(i(n)?Ye:Je).find(e=>e===`top`||e===`bottom`?l.height<=f[e]+1:!p&&l.width<=f[e]+1&&l.height<=d+1),h=Math.min(s.bottom,u.bottom+H)-Math.max(s.top,u.top-H);m?tt(t,o,m,s,u,l):h>=Math.min(l.height,d)+8?nt(t,o,s,u,l):rt(t,o,f.bottom>=f.top?`bottom`:`top`,s,u,l,f),t.scrollTop=c}function et(e,t){Ze??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of Xe)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),Ze&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function tt(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=G(r.left,r.right,i.left,i.right);s=W(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+V:r.top-V-a.height,l=W(e-s,U,a.width-U)}else{let e=G(r.top,r.bottom,i.top,i.bottom);c=W(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+V:r.left-V-a.width,l=W(e-c,U,a.height-U)}e.dataset.placement=n,e.style.top=`${c}px`,e.style.left=`${s}px`,t.hidden=!1,t.style.left=o?`${l-e.clientLeft-t.offsetWidth/2}px`:``,t.style.top=o?``:`${l-e.clientTop-t.offsetHeight/2}px`}function nt(e,t,n,r,i){let a=r.bottom-r.top;e.dataset.placement=`overlap`,t.hidden=!0,e.style.maxHeight=i.height>a?`${Math.max(a,0)}px`:``;let o=Math.min(n.bottom,r.bottom)-Ke;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${W(n.left+Ke,r.left,r.right-i.width)}px`}function rt(e,t,n,r,i,a,o){let s=Math.max(o[n],0),c=Math.min(a.height,s);e.dataset.placement=n,t.hidden=!0,e.style.maxHeight=a.height>s?`${s}px`:``,e.style.top=`${n===`bottom`?r.bottom+V:r.top-V-c}px`;let l=G(r.left,r.right,i.left,i.right);e.style.left=`${W(l-a.width/2,i.left,i.right-a.width)}px`}function it(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+H,bottom:window.innerHeight-r(`paddingBottom`)-H,left:r(`paddingLeft`)+H,right:window.innerWidth-r(`paddingRight`)-H}}function at(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);if(t instanceof HTMLElement)return t;let n=document.createElement(`span`);return n.className=`wui-tour-arrow`,n.setAttribute(`aria-hidden`,`true`),n.hidden=!0,e.append(n),n}var ot=0,st=`btn btn-sm btn-link`;function K(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`Expected "${t}" to match a ${n.name}.`);return r}function ct(e,t){let n=`wui-tour-end-${++ot}`,{nextLabel:r,nextHref:i}=e,a=r&&i?m(`a`,{class:`${p(`primary`,`solid`,`sm`)} wui-tour-end-next`,"data-wui":l,href:i},r):null,o=a!==null,s=m(`button`,{type:`button`,class:`${o?st:p(`primary`,`solid`,`sm`)} wui-tour-end-button`,"data-wui":l},e.button);return m(t?`dialog`:`div`,{class:`wui-tour-card wui-tour-end`,"data-layout":`center`,"data-next":o||void 0,role:`dialog`,tabindex:-1,"aria-labelledby":`${n}-title`,"aria-describedby":`${n}-message`},m(`div`,{class:`wui-tour-end-mark`,"aria-hidden":`true`},Me({viewBox:`0 0 24 24`,focusable:`false`},[[`path`,{d:`M5 12.5l4.5 4.5L19 7.5`}]])),m(`h2`,{class:`wui-tour-title wui-tour-end-title`,id:`${n}-title`},e.title),m(`p`,{class:`wui-tour-text wui-tour-end-message`,id:`${n}-message`},e.message),m(`div`,{class:`wui-tour-actions`},a,s))}var lt=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function ut(e,t,n){let r=e.ownerDocument,i=ct(t,e.getRootNode()===r),a=K(i,`.wui-tour-end-button`,HTMLButtonElement),o=i.querySelector(`.wui-tour-end-next`);if(o!==null&&!(o instanceof HTMLAnchorElement))throw Error(`The end dialog's next link is not a link.`);let s=o,c=s??a,l=new AbortController,u=i instanceof HTMLDialogElement?i:null,d=null;return new Promise(o=>{let f=e=>{if(l.abort(),d&&u){let e=d;d=null,se(u).then(e)}o(e)};if(n?.aborted){f(`done`);return}let p=K(e,`.wui-tour-card:not(.wui-tour-end)`,HTMLElement),m=K(e,`.wui-tour-spot`,HTMLElement),h=K(e,`[role=status]`,HTMLElement),g={signal:l.signal};n?.addEventListener(`abort`,()=>f(`done`),g),a.addEventListener(`click`,()=>f(`done`),g),s&&s.addEventListener(`click`,e=>{lt(e)&&(e.preventDefault(),f(`next`))},g),r.addEventListener(`keydown`,e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){if(d)return;e.preventDefault(),e.stopPropagation(),f(`done`)}else je(e)&&s&&!e.shiftKey&&(e.composedPath?.()[0]??e.target)===s&&(e.preventDefault(),f(`next`))}},{capture:!0,signal:l.signal});let _=()=>{l.signal.aborted||(p.hidden=!0,$e(m,p,null),e.append(i),He(i),u&&(d=oe(u,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>f(`done`)})),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),c.focus())},v=Ue(p);v===null?_():v.then(_)})}var dt=` :host { all: initial; display: revert-layer; position: fixed; inset: 0; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-popover":`0px 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-ease-linear":`cubic-bezier(0, 0, 1, 1)`,"--wui-duration-fast":`150ms`,"--wui-duration-default":`250ms`,"--wui-duration-slow":`400ms`,"--wui-space-xs":`4px`,"--wui-tour-motion-duration":`200ms`,"--wui-tour-motion-ease":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-tour-spot-duration":`240ms`,"--wui-tour-spot-ease":`cubic-bezier(0.32, 0.72, 0, 1)`,"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-text":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-on-primary":`#FFFFFF`,"--color-success-soft":`#E8FAEE`,"--color-success-text":`#0e7531`,"--color-on-scrim":`#FFFFFF`,"--color-scrim-strong":`color-mix(in srgb, #071437 62%, transparent)`,"--color-surface":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-bg-muted":`#F5F6FA`}).map(([e,t])=>` ${e}: ${t};`).join(` `)} } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; } .btn { display: inline-block; margin: 0; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; } .btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-neutral { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-neutral:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-text); text-decoration: underline; } .btn-link:hover { color: var(--color-primary-hover); } .wui-tour-layer { pointer-events: none; font-family: "Webority Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--color-text); text-align: start; } .wui-tour-card { pointer-events: auto; } .wui-tour-layer { position: fixed; inset: 0; z-index: var(--wui-z-tour); width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; background: none; } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 0 0 4px 2px color-mix(in srgb, var(--color-primary) 30%, transparent), 0 0 0 100vmax var(--color-scrim-strong); pointer-events: none; } .wui-tour-card { display: flex; flex-direction: column; gap: 8px; width: min(360px, 100vw - 16px); padding: 16px; overflow-y: auto; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--wui-radius-lg); corner-shape: squircle; box-shadow: var(--wui-shadow-popover); } .wui-tour-card:focus { outline: none; } .wui-tour-card:focus-visible { outline: var(--wui-focus-ring-width) solid var(--color-focus-ring); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-title { margin: 0; font-size: 16px; font-weight: 600; } .wui-tour-text { margin: 0; font-size: 14px; color: var(--color-text-muted); } .wui-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; } .wui-tour-nav { display: flex; gap: 8px; } .wui-tour-skip { color: var(--color-text-muted); } .wui-tour-back, .wui-tour-next { min-width: 64px; } @keyframes wui-tour-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes wui-tour-card-enter { from { opacity: 0; scale: 0.96; translate: var(--wui-tour-card-lift, 0 6px); } to { opacity: 1; scale: 1; translate: 0 0; } } .wui-tour-layer[data-state=leaving], .wui-tour-card[data-state=leaving] { opacity: 0; } .wui-tour-layer[data-state=leaving], .wui-tour-layer[data-state=leaving] * { pointer-events: none; } @media (prefers-reduced-motion: no-preference) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-spot { transition: top var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), left var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), width var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), height var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), border-radius var(--wui-tour-spot-duration) var(--wui-tour-spot-ease); } .wui-tour-spot[data-tracking] { transition: none; } .wui-tour-card { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=top] { --wui-tour-card-lift: 0 -6px; transform-origin: bottom center; } .wui-tour-card[data-placement=bottom] { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=left] { --wui-tour-card-lift: -6px 0; transform-origin: right center; } .wui-tour-card[data-placement=right] { --wui-tour-card-lift: 6px 0; transform-origin: left center; } .wui-tour-card[data-placement=overlap], .wui-tour-card[data-placement=center] { --wui-tour-card-lift: 0 0; transform-origin: center; } .wui-tour-card[data-state=entering] { animation: wui-tour-card-enter var(--wui-tour-motion-duration) var(--wui-tour-motion-ease) var(--wui-tour-card-delay, 0ms) both; } .wui-tour-card[data-state=leaving] { transition: opacity calc(var(--wui-tour-motion-duration) / 2) var(--wui-tour-motion-ease); } } @media (prefers-reduced-motion: reduce) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear) both; } } .wui-tour-progress-bar { display: flex; gap: 4px; } .wui-tour-progress-segment { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--color-border); } .wui-tour-progress-segment[data-filled] { background: var(--color-primary); } .wui-tour-position { margin: 0; font-size: 12px; color: var(--color-text-muted); } .wui-tour-layer { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); } .wui-tour-card:has(.wui-tour-arrow:not([hidden])) { overflow: visible; } .wui-tour-arrow { position: absolute; width: 8px; height: 8px; background: var(--color-surface); border: 1px solid var(--color-border); rotate: 45deg; pointer-events: none; } .wui-tour-card[data-placement=bottom] .wui-tour-arrow { top: -5px; border-right-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=top] .wui-tour-arrow { bottom: -5px; border-top-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=right] .wui-tour-arrow { left: -5px; border-top-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=left] .wui-tour-arrow { right: -5px; border-bottom-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } @media (max-width: 575.98px) { .wui-tour-card { width: calc(100vw - 16px); } .wui-tour-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; } } .wui-tour-media { position: relative; order: -1; flex: none; aspect-ratio: 16/9; margin: -16px -16px 4px; overflow: hidden; background: var(--color-border); } .wui-tour-media>img, .wui-tour-media>video { display: block; width: 100%; height: 100%; object-fit: cover; } .wui-tour-card[data-welcome] { width: min(420px, 100vw - 16px); } .wui-tour-media-toggle { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--color-scrim-strong); color: var(--color-on-scrim); cursor: pointer; } .wui-tour-media-toggle>svg { width: 20px; height: 20px; fill: currentColor; } .wui-tour-media-toggle:focus-visible { outline: 2px solid var(--color-on-scrim); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-layer[data-advance] { pointer-events: none; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-card { pointer-events: auto; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-spot::before { content: ""; position: absolute; inset: -100vmax; pointer-events: auto; clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 100vmax 100vmax, calc(100% - 100vmax) 100vmax, calc(100% - 100vmax) calc(100% - 100vmax), 100vmax calc(100% - 100vmax), 100vmax 100vmax); } .wui-tour-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); } .wui-tour-pointer { position: absolute; top: 50%; left: 50%; width: 18px; height: 24px; pointer-events: none; } .wui-tour-pointer::before { content: ""; position: absolute; inset: 0; background: var(--color-primary); clip-path: polygon(0 0, 0 75%, 28% 58%, 46% 100%, 62% 92%, 45% 52%, 85% 52%); filter: drop-shadow(1px 0 0 var(--color-surface)) drop-shadow(-1px 0 0 var(--color-surface)) drop-shadow(0 1px 0 var(--color-surface)) drop-shadow(0 -1px 0 var(--color-surface)); } .wui-tour-pointer::after { content: ""; position: absolute; top: -16px; left: -16px; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); opacity: 0; display: none; } @media (max-width: 575.98px) { .wui-tour-pointer { width: 24px; height: 24px; translate: -50% -50%; } .wui-tour-pointer::before { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-surface); filter: none; } .wui-tour-pointer::after { top: -4px; left: -4px; } } @keyframes wui-tour-tap { 0% { opacity: 0; transform: translate(56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-tap-rtl { 0% { opacity: 0; transform: translate(-56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(-56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-ripple { 0%, 50% { opacity: 0; transform: scale(0.2); } 52% { opacity: 0.35; transform: scale(0.2); } 80%, 100% { opacity: 0; transform: scale(1); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-pointer { opacity: 0; animation: wui-tour-tap calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } .wui-tour-pointer:dir(rtl) { animation-name: wui-tour-tap-rtl; } .wui-tour-pointer::after { display: block; animation: wui-tour-ripple calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } } @keyframes wui-tour-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } } .wui-tour-end[data-layout=center] { --wui-tour-card-lift: 0 0; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: center; align-items: center; gap: 8px; width: min(420px, 100vw - 16px); max-height: calc(100vh - 16px); padding: 24px; text-align: center; } .wui-tour-end[data-layout=center] .wui-tour-actions { justify-content: center; margin-top: 8px; } .wui-tour-end[data-layout=center][data-next] .wui-tour-actions { flex-direction: column; align-items: stretch; width: 100%; gap: var(--wui-space-xs); } .wui-tour-end-mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-success-soft); color: var(--color-success-text); } .wui-tour-end-mark>svg { width: 26px; height: 26px; } .wui-tour-end-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; } .wui-tour-end-title { font-size: 18px; } .wui-tour-end-message { text-wrap: balance; } .wui-tour-end-next { text-wrap: balance; } .wui-tour-end-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check var(--wui-duration-default) var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + var(--wui-duration-fast)) both; } } `,ft=()=>E(`tour`,O),pt=`wui-tour-media`,mt=`wui-tour-media-toggle`,ht=`http://www.w3.org/2000/svg`,gt=`M6 5h4v14H6zM14 5h4v14h-4z`,_t=`M8 5v14l11-7z`,vt=()=>({pause:ft().mediaPauseLabel,play:ft().mediaPlayLabel}),yt=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function bt(e){let t=document.createElementNS(ht,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(ht,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function xt(e){let t=document.createElement(`img`);return t.setAttribute(`alt`,e.mediaAlt??``),t.setAttribute(`width`,`1280`),t.setAttribute(`height`,`720`),t.setAttribute(`loading`,`lazy`),t.setAttribute(`decoding`,`async`),t.setAttribute(`src`,e.media??``),t}function St(e,t){let n=document.createElement(`video`);return n.muted=!0,n.setAttribute(`muted`,``),n.loop=!0,n.setAttribute(`playsinline`,``),t&&n.setAttribute(`autoplay`,``),n.setAttribute(`preload`,t?`auto`:`metadata`),e.mediaAlt&&n.setAttribute(`aria-label`,e.mediaAlt),e.mediaPoster&&n.setAttribute(`poster`,e.mediaPoster),n.setAttribute(`src`,e.media??``),n}function Ct(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=mt;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(bt(r?gt:_t))};return e.addEventListener(`play`,()=>r()),e.addEventListener(`pause`,()=>r()),n.addEventListener(`click`,()=>{e.paused?e.play()?.catch(()=>r()):e.pause()}),r(e.hasAttribute(`autoplay`)),n}function wt(e){let t=e.querySelector(`:scope > .${pt}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function Tt(e,t,n=vt()){if(wt(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=pt,t.mediaType===`video`){let e=St(t,!yt());r.append(e,Ct(e,n))}else r.appendChild(xt(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var Et=`data-wui-tour-open`,Dt=()=>E(`tour`,O);function Ot(e){let t=new Set;return{drop:e=>{t.add(e)},position:e=>{t.delete(e);let n=0;for(let r of t)r<e&&n++;return e+1-n},total:()=>e-t.size}}function kt(e,t,n){return(e.getAttribute(`progress-label`)||Dt().progressLabel).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function At(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);if(!(i instanceof HTMLElement))throw Error(`tour position label missing`);i.textContent=t;let a=e.querySelector(`.wui-tour-progress-bar`);if(!a){let t=e.ownerDocument,n=t.createElement(`div`);n.className=`wui-tour-progress`,n.setAttribute(`aria-hidden`,`true`),a=t.createElement(`div`),a.className=`wui-tour-progress-bar`,n.append(a),i.before(n)}let o=a.children;for(;o.length<r;){let t=e.ownerDocument.createElement(`span`);t.className=`wui-tour-progress-segment`,a.append(t)}for(;o.length>r;){let e=a.lastElementChild;if(!e)throw Error(`progress bar segment missing`);e.remove()}for(let e=0;e<o.length;e++){let t=o[e];if(!t)throw Error(`progress bar segment missing`);t.toggleAttribute(`data-filled`,e<n)}}var jt=`wui-tour-seen:`;function Mt(e=jt,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}function q(e){"@babel/helpers - typeof";return q=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},q(e)}function Nt(e,t){if(q(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(q(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pt(e){var t=Nt(e,`string`);return q(t)==`symbol`?t:t+``}function J(e,t,n){return(t=Pt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ft=`wui-tour-step`,It=`wui-tour-host`,Y=`data-tracking`,X=()=>E(`tour`,O),Lt=()=>({back:X().backLabel,next:X().nextLabel,skip:X().skipLabel,done:X().doneLabel,mediaPause:X().mediaPauseLabel,mediaPlay:X().mediaPlayLabel,endTitle:X().endTitle,endMessage:X().endMessage,endButton:X().doneLabel}),Rt={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},zt=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],Bt={index:null,position:null,total:null},Vt=0,Z=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Ht=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Q(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Ut=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Wt(e){$||($=new CSSStyleSheet,$.replaceSync(dt)),e.adoptedStyleSheets=[$]}var Gt=class extends r{static get observedAttributes(){return[`open`]}constructor(){super(),J(this,`seenStore`,void 0),J(this,`onBeforeStep`,void 0),J(this,`_run`,void 0),J(this,`_running`,void 0),J(this,`_layer`,void 0),J(this,`_outer`,void 0),J(this,`_shadow`,void 0),J(this,`_unbindAdvance`,void 0),J(this,`_ending`,void 0),J(this,`_seenMark`,void 0),J(this,`_steps`,[]),J(this,`_progress`,Ot(0)),J(this,`_firstIndex`,0),J(this,`_returnFocus`,null),J(this,`_current`,null),J(this,`_moving`,!1),J(this,`_card`,null),J(this,`_spot`,null),J(this,`_live`,null),J(this,`_onKey`,null),J(this,`_onFocusIn`,null),this.seenStore=null,this.onBeforeStep=null,this._run=0,this._running=!1,this._layer=null,this._outer=null,this._shadow=null,this._unbindAdvance=null,this._ending=null,this._seenMark=null}connectedCallback(){this.hasAttribute(`open`)&&this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(e,t,n){e===`open`&&this.isConnected&&(n===null?this.stop():this.start())}get tourId(){return this.getAttribute(`tour-id`)||``}set tourId(e){e==null||e===``?this.removeAttribute(`tour-id`):this.setAttribute(`tour-id`,String(e))}get isolated(){return this.hasAttribute(`isolated`)}set isolated(e){this.toggleAttribute(`isolated`,e===!0||e===``||e===`true`)}_stepList(){return Array.from(this.querySelectorAll(`:scope > ${Ft}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of zt)e.hasAttribute(r)&&(t[n]=e.getAttribute(r)??``);return t})}_stepAt(e){let t=this._steps[e];if(!t)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);return t}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Mt():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Rt[e])||Lt()[e]}_endDialogText(){if(this.getAttribute(`end-dialog`)===`false`)return null;let e=(this.getAttribute(`end-next-label`)??``).trim(),t=(this.getAttribute(`end-next-href`)??``).trim();return{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`),nextLabel:e,nextHref:t}}_markSeen(e){let t=this._store();return t?t.markSeen(this.tourId,e):null}async start(){if(this._running)return;this._running=!0;let e=++this._run;this.hasAttribute(`open`)||this.setAttribute(`open`,``);try{await this._start(e)}catch(t){throw e===this._run&&(this._running=!1),t}}async _start(e){this._steps=this._stepList(),this._progress=Ot(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!Z(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(!e)break;if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target),a=t instanceof HTMLElement||t instanceof SVGElement?t:null;if(Z(a))return this._progress.position(i),{index:i,target:a};this._progress.drop(i)}return null}async _beforeStep(e,t){let n=[];this.dispatchEvent(new CustomEvent(`wui-tour:beforestep`,{bubbles:!0,detail:{step:e,index:t,wait:e=>n.push(e)}})),await Promise.all(n),typeof this.onBeforeStep==`function`&&await this.onBeforeStep(e,t)}_build(){let e=`wui-tour-${++Vt}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.replaceChildren(m(`div`,{class:`wui-tour-spot`,"aria-hidden":`true`}),m(`div`,{class:`wui-tour-card`,role:`dialog`,tabindex:`-1`,"aria-labelledby":`${e}-title`,"aria-describedby":`${e}-text`},m(`p`,{class:`wui-tour-position`}),m(`h2`,{class:`wui-tour-title`,id:`${e}-title`}),m(`p`,{class:`wui-tour-text`,id:`${e}-text`}),m(`div`,{class:`wui-tour-actions`},m(`button`,{type:`button`,class:`btn btn-sm btn-link wui-tour-skip`}),m(`div`,{class:`wui-tour-nav`},m(`button`,{type:`button`,class:`${p(`neutral`,`outline`,`sm`)} wui-tour-back`,"data-wui":l}),m(`button`,{type:`button`,class:`${p(`primary`,`solid`,`sm`)} wui-tour-next`,"data-wui":l})))),m(`div`,{class:`visually-hidden`,role:`status`,"aria-live":`polite`}));let n=t;this._shadow=null,this.isolated&&(n=document.createElement(It),this._shadow=n.attachShadow({mode:`open`}),Wt(this._shadow),this._shadow.appendChild(t)),n.setAttribute(`popover`,`manual`),T(document).appendChild(n),document.documentElement.setAttribute(Et,``),this._outer=n,this._layer=t;let r=Q(t,`.wui-tour-spot`,HTMLDivElement),i=Q(t,`.wui-tour-card`,HTMLDivElement),a=Q(t,`[role=status]`,HTMLElement);this._spot=r,this._card=i,this._live=a,Q(i,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Q(i,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Q(i,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let s=e=>this._key(e);this._onKey=s;let c=e=>{let t=this._layer;if(!t||this._ending)return;let n=this._current,r=n?this._stepAt(n.index):null;if(!(e.target instanceof Node))throw Error(`<wui-tour> saw a focus change from a non-node target`);Oe(t,r,n?.target??null,e.target)||i.focus()};this._onFocusIn=c,document.addEventListener(`keydown`,s,!0),this._shadow||document.addEventListener(`focusin`,c),o(n,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_raise(){let e=this._outer;if(!e)throw Error(`<wui-tour> raises a step before its host is built`);let t=T(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),ce(e)}_show(e){this._current=e;let{index:t,target:n}=e,r=this._stepAt(t),i=this._layer,a=this._spot,o=this._card,s=this._live;if(!i||!a||!o||!s)throw Error(`<wui-tour> shows a step before its layer is built`);this._raise();let c=this._progress.position(t),l=this._progress.total(),u=c===l&&!this._endDialogText(),d=kt(this,c,l);At(o,{text:d,position:c,total:l}),Tt(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=F(this,{layer:i,spot:a,card:o},r,n),p=Q(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Q(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Q(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Q(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Q(o,`.wui-tour-next`,HTMLElement).textContent=this._label(u?`done`:`next`);let h=[d,r.title,r.description].filter(Boolean).join(`. `);s.textContent=f?[h,f].join(/[.!?]$/.test(h)?` `:`. `):h,Qe(o,n),a.removeAttribute(Y),this._place(),He(o),this._unbindAdvance?.(),this._unbindAdvance=De(r,n,()=>void this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&Ht(Ut()))||o.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:c,total:l}}))}_place(){if(!this._current||!this._layer)return;let e=this._spot,t=this._card;if(!e||!t)throw Error(`<wui-tour> places a step before its layer is built`);$e(e,t,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot;if(!e)throw Error(`<wui-tour> follows a step before its spot is built`);let t=e.style.cssText;this._place(),e.style.cssText!==t&&e.setAttribute(Y,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=this._card;if(!e)throw Error(`<wui-tour> moved with no card showing`);let t=Ue(e);if(t!==null&&await t,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText(),t=e?await this._showEnd(e):`done`;if(n!==this._run)return;let r=await this._close(t===`next`?`next`:`finished`);if(t===`next`&&r&&e){let t=this.ownerDocument.defaultView;if(!t)throw Error(`<wui-tour> has no window to follow its next link in`);t.location.assign(e.nextHref)}}}finally{this._moving=!1}}_showEnd(e){this._unbindAdvance?.(),this._unbindAdvance=null;let t=this._layer,n=this._spot,r=this._card;if(!t||!n||!r)throw Error(`<wui-tour> ends a tour before its layer is built`);return F(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(Y),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),ut(t,e,this._ending.signal)}_key(e){if(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)return;let t=a(e.key,i(this));if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(t===`ArrowRight`||t===`ArrowLeft`){if(Ht(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),t===`ArrowRight`)this._move(1);else{let e=this._current;if(!e)throw Error(`<wui-tour> moved back with no step showing`);e.index>this._firstIndex&&this._move(-1)}}else if(e.key===`Tab`&&!this._shadow){let t=this._current,n=this._card;if(!t||!n)throw Error(`<wui-tour> cycled focus with no step showing`);ke(e,{card:n,active:this._active(),step:this._stepAt(t.index),target:t.target})}}_teardown(){if(!this._layer)return;this._onKey&&document.removeEventListener(`keydown`,this._onKey,!0),this._onFocusIn&&document.removeEventListener(`focusin`,this._onFocusIn);let e=!this._shadow||this._shadow.activeElement!==null||!document.activeElement||document.activeElement===document.body;this._unbindAdvance?.(),this._unbindAdvance=null,this._ending?.abort(),this._ending=null,this._seenMark=null;let t=this._outer;if(s(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);We(t),document.documentElement.removeAttribute(Et),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&(n instanceof HTMLElement||n instanceof SVGElement)&&n.focus()}async _close(e,t=null){let n=this._run,r=this._current,i=r?{index:r.index,position:this._progress.position(r.index),total:this._progress.total()}:Bt,a=this._seenMark;this._teardown();let o=e===`next`?`finished`:e,s=!1;try{n===this._run&&await(a??this._markSeen(o)),s=n===this._run}finally{this._finish(e,i,t)}return s}_finish(e,t=Bt,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}},Kt=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,Gt),t(`wui-tour-step`,Kt),e.WuiTourStep=Kt,e})({});
1
+ var WeborityTour=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var n=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(n);var r=HTMLElement;function i(e){return getComputedStyle(e).direction===`rtl`}function a(e,t){return t?e===`ArrowRight`?`ArrowLeft`:e===`ArrowLeft`?`ArrowRight`:e:e}function o(e,t){s(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function s(e){if(!e?._reanchor)return;window.removeEventListener(`resize`,e._reanchor);let t=e._reanchorScroll;t&&window.removeEventListener(`scroll`,t,!0),e._reanchor=null,e._reanchorScroll=null}var c=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,l=`AppButton`,u=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),d={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 f(e){return c(d,e)}function p(e=`primary`,t=`solid`,n=`md`){if(!u.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!f(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=d[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}function m(e,t,...n){if(e.toLowerCase()===`svg`)throw Error(`make() builds HTML elements; use svgRoot for svg`);let r=document.createElement(e);for(let[e,n]of Object.entries(t??{}))n===!0?r.setAttribute(e,``):(typeof n==`string`||typeof n==`number`)&&r.setAttribute(e,String(n));let i=[];for(let e of n)e instanceof Node?i.push(e):(typeof e==`string`||typeof e==`number`)&&i.push(document.createTextNode(String(e)));return r.append(...i),r}var h=`data-wui-dismiss`,g=`data-wui-closing`,_=`[${h}]`,v=`(prefers-reduced-motion: reduce)`,y=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,b=new WeakSet,x=Symbol.for(`webority.ui.modal-stack`),ee=Symbol.for(`webority.ui.root-watches`);function te(e){let t=e;return t[ee]??=new Set,t[ee]}function ne(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(y))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${_},.wui-modal-back`))return t;n??=t}return n}function re(e){let t=[],n=new Map;for(let r of e.querySelectorAll(y))if(!(r.closest(`[hidden],[inert]`)||r.closest(`dialog`)!==e)&&!(r.tabIndex<0||r.getClientRects().length===0)){if(r instanceof HTMLInputElement&&r.type===`radio`&&r.name){let e=n.get(r.name);e?r.checked&&!e.checked&&(e.checked=r,t[t.indexOf(e.first)]=r):(n.set(r.name,{first:r,checked:r.checked?r:null}),t.push(r))}else t.push(r)}return t}function S(e){let t=e;return t[x]??=[],t[x]}function ie(e){C(e),S(e.ownerDocument).push(e)}function C(e){let t=S(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function w(e){for(let t of te(e)){let n=T(e);t.last!==n&&(t.last=n,t.listener(n))}}function ae(e){let t=Promise.allSettled(e.getAnimations().map(e=>e.finished));return new Promise(e=>{let n=window.setTimeout(e,400);t.then(()=>{window.clearTimeout(n),e()})})}function oe(e,t){let n=t.focus===`first-control`?ne(e):null,r=n??e,i=r===e&&!e.hasAttribute(`tabindex`);i&&e.setAttribute(`tabindex`,`-1`);let a=!t.escape&&!e.hasAttribute(`closedby`);a&&e.setAttribute(`closedby`,`none`),b.add(e);let o=()=>{if(ie(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw C(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),w(e.ownerDocument)},s=!1,c=n=>{if(n.key!==`Escape`||n.defaultPrevented||!t.escape||n.altKey||n.ctrlKey||n.metaKey)return;let r=e.ownerDocument;T(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&b.has(e)&&e.open&&(s=!1,t.onRequestClose(`escape`))},0)))},l=t=>{if(t.key!==`Tab`||t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)return;let n=e.ownerDocument;if(T(n)!==e||e.querySelector(`:popover-open`))return;t.preventDefault();let r=re(e),i=r[0],a=r[r.length-1];if(!i||!a){e.focus();return}let o=n.activeElement,s=o?r.findIndex(e=>e===o||e.contains(o)):-1;s<0?(t.shiftKey?a:i).focus():r[((t.shiftKey?s-1:s+1)+r.length)%r.length]?.focus()},u=e=>{s=!1,e.preventDefault(),t.escape&&t.onRequestClose(`escape`)},d=n=>{let r=n.target;if(!(r instanceof Element))return;let i=r.closest(_);if(i&&i.closest(`dialog`)===e){t.onRequestClose(`dismiss`);return}if(r!==e||!t.backdrop)return;let a=e.getBoundingClientRect();(n.clientX<a.left||n.clientX>a.right||n.clientY<a.top||n.clientY>a.bottom)&&t.onRequestClose(`backdrop`)},f=()=>{let n=s;s=!1,C(e),b.has(e)?(o(),n&&t.onRequestClose(`escape`)):w(e.ownerDocument)},p=e.ownerDocument;return p.addEventListener(`keydown`,c),p.addEventListener(`keydown`,l),e.addEventListener(`cancel`,u),e.addEventListener(`click`,d),e.addEventListener(`close`,f),o(),()=>{p.removeEventListener(`keydown`,c),p.removeEventListener(`keydown`,l),e.removeEventListener(`cancel`,u),e.removeEventListener(`click`,d),e.removeEventListener(`close`,f),b.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),C(e),w(e.ownerDocument)}}async function se(e){b.delete(e),e.setAttribute(g,``),!window.matchMedia(v).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await ae(e),e.close(),C(e),w(e.ownerDocument),e.removeAttribute(g)}function ce(e){if(le(e),!e.isConnected)throw Error(`nativeOverlay: raisePopover was given a panel that is not on the page; a caller whose overlay root can leave the page skips the raise until the panel moves to the new root`);e.hidePopover(),e.showPopover()}function le(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function T(e=document){let t=S(e);for(let e=t.length-1;e>=0;e--){let n=t[e];if(n?.isConnected&&n.hasAttribute(`open`))return n}return e.body}var ue=/\{([A-Za-z0-9_]+)\}/g,de=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,fe=new Map,pe=0,me=new Map;function E(e,t){let n=fe.get(e);if(n===void 0)return t;let r=me.get(e);if(r!==void 0&&r.version===pe&&r.english===t&&ge(r.merged,t))return r.merged;let i=he(e,n,t);return me.set(e,{version:pe,english:t,merged:i}),i}function he(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=de(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=D(t);for(let t of D(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function ge(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>de(e,t))}function D(e){return Array.from(e.matchAll(ue),e=>e[1]??``)}var O={backLabel:`Back`,doneLabel:`Done`,endMessage:`You know your way around now. Enjoy exploring.`,endTitle:`You're all set`,mediaPauseLabel:`Pause animation`,mediaPlayLabel:`Play animation`,nextLabel:`Next`,progressLabel:`Step {current} of {total}`,skipLabel:`Skip`},_e={advanceLabel:`Click {actionName} to continue.`},k=`data-advance`,A=`wui-tour-hint`,j=`wui-tour-pointer`,ve=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,ye=()=>E(`tourAdvance`,_e),M=(e,t)=>e?.advanceOn===`click`&&!!t,N=e=>(e??``).replace(/\s+/g,` `).trim(),be=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLMeterElement||e instanceof HTMLOutputElement||e instanceof HTMLProgressElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.labels:null,xe=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLFieldSetElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement?e.disabled:!1;function Se(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e instanceof HTMLInputElement&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(be(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=N(e);if(t)return t}return``}function Ce(e){for(let t of[e,...e.querySelectorAll(ve)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!xe(t))return t;return null}function P(e,t,n){let r=(e.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(e=>e&&e!==t);n&&r.push(t),r.length>0?e.setAttribute(`aria-describedby`,r.join(` `)):e.removeAttribute(`aria-describedby`)}function we(e,t){let n=e.querySelector(`.${A}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&P(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=A,i&&(n.id=i);let t=e.querySelector(`.wui-tour-actions`);if(!t)throw Error(`Tour card has no actions row.`);t.before(n)}n.textContent=t,i&&P(e,i,!0)}}function Te(e,t){let n=e.querySelector(`.${j}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=j,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var Ee=e=>getComputedStyle(e).animationName;function F(e,{layer:t,spot:n,card:r},i,a){let o=M(i,a);t.toggleAttribute(k,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(k)&&(n.removeAttribute(k),o&&Ee(n)),o&&n.setAttribute(k,``),Te(n,o);let s=r.querySelector(`.wui-tour-next`);if(!(s instanceof HTMLElement))throw Error(`Tour card has no next button.`);s.classList.toggle(`btn-primary`,!o),s.classList.toggle(`btn-link`,o);let c=o?N(i?.actionLabel)||Se(a):``,l=e.getAttribute(`advance-label`)||ye().advanceLabel,u=c?l.replace(/\{actionName\}/g,()=>c):``;return we(r,u),u}function De(e,t,n){if(!M(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function Oe(e,t,n,r){return e.contains(r)||M(t,n)&&n.contains(r)}function ke(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=M(r,i)?Ce(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i?.contains(n));e.preventDefault();let c=a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length];if(!c)throw Error(`Tour card has no focus stop.`);c.focus()}function Ae(e){return e.isComposing||e.keyCode===229}function je(e){return e.key===`Enter`&&!Ae(e)}var I=`http://www.w3.org/2000/svg`;function L(e){return e.map(Ne)}function Me(e,t){let n=document.createElementNS(I,`svg`);return R(n,e),n.append(...L(t)),n}function Ne(e){let[t,n,r]=e,i=document.createElementNS(I,t);return R(i,n),typeof r==`string`?i.append(document.createTextNode(r)):r&&i.append(...L(r)),i}function R(e,t){for(let[n,r]of Object.entries(t))r===!0?e.setAttribute(n,``):(typeof r==`string`||typeof r==`number`)&&e.setAttribute(n,String(r))}var Pe=2/3,Fe=1e3,Ie=new Set([`top`,`left`,`width`,`height`]),z=new WeakMap,B=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],Le=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,Re=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&Ie.has(e.transitionProperty),ze=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function Be(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,Fe);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function Ve(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?B(t,Re):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*Pe-r)}return n}function He(e){let t=Ve(e);t>0?e.style.setProperty(`--wui-tour-card-delay`,`${Math.round(t)}ms`):e.style.removeProperty(`--wui-tour-card-delay`),e.dataset.state=`entering`;let n={};z.set(e,n);let r=()=>{z.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=B(e,ze);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function Ue(e){return e.dataset.state=`leaving`,Be(B(e,Le))}function We(e){let t=e.shadowRoot?.querySelector(`.wui-tour-layer`),n=e.classList.contains(`wui-tour-layer`)?e:t instanceof HTMLElement?t:null;n&&(n.dataset.state=`leaving`);let r=n?Be(B(n,Le)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var Ge=2,V=12,H=8,Ke=4,U=20,qe=`(max-width: 575.98px)`,Je=[`bottom`,`top`,`right`,`left`],Ye=[`bottom`,`top`,`left`,`right`],Xe=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],Ze,W=(e,t,n)=>Math.max(t,Math.min(e,n)),G=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function Qe(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=it(e),r=e.offsetHeight+V;if(t.getBoundingClientRect().height+4+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+Ge}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function $e(e,t,n){let r=e.style,a=t.style,o=at(t);if(!n){r.top=`50%`,r.left=`50%`,r.width=`0px`,r.height=`0px`,r.boxShadow=`0 0 0 100vmax var(--color-scrim-strong)`;for(let e of Xe)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,o.hidden=!0,a.position=`fixed`,a.top=`50%`,a.left=`50%`,a.transform=`translate(-50%, -50%)`,a.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,a.transform=``,a.position=`fixed`;let s=n.getBoundingClientRect();r.top=`${s.top}px`,r.left=`${s.left}px`,r.width=`${s.width}px`,r.height=`${s.height}px`,et(r,n);let c=t.scrollTop;a.maxHeight=``;let l={width:t.offsetWidth,height:t.offsetHeight},u=it(t),d=u.bottom-u.top,f={bottom:u.bottom-s.bottom-V,top:s.top-V-u.top,right:u.right-s.right-V,left:s.left-V-u.left},p=window.matchMedia(qe).matches,m=(i(n)?Ye:Je).find(e=>e===`top`||e===`bottom`?l.height<=f[e]+1:!p&&l.width<=f[e]+1&&l.height<=d+1),h=Math.min(s.bottom,u.bottom+H)-Math.max(s.top,u.top-H);m?tt(t,o,m,s,u,l):h>=Math.min(l.height,d)+8?nt(t,o,s,u,l):rt(t,o,f.bottom>=f.top?`bottom`:`top`,s,u,l,f),t.scrollTop=c}function et(e,t){Ze??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of Xe)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),Ze&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function tt(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=G(r.left,r.right,i.left,i.right);s=W(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+V:r.top-V-a.height,l=W(e-s,U,a.width-U)}else{let e=G(r.top,r.bottom,i.top,i.bottom);c=W(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+V:r.left-V-a.width,l=W(e-c,U,a.height-U)}e.dataset.placement=n,e.style.top=`${c}px`,e.style.left=`${s}px`,t.hidden=!1,t.style.left=o?`${l-e.clientLeft-t.offsetWidth/2}px`:``,t.style.top=o?``:`${l-e.clientTop-t.offsetHeight/2}px`}function nt(e,t,n,r,i){let a=r.bottom-r.top;e.dataset.placement=`overlap`,t.hidden=!0,e.style.maxHeight=i.height>a?`${Math.max(a,0)}px`:``;let o=Math.min(n.bottom,r.bottom)-Ke;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${W(n.left+Ke,r.left,r.right-i.width)}px`}function rt(e,t,n,r,i,a,o){let s=Math.max(o[n],0),c=Math.min(a.height,s);e.dataset.placement=n,t.hidden=!0,e.style.maxHeight=a.height>s?`${s}px`:``,e.style.top=`${n===`bottom`?r.bottom+V:r.top-V-c}px`;let l=G(r.left,r.right,i.left,i.right);e.style.left=`${W(l-a.width/2,i.left,i.right-a.width)}px`}function it(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+H,bottom:window.innerHeight-r(`paddingBottom`)-H,left:r(`paddingLeft`)+H,right:window.innerWidth-r(`paddingRight`)-H}}function at(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);if(t instanceof HTMLElement)return t;let n=document.createElement(`span`);return n.className=`wui-tour-arrow`,n.setAttribute(`aria-hidden`,`true`),n.hidden=!0,e.append(n),n}var ot=0,st=`btn btn-sm btn-link`;function K(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`Expected "${t}" to match a ${n.name}.`);return r}function ct(e,t){let n=`wui-tour-end-${++ot}`,{nextLabel:r,nextHref:i}=e,a=r&&i?m(`a`,{class:`${p(`primary`,`solid`,`sm`)} wui-tour-end-next`,"data-wui":l,href:i},r):null,o=a!==null,s=m(`button`,{type:`button`,class:`${o?st:p(`primary`,`solid`,`sm`)} wui-tour-end-button`,"data-wui":l},e.button);return m(t?`dialog`:`div`,{class:`wui-tour-card wui-tour-end`,"data-layout":`center`,"data-next":o||void 0,role:`dialog`,tabindex:-1,"aria-labelledby":`${n}-title`,"aria-describedby":`${n}-message`},m(`div`,{class:`wui-tour-end-mark`,"aria-hidden":`true`},Me({viewBox:`0 0 24 24`,focusable:`false`},[[`path`,{d:`M5 12.5l4.5 4.5L19 7.5`}]])),m(`h2`,{class:`wui-tour-title wui-tour-end-title`,id:`${n}-title`},e.title),m(`p`,{class:`wui-tour-text wui-tour-end-message`,id:`${n}-message`},e.message),m(`div`,{class:`wui-tour-actions`},a,s))}var lt=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function ut(e,t,n){let r=e.ownerDocument,i=ct(t,e.getRootNode()===r),a=K(i,`.wui-tour-end-button`,HTMLButtonElement),o=i.querySelector(`.wui-tour-end-next`);if(o!==null&&!(o instanceof HTMLAnchorElement))throw Error(`The end dialog's next link is not a link.`);let s=o,c=s??a,l=new AbortController,u=i instanceof HTMLDialogElement?i:null,d=null;return new Promise(o=>{let f=e=>{if(l.abort(),d&&u){let e=d;d=null,se(u).then(e)}o(e)};if(n?.aborted){f(`done`);return}let p=K(e,`.wui-tour-card:not(.wui-tour-end)`,HTMLElement),m=K(e,`.wui-tour-spot`,HTMLElement),h=K(e,`[role=status]`,HTMLElement),g={signal:l.signal};n?.addEventListener(`abort`,()=>f(`done`),g),a.addEventListener(`click`,()=>f(`done`),g),s&&s.addEventListener(`click`,e=>{lt(e)&&(e.preventDefault(),f(`next`))},g),r.addEventListener(`keydown`,e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){if(d)return;e.preventDefault(),e.stopPropagation(),f(`done`)}else je(e)&&s&&!e.shiftKey&&(e.composedPath?.()[0]??e.target)===s&&(e.preventDefault(),f(`next`))}},{capture:!0,signal:l.signal});let _=()=>{l.signal.aborted||(p.hidden=!0,$e(m,p,null),e.append(i),He(i),u&&(d=oe(u,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>f(`done`)})),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),c.focus())},v=Ue(p);v===null?_():v.then(_)})}var dt=` :host { all: initial; display: revert-layer; position: fixed; inset: 0; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-2xl":`18px`,"--wui-shadow-popover":`0px 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-ease-linear":`cubic-bezier(0, 0, 1, 1)`,"--wui-duration-fast":`150ms`,"--wui-duration-default":`250ms`,"--wui-duration-slow":`400ms`,"--wui-space-xs":`4px`,"--wui-tour-motion-duration":`200ms`,"--wui-tour-motion-ease":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-tour-spot-duration":`240ms`,"--wui-tour-spot-ease":`cubic-bezier(0.32, 0.72, 0, 1)`,"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-text":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-on-primary":`#FFFFFF`,"--color-success-soft":`#E8FAEE`,"--color-success-text":`#0e7531`,"--color-on-scrim":`#FFFFFF`,"--color-scrim-strong":`color-mix(in srgb, #071437 62%, transparent)`,"--color-surface":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-bg-muted":`#F5F6FA`}).map(([e,t])=>` ${e}: ${t};`).join(` `)} } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; } .btn { display: inline-block; margin: 0; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; } .btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-neutral { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-neutral:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-text); text-decoration: underline; } .btn-link:hover { color: var(--color-primary-hover); } .wui-tour-layer { pointer-events: none; font-family: "Webority Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--color-text); text-align: start; } .wui-tour-card { pointer-events: auto; } .wui-tour-layer { position: fixed; inset: 0; z-index: var(--wui-z-tour); width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; background: none; } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 0 0 4px 2px color-mix(in srgb, var(--color-primary) 30%, transparent), 0 0 0 100vmax var(--color-scrim-strong); pointer-events: none; } .wui-tour-card { display: flex; flex-direction: column; gap: 8px; width: min(360px, 100vw - 16px); padding: 16px; overflow-y: auto; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--wui-radius-2xl); corner-shape: squircle; box-shadow: var(--wui-shadow-popover); } .wui-tour-card:focus { outline: none; } .wui-tour-card:focus-visible { outline: var(--wui-focus-ring-width) solid var(--color-focus-ring); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-title { margin: 0; font-size: 16px; font-weight: 600; } .wui-tour-text { margin: 0; font-size: 14px; color: var(--color-text-muted); } .wui-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; } .wui-tour-nav { display: flex; gap: 8px; } .wui-tour-skip { color: var(--color-text-muted); } .wui-tour-back, .wui-tour-next { min-width: 64px; } @keyframes wui-tour-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes wui-tour-card-enter { from { opacity: 0; scale: 0.96; translate: var(--wui-tour-card-lift, 0 6px); } to { opacity: 1; scale: 1; translate: 0 0; } } .wui-tour-layer[data-state=leaving], .wui-tour-card[data-state=leaving] { opacity: 0; } .wui-tour-layer[data-state=leaving], .wui-tour-layer[data-state=leaving] * { pointer-events: none; } @media (prefers-reduced-motion: no-preference) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-spot { transition: top var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), left var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), width var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), height var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), border-radius var(--wui-tour-spot-duration) var(--wui-tour-spot-ease); } .wui-tour-spot[data-tracking] { transition: none; } .wui-tour-card { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=top] { --wui-tour-card-lift: 0 -6px; transform-origin: bottom center; } .wui-tour-card[data-placement=bottom] { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=left] { --wui-tour-card-lift: -6px 0; transform-origin: right center; } .wui-tour-card[data-placement=right] { --wui-tour-card-lift: 6px 0; transform-origin: left center; } .wui-tour-card[data-placement=overlap], .wui-tour-card[data-placement=center] { --wui-tour-card-lift: 0 0; transform-origin: center; } .wui-tour-card[data-state=entering] { animation: wui-tour-card-enter var(--wui-tour-motion-duration) var(--wui-tour-motion-ease) var(--wui-tour-card-delay, 0ms) both; } .wui-tour-card[data-state=leaving] { transition: opacity calc(var(--wui-tour-motion-duration) / 2) var(--wui-tour-motion-ease); } } @media (prefers-reduced-motion: reduce) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear) both; } } .wui-tour-progress-bar { display: flex; gap: 4px; } .wui-tour-progress-segment { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--color-border); } .wui-tour-progress-segment[data-filled] { background: var(--color-primary); } .wui-tour-position { margin: 0; font-size: 12px; color: var(--color-text-muted); } .wui-tour-layer { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); } .wui-tour-card:has(.wui-tour-arrow:not([hidden])) { overflow: visible; } .wui-tour-arrow { position: absolute; width: 8px; height: 8px; background: var(--color-surface); border: 1px solid var(--color-border); rotate: 45deg; pointer-events: none; } .wui-tour-card[data-placement=bottom] .wui-tour-arrow { top: -5px; border-right-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=top] .wui-tour-arrow { bottom: -5px; border-top-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=right] .wui-tour-arrow { left: -5px; border-top-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=left] .wui-tour-arrow { right: -5px; border-bottom-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } @media (max-width: 575.98px) { .wui-tour-card { width: calc(100vw - 16px); } .wui-tour-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; } } .wui-tour-media { position: relative; order: -1; flex: none; aspect-ratio: 16/9; margin: -16px -16px 4px; overflow: hidden; background: var(--color-border); } .wui-tour-media>img, .wui-tour-media>video { display: block; width: 100%; height: 100%; object-fit: cover; } .wui-tour-card[data-welcome] { width: min(420px, 100vw - 16px); } .wui-tour-media-toggle { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--color-scrim-strong); color: var(--color-on-scrim); cursor: pointer; } .wui-tour-media-toggle>svg { width: 20px; height: 20px; fill: currentColor; } .wui-tour-media-toggle:focus-visible { outline: 2px solid var(--color-on-scrim); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-layer[data-advance] { pointer-events: none; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-card { pointer-events: auto; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-spot::before { content: ""; position: absolute; inset: -100vmax; pointer-events: auto; clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 100vmax 100vmax, calc(100% - 100vmax) 100vmax, calc(100% - 100vmax) calc(100% - 100vmax), 100vmax calc(100% - 100vmax), 100vmax 100vmax); } .wui-tour-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); } .wui-tour-pointer { position: absolute; top: 50%; left: 50%; width: 18px; height: 24px; pointer-events: none; } .wui-tour-pointer::before { content: ""; position: absolute; inset: 0; background: var(--color-primary); clip-path: polygon(0 0, 0 75%, 28% 58%, 46% 100%, 62% 92%, 45% 52%, 85% 52%); filter: drop-shadow(1px 0 0 var(--color-surface)) drop-shadow(-1px 0 0 var(--color-surface)) drop-shadow(0 1px 0 var(--color-surface)) drop-shadow(0 -1px 0 var(--color-surface)); } .wui-tour-pointer::after { content: ""; position: absolute; top: -16px; left: -16px; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); opacity: 0; display: none; } @media (max-width: 575.98px) { .wui-tour-pointer { width: 24px; height: 24px; translate: -50% -50%; } .wui-tour-pointer::before { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-surface); filter: none; } .wui-tour-pointer::after { top: -4px; left: -4px; } } @keyframes wui-tour-tap { 0% { opacity: 0; transform: translate(56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-tap-rtl { 0% { opacity: 0; transform: translate(-56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(-56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-ripple { 0%, 50% { opacity: 0; transform: scale(0.2); } 52% { opacity: 0.35; transform: scale(0.2); } 80%, 100% { opacity: 0; transform: scale(1); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-pointer { opacity: 0; animation: wui-tour-tap calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } .wui-tour-pointer:dir(rtl) { animation-name: wui-tour-tap-rtl; } .wui-tour-pointer::after { display: block; animation: wui-tour-ripple calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } } @keyframes wui-tour-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } } .wui-tour-end[data-layout=center] { --wui-tour-card-lift: 0 0; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: center; align-items: center; gap: 8px; width: min(420px, 100vw - 16px); max-height: calc(100vh - 16px); padding: 24px; text-align: center; } .wui-tour-end[data-layout=center] .wui-tour-actions { justify-content: center; margin-top: 8px; } .wui-tour-end[data-layout=center][data-next] .wui-tour-actions { flex-direction: column; align-items: stretch; width: 100%; gap: var(--wui-space-xs); } .wui-tour-end-mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-success-soft); color: var(--color-success-text); } .wui-tour-end-mark>svg { width: 26px; height: 26px; } .wui-tour-end-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; } .wui-tour-end-title { font-size: 18px; } .wui-tour-end-message { text-wrap: balance; } .wui-tour-end-next { text-wrap: balance; } .wui-tour-end-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check var(--wui-duration-default) var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + var(--wui-duration-fast)) both; } } `,ft=()=>E(`tour`,O),pt=`wui-tour-media`,mt=`wui-tour-media-toggle`,ht=`http://www.w3.org/2000/svg`,gt=`M6 5h4v14H6zM14 5h4v14h-4z`,_t=`M8 5v14l11-7z`,vt=()=>({pause:ft().mediaPauseLabel,play:ft().mediaPlayLabel}),yt=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function bt(e){let t=document.createElementNS(ht,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(ht,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function xt(e){let t=document.createElement(`img`);return t.setAttribute(`alt`,e.mediaAlt??``),t.setAttribute(`width`,`1280`),t.setAttribute(`height`,`720`),t.setAttribute(`loading`,`lazy`),t.setAttribute(`decoding`,`async`),t.setAttribute(`src`,e.media??``),t}function St(e,t){let n=document.createElement(`video`);return n.muted=!0,n.setAttribute(`muted`,``),n.loop=!0,n.setAttribute(`playsinline`,``),t&&n.setAttribute(`autoplay`,``),n.setAttribute(`preload`,t?`auto`:`metadata`),e.mediaAlt&&n.setAttribute(`aria-label`,e.mediaAlt),e.mediaPoster&&n.setAttribute(`poster`,e.mediaPoster),n.setAttribute(`src`,e.media??``),n}function Ct(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=mt;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(bt(r?gt:_t))};return e.addEventListener(`play`,()=>r()),e.addEventListener(`pause`,()=>r()),n.addEventListener(`click`,()=>{e.paused?e.play()?.catch(()=>r()):e.pause()}),r(e.hasAttribute(`autoplay`)),n}function wt(e){let t=e.querySelector(`:scope > .${pt}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function Tt(e,t,n=vt()){if(wt(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=pt,t.mediaType===`video`){let e=St(t,!yt());r.append(e,Ct(e,n))}else r.appendChild(xt(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var Et=`data-wui-tour-open`,Dt=()=>E(`tour`,O);function Ot(e){let t=new Set;return{drop:e=>{t.add(e)},position:e=>{t.delete(e);let n=0;for(let r of t)r<e&&n++;return e+1-n},total:()=>e-t.size}}function kt(e,t,n){return(e.getAttribute(`progress-label`)||Dt().progressLabel).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function At(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);if(!(i instanceof HTMLElement))throw Error(`tour position label missing`);i.textContent=t;let a=e.querySelector(`.wui-tour-progress-bar`);if(!a){let t=e.ownerDocument,n=t.createElement(`div`);n.className=`wui-tour-progress`,n.setAttribute(`aria-hidden`,`true`),a=t.createElement(`div`),a.className=`wui-tour-progress-bar`,n.append(a),i.before(n)}let o=a.children;for(;o.length<r;){let t=e.ownerDocument.createElement(`span`);t.className=`wui-tour-progress-segment`,a.append(t)}for(;o.length>r;){let e=a.lastElementChild;if(!e)throw Error(`progress bar segment missing`);e.remove()}for(let e=0;e<o.length;e++){let t=o[e];if(!t)throw Error(`progress bar segment missing`);t.toggleAttribute(`data-filled`,e<n)}}var jt=`wui-tour-seen:`;function Mt(e=jt,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}function q(e){"@babel/helpers - typeof";return q=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},q(e)}function Nt(e,t){if(q(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(q(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pt(e){var t=Nt(e,`string`);return q(t)==`symbol`?t:t+``}function J(e,t,n){return(t=Pt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ft=`wui-tour-step`,It=`wui-tour-host`,Y=`data-tracking`,X=()=>E(`tour`,O),Lt=()=>({back:X().backLabel,next:X().nextLabel,skip:X().skipLabel,done:X().doneLabel,mediaPause:X().mediaPauseLabel,mediaPlay:X().mediaPlayLabel,endTitle:X().endTitle,endMessage:X().endMessage,endButton:X().doneLabel}),Rt={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},zt=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],Bt={index:null,position:null,total:null},Vt=0,Z=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Ht=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Q(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Ut=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Wt(e){$||($=new CSSStyleSheet,$.replaceSync(dt)),e.adoptedStyleSheets=[$]}var Gt=class extends r{static get observedAttributes(){return[`open`]}constructor(){super(),J(this,`seenStore`,void 0),J(this,`onBeforeStep`,void 0),J(this,`_run`,void 0),J(this,`_running`,void 0),J(this,`_layer`,void 0),J(this,`_outer`,void 0),J(this,`_shadow`,void 0),J(this,`_unbindAdvance`,void 0),J(this,`_ending`,void 0),J(this,`_seenMark`,void 0),J(this,`_steps`,[]),J(this,`_progress`,Ot(0)),J(this,`_firstIndex`,0),J(this,`_returnFocus`,null),J(this,`_current`,null),J(this,`_moving`,!1),J(this,`_card`,null),J(this,`_spot`,null),J(this,`_live`,null),J(this,`_onKey`,null),J(this,`_onFocusIn`,null),this.seenStore=null,this.onBeforeStep=null,this._run=0,this._running=!1,this._layer=null,this._outer=null,this._shadow=null,this._unbindAdvance=null,this._ending=null,this._seenMark=null}connectedCallback(){this.hasAttribute(`open`)&&this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(e,t,n){e===`open`&&this.isConnected&&(n===null?this.stop():this.start())}get tourId(){return this.getAttribute(`tour-id`)||``}set tourId(e){e==null||e===``?this.removeAttribute(`tour-id`):this.setAttribute(`tour-id`,String(e))}get isolated(){return this.hasAttribute(`isolated`)}set isolated(e){this.toggleAttribute(`isolated`,e===!0||e===``||e===`true`)}_stepList(){return Array.from(this.querySelectorAll(`:scope > ${Ft}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of zt)e.hasAttribute(r)&&(t[n]=e.getAttribute(r)??``);return t})}_stepAt(e){let t=this._steps[e];if(!t)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);return t}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Mt():null}_label(e){return this.getAttribute(Rt[e])||Lt()[e]}_endDialogText(){if(this.getAttribute(`end-dialog`)===`false`)return null;let e=(this.getAttribute(`end-next-label`)??``).trim(),t=(this.getAttribute(`end-next-href`)??``).trim();return{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`),nextLabel:e,nextHref:t}}_markSeen(e){let t=this._store();return t?t.markSeen(this.tourId,e):null}async start(){if(this._running)return;this._running=!0;let e=++this._run;this.hasAttribute(`open`)||this.setAttribute(`open`,``);try{await this._start(e)}catch(t){throw e===this._run&&(this._running=!1),t}}async _start(e){this._steps=this._stepList(),this._progress=Ot(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!Z(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(!e)break;if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target),a=t instanceof HTMLElement||t instanceof SVGElement?t:null;if(Z(a))return this._progress.position(i),{index:i,target:a};this._progress.drop(i)}return null}async _beforeStep(e,t){let n=[];this.dispatchEvent(new CustomEvent(`wui-tour:beforestep`,{bubbles:!0,detail:{step:e,index:t,wait:e=>n.push(e)}})),await Promise.all(n),typeof this.onBeforeStep==`function`&&await this.onBeforeStep(e,t)}_build(){let e=`wui-tour-${++Vt}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.replaceChildren(m(`div`,{class:`wui-tour-spot`,"aria-hidden":`true`}),m(`div`,{class:`wui-tour-card`,role:`dialog`,tabindex:`-1`,"aria-labelledby":`${e}-title`,"aria-describedby":`${e}-text`},m(`p`,{class:`wui-tour-position`}),m(`h2`,{class:`wui-tour-title`,id:`${e}-title`}),m(`p`,{class:`wui-tour-text`,id:`${e}-text`}),m(`div`,{class:`wui-tour-actions`},m(`button`,{type:`button`,class:`btn btn-sm btn-link wui-tour-skip`}),m(`div`,{class:`wui-tour-nav`},m(`button`,{type:`button`,class:`${p(`neutral`,`outline`,`sm`)} wui-tour-back`,"data-wui":l}),m(`button`,{type:`button`,class:`${p(`primary`,`solid`,`sm`)} wui-tour-next`,"data-wui":l})))),m(`div`,{class:`visually-hidden`,role:`status`,"aria-live":`polite`}));let n=t;this._shadow=null,this.isolated&&(n=document.createElement(It),this._shadow=n.attachShadow({mode:`open`}),Wt(this._shadow),this._shadow.appendChild(t)),n.setAttribute(`popover`,`manual`),T(document).appendChild(n),document.documentElement.setAttribute(Et,``),this._outer=n,this._layer=t;let r=Q(t,`.wui-tour-spot`,HTMLDivElement),i=Q(t,`.wui-tour-card`,HTMLDivElement),a=Q(t,`[role=status]`,HTMLElement);this._spot=r,this._card=i,this._live=a,Q(i,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Q(i,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Q(i,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let s=e=>this._key(e);this._onKey=s;let c=e=>{let t=this._layer;if(!t||this._ending)return;let n=this._current,r=n?this._stepAt(n.index):null;if(!(e.target instanceof Node))throw Error(`<wui-tour> saw a focus change from a non-node target`);Oe(t,r,n?.target??null,e.target)||i.focus()};this._onFocusIn=c,document.addEventListener(`keydown`,s,!0),this._shadow||document.addEventListener(`focusin`,c),o(n,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_raise(){let e=this._outer;if(!e)throw Error(`<wui-tour> raises a step before its host is built`);let t=T(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),ce(e)}_show(e){this._current=e;let{index:t,target:n}=e,r=this._stepAt(t),i=this._layer,a=this._spot,o=this._card,s=this._live;if(!i||!a||!o||!s)throw Error(`<wui-tour> shows a step before its layer is built`);this._raise();let c=this._progress.position(t),l=this._progress.total(),u=c===l&&!this._endDialogText(),d=kt(this,c,l);At(o,{text:d,position:c,total:l}),Tt(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=F(this,{layer:i,spot:a,card:o},r,n),p=Q(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Q(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Q(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Q(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Q(o,`.wui-tour-next`,HTMLElement).textContent=this._label(u?`done`:`next`);let h=[d,r.title,r.description].filter(Boolean).join(`. `);s.textContent=f?[h,f].join(/[.!?]$/.test(h)?` `:`. `):h,Qe(o,n),a.removeAttribute(Y),this._place(),He(o),this._unbindAdvance?.(),this._unbindAdvance=De(r,n,()=>void this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&Ht(Ut()))||o.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:c,total:l}}))}_place(){if(!this._current||!this._layer)return;let e=this._spot,t=this._card;if(!e||!t)throw Error(`<wui-tour> places a step before its layer is built`);$e(e,t,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot;if(!e)throw Error(`<wui-tour> follows a step before its spot is built`);let t=e.style.cssText;this._place(),e.style.cssText!==t&&e.setAttribute(Y,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=this._card;if(!e)throw Error(`<wui-tour> moved with no card showing`);let t=Ue(e);if(t!==null&&await t,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText(),t=e?await this._showEnd(e):`done`;if(n!==this._run)return;let r=await this._close(t===`next`?`next`:`finished`);if(t===`next`&&r&&e){let t=this.ownerDocument.defaultView;if(!t)throw Error(`<wui-tour> has no window to follow its next link in`);t.location.assign(e.nextHref)}}}finally{this._moving=!1}}_showEnd(e){this._unbindAdvance?.(),this._unbindAdvance=null;let t=this._layer,n=this._spot,r=this._card;if(!t||!n||!r)throw Error(`<wui-tour> ends a tour before its layer is built`);return F(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(Y),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),ut(t,e,this._ending.signal)}_key(e){if(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)return;let t=a(e.key,i(this));if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(t===`ArrowRight`||t===`ArrowLeft`){if(Ht(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),t===`ArrowRight`)this._move(1);else{let e=this._current;if(!e)throw Error(`<wui-tour> moved back with no step showing`);e.index>this._firstIndex&&this._move(-1)}}else if(e.key===`Tab`&&!this._shadow){let t=this._current,n=this._card;if(!t||!n)throw Error(`<wui-tour> cycled focus with no step showing`);ke(e,{card:n,active:this._active(),step:this._stepAt(t.index),target:t.target})}}_teardown(){if(!this._layer)return;this._onKey&&document.removeEventListener(`keydown`,this._onKey,!0),this._onFocusIn&&document.removeEventListener(`focusin`,this._onFocusIn);let e=!this._shadow||this._shadow.activeElement!==null||!document.activeElement||document.activeElement===document.body;this._unbindAdvance?.(),this._unbindAdvance=null,this._ending?.abort(),this._ending=null,this._seenMark=null;let t=this._outer;if(s(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);We(t),document.documentElement.removeAttribute(Et),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&(n instanceof HTMLElement||n instanceof SVGElement)&&n.focus()}async _close(e,t=null){let n=this._run,r=this._current,i=r?{index:r.index,position:this._progress.position(r.index),total:this._progress.total()}:Bt,a=this._seenMark;this._teardown();let o=e===`next`?`finished`:e,s=!1;try{n===this._run&&await(a??this._markSeen(o)),s=n===this._run}finally{this._finish(e,i,t)}return s}_finish(e,t=Bt,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}},Kt=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,Gt),t(`wui-tour-step`,Kt),e.WuiTourStep=Kt,e})({});
@@ -0,0 +1 @@
1
+ import{n as e}from"./devWarn-DXdRWZs3.js";var t=Object.freeze([`POST`,`PUT`,`PATCH`,`DELETE`]),n=t=>(e(`[@webority/ui-elements] Wui-Toast-Action: ${t}; the toast shows no action.`),null),r=e=>typeof e==`object`&&!!e;function i(e){if(e==null||e===``)return null;let i;try{i=JSON.parse(e)}catch{return n(`the value is not JSON`)}let a=r(i)?i:{},o=a.label,s=a.url,c=String(a.method??`POST`).toUpperCase();return typeof o!=`string`||o===``||typeof s!=`string`||s===``?n(`label and url must be non-empty strings`):t.includes(c)?{label:o,url:s,method:c}:n(`method must be one of ${t.join(`, `)}`)}var a=`wui-csrf`,o=`RequestVerificationToken`,s={metaName:a,header:o};function c({metaName:e=a,header:t=o}={}){s={metaName:e,header:t}}var l=`Wui-Request`,u=Object.freeze({fragment:`Wui-Fragment`,message:`Wui-Message`,redirect:`Wui-Redirect`,result:`Wui-Result`,keepOpen:`Wui-Keep-Open`,toastVariant:`Wui-Toast-Variant`,toastAction:`Wui-Toast-Action`,data:`Wui-Data`,next:`Wui-Next`}),d=Object.freeze([`ok`,`validation`,`forbidden`,`networkCheck`,`client`,`server`,`network`,`timeout`,`aborted`,`stale`,`session`]),f=/* @__PURE__ */ new Set([`GET`,`HEAD`]);function p(e=document){let t=[...e.querySelectorAll(`meta`)].find(e=>e.getAttribute(`name`)===s.metaName),n=t?.getAttribute(`content`);return!t||!n?null:{header:t.getAttribute(`data-header`)||s.header,token:n}}var m=e=>{try{return new URL(e,window.location.href).origin===window.location.origin}catch{return!1}};function h(e,t=null){return e>=200&&e<300?`ok`:e===401?`session`:e===403?t?.get(`cf-mitigated`)===`challenge`?`networkCheck`:`forbidden`:e===422?`validation`:e>=400&&e<500?`client`:`server`}var g=e=>typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`,_=3e4;function v(e){let t=e?.trim()??``;return/^\d+$/.test(t)?Number(t):void 0}var y=e=>{if(e==null||e===``)return null;try{return JSON.parse(e)}catch(e){throw TypeError(`The ${u.data} response header is not JSON: ${e instanceof Error?e.message:String(e)}`,{cause:e})}},b=e=>{if(e==null)return null;try{return decodeURIComponent(e)}catch{return e}};function x(e,t=null,n=``){let r=e=>t?.headers.get(e)??null;return{kind:e,ok:e===`ok`,status:t?.status??0,html:n,response:t,message:b(r(u.message)),redirect:r(u.redirect),result:r(u.result),keepOpen:r(u.keepOpen)===`1`,toastVariant:r(u.toastVariant),toastAction:i(r(u.toastAction)),fragment:r(u.fragment)===`1`,data:y(b(r(u.data))),next:r(u.next)}}async function S(e,t={}){let n=(t.method||`GET`).toUpperCase(),r=t.navigate||(e=>window.location.assign(e)),i={Accept:`text/html`,"X-Requested-With":`XMLHttpRequest`,[l]:`1`,...t.headers};if(!f.has(n)&&m(e)){let e=p();e&&(i[e.header]=e.token)}let a=new AbortController,o=()=>a.abort(),s=t.signal;s?.aborted&&a.abort(),s?.addEventListener(`abort`,o,{once:!0});let c=t.timeoutMs??0,d=!1,_=c>0?setTimeout(()=>{d=!0,a.abort()},c):void 0,v=e=>s?.aborted?`aborted`:d?`timeout`:g(e)?`aborted`:`network`;try{let o;try{o=await fetch(e,{method:n,...t.body===void 0?{}:{body:t.body},headers:i,signal:a.signal,credentials:`same-origin`})}catch(e){return x(v(e))}let s=h(o.status,o.headers);if(s===`ok`&&o.redirected&&o.headers.get(u.fragment)!==`1`&&(s=`session`),s===`session`)return r(o.status===401?o.headers.get(`Location`)||window.location.href:o.url),x(s,o);let c=``;if(s===`ok`||s===`validation`)try{c=await o.text()}catch(e){return x(v(e),o)}return x(s,o,c)}finally{clearTimeout(_),s?.removeEventListener(`abort`,o)}}function C(){let e=null,t=0;return{async run(n,r={}){e?.abort();let i=new AbortController;e=i;let a=++t,o=r.signal;o&&(o.aborted?i.abort():o.addEventListener(`abort`,()=>i.abort(),{once:!0}));let s;try{s=await S(n,{...r,signal:i.signal})}finally{e===i&&(e=null)}return a!==t&&s.kind!==`aborted`?{...s,kind:`stale`,ok:!1}:s},abort(){e?.abort(),e=null}}}export{u as a,c,p as d,x as f,i as g,t as h,d as i,C as l,S as m,o as n,l as o,v as p,_ as r,h as s,a as t,m as u};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-elements",
3
- "version": "0.175.0",
3
+ "version": "0.177.0",
4
4
  "description": "Webority framework-agnostic UI custom elements (<wui-*>): the single implementation of the interactive components, styled by @webority/theme. Used natively in Razor and wrapped by @webority/ui-react.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -275,10 +275,10 @@
275
275
  "@tiptap/starter-kit": "3.31.4",
276
276
  "@types/node": "25.6.0",
277
277
  "@vitest/coverage-v8": "5.1.0",
278
- "@webority/biome-config": "0.175.0",
279
- "@webority/markdown-core": "0.175.0",
280
- "@webority/theme": "0.175.0",
281
- "@webority/web-core": "0.175.0",
278
+ "@webority/biome-config": "0.177.0",
279
+ "@webority/markdown-core": "0.177.0",
280
+ "@webority/theme": "0.177.0",
281
+ "@webority/web-core": "0.177.0",
282
282
  "echarts": "6.1.0",
283
283
  "jsdom": "30.1.1",
284
284
  "libphonenumber-js": "^1.13.9",
@@ -288,7 +288,7 @@
288
288
  "vitest": "5.1.0"
289
289
  },
290
290
  "scripts": {
291
- "build": "node scripts/check-wui-assembly.ts && node scripts/check-one-dom-helper.ts && tsc -p tsconfig.json && vite build && vite build -c vite.phone.config.ts && vite build -c vite.consent-banner.config.ts && vite build -c vite.lead-popup.config.ts && vite build -c vite.tour.config.ts && vite build -c vite.file-viewer.config.ts && vite build -c vite.chart.config.ts && vite build -c vite.calendar.config.ts && vite build -c vite.rich-text.config.ts && node build-global.ts && vite build -c vite.razor.config.ts && node ../../scripts/sync-rcl-assets.mjs elements && node scripts/emit-types.ts clean && tsc -p tsconfig.build.json && node scripts/emit-types.ts flatten && node -e \"const f=require('node:fs');f.mkdirSync('dist/text',{recursive:true});f.copyFileSync('../../text/web.en.json','dist/text/en.json')\"",
291
+ "build": "node scripts/check-wui-assembly.ts && node scripts/check-one-dom-helper.ts && tsc -p tsconfig.json && vite build && vite build -c vite.phone.config.ts && vite build -c vite.consent-banner.config.ts && vite build -c vite.lead-popup.config.ts && vite build -c vite.tour.config.ts && vite build -c vite.file-viewer.config.ts && vite build -c vite.chart.config.ts && vite build -c vite.calendar.config.ts && vite build -c vite.rich-text.config.ts && node build-global.ts && vite build -c vite.razor.config.ts && node ../../scripts/sync-rcl-assets.mts elements && node scripts/emit-types.ts clean && tsc -p tsconfig.build.json && node scripts/emit-types.ts flatten && node -e \"const f=require('node:fs');f.mkdirSync('dist/text',{recursive:true});f.copyFileSync('../../text/web.en.json','dist/text/en.json')\"",
292
292
  "typecheck": "tsc -p tsconfig.json",
293
293
  "test": "vitest run",
294
294
  "test:razor-js": "vitest run --config vitest.razor-js.config.ts",
@@ -1,14 +1,14 @@
1
- import type { normalizeEvents } from "./calendarModel.ts";
1
+ import { type normalizeEvents } from "./calendarModel.ts";
2
2
  export type ViewName = "month" | "week" | "day" | "list";
3
- type NormalizedEvent = ReturnType<typeof normalizeEvents>[number];
4
- interface RangeState {
3
+ export type NormalizedEvent = ReturnType<typeof normalizeEvents>[number];
4
+ export interface RangeState {
5
5
  view: ViewName;
6
6
  title: string;
7
7
  start: string;
8
8
  end: string;
9
9
  date: string;
10
10
  }
11
- interface MountOptions {
11
+ export interface MountOptions {
12
12
  view: ViewName;
13
13
  date?: string;
14
14
  timeZone?: string;
@@ -47,22 +47,9 @@ export interface CalendarEngine {
47
47
  dispose(): void;
48
48
  }
49
49
  export declare const isViewName: (value: string | undefined) => value is ViewName;
50
- /**
51
- * Draw a calendar in `container`.
52
- *
53
- * @param container Where the calendar goes.
54
- * @param options
55
- * @param options.view The first view.
56
- * @param options.date The day to open on (`YYYY-MM-DD` in that zone); today when omitted.
57
- * @param options.timeZone IANA zone the dates of the calendar are in; India Standard Time when omitted.
58
- * @param options.firstDay The weekday a week starts on, 0 = Sunday to 6 = Saturday.
59
- * @param options.emptyText What a list of no events says.
60
- * @param options.fetchEvents Normalized events for the range (days; `end` is the first day not shown) and the view it is shown in.
61
- * @param options.onEventClick Return true to stop the event's own link.
62
- * @param options.navigate Called to open the link of a stacked event; defaults to window.location.assign.
63
- * @param options.onDateClick
64
- * @param options.onRange The visible period changed.
65
- * @param options.onLoading
66
- */
50
+ type MountCalendar = (container: HTMLElement, options: MountOptions) => CalendarEngine;
51
+ /** Called once by the calendar builds' entry with the real engine. */
52
+ export declare function installCalendarEngine(mountEngine: MountCalendar): void;
53
+ /** Draw a calendar in `container` through the installed engine; see calendarEngine.ts for the options. */
67
54
  export declare function mountCalendar(container: HTMLElement, options: MountOptions): CalendarEngine;
68
55
  export {};
@@ -0,0 +1,22 @@
1
+ import type { CalendarEngine, MountOptions } from "./calendarAdapter.ts";
2
+ import { WuiCalendar } from "./WuiCalendar.ts";
3
+ /**
4
+ * Draw a calendar in `container`.
5
+ *
6
+ * @param container Where the calendar goes.
7
+ * @param options
8
+ * @param options.view The first view.
9
+ * @param options.date The day to open on (`YYYY-MM-DD` in that zone); today when omitted.
10
+ * @param options.timeZone IANA zone the dates of the calendar are in; India Standard Time when omitted.
11
+ * @param options.firstDay The weekday a week starts on, 0 = Sunday to 6 = Saturday.
12
+ * @param options.emptyText What a list of no events says.
13
+ * @param options.fetchEvents Normalized events for the range (days; `end` is the first day not shown) and the view it is shown in.
14
+ * @param options.onEventClick Return true to stop the event's own link.
15
+ * @param options.navigate Called to open the link of a stacked event; defaults to window.location.assign.
16
+ * @param options.onDateClick
17
+ * @param options.onRange The visible period changed.
18
+ * @param options.onLoading
19
+ */
20
+ export declare function mountCalendar(container: HTMLElement, options: MountOptions): CalendarEngine;
21
+ export { CALENDAR_TONES, CALENDAR_VIEWS } from "./calendarModel.ts";
22
+ export { WuiCalendar };
@@ -1,4 +1,15 @@
1
1
  export declare const COMMAND_SHORTCUT_ATTRIBUTE = "data-wui-command-shortcut";
2
+ interface NavigatorPlatform {
3
+ readonly platform: string;
4
+ readonly userAgentData?: {
5
+ readonly platform?: string;
6
+ };
7
+ }
8
+ /**
9
+ * True on macOS, iPhone and iPad, where the command chord is Cmd rather than Ctrl.
10
+ * @param nav
11
+ */
12
+ export declare function isApplePlatform(nav?: NavigatorPlatform): boolean;
2
13
  /**
3
14
  * Ctrl or Cmd plus key, no Alt, no Shift, no auto-repeat; key matched case-insensitively.
4
15
  * @param event
@@ -10,3 +21,4 @@ export declare function isCommandChord(event: KeyboardEvent, key: string): boole
10
21
  * @param root
11
22
  */
12
23
  export declare function initCommandShortcuts(root: Document | Element): void;
24
+ export {};
@@ -34,6 +34,7 @@ import * as tableSelect from "../tableSelect.ts";
34
34
  import * as textStore from "../text/textStore.ts";
35
35
  import * as datePickerText from "../text/web/datePicker.g.ts";
36
36
  import * as drawerText from "../text/web/drawer.g.ts";
37
+ import * as httpFailureText from "../text/web/httpFailure.g.ts";
37
38
  import * as selectText from "../text/web/select.g.ts";
38
39
  import * as textMatch from "../textMatch.ts";
39
40
  import * as tooltips from "../tooltips.ts";
@@ -60,6 +61,7 @@ export interface SharedModules {
60
61
  readonly formMirror: typeof formMirror;
61
62
  readonly glyphs: typeof glyphs;
62
63
  readonly hasOwn: typeof hasOwn;
64
+ readonly httpFailureText: typeof httpFailureText;
63
65
  readonly iconGlyphs: typeof iconGlyphs;
64
66
  readonly imeSafeEnter: typeof imeSafeEnter;
65
67
  readonly isDrawn: typeof isDrawn;
@@ -182,10 +182,6 @@ declare global {
182
182
  load(url: string, options?: Parameters<typeof import("./server/remoteModal.ts").loadRemoteModal>[1]): ReturnType<typeof import("./server/remoteModal.ts").loadRemoteModal>;
183
183
  };
184
184
  tour: {
185
- seenStore: {
186
- isSeen(tourId: string): Promise<boolean>;
187
- markSeen(tourId: string, outcome: "finished" | "skipped"): Promise<void>;
188
- } | null;
189
185
  start(id: string): unknown;
190
186
  };
191
187
  }
@@ -1,6 +1,6 @@
1
1
  export type { AnchorOptions, OverlaySide } from "./anchorOverlay.ts";
2
2
  export { AVATAR_ACCEPT, AVATAR_MAX_SIZE_MB, AVATAR_OUTPUT_SIZE, AVATAR_OUTPUT_TYPE, AVATAR_PREVIEW_SIZES, avatarCropOptions, avatarUnreadableMessage, isHeicFile, } from "./avatarPicker.ts";
3
- export { COMMAND_SHORTCUT_ATTRIBUTE, initCommandShortcuts, isCommandChord } from "./commandShortcut.ts";
3
+ export { COMMAND_SHORTCUT_ATTRIBUTE, initCommandShortcuts, isApplePlatform, isCommandChord } from "./commandShortcut.ts";
4
4
  export { COMMENT_INTENTS, COMMENT_REACTIONS, type CommentIntent } from "./commentText.ts";
5
5
  export { COPY_FEEDBACK_MS, copyTextToClipboard } from "./copyText.ts";
6
6
  export { CURRENCY_SYMBOLS, currencyPrefix, DEFAULT_CURRENCY, isCurrencyCode } from "./currency.ts";
@@ -22,7 +22,7 @@
22
22
  * findByPrefix: (prefix, from) => index, // optional: first row at or after `from` whose text starts with prefix, else -1
23
23
  * });
24
24
  * // Then bind: element.addEventListener('keydown', handler);
25
- * // On unmount: handler.teardown();
25
+ * // On unmount: handler.clearTypeahead();
26
26
  * ```
27
27
  *
28
28
  * **Key contract:** setActive(-1) on close and on Escape is the caller's responsibility
@@ -48,7 +48,6 @@ export interface ListboxKeyNavConfig {
48
48
  export interface ListboxKeyNav {
49
49
  handler: (e: KeyboardEvent) => void;
50
50
  clearTypeahead: () => void;
51
- teardown: () => void;
52
51
  }
53
52
  /**
54
53
  * Factory: creates a keydown handler + typeahead management for a listbox.
@@ -63,7 +62,7 @@ export interface ListboxKeyNav {
63
62
  * @param [config.getCount] - total rows when the list is windowed (default: the rendered rows)
64
63
  * @param [config.getOptionAt] - the row element at a data index when the list is windowed
65
64
  * @param [config.findByPrefix] - (prefix, from) => data index of the first match, -1 for none, when the list is windowed
66
- * @returns { handler: (KeyboardEvent) => void, teardown: () => void, clearTypeahead: () => void }
65
+ * @returns { handler: (KeyboardEvent) => void, clearTypeahead: () => void }
67
66
  */
68
67
  export declare function createListboxKeyNav(config: ListboxKeyNavConfig): ListboxKeyNav;
69
68
  /**
@@ -14,12 +14,7 @@ export declare const pane: {
14
14
  load: (url: string, options?: RemoteOptions) => Promise<ModalHandle>;
15
15
  close: (target: string | Element) => void;
16
16
  };
17
- export interface TourSeenStore {
18
- isSeen(tourId: string): Promise<boolean>;
19
- markSeen(tourId: string, outcome: "finished" | "skipped"): Promise<void>;
20
- }
21
17
  export declare const tour: {
22
- seenStore: TourSeenStore | null;
23
18
  start: (id: string) => unknown;
24
19
  };
25
20
  export declare const table: {
@@ -8,3 +8,4 @@ export { runToastAction, showResultToast, TOAST_ACTION_MS } from "./toastAction.
8
8
  export { parseToastAction, TOAST_ACTION_METHODS } from "./toastHeader.ts";
9
9
  export { formValues, initUnsavedChanges, resetUnsavedChanges } from "./unsavedChanges.ts";
10
10
  export { CSRF_META_NAME, classifyStatus, configureCsrf, createRequestQueue, DEFAULT_CSRF_HEADER, HTTP_KINDS, readCsrf, timeoutFromAttribute, WUI_HEADERS, wuiFetch, } from "./wuiHttp.ts";
11
+ export { type WuiUploadOptions, wuiUpload } from "./wuiUpload.ts";
@@ -5,9 +5,15 @@ export declare const COLLAPSED_COOKIE_MAX_AGE: number;
5
5
  export interface ShellHandle {
6
6
  el: HTMLElement;
7
7
  setUnread(n: number): void;
8
+ setTabCount(href: string, count: number | null, tone?: string): void;
8
9
  refreshNotifications(): Promise<void>;
9
10
  collapsed: boolean;
10
11
  }
12
+ /**
13
+ * Set or clear the count badge of the phone tab bar item whose link is `href`. A count of null or 0 removes
14
+ * the badge; a count over UNREAD_CAP reads "99+" when the bar is capped (data-wui-cap-badges, as the server writes).
15
+ */
16
+ export declare function setTabCount(shell: HTMLElement, href: string, count: number | null, tone?: string): void;
11
17
  /**
12
18
  * Write the remembered rail state the server reads on the next request ("1" collapsed, "0" expanded).
13
19
  * A sandboxed frame without allow-same-origin throws SecurityError on cookie access; it remembers nothing.
@@ -28,12 +28,13 @@ export declare const WUI_HEADERS: Readonly<{
28
28
  /**
29
29
  * Every `kind` a request settles as.
30
30
  * ok: 2xx. validation: 422 (the form re-rendered with its errors). forbidden: 403.
31
+ * networkCheck: a 403 that Cloudflare answered with a challenge (`cf-mitigated: challenge`), not the server refusing access.
31
32
  * client: any other 4xx. server: 5xx. network: no answer at all. aborted: the caller (or a newer
32
33
  * request on the same queue) cancelled it. stale: answered, but a newer request on the same queue
33
34
  * started meanwhile. session: the sign-in expired and the browser is being sent to sign in.
34
35
  * timeout: no answer within the time limit; a caller's or newer request's abort is still aborted.
35
36
  */
36
- export type HttpKind = "ok" | "validation" | "forbidden" | "client" | "server" | "network" | "timeout" | "aborted" | "stale" | "session";
37
+ export type HttpKind = "ok" | "validation" | "forbidden" | "networkCheck" | "client" | "server" | "network" | "timeout" | "aborted" | "stale" | "session";
37
38
  export declare const HTTP_KINDS: readonly HttpKind[];
38
39
  export interface WuiToastAction {
39
40
  label: string;
@@ -75,12 +76,14 @@ export declare function readCsrf(doc?: Document): {
75
76
  header: string;
76
77
  token: string;
77
78
  } | null;
78
- /** Classify a status code. Exported so a caller holding a raw Response applies the same rule. */
79
- export declare function classifyStatus(status: number): HttpKind;
79
+ export declare const isSameOrigin: (url: string) => boolean;
80
+ /** Classify a status code, with the response headers when there are any. Exported so a caller holding a raw Response applies the same rule. */
81
+ export declare function classifyStatus(status: number, headers?: Pick<Headers, "get"> | null): HttpKind;
80
82
  /** The answer time limit the modal, drawer, form, table and post surfaces apply; other callers stay unlimited. */
81
83
  export declare const DEFAULT_TIMEOUT_MS = 30000;
82
84
  /** The `data-wui-timeout` attribute value (milliseconds); anything that is not a whole number reads as no value. */
83
85
  export declare function timeoutFromAttribute(value: string | null): number | undefined;
86
+ export declare function settleResponse(kind: HttpKind, response?: Response | null, html?: string): WuiResult;
84
87
  /**
85
88
  * Fetch `url` and settle as a classified result; never rejects for an HTTP or network failure; it rejects with a TypeError when an answer's Wui-Data header is not JSON (a server defect).
86
89
  */
@@ -0,0 +1,15 @@
1
+ import { type WuiResult } from "./wuiHttp.ts";
2
+ export interface WuiUploadOptions {
3
+ /** Called from the upload progress events; totalBytes is 0 when the browser cannot size the body. */
4
+ onProgress?: (loadedBytes: number, totalBytes: number) => void;
5
+ signal?: AbortSignal;
6
+ /** Milliseconds from sending to the answer. Undefined means no limit: a large part can take minutes. */
7
+ timeoutMs?: number;
8
+ headers?: Record<string, string>;
9
+ }
10
+ /**
11
+ * POST `body` to `url` and settle as a classified result, like wuiFetch; never rejects for an HTTP or network
12
+ * failure. It is the one request the library sends with XMLHttpRequest, because fetch cannot report upload progress.
13
+ * Throws a TypeError for a body that is not FormData or a timeoutMs that is not a positive number.
14
+ */
15
+ export declare function wuiUpload(url: string, body: FormData, options?: WuiUploadOptions): Promise<WuiResult>;
@@ -1,4 +1,5 @@
1
1
  export type HttpFailureText = {
2
+ readonly networkCheckText: string;
2
3
  readonly networkText: string;
3
4
  };
4
5
  export declare const HTTP_FAILURE_TEXT: HttpFailureText;
@@ -1 +0,0 @@
1
- import{n as e,t}from"./buttonClass-C8BRtTk8.js";import{n}from"./commentText-NWsssKvj.js";import{t as r}from"./elementBase-Cxeyx0tU.js";import{t as i}from"./hasOwn-CJsplJ62.js";import{a,l as o,s}from"./nativeOverlay-BHD2QV02.js";import{n as c,t as l}from"./rtl-g7G8Bsib.js";import{t as u}from"./serverHtml-BC6tAyAl.js";import{d}from"./wuiHttp-BWf9dDsZ.js";import{r as f,t as p}from"./textStore-DBplASiZ.js";import{n as m,t as h}from"./httpFailure.g-DBKzEpAf.js";import{r as g}from"./WuiMentionInput-DJv-WwW6.js";var _=`[data-wui-items]`,v=`[data-wui-picker]`,y=`[data-wui-composer]`,b=`[data-wui-comment]`,x=`[data-wui-live]`,S=()=>f(`commentThread`,m),C=e=>({forbidden:S().forbiddenMessage,client:S().failedClientMessage,validation:S().validationMessage,server:S().failedServerMessage,network:f(`httpFailure`,h).networkText})[e],w=e=>({post:S().donePostText,reply:S().doneReplyText,edit:S().doneEditText,delete:S().doneDeleteText,react:``})[e],T=e=>{let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;return typeof t==`string`&&t?t:S().failedServerMessage},E=e=>e instanceof Element?e:null,D=e=>`disabled`in e&&e.disabled===!0,O=(e,t)=>{if(e==null)throw Error(`${t} missing`);return e},k=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},A=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},j=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],M=class extends r{_wired;_busy;_peopleProp;_pickerFor;_openers;constructor(){super(),this._wired=!1,this._busy=!1,this._peopleProp=null,this._pickerFor=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onSubmitKey=this._onSubmitKey.bind(this)}connectedCallback(){if(i(this,`people`)){let e=this.people;Reflect.deleteProperty(this,`people`),this.people=e}if(this._wired)return;this._wired=!0,this.addEventListener(`click`,this._onClick),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`wui:mention-input:submit`,this._onSubmitKey),customElements.upgrade(this);let e=k(this,`${y} wui-mention-input`,g);this._handPeople(e),this._applyComposerPlaceholder(e)}disconnectedCallback(){this._closePicker(!1)}get people(){return this._peopleProp?this._peopleProp:j(this,`:scope > [data-wui-people] > wui-option`,HTMLElement).map(e=>({value:e.getAttribute(`value`)??``,label:(e.textContent??``).trim(),description:e.getAttribute(`data-description`)||void 0,src:e.getAttribute(`data-src`)||void 0}))}set people(e){this._peopleProp=Array.isArray(e)?e:[];for(let e of this.querySelectorAll(`wui-mention-input`))e.people=this._peopleProp}_handPeople(e){!e||this.hasAttribute(`remote`)||this.hasAttribute(`source`)||(e.people=this.people)}_applyComposerPlaceholder(e){let t=this.getAttribute(`composer-placeholder`);e&&t!=null&&e.setAttribute(`placeholder`,t)}_reactionChoices(){let e=this.getAttribute(`reaction-choices`),t=e?e.split(/\s+/).filter(Boolean):[];return t.length?t:n}_onClick(e){let t=A(E(e.target),`[data-wui-emoji]`,HTMLElement);if(t&&this.contains(t)&&!D(t)){let e=t.closest(v),n=e?this._pickerFor?.comment:t.closest(b);e&&this._closePicker(!0),n&&this._react(n,t.getAttribute(`data-wui-emoji`));return}let n=A(E(e.target),`[data-wui-action]`,HTMLElement);if(!n||!this.contains(n)||D(n))return;let r=n.closest(b);switch(n.getAttribute(`data-wui-action`)){case`reply`:this._openReply(r,n);break;case`edit`:this._openEditor(r,n);break;case`delete`:this._askDelete(r);break;case`cancel-delete`:this._closeConfirm(r,!0);break;case`confirm-delete`:{let e=O(r,`comment`);this._send(`delete`,{commentId:e.getAttribute(`data-wui-comment`)},{comment:e,scope:e});break}case`react-menu`:this._pickerFor?.button===n?this._closePicker(!0):this._openPicker(r,n);break;case`cancel`:this._closeSlot(A(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement),!0);break;case`post`:case`send`:this._sendFrom(n)}}_onKeyDown(e){let t=k(this,v,HTMLElement),n=E(e.target),r=c(e.key,l(this));if(this._pickerFor&&t?.contains(n)){let i=j(t,`[data-wui-emoji]`,HTMLElement),a=n instanceof HTMLElement?i.indexOf(n):-1;e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this._closePicker(!0)):r===`ArrowRight`||r===`ArrowLeft`?(e.preventDefault(),i[(a+(r===`ArrowRight`?1:-1)+i.length)%i.length]?.focus()):e.key===`Tab`&&this._closePicker(!1);return}if(e.key!==`Escape`)return;let i=A(n,`[data-wui-reply], [data-wui-editor]`,HTMLElement);if(i&&this.contains(i)){e.preventDefault(),e.stopPropagation(),this._closeSlot(i,!0);return}let a=A(n,`[data-wui-comment-confirm]`,HTMLElement);a&&(e.preventDefault(),e.stopPropagation(),this._closeConfirm(a.closest(b),!0))}_onSubmitKey(e){let t=k(A(E(e.target),`[data-wui-reply], [data-wui-editor], [data-wui-composer]`,HTMLElement),`[data-wui-action="send"], [data-wui-action="post"]`,HTMLElement);t&&!D(t)&&this._sendFrom(t)}_openReply(e,t){if(this.hasAttribute(`no-replies`))return;let n=k(e,`:scope > [data-wui-reply]`,HTMLElement);if(!n)return;if(!n.hidden){n.querySelector(`wui-mention-input`)?.focus();return}let r=e?.querySelector(`.wui-comment-author`)?.textContent?.trim()||``;this._fillSlot(n,{label:p(S().replyToText,{author:r}),placeholder:S().replyPlaceholder,value:``,send:S().replyLabel,opener:t})}_openEditor(e,t){let n=k(e,`:scope > .wui-comment-row [data-wui-editor]`,HTMLElement);if(!n?.hidden)return;let r=k(O(n.parentElement,`comment row`),`:scope > [data-wui-text]`,HTMLElement);r&&(r.hidden=!0),this._fillSlot(n,{label:S().editCommentLabel,placeholder:``,value:e?.getAttribute(`data-value`)??``,send:S().saveLabel,opener:t})}_fillSlot(e,{label:t,placeholder:n,value:r,send:i,opener:a}){let o=this.ownerDocument,s=o.createElement(`wui-mention-input`);s.className=`wui-mention-input`,s.setAttribute(`label`,t),n&&s.setAttribute(`placeholder`,n),s.setAttribute(`rows`,`2`),s.setAttribute(`value`,r);for(let e of[`remote`,`source`,`min-chars`,`debounce`]){let t=this.getAttribute(e);t!=null&&s.setAttribute(e,t)}let c=o.createElement(`div`);c.className=`wui-comment-form-actions`,c.append(this._button(`primary`,`solid`,`sm`,`send`,i),this._button(`primary`,`ghost`,`sm`,`cancel`,S().cancelLabel));let l=o.createElement(`div`);l.className=`wui-comment-error`,l.setAttribute(`data-wui-error`,``),l.hidden=!0,e.replaceChildren(s,c,l),this._handPeople(s),e.hidden=!1,this._openers??=/* @__PURE__ */ new WeakMap,this._openers.set(e,a),s.focus();let u=s.querySelector(`textarea`);u?.setSelectionRange(u.value.length,u.value.length)}_button(n,r,i,a,o){let s=this.ownerDocument.createElement(`button`);return s.type=`button`,s.className=e(n,r,i),s.dataset.wui=t,s.setAttribute(`data-wui-action`,a),s.textContent=o,s}_closeSlot(e,t){if(!e||e.hidden)return;if(e.hidden=!0,e.replaceChildren(),e.hasAttribute(`data-wui-editor`)){let t=k(e.parentElement,`:scope > [data-wui-text]`,HTMLElement);t&&(t.hidden=!1)}let n=this._openers?.get(e);t&&n?.isConnected&&n.focus()}_askDelete(e){let t=k(e,`:scope > .wui-comment-row`,HTMLElement),n=k(t,`[data-wui-comment-confirm]`,HTMLElement),r=k(t,`[data-wui-actions]`,HTMLElement);n&&(n.hidden=!1,r&&(r.hidden=!0),k(n,`[data-wui-action="cancel-delete"]`,HTMLElement)?.focus())}_closeConfirm(e,t){let n=k(e,`:scope > .wui-comment-row`,HTMLElement),r=k(n,`[data-wui-comment-confirm]`,HTMLElement),i=k(n,`[data-wui-actions]`,HTMLElement);r&&(r.hidden=!0),i&&(i.hidden=!1),t&&k(i,`[data-wui-action="delete"]`,HTMLElement)?.focus()}_openPicker(e,t){let n=k(this,v,HTMLElement);n&&e&&!this.hasAttribute(`no-reactions`)&&(this._closePicker(!1),this._pickerFor={comment:e,button:t},t.setAttribute(`aria-expanded`,`true`),o(t,n,{mode:`auto`,onClosed:()=>this._pickerClosed()}),k(n,`[data-wui-emoji]`,HTMLElement)?.focus())}_closePicker(e){let t=this._pickerFor;if(!t)return;let n=k(this,v,HTMLElement);n&&a(n),this._pickerClosed(),e&&t.button.isConnected&&t.button.focus()}_pickerClosed(){let e=k(this,v,HTMLElement),t=this._pickerFor;!t||e&&s(e)||(this._pickerFor=null,t.button.setAttribute(`aria-expanded`,`false`))}_react(e,t){t&&!this.hasAttribute(`no-reactions`)&&this._send(`react`,{commentId:e.getAttribute(`data-wui-comment`),emoji:t},{comment:e,scope:e})}_sendFrom(e){let t=A(e,`[data-wui-reply], [data-wui-editor], [data-wui-composer]`,HTMLElement);if(!t)return;let n=t.querySelector(`wui-mention-input`),r=n?.value??``;if(!r.trim()){this._showError(t,S().emptyBodyMessage),n?.focus();return}let i=t.closest(b);t.hasAttribute(`data-wui-composer`)?this._send(`post`,{body:r},{scope:t,form:t}):t.hasAttribute(`data-wui-reply`)?this._send(`reply`,{parentId:O(i,`comment`).getAttribute(`data-wui-comment`),body:r},{comment:i,scope:t,form:t}):this._send(`edit`,{commentId:O(i,`comment`).getAttribute(`data-wui-comment`),body:r},{comment:i,scope:t,form:t})}async _send(e,t,{comment:n,scope:r,form:i}){if(this._busy)return;this._busy=!0,this.setAttribute(`aria-busy`,`true`);let a=i??k(n,`:scope > .wui-comment-row`,HTMLElement)??this;this._showError(a,null);let o=[...r.querySelectorAll(`button, textarea`)].filter(e=>e instanceof HTMLButtonElement||e instanceof HTMLTextAreaElement).filter(e=>!e.disabled);for(let e of o)e.disabled=!0;let s=await this._persist({intent:e,...t});for(let e of o)e.isConnected&&(e.disabled=!1);this._busy=!1,this.removeAttribute(`aria-busy`);let c=t.commentId??null,l=t.parentId??null;s.ok?(s.html!=null&&this._swapItems(s.html),e===`post`?i?.querySelector(`wui-mention-input`)?.clear():i?.isConnected&&this._closeSlot(i,!1),e===`delete`&&n?.isConnected&&this._closeConfirm(n,!1),this._restoreFocus(e,t,i),w(e)&&this._announce(w(e)),this.dispatchEvent(new CustomEvent(`wui:comment-thread:done`,{bubbles:!0,detail:{intent:e,commentId:c,parentId:l}}))):s.kind!==`session`&&s.kind!==`aborted`&&(this._showError(a.isConnected?a:this,s.message),this._announce(s.message),this.dispatchEvent(new CustomEvent(`wui:comment-thread:failed`,{bubbles:!0,detail:{intent:e,kind:s.kind,message:s.message}})))}async _persist(e){if(this.hasAttribute(`controlled`)){if(typeof this.submit!=`function`)return{ok:!0,html:null};try{return await this.submit(e),{ok:!0,html:null}}catch(e){return{ok:!1,kind:`server`,message:T(e)}}}let t=this.getAttribute(`action`);if(!t)return{ok:!1,kind:`client`,message:S().failedClientMessage};let n=new URLSearchParams;for(let[t,r]of Object.entries(e))r!=null&&n.set(t,r);let r=await d(t,{method:`POST`,body:n});return r.ok?{ok:!0,html:r.html}:{ok:!1,kind:r.kind,message:r.message||C(r.kind)||S().failedServerMessage}}_swapItems(e){let t=k(this,_,HTMLElement);if(!t||!e.trim())return;let n=u(e),r=k(n,_,HTMLElement);t.replaceChildren(...r?r.childNodes:n.childNodes)}_restoreFocus(e,t,n){let r=this.ownerDocument,i=r.activeElement;if(i&&i!==r.body&&i.isConnected&&this.contains(i)&&!D(i))return;let a=e=>e?j(this,b,HTMLElement).find(t=>t.getAttribute(`data-wui-comment`)===e):null,o=e=>k(a(e),`:scope > .wui-comment-row`,HTMLElement),s=null;if(e===`post`)s=n?.querySelector(`textarea`);else if(e===`reply`)s=k(o(t.parentId),`[data-wui-action="reply"]`,HTMLElement);else if(e===`edit`)s=k(o(t.commentId),`[data-wui-action="edit"]`,HTMLElement);else if(e===`react`){let e=o(t.commentId);s=j(e,`button[data-wui-emoji]`,HTMLButtonElement).find(e=>e.getAttribute(`data-wui-emoji`)===t.emoji)??k(e,`[data-wui-action="react-menu"]`,HTMLElement)}s??=k(this,`${y} textarea`,HTMLTextAreaElement),s?.focus()}_showError(e,t){let n=k(e,`:scope > [data-wui-error], :scope > .wui-comment-main > [data-wui-error]`,HTMLElement);n&&(n.textContent=t||``,n.hidden=!t)}_announce(e){let t=k(this,`:scope > ${x}`,HTMLElement);t&&e&&(t.textContent=``,t.textContent=e)}};export{M as t};