@webority/ui-elements 0.163.0 → 0.165.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 (223) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +4 -4
  3. package/THIRD-PARTY-NOTICES.txt +1 -1
  4. package/dist/WuiCodeBlock-7O514Hqe.js +1 -0
  5. package/dist/{WuiCommandPalette-Dpz0DXKJ.js → WuiCommandPalette-rVScJ2Hy.js} +2 -2
  6. package/dist/WuiCommentThread-Bkb78uhy.js +1 -0
  7. package/dist/WuiContextMenu-Fc9WCgM8.js +1 -0
  8. package/dist/{WuiDataTable-C1Rrxmh_.js → WuiDataTable-Bb5hxTfn.js} +1 -1
  9. package/dist/WuiDatePicker-D7tOu4kV.js +31 -0
  10. package/dist/WuiDateRange-D0pzZeUU.js +25 -0
  11. package/dist/WuiDrawer-BKNcc0WX.js +1 -0
  12. package/dist/WuiDropdown-CeiMaiwi.js +1 -0
  13. package/dist/WuiEntryGrid-DCVSZuPc.js +1 -0
  14. package/dist/WuiHoverCard-AAXID-P3.js +1 -0
  15. package/dist/WuiInlineEdit-DwnXChDc.js +1 -0
  16. package/dist/WuiLightbox-hw48EjHj.js +1 -0
  17. package/dist/WuiMarkdown-B7nfQ6tW.js +4 -0
  18. package/dist/WuiMentionInput-BCXdub58.js +1 -0
  19. package/dist/WuiModal-Bz2Xg161.js +1 -0
  20. package/dist/WuiNavigationMenu-Dybw-nMb.js +1 -0
  21. package/dist/WuiNotificationCenter-BRomMzI2.js +1 -0
  22. package/dist/WuiOverflow-CV5y5zkM.js +1 -0
  23. package/dist/WuiPhone-BKxBok5L.js +16 -0
  24. package/dist/WuiPopover-y_Vxm64z.js +1 -0
  25. package/dist/WuiRelativeTime-CmlKD-97.js +1 -0
  26. package/dist/WuiSavedViews-CdjavvPC.js +1 -0
  27. package/dist/WuiSelect-CKfM5kWG.js +9 -0
  28. package/dist/WuiShortcuts-Wiv_zufK.js +1 -0
  29. package/dist/WuiSlider-Cz5-zWC7.js +51 -0
  30. package/dist/WuiTimePicker-DAS2sxSH.js +9 -0
  31. package/dist/WuiTour-CAVM3O8-.js +1 -0
  32. package/dist/{WuiTree-COd5leOB.js → WuiTree-BPT9EZuw.js} +1 -1
  33. package/dist/{WuiTruncate-C2WV1-NN.js → WuiTruncate-BB4i8wHE.js} +1 -1
  34. package/dist/WuiWhatsNew-BdsS6MzB.js +1 -0
  35. package/dist/anchorOverlay-B8fu8hjz.js +1 -0
  36. package/dist/chips-DjccCG3b.js +2 -0
  37. package/dist/digitGrouping-CCPI3HK3.js +1 -0
  38. package/dist/drawerDiscard-C1We4r_2.js +1 -0
  39. package/dist/elements/code-block.js +1 -1
  40. package/dist/elements/command-palette.js +1 -1
  41. package/dist/elements/comment-thread.js +1 -1
  42. package/dist/elements/context-menu.js +1 -1
  43. package/dist/elements/data-table.js +1 -1
  44. package/dist/elements/date-range.js +1 -1
  45. package/dist/elements/datepicker.js +1 -1
  46. package/dist/elements/drawer.js +1 -1
  47. package/dist/elements/dropdown.js +1 -0
  48. package/dist/elements/entry-grid.js +1 -0
  49. package/dist/elements/filter-popover.js +1 -1
  50. package/dist/elements/hover-card.js +1 -1
  51. package/dist/elements/inline-edit.js +1 -1
  52. package/dist/elements/lightbox.js +1 -1
  53. package/dist/elements/markdown.js +1 -1
  54. package/dist/elements/mention-input.js +1 -1
  55. package/dist/elements/modal.js +1 -0
  56. package/dist/elements/navigation-menu.js +1 -1
  57. package/dist/elements/notification-center.js +1 -1
  58. package/dist/elements/overflow.js +1 -1
  59. package/dist/elements/phone.js +1 -1
  60. package/dist/elements/popover.js +1 -0
  61. package/dist/elements/relative-time.js +1 -1
  62. package/dist/elements/saved-views.js +1 -1
  63. package/dist/elements/select.js +1 -1
  64. package/dist/elements/shortcuts.js +1 -1
  65. package/dist/elements/slider.js +1 -1
  66. package/dist/elements/timepicker.js +1 -1
  67. package/dist/elements/tour.js +1 -1
  68. package/dist/elements/tree.js +1 -1
  69. package/dist/elements/truncate.js +1 -1
  70. package/dist/elements/whats-new.js +1 -1
  71. package/dist/fileViewerImage-CVHV1fBb.js +3 -0
  72. package/dist/fileViewerMedia-DGnbWDXP.js +1 -0
  73. package/dist/{fileViewerPdf-CAbiTCHl.js → fileViewerPdf-BxoLE4hd.js} +2 -2
  74. package/dist/fileViewerUi-2ZoK9uX0.js +1 -0
  75. package/dist/filterPopover-B29bt1s2.js +1 -0
  76. package/dist/helpers.js +1 -1
  77. package/dist/inlineEditText-CDptpqmI.js +1 -0
  78. package/dist/isDrawn-BbF4phmB.js +1 -0
  79. package/dist/{listboxKeyNav-DkLHwzJE.js → listboxKeyNav-CF7tMDGG.js} +1 -1
  80. package/dist/loader-C7Ov09Bx.js +1 -0
  81. package/dist/menuKeyNav-CstMzU08.js +1 -0
  82. package/dist/nativeOverlay-BsVSWs1q.js +1 -0
  83. package/dist/{search-C0IYOzso.js → search-Du-vK_9z.js} +1 -1
  84. package/dist/server.js +1 -1
  85. package/dist/{themeTransition-CwE2VwQa.js → themeTransition-Dt7Br1QT.js} +1 -1
  86. package/dist/ui-elements/carousel.global.js +1 -1
  87. package/dist/ui-elements/code-block.global.js +1 -1
  88. package/dist/ui-elements/command-palette.global.js +2 -2
  89. package/dist/ui-elements/comment-thread.global.js +1 -1
  90. package/dist/ui-elements/consent-banner.global.js +1 -1
  91. package/dist/ui-elements/context-menu.global.js +1 -1
  92. package/dist/ui-elements/date-range.global.js +10 -10
  93. package/dist/ui-elements/drawer.global.js +1 -1
  94. package/dist/ui-elements/dropdown.global.js +1 -0
  95. package/dist/ui-elements/entry-grid.global.js +1 -0
  96. package/dist/ui-elements/glyphs.global.js +1 -1
  97. package/dist/ui-elements/image-crop.global.js +1 -1
  98. package/dist/ui-elements/inline-edit.global.js +1 -1
  99. package/dist/ui-elements/kanban.global.js +1 -1
  100. package/dist/ui-elements/lead-popup.global.js +1 -1
  101. package/dist/ui-elements/lightbox.global.js +1 -1
  102. package/dist/ui-elements/markdown.global.js +3 -3
  103. package/dist/ui-elements/org-tree.global.js +1 -1
  104. package/dist/ui-elements/phone.global.js +6 -6
  105. package/dist/ui-elements/popover.global.js +1 -0
  106. package/dist/ui-elements/saved-views.global.js +1 -1
  107. package/dist/ui-elements/select-chips.global.js +2 -2
  108. package/dist/ui-elements/select-recents.global.js +1 -1
  109. package/dist/ui-elements/select-search.global.js +1 -1
  110. package/dist/ui-elements/slider.global.js +3 -3
  111. package/dist/ui-elements/sortable.global.js +1 -1
  112. package/dist/ui-elements/status-icon.global.js +1 -1
  113. package/dist/ui-elements/timepicker.global.js +4 -4
  114. package/dist/ui-elements/tour.global.js +1 -1
  115. package/dist/ui-elements/tree.global.js +1 -1
  116. package/dist/ui-elements/wizard.global.js +1 -1
  117. package/dist/ui-elements.global.js +20 -20
  118. package/dist/ui-elements.js +1 -1
  119. package/dist/ui-file-viewer.global.js +10 -10
  120. package/dist/ui-file-viewer.js +1 -1
  121. package/dist/ui-tour.global.js +1 -1
  122. package/package.json +22 -13
  123. package/types/WuiCommandPalette.d.ts +2 -2
  124. package/types/WuiCommentThread.d.ts +1 -2
  125. package/types/WuiContextMenu.d.ts +56 -5
  126. package/types/WuiDatePicker.d.ts +3 -7
  127. package/types/WuiDateRange.d.ts +4 -9
  128. package/types/WuiDrawer.d.ts +9 -12
  129. package/types/WuiDropdown.d.ts +68 -0
  130. package/types/WuiEntryGrid.d.ts +26 -0
  131. package/types/WuiHoverCard.d.ts +15 -1
  132. package/types/WuiInlineEdit.d.ts +2 -0
  133. package/types/WuiLightbox.d.ts +1 -2
  134. package/types/WuiMentionInput.d.ts +0 -4
  135. package/types/WuiModal.d.ts +50 -0
  136. package/types/WuiNavigationMenu.d.ts +8 -3
  137. package/types/WuiNotificationCenter.d.ts +10 -2
  138. package/types/WuiPhone.d.ts +3 -5
  139. package/types/WuiPopover.d.ts +68 -0
  140. package/types/WuiRelativeTime.d.ts +5 -6
  141. package/types/WuiSelect.d.ts +8 -6
  142. package/types/WuiShortcuts.d.ts +6 -1
  143. package/types/WuiSlider.d.ts +6 -3
  144. package/types/WuiTimePicker.d.ts +3 -5
  145. package/types/WuiTour.d.ts +1 -0
  146. package/types/WuiTruncate.d.ts +2 -2
  147. package/types/WuiWhatsNew.d.ts +3 -3
  148. package/types/anchorOverlay.d.ts +24 -8
  149. package/types/codeHighlight.d.ts +1 -1
  150. package/types/digitGrouping.d.ts +11 -0
  151. package/types/elements/dropdown.d.ts +2 -0
  152. package/types/elements/entry-grid.d.ts +2 -0
  153. package/types/elements/modal.d.ts +2 -0
  154. package/types/elements/popover.d.ts +2 -0
  155. package/types/fileViewerImage.d.ts +2 -0
  156. package/types/fileViewerMedia.d.ts +2 -0
  157. package/types/fileViewerPdf.d.ts +2 -0
  158. package/types/fileViewerUi.d.ts +1 -2
  159. package/types/filterPopover.d.ts +7 -8
  160. package/types/global/core.d.ts +1 -3
  161. package/types/global/shared.d.ts +10 -0
  162. package/types/globals.d.ts +28 -79
  163. package/types/helpers.d.ts +5 -0
  164. package/types/iconGlyphs.g.d.ts +1 -1
  165. package/types/index.d.ts +5 -3
  166. package/types/inlineEditText.d.ts +3 -1
  167. package/types/isDrawn.d.ts +1 -0
  168. package/types/listboxKeyNav.d.ts +3 -3
  169. package/types/menuKeyNav.d.ts +8 -0
  170. package/types/nativeOverlay.d.ts +51 -0
  171. package/types/razor-js/modules/fieldChecks.d.ts +1 -0
  172. package/types/razor-js/modules/overlays.d.ts +1 -4
  173. package/types/razor-js/modules/serverBridge.d.ts +15 -13
  174. package/types/razor-js/modules/serverRules.d.ts +9 -0
  175. package/types/razor-js/modules/shared.d.ts +0 -7
  176. package/types/razor-js/modules/tables.d.ts +1 -0
  177. package/types/razor-js/modules/validation.d.ts +7 -0
  178. package/types/server/remoteModal.d.ts +0 -1
  179. package/types/statusIcons.d.ts +1 -1
  180. package/types/tooltips.d.ts +18 -0
  181. package/dist/WuiCodeBlock-cLLbSBK4.js +0 -1
  182. package/dist/WuiCommentThread-CclWHz4C.js +0 -1
  183. package/dist/WuiContextMenu-B2MrH_LK.js +0 -1
  184. package/dist/WuiDatePicker-DLEsnzqG.js +0 -31
  185. package/dist/WuiDateRange-9Xqs5nvv.js +0 -25
  186. package/dist/WuiDrawer-B3YFmxl2.js +0 -1
  187. package/dist/WuiHoverCard-CE3dHKaM.js +0 -1
  188. package/dist/WuiInlineEdit-pG9Z5tUQ.js +0 -1
  189. package/dist/WuiLightbox-C2A14vHx.js +0 -1
  190. package/dist/WuiMarkdown-BXY0QKaO.js +0 -4
  191. package/dist/WuiMentionInput-B_K8AXM5.js +0 -1
  192. package/dist/WuiNavigationMenu-CZ3XhFam.js +0 -1
  193. package/dist/WuiNotificationCenter-ClkCTUnp.js +0 -1
  194. package/dist/WuiOverflow-B0wA6aDe.js +0 -1
  195. package/dist/WuiPhone-icMSUnua.js +0 -16
  196. package/dist/WuiRelativeTime-DyeUQOQ8.js +0 -1
  197. package/dist/WuiResizable-KvfLtbCw.js +0 -1
  198. package/dist/WuiRollingNumber-sfgNzaP0.js +0 -1
  199. package/dist/WuiSavedViews-Br9YKOVU.js +0 -1
  200. package/dist/WuiSelect-B199VL24.js +0 -9
  201. package/dist/WuiShortcuts-D3rWkaOm.js +0 -1
  202. package/dist/WuiSlider-D33Y3_t9.js +0 -51
  203. package/dist/WuiTimePicker-wo9BlOFs.js +0 -9
  204. package/dist/WuiTour-D3Sx7JCM.js +0 -1
  205. package/dist/WuiWhatsNew-dLGyA4g1.js +0 -1
  206. package/dist/anchorOverlay-CXnWfezA.js +0 -1
  207. package/dist/chips-0jT9fpA9.js +0 -2
  208. package/dist/drawerDiscard-C-STs39f.js +0 -1
  209. package/dist/elements/resizable.js +0 -1
  210. package/dist/elements/rolling-number.js +0 -1
  211. package/dist/fileViewerImage-Bt1jeArm.js +0 -3
  212. package/dist/fileViewerMedia-Bp1uHJvC.js +0 -1
  213. package/dist/fileViewerUi-ResPjO1o.js +0 -1
  214. package/dist/filterPopover-CaHWe9V0.js +0 -1
  215. package/dist/inlineEditText-CsLCQbcg.js +0 -1
  216. package/dist/loader-DRYPWxQL.js +0 -1
  217. package/dist/ui-elements/resizable.global.js +0 -1
  218. package/types/WuiResizable.d.ts +0 -79
  219. package/types/WuiRollingNumber.d.ts +0 -27
  220. package/types/elements/resizable.d.ts +0 -2
  221. package/types/elements/rolling-number.d.ts +0 -2
  222. package/types/overlayRelease.d.ts +0 -12
  223. package/types/razor-js/modules/popovers.d.ts +0 -1
@@ -1 +1 @@
1
- import{i as e,r as t,s as n,t as r}from"./fileViewerUi-ResPjO1o.js";function i(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 a=`AppButton`,o=/* @__PURE__ */ new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),s={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 c(e){return Object.hasOwn(s,e)}function l(e=`primary`,t=`solid`,n=`md`){if(!o.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!c(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=s[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var u=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(u);var d=HTMLElement,f={pdf:`pdf`,jpg:`image`,jpeg:`image`,png:`image`,webp:`image`,gif:`image`,avif:`image`,bmp:`image`,svg:`image`,mp4:`video`,m4v:`video`,webm:`video`,ogv:`video`,mp3:`audio`,m4a:`audio`,aac:`audio`,wav:`audio`,ogg:`audio`,oga:`audio`,opus:`audio`,flac:`audio`},p={"application/pdf":`pdf`,"image/jpeg":`image`,"image/png":`image`,"image/webp":`image`,"image/gif":`image`,"image/avif":`image`,"image/bmp":`image`,"image/svg+xml":`image`,"video/mp4":`video`,"video/webm":`video`,"video/ogg":`video`,"audio/mpeg":`audio`,"audio/mp4":`audio`,"audio/aac":`audio`,"audio/wav":`audio`,"audio/x-wav":`audio`,"audio/ogg":`audio`,"audio/opus":`audio`,"audio/webm":`audio`,"audio/flac":`audio`},m=`wui-file-viewer:load`,h=`wui-file-viewer:error`,g=`wui-file-viewer:prefs-change`;function _(e,t){let n=(String(e??``).split(`;`)[0]??``).trim().toLowerCase();if(n)return p[n]??null;let r=String(t??``).split(/[?#]/)[0]??``;return f[r.includes(`.`)?(r.split(`.`).pop()??``).toLowerCase():``]??null}function v(e){let t=(String(e??``).split(/[?#]/)[0]??``).split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}var y={pdf:()=>import(`./fileViewerPdf-CAbiTCHl.js`).then(e=>e.PdfView),image:()=>import(`./fileViewerImage-Bt1jeArm.js`).then(e=>e.ImageView),video:()=>import(`./fileViewerMedia-Bp1uHJvC.js`).then(e=>e.MediaView),audio:()=>import(`./fileViewerMedia-Bp1uHJvC.js`).then(e=>e.MediaView)},b=0,x=class i extends d{static defaultAssetBase=``;static get observedAttributes(){return[`src`,`name`,`type`,`download`,`print`,`worker-src`,`asset-base`,`captions`]}uid;_prefs;_hostPrefs;_onFullscreen;_view;_loadId;_actionsBox;constructor(){super(),b+=1,this.uid=`wui-file-viewer-${b}`,this._prefs={},this._onFullscreen=()=>this._syncFullscreen()}get src(){return this.getAttribute(`src`)??``}set src(e){this.setAttribute(`src`,String(e??``))}get name(){return this.getAttribute(`name`)??``}set name(e){this.setAttribute(`name`,String(e??``))}get type(){return this.getAttribute(`type`)??``}set type(e){this.setAttribute(`type`,String(e??``))}get viewKey(){return this.getAttribute(`view-key`)??``}set viewKey(e){this.setAttribute(`view-key`,String(e??``))}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get print(){return this.getAttribute(`print`)!==`false`}set print(e){this.setAttribute(`print`,e===!1||e===`false`?`false`:`true`)}get workerSrc(){return this.getAttribute(`worker-src`)??``}set workerSrc(e){this.setAttribute(`worker-src`,String(e??``))}get captions(){return this.getAttribute(`captions`)??``}set captions(e){this.setAttribute(`captions`,String(e??``))}get assetBase(){return this.getAttribute(`asset-base`)??``}set assetBase(e){this.setAttribute(`asset-base`,String(e??``))}get prefs(){return{...this._prefs}}set prefs(e){this._hostPrefs=!0,this._prefs=e&&typeof e==`object`?{...e}:{}}get actionsContainer(){return this._actionsBox??null}seekTo(e){if(typeof e!=`number`||!Number.isFinite(e))throw TypeError(`[wui-file-viewer] seekTo takes a number of seconds; got ${String(e)}.`);return this._view?.seekTo?(this._view.seekTo(e),!0):!1}displayName(){return this.name||v(this.src)||`Document`}connectedCallback(){if(Object.hasOwn(this,`prefs`)){let e=this.prefs;Reflect.deleteProperty(this,`prefs`),this.prefs=e}document.addEventListener(`fullscreenchange`,this._onFullscreen),this._open()}disconnectedCallback(){document.removeEventListener(`fullscreenchange`,this._onFullscreen),this._close()}attributeChangedCallback(e,t,n){this.isConnected&&this._parts&&t!==n&&(e===`name`?this._parts.name.textContent=this.displayName():e===`download`?this._syncDownload():e===`print`?this._syncPrint():this._open())}_close(){this._view?.destroy(),this._view=null,this._loadId=(this._loadId??0)+1}async _open(){this._close();let e=this._loadId;this._render(),this._prefs=this._readPrefs();let t=_(this.type,this.name||this.src);if(!this.src){this._settle(`No file to show.`);return}if(!t){this._settle(`This file can't be shown here.`,{offerDownload:!0});return}this._status(`Loading...`);let n;try{n=await y[t]()}catch(t){e===this._loadId&&this._fail(t);return}e===this._loadId&&(this._view=new n(this._shell(e),{src:this.src,kind:t,captions:this.captions,workerSrc:this.workerSrc,assetBase:C(this.assetBase||i.defaultAssetBase)}),this._view.load())}_shell(e){let t=()=>e===this._loadId,n=this._parts;return{host:this,start:n.start,center:n.center,end:n.viewEnd,search:n.search,body:n.body,prefs:{...this._prefs},name:()=>this.displayName(),print:()=>this.print,savePrefs:e=>{t()&&this._savePrefs(e)},loaded:e=>{t()&&(n.body.removeAttribute(`aria-busy`),this.dispatchEvent(new CustomEvent(m,{bubbles:!0,detail:e})))},fail:e=>{t()&&this._fail(e)}}}_render(){let n=(e,t)=>{let n=document.createElement(e);return n.className=t,n},i=n(`div`,`wui-file-viewer-toolbar`),a=n(`div`,`wui-file-viewer-group wui-file-viewer-start`),o=n(`span`,`wui-file-viewer-name`);o.textContent=this.displayName(),o.title=this.displayName(),a.append(o);let s=n(`div`,`wui-file-viewer-group wui-file-viewer-center`),c=n(`div`,`wui-file-viewer-group wui-file-viewer-end`),l=n(`div`,`wui-file-viewer-group wui-file-viewer-view-end`),u=document.createElement(`a`);u.className=`u-action wui-file-viewer-download`,u.style.setProperty(`--wui-action-size`,`32px`),t(u,`download`),e(u,`Download`);let d=r(`maximize-4`,`Full screen`,{className:`wui-file-viewer-fullscreen`});d.addEventListener(`click`,()=>this.toggleFullscreen()),d.hidden=!document.fullscreenEnabled,this._actionsBox??=n(`div`,`wui-file-viewer-actions`);let f=this._actionsBox;f.append(...this.querySelectorAll(`:scope > [slot="actions"]`)),c.append(l,u,d,f);let p=n(`search`,`wui-file-viewer-search`);p.hidden=!0,i.append(a,s,c,p);let m=n(`div`,`wui-file-viewer-body`);m.setAttribute(`aria-busy`,`true`),this.replaceChildren(i,m),this._parts={toolbar:i,start:a,name:o,center:s,end:c,viewEnd:l,downloadLink:u,fullscreen:d,actionsBox:f,search:p,body:m},this._syncDownload(),this._syncFullscreen()}_syncDownload(){let e=this._parts.downloadLink;e.hidden=!this.download||!this.src,e.href=this.src,e.setAttribute(`download`,this.displayName())}_syncPrint(){for(let e of this._parts.toolbar.querySelectorAll(`.wui-file-viewer-print`))e instanceof HTMLElement&&(e.hidden=!this.print)}_status(e,{offerDownload:t=!1}={}){let n=document.createElement(`div`);n.className=`wui-file-viewer-status`;let r=document.createElement(`p`);if(r.textContent=e,n.append(r),t&&this.src){let e=document.createElement(`a`);e.className=l(`neutral`,`outline`,`sm`),e.dataset.wui=a,e.href=this.src,e.setAttribute(`download`,this.displayName()),e.textContent=`Download`,n.append(e)}this._parts.body.replaceChildren(n)}_settle(e,t){this._parts.body.removeAttribute(`aria-busy`),this._status(e,t)}_fail(e){this._view?.destroy(),this._view=null,this._settle(`Couldn't open this file.`,{offerDownload:!0});let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;this.dispatchEvent(new CustomEvent(h,{bubbles:!0,detail:{message:t??String(e)}}))}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen():this.requestFullscreen().catch(e=>{n(`[wui-file-viewer] full screen refused:`,e?.message)})}_syncFullscreen(){if(!this._parts)return;let n=document.fullscreenElement===this,r=this._parts.fullscreen;t(r,n?`x`:`maximize-4`),e(r,n?`Exit full screen`:`Full screen`),this._parts.actionsBox.hidden=n}_readPrefs(){if(this._hostPrefs||!this.viewKey)return{...this._prefs};try{let e=JSON.parse(window.localStorage.getItem(`wui-view:${this.viewKey}`)??`{}`);return S(e)?e:{}}catch{return{}}}_savePrefs(e){if(this._prefs={...this._prefs,...e},this.dispatchEvent(new CustomEvent(g,{bubbles:!0,detail:{...this._prefs}})),!this._hostPrefs&&this.viewKey)try{window.localStorage.setItem(`wui-view:${this.viewKey}`,JSON.stringify(this._prefs))}catch(e){if(!(e instanceof DOMException))throw e}}};function S(e){return typeof e==`object`&&!!e}function C(e){return e&&new URL(e,document.baseURI).href}var w=typeof document>`u`?null:document.currentScript;w instanceof HTMLScriptElement&&w.src&&(x.defaultAssetBase=new URL(`pdfjs/`,w.src).href),i(`wui-file-viewer`,x);var T=(e,t)=>import(`./fileViewerPdf-CAbiTCHl.js`).then(n=>n.renderFirstPage(e,{assetBase:x.defaultAssetBase||void 0,...t}));export{x as WuiFileViewer,_ as fileKind,v as fileNameFromUrl,T as renderPdfFirstPage};
1
+ import{i as e,r as t,s as n,t as r}from"./fileViewerUi-2ZoK9uX0.js";function i(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 a=`AppButton`,o=/* @__PURE__ */ new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),s={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 c(e){return Object.hasOwn(s,e)}function l(e=`primary`,t=`solid`,n=`md`){if(!o.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!c(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=s[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var u=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(u);var d=HTMLElement,f={pdf:`pdf`,jpg:`image`,jpeg:`image`,png:`image`,webp:`image`,gif:`image`,avif:`image`,bmp:`image`,svg:`image`,mp4:`video`,m4v:`video`,webm:`video`,ogv:`video`,mp3:`audio`,m4a:`audio`,aac:`audio`,wav:`audio`,ogg:`audio`,oga:`audio`,opus:`audio`,flac:`audio`},p={"application/pdf":`pdf`,"image/jpeg":`image`,"image/png":`image`,"image/webp":`image`,"image/gif":`image`,"image/avif":`image`,"image/bmp":`image`,"image/svg+xml":`image`,"video/mp4":`video`,"video/webm":`video`,"video/ogg":`video`,"audio/mpeg":`audio`,"audio/mp4":`audio`,"audio/aac":`audio`,"audio/wav":`audio`,"audio/x-wav":`audio`,"audio/ogg":`audio`,"audio/opus":`audio`,"audio/webm":`audio`,"audio/flac":`audio`},m=`wui-file-viewer:load`,h=`wui-file-viewer:error`,g=`wui-file-viewer:prefs-change`;function _(e,t){let n=(String(e??``).split(`;`)[0]??``).trim().toLowerCase();if(n)return p[n]??null;let r=String(t??``).split(/[?#]/)[0]??``;return f[r.includes(`.`)?(r.split(`.`).pop()??``).toLowerCase():``]??null}function v(e){let t=(String(e??``).split(/[?#]/)[0]??``).split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}var y={pdf:()=>import(`./fileViewerPdf-BxoLE4hd.js`).then(e=>e.PdfView),image:()=>import(`./fileViewerImage-CVHV1fBb.js`).then(e=>e.ImageView),video:()=>import(`./fileViewerMedia-DGnbWDXP.js`).then(e=>e.MediaView),audio:()=>import(`./fileViewerMedia-DGnbWDXP.js`).then(e=>e.MediaView)},b=0,x=class i extends d{static defaultAssetBase=``;static get observedAttributes(){return[`src`,`name`,`type`,`download`,`print`,`worker-src`,`asset-base`,`captions`]}uid;_prefs;_hostPrefs;_onFullscreen;_view;_loadId;_actionsBox;constructor(){super(),b+=1,this.uid=`wui-file-viewer-${b}`,this._prefs={},this._onFullscreen=()=>this._syncFullscreen()}get src(){return this.getAttribute(`src`)??``}set src(e){this.setAttribute(`src`,String(e??``))}get name(){return this.getAttribute(`name`)??``}set name(e){this.setAttribute(`name`,String(e??``))}get type(){return this.getAttribute(`type`)??``}set type(e){this.setAttribute(`type`,String(e??``))}get viewKey(){return this.getAttribute(`view-key`)??``}set viewKey(e){this.setAttribute(`view-key`,String(e??``))}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get print(){return this.getAttribute(`print`)!==`false`}set print(e){this.setAttribute(`print`,e===!1||e===`false`?`false`:`true`)}get workerSrc(){return this.getAttribute(`worker-src`)??``}set workerSrc(e){this.setAttribute(`worker-src`,String(e??``))}get captions(){return this.getAttribute(`captions`)??``}set captions(e){this.setAttribute(`captions`,String(e??``))}get assetBase(){return this.getAttribute(`asset-base`)??``}set assetBase(e){this.setAttribute(`asset-base`,String(e??``))}get prefs(){return{...this._prefs}}set prefs(e){this._hostPrefs=!0,this._prefs=e&&typeof e==`object`?{...e}:{}}get actionsContainer(){return this._actionsBox??null}seekTo(e){if(typeof e!=`number`||!Number.isFinite(e))throw TypeError(`[wui-file-viewer] seekTo takes a number of seconds; got ${String(e)}.`);return this._view?.seekTo?(this._view.seekTo(e),!0):!1}displayName(){return this.name||v(this.src)||`Document`}connectedCallback(){if(Object.hasOwn(this,`prefs`)){let e=this.prefs;Reflect.deleteProperty(this,`prefs`),this.prefs=e}document.addEventListener(`fullscreenchange`,this._onFullscreen),this._open()}disconnectedCallback(){document.removeEventListener(`fullscreenchange`,this._onFullscreen),this._close()}attributeChangedCallback(e,t,n){this.isConnected&&this._parts&&t!==n&&(e===`name`?this._parts.name.textContent=this.displayName():e===`download`?this._syncDownload():e===`print`?this._syncPrint():this._open())}_close(){this._view?.destroy(),this._view=null,this._loadId=(this._loadId??0)+1}async _open(){this._close();let e=this._loadId;this._render(),this._prefs=this._readPrefs();let t=_(this.type,this.name||this.src);if(!this.src){this._settle(`No file to show.`);return}if(!t){this._settle(`This file can't be shown here.`,{offerDownload:!0});return}this._status(`Loading...`);let n;try{n=await y[t]()}catch(t){e===this._loadId&&this._fail(t);return}e===this._loadId&&(this._view=new n(this._shell(e),{src:this.src,kind:t,captions:this.captions,workerSrc:this.workerSrc,assetBase:C(this.assetBase||i.defaultAssetBase)}),this._view.load())}_shell(e){let t=()=>e===this._loadId,n=this._parts;return{host:this,start:n.start,center:n.center,end:n.viewEnd,search:n.search,body:n.body,prefs:{...this._prefs},name:()=>this.displayName(),print:()=>this.print,savePrefs:e=>{t()&&this._savePrefs(e)},loaded:e=>{t()&&(n.body.removeAttribute(`aria-busy`),this.dispatchEvent(new CustomEvent(m,{bubbles:!0,detail:e})))},fail:e=>{t()&&this._fail(e)}}}_render(){let n=(e,t)=>{let n=document.createElement(e);return n.className=t,n},i=n(`div`,`wui-file-viewer-toolbar`),a=n(`div`,`wui-file-viewer-group wui-file-viewer-start`),o=n(`span`,`wui-file-viewer-name`);o.textContent=this.displayName(),o.title=this.displayName(),a.append(o);let s=n(`div`,`wui-file-viewer-group wui-file-viewer-center`),c=n(`div`,`wui-file-viewer-group wui-file-viewer-end`),l=n(`div`,`wui-file-viewer-group wui-file-viewer-view-end`),u=document.createElement(`a`);u.className=`u-action wui-file-viewer-download`,u.style.setProperty(`--wui-action-size`,`32px`),t(u,`download`),e(u,`Download`);let d=r(`maximize-4`,`Full screen`,{className:`wui-file-viewer-fullscreen`});d.addEventListener(`click`,()=>this.toggleFullscreen()),d.hidden=!document.fullscreenEnabled,this._actionsBox??=n(`div`,`wui-file-viewer-actions`);let f=this._actionsBox;f.append(...this.querySelectorAll(`:scope > [slot="actions"]`)),c.append(l,u,d,f);let p=n(`search`,`wui-file-viewer-search`);p.hidden=!0,i.append(a,s,c,p);let m=n(`div`,`wui-file-viewer-body`);m.setAttribute(`aria-busy`,`true`),this.replaceChildren(i,m),this._parts={toolbar:i,start:a,name:o,center:s,end:c,viewEnd:l,downloadLink:u,fullscreen:d,actionsBox:f,search:p,body:m},this._syncDownload(),this._syncFullscreen()}_syncDownload(){let e=this._parts.downloadLink;e.hidden=!this.download||!this.src,e.href=this.src,e.setAttribute(`download`,this.displayName())}_syncPrint(){for(let e of this._parts.toolbar.querySelectorAll(`.wui-file-viewer-print`))e instanceof HTMLElement&&(e.hidden=!this.print)}_status(e,{offerDownload:t=!1}={}){let n=document.createElement(`div`);n.className=`wui-file-viewer-status`;let r=document.createElement(`p`);if(r.textContent=e,n.append(r),t&&this.src){let e=document.createElement(`a`);e.className=l(`neutral`,`outline`,`sm`),e.dataset.wui=a,e.href=this.src,e.setAttribute(`download`,this.displayName()),e.textContent=`Download`,n.append(e)}this._parts.body.replaceChildren(n)}_settle(e,t){this._parts.body.removeAttribute(`aria-busy`),this._status(e,t)}_fail(e){this._view?.destroy(),this._view=null,this._settle(`Couldn't open this file.`,{offerDownload:!0});let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;this.dispatchEvent(new CustomEvent(h,{bubbles:!0,detail:{message:t??String(e)}}))}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen():this.requestFullscreen().catch(e=>{n(`[wui-file-viewer] full screen refused:`,e?.message)})}_syncFullscreen(){if(!this._parts)return;let n=document.fullscreenElement===this,r=this._parts.fullscreen;t(r,n?`x`:`maximize-4`),e(r,n?`Exit full screen`:`Full screen`),this._parts.actionsBox.hidden=n}_readPrefs(){if(this._hostPrefs||!this.viewKey)return{...this._prefs};try{let e=JSON.parse(window.localStorage.getItem(`wui-view:${this.viewKey}`)??`{}`);return S(e)?e:{}}catch{return{}}}_savePrefs(e){if(this._prefs={...this._prefs,...e},this.dispatchEvent(new CustomEvent(g,{bubbles:!0,detail:{...this._prefs}})),!this._hostPrefs&&this.viewKey)try{window.localStorage.setItem(`wui-view:${this.viewKey}`,JSON.stringify(this._prefs))}catch(e){if(!(e instanceof DOMException))throw e}}};function S(e){return typeof e==`object`&&!!e}function C(e){return e&&new URL(e,document.baseURI).href}var w=typeof document>`u`?null:document.currentScript;w instanceof HTMLScriptElement&&w.src&&(x.defaultAssetBase=new URL(`pdfjs/`,w.src).href),i(`wui-file-viewer`,x);var T=(e,t)=>import(`./fileViewerPdf-BxoLE4hd.js`).then(n=>n.renderFirstPage(e,{assetBase:x.defaultAssetBase||void 0,...t}));export{x as WuiFileViewer,_ as fileKind,v as fileNameFromUrl,T as renderPdfFirstPage};
@@ -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,t){a(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function a(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 o=`AppButton`,s=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),c={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 l(e){return Object.hasOwn(c,e)}function u(e=`primary`,t=`solid`,n=`md`){if(!s.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!l(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=c[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var d=`data-advance`,f=`wui-tour-hint`,p=`wui-tour-pointer`,m=`Click {actionName} to continue.`,h=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,g=(e,t)=>e?.advanceOn===`click`&&!!t,_=e=>(e??``).replace(/\s+/g,` `).trim(),v=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,ee=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 te(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(v(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=_(e);if(t)return t}return``}function ne(e){for(let t of[e,...e.querySelectorAll(h)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!ee(t))return t;return null}function y(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 b(e,t){let n=e.querySelector(`.${f}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&y(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=f,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&&y(e,i,!0)}}function x(e,t){let n=e.querySelector(`.${p}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=p,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var S=e=>getComputedStyle(e).animationName;function C(e,{layer:t,spot:n,card:r},i,a){let o=g(i,a);t.toggleAttribute(d,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(d)&&(n.removeAttribute(d),o&&S(n)),o&&n.setAttribute(d,``),x(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?_(i?.actionLabel)||te(a):``,l=e.getAttribute(`advance-label`)||m,u=c?l.replace(/\{actionName\}/g,()=>c):``;return b(r,u),u}function re(e,t,n){if(!g(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function ie(e,t,n,r){return e.contains(r)||g(t,n)&&n.contains(r)}function ae(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=g(r,i)?ne(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 oe(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}var se=2/3,w=1e3,ce=new Set([`top`,`left`,`width`,`height`]),T=new WeakMap,E=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],D=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,le=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&ce.has(e.transitionProperty),ue=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function O(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,w);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function de(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?E(t,le):[]){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*se-r)}return n}function k(e){let t=de(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={};T.set(e,n);let r=()=>{T.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=E(e,ue);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function A(e){return e.dataset.state=`leaving`,O(E(e,D))}function fe(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?O(E(n,D)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var pe=2,j=12,M=8,N=4,P=20,me=`(max-width: 575.98px)`,he=[`bottom`,`top`,`right`,`left`],F=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],I,L=(e,t,n)=>Math.max(t,Math.min(e,n)),R=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function ge(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=B(e),r=e.offsetHeight+j;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+pe}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function z(e,t,n){let r=e.style,i=t.style,a=xe(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 F)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,a.hidden=!0,i.position=`fixed`,i.top=`50%`,i.left=`50%`,i.transform=`translate(-50%, -50%)`,i.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,i.transform=``,i.position=`fixed`;let o=n.getBoundingClientRect();r.top=`${o.top}px`,r.left=`${o.left}px`,r.width=`${o.width}px`,r.height=`${o.height}px`,_e(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=B(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-j,top:o.top-j-l.top,right:l.right-o.right-j,left:o.left-j-l.left},f=window.matchMedia(me).matches,p=he.find(e=>e===`top`||e===`bottom`?c.height<=d[e]+1:!f&&c.width<=d[e]+1&&c.height<=u+1),m=Math.min(o.bottom,l.bottom+M)-Math.max(o.top,l.top-M);p?ve(t,a,p,o,l,c):m>=Math.min(c.height,u)+8?ye(t,a,o,l,c):be(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function _e(e,t){I??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of F)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),I&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function ve(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=R(r.left,r.right,i.left,i.right);s=L(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+j:r.top-j-a.height,l=L(e-s,P,a.width-P)}else{let e=R(r.top,r.bottom,i.top,i.bottom);c=L(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+j:r.left-j-a.width,l=L(e-c,P,a.height-P)}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 ye(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)-N;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${L(n.left+N,r.left,r.right-i.width)}px`}function be(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+j:r.top-j-c}px`;let l=R(r.left,r.right,i.left,i.right);e.style.left=`${L(l-a.width/2,i.left,i.right-a.width)}px`}function B(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+M,bottom:window.innerHeight-r(`paddingBottom`)-M,left:r(`paddingLeft`)+M,right:window.innerWidth-r(`paddingRight`)-M}}function xe(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 Se=0,Ce=`btn btn-sm btn-link`;function V(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`Expected "${t}" to match a ${n.name}.`);return r}function we(e,t,n){let r=`wui-tour-end-${++Se}`,i=!!(t.nextLabel&&t.nextHref),a=e.createElement(`div`);a.className=`wui-tour-card wui-tour-end`,a.dataset.layout=`center`,i&&(a.dataset.next=``),a.setAttribute(`role`,`dialog`),n&&a.setAttribute(`aria-modal`,`true`),a.tabIndex=-1,a.setAttribute(`aria-labelledby`,`${r}-title`),a.setAttribute(`aria-describedby`,`${r}-message`),a.innerHTML=` <div class="wui-tour-end-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></div> <h2 class="wui-tour-title wui-tour-end-title" id="${r}-title"></h2> <p class="wui-tour-text wui-tour-end-message" id="${r}-message"></p> <div class="wui-tour-actions">${i?`<a class="${u(`primary`,`solid`,`sm`)} wui-tour-end-next" data-wui="${o}"></a>`:``}<button type="button" class="${i?Ce:u(`primary`,`solid`,`sm`)} wui-tour-end-button" data-wui="${o}"></button></div>`,V(a,`.wui-tour-end-title`,HTMLElement).textContent=t.title,V(a,`.wui-tour-end-message`,HTMLElement).textContent=t.message,V(a,`.wui-tour-end-button`,HTMLButtonElement).textContent=t.button;let{nextLabel:s,nextHref:c}=t;if(i&&s&&c){let e=V(a,`.wui-tour-end-next`,HTMLAnchorElement);e.textContent=s,e.setAttribute(`href`,c)}return a}var Te=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function Ee(e,t,n){let r=e.ownerDocument,i=e.getRootNode()===r,a=we(r,t,i),o=V(a,`.wui-tour-end-button`,HTMLButtonElement),s=a.querySelector(`.wui-tour-end-next`);if(s!==null&&!(s instanceof HTMLAnchorElement))throw Error(`The end dialog's next link is not a link.`);let c=s,l=c?[c,o]:[o],u=c??o,d=new AbortController;return new Promise(s=>{let f=e=>{d.abort(),s(e)};if(n?.aborted){f(`done`);return}let p=V(e,`.wui-tour-card:not(.wui-tour-end)`,HTMLElement),m=V(e,`.wui-tour-spot`,HTMLElement),h=V(e,`[role=status]`,HTMLElement),g={signal:d.signal};n?.addEventListener(`abort`,()=>f(`done`),g),o.addEventListener(`click`,()=>f(`done`),g),c&&c.addEventListener(`click`,e=>{Te(e)&&(e.preventDefault(),f(`next`))},g),r.addEventListener(`keydown`,e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),f(`done`);else if(oe(e)&&c&&!e.shiftKey&&(e.composedPath?.()[0]??e.target)===c)e.preventDefault(),f(`next`);else if(e.key===`Tab`&&i){e.preventDefault();let t=r.activeElement,n=t instanceof HTMLElement?l.indexOf(t):-1,i=n===-1?e.shiftKey?l.length-1:0:(n+(e.shiftKey?-1:1)+l.length)%l.length,a=l[i];if(!a)throw Error(`The end dialog has no focus stop.`);a.focus()}}},{capture:!0,signal:d.signal}),i&&r.addEventListener(`focusin`,e=>{let t=e.target;if(t!==null&&!(t instanceof Node))throw Error(`Focus moved to a target that is not a node.`);a.contains(t)||u.focus()},g);let _=()=>{d.signal.aborted||(p.hidden=!0,z(m,p,null),e.append(a),k(a),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),u.focus())},v=A(p);v?v.then(_):_()})}var De=` :host { all: initial; ${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); } .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: 2px; } .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-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::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; } } `,H=`wui-tour-media`,Oe=`wui-tour-media-toggle`,U=`http://www.w3.org/2000/svg`,W=`M6 5h4v14H6zM14 5h4v14h-4z`,ke=`M8 5v14l11-7z`,Ae={pause:`Pause animation`,play:`Play animation`},je=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function Me(e){let t=document.createElementNS(U,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(U,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function Ne(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 Pe(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 Fe(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=Oe;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(Me(r?W:ke))};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 Ie(e){let t=e.querySelector(`:scope > .${H}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function Le(e,t,n=Ae){if(Ie(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=H,t.mediaType===`video`){let e=Pe(t,!je());r.append(e,Fe(e,n))}else r.appendChild(Ne(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var G=`data-wui-tour-open`,Re=`Step {current} of {total}`;function K(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 ze(e,t,n){return(e.getAttribute(`progress-label`)||Re).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function Be(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 Ve=`wui-tour-seen:`;function He(e=Ve,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var Ue=`wui-tour-step`,We=`wui-tour-host`,q=`data-tracking`,Ge={back:`Back`,next:`Next`,skip:`Skip`,done:`Done`,mediaPause:`Pause animation`,mediaPlay:`Play animation`,endTitle:`You're all set`,endMessage:`You know your way around now. Enjoy exploring.`,endButton:`Done`},Ke={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`},qe=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],J={index:null,position:null,total:null},Je=0,Y=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,X=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Z(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Ye=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},Q=null;function Xe(e){Q||(Q=new CSSStyleSheet,Q.replaceSync(De)),e.adoptedStyleSheets=[Q]}var Ze=class extends r{seenStore;onBeforeStep;_run;_running;_layer;_outer;_shadow;_unbindAdvance;_ending;_seenMark;_steps=[];_progress=K(0);_firstIndex=0;_returnFocus=null;_current=null;_moving=!1;_card=null;_spot=null;_live=null;_onKey=null;_onFocusIn=null;static get observedAttributes(){return[`open`]}constructor(){super(),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 > ${Ue}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of qe)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`?He():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Ke[e])||Ge[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=K(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&&!Y(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(Y(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-${++Je}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.innerHTML=` <div class="wui-tour-spot" aria-hidden="true"></div> <div class="wui-tour-card" role="dialog" aria-modal="true" tabindex="-1" aria-labelledby="${e}-title" aria-describedby="${e}-text"> <p class="wui-tour-position"></p> <h2 class="wui-tour-title" id="${e}-title"></h2> <p class="wui-tour-text" id="${e}-text"></p> <div class="wui-tour-actions"> <button type="button" class="btn btn-sm btn-link wui-tour-skip"></button> <div class="wui-tour-nav"> <button type="button" class="${u(`neutral`,`outline`,`sm`)} wui-tour-back" data-wui="${o}"></button> <button type="button" class="${u(`primary`,`solid`,`sm`)} wui-tour-next" data-wui="${o}"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let n=t;this._shadow=null,this.isolated&&(n=document.createElement(We),this._shadow=n.attachShadow({mode:`open`}),Xe(this._shadow),this._shadow.appendChild(t)),document.body.appendChild(n),document.documentElement.setAttribute(G,``),this._outer=n,this._layer=t;let r=Z(t,`.wui-tour-spot`,HTMLDivElement),a=Z(t,`.wui-tour-card`,HTMLDivElement),s=Z(t,`[role=status]`,HTMLElement);this._spot=r,this._card=a,this._live=s,Z(a,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Z(a,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Z(a,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1)),this._shadow&&a.removeAttribute(`aria-modal`);let c=e=>this._key(e);this._onKey=c;let l=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`);ie(t,r,n?.target??null,e.target)||a.focus()};this._onFocusIn=l,document.addEventListener(`keydown`,c,!0),this._shadow||document.addEventListener(`focusin`,l),i(n,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_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`);let c=this._progress.position(t),l=this._progress.total(),u=c===l&&!this._endDialogText(),d=ze(this,c,l);Be(o,{text:d,position:c,total:l}),Le(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=C(this,{layer:i,spot:a,card:o},r,n),p=Z(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Z(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Z(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Z(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Z(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,ge(o,n),a.removeAttribute(q),this._place(),k(o),this._unbindAdvance?.(),this._unbindAdvance=re(r,n,()=>this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&X(Ye()))||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`);z(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(q,``)}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=A(e);if(t&&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 C(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(q),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),Ee(t,e,this._ending.signal)}_key(e){if(!(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(X(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),e.key===`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`);ae(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(a(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);fe(t),document.documentElement.removeAttribute(G),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()}:J,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=J,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}}))}},$=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,Ze),t(`wui-tour-step`,$),e.WuiTourStep=$,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,t){a(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function a(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 o=`AppButton`,s=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),c={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 l(e){return Object.hasOwn(c,e)}function u(e=`primary`,t=`solid`,n=`md`){if(!s.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!l(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=c[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var d=`data-wui-dismiss`,f=`data-wui-closing`,p=`[${d}]`,m=`(prefers-reduced-motion: reduce)`,h=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,g=new WeakSet,_=Symbol.for(`webority.ui.modal-stack`),v=Symbol.for(`webority.ui.root-watches`);function ee(e){let t=e;return t[v]??=new Set,t[v]}function te(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(h))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${p},.wui-modal-back`))return t;n??=t}return n}function y(e){let t=e;return t[_]??=[],t[_]}function ne(e){b(e),y(e.ownerDocument).push(e)}function b(e){let t=y(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function x(e){for(let t of ee(e)){let n=S(e);t.last!==n&&(t.last=n,t.listener(n))}}function re(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 ie(e,t){let n=t.focus===`first-control`?te(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`),g.add(e);let o=()=>{if(ne(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw b(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),x(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;S(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&g.has(e)&&e.open&&(s=!1,t.onRequestClose(`escape`))},0)))},l=e=>{s=!1,e.preventDefault(),t.escape&&t.onRequestClose(`escape`)},u=n=>{let r=n.target;if(!(r instanceof Element))return;let i=r.closest(p);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`)},d=()=>{let n=s;s=!1,b(e),g.has(e)?(o(),n&&t.onRequestClose(`escape`)):x(e.ownerDocument)},f=e.ownerDocument;return f.addEventListener(`keydown`,c),e.addEventListener(`cancel`,l),e.addEventListener(`click`,u),e.addEventListener(`close`,d),o(),()=>{f.removeEventListener(`keydown`,c),e.removeEventListener(`cancel`,l),e.removeEventListener(`click`,u),e.removeEventListener(`close`,d),g.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),b(e),x(e.ownerDocument)}}async function ae(e){g.delete(e),e.setAttribute(f,``),!window.matchMedia(m).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await re(e),e.close(),b(e),x(e.ownerDocument),e.removeAttribute(f)}function oe(e){if(se(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 se(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function S(e=document){let t=y(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 C=`data-advance`,w=`wui-tour-hint`,T=`wui-tour-pointer`,ce=`Click {actionName} to continue.`,le=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,E=(e,t)=>e?.advanceOn===`click`&&!!t,D=e=>(e??``).replace(/\s+/g,` `).trim(),ue=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,de=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 fe(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(ue(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=D(e);if(t)return t}return``}function pe(e){for(let t of[e,...e.querySelectorAll(le)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!de(t))return t;return null}function O(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 me(e,t){let n=e.querySelector(`.${w}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&O(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=w,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&&O(e,i,!0)}}function he(e,t){let n=e.querySelector(`.${T}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=T,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var ge=e=>getComputedStyle(e).animationName;function k(e,{layer:t,spot:n,card:r},i,a){let o=E(i,a);t.toggleAttribute(C,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(C)&&(n.removeAttribute(C),o&&ge(n)),o&&n.setAttribute(C,``),he(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?D(i?.actionLabel)||fe(a):``,l=e.getAttribute(`advance-label`)||ce,u=c?l.replace(/\{actionName\}/g,()=>c):``;return me(r,u),u}function _e(e,t,n){if(!E(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function ve(e,t,n,r){return e.contains(r)||E(t,n)&&n.contains(r)}function ye(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=E(r,i)?pe(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 be(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}var xe=2/3,Se=1e3,Ce=new Set([`top`,`left`,`width`,`height`]),A=new WeakMap,j=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],M=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,we=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&Ce.has(e.transitionProperty),Te=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function N(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,Se);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function Ee(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?j(t,we):[]){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*xe-r)}return n}function P(e){let t=Ee(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={};A.set(e,n);let r=()=>{A.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=j(e,Te);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function F(e){return e.dataset.state=`leaving`,N(j(e,M))}function De(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?N(j(n,M)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var Oe=2,I=12,L=8,R=4,z=20,ke=`(max-width: 575.98px)`,Ae=[`bottom`,`top`,`right`,`left`],B=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],V,H=(e,t,n)=>Math.max(t,Math.min(e,n)),U=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function je(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=G(e),r=e.offsetHeight+I;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+Oe}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function W(e,t,n){let r=e.style,i=t.style,a=Ie(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 B)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,a.hidden=!0,i.position=`fixed`,i.top=`50%`,i.left=`50%`,i.transform=`translate(-50%, -50%)`,i.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,i.transform=``,i.position=`fixed`;let o=n.getBoundingClientRect();r.top=`${o.top}px`,r.left=`${o.left}px`,r.width=`${o.width}px`,r.height=`${o.height}px`,Me(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=G(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-I,top:o.top-I-l.top,right:l.right-o.right-I,left:o.left-I-l.left},f=window.matchMedia(ke).matches,p=Ae.find(e=>e===`top`||e===`bottom`?c.height<=d[e]+1:!f&&c.width<=d[e]+1&&c.height<=u+1),m=Math.min(o.bottom,l.bottom+L)-Math.max(o.top,l.top-L);p?Ne(t,a,p,o,l,c):m>=Math.min(c.height,u)+8?Pe(t,a,o,l,c):Fe(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function Me(e,t){V??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of B)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),V&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function Ne(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=U(r.left,r.right,i.left,i.right);s=H(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+I:r.top-I-a.height,l=H(e-s,z,a.width-z)}else{let e=U(r.top,r.bottom,i.top,i.bottom);c=H(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+I:r.left-I-a.width,l=H(e-c,z,a.height-z)}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 Pe(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)-R;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${H(n.left+R,r.left,r.right-i.width)}px`}function Fe(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+I:r.top-I-c}px`;let l=U(r.left,r.right,i.left,i.right);e.style.left=`${H(l-a.width/2,i.left,i.right-a.width)}px`}function G(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+L,bottom:window.innerHeight-r(`paddingBottom`)-L,left:r(`paddingLeft`)+L,right:window.innerWidth-r(`paddingRight`)-L}}function Ie(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 Le=0,Re=`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 ze(e,t,n){let r=`wui-tour-end-${++Le}`,i=!!(t.nextLabel&&t.nextHref),a=n?e.createElement(`dialog`):e.createElement(`div`);a.className=`wui-tour-card wui-tour-end`,a.dataset.layout=`center`,i&&(a.dataset.next=``),a.setAttribute(`role`,`dialog`),a.tabIndex=-1,a.setAttribute(`aria-labelledby`,`${r}-title`),a.setAttribute(`aria-describedby`,`${r}-message`),a.innerHTML=` <div class="wui-tour-end-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></div> <h2 class="wui-tour-title wui-tour-end-title" id="${r}-title"></h2> <p class="wui-tour-text wui-tour-end-message" id="${r}-message"></p> <div class="wui-tour-actions">${i?`<a class="${u(`primary`,`solid`,`sm`)} wui-tour-end-next" data-wui="${o}"></a>`:``}<button type="button" class="${i?Re:u(`primary`,`solid`,`sm`)} wui-tour-end-button" data-wui="${o}"></button></div>`,K(a,`.wui-tour-end-title`,HTMLElement).textContent=t.title,K(a,`.wui-tour-end-message`,HTMLElement).textContent=t.message,K(a,`.wui-tour-end-button`,HTMLButtonElement).textContent=t.button;let{nextLabel:s,nextHref:c}=t;if(i&&s&&c){let e=K(a,`.wui-tour-end-next`,HTMLAnchorElement);e.textContent=s,e.setAttribute(`href`,c)}return a}var Be=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function Ve(e,t,n){let r=e.ownerDocument,i=ze(r,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,ae(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=>{Be(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 be(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,W(m,p,null),e.append(i),P(i),u&&(d=ie(u,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>f(`done`)})),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),c.focus())},v=F(p);v?v.then(_):_()})}var He=` :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-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::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; } } `,q=`wui-tour-media`,Ue=`wui-tour-media-toggle`,J=`http://www.w3.org/2000/svg`,We=`M6 5h4v14H6zM14 5h4v14h-4z`,Ge=`M8 5v14l11-7z`,Ke={pause:`Pause animation`,play:`Play animation`},qe=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function Je(e){let t=document.createElementNS(J,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(J,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function Ye(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 Xe(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 Ze(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=Ue;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(Je(r?We:Ge))};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 Qe(e){let t=e.querySelector(`:scope > .${q}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function $e(e,t,n=Ke){if(Qe(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=q,t.mediaType===`video`){let e=Xe(t,!qe());r.append(e,Ze(e,n))}else r.appendChild(Ye(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var Y=`data-wui-tour-open`,et=`Step {current} of {total}`;function X(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 tt(e,t,n){return(e.getAttribute(`progress-label`)||et).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function nt(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 rt=`wui-tour-seen:`;function it(e=rt,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var at=`wui-tour-step`,ot=`wui-tour-host`,Z=`data-tracking`,st={back:`Back`,next:`Next`,skip:`Skip`,done:`Done`,mediaPause:`Pause animation`,mediaPlay:`Play animation`,endTitle:`You're all set`,endMessage:`You know your way around now. Enjoy exploring.`,endButton:`Done`},ct={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`},lt=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],ut={index:null,position:null,total:null},dt=0,ft=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,pt=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 mt=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function ht(e){$||($=new CSSStyleSheet,$.replaceSync(He)),e.adoptedStyleSheets=[$]}var gt=class extends r{seenStore;onBeforeStep;_run;_running;_layer;_outer;_shadow;_unbindAdvance;_ending;_seenMark;_steps=[];_progress=X(0);_firstIndex=0;_returnFocus=null;_current=null;_moving=!1;_card=null;_spot=null;_live=null;_onKey=null;_onFocusIn=null;static get observedAttributes(){return[`open`]}constructor(){super(),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 > ${at}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of lt)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`?it():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(ct[e])||st[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=X(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&&!ft(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(ft(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-${++dt}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.innerHTML=` <div class="wui-tour-spot" aria-hidden="true"></div> <div class="wui-tour-card" role="dialog" tabindex="-1" aria-labelledby="${e}-title" aria-describedby="${e}-text"> <p class="wui-tour-position"></p> <h2 class="wui-tour-title" id="${e}-title"></h2> <p class="wui-tour-text" id="${e}-text"></p> <div class="wui-tour-actions"> <button type="button" class="btn btn-sm btn-link wui-tour-skip"></button> <div class="wui-tour-nav"> <button type="button" class="${u(`neutral`,`outline`,`sm`)} wui-tour-back" data-wui="${o}"></button> <button type="button" class="${u(`primary`,`solid`,`sm`)} wui-tour-next" data-wui="${o}"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let n=t;this._shadow=null,this.isolated&&(n=document.createElement(ot),this._shadow=n.attachShadow({mode:`open`}),ht(this._shadow),this._shadow.appendChild(t)),n.setAttribute(`popover`,`manual`),S(document).appendChild(n),document.documentElement.setAttribute(Y,``),this._outer=n,this._layer=t;let r=Q(t,`.wui-tour-spot`,HTMLDivElement),a=Q(t,`.wui-tour-card`,HTMLDivElement),s=Q(t,`[role=status]`,HTMLElement);this._spot=r,this._card=a,this._live=s,Q(a,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Q(a,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Q(a,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let c=e=>this._key(e);this._onKey=c;let l=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`);ve(t,r,n?.target??null,e.target)||a.focus()};this._onFocusIn=l,document.addEventListener(`keydown`,c,!0),this._shadow||document.addEventListener(`focusin`,l),i(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=S(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),oe(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=tt(this,c,l);nt(o,{text:d,position:c,total:l}),$e(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=k(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,je(o,n),a.removeAttribute(Z),this._place(),P(o),this._unbindAdvance?.(),this._unbindAdvance=_e(r,n,()=>this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&pt(mt()))||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`);W(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(Z,``)}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=F(e);if(t&&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 k(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(Z),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),Ve(t,e,this._ending.signal)}_key(e){if(!(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(pt(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),e.key===`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`);ye(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(a(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);De(t),document.documentElement.removeAttribute(Y),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()}:ut,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=ut,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}}))}},_t=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,gt),t(`wui-tour-step`,_t),e.WuiTourStep=_t,e})({});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webority/ui-elements",
3
- "version": "0.163.0",
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.",
3
+ "version": "0.165.0",
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",
7
7
  "publishConfig": {
@@ -59,6 +59,10 @@
59
59
  "types": "./types/elements/data-table.d.ts",
60
60
  "default": "./dist/elements/data-table.js"
61
61
  },
62
+ "./elements/entry-grid": {
63
+ "types": "./types/elements/entry-grid.d.ts",
64
+ "default": "./dist/elements/entry-grid.js"
65
+ },
62
66
  "./elements/date-range": {
63
67
  "types": "./types/elements/date-range.d.ts",
64
68
  "default": "./dist/elements/date-range.js"
@@ -75,6 +79,18 @@
75
79
  "types": "./types/elements/drawer.d.ts",
76
80
  "default": "./dist/elements/drawer.js"
77
81
  },
82
+ "./elements/dropdown": {
83
+ "types": "./types/elements/dropdown.d.ts",
84
+ "default": "./dist/elements/dropdown.js"
85
+ },
86
+ "./elements/modal": {
87
+ "types": "./types/elements/modal.d.ts",
88
+ "default": "./dist/elements/modal.js"
89
+ },
90
+ "./elements/popover": {
91
+ "types": "./types/elements/popover.d.ts",
92
+ "default": "./dist/elements/popover.js"
93
+ },
78
94
  "./elements/filter-popover": {
79
95
  "types": "./types/elements/filter-popover.d.ts",
80
96
  "default": "./dist/elements/filter-popover.js"
@@ -151,14 +167,6 @@
151
167
  "types": "./types/elements/relative-time.d.ts",
152
168
  "default": "./dist/elements/relative-time.js"
153
169
  },
154
- "./elements/resizable": {
155
- "types": "./types/elements/resizable.d.ts",
156
- "default": "./dist/elements/resizable.js"
157
- },
158
- "./elements/rolling-number": {
159
- "types": "./types/elements/rolling-number.d.ts",
160
- "default": "./dist/elements/rolling-number.js"
161
- },
162
170
  "./elements/saved-views": {
163
171
  "types": "./types/elements/saved-views.d.ts",
164
172
  "default": "./dist/elements/saved-views.js"
@@ -250,9 +258,10 @@
250
258
  "@tiptap/starter-kit": "3.31.4",
251
259
  "@types/node": "25.6.0",
252
260
  "@vitest/coverage-v8": "5.1.0",
253
- "@webority/biome-config": "0.163.0",
254
- "@webority/markdown-core": "0.163.0",
255
- "@webority/theme": "0.163.0",
261
+ "@webority/biome-config": "0.165.0",
262
+ "@webority/markdown-core": "0.165.0",
263
+ "@webority/theme": "0.165.0",
264
+ "@webority/web-core": "0.165.0",
256
265
  "echarts": "6.1.0",
257
266
  "jsdom": "30.1.1",
258
267
  "libphonenumber-js": "^1.13.9",
@@ -48,7 +48,7 @@
48
48
  * cancels the event; otherwise the element keeps the path itself, and with `.wui-cmd-page`
49
49
  * containers (`data-page`, `data-label`) in the markup it shows only the current page's options
50
50
  * (the root options when the path is empty). Every navigation clears the search. The path
51
- * resets when the enclosing Bootstrap modal closes.
51
+ * resets when the enclosing wui-modal closes.
52
52
  *
53
53
  * Recents. With `recents-key` (a localStorage key; make it per user), each chosen option is
54
54
  * remembered by its `data-group-key` and `data-key`, newest first, up to `recents-limit`
@@ -73,7 +73,7 @@ export declare class WuiCommandPalette extends ElementBase {
73
73
  _crumbSig: string | null;
74
74
  _modal: Element | null;
75
75
  _recentsId: string;
76
- _onModalHidden: () => void;
76
+ _onModalClosed: () => void;
77
77
  _activeId: string | null;
78
78
  _lastQuery: string | null;
79
79
  _lastIds: string | null;
@@ -30,8 +30,6 @@ export declare class WuiCommentThread extends ElementBase {
30
30
  private _busy;
31
31
  private _peopleProp;
32
32
  private _pickerFor;
33
- private _onDocClick;
34
- private _repositionPicker;
35
33
  private _openers?;
36
34
  submit?: (request: CommentRequest) => Promise<unknown>;
37
35
  constructor();
@@ -61,6 +59,7 @@ export declare class WuiCommentThread extends ElementBase {
61
59
  _closeConfirm(comment: Element | null, restoreFocus: boolean): void;
62
60
  _openPicker(comment: Element | null, button: HTMLElement): void;
63
61
  _closePicker(restoreFocus: boolean): void;
62
+ _pickerClosed(): void;
64
63
  _react(comment: Element, emoji: string | null): void;
65
64
  _sendFrom(button: HTMLElement): void;
66
65
  _send(intent: CommentIntent, fields: CommentFields, { comment, scope, form }: {
@@ -1,5 +1,53 @@
1
+ /**
2
+ * <wui-context-menu>: the behaviour of a right-click menu over a region of the page.
3
+ *
4
+ * Like <wui-command-palette>, this element authors almost no markup of its own. The wrappers (React
5
+ * AppContextMenu, Razor <app-context-menu>) author the menu panel, a direct child with
6
+ * `role="menu"` and `tabindex="-1"` holding `role="menuitem"` rows, and the dropdown look comes
7
+ * from the shared `.dropdown-menu` / `.dropdown-item` theme. This element only:
8
+ *
9
+ * - decides WHERE it listens. With a `target` attribute (a CSS selector) it listens on every
10
+ * element that matches, so one menu can serve each row of a table or each card of a grid,
11
+ * including ones added later. Without `target` the element is the region itself: it is
12
+ * `display: contents`, wraps whatever the wrapper put around the menu, and listens on those
13
+ * children. The panel's own subtree is never a region.
14
+ * - opens on right-click, on a long press of a finger (500 ms, cancelled by a move, a lift or
15
+ * a scroll), and on Shift+F10 or the ContextMenu key from the focused element. The panel is
16
+ * placed at the pointer, or under the focused element for the keyboard, and kept inside the
17
+ * viewport (`openAnchoredPopover`: flips above, shrinks and scrolls when short on room).
18
+ * - opens on a click or Enter on an element matching `trigger` (a CSS selector) inside a region,
19
+ * anchored under that element and for that region.
20
+ * - leaves the browser's own menu alone where it is the better tool: inside an input,
21
+ * textarea, select or contenteditable, with the element `disabled`, and on Shift+right-click.
22
+ * Cancelling the `contextmenu` event on the page opts a sub-region out too.
23
+ * - keeps one menu open on the page, and the innermost region wins when regions nest.
24
+ * - moves focus with ArrowDown / ArrowUp (wrapping), Home / End and typeahead (`bindMenuKeys`);
25
+ * Space and Enter activate the focused row; Escape closes and returns focus to where it was;
26
+ * Tab closes. A disabled row (`aria-disabled="true"`) is listed but skipped.
27
+ * - closes on an outside press (the popover's light dismiss), on a right-click elsewhere, on
28
+ * scroll outside the panel, on resize, and when the window loses focus.
29
+ * - renders a tick in a row that has `aria-checked="true"`, and a `span.wui-context-menu-hint`
30
+ * from a row's `data-hint`, linked by `aria-describedby`.
31
+ *
32
+ * Submenus follow the menubar's shape. A `.wui-context-menu-sub` wraps the row that opens it
33
+ * (`aria-haspopup="menu"`) and its panel, `.dropdown-menu.wui-context-menu-subpanel` with
34
+ * `role="menu"`. It opens on click, Enter, Space or ArrowRight, never on hover alone, is placed
35
+ * beside its row (`beside` placement), and ArrowLeft or Escape closes one level. A submenu
36
+ * with `data-searchable` holds an `input.wui-context-menu-search`: the element filters its rows
37
+ * as the user types and focuses the input when the submenu opens.
38
+ *
39
+ * Events, all bubbling:
40
+ * `wui-context-menu:beforeopen` { region, origin, trigger } before the panel shows; cancelable.
41
+ * A cancel keeps the menu closed and leaves the browser's menu alone.
42
+ * `trigger` is the element that matched `trigger`, or null.
43
+ * `wui-context-menu:open` { region, origin, x, y } after the panel is shown
44
+ * `wui-context-menu:select` { key, item, region, origin } after a row is activated and the
45
+ * menu has closed; `key` is the row's `data-key`, for a submenu
46
+ * row too. A row that is a link also navigates; the event is for
47
+ * rows that are actions.
48
+ * `region` is the matched target; `origin` is the element the user acted on inside it.
49
+ */
1
50
  import { ElementBase } from "./elementBase.ts";
2
- import { type ListboxKeyNav } from "./listboxKeyNav.ts";
3
51
  export declare class WuiContextMenu extends ElementBase {
4
52
  _region: Element | null;
5
53
  _origin: Element | null;
@@ -10,8 +58,9 @@ export declare class WuiContextMenu extends ElementBase {
10
58
  timer: ReturnType<typeof setTimeout>;
11
59
  } | null;
12
60
  _swallowClick: boolean;
13
- _navPanel: HTMLElement | null;
14
- _nav: ListboxKeyNav;
61
+ _unbindKeys: (() => void) | null;
62
+ _anchor: HTMLElement | null;
63
+ _closingByKey: boolean;
15
64
  _onContextMenu: (e: MouseEvent) => void;
16
65
  _onContextMenuCapture: (e: MouseEvent) => void;
17
66
  _onDocKeyDown: (e: KeyboardEvent) => void;
@@ -58,6 +107,9 @@ export declare class WuiContextMenu extends ElementBase {
58
107
  } | null;
59
108
  /** Hide the menu and every submenu in it. `restoreFocus` returns focus to what held it when the menu opened. */
60
109
  close(restoreFocus?: boolean): void;
110
+ _finish(restoreFocus: boolean): void;
111
+ _onPanelClosed(): void;
112
+ _menuRows(): HTMLElement[];
61
113
  _panel(): HTMLElement | null;
62
114
  _inPanel(node: EventTarget | null): boolean;
63
115
  _rowsOf(panel: HTMLElement | null): HTMLElement[];
@@ -75,13 +127,12 @@ export declare class WuiContextMenu extends ElementBase {
75
127
  _cancelPress(): void;
76
128
  _handleMenuKey(e: KeyboardEvent): void;
77
129
  _handleSearchKey(e: KeyboardEvent, input: Element): void;
78
- _step(panel: HTMLElement, item: HTMLElement | null, step: number): void;
79
130
  _subOf(item: HTMLElement): HTMLElement | null;
80
- _openSubOf(panel: HTMLElement): HTMLElement | null;
81
131
  _openSub(sub: HTMLElement, focusFirst: boolean): void;
82
132
  _closeSub(sub: HTMLElement): void;
83
133
  _closeSubByKey(sub: HTMLElement): void;
84
134
  _setSub(sub: HTMLElement, open: boolean): void;
135
+ _onSubClosed(sub: HTMLElement): void;
85
136
  _filter(sub: HTMLElement, text: string): void;
86
137
  _handleInput(e: Event): void;
87
138
  _decorate(panel: HTMLElement): void;
@@ -24,15 +24,13 @@ export declare class WuiDatePicker extends ElementBase {
24
24
  _viewNavigated?: boolean;
25
25
  _openFn?: () => void;
26
26
  _closeFn?: () => void;
27
- _bindGlobal?: () => void;
28
27
  _onKeyBound?: (e: KeyboardEvent) => void;
29
- _onDocClick?: ((e: MouseEvent) => void) | null;
30
- _onDocKey?: ((e: KeyboardEvent) => void) | null;
31
- _onHostKey?: ((e: KeyboardEvent) => void) | null;
28
+ _closingQuietly?: boolean;
32
29
  get _open(): () => void;
33
30
  get _close(): () => void;
34
31
  constructor();
35
32
  connectedCallback(): void;
33
+ disconnectedCallback(): void;
36
34
  attributeChangedCallback(name: string, _old: string | null, val: string | null): void;
37
35
  _syncInvalid(): void;
38
36
  formResetCallback(): void;
@@ -43,17 +41,15 @@ export declare class WuiDatePicker extends ElementBase {
43
41
  _syncFormValue(): void;
44
42
  _syncTrigger(): void;
45
43
  _limits(): DayLimits;
44
+ _dropPanel(): void;
46
45
  _renderView(): void;
47
46
  _daysHtml(): string;
48
47
  _monthsHtml(): string;
49
48
  _yearsHtml(): string;
50
49
  _focusActive(): void;
51
- _position(trigger: HTMLElement, pop: HTMLElement): void;
52
50
  _setFocus(y: number, m: number, d: number, slide?: string): void;
53
51
  _seek(y: number, m: number, d: number, step: number): Date | null;
54
52
  _onKey(e: KeyboardEvent): void;
55
53
  _wire(): void;
56
- _teardown(): void;
57
- disconnectedCallback(): void;
58
54
  }
59
55
  export {};
@@ -12,17 +12,14 @@ export declare class WuiDateRange extends ElementBase {
12
12
  _defaultStart: string | undefined;
13
13
  _defaultEnd: string | undefined;
14
14
  _presetList: Preset[] | undefined;
15
- _bindGlobal: (() => void) | undefined;
16
15
  _open: () => void;
17
16
  _close: () => void;
18
- _onDocClick: ((e: MouseEvent) => void) | null | undefined;
19
- _onDocKey: ((e: KeyboardEvent) => void) | null | undefined;
20
- _onHostKey: ((e: KeyboardEvent) => void) | null | undefined;
21
- _reanchor?: (() => void) | null;
22
- _reanchorScroll?: ((e: Event) => void) | null;
17
+ get open(): boolean;
18
+ set open(next: boolean);
23
19
  static get observedAttributes(): string[];
24
20
  constructor();
25
21
  connectedCallback(): void;
22
+ disconnectedCallback(): void;
26
23
  attributeChangedCallback(name: string, _old: string | null, _val: string | null): void;
27
24
  _syncInvalid(): void;
28
25
  get value(): {
@@ -52,10 +49,8 @@ export declare class WuiDateRange extends ElementBase {
52
49
  _presetsHtml(): string;
53
50
  _renderView(): void;
54
51
  _paint(): void;
55
- _position(trigger: HTMLElement, pop: HTMLElement): void;
56
52
  _pick(iso: string): void;
57
53
  _applyPreset({ start, end }: Preset): void;
54
+ _dropPanel(): void;
58
55
  _wire(): void;
59
- _teardown(): void;
60
- disconnectedCallback(): void;
61
56
  }
@@ -1,4 +1,5 @@
1
1
  import { ElementBase } from "./elementBase.ts";
2
+ import { type OverlayCloseReason } from "./nativeOverlay.ts";
2
3
  interface DragState {
3
4
  grip: HTMLElement;
4
5
  id: number;
@@ -13,17 +14,16 @@ export declare class WuiDrawer extends ElementBase {
13
14
  _doc: Document | null;
14
15
  _media: MediaQueryList | null;
15
16
  _shown: boolean;
16
- _locked: boolean;
17
- _opener: HTMLElement | SVGElement | null;
17
+ _trigger: HTMLElement | null;
18
+ _returnTo: HTMLElement | null;
19
+ _release: (() => void) | null;
18
20
  _snap: number;
19
21
  _drag: DragState | null;
20
22
  _onMedia: () => void;
21
- _onClick: (e: MouseEvent) => void;
22
23
  _onPointerDown: (e: PointerEvent) => void;
23
24
  _onPointerMove: (e: PointerEvent) => void;
24
25
  _onPointerUp: (e: PointerEvent) => void;
25
26
  _onKeyDown: (e: KeyboardEvent) => void;
26
- _onHostKey: (e: KeyboardEvent) => void;
27
27
  _onTransitionEnd: (e: TransitionEvent) => void;
28
28
  _announced: boolean;
29
29
  static get observedAttributes(): string[];
@@ -32,7 +32,7 @@ export declare class WuiDrawer extends ElementBase {
32
32
  disconnectedCallback(): void;
33
33
  attributeChangedCallback(name: string): void;
34
34
  get isOpen(): boolean;
35
- /** Opens the drawer; `opener` is the control focus returns to (defaults to the focused one). */
35
+ /** Opens the drawer; `opener` is reported as detail.trigger of `wui-drawer-open`. */
36
36
  show(opener?: HTMLElement): void;
37
37
  /** Closes the drawer without asking. */
38
38
  hide(): void;
@@ -43,18 +43,15 @@ export declare class WuiDrawer extends ElementBase {
43
43
  _setSnap(index: number): void;
44
44
  _open(): void;
45
45
  _close(): void;
46
+ _teardown(): void;
46
47
  _settle(): void;
47
48
  _announce(): void;
48
- _release(): void;
49
49
  _document(): Document;
50
- _panel(): HTMLElement | null;
51
- _focusables(): HTMLElement[];
52
- _focusIn(): void;
50
+ _panel(): HTMLDialogElement | null;
51
+ _dialog(): HTMLDialogElement;
53
52
  _dismissible(): boolean;
54
- _requestClose(): boolean;
55
- _click(e: MouseEvent): void;
53
+ _requestClose(reason: OverlayCloseReason): boolean;
56
54
  _keyDown(e: KeyboardEvent): void;
57
- _trapTab(e: KeyboardEvent): void;
58
55
  _handleKey(e: KeyboardEvent): void;
59
56
  _pointerDown(e: PointerEvent): void;
60
57
  _viewport(): number;