@webority/ui-elements 0.129.0 → 0.130.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/dist/{WuiCodeBlock-Cdz6meSs.js → WuiCodeBlock-iYtlkQn6.js} +1 -1
- package/dist/{WuiCommentThread-0GshmzBj.js → WuiCommentThread-ZXxBt71o.js} +1 -1
- package/dist/WuiConsentBanner-CYOU67bp.js +1 -0
- package/dist/{WuiSavedViews-B5DNBGpt.js → WuiSavedViews-8KVuepEC.js} +1 -1
- package/dist/WuiTour-ClCXfOtI.js +1 -0
- package/dist/{WuiWizardStep-DK2qWwP9.js → WuiWizardStep-7TdmGpUA.js} +1 -1
- package/dist/buttonClass-DpG9WzgJ.js +1 -0
- package/dist/drawerDiscard-CZn1VnaB.js +1 -0
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/comment-thread.js +1 -1
- package/dist/elements/consent-banner.js +1 -1
- package/dist/elements/saved-views.js +1 -1
- package/dist/elements/tour.js +1 -1
- package/dist/elements/wizard.js +1 -1
- package/dist/helpers.js +1 -1
- package/dist/server.js +1 -1
- package/dist/themeTransition-rHRVbhHB.js +1 -0
- package/dist/ui-calendar.global.js +1 -1
- package/dist/ui-calendar.js +1 -1
- package/dist/ui-consent-banner.global.js +1 -1
- package/dist/ui-elements/autocomplete.global.js +1 -1
- package/dist/ui-elements/carousel.global.js +1 -1
- package/dist/ui-elements/code-block.global.js +1 -1
- package/dist/ui-elements/command-palette.global.js +1 -1
- package/dist/ui-elements/comment-thread.global.js +1 -1
- package/dist/ui-elements/consent-banner.global.js +1 -1
- package/dist/ui-elements/context-menu.global.js +1 -1
- package/dist/ui-elements/date-range.global.js +1 -1
- package/dist/ui-elements/drawer.global.js +1 -1
- package/dist/ui-elements/image-crop.global.js +1 -1
- package/dist/ui-elements/inline-edit.global.js +1 -1
- package/dist/ui-elements/kanban.global.js +1 -1
- package/dist/ui-elements/lead-popup.global.js +1 -1
- package/dist/ui-elements/lightbox.global.js +1 -1
- package/dist/ui-elements/markdown.global.js +1 -1
- package/dist/ui-elements/multiselect.global.js +1 -1
- package/dist/ui-elements/phone.global.js +1 -1
- package/dist/ui-elements/resizable.global.js +1 -1
- package/dist/ui-elements/saved-views.global.js +1 -1
- package/dist/ui-elements/slider.global.js +1 -1
- package/dist/ui-elements/sortable.global.js +1 -1
- package/dist/ui-elements/status-icon.global.js +1 -1
- package/dist/ui-elements/taginput.global.js +1 -1
- package/dist/ui-elements/timepicker.global.js +1 -1
- package/dist/ui-elements/tour.global.js +1 -1
- package/dist/ui-elements/tree.global.js +1 -1
- package/dist/ui-elements/wizard.global.js +1 -1
- package/dist/ui-elements.global.js +1 -1
- package/dist/ui-elements.js +1 -1
- package/dist/ui-file-viewer.global.js +1 -1
- package/dist/ui-file-viewer.js +1 -1
- package/dist/ui-tour.global.js +1 -1
- package/package.json +2 -8
- package/dist/WuiConsentBanner-BF5ymoH5.js +0 -1
- package/dist/WuiTour-DjR-6kr5.js +0 -1
- package/dist/buttonClass-FD57QNey.js +0 -1
- package/dist/server-XVcnIJ_Y.js +0 -1
- package/dist/themeTransition-lIK8WDpA.js +0 -1
package/dist/ui-file-viewer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,o as t,r as n,t as r}from"./fileViewerUi-D9R6-gZt.js";var i=`AppButton`,a={primary:`btn-primary`,
|
|
1
|
+
import{i as e,o as t,r as n,t as r}from"./fileViewerUi-D9R6-gZt.js";var i=`AppButton`,a={primary:`btn-primary`,soft:`btn-soft-primary`,outline:`btn-outline-primary`,ghost:`btn-ghost-primary`,text:`btn-link-primary`,danger:`btn-danger`,success:`btn-success`,"outline-danger":`btn-outline-danger`,light:`btn-neutral`,warning:`btn-warning`,neutral:`btn-soft-neutral`,"outline-light":`btn-glass`,"outline-secondary":`btn-outline-neutral`};function o(e=`primary`,t=`md`){let n=a[e];if(!n)throw Error(`buttonClass: unknown variant "${e}"`);return t===`md`?`btn ${n}`:`btn ${n} btn-${t}`}var s=typeof HTMLElement>`u`?class{}:HTMLElement,c={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`},l={"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`},u=`wui-file-viewer:load`,d=`wui-file-viewer:error`,f=`wui-file-viewer:prefs-change`;function p(e,t){let n=String(e??``).split(`;`)[0].trim().toLowerCase();if(n)return l[n]??null;let r=String(t??``).split(/[?#]/)[0];return c[r.includes(`.`)?r.split(`.`).pop().toLowerCase():``]??null}function m(e){let t=String(e??``).split(/[?#]/)[0].split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}var h={pdf:()=>import(`./fileViewerPdf-CvY7afCX.js`).then(e=>e.PdfView),image:()=>import(`./fileViewerImage-DQYAoEzn.js`).then(e=>e.ImageView),video:()=>import(`./fileViewerMedia-DwkIYzmY.js`).then(e=>e.MediaView),audio:()=>import(`./fileViewerMedia-DwkIYzmY.js`).then(e=>e.MediaView)},g=0,_=class a extends s{static defaultAssetBase=``;static get observedAttributes(){return[`src`,`name`,`type`,`download`,`print`,`worker-src`,`asset-base`,`captions`]}constructor(){super(),g+=1,this.uid=`wui-file-viewer-${g}`,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||m(this.src)||`Document`}connectedCallback(){if(Object.hasOwn(this,`prefs`)){let e=this.prefs;delete 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=p(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 h[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:v(this.assetBase||a.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(u,{bubbles:!0,detail:e})))},fail:e=>{t()&&this._fail(e)}}}_render(){let t=(e,t)=>{let n=document.createElement(e);return n.className=t,n},i=t(`div`,`wui-file-viewer-toolbar`),a=t(`div`,`wui-file-viewer-group wui-file-viewer-start`),o=t(`span`,`wui-file-viewer-name`);o.textContent=this.displayName(),o.title=this.displayName(),a.append(o);let s=t(`div`,`wui-file-viewer-group wui-file-viewer-center`),c=t(`div`,`wui-file-viewer-group wui-file-viewer-end`),l=t(`div`,`wui-file-viewer-group wui-file-viewer-view-end`),u=t(`a`,`u-action wui-file-viewer-download`);u.style.setProperty(`--wui-action-size`,`32px`),n(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??=t(`div`,`wui-file-viewer-actions`);let f=this._actionsBox;f.append(...this.querySelectorAll(`:scope > [slot="actions"]`)),c.append(l,u,d,f);let p=t(`search`,`wui-file-viewer-search`);p.hidden=!0,i.append(a,s,c,p);let m=t(`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.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=o(`outline-secondary`,`sm`),e.dataset.wui=i,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}),this.dispatchEvent(new CustomEvent(d,{bubbles:!0,detail:{message:e?.message??String(e)}}))}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen():this.requestFullscreen().catch(e=>{t(`[wui-file-viewer] full screen refused:`,e?.message)})}_syncFullscreen(){if(!this._parts)return;let t=document.fullscreenElement===this,r=this._parts.fullscreen;n(r,t?`x`:`maximize-4`),e(r,t?`Exit full screen`:`Full screen`),this._parts.actionsBox.hidden=t}_readPrefs(){if(this._hostPrefs||!this.viewKey)return{...this._prefs};try{return JSON.parse(window.localStorage.getItem(`wui-view:${this.viewKey}`)??`{}`)??{}}catch{return{}}}_savePrefs(e){if(this._prefs={...this._prefs,...e},this.dispatchEvent(new CustomEvent(f,{bubbles:!0,detail:{...this._prefs}})),!this._hostPrefs&&this.viewKey)try{window.localStorage.setItem(`wui-view:${this.viewKey}`,JSON.stringify(this._prefs))}catch{}}};function v(e){return e&&new URL(e,document.baseURI).href}var y=typeof document>`u`?null:document.currentScript;y?.src&&(_.defaultAssetBase=new URL(`pdfjs/`,y.src).href),typeof customElements<`u`&&!customElements.get(`wui-file-viewer`)&&customElements.define(`wui-file-viewer`,_);var b=(e,t)=>import(`./fileViewerPdf-CvY7afCX.js`).then(n=>n.renderFirstPage(e,{assetBase:_.defaultAssetBase||void 0,...t}));export{_ as WuiFileViewer,p as fileKind,m as fileNameFromUrl,b as renderPdfFirstPage};
|
package/dist/ui-tour.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){function e(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 e of Object.keys(r)){let i=Object.getOwnPropertyDescriptor(t.prototype,e);i&&(i.set||i.get)&&(n.push([r,e,r[e]]),delete r[e])}customElements.define(e,t);for(let[e,t,r]of n)e[t]=r}var t=typeof HTMLElement>`u`?class{}:HTMLElement;function n(e,t){r(e),e._reanchor=t,e._reanchorScroll=n=>{n.target instanceof Node&&typeof e.contains==`function`&&e.contains(n.target)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function r(e){e?._reanchor&&(window.removeEventListener(`resize`,e._reanchor),window.removeEventListener(`scroll`,e._reanchorScroll,!0),e._reanchor=null,e._reanchorScroll=null)}var i=`AppButton`,a={primary:`btn-primary`,secondary:`btn-secondary`,outline:`btn-outline-primary`,ghost:`btn-ghost`,text:`btn-text`,danger:`btn-danger`,success:`btn-success`,"secondary-danger":`btn-secondary-danger`,"outline-danger":`btn-outline-danger`,light:`btn-light`,warning:`btn-warning`,neutral:`btn-neutral`,"outline-light":`btn-outline-light`,"outline-secondary":`btn-outline-secondary`};function o(e=`primary`,t=`md`){let n=a[e];if(!n)throw Error(`buttonClass: unknown variant "${e}"`);return t===`md`?`btn ${n}`:`btn ${n} btn-${t}`}var s=`data-advance`,c=`wui-tour-hint`,l=`Click {actionName} to continue.`,u=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,d=(e,t)=>e?.advanceOn===`click`&&!!t,f=e=>(e??``).replace(/\s+/g,` `).trim();function p(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e.tagName===`INPUT`&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(e.labels??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=f(e);if(t)return t}return``}function m(e){for(let t of[e,...e.querySelectorAll(u)])if(t.tabIndex>=0&&!t.disabled)return t;return null}function h(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 ee(e,t){let n=e.querySelector(`.${c}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;t?(n||(n=e.ownerDocument.createElement(`p`),n.className=c,i&&(n.id=i),e.querySelector(`.wui-tour-actions`).before(n)),n.textContent=t,i&&h(e,i,!0)):(n?.remove(),i&&h(e,i,!1))}var te=e=>getComputedStyle(e).animationName;function g(e,{layer:t,spot:n,card:r},i,a){let o=d(i,a);t.toggleAttribute(s,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(s)&&(n.removeAttribute(s),o&&te(n)),o&&n.setAttribute(s,``);let c=r.querySelector(`.wui-tour-next`);c.classList.toggle(`btn-primary`,!o),c.classList.toggle(`btn-link`,o);let u=o?f(i.actionLabel)||p(a):``,m=e.getAttribute(`advance-label`)||l,h=u?m.replace(/\{actionName\}/g,()=>u):``;return ee(r,h),h}function ne(e,t,n){if(!d(e,t))return()=>{};let r=null,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function _(e,t,n,r){return e.contains(r)||d(t,n)&&n.contains(r)}function v(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=d(r,i)?m(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i.contains(n));e.preventDefault(),a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length].focus()}var re=2/3,ie=1e3,ae=new Set([`top`,`left`,`width`,`height`]),y=new WeakMap,b=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],x=e=>e.transitionProperty===`opacity`,S=e=>ae.has(e.transitionProperty),C=e=>typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function w(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,ie);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function T(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?b(t,S):[]){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*re-r)}return n}function E(e){let t=T(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={};y.set(e,n);let r=()=>{y.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=b(e,C);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function D(e){return e.dataset.state=`leaving`,w(b(e,x))}function oe(e){let t=e.classList.contains(`wui-tour-layer`)?e:e.shadowRoot?.querySelector(`.wui-tour-layer`);t&&(t.dataset.state=`leaving`);let n=t?w(b(t,x)):null;n?(e.setAttribute(`inert`,``),n.then(()=>e.remove())):e.remove()}var se=2,O=12,k=8,A=4,j=20,ce=`(max-width: 575.98px)`,le=[`bottom`,`top`,`right`,`left`],M=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],N,P=(e,t,n)=>Math.max(t,Math.min(e,n)),F=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function I(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=H(e),r=e.offsetHeight+O;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+se}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function L(e,t,n){let r=e.style,i=t.style,a=U(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 M)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`,R(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=H(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-O,top:o.top-O-l.top,right:l.right-o.right-O,left:o.left-O-l.left},f=window.matchMedia(ce).matches,p=le.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+k)-Math.max(o.top,l.top-k);p?z(t,a,p,o,l,c):m>=Math.min(c.height,u)+8?B(t,a,o,l,c):V(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function R(e,t){N??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of M)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),N&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function z(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=F(r.left,r.right,i.left,i.right);s=P(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+O:r.top-O-a.height,l=P(e-s,j,a.width-j)}else{let e=F(r.top,r.bottom,i.top,i.bottom);c=P(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+O:r.left-O-a.width,l=P(e-c,j,a.height-j)}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 B(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)-A;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${P(n.left+A,r.left,r.right-i.width)}px`}function V(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+O:r.top-O-c}px`;let l=F(r.left,r.right,i.left,i.right);e.style.left=`${P(l-a.width/2,i.left,i.right-a.width)}px`}function H(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e])||0;return{top:r(`paddingTop`)+k,bottom:window.innerHeight-r(`paddingBottom`)-k,left:r(`paddingLeft`)+k,right:window.innerWidth-r(`paddingRight`)-k}}function U(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);return t||(t=document.createElement(`span`),t.className=`wui-tour-arrow`,t.setAttribute(`aria-hidden`,`true`),t.hidden=!0,e.append(t)),t}var W=0;function ue(e,t,n){let r=`wui-tour-end-${++W}`,a=e.createElement(`div`);return a.className=`wui-tour-card wui-tour-end`,a.dataset.layout=`center`,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"><button type="button" class="${o(`primary`,`sm`)} wui-tour-end-button" data-wui="${i}"></button></div>`,a.querySelector(`.wui-tour-end-title`).textContent=t.title,a.querySelector(`.wui-tour-end-message`).textContent=t.message,a.querySelector(`.wui-tour-end-button`).textContent=t.button,a}function de(e,t,n){let r=e.ownerDocument,i=e.getRootNode()===r,a=e.querySelector(`.wui-tour-card:not(.wui-tour-end)`),o=e.querySelector(`.wui-tour-spot`),s=e.querySelector(`[role=status]`),c=ue(r,t,i),l=c.querySelector(`.wui-tour-end-button`),u=new AbortController;return new Promise(d=>{let f=()=>{u.abort(),d()};if(n?.aborted){f();return}let p={signal:u.signal};n?.addEventListener(`abort`,f,p),l.addEventListener(`click`,f,p),r.addEventListener(`keydown`,e=>{e.altKey||e.ctrlKey||e.metaKey||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),f()):e.key===`Tab`&&i&&(e.preventDefault(),l.focus()))},{capture:!0,signal:u.signal}),i&&r.addEventListener(`focusin`,e=>{c.contains(e.target)||l.focus()},p);let m=()=>{u.signal.aborted||(a.hidden=!0,L(o,a,null),e.append(c),E(c),s.textContent=[t.title,t.message].filter(Boolean).join(`. `),l.focus())},h=D(a);h?h.then(m):m()})}var fe=` :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-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-secondary { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-secondary: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 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 120ms linear; } .wui-tour-layer[data-state=leaving] { transition: opacity 120ms linear; } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in 120ms 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-media=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); } @keyframes wui-tour-pulse { from { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 85%, transparent); } to { box-shadow: 0 0 0 14px color-mix(in srgb, var(--color-primary) 0%, transparent); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-spot[data-advance]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; corner-shape: inherit; pointer-events: none; animation: wui-tour-pulse 600ms var(--wui-ease-out) var(--wui-tour-spot-duration); } } @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-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-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check 300ms var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + 120ms) both; } } `,G=`wui-tour-media`,pe=`wui-tour-media-toggle`,K=`http://www.w3.org/2000/svg`,me=`M6 5h4v14H6zM14 5h4v14h-4z`,he=`M8 5v14l11-7z`,ge={pause:`Pause animation`,play:`Play animation`},_e=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function ve(e){let t=document.createElementNS(K,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(K,`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 be(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 xe(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=pe;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(ve(r?me:he))};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 Se(e){let t=e.querySelector(`:scope > .${G}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function Ce(e,t,n=ge){if(Se(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=G,t.mediaType===`video`){let e=be(t,!_e());r.append(e,xe(e,n))}else r.appendChild(ye(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var q=`data-wui-tour-open`,we=`Step {current} of {total}`;function Te(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 Ee(e,t,n){return(e.getAttribute(`progress-label`)||we).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function De(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);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;)a.lastElementChild.remove();for(let e=0;e<o.length;e++)o[e].toggleAttribute(`data-filled`,e<n)}var Oe=`wui-tour-step`,ke=`wui-tour-host`,Ae=`wui-tour-seen:`,J=`data-tracking`,je={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`},Y={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`},Me=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],X={index:null,position:null,total:null},Ne=0;function Pe(e=Ae,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var Z=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Q=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Fe=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Ie(e){$||($=new CSSStyleSheet,$.replaceSync(fe)),e.adoptedStyleSheets=[$]}var Le=class extends t{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 > ${Oe}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:e.textContent.trim()};for(let[n,r]of Me)e.hasAttribute(r)&&(t[n]=e.getAttribute(r));return t})}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Pe():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Y[e])||je[e]}_endDialogText(){return this.getAttribute(`end-dialog`)===`false`?null:{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`)}}_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=Te(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!Z(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target);if(Z(t))return this._progress.position(i),{index:i,target:t};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-${++Ne}`,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="${o(`outline-secondary`,`sm`)} wui-tour-back" data-wui="${i}"></button> <button type="button" class="${o(`primary`,`sm`)} wui-tour-next" data-wui="${i}"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let r=t;this._shadow=null,this.isolated&&(r=document.createElement(ke),this._shadow=r.attachShadow({mode:`open`}),Ie(this._shadow),this._shadow.appendChild(t)),document.body.appendChild(r),document.documentElement.setAttribute(q,``),this._outer=r,this._layer=t,this._spot=t.querySelector(`.wui-tour-spot`),this._card=t.querySelector(`.wui-tour-card`),this._live=t.querySelector(`[role=status]`),this._card.querySelector(`.wui-tour-skip`).addEventListener(`click`,()=>this._close(`skipped`,`button`)),this._card.querySelector(`.wui-tour-back`).addEventListener(`click`,()=>this._move(-1)),this._card.querySelector(`.wui-tour-next`).addEventListener(`click`,()=>this._move(1)),this._shadow&&this._card.removeAttribute(`aria-modal`),this._onKey=e=>this._key(e),this._onFocusIn=e=>{if(!this._layer||this._ending)return;let t=this._current,n=t?this._steps[t.index]:null;_(this._layer,n,t?.target??null,e.target)||this._card.focus()},document.addEventListener(`keydown`,this._onKey,!0),this._shadow||document.addEventListener(`focusin`,this._onFocusIn),n(r,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_show(e){this._current=e;let{index:t,target:n}=e,r=this._steps[t],i=this._card,a=this._progress.position(t),o=this._progress.total(),s=a===o&&!this._endDialogText(),c=Ee(this,a,o);De(i,{text:c,position:a,total:o}),Ce(i,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)});let l=g(this,{layer:this._layer,spot:this._spot,card:i},r,n),u=i.querySelector(`.wui-tour-title`);u.textContent=r.title||``,u.hidden=!r.title,i.querySelector(`.wui-tour-text`).textContent=r.description||``,i.querySelector(`.wui-tour-skip`).textContent=this._label(`skip`),i.querySelector(`.wui-tour-back`).textContent=this._label(`back`),i.querySelector(`.wui-tour-back`).hidden=t<=this._firstIndex,i.querySelector(`.wui-tour-next`).textContent=this._label(s?`done`:`next`);let d=[c,r.title,r.description].filter(Boolean).join(`. `);this._live.textContent=l?[d,l].join(/[.!?]$/.test(d)?` `:`. `):d,I(i,n),this._spot.removeAttribute(J),this._place(),E(i),this._unbindAdvance?.(),this._unbindAdvance=ne(r,n,()=>this._move(1));let f=this._active();(i.contains(f)?!f.hidden:this._shadow!==null&&Q(Fe()))||i.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:a,total:o}}))}_place(){this._current&&this._layer&&L(this._spot,this._card,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot.style.cssText;this._place(),this._spot.style.cssText!==e&&this._spot.setAttribute(J,``)}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=D(this._card);if(e&&await e,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText();if(e&&await this._showEnd(e),n!==this._run)return;await this._close(`finished`)}}finally{this._moving=!1}}_showEnd(e){return this._unbindAdvance?.(),this._unbindAdvance=null,g(this,{layer:this._layer,spot:this._spot,card:this._card},null,null),this._spot.removeAttribute(J),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),de(this._layer,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(Q(e.composedPath?.()[0]??e.target))return;e.preventDefault(),e.key===`ArrowRight`?this._move(1):this._current.index>this._firstIndex&&this._move(-1)}else if(e.key===`Tab`&&!this._shadow){let{index:t,target:n}=this._current;v(e,{card:this._card,active:this._active(),step:this._steps[t],target:n})}}}_teardown(){if(!this._layer)return;document.removeEventListener(`keydown`,this._onKey,!0),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,r(this._outer),oe(this._outer),document.documentElement.removeAttribute(q),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let t=this._returnFocus;this._returnFocus=null,e&&t?.isConnected&&t.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()}:X,a=this._seenMark;this._teardown();try{n===this._run&&await(a??this._markSeen(e))}finally{this._finish(e,i,t)}}_finish(e,t=X,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}}))}},Re=class extends t{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};e(`wui-tour`,Le),e(`wui-tour-step`,Re)})();
|
|
1
|
+
(function(){function e(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 e of Object.keys(r)){let i=Object.getOwnPropertyDescriptor(t.prototype,e);i&&(i.set||i.get)&&(n.push([r,e,r[e]]),delete r[e])}customElements.define(e,t);for(let[e,t,r]of n)e[t]=r}var t=typeof HTMLElement>`u`?class{}:HTMLElement;function n(e,t){r(e),e._reanchor=t,e._reanchorScroll=n=>{n.target instanceof Node&&typeof e.contains==`function`&&e.contains(n.target)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function r(e){e?._reanchor&&(window.removeEventListener(`resize`,e._reanchor),window.removeEventListener(`scroll`,e._reanchorScroll,!0),e._reanchor=null,e._reanchorScroll=null)}var i=`AppButton`,a={primary:`btn-primary`,soft:`btn-soft-primary`,outline:`btn-outline-primary`,ghost:`btn-ghost-primary`,text:`btn-link-primary`,danger:`btn-danger`,success:`btn-success`,"outline-danger":`btn-outline-danger`,light:`btn-neutral`,warning:`btn-warning`,neutral:`btn-soft-neutral`,"outline-light":`btn-glass`,"outline-secondary":`btn-outline-neutral`};function o(e=`primary`,t=`md`){let n=a[e];if(!n)throw Error(`buttonClass: unknown variant "${e}"`);return t===`md`?`btn ${n}`:`btn ${n} btn-${t}`}var s=`data-advance`,c=`wui-tour-hint`,l=`Click {actionName} to continue.`,u=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,d=(e,t)=>e?.advanceOn===`click`&&!!t,f=e=>(e??``).replace(/\s+/g,` `).trim();function p(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e.tagName===`INPUT`&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(e.labels??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=f(e);if(t)return t}return``}function m(e){for(let t of[e,...e.querySelectorAll(u)])if(t.tabIndex>=0&&!t.disabled)return t;return null}function h(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 ee(e,t){let n=e.querySelector(`.${c}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;t?(n||(n=e.ownerDocument.createElement(`p`),n.className=c,i&&(n.id=i),e.querySelector(`.wui-tour-actions`).before(n)),n.textContent=t,i&&h(e,i,!0)):(n?.remove(),i&&h(e,i,!1))}var te=e=>getComputedStyle(e).animationName;function g(e,{layer:t,spot:n,card:r},i,a){let o=d(i,a);t.toggleAttribute(s,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(s)&&(n.removeAttribute(s),o&&te(n)),o&&n.setAttribute(s,``);let c=r.querySelector(`.wui-tour-next`);c.classList.toggle(`btn-primary`,!o),c.classList.toggle(`btn-link`,o);let u=o?f(i.actionLabel)||p(a):``,m=e.getAttribute(`advance-label`)||l,h=u?m.replace(/\{actionName\}/g,()=>u):``;return ee(r,h),h}function ne(e,t,n){if(!d(e,t))return()=>{};let r=null,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function _(e,t,n,r){return e.contains(r)||d(t,n)&&n.contains(r)}function v(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=d(r,i)?m(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i.contains(n));e.preventDefault(),a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length].focus()}var re=2/3,ie=1e3,ae=new Set([`top`,`left`,`width`,`height`]),y=new WeakMap,b=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],x=e=>e.transitionProperty===`opacity`,S=e=>ae.has(e.transitionProperty),C=e=>typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function w(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,ie);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function T(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?b(t,S):[]){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*re-r)}return n}function E(e){let t=T(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={};y.set(e,n);let r=()=>{y.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=b(e,C);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function D(e){return e.dataset.state=`leaving`,w(b(e,x))}function oe(e){let t=e.classList.contains(`wui-tour-layer`)?e:e.shadowRoot?.querySelector(`.wui-tour-layer`);t&&(t.dataset.state=`leaving`);let n=t?w(b(t,x)):null;n?(e.setAttribute(`inert`,``),n.then(()=>e.remove())):e.remove()}var se=2,O=12,k=8,A=4,j=20,ce=`(max-width: 575.98px)`,le=[`bottom`,`top`,`right`,`left`],M=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],N,P=(e,t,n)=>Math.max(t,Math.min(e,n)),F=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function I(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=H(e),r=e.offsetHeight+O;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+se}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function L(e,t,n){let r=e.style,i=t.style,a=U(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 M)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`,R(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=H(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-O,top:o.top-O-l.top,right:l.right-o.right-O,left:o.left-O-l.left},f=window.matchMedia(ce).matches,p=le.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+k)-Math.max(o.top,l.top-k);p?z(t,a,p,o,l,c):m>=Math.min(c.height,u)+8?B(t,a,o,l,c):V(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function R(e,t){N??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of M)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),N&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function z(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=F(r.left,r.right,i.left,i.right);s=P(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+O:r.top-O-a.height,l=P(e-s,j,a.width-j)}else{let e=F(r.top,r.bottom,i.top,i.bottom);c=P(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+O:r.left-O-a.width,l=P(e-c,j,a.height-j)}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 B(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)-A;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${P(n.left+A,r.left,r.right-i.width)}px`}function V(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+O:r.top-O-c}px`;let l=F(r.left,r.right,i.left,i.right);e.style.left=`${P(l-a.width/2,i.left,i.right-a.width)}px`}function H(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e])||0;return{top:r(`paddingTop`)+k,bottom:window.innerHeight-r(`paddingBottom`)-k,left:r(`paddingLeft`)+k,right:window.innerWidth-r(`paddingRight`)-k}}function U(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);return t||(t=document.createElement(`span`),t.className=`wui-tour-arrow`,t.setAttribute(`aria-hidden`,`true`),t.hidden=!0,e.append(t)),t}var W=0;function ue(e,t,n){let r=`wui-tour-end-${++W}`,a=e.createElement(`div`);return a.className=`wui-tour-card wui-tour-end`,a.dataset.layout=`center`,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"><button type="button" class="${o(`primary`,`sm`)} wui-tour-end-button" data-wui="${i}"></button></div>`,a.querySelector(`.wui-tour-end-title`).textContent=t.title,a.querySelector(`.wui-tour-end-message`).textContent=t.message,a.querySelector(`.wui-tour-end-button`).textContent=t.button,a}function de(e,t,n){let r=e.ownerDocument,i=e.getRootNode()===r,a=e.querySelector(`.wui-tour-card:not(.wui-tour-end)`),o=e.querySelector(`.wui-tour-spot`),s=e.querySelector(`[role=status]`),c=ue(r,t,i),l=c.querySelector(`.wui-tour-end-button`),u=new AbortController;return new Promise(d=>{let f=()=>{u.abort(),d()};if(n?.aborted){f();return}let p={signal:u.signal};n?.addEventListener(`abort`,f,p),l.addEventListener(`click`,f,p),r.addEventListener(`keydown`,e=>{e.altKey||e.ctrlKey||e.metaKey||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),f()):e.key===`Tab`&&i&&(e.preventDefault(),l.focus()))},{capture:!0,signal:u.signal}),i&&r.addEventListener(`focusin`,e=>{c.contains(e.target)||l.focus()},p);let m=()=>{u.signal.aborted||(a.hidden=!0,L(o,a,null),e.append(c),E(c),s.textContent=[t.title,t.message].filter(Boolean).join(`. `),l.focus())},h=D(a);h?h.then(m):m()})}var fe=` :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-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 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 120ms linear; } .wui-tour-layer[data-state=leaving] { transition: opacity 120ms linear; } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in 120ms 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-media=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); } @keyframes wui-tour-pulse { from { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 85%, transparent); } to { box-shadow: 0 0 0 14px color-mix(in srgb, var(--color-primary) 0%, transparent); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-spot[data-advance]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; corner-shape: inherit; pointer-events: none; animation: wui-tour-pulse 600ms var(--wui-ease-out) var(--wui-tour-spot-duration); } } @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-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-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check 300ms var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + 120ms) both; } } `,G=`wui-tour-media`,pe=`wui-tour-media-toggle`,K=`http://www.w3.org/2000/svg`,me=`M6 5h4v14H6zM14 5h4v14h-4z`,he=`M8 5v14l11-7z`,ge={pause:`Pause animation`,play:`Play animation`},_e=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function ve(e){let t=document.createElementNS(K,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(K,`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 be(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 xe(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=pe;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(ve(r?me:he))};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 Se(e){let t=e.querySelector(`:scope > .${G}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function Ce(e,t,n=ge){if(Se(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=G,t.mediaType===`video`){let e=be(t,!_e());r.append(e,xe(e,n))}else r.appendChild(ye(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var q=`data-wui-tour-open`,we=`Step {current} of {total}`;function Te(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 Ee(e,t,n){return(e.getAttribute(`progress-label`)||we).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function De(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);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;)a.lastElementChild.remove();for(let e=0;e<o.length;e++)o[e].toggleAttribute(`data-filled`,e<n)}var Oe=`wui-tour-step`,ke=`wui-tour-host`,Ae=`wui-tour-seen:`,J=`data-tracking`,je={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`},Y={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`},Me=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],X={index:null,position:null,total:null},Ne=0;function Pe(e=Ae,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var Z=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Q=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Fe=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Ie(e){$||($=new CSSStyleSheet,$.replaceSync(fe)),e.adoptedStyleSheets=[$]}var Le=class extends t{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 > ${Oe}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:e.textContent.trim()};for(let[n,r]of Me)e.hasAttribute(r)&&(t[n]=e.getAttribute(r));return t})}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Pe():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Y[e])||je[e]}_endDialogText(){return this.getAttribute(`end-dialog`)===`false`?null:{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`)}}_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=Te(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!Z(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target);if(Z(t))return this._progress.position(i),{index:i,target:t};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-${++Ne}`,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="${o(`outline-secondary`,`sm`)} wui-tour-back" data-wui="${i}"></button> <button type="button" class="${o(`primary`,`sm`)} wui-tour-next" data-wui="${i}"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let r=t;this._shadow=null,this.isolated&&(r=document.createElement(ke),this._shadow=r.attachShadow({mode:`open`}),Ie(this._shadow),this._shadow.appendChild(t)),document.body.appendChild(r),document.documentElement.setAttribute(q,``),this._outer=r,this._layer=t,this._spot=t.querySelector(`.wui-tour-spot`),this._card=t.querySelector(`.wui-tour-card`),this._live=t.querySelector(`[role=status]`),this._card.querySelector(`.wui-tour-skip`).addEventListener(`click`,()=>this._close(`skipped`,`button`)),this._card.querySelector(`.wui-tour-back`).addEventListener(`click`,()=>this._move(-1)),this._card.querySelector(`.wui-tour-next`).addEventListener(`click`,()=>this._move(1)),this._shadow&&this._card.removeAttribute(`aria-modal`),this._onKey=e=>this._key(e),this._onFocusIn=e=>{if(!this._layer||this._ending)return;let t=this._current,n=t?this._steps[t.index]:null;_(this._layer,n,t?.target??null,e.target)||this._card.focus()},document.addEventListener(`keydown`,this._onKey,!0),this._shadow||document.addEventListener(`focusin`,this._onFocusIn),n(r,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_show(e){this._current=e;let{index:t,target:n}=e,r=this._steps[t],i=this._card,a=this._progress.position(t),o=this._progress.total(),s=a===o&&!this._endDialogText(),c=Ee(this,a,o);De(i,{text:c,position:a,total:o}),Ce(i,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)});let l=g(this,{layer:this._layer,spot:this._spot,card:i},r,n),u=i.querySelector(`.wui-tour-title`);u.textContent=r.title||``,u.hidden=!r.title,i.querySelector(`.wui-tour-text`).textContent=r.description||``,i.querySelector(`.wui-tour-skip`).textContent=this._label(`skip`),i.querySelector(`.wui-tour-back`).textContent=this._label(`back`),i.querySelector(`.wui-tour-back`).hidden=t<=this._firstIndex,i.querySelector(`.wui-tour-next`).textContent=this._label(s?`done`:`next`);let d=[c,r.title,r.description].filter(Boolean).join(`. `);this._live.textContent=l?[d,l].join(/[.!?]$/.test(d)?` `:`. `):d,I(i,n),this._spot.removeAttribute(J),this._place(),E(i),this._unbindAdvance?.(),this._unbindAdvance=ne(r,n,()=>this._move(1));let f=this._active();(i.contains(f)?!f.hidden:this._shadow!==null&&Q(Fe()))||i.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:a,total:o}}))}_place(){this._current&&this._layer&&L(this._spot,this._card,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot.style.cssText;this._place(),this._spot.style.cssText!==e&&this._spot.setAttribute(J,``)}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=D(this._card);if(e&&await e,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText();if(e&&await this._showEnd(e),n!==this._run)return;await this._close(`finished`)}}finally{this._moving=!1}}_showEnd(e){return this._unbindAdvance?.(),this._unbindAdvance=null,g(this,{layer:this._layer,spot:this._spot,card:this._card},null,null),this._spot.removeAttribute(J),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),de(this._layer,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(Q(e.composedPath?.()[0]??e.target))return;e.preventDefault(),e.key===`ArrowRight`?this._move(1):this._current.index>this._firstIndex&&this._move(-1)}else if(e.key===`Tab`&&!this._shadow){let{index:t,target:n}=this._current;v(e,{card:this._card,active:this._active(),step:this._steps[t],target:n})}}}_teardown(){if(!this._layer)return;document.removeEventListener(`keydown`,this._onKey,!0),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,r(this._outer),oe(this._outer),document.documentElement.removeAttribute(q),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let t=this._returnFocus;this._returnFocus=null,e&&t?.isConnected&&t.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()}:X,a=this._seenMark;this._teardown();try{n===this._run&&await(a??this._markSeen(e))}finally{this._finish(e,i,t)}}_finish(e,t=X,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}}))}},Re=class extends t{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};e(`wui-tour`,Le),e(`wui-tour-step`,Re)})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.130.1",
|
|
4
4
|
"description": "Webority framework-agnostic UI custom elements (<wui-*>) — the single implementation of the interactive components, styled by @webority/theme. Used natively in Razor and wrapped by @webority/ui-react.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -19,10 +19,7 @@
|
|
|
19
19
|
"module": "./dist/ui-elements.js",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": "./dist/ui-elements.js",
|
|
22
|
-
"./global": "./dist/ui-elements.global.js",
|
|
23
|
-
"./phone-data": "./dist/ui-phone.global.js",
|
|
24
22
|
"./helpers": "./dist/helpers.js",
|
|
25
|
-
"./listQuery": "./dist/listQuery.js",
|
|
26
23
|
"./server": "./dist/server.js",
|
|
27
24
|
"./elements/autocomplete": "./dist/elements/autocomplete.js",
|
|
28
25
|
"./elements/carousel": "./dist/elements/carousel.js",
|
|
@@ -72,9 +69,6 @@
|
|
|
72
69
|
"./elements/truncate": "./dist/elements/truncate.js",
|
|
73
70
|
"./elements/whats-new": "./dist/elements/whats-new.js",
|
|
74
71
|
"./elements/wizard": "./dist/elements/wizard.js",
|
|
75
|
-
"./consent-banner": "./dist/ui-consent-banner.global.js",
|
|
76
|
-
"./lead-popup": "./dist/ui-lead-popup.global.js",
|
|
77
|
-
"./tour": "./dist/ui-tour.global.js",
|
|
78
72
|
"./file-viewer": "./dist/ui-file-viewer.js",
|
|
79
73
|
"./chart": "./dist/ui-chart.js",
|
|
80
74
|
"./calendar": "./dist/ui-calendar.js",
|
|
@@ -98,7 +92,7 @@
|
|
|
98
92
|
"@tiptap/markdown": "3.31.4",
|
|
99
93
|
"@tiptap/starter-kit": "3.31.4",
|
|
100
94
|
"@vitest/coverage-v8": "5.0.1",
|
|
101
|
-
"@webority/markdown-core": "0.
|
|
95
|
+
"@webority/markdown-core": "0.130.1",
|
|
102
96
|
"echarts": "6.1.0",
|
|
103
97
|
"jsdom": "30.1.1",
|
|
104
98
|
"libphonenumber-js": "^1.13.9",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./buttonClass-FD57QNey.js";import{n}from"./devWarn-DXdRWZs3.js";import{t as r}from"./elementBase-DV9IZZCu.js";import{t as i}from"./tourOpenMark-nPeAJFSo.js";var a={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-text":`#4F46E5`,"--color-on-primary":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-modal":`0px 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-fixed":`1030`},o=e=>`var(${e}, ${a[e]})`,s=` :host { all: initial; position: fixed; bottom: 20px; left: 20px; right: auto; z-index: ${o(`--wui-z-fixed`)}; display: block; width: 420px; max-width: calc(100vw - 40px); font-family: inherit; font-size: 16px; line-height: 1.5; color: ${o(`--color-text`)}; } :host([position="bottom-right"]) { right: 20px; left: auto; } :host([position="bar"]) { left: 0; right: 0; bottom: 0; width: auto; max-width: none; } :host([position="bar"]) .wui-consent-banner-panel { padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)); border-width: 1px 0 0; border-radius: 0; } :host(:not([open])) { pointer-events: none; } :host([tour-open]) { visibility: hidden; } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .wui-consent-banner-panel { padding: 20px; background: ${o(`--color-surface`)}; border: 1px solid ${o(`--color-border`)}; border-radius: ${o(`--wui-radius-lg`)}; box-shadow: ${o(`--wui-shadow-modal`)}; text-align: start; pointer-events: auto; } .wui-consent-banner-heading { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: ${o(`--color-text`)}; } .wui-consent-banner-description { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: ${o(`--color-text-muted`)}; } .wui-consent-banner-policy { color: ${o(`--color-primary-text`)}; font-weight: 500; } .wui-consent-banner-settings { display: grid; gap: 12px; max-height: 50vh; margin: 0 0 16px; padding: 12px 0; overflow-y: auto; border-top: 1px solid ${o(`--color-border`)}; border-bottom: 1px solid ${o(`--color-border`)}; } .wui-consent-banner-category-description { margin: 2px 0 0; padding-inline-start: 2.5em; font-size: 12px; line-height: 1.4; color: ${o(`--color-text-muted`)}; } .form-check { display: flex; align-items: center; gap: 0.5em; margin: 0; font-size: 14px; } .form-check-input { appearance: none; flex: none; width: 2em; height: 1em; margin: 0; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2em; background: ${o(`--color-surface`)} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat; cursor: pointer; transition: background-position 0.15s ease-in-out; } .form-check-input:checked { border-color: ${o(`--color-primary`)}; background: ${o(`--color-primary`)} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat; } .form-check-input:disabled { opacity: 0.5; cursor: default; } .form-check-input:focus-visible { outline: 2px solid ${o(`--color-primary`)}; outline-offset: 2px; } .form-check-label { cursor: pointer; } .wui-consent-banner-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } .btn { display: inline-block; 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; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid ${o(`--color-primary`)}; outline-offset: 2px; } .btn-primary { background: ${o(`--color-primary`)}; border-color: ${o(`--color-primary`)}; color: ${o(`--color-on-primary`)}; } .btn-primary:hover { background: ${o(`--color-primary-hover`)}; border-color: ${o(`--color-primary-hover`)}; } .btn-outline-secondary { border-color: ${o(`--color-text-muted`)}; color: ${o(`--color-text-muted`)}; } .btn-outline-secondary:hover { background: ${o(`--color-bg-muted`)}; color: ${o(`--color-text`)}; } .btn-link { font-weight: 400; color: ${o(`--color-primary-text`)}; text-decoration: underline; } .btn-link:hover { color: ${o(`--color-primary-hover`)}; } .wui-consent-banner-settings-toggle { margin-inline-end: auto; padding-inline: 0; } .wui-consent-banner-save { flex: 1 1 100%; } @media (max-width: 575.98px) { :host, :host([position="bottom-right"]) { left: 0; right: 0; bottom: 0; width: auto; max-width: none; } .wui-consent-banner-panel { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-width: 1px 0 0; border-radius: 0; } /* Hidden on phones, but it stays the dialog's accessible name. */ .wui-consent-banner-heading { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } .wui-consent-banner-description { margin: 0 0 8px; font-size: 13px; line-height: 1.4; } .wui-consent-banner-actions { gap: 6px; } } @media (min-width: 576px) { :host([position="bar"]) .wui-consent-banner-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; } /* Hidden on the bar, but it stays the dialog's accessible name. */ :host([position="bar"]) .wui-consent-banner-heading { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } :host([position="bar"]) .wui-consent-banner-description { margin: 0; flex: 1 1 320px; } :host([position="bar"]) .wui-consent-banner-actions { flex: none; } :host([position="bar"]) .wui-consent-banner-settings { flex-basis: 100%; margin: 0; } } /* The actions are small buttons, which fall under the 44px touch target on touch screens. This sheet's .btn is inline-block, so it centres the label itself. */ @media (max-width: 575.98px), (pointer: coarse) { .wui-consent-banner-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; } } `,c=`wui-consent-save`,l=`[data-consent-settings]`,u=`tour-open`,d=`--wui-consent-banner-block`,f=`--wui-consent-banner-inline`,p={heading:`Cookies on this site`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,policyLabel:`Cookie policy`,essentialLabel:`Essential cookies`,essentialDescription:`Required for the site to work and stay secure. Always on.`,analyticsLabel:`Analytics cookies`,analyticsDescription:`Help us understand how visitors use the site.`,functionalLabel:`Functional cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,marketingLabel:`Marketing cookies`,marketingDescription:`Measure how well our campaigns work.`,settingsLabel:`Cookie settings`,rejectLabel:`Reject all`,acceptLabel:`Accept all`,saveLabel:`Save preferences`},m=[`analytics`,`functional`,`marketing`],h={analytics:{label:p.analyticsLabel,description:`analyticsDescription`},functional:{label:p.functionalLabel,description:`functionalDescription`},marketing:{label:p.marketingLabel,description:`marketingDescription`}},g=/* @__PURE__ */ new Set;function _(e){g.has(e)||(g.add(e),n(`[@webority/ui-elements] <wui-consent-banner> received categories containing "${e}", which is not one of ${m.map(e=>`"${e}"`).join(` | `)}. It is ignored.`))}var v=0,y=null;function b(e){y||(y=new CSSStyleSheet,y.replaceSync(s)),e.adoptedStyleSheets=[y]}var x=class extends r{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`,`categories`]}constructor(){super(),v+=1,this._uid=`wui-consent-${v}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(l)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null,this._roomObserver=null,this._onWindowResize=()=>this._reserveRoom()}get position(){let e=this.getAttribute(`position`);return e===`bottom-right`||e===`bar`?e:`bottom-left`}set position(e){this.setAttribute(`position`,String(e??`bottom-left`))}get standalone(){return this.hasAttribute(`standalone`)}set standalone(e){this.toggleAttribute(`standalone`,e===!0||e===``||e===`true`)}get preview(){return this.hasAttribute(`preview`)}set preview(e){this.toggleAttribute(`preview`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||p.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||p.description}set description(e){this.setAttribute(`description`,String(e??``))}get policyHref(){return this.getAttribute(`policy-href`)||``}set policyHref(e){this.setAttribute(`policy-href`,String(e??``))}get policyLabel(){return this.getAttribute(`policy-label`)||p.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||p.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||p.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||p.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get categories(){let e=this.getAttribute(`categories`);if(!e?.trim())return[...m];let t=e.split(/\s+/).filter(Boolean);for(let e of t)m.includes(e)||_(e);let n=m.filter(e=>t.includes(e));return n.length?n:[...m]}set categories(e){e==null?this.removeAttribute(`categories`):this.setAttribute(`categories`,Array.isArray(e)?e.join(` `):String(e))}get preferences(){let e=this.categories;return Object.fromEntries(m.map(t=>[t,e.includes(t)&&this._preferences[t]]))}set preferences(e){this._preferences={analytics:e?.analytics===!0,functional:e?.functional===!0,marketing:e?.marketing===!0},this._applyPreferences()}get isOpen(){return this.hasAttribute(`open`)}connectedCallback(){this._rendered||this.render(),document.addEventListener(`click`,this._onDocumentClick),this._syncTour(),this._tourWatch??=new MutationObserver(()=>this._syncTour()),this._tourWatch.observe(document.documentElement,{attributes:!0,attributeFilter:[i]}),this.preview&&!this.isOpen&&this.open(),this.isOpen&&this._trackRoom()}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect(),this._untrackRoom()}_syncTour(){this.toggleAttribute(u,document.documentElement.hasAttribute(i))}attributeChangedCallback(){this._rendered&&this.render()}render(){let n=this.isOpen,r=this._uid,i=this.policyHref?` <a class="wui-consent-banner-policy" href="${w(this.policyHref)}">${C(this.policyLabel)}</a>`:``,a=this._root();a!==this&&b(a),a.innerHTML=` <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${r}-heading" aria-describedby="${r}-description" hidden> <h2 class="wui-consent-banner-heading" id="${r}-heading">${C(this.heading)}</h2> <p class="wui-consent-banner-description" id="${r}-description">${C(this.description)}${i}</p> <div class="wui-consent-banner-settings" hidden> ${S(r,`essential`,p.essentialLabel,p.essentialDescription,!0)} ${this.categories.map(e=>S(r,e,h[e].label,this[h[e].description],!1)).join(` `)} </div> <div class="wui-consent-banner-actions"> <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${p.settingsLabel}</button> <button type="button" class="${e(`outline-secondary`,`sm`)} wui-consent-banner-reject" data-wui="${t}">${p.rejectLabel}</button> <button type="button" class="${e(`primary`,`sm`)} wui-consent-banner-accept" data-wui="${t}">${p.acceptLabel}</button> <button type="button" class="${e(`primary`,`sm`)} wui-consent-banner-save" hidden data-wui="${t}">${p.saveLabel}</button> </div> </div>`,this._rendered=!0,this._wire(),this._applyPreferences(),this._showSettings(this._settings),n&&(this._panel().hidden=!1)}open({settings:e=!1,focus:t=!1}={}){this._rendered||this.render(),this._applyPreferences(),this._showSettings(e),this._panel().hidden=!1,this.setAttribute(`open`,``),this._trackRoom(),t&&(e?this._root().querySelector(`.wui-consent-banner-category input:not([disabled])`):this._root().querySelector(`.wui-consent-banner-accept`))?.focus()}close(){let e=this._panel();e&&(e.hidden=!0),this.removeAttribute(`open`),this._showSettings(!1),this._untrackRoom()}_trackRoom(){this.isConnected&&!this.preview&&(typeof ResizeObserver<`u`&&(this._roomObserver??=new ResizeObserver(()=>this._reserveRoom()),this._roomObserver.observe(this)),window.addEventListener(`resize`,this._onWindowResize),this._reserveRoom())}_untrackRoom(){this._roomObserver?.disconnect(),window.removeEventListener(`resize`,this._onWindowResize),document.documentElement.style.removeProperty(d),document.documentElement.style.removeProperty(f)}_reserveRoom(){let e=this.getBoundingClientRect(),t=this.position===`bar`?0:this.position===`bottom-right`?window.innerWidth-e.left:e.right,n=document.documentElement.style;n.setProperty(d,`${Math.ceil(window.innerHeight-e.top)}px`),n.setProperty(f,`${Math.ceil(t)}px`)}_root(){return this.shadowRoot?this.shadowRoot:this.standalone?this.attachShadow({mode:`open`}):this}_panel(){return this._root().querySelector(`.wui-consent-banner-panel`)}_wire(){let e=this._root();e.querySelector(`.wui-consent-banner-accept`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!0))),e.querySelector(`.wui-consent-banner-reject`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!1))),e.querySelector(`.wui-consent-banner-save`)?.addEventListener(`click`,()=>this._save(this._switchValues())),e.querySelector(`.wui-consent-banner-settings-toggle`)?.addEventListener(`click`,()=>this._showSettings(!this._settings))}_save(e){this._preferences={...e},this.dispatchEvent(new CustomEvent(c,{bubbles:!0,composed:!0,detail:{...e}})),this.close()}_choiceForShown(e){let t=this.categories;return Object.fromEntries(m.map(n=>[n,e&&t.includes(n)]))}_switchValues(){let e={};for(let t of m)e[t]=this._root().querySelector(`input[data-category="${t}"]`)?.checked===!0;return e}_applyPreferences(){for(let e of m){let t=this._root().querySelector(`input[data-category="${e}"]`);t&&(t.checked=this._preferences[e])}}_showSettings(e){this._settings=e;let t=this._root(),n=t.querySelector(`.wui-consent-banner-settings`);if(!n)return;n.hidden=!e,t.querySelector(`.wui-consent-banner-settings-toggle`)?.setAttribute(`aria-expanded`,e?`true`:`false`);let r=t.querySelector(`.wui-consent-banner-save`);r&&(r.hidden=!e);for(let n of[`.wui-consent-banner-reject`,`.wui-consent-banner-accept`]){let r=t.querySelector(n);r&&(r.hidden=e)}}};function S(e,t,n,r,i){let a=`${e}-${t}`;return`<div class="wui-consent-banner-category"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i?` checked disabled`:``} /> <label class="form-check-label" for="${a}">${C(n)}</label> </div> <p class="wui-consent-banner-category-description">${C(r)}</p> </div>`}var C=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),w=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`);export{x as t};
|
package/dist/WuiTour-DjR-6kr5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./anchorOverlay-CBMAnDUt.js";import{n,t as r}from"./buttonClass-FD57QNey.js";import{t as i}from"./elementBase-DV9IZZCu.js";import{t as a}from"./tourOpenMark-nPeAJFSo.js";var o=`data-advance`,s=`wui-tour-hint`,c=`Click {actionName} to continue.`,l=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,u=(e,t)=>e?.advanceOn===`click`&&!!t,d=e=>(e??``).replace(/\s+/g,` `).trim();function f(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e.tagName===`INPUT`&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(e.labels??[],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 p(e){for(let t of[e,...e.querySelectorAll(l)])if(t.tabIndex>=0&&!t.disabled)return t;return null}function m(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 h(e,t){let n=e.querySelector(`.${s}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;t?(n||(n=e.ownerDocument.createElement(`p`),n.className=s,i&&(n.id=i),e.querySelector(`.wui-tour-actions`).before(n)),n.textContent=t,i&&m(e,i,!0)):(n?.remove(),i&&m(e,i,!1))}var ee=e=>getComputedStyle(e).animationName;function g(e,{layer:t,spot:n,card:r},i,a){let s=u(i,a);t.toggleAttribute(o,s&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(o)&&(n.removeAttribute(o),s&&ee(n)),s&&n.setAttribute(o,``);let l=r.querySelector(`.wui-tour-next`);l.classList.toggle(`btn-primary`,!s),l.classList.toggle(`btn-link`,s);let p=s?d(i.actionLabel)||f(a):``,m=e.getAttribute(`advance-label`)||c,g=p?m.replace(/\{actionName\}/g,()=>p):``;return h(r,g),g}function _(e,t,n){if(!u(e,t))return()=>{};let r=null,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function te(e,t,n,r){return e.contains(r)||u(t,n)&&n.contains(r)}function ne(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=u(r,i)?p(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i.contains(n));e.preventDefault(),a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length].focus()}var v=2/3,y=1e3,re=/* @__PURE__ */ new Set([`top`,`left`,`width`,`height`]),b=/* @__PURE__ */ new WeakMap,x=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],S=e=>e.transitionProperty===`opacity`,ie=e=>re.has(e.transitionProperty),ae=e=>typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function C(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,y);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function oe(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?x(t,ie):[]){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*v-r)}return n}function w(e){let t=oe(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={};b.set(e,n);let r=()=>{b.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=x(e,ae);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function T(e){return e.dataset.state=`leaving`,C(x(e,S))}function se(e){let t=e.classList.contains(`wui-tour-layer`)?e:e.shadowRoot?.querySelector(`.wui-tour-layer`);t&&(t.dataset.state=`leaving`);let n=t?C(x(t,S)):null;n?(e.setAttribute(`inert`,``),n.then(()=>e.remove())):e.remove()}var E=2,D=12,O=8,k=4,A=20,ce=`(max-width: 575.98px)`,le=[`bottom`,`top`,`right`,`left`],j=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],M,N=(e,t,n)=>Math.max(t,Math.min(e,n)),P=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function F(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=V(e),r=e.offsetHeight+D;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+E}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function I(e,t,n){let r=e.style,i=t.style,a=H(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 j)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`,L(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=V(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-D,top:o.top-D-l.top,right:l.right-o.right-D,left:o.left-D-l.left},f=window.matchMedia(ce).matches,p=le.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+O)-Math.max(o.top,l.top-O);p?R(t,a,p,o,l,c):m>=Math.min(c.height,u)+8?z(t,a,o,l,c):B(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function L(e,t){M??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of j)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),M&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function R(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=P(r.left,r.right,i.left,i.right);s=N(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+D:r.top-D-a.height,l=N(e-s,A,a.width-A)}else{let e=P(r.top,r.bottom,i.top,i.bottom);c=N(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+D:r.left-D-a.width,l=N(e-c,A,a.height-A)}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 z(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)-k;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${N(n.left+k,r.left,r.right-i.width)}px`}function B(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+D:r.top-D-c}px`;let l=P(r.left,r.right,i.left,i.right);e.style.left=`${N(l-a.width/2,i.left,i.right-a.width)}px`}function V(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e])||0;return{top:r(`paddingTop`)+O,bottom:window.innerHeight-r(`paddingBottom`)-O,left:r(`paddingLeft`)+O,right:window.innerWidth-r(`paddingRight`)-O}}function H(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);return t||(t=document.createElement(`span`),t.className=`wui-tour-arrow`,t.setAttribute(`aria-hidden`,`true`),t.hidden=!0,e.append(t)),t}var U=0;function W(e,t,i){let a=`wui-tour-end-${++U}`,o=e.createElement(`div`);return o.className=`wui-tour-card wui-tour-end`,o.dataset.layout=`center`,o.setAttribute(`role`,`dialog`),i&&o.setAttribute(`aria-modal`,`true`),o.tabIndex=-1,o.setAttribute(`aria-labelledby`,`${a}-title`),o.setAttribute(`aria-describedby`,`${a}-message`),o.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="${a}-title"></h2> <p class="wui-tour-text wui-tour-end-message" id="${a}-message"></p> <div class="wui-tour-actions"><button type="button" class="${n(`primary`,`sm`)} wui-tour-end-button" data-wui="${r}"></button></div>`,o.querySelector(`.wui-tour-end-title`).textContent=t.title,o.querySelector(`.wui-tour-end-message`).textContent=t.message,o.querySelector(`.wui-tour-end-button`).textContent=t.button,o}function ue(e,t,n){let r=e.ownerDocument,i=e.getRootNode()===r,a=e.querySelector(`.wui-tour-card:not(.wui-tour-end)`),o=e.querySelector(`.wui-tour-spot`),s=e.querySelector(`[role=status]`),c=W(r,t,i),l=c.querySelector(`.wui-tour-end-button`),u=new AbortController;return new Promise(d=>{let f=()=>{u.abort(),d()};if(n?.aborted){f();return}let p={signal:u.signal};n?.addEventListener(`abort`,f,p),l.addEventListener(`click`,f,p),r.addEventListener(`keydown`,e=>{e.altKey||e.ctrlKey||e.metaKey||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),f()):e.key===`Tab`&&i&&(e.preventDefault(),l.focus()))},{capture:!0,signal:u.signal}),i&&r.addEventListener(`focusin`,e=>{c.contains(e.target)||l.focus()},p);let m=()=>{u.signal.aborted||(a.hidden=!0,I(o,a,null),e.append(c),w(c),s.textContent=[t.title,t.message].filter(Boolean).join(`. `),l.focus())},h=T(a);h?h.then(m):m()})}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-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-secondary { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-secondary: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 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 120ms linear; } .wui-tour-layer[data-state=leaving] { transition: opacity 120ms linear; } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in 120ms 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-media=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); } @keyframes wui-tour-pulse { from { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 85%, transparent); } to { box-shadow: 0 0 0 14px color-mix(in srgb, var(--color-primary) 0%, transparent); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-spot[data-advance]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; corner-shape: inherit; pointer-events: none; animation: wui-tour-pulse 600ms var(--wui-ease-out) var(--wui-tour-spot-duration); } } @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-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-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check 300ms var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + 120ms) both; } } `,G=`wui-tour-media`,fe=`wui-tour-media-toggle`,K=`http://www.w3.org/2000/svg`,pe=`M6 5h4v14H6zM14 5h4v14h-4z`,me=`M8 5v14l11-7z`,q={pause:`Pause animation`,play:`Play animation`},he=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function ge(e){let t=document.createElementNS(K,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(K,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function _e(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 ve(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 ye(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=fe;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(ge(r?pe:me))};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 be(e){let t=e.querySelector(`:scope > .${G}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function xe(e,t,n=q){if(be(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=G,t.mediaType===`video`){let e=ve(t,!he());r.append(e,ye(e,n))}else r.appendChild(_e(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var Se=`Step {current} of {total}`;function Ce(e){let t=/* @__PURE__ */ 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 we(e,t,n){return(e.getAttribute(`progress-label`)||Se).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function Te(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);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;)a.lastElementChild.remove();for(let e=0;e<o.length;e++)o[e].toggleAttribute(`data-filled`,e<n)}var Ee=`wui-tour-step`,De=`wui-tour-host`,Oe=`wui-tour-seen:`,J=`data-tracking`,ke={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`},Ae={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`},je=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],Y={index:null,position:null,total:null},Me=0;function X(e=Oe,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var Z=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Q=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Ne=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Pe(e){$||($=new CSSStyleSheet,$.replaceSync(de)),e.adoptedStyleSheets=[$]}var Fe=class extends i{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 > ${Ee}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:e.textContent.trim()};for(let[n,r]of je)e.hasAttribute(r)&&(t[n]=e.getAttribute(r));return t})}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?X():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Ae[e])||ke[e]}_endDialogText(){return this.getAttribute(`end-dialog`)===`false`?null:{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`)}}_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=Ce(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!Z(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target);if(Z(t))return this._progress.position(i),{index:i,target:t};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 t=`wui-tour-${++Me}`,i=document.createElement(`div`);i.className=`wui-tour-layer`,i.innerHTML=` <div class="wui-tour-spot" aria-hidden="true"></div> <div class="wui-tour-card" role="dialog" aria-modal="true" tabindex="-1" aria-labelledby="${t}-title" aria-describedby="${t}-text"> <p class="wui-tour-position"></p> <h2 class="wui-tour-title" id="${t}-title"></h2> <p class="wui-tour-text" id="${t}-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="${n(`outline-secondary`,`sm`)} wui-tour-back" data-wui="${r}"></button> <button type="button" class="${n(`primary`,`sm`)} wui-tour-next" data-wui="${r}"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let o=i;this._shadow=null,this.isolated&&(o=document.createElement(De),this._shadow=o.attachShadow({mode:`open`}),Pe(this._shadow),this._shadow.appendChild(i)),document.body.appendChild(o),document.documentElement.setAttribute(a,``),this._outer=o,this._layer=i,this._spot=i.querySelector(`.wui-tour-spot`),this._card=i.querySelector(`.wui-tour-card`),this._live=i.querySelector(`[role=status]`),this._card.querySelector(`.wui-tour-skip`).addEventListener(`click`,()=>this._close(`skipped`,`button`)),this._card.querySelector(`.wui-tour-back`).addEventListener(`click`,()=>this._move(-1)),this._card.querySelector(`.wui-tour-next`).addEventListener(`click`,()=>this._move(1)),this._shadow&&this._card.removeAttribute(`aria-modal`),this._onKey=e=>this._key(e),this._onFocusIn=e=>{if(!this._layer||this._ending)return;let t=this._current,n=t?this._steps[t.index]:null;te(this._layer,n,t?.target??null,e.target)||this._card.focus()},document.addEventListener(`keydown`,this._onKey,!0),this._shadow||document.addEventListener(`focusin`,this._onFocusIn),e(o,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_show(e){this._current=e;let{index:t,target:n}=e,r=this._steps[t],i=this._card,a=this._progress.position(t),o=this._progress.total(),s=a===o&&!this._endDialogText(),c=we(this,a,o);Te(i,{text:c,position:a,total:o}),xe(i,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)});let l=g(this,{layer:this._layer,spot:this._spot,card:i},r,n),u=i.querySelector(`.wui-tour-title`);u.textContent=r.title||``,u.hidden=!r.title,i.querySelector(`.wui-tour-text`).textContent=r.description||``,i.querySelector(`.wui-tour-skip`).textContent=this._label(`skip`),i.querySelector(`.wui-tour-back`).textContent=this._label(`back`),i.querySelector(`.wui-tour-back`).hidden=t<=this._firstIndex,i.querySelector(`.wui-tour-next`).textContent=this._label(s?`done`:`next`);let d=[c,r.title,r.description].filter(Boolean).join(`. `);this._live.textContent=l?[d,l].join(/[.!?]$/.test(d)?` `:`. `):d,F(i,n),this._spot.removeAttribute(J),this._place(),w(i),this._unbindAdvance?.(),this._unbindAdvance=_(r,n,()=>this._move(1));let f=this._active();(i.contains(f)?!f.hidden:this._shadow!==null&&Q(Ne()))||i.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:a,total:o}}))}_place(){this._current&&this._layer&&I(this._spot,this._card,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot.style.cssText;this._place(),this._spot.style.cssText!==e&&this._spot.setAttribute(J,``)}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=T(this._card);if(e&&await e,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText();if(e&&await this._showEnd(e),n!==this._run)return;await this._close(`finished`)}}finally{this._moving=!1}}_showEnd(e){return this._unbindAdvance?.(),this._unbindAdvance=null,g(this,{layer:this._layer,spot:this._spot,card:this._card},null,null),this._spot.removeAttribute(J),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),ue(this._layer,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(Q(e.composedPath?.()[0]??e.target))return;e.preventDefault(),e.key===`ArrowRight`?this._move(1):this._current.index>this._firstIndex&&this._move(-1)}else if(e.key===`Tab`&&!this._shadow){let{index:t,target:n}=this._current;ne(e,{card:this._card,active:this._active(),step:this._steps[t],target:n})}}}_teardown(){if(!this._layer)return;document.removeEventListener(`keydown`,this._onKey,!0),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,t(this._outer),se(this._outer),document.documentElement.removeAttribute(a),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&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()}:Y,a=this._seenMark;this._teardown();try{n===this._run&&await(a??this._markSeen(e))}finally{this._finish(e,i,t)}}_finish(e,t=Y,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}}))}};export{X as n,Fe as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`AppButton`,t={primary:`btn-primary`,secondary:`btn-secondary`,outline:`btn-outline-primary`,ghost:`btn-ghost`,text:`btn-text`,danger:`btn-danger`,success:`btn-success`,"secondary-danger":`btn-secondary-danger`,"outline-danger":`btn-outline-danger`,light:`btn-light`,warning:`btn-warning`,neutral:`btn-neutral`,"outline-light":`btn-outline-light`,"outline-secondary":`btn-outline-secondary`};function n(e=`primary`,n=`md`){let r=t[e];if(!r)throw Error(`buttonClass: unknown variant "${e}"`);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}export{n,e as t};
|
package/dist/server-XVcnIJ_Y.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./buttonClass-FD57QNey.js";import{n,t as r}from"./devWarn-DXdRWZs3.js";import{l as i,s as a}from"./wuiHttp-DgnM7K2Q.js";import{E as o,k as s,r as c,w as l,y as u}from"./dataTable-CUILMcga.js";import{t as d}from"./iconGlyphs.g-DaOONrBK.js";import{LIST_QUERY_RESERVED as f,SEARCH_PARAM as p}from"./listQuery.js";function m(e,t){e&&(e.tip?.isConnected?(t.addEventListener(`hidden${e.constructor.EVENT_KEY}`,()=>e.dispose(),{once:!0}),e.hide()):e.dispose())}var h=Object.freeze({autocomplete:{entries:[`elements/autocomplete.js`],tags:[`wui-autocomplete`]},carousel:{entries:[`elements/carousel.js`],tags:[`wui-carousel`]},"code-block":{entries:[`elements/code-block.js`],tags:[`wui-code-block`]},"command-palette":{entries:[`elements/command-palette.js`],tags:[`wui-command-palette`]},"comment-thread":{entries:[`elements/comment-thread.js`],tags:[`wui-mention-input`,`wui-comment-thread`]},"consent-banner":{entries:[`elements/consent-banner.js`],tags:[`wui-consent-banner`]},"context-menu":{entries:[`elements/context-menu.js`],tags:[`wui-context-menu`]},"date-range":{entries:[`elements/date-range.js`],tags:[`wui-date-range`]},drawer:{entries:[`elements/drawer.js`],tags:[`wui-drawer`]},"image-crop":{entries:[`elements/image-crop.js`],tags:[`wui-image-crop`]},"inline-edit":{entries:[`elements/inline-edit.js`],tags:[`wui-inline-edit`]},kanban:{entries:[`elements/kanban.js`],tags:[`wui-kanban`]},"lead-popup":{entries:[`elements/lead-popup.js`],tags:[`wui-lead-popup`]},lightbox:{entries:[`elements/lightbox.js`],tags:[`wui-lightbox`]},markdown:{entries:[`elements/markdown.js`],tags:[`wui-markdown`]},multiselect:{entries:[`elements/multiselect.js`],tags:[`wui-multiselect`]},phone:{entries:[`elements/phone.js`,`elements/country-select.js`],tags:[`wui-phone`,`wui-country-select`]},resizable:{entries:[`elements/resizable.js`],tags:[`wui-resizable`]},"saved-views":{entries:[`elements/saved-views.js`],tags:[`wui-saved-views`]},slider:{entries:[`elements/slider.js`],tags:[`wui-slider`]},sortable:{entries:[`elements/sortable.js`],tags:[`wui-sortable`]},"status-icon":{entries:[`elements/status-icon.js`],tags:[`wui-status-icon`]},taginput:{entries:[`elements/taginput.js`],tags:[`wui-taginput`]},timepicker:{entries:[`elements/timepicker.js`],tags:[`wui-timepicker`]},tour:{entries:[`elements/tour.js`],tags:[`wui-tour`]},tree:{entries:[`elements/tree.js`],tags:[`wui-tree`]},wizard:{entries:[`elements/wizard.js`],tags:[`wui-wizard-step`,`wui-wizard`]},chart:{file:`ui-chart.global.js`,tags:[`wui-chart`],selfContained:!0},calendar:{file:`ui-calendar.global.js`,tags:[`wui-calendar`],selfContained:!0},"rich-text":{file:`ui-rich-text.global.js`,tags:[`wui-rich-text`],selfContained:!0},"file-viewer":{file:`ui-file-viewer.global.js`,tags:[`wui-file-viewer`],selfContained:!0}});Object.freeze({anchorOverlay:`anchorOverlay.js`,buttonClass:`buttonClass.js`,calendarMath:`calendarMath.js`,copyText:`copyText.js`,dataTable:`dataTable.js`,defineElement:`defineElement.js`,devWarn:`devWarn.js`,elementBase:`elementBase.js`,fieldState:`fieldState.js`,formatters:`formatters.js`,formMirror:`formMirror.js`,iconGlyphs:`iconGlyphs.g.js`,listboxKeyNav:`listboxKeyNav.js`,loader:`global/loader.js`,mentionText:`mentionText.js`,notificationDays:`notificationDays.js`,optionLabel:`optionLabel.js`,stepperHeader:`stepperHeader.js`,tableSelect:`tableSelect.js`,textMatch:`textMatch.js`,wuiHttp:`server/wuiHttp.js`,WuiSelect:`WuiSelect.js`,zone:`zone.js`});var g=`wui-elements:defined`,_=/* @__PURE__ */ new Map;for(let[e,t]of Object.entries(h))for(let n of t.tags)_.set(n,e);[..._.keys()].join(`,`);var v=`wui-remote-modal`,y=`wui-remote-drawer`,b=Object.freeze({sm:360,md:480,lg:640,xl:720}),x=`wui-modal-fullscreen`,S=Object.freeze({sm:380,md:440,lg:640,xl:880}),C=Object.freeze({loading:`Loading`,close:`Close`,retry:`Try again`,errorTitle:`This could not be loaded`,forbidden:`You do not have access to this.`,client:`It may have been moved or deleted.`,server:`Something went wrong on our side. Try again in a moment.`,network:`Could not reach the server. Check your connection and try again.`,submitFailed:`Your changes were not saved.`,invalid:`Some fields need attention.`}),w=`a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,T=`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled]),[contenteditable="true"]`,E=`[aria-invalid="true"], .is-invalid, .input-validation-error`,ee=`.wui-error-summary, [data-wui-form-errors], .validation-summary-errors, [data-valmsg-summary]`,te=`[data-wui-modal-content]`,D=`[data-wui-pane-close], [data-bs-dismiss="modal"]`,O=`<button type="button" class="wui-modal-close" data-bs-dismiss="modal" aria-label="Close"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg></button>`,k=/* @__PURE__ */ new WeakMap,ne=/* @__PURE__ */ new WeakSet,A=()=>Object.assign(/* @__PURE__ */ Error(`The remote modal load was aborted.`),{name:`AbortError`}),re=e=>{let t=window.bootstrap?.Modal;if(!t)throw Error(`WUI.modal.load(${String(e)}): Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);return t},j=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML};function ie(e){if(e==null||e===``)return null;if(e===`fullscreen`)return{fullscreen:!0};if(Object.hasOwn(S,e))return{px:S[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported modal size "${String(e)}". Use sm, md, lg, xl, fullscreen or a px number.`)}var ae=e=>{if(e.classList.contains(`wui-modal-fullscreen`))return{fullscreen:!0};let t=Number.parseInt(e.style.getPropertyValue(`--wui-modal-max-width`),10);return{px:t>0?t:S.md}},oe=(e,t)=>{e.classList.toggle(x,!!t.fullscreen),t.fullscreen?e.style.removeProperty(`--wui-modal-max-width`):e.style.setProperty(`--wui-modal-max-width`,`${t.px}px`)},M=[`center`,`top`];function N(e){if(e==null||e===``)return null;if(Object.hasOwn(b,e))return{px:b[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported drawer size "${String(e)}". Use sm, md, lg, xl or a px number.`)}var P=e=>e.container===`drawer`,F=e=>e.container===`pane`,I=e=>e.container!==`modal`,se=(e,t)=>P(e)?N(t):ie(t),ce=()=>document.getElementById(`wui-remote-drawer`)?.classList.contains(`show`)??!1,le=e=>{let t=typeof e==`string`?document.querySelector(e):e;return t?.matches?.(`[data-wui-pane-host]`)?t:null},ue=e=>F(e)?e.shell:e.shell.querySelector(`.modal-dialog`);function de(e=`modal`){let t=e===`drawer`,n=t?y:v,r=document.getElementById(n);return r||(r=document.createElement(`div`),r.id=n,r.className=t?`modal fade wui-modal-shell wui-remote-drawer`:`modal fade wui-modal-shell`,r.tabIndex=-1,r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`role`,`dialog`),r.setAttribute(`aria-modal`,`true`),r.style.setProperty(`--wui-modal-max-width`,`${t?b.md:S.md}px`),r.innerHTML=t?`<div class="modal-dialog wui-remote-drawer-dialog"><div class="modal-content wui-modal"></div></div>`:`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal"></div></div>`,document.body.appendChild(r),r)}var L=e=>`<div class="wui-modal-header"><div class="wui-modal-heading"><div class="wui-modal-headtext"><div class="wui-modal-title">${j(e)}</div></div></div>${O}</div>`,fe=e=>`<div class="modal-content wui-modal" aria-busy="true">${L(e)}<div class="wui-modal-body"><div class="wui-modal-loading" role="status"><span class="visually-hidden">${j(C.loading)}</span><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton wui-modal-skeleton--short"></div></div></div></div>`,pe=(n,r)=>`<div class="modal-content wui-modal" data-wui-modal-error="${j(r)}">${L(n)}<div class="wui-modal-body"><div class="wui-modal-state" role="alert"><p class="wui-modal-state-title">${j(C.errorTitle)}</p><p class="wui-modal-state-text">${j(C[r]||C.server)}</p><div class="wui-modal-state-actions"><button type="button" class="${e(`secondary`,`md`)}" data-bs-dismiss="modal" data-wui="${t}">${j(C.close)}</button><button type="button" class="${e(`primary`,`md`)}" data-wui-modal-retry data-wui="${t}">${j(C.retry)}</button></div></div></div></div>`,me=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content.querySelector(`.modal-content`)},R=e=>e.shell.querySelector(`.modal-content`);function he(e){if(!e)return;e.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0}));let t=window.bootstrap,n=[t?.Tooltip,t?.Popover].filter(e=>e?.getInstance);for(let r of[e,...e.querySelectorAll(`*`)]){for(let e of n)m(e.getInstance(r),r);t?.Dropdown?.getInstance?.(r)?.dispose()}}function z(e,t){let n=R(e),r=n?_e(n):/* @__PURE__ */ new Map;he(n),n?n.replaceWith(t):ue(e).appendChild(t),ve(t,r),window.WUI?.refresh?.()}var ge=`input[type="file"][name]`;function _e(e){let t=/* @__PURE__ */ new Map;for(let n of e.querySelectorAll(ge))n.files.length>0&&t.set(n.name,[...n.files]);return t}function ve(e,t){if(t.size!==0&&typeof DataTransfer<`u`)for(let n of e.querySelectorAll(ge)){let e=t.get(n.name);if(!e)continue;let r=new DataTransfer;for(let t of e)r.items.add(t);n.files=r.files,n.dispatchEvent(new Event(`change`,{bubbles:!0}))}}var B=e=>F(e)?!e.shell.hidden:e.shell.classList.contains(`show`);function ye(e,t,n=!1){let r=t&&e.querySelector(E),i=r?r.matches(w)?r:r.querySelector(w)||r:null;if(!i&&n)i=e.querySelector(`[data-autofocus]`)||e.querySelector(T)||e.querySelector(`.wui-modal-close`);else if(!i){let t=[...e.querySelectorAll(w)];i=e.querySelector(`[data-autofocus]`)||t.find(e=>!e.classList.contains(`wui-modal-close`))||t[0]||e}i?.focus?.()}function be(e,t){let n=[...e.querySelectorAll(w)].filter(e=>e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`);if(!n.length){t.preventDefault(),e.focus();return}let r=n[0],i=n[n.length-1],a=document.activeElement;!e.contains(a)||a===e?(t.preventDefault(),(t.shiftKey?i:r).focus()):t.shiftKey&&a===r?(t.preventDefault(),i.focus()):!t.shiftKey&&a===i&&(t.preventDefault(),r.focus())}function xe(e,t){let n=e.shell.querySelector(`[data-wui-modal-live]`);n||(n=document.createElement(`div`),n.className=`visually-hidden`,n.setAttribute(`aria-live`,`assertive`),n.setAttribute(`data-wui-modal-live`,``),ue(e).appendChild(n)),n.textContent=``,n.textContent=t}var Se=e=>{let t=e.shell.querySelector(`[data-wui-modal-live]`);t&&(t.textContent=``)},V=(e,t,n)=>e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}));function H(e,t,n,r){let i={...r,container:e.container};V(t,`wui:modal:${n}`,i),P(e)&&V(t,`wui:drawer:${n}`,i),F(e)&&V(t,`wui:pane:${n}`,i)}var U=e=>e.matches(`[data-wui-pane-host]`)?`pane`:e.classList.contains(`wui-remote-drawer`)?`drawer`:`modal`;function Ce(e){let t=k.get(e);return t||(t={shell:e,container:U(e),queue:a(),defaultSize:ae(e),defaultLabel:e.getAttribute(`aria-label`),placeholder:R({shell:e})?.outerHTML||`<div class="modal-content wui-modal"></div>`,remoteUrl:e.getAttribute(`data-wui-remote-url`),cache:e.getAttribute(`data-wui-remote-cache`)===`true`,loadedUrl:null,session:null},k.set(e,t),e.addEventListener(`submit`,e=>He(t,e)),e.addEventListener(`click`,e=>{e.target.closest?.(`[data-wui-modal-retry]`)&&t.session&&(e.preventDefault(),G(t,t.session))}),F(t)&&e.addEventListener(`click`,e=>{let n=e.target.closest?.(D);n&&e.currentTarget.contains(n)&&t.session&&W(t,t.session,`dismissed`,null)}),e.addEventListener(`hidden.bs.modal`,n=>{n.target===e&&(e.classList.contains(`wui-modal-stacked`)&&Ee(t),De(t))}),e.addEventListener(`shown.bs.modal`,n=>{if(n.target!==e)return;e.classList.contains(`wui-modal-stacked`)&&[...document.querySelectorAll(`.modal-backdrop`)].at(-1)?.classList.add(`wui-modal-backdrop-stacked`);let r=R(t);t.session&&r?.matches(te)&&!r.contains(document.activeElement)&&ye(r,!1,I(t))}),t.remoteUrl&&e.addEventListener(`show.bs.modal`,n=>{n.target===e&&Oe(t,n)}),t)}function we(e,t,n){e.session&&(e.queue.abort(),e.session.resolveClosed({status:`dismissed`,detail:{replaced:!0}}));let r,i=new Promise(e=>{r=e}),a={url:t,method:(n.method||`GET`).toUpperCase(),body:n.body,options:n,trigger:n.trigger||null,explicitSize:null,closing:null,resolveClosed:r,handle:null};return a.handle={el:e.shell,closed:i,close:()=>W(e,a,`dismissed`,null),reload:()=>G(e,a)},e.session=a,a}function W(e,t,n,r){e.session===t&&(t.closing={status:n,detail:r},F(e)?Te(e,t):window.bootstrap?.Modal?.getOrCreateInstance(e.shell).hide())}function Te(e,t){let n=e.shell,{status:r,detail:i}=t.closing,a=n.contains(document.activeElement);e.queue.abort(),e.session=null,he(R(e)),n.replaceChildren(),n.hidden=!0,n.removeAttribute(`data-open`),t.resolveClosed({status:r,detail:i}),H(e,n,`closed`,{status:r,url:t.url}),a&&t.trigger?.isConnected&&t.trigger.focus?.()}function Ee(e){e.shell.classList.remove(`wui-modal-stacked`),ce()&&(document.body.classList.add(`modal-open`),document.body.style.overflow=`hidden`)}function De(e){let t=e.session;if(e.queue.abort(),e.session=null,Se(e),t){let{status:n,detail:r}=t.closing||{status:`dismissed`,detail:null};t.resolveClosed({status:n,detail:r}),H(e,e.shell,`closed`,{status:n,url:t.url});let i=document.activeElement;t.trigger?.isConnected&&(!i||i===document.body||e.shell.contains(i))&&t.trigger.focus?.()}e.cache||(z(e,me(e.placeholder)),e.loadedUrl=null,oe(e.shell,e.defaultSize),e.defaultLabel?e.shell.setAttribute(`aria-label`,e.defaultLabel):e.shell.removeAttribute(`aria-label`))}function Oe(e,t){let n=t.relatedTarget instanceof Element?t.relatedTarget:null,r=n?.getAttribute(`data-wui-url`)||e.remoteUrl,i=we(e,r,{trigger:n});i.explicitSize=ke(e,n?.getAttribute(`data-wui-size`)),i.explicitSize&&oe(e.shell,i.explicitSize),e.cache&&e.loadedUrl===r||(e.loadedUrl&&z(e,me(e.placeholder)),G(e,i,{keepPlaceholder:!0}))}function ke(e,t){try{return se(e,t)}catch(e){return r(e),null}}async function G(e,t,{keepPlaceholder:n=!1}={}){n||z(e,me(fe(t.options.title||Ae(e))));let r=await e.queue.run(t.url,{method:t.method,body:t.body,navigate:t.options.navigate});if(e.session!==t||r.kind===`aborted`||r.kind===`stale`)return`aborted`;if(r.kind===`session`)return`session`;if((r.kind===`ok`||r.kind===`validation`)&&Pe(e,t,r.html,!1))return e.loadedUrl=t.url,H(e,e.shell,`loaded`,{url:t.url,handle:t.handle}),`loaded`;let i=r.kind===`ok`||r.kind===`validation`?`server`:r.kind;return z(e,me(pe(t.options.title||Ae(e),i))),B(e)&&ye(R(e),!1,I(e)),H(e,e.shell,`error`,{url:t.url,kind:i,status:r.status}),`error`}var Ae=e=>R(e)?.querySelector(`.wui-modal-title`)?.textContent||e.shell.getAttribute(`aria-label`)||``,je=`/_content/Webority.Ui.Razor/js/`,Me=e=>new URL(e,window.location.href).pathname.includes(je);function Ne(e){if([...document.scripts].some(t=>t.getAttribute(`src`)===e))return;let t=document.createElement(`script`);t.src=e,document.head.appendChild(t)}function Pe(e,t,i,a){let o=document.createElement(`template`);o.innerHTML=i;let s=!1;for(let e of o.content.querySelectorAll(`script`)){if(e.getAttribute(`type`)===`application/json`)continue;let t=e.getAttribute(`src`);e.remove(),t&&Me(t)?Ne(t):s=!0}s&&n(`WUI.modal: ${t.url} returned a fragment with script; it was removed. Keep page behaviour in the page.`);let c=o.content.querySelector(te);if(!c)return r(`WUI.modal: ${t.url} did not answer with an <app-modal-content> fragment.`),!1;if(z(e,c),a||Se(e),!F(e)){oe(e.shell,t.explicitSize||ke(e,c.getAttribute(`data-wui-size`))||e.defaultSize);let n=c.getAttribute(`data-wui-title`);n&&e.shell.setAttribute(`aria-label`,n)}return B(e)&&ye(c,a,I(e)),!0}var Fe=`button[type="submit"], button:not([type]), input[type="submit"], input[type="image"]`;function Ie(e,t,n){let r=[...e.elements].filter(e=>e.matches(Fe));if(n){e.setAttribute(`data-wui-submitting`,``);let n=t&&r.includes(t)?t:r[0];for(let e of r)e.toggleAttribute(`data-wui-was-disabled`,e.disabled),e.disabled=!0;n&&(n.classList.add(`is-loading`),n.setAttribute(`aria-busy`,`true`),n.tagName===`BUTTON`&&n.insertAdjacentHTML(`afterbegin`,`<span class="spinner-border spinner-border-sm me-2" aria-hidden="true" data-wui-submit-spinner></span>`))}else{e.removeAttribute(`data-wui-submitting`);for(let e of r)e.disabled=e.hasAttribute(`data-wui-was-disabled`),e.removeAttribute(`data-wui-was-disabled`),e.classList.remove(`is-loading`),e.removeAttribute(`aria-busy`),e.querySelector(`[data-wui-submit-spinner]`)?.remove()}}function Le(e){for(let t of e.querySelectorAll(ee))t.remove();for(let t of e.querySelectorAll(E))t.removeAttribute(`aria-invalid`),t.classList.remove(`is-invalid`,`input-validation-error`);for(let t of e.querySelectorAll(`.field-error`))t.textContent=``}var Re=/* @__PURE__ */ new Set(/* @__PURE__ */ `bad request.unauthorized.payment required.forbidden.not found.method not allowed.not acceptable.proxy authentication required.request timeout.conflict.gone.length required.precondition failed.payload too large.uri too long.unsupported media type.range not satisfiable.expectation failed.misdirected request.unprocessable content.unprocessable entity.locked.failed dependency.too early.upgrade required.precondition required.too many requests.request header fields too large.unavailable for legal reasons`.split(`.`));async function ze(e){if(!e||e.status<400||e.status>499||e.status===422||!e.headers.get(`content-type`)?.toLowerCase().includes(`json`))return null;let t;try{t=JSON.parse(await e.text())}catch{return null}let n=e=>typeof e==`string`?e.trim():``,r=n(t?.title),i=(e.statusText||``).trim().toLowerCase(),a=Re.has(r.toLowerCase())||r.toLowerCase()===i;return n(t?.message)||n(t?.detail)||(r&&!a?r:null)}function Be(e,t,n,r){let i=t.closest(`.wui-modal-body`)||t;i.querySelector(`[data-wui-modal-submit-error]`)?.remove(),Le(i);let a=document.createElement(`div`);a.className=`alert alert-danger wui-modal-submit-error`,a.setAttribute(`role`,`alert`),a.setAttribute(`data-wui-modal-submit-error`,``),a.innerHTML=j(`${C.submitFailed} ${r||C[n]||C.server}`),i.prepend(a),xe(e,a.textContent)}var Ve=(e,t)=>{let n=new URL(e,window.location.href);for(let[e,r]of t)typeof r==`string`&&n.searchParams.append(e,r);return n.origin===window.location.origin?n.pathname+n.search:n.href};async function He(e,t){let n=t.target,r=e.session;if(!(n instanceof HTMLFormElement)||!r||n.hasAttribute(`data-wui-native`)||!n.closest(te)||(t.preventDefault(),n.hasAttribute(`data-wui-submitting`)))return;let i=t.submitter||null,a=i?.getAttribute(`formaction`)||n.getAttribute(`action`)||r.url,o=(i?.getAttribute(`formmethod`)||n.getAttribute(`method`)||`GET`).toUpperCase(),s=new FormData(n);i?.name&&!s.has(i.name)&&s.append(i.name,i.value);let c=o===`GET`;Ie(n,i,!0);let l=await e.queue.run(c?Ve(a,s):a,{method:o,body:c?void 0:s,navigate:r.options.navigate});if(e.session!==r)return;if(n.isConnected&&Ie(n,i,!1),l.kind===`ok`&&l.result===`success`){Ue(e,r,l);return}if(l.kind===`aborted`||l.kind===`stale`||l.kind===`session`)return;if(l.kind===`validation`&&Pe(e,r,l.html,!0)){let t=R(e).querySelector(ee)?.textContent.replace(/\s+/g,` `).trim();xe(e,t||C.invalid);return}if(l.kind===`ok`&&l.html&&Pe(e,r,l.html,!1))return;let u=l.kind===`ok`||l.kind===`validation`?`server`:l.kind,d=await ze(l.response);e.session===r&&Be(e,n,u,d)}function Ue(e,t,n){let r=n.message,i=n.redirect||null,a={url:t.url,trigger:t.trigger,handle:t.handle,message:r,redirect:i,data:n.data??null,container:e.container};r&&window.WUI?.toast?.(r,{variant:`success`}),H(e,t.trigger?.isConnected?t.trigger:document,`success`,a),t.options.onSuccess?.(a,t.handle),i&&(t.options.navigate||(e=>window.location.assign(e)))(i),n.next&&!i?(t.url=n.next,t.method=`GET`,t.body=void 0,G(e,t)):n.keepOpen?n.html&&Pe(e,t,n.html,!1):W(e,t,`success`,a)}function We(e){let t=e.target.closest?.(`[data-wui-modal], [data-wui-drawer], [data-wui-pane]`);t&&(t.matches(`a[href]`)&&(e.ctrlKey||e.metaKey||e.shiftKey||e.button!==0)||(e.preventDefault(),t.hasAttribute(`data-wui-pane`)?Qe(t.getAttribute(`data-wui-pane`),{target:t.getAttribute(`data-wui-pane-target`),trigger:t}).catch(e=>{e?.name!==`AbortError`&&r(e)}):t.hasAttribute(`data-wui-modal`)?Je(t.getAttribute(`data-wui-modal`),{size:t.getAttribute(`data-wui-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{e?.name!==`AbortError`&&r(e)}):Xe(t.getAttribute(`data-wui-drawer`),{size:t.getAttribute(`data-wui-drawer-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{e?.name!==`AbortError`&&r(e)})))}function Ge(e){if(e.key!==`Tab`||e.defaultPrevented)return;let t=e.currentTarget.querySelectorAll(`.modal.show`),n=e.currentTarget.querySelector(`.modal.show.wui-modal-stacked`)??t[t.length-1];n&&be(n,e)}function Ke(e){if(e.key!==`Escape`||e.defaultPrevented)return;let t=e.target.closest?.(Ze),n=t&&k.get(t);n?.session&&!e.currentTarget.querySelector(`.modal.show`)&&W(n,n.session,`dismissed`,null)}function qe(e=document){let t=e.ownerDocument||e;ne.has(t)||(ne.add(t),t.addEventListener(`click`,We),t.addEventListener(`keydown`,Ge),t.addEventListener(`keydown`,Ke));let n=[...e.querySelectorAll?.(`.modal[data-wui-remote-url]`)||[]];e.matches?.(`.modal[data-wui-remote-url]`)&&n.unshift(e);for(let e of n)Ce(e)}function Je(e,t={}){try{if(!e)throw TypeError(`WUI.modal.load: a fragment url is required.`);let n=re(e),r=t.container===`drawer`,i=r?N(t.size):ie(t.size),a=t.placement||`center`;if(!M.includes(a))throw TypeError(`WUI.modal.load: unsupported placement "${a}". Use center or top.`);if(t.signal?.aborted)return Promise.reject(A());let o=de(r?`drawer`:`modal`);qe(document);let s=Ce(o),c=B(s),l=we(s,e,t);l.explicitSize=i,oe(o,i||s.defaultSize),r||o.querySelector(`.modal-dialog`).classList.toggle(`modal-dialog-centered`,a===`center`),t.title&&o.setAttribute(`aria-label`,t.title),c||(!r&&ce()&&(document.body.appendChild(o),o.classList.add(`wui-modal-stacked`)),n.getInstance(o)?.dispose(),n.getOrCreateInstance(o,{backdrop:!t.staticBackdrop||`static`,keyboard:!t.staticBackdrop}));let u=c?Promise.resolve():new Promise(e=>o.addEventListener(`shown.bs.modal`,()=>e(),{once:!0})),d=G(s,l);return c||n.getOrCreateInstance(o).show(),Ye(s,l,t,u,d,`WUI.modal.load`)}catch(e){return Promise.reject(e)}}function Ye(e,t,n,r,i,a){let o=new Promise((r,i)=>{n.signal?.addEventListener(`abort`,()=>{e.session===t&&(e.queue.abort(),W(e,t,`dismissed`,{aborted:!0})),i(A())},{once:!0})}),s=Promise.all([r,i]).then(([,e])=>{if(e===`aborted`)throw A();if(e===`session`)throw Error(`${a}(${t.url}): the session expired; the browser is signing in again.`);return t.handle});return Promise.race([s,o])}function Xe(e,t={}){return Je(e,{...t,container:`drawer`,placement:void 0})}var Ze=`[data-wui-pane-host]`;function Qe(e,t={}){try{if(!e)throw TypeError(`WUI.pane.load: a fragment url is required.`);let n=le(t.target);if(!n)throw TypeError(`WUI.pane.load: the target is not an <app-detail-pane>.`);if(t.signal?.aborted)return Promise.reject(A());qe(document);let r=Ce(n),i=we(r,e,t);n.hidden=!1,n.setAttribute(`data-open`,``);let a=G(r,i);return Ye(r,i,t,Promise.resolve(),a,`WUI.pane.load`)}catch(e){return Promise.reject(e)}}function $e(e){let t=le(e);if(!t)throw TypeError(`WUI.pane.close: the target is not an <app-detail-pane>.`);let n=k.get(t);n?.session&&W(n,n.session,`dismissed`,null)}var et=`Select all rows`,tt=`Select row`,K=`wui-select-cell`,nt=(e,t)=>{let n=e.createElement(`input`);return n.type=`checkbox`,n.className=`wui-check`,n.setAttribute(`aria-label`,t),n};function rt(e=document){let t=e.createElement(`th`);return t.className=K,t.appendChild(nt(e,et)),t}function it(e=document,{disabled:t=!1}={}){let n=e.createElement(`td`);n.className=K;let r=nt(e,tt);return r.disabled=t,n.appendChild(r),n}function at(e=document){let t=e.createElement(`td`);return t.className=K,t}var ot=e=>e.firstElementChild?.classList.contains(K),st=e=>e.matches(`.wui-group-row, .wui-virtual-spacer`);function ct(e){for(let t of e){if(ot(t)||st(t))continue;let e=t.getAttribute(`data-row-selectable`)===`false`;t.insertBefore(it(t.ownerDocument,{disabled:e}),t.firstChild)}}function lt(e){let t=e.querySelector(`thead tr`);if(!t)return null;ot(t)||t.insertBefore(rt(e.ownerDocument),t.firstChild),ct(e.querySelectorAll(`tbody tr`));for(let t of e.querySelectorAll(`tfoot tr`))ot(t)||t.insertBefore(at(e.ownerDocument),t.firstChild);return t.querySelector(`.${K} .wui-check`)}function ut(e){let t=e.querySelector(`thead .${K} .wui-check`),n=[...e.querySelectorAll(`tbody tr .wui-check:not(:disabled)`)],r=n.length,i=n.filter(e=>e.checked).length;t&&(t.checked=r>0&&i===r,t.indeterminate=i>0&&i<r);for(let t of e.querySelectorAll(`tbody tr`))t.classList.toggle(`is-selected`,!!t.querySelector(`.wui-check`)?.checked);return{selected:i,total:r}}var dt=`tbody .${K} .wui-check:not(:disabled)`;function ft(e,t){let n=null,r=e=>e instanceof Element&&e.matches(`.wui-select-cell .wui-check:not(:disabled)`)&&!!e.closest(`tbody`);e.addEventListener(`mousedown`,e=>{e.shiftKey&&r(e.target)&&e.preventDefault()}),e.addEventListener(`click`,i=>{let a=i.target;if(r(a)){if(i.shiftKey&&n?.isConnected&&n!==a){let r=[...e.querySelectorAll(dt)],i=r.indexOf(n),o=r.indexOf(a);if(i>=0&&o>=0){let e=[];for(let t of r.slice(Math.min(i,o),Math.max(i,o)+1))t!==a&&t.checked!==a.checked&&(t.checked=a.checked,e.push(t));e.length&&t?.(e,a.checked)}}n=a}})}var pt=8e3,mt=`That did not work. Try again.`;function ht(e,t=`success`){if(!e?.message)return;let n=e.toastAction;n?window.WUI?.toast?.(e.message,{variant:t,duration:pt,action:{label:n.label,onClick:()=>gt(n)}}):window.WUI?.toast?.(e.message,{variant:t})}async function gt(e){let t=await i(e.url,{method:e.method});if(t.kind!==`session`&&t.kind!==`aborted`){if(t.ok){ht(t,t.toastVariant||`success`);for(let e of document.querySelectorAll(`[data-wui-server]`))e.dataset.refreshOnSuccess!==`false`&&Et(e)?.reload()}else window.WUI?.toast?.(t.message||mt,{variant:`danger`})}}var q=Object.freeze({loading:`Loading rows`,error:`These rows did not load. Try again.`,network:`The connection dropped before the rows loaded. Check it and try again.`,forbidden:`You do not have access to these rows.`,retry:`Retry`,actionFailed:`That did not work. Try again.`,actionForbidden:`You do not have permission to do that.`,empty:`No rows`}),_t=5,vt=/* @__PURE__ */ new WeakMap,yt=(e,t)=>{let n=Number(e);return Number.isInteger(n)?n:t},bt=e=>({total:yt(e.dataset.total,0),page:yt(e.dataset.page,1),pageSize:yt(e.dataset.pageSize,0),sortBy:e.dataset.sortBy||``,sortOrder:e.dataset.sortOrder===`desc`?`desc`:`asc`}),xt=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},St=(e,t)=>{if(!e)return;let n=new Set([...e.elements].filter(e=>e.type!==`hidden`||e.hasAttribute(`data-range-mirror`)).map(e=>e.getAttribute(`name`)).filter(e=>e&&!f.includes(e))),r=[...t].some(([e,t])=>t!==``&&n.has(e));for(let t of e.querySelectorAll(`[data-wui-filter-clear]`))t.hidden=!r},Ct=new Intl.NumberFormat(`en-IN`),wt=(e,t)=>{let n=e.closest(`.wui-list-card`)?.querySelector(`.wui-list-card-count`);n&&(n.textContent=Ct.format(t))};function Tt(e=document){let t=e.querySelectorAll?[...e.querySelectorAll(`[data-wui-server]`)]:[];e instanceof Element&&e.matches(`[data-wui-server]`)&&t.unshift(e);for(let e of t)vt.has(e)||vt.set(e,Dt(e))}function Et(e){let t=e instanceof Element?e.closest(`[data-wui-server]`):null;return t&&vt.get(t)||null}function Dt(m){let h=m.querySelector(`.table-wrap`),g=h?.querySelector(`:scope > table`),_=m.dataset.src;if(!g||!_)throw Error(`A server-paged table needs data-src and a .table-wrap > table: render it with <app-data-table src>.`);let v=h.querySelector(`:scope > [data-wui-table-state]`),y=m.querySelector(`[data-wui-table-pager]`),b=m.querySelector(`[data-wui-table-status]`),x={urlState:m.dataset.urlState!==`false`,refreshOnSuccess:m.dataset.refreshOnSuccess!==`false`,filtersForm:m.dataset.filtersForm||null,filtersRegion:m.dataset.filtersRegion||null,searchInput:m.dataset.searchInput||null,loadingText:m.dataset.loadingText||q.loading,errorText:m.dataset.errorText||q.error},S=new URL(_,window.location.href),C=new Set(S.searchParams.keys()),w=g.hasAttribute(`data-app-datatable-selectable`),T=/* @__PURE__ */ new Set,E=!1,ee=a(),te=new AbortController,D={signal:te.signal},O=g.querySelector(`:scope > tbody[data-wui-rows]`);if(!O)throw Error(`A server-paged table needs its rows in <app-table-rows> (tbody[data-wui-rows]).`);let k=bt(O),ne=null,A=null,re=e=>{let t=new URLSearchParams;for(let[n,r]of new URLSearchParams(e))C.has(n)||t.append(n,r);return t},j=e=>re(new URL(e,window.location.href).search),ie=e=>{let t=e.toString();return`${window.location.pathname}${t?`?${t}`:``}${window.location.hash}`},ae=e=>{let t=new URL(S.href);for(let[n,r]of e)C.has(n)||t.searchParams.append(n,r);return t.origin===window.location.origin?`${t.pathname}${t.search}`:t.href},oe=(e,t)=>{let n=new URLSearchParams(e);return n.has(`page`)&&n.set(`page`,String(t.page)),n.has(`pageSize`)&&n.set(`pageSize`,String(t.pageSize)),n.has(`sortBy`)?t.sortBy?(n.set(`sortBy`,t.sortBy),n.set(`sortOrder`,t.sortOrder)):(n.delete(`sortBy`),n.delete(`sortOrder`)):n.delete(`sortOrder`),n},M=oe(x.urlState?re(window.location.search):new URLSearchParams,k);x.urlState&&ie(M)!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,``,ie(M));let N=(e,t)=>h.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t})),P=e=>{b&&(b.textContent=e)},F=e=>{if(e.total===0)return q.empty;let t=e.pageSize>0?Math.max(1,Math.ceil(e.total/e.pageSize)):1;return`Page ${e.page} of ${t}, ${e.total} ${e.total===1?`row`:`rows`}`},I=()=>[...g.querySelectorAll(`:scope > thead > tr:first-child > th`)],se=e=>{if(w&&[...e.querySelectorAll(`:scope > tr:not(.wui-group-row, .wui-virtual-spacer)`)].some(e=>!e.dataset.rowKey))throw Error(`A selectable server-paged table needs data-row-key on every row, so a selection can span pages.`)},ce=e=>{let t=m.dataset.activeRowKey;if(t!==void 0)for(let n of e){let e=n.classList.contains(`wui-row-active`),r=t!==``&&n.dataset.rowKey===t;n.classList.toggle(`wui-row-active`,r),r?n.setAttribute(`aria-current`,`true`):e&&n.removeAttribute(`aria-current`)}},le=e=>{if(w){ct(e);for(let t of e){let e=t.querySelector(`.${K} .wui-check:not(:disabled)`);e&&(E&&T.add(t.dataset.rowKey),e.checked=T.has(t.dataset.rowKey))}ut(g)}ce(e);let t=I();if(g.classList.contains(`wui-table-stack`))for(let n of e)[...n.cells].forEach((e,n)=>{let r=t[n]?.textContent.trim();r&&!e.hasAttribute(`data-label`)&&e.setAttribute(`data-label`,r)});t.forEach((t,n)=>{if(t.classList.contains(`wui-col-hidden`))for(let t of e)t.cells[n]?.classList.add(`wui-col-hidden`)})},ue=e=>le([...e.querySelectorAll(`:scope > tr`)]),de=e=>{for(let t of e.querySelectorAll(`:scope > template[data-wui-pager], :scope > template[data-wui-empty], :scope > template[data-wui-filters]`))t.remove()},L=e=>e?.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),fe=(e,t)=>{if(!v)return;let n=e.querySelector(`:scope > template[data-wui-empty]`);L(v),t.total===0&&n?(v.replaceChildren(n.content.cloneNode(!0)),v.hidden=!1):(v.replaceChildren(),v.hidden=!0)},pe=e=>{let t=bt(e),n=t.sortBy!==k.sortBy||t.sortOrder!==k.sortOrder?u(O.rows):null;if(y){let t=e.querySelector(`:scope > template[data-wui-pager]`);L(y),y.replaceChildren(...t?[t.content.cloneNode(!0)]:[]),y.hidden=!1}fe(e,t);let r=e.querySelector(`:scope > template[data-wui-filters]`),i=x.filtersRegion&&r?document.querySelector(x.filtersRegion):null;i&&(L(i),i.replaceChildren(r.content.cloneNode(!0))),de(e),L(O),g.replaceChild(e,O),O=e;let a=E&&t.total!==k.total;return k=t,a&&(E=!1),h.removeAttribute(`data-wui-table-error`),ue(e),xe(),l(e.rows,n),a&&V(),i},me=e=>{let t=document.createElement(`template`);t.innerHTML=`<table>${e}</table>`;let n=t.content.querySelector(`tbody[data-wui-rows]`);return n&&se(n),n?document.importNode(n,!0):null},R=(e,t=I())=>{let n=document.createElement(`tr`);for(let r=0;r<e;r++){let e=t[r],i=e?.classList.contains(`text-center`),a=!i&&(e?.classList.contains(`num`)||e?.classList.contains(`text-end`)||e?.classList.contains(`wui-cell-end`)),o=document.createElement(`td`);i?o.classList.add(`text-center`):a&&o.classList.add(e.classList.contains(`num`)?`num`:`wui-cell-end`);let s=document.createElement(`span`);s.className=`skeleton`,s.setAttribute(`aria-hidden`,`true`);let c=i?44:a?56:60;s.style.cssText=`display:block;width:${c}%;height:12px;border-radius:6px`,o.append(s),n.append(o)}return n},he=()=>{if(O.querySelector(`:scope > tr:not([data-wui-skeleton])`))return;let e=Math.max(1,I().length);O.replaceChildren(...Array.from({length:_t},()=>{let t=R(e);return t.setAttribute(`data-wui-skeleton`,``),t})),h.removeAttribute(`data-wui-table-error`),v&&(v.hidden=!0)},z=e=>{e?(h.setAttribute(`aria-busy`,`true`),he()):h.removeAttribute(`aria-busy`)},ge=e=>e===`forbidden`?q.forbidden:e===`network`?q.network:x.errorText,_e=n=>{let r=ge(n);if(h.setAttribute(`data-wui-table-error`,n),y&&(y.hidden=!0),v){let i=document.createElement(`div`);i.className=`empty-state wui-empty-state-table wui-table-error`,i.setAttribute(`role`,`alert`);let a=document.createElement(`span`);a.className=`empty-state-icon`,a.innerHTML=d(n===`forbidden`?`lock`:`alert-circle`,{size:24});let o=document.createElement(`div`);o.className=`empty-state-title`,o.textContent=r;let s=document.createElement(`div`);s.className=`empty-state-action`;let c=document.createElement(`button`);c.type=`button`,c.className=e(`outline`,`sm`),c.dataset.wui=t,c.setAttribute(`data-wui-table-retry`,``),c.textContent=q.retry,s.append(c),i.append(a,o,s),L(v),v.replaceChildren(i),v.hidden=!1}P(r)},ve=()=>x.filtersForm?document.querySelector(x.filtersForm):null,B=async(e,t=`none`,{quiet:i=!1}={})=>{let a=new URLSearchParams(e);i||(ne={query:a,mode:t},z(!0),P(x.loadingText)),N(`wui:table:loading`,{query:a.toString()});let o=await ee.run(ae(a));if(o.kind===`aborted`||o.kind===`stale`||o.kind===`session`)return o;i||z(!1);let s=null,c=o.ok?null:o.kind;if(o.ok){try{s=me(o.html)}catch(e){r(e)}s||(c=`server`)}if(c)return i?n(`A quiet server table refresh failed; the rows on screen are kept.`,c):_e(c),N(`wui:table:error`,{status:o.status,kind:c,message:ge(c)}),o;let l=pe(s);return M=oe(a,k),St(ve(),M),x.urlState&&t===`push`?window.history.pushState(window.history.state,``,ie(M)):x.urlState&&t===`replace`&&window.history.replaceState(window.history.state,``,ie(M)),i||P(F(k)),window.WUI?.refresh?.(h),l&&window.WUI?.refresh?.(l),wt(m,k.total),N(`wui:table:loaded`,{...k,query:M.toString()}),o},ye=e=>(e.delete(`page`),e),be=()=>[...g.querySelectorAll(`:scope > thead th[data-sort-key]`)],xe=()=>{for(let e of be()){let t=e.dataset.sortKey===k.sortBy;e.setAttribute(`aria-sort`,t?k.sortOrder===`desc`?`descending`:`ascending`:`none`)}};for(let e of be())if(e.classList.add(`sortable`),e.tabIndex=0,!e.querySelector(`.sort-icon`)){let t=e.classList.contains(`num`)||e.classList.contains(`text-end`),n=document.createElement(`span`);n.className=t?`sort-icon wui-sort-lead`:`sort-icon`,n.innerHTML=d(`chevrons-up-down`,{size:14}),t?e.prepend(n):e.append(n)}let Se=e=>{let t=ye(new URLSearchParams(M)),n=k.sortBy===e&&k.sortOrder===`asc`?`desc`:`asc`;return t.set(`sortBy`,e),t.set(`sortOrder`,n),B(t,`push`)};g.addEventListener(`click`,e=>{let t=e.target.closest(`th[data-sort-key]`);t&&g.tHead?.contains(t)&&Se(t.dataset.sortKey)}),g.addEventListener(`keydown`,e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target.closest?.(`th[data-sort-key]`);t&&g.tHead?.contains(t)&&(e.preventDefault(),Se(t.dataset.sortKey))});let V=()=>{ut(g);let e=E?{selected:k.total,total:k.total,allMatching:E}:{selected:T.size,total:k.total};g.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:e}))};w&&(ft(g,(e,t)=>{for(let n of e){let e=n.closest(`tr`)?.dataset.rowKey;e&&(t?T.add(e):T.delete(e))}t||(E=!1)}),g.addEventListener(`change`,e=>{let t=e.target;if(t.matches?.(`.wui-select-cell .wui-check:not(:disabled)`)){if(t.checked||(E=!1),g.tHead?.contains(t))for(let e of O.querySelectorAll(`:scope > tr`)){let n=e.querySelector(`.${K} .wui-check:not(:disabled)`);n&&(n.checked=t.checked,t.checked?T.add(e.dataset.rowKey):T.delete(e.dataset.rowKey))}else{let e=t.closest(`tr`)?.dataset.rowKey;if(!e)return;t.checked?T.add(e):T.delete(e)}V()}})),y&&(y.addEventListener(`click`,e=>{let t=e.target.closest(`a[href]`);!t||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),B(j(t.getAttribute(`href`)),`push`))}),y.addEventListener(`change`,e=>{e.target.classList?.contains(`tpg-select`)&&e.target.value&&(e.stopPropagation(),B(j(e.target.value),`push`))}));let H=()=>{if(!x.searchInput)return null;let e=document.querySelector(x.searchInput);return e&&(e.matches(`input, textarea`)?e:e.querySelector(`input`))},U=()=>m.isConnected?!0:(te.abort(),clearTimeout(A),!1),Ce=(e,t)=>{let n=/* @__PURE__ */ new Set;for(let t of e.elements)t.name&&t.type!==`hidden`&&n.add(t.name);let r=[];for(let t of e.elements)if(t.name&&!t.disabled){if(t.matches(`input[type="hidden"][data-wui-carried]`))n.has(t.name)||r.push([t.name,t.value]);else if(t.matches(`input[type=checkbox], input[type=radio]`))t.checked&&r.push([t.name,t.value]);else if(t.matches(`input, textarea`))t.matches(`[type=submit], [type=button], [type=reset], [type=image], [type=file]`)||r.push([t.name,t.value]);else if(t.localName===`select`)for(let e of t.selectedOptions)r.push([t.name,e.value])}return t?.name&&!t.disabled&&r.push([t.name,t.value]),r},we=(e,t)=>{let n=new Set([...e.elements].map(e=>e.name).filter(Boolean)),r=new URLSearchParams,i=e=>e!==`search`&&f.includes(e);for(let[e,t]of M)e!==`page`&&(i(e)||!n.has(e))&&r.append(e,t);for(let[n,a]of Ce(e,t))a===``||i(n)||C.has(n)||r.append(n,a);let a=H();if(a){r.delete(p);let e=a.value.trim();e&&r.set(p,e)}return B(r,`push`)},W=e=>x.filtersForm&&e.closest?.(x.filtersForm)||x.filtersRegion&&e.closest?.(x.filtersRegion)||null;document.addEventListener(`submit`,e=>{U()&&x.filtersForm&&e.target instanceof HTMLFormElement&&e.target.matches(x.filtersForm)&&(e.preventDefault(),we(e.target,e.submitter))},D),document.addEventListener(`change`,e=>{if(!U()||!x.filtersForm)return;let t=e.target.closest?.(x.filtersForm);!t||e.target===H()||t.hasAttribute(`data-wui-apply-on-change`)||e.target.closest?.(`wui-filter-popover`)||we(t)},D);let Te=(e,t)=>{if(!e)return;let n=e=>t.get(e)??``;for(let r of e.querySelectorAll(`input[name]:not([type=hidden])`))if(r.type===`checkbox`)r.checked=t.getAll(r.name).includes(r.value);else if(r.type===`radio`){let e=n(r.name)===r.value;if(r.checked===e)continue;r.checked=e,e&&r.dispatchEvent(new Event(`change`))}else r.value!==n(r.name)&&(r.value=n(r.name),r.dispatchEvent(new Event(`input`,{bubbles:!0})));for(let r of e.querySelectorAll(`select[name]`))if(!r.multiple)r.value=n(r.name);else for(let e of r.options)e.selected=t.getAll(r.name).includes(e.value);for(let t of e.querySelectorAll(`wui-select[name]`))t.value=n(t.getAttribute(`name`));for(let n of e.querySelectorAll(`wui-multiselect[name]`))n.values=t.getAll(n.getAttribute(`name`));for(let t of e.querySelectorAll(`wui-date-range`)){let e=t.getAttribute(`start-name`)||t.getAttribute(`name`),r=t.getAttribute(`end-name`);t.value={start:e?n(e):``,end:r?n(r):``}}};document.addEventListener(`click`,e=>{if(!U())return;let t=e.target.closest?.(`a[href]`);if(!t||!W(t)||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let n=new URL(t.getAttribute(`href`),window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname)return;e.preventDefault();let r=ye(j(n.href));Te(t.closest(`form`),r),St(t.closest(`form`),r),B(r,`push`)},D),document.addEventListener(`input`,e=>{if(!U())return;let t=H();t&&e.target===t&&(clearTimeout(A),A=setTimeout(()=>{if(!U())return;let e=ye(new URLSearchParams(M)),n=t.value.trim();n?e.set(p,n):e.delete(p),e.toString()!==M.toString()&&B(e,`replace`)},300))},D),x.urlState&&window.addEventListener(`popstate`,()=>{if(!U())return;let e=re(window.location.search),t=H();t&&(t.value=e.get(`search`)??``),St(ve(),e),B(e,`none`)},D),document.addEventListener(`wui:modal:success`,()=>{U()&&x.refreshOnSuccess&&B(M,`none`)},D),v?.addEventListener(`click`,e=>{e.target.closest(`[data-wui-table-retry]`)&&ne&&B(ne.query,ne.mode)});let Ee=e=>[...O.rows].find(t=>t.dataset.rowKey===e)??null,De=e=>{if(!e?.trim())return null;let t=document.createElement(`template`);if(t.innerHTML=`<table><tbody>${e}</tbody></table>`,t.content.querySelector(`tbody[data-wui-rows]`))return null;let n=[...t.content.querySelectorAll(`table > tbody > tr[data-row-key]`)];return n.length?n.map(e=>document.importNode(e,!0)):null},Oe=(e,t,n)=>{let r=n?e[0]:e.find(e=>e.dataset.rowKey===t.dataset.rowKey);if(!r)return null;let i=[];for(let n of e){let e=n===r?t:Ee(n.dataset.rowKey);e&&(L(e),e.replaceWith(n),i.push(n))}return le(i),window.WUI?.refresh?.(h),r},ke=e=>e.message||(e.kind===`forbidden`?q.actionForbidden:q.actionFailed),G=e=>{e?.isConnected&&e.getAttribute(`data-wui-save-state`)===`saving`&&s(e,null)},Ae=e=>{if(e instanceof HTMLTableRowElement)return e;let t=document.createElement(`template`);t.innerHTML=`<table><tbody>${String(e)}</tbody></table>`;let n=t.content.querySelector(`table > tbody > tr`);if(!n)throw Error("saveRow's `row` is the row as it will read: a <tr> element or its HTML.");return document.importNode(n,!0)},je=async({url:e,method:t=`POST`,body:n,key:r,row:a}={})=>{if(!e)throw Error("saveRow needs `url`: the handler that saves the row.");let l=r==null,u=l?null:Ee(String(r));if(!l&&!u)throw Error(`saveRow found no row with data-row-key="${r}" on this page.`);let d=I().filter(e=>!e.classList.contains(K)),f=a?Ae(a):u??R(Math.max(1,d.length),d);u&&f!==u?u.replaceWith(f):u||O.insertBefore(f,O.firstChild),f!==u&&le([f]),v&&!h.hasAttribute(`data-wui-table-error`)&&(v.hidden=!0),s(f,`saving`);let p=o(f),m=await i(e,{method:t.toUpperCase(),body:n});if(m.kind===`session`)return!1;if(m.ok){let e=De(m.html),t=e&&f.isConnected?Oe(e,f,l):null;return t?P(c.saved(o(t)||p)):(await B(M,`none`),G(f)),ht(m,m.toastVariant||`success`),N(`wui:table:saved`,{key:t?.dataset.rowKey??(l?null:String(r)),added:l,status:m.status}),!0}let g=ke(m),_=f;return u&&f!==u&&f.isConnected?(f.replaceWith(u),_=u):l&&!a&&(f.remove(),_=null,v?.childElementCount&&!O.querySelector(`:scope > tr`)&&(v.hidden=!1)),_?.isConnected&&s(_,`error`,g),m.kind!==`aborted`&&xt(g,`danger`),P(c.notSaved(p,g)),N(`wui:table:failed`,{key:l?null:String(r),added:l,status:m.status,kind:m.kind,message:g}),!1},Me=async e=>{let t=e.dataset.url;if(!t)throw Error(`A data-wui-row-action button needs data-url: the handler the action posts to.`);let n=e.closest(`tr`),r=n?.dataset.rowKey??null,a=e.dataset.wuiRowAction||``,l=n?o(n):``;e.disabled=!0,e.setAttribute(`aria-busy`,`true`),n&&s(n,`saving`);let u=await i(t,{method:(e.dataset.method||`post`).toUpperCase()});if(e.disabled=!1,e.removeAttribute(`aria-busy`),u.kind===`session`||u.kind===`aborted`)G(n);else{if(u.ok){ht(u,u.toastVariant||`success`);let e=n?.isConnected?De(u.html):null,t=e?Oe(e,n,!1):null;t?P(c.saved(o(t)||l)):(await B(M,`none`),G(n))}else{let e=ke(u);xt(e,`danger`),n?.isConnected&&s(n,`error`,e),P(c.notSaved(l,e))}N(`wui:table:action`,{action:a,key:r,ok:u.ok,status:u.status})}};return g.addEventListener(`click`,e=>{let t=e.target.closest(`[data-wui-row-action]`);t&&O.contains(t)&&!t.disabled&&(e.preventDefault(),Me(t))}),se(O),de(O),w&<(g),ue(O),xe(),{el:m,reload:async e=>{let t=e?.quiet===!0;return t&&h.getAttribute(`aria-busy`)===`true`?null:B(M,`none`,{quiet:t})},query:()=>new URLSearchParams(M),setQuery:e=>{let t=new URLSearchParams(M);for(let[n,r]of Object.entries(e??{})){t.delete(n);for(let e of Array.isArray(r)?r:[r])e!=null&&e!==``&&t.append(n,String(e))}return e&&`page`in e||t.delete(`page`),B(t,`push`)},saveRow:je,setActiveRow:e=>{m.dataset.activeRowKey=e==null?``:String(e),ce([...O.querySelectorAll(`:scope > tr`)])},selection:{keys:()=>[...T],count:()=>E?k.total:T.size,allMatching:()=>E,selectAllMatching:()=>{E=!0;for(let e of O.querySelectorAll(`:scope > tr`)){let t=e.querySelector(`.${K} .wui-check`);t?.disabled||(t&&(t.checked=!0),e.dataset.rowKey&&T.add(e.dataset.rowKey))}V()},clear:()=>{E=!1,T.clear();for(let e of O.querySelectorAll(`:scope > tr > .${K} .wui-check:not(:disabled)`))e.checked=!1;V()}}}}var J=`wuiConfirm`,Ot=Object.freeze([`danger`]),kt=Object.freeze([`success`,`info`,`warning`,`danger`]),At=`wui.flash`,Y=Object.freeze({confirmTitle:`Are you sure?`,confirmLabel:`Confirm`,cancelLabel:`Cancel`,failed:`That did not work. Try again.`,forbidden:`You do not have permission to do that.`,network:`Could not reach the server. Check your connection and try again.`}),jt=/* @__PURE__ */ new WeakSet,Mt=/* @__PURE__ */ new WeakSet,Nt=null,Pt=null,Ft=!1,It=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},Lt=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},Rt=()=>{let e=window.bootstrap?.Modal;if(!e)throw Error(`data-wui-confirm: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);return e};function zt(){let n=document.getElementById(J);return n||(n=document.createElement(`div`),n.id=J,n.className=`modal fade wui-modal-shell`,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`dialog`),n.setAttribute(`aria-modal`,`true`),n.style.setProperty(`--wui-modal-max-width`,`${S.md}px`),n.innerHTML=`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal wui-confirm"><div class="wui-modal-body"><div class="wui-confirm-content"><span class="wui-confirm-icon"><wui-status-icon tone="info" size="120"></wui-status-icon></span><h3 class="wui-confirm-title" tabindex="-1" data-autofocus></h3><p class="wui-confirm-msg"></p></div></div><div class="wui-modal-footer"><div class="wui-confirm-actions"><button type="button" class="${e(`secondary`,`md`)}" data-bs-dismiss="modal" data-wui="${t}">${It(Y.cancelLabel)}</button><button type="button" class="${e(`primary`,`md`)}" data-app-confirm data-wui="${t}"></button></div></div></div></div>`,document.body.appendChild(n),n)}function Bt(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!Ot.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);Vt({title:e.getAttribute(`data-wui-confirm-title`),message:e.getAttribute(`data-wui-confirm`),label:e.getAttribute(`data-wui-confirm-label`),danger:n===`danger`},t)}function Vt({title:e,message:t,label:n,danger:r},i){let a=Rt(),o=zt(),s=o.querySelector(`.wui-confirm-title`),c=o.querySelector(`[data-app-confirm]`);if(!s||!c)throw Error(`#${J} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${J}"> without confirm-href, or leave the dialog to the library.`);let l=o.querySelector(`.wui-confirm-msg`);l||(l=document.createElement(`p`),l.className=`wui-confirm-msg`,s.after(l)),s.textContent=e||Y.confirmTitle,l.textContent=t,c.textContent=n||Y.confirmLabel,c.classList.toggle(`btn-danger`,r),c.classList.toggle(`btn-primary`,!r),o.querySelector(`wui-status-icon`)?.setAttribute(`tone`,r?`delete`:`info`),o.setAttribute(`aria-label`,s.textContent),Pt=i,Ft=!1,a.getOrCreateInstance(o).show()}var Ht=(e,t)=>{Nt=e;try{t()}finally{Nt=null}};function Ut(e,{title:t,message:n,label:r,tone:i},a){if(i!=null&&!Ot.includes(i))throw TypeError(`confirmAction: tone "${i}" is not supported. Use danger, or leave it off.`);on(e.ownerDocument),Vt({title:t,message:n,label:r,danger:i===`danger`},()=>Ht(e,a))}var Wt=e=>e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`;function Gt(e){let t=e.target.closest?.(`[data-wui-confirm]:not(form)`);t&&t!==Nt&&!Wt(t)&&(e.preventDefault(),e.stopImmediatePropagation(),Bt(t,()=>Ht(t,()=>t.click())))}function Kt(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===Nt||e.submitter&&e.submitter===Nt||t.querySelector(`input[data-app-repeater-hidden]`))return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter?.form===t?e.submitter:void 0;Bt(t,()=>Ht(t,()=>t.requestSubmit(n)))}function qt(e){let t=e.target.closest?.(`#${J} [data-app-confirm]`);t&&!t.disabled&&Pt&&(Ft=!0,Rt().getOrCreateInstance(t.closest(`#${J}`)).hide())}function Jt(e){if(e.target.id!==`wuiConfirm`)return;let t=Ft?Pt:null;Pt=null,Ft=!1,t?.()}var Yt=(e,t)=>{e&&window.sessionStorage.setItem(At,JSON.stringify({message:e,variant:t}))},Xt=e=>e===`forbidden`?Y.forbidden:e===`network`?Y.network:Y.failed;function Zt(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.dataset.refreshOnSuccess!==`false`&&Et(e)?.reload()}async function Qt(e){let t=e.getAttribute(`data-wui-post`);if(!t)throw Error(`A data-wui-post button needs the URL the action posts to.`);return $t(t,e)}async function $t(e,t,n){let r=t.getAttribute(`data-wui-post-reload`);if(r!==null&&r!==`page`)throw TypeError(`data-wui-post-reload="${r}" is not supported. Use page, or leave it off to reload the server tables.`);t.disabled=!0,t.setAttribute(`aria-busy`,`true`);let a=await i(e,{method:`POST`,body:n});if(a.kind===`session`||a.kind===`aborted`)return;let o=a.toastVariant||`success`;a.ok&&(a.redirect||r===`page`)?(Yt(a.message,o),a.redirect?window.location.assign(a.redirect):window.location.reload()):(t.disabled=!1,t.removeAttribute(`aria-busy`),a.ok?(ht(a,o),Zt()):Lt(a.message||Xt(a.kind),`danger`))}function en(e){let t=e.target.closest?.(`[data-wui-post]`);t&&(e.preventDefault(),Wt(t)||t.getAttribute(`aria-busy`)===`true`||Qt(t).catch(e=>r(e)))}function tn(e){let t=e.target.closest?.(`form[data-wui-post-form]`);if(!t||e.defaultPrevented)return;e.preventDefault();let n=e.submitter||t.querySelector(`button`);n.getAttribute(`aria-busy`)!==`true`&&($t(t.getAttribute(`action`),n,new FormData(t)).catch(e=>r(e)),window.bootstrap?.Dropdown?.getInstance(t.closest(`.dropdown`)?.querySelector(`[data-bs-toggle='dropdown']`))?.hide())}function nn(){let e=window.sessionStorage.getItem(At);if(!e)return;window.sessionStorage.removeItem(At);let{message:t,variant:n}=JSON.parse(e);Lt(t,n)}function rn(e){let t=e.querySelectorAll?[...e.querySelectorAll(`[data-wui-flash]`)]:[];e instanceof Element&&e.matches(`[data-wui-flash]`)&&t.unshift(e);for(let e of t){let t=e.getAttribute(`data-wui-flash-variant`)||`success`;if(!kt.includes(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${kt.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||e.textContent.trim();e.remove(),Lt(n,t)}}function an(e){let t=e.target instanceof Element?e.target.closest(`[data-wui-auto-submit]`):null,n=t&&(e.target.form||t.closest(`form`));n&&n.requestSubmit()}function on(e){Mt.has(e)||(Mt.add(e),e.addEventListener(`click`,qt),e.addEventListener(`hidden.bs.modal`,Jt))}function sn(e=document){let t=e.ownerDocument||e;jt.has(t)||(jt.add(t),t.addEventListener(`click`,Gt,!0),t.addEventListener(`submit`,Kt,!0),on(t),t.addEventListener(`click`,en),t.addEventListener(`submit`,tn),t.addEventListener(`change`,an),nn()),rn(e)}var cn=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),X=`form[data-wui-unsaved]`,ln=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,un=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,dn=/* @__PURE__ */ new Set([`submit`,`button`,`reset`,`image`]),fn=/* @__PURE__ */ new Set([`hidden`,`checkbox`,`radio`,`file`,`submit`,`button`,`reset`,`image`,`range`,`color`]),Z=/* @__PURE__ */ new WeakMap,pn=/* @__PURE__ */ new WeakSet,mn=e=>`${e.name}:${e.size}:${e.lastModified}`;function Q(e){let t=[];for(let n of e.elements)!n.name||n.disabled||dn.has(n.type)||(n.type===`checkbox`||n.type===`radio`?t.push([n.name,n.value,n.checked]):n.type===`file`?t.push([n.name,[...n.files||[]].map(mn)]):n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):t.push([n.name,n.value]));return JSON.stringify(t)}function hn(e){return Q(e)}function gn(e,t){let n=/* @__PURE__ */ new Map;for(let e of JSON.parse(t)){let t=n.get(e[0]);t?t.push(e):n.set(e[0],[e])}let r=JSON.parse(Q(e)).map(e=>n.get(e[0])?.shift()??e);for(let e of n.values())r.push(...e);return JSON.stringify(r)}function _n(e){for(let t of e.elements)if(t.name&&!t.disabled){if(t.tagName===`TEXTAREA`||t.tagName===`INPUT`&&!fn.has(t.type)){if(t.value.trim()!==``)return!0}else if(t.tagName===`INPUT`&&t.type===`file`&&t.files?.length>0)return!0}return!1}var vn=e=>({saved:e.querySelector(ln)&&_n(e)?null:Q(e),engaged:!1,discarded:!1});function yn(e){let t=Z.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&Q(e)!==t.saved}var bn=(e,t)=>[...e.querySelectorAll(X)].filter(e=>e!==t&&yn(e)),xn=()=>!!window.bootstrap?.Modal;function Sn(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||cn.message;Ut(e,{title:cn.title,message:r,label:cn.leaveLabel,tone:`danger`},()=>{for(let e of t)Z.get(e).discarded=!0;n()})}function Cn(e){if(e.matches(un))return!1;let t=e.getAttribute(`target`);if(t&&t.toLowerCase()!==`_self`)return!1;let n=new URL(e.getAttribute(`href`),window.location.href);if(n.protocol!==`http:`&&n.protocol!==`https:`)return!1;let r=window.location;return!(n.hash&&n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search)}function wn(e,t){if((t?.getAttribute(`formmethod`)||e.getAttribute(`method`)||`get`).toLowerCase()===`dialog`)return!1;let n=t?.getAttribute(`formtarget`)||e.getAttribute(`target`);return!n||n.toLowerCase()===`_self`}function Tn(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target.closest?.(`a[href]`);if(!t||!Cn(t))return;let n=bn(t.ownerDocument,null);n.length&&xn()&&(e.preventDefault(),Sn(t,n,()=>t.click()))}function En(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!wn(t,e.submitter))return;let n=bn(t.ownerDocument,t);if(n.length&&xn()){e.preventDefault();let r=e.submitter?.form===t?e.submitter:void 0;Sn(t,n,()=>t.requestSubmit(r));return}let r=Z.get(t);r&&(r.saved=Q(t),r.discarded=!1)}function Dn(e){bn(document,null).length&&(e.preventDefault(),e.returnValue=``)}function On(e){let t=e.target.closest?.(X),n=t&&Z.get(t);n&&!n.engaged&&(n.saved!==null&&(n.saved=Q(t)),n.engaged=!0)}function kn(e){let t=e.target.closest?.(X),n=t&&Z.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function An(e){for(let t of e.currentTarget.querySelectorAll(X)){let e=Z.get(t);e?.saved&&(e.saved=gn(t,e.saved))}}function jn(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(X))Nn(e)}function Mn(e=document){let t=e.ownerDocument||e;if(!pn.has(t)){pn.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,On,!0);for(let e of[`input`,`change`])t.addEventListener(e,kn,!0);t.addEventListener(`click`,Tn),t.addEventListener(`submit`,En),t.addEventListener(`wui:modal:success`,jn),t.addEventListener(g,An),t.defaultView.addEventListener(`beforeunload`,Dn)}let n=[...e.querySelectorAll?.(X)||[]];e.matches?.(X)&&n.unshift(e);for(let e of n)Z.has(e)||Z.set(e,vn(e))}function Nn(e){if(!(e instanceof HTMLFormElement)||!e.matches(X))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);Z.set(e,{saved:Q(e),engaged:!1,discarded:!1})}var Pn=Object.freeze({question:`Discard your changes?`,discard:`Discard`,keep:`Keep editing`}),Fn=`wui:drawer:discard`,In=`wui-drawer[confirm-discard]`,Ln=`.wui-modal-shell`,Rn=`data-wui-no-discard`,zn=`.wui-drawer-discard`,Bn=`input, select, textarea`,$=/* @__PURE__ */ new WeakMap,Vn=/* @__PURE__ */ new WeakSet,Hn=/* @__PURE__ */ new WeakSet;function Un(n,r,i,a){let o=n.createElement(`button`);return o.type=`button`,o.className=e(r,`sm`),o.dataset.wui=t,o.setAttribute(i,``),o.textContent=a,o}function Wn(e,t){let n=e.createElement(`div`);n.className=`wui-drawer-discard`,n.setAttribute(`role`,`alert`);let r=e.createElement(`span`);return r.className=`wui-drawer-discard-text`,r.textContent=t,n.append(r,Un(e,`danger`,`data-wui-discard-confirm`,Pn.discard),Un(e,`secondary`,`data-wui-discard-keep`,Pn.keep)),n}function Gn(e){let t=e.closest?.(In);if(t)return t;let n=e.closest?.(Ln);return n&&Jn(n).length?n:null}function Kn(e){return e.closest(In)??e.closest(Ln)}function qn(e,t){return t.hasAttribute(Rn)||e.hasAttribute(Rn)?!1:t.hasAttribute(`confirm-discard`)||e.hasAttribute(`data-wui-confirm-discard`)?!0:(e.getAttribute(`method`)||`get`).toLowerCase()!==`get`}function Jn(e){return e.matches(In)?e.querySelectorAll(`form`):[...e.querySelectorAll(`form`)].filter(t=>qn(t,e))}function Yn(e){let t=$.get(e);return t!=null&&hn(e)!==t}function Xn(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,e.querySelector(`.wui-drawer-panel`).append(t),Hn.add(t),t}function Zn(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-modal-footer`,(e.querySelector(`.wui-modal-body`)?.parentElement??e.querySelector(`.modal-content`)??e).append(t),Hn.add(t),t}function Qn(e){e.querySelector(`[data-wui-discard-confirm]`).focus()}function $n(e,t,n){let r=e.querySelector(zn);if(r){Qn(r);return}let i=Wn(e.ownerDocument,t),a;e.matches(In)?(a=e.querySelector(`.wui-drawer-footer`)??Xn(e),a.prepend(i)):e.hasAttribute(`confirm-discard`)?(a=e.querySelector(`.wui-modal-footer`)??Zn(e),a.prepend(i)):(a=n.querySelector(`.modal-footer`),a?a.prepend(i):(a=n,n.append(i))),a.classList.add(`wui-drawer-discarding`),Qn(i)}function er(e){let t=e.parentElement;e.remove(),t.classList.remove(`wui-drawer-discarding`),Hn.has(t)&&t.remove()}function tr(e){for(let t of Jn(e)){let e=[...t.querySelectorAll(Bn)].find(e=>e.type!==`hidden`&&!e.disabled);if(e){e.focus();return}}}function nr(e){let t=Gn(e.target);if(t)for(let e of Jn(t))$.get(e)??$.set(e,hn(e))}function rr(e){for(let t of e.currentTarget.querySelectorAll(`form`)){let e=$.get(t);e!=null&&$.set(t,gn(t,e))}}function ir(e){let t=e.target;t instanceof HTMLFormElement&&Gn(t)&&$.set(t,hn(t))}function ar(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(`form`))$.delete(e)}function or(e){let t=e.target;t instanceof Element&&t.matches(In)&&[...Jn(t)].some(Yn)&&(e.preventDefault(),$n(t,t.getAttribute(`confirm-discard`),null))}function sr(e){let t=e.target;if(!(t instanceof Element)||!t.matches(Ln))return;let n=[...Jn(t)].find(Yn);n&&(e.preventDefault(),$n(t,n.getAttribute(`data-wui-confirm-discard`)??t.getAttribute(`confirm-discard`)??Pn.question,n))}function cr(e){let t=e.closest(`wui-drawer`);if(t){t.dispatchEvent(new CustomEvent(`wui-drawer-close`,{bubbles:!0,cancelable:!0}))&&t.hide();return}let n=e.closest(Ln);n&&window.bootstrap?.Modal?.getInstance(n)?.hide()}function lr(e){let t=e.closest(zn),n=Kn(t);er(t);for(let e of Jn(n))$.set(e,hn(e));n.dispatchEvent(new CustomEvent(Fn,{bubbles:!0})),n.matches(In)?n.hide():window.bootstrap.Modal.getInstance(n).hide()}function ur(e){let t=e.closest(zn),n=Kn(t);er(t),tr(n)}function dr(e){let t=e.target,n=t.closest?.(`[data-wui-discard-confirm]`);if(n){lr(n);return}let r=t.closest?.(`[data-wui-discard-keep]`);if(r){ur(r);return}let i=t.closest?.(`[data-wui-dismiss]`);i&&cr(i)}function fr(e){if(e.key!==`Escape`)return;let t=e.currentTarget.querySelector(zn);if(!t)return;e.preventDefault(),e.stopPropagation();let n=Kn(t);er(t),tr(n)}function pr(e=document){let t=e.ownerDocument||e;Vn.has(t)||(Vn.add(t),t.addEventListener(`focusin`,nr),t.addEventListener(`pointerdown`,nr),t.addEventListener(`submit`,ir),t.addEventListener(g,rr),t.addEventListener(`wui:modal:success`,ar),t.addEventListener(`wui:modal:loaded`,ar),t.addEventListener(`wui-drawer-close`,or,!0),t.addEventListener(`hide.bs.modal`,sr),t.addEventListener(`click`,dr),t.addEventListener(`keydown`,fr,!0))}var mr=31536e3,hr=/* @__PURE__ */ new WeakMap,gr=e=>e>99?`99+`:String(e),_r=(e,t)=>Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,()=>String(n)),e);function vr(e,t,n=document){try{n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${mr}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}function yr(e,t,n,r=document){try{let i=`${e}=`,a=r.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(i)),o=new Set(a?a.slice(i.length).split(`.`).filter(Boolean):[]);n?o.add(t):o.delete(t),r.cookie=`${e}=${[...o].join(`.`)}; Path=/; Max-Age=${mr}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}var br=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},xr=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function Sr(e,t){let n=e.querySelector(`.wui-bell-trigger`),r=e.querySelector(`.wui-bell-count`),o=e.querySelector(`[data-wui-bell-live]`),s=e.querySelector(`[data-wui-bell-list]`),c=e.querySelector(`.wui-bell-menu`),{src:l,readAction:u}=e.dataset,d=e.dataset.label||`Notifications`,f=e.dataset.emptyText||`You are all caught up.`,p=e.dataset.loadingText??`Loading…`,m=e.dataset.noUnreadText??`No unread notifications`,h=e.dataset.unreadText??`{count} unread notifications`,g=e.dataset.bellLabel??`{label}, {count} unread`,_=Number(e.dataset.pollSeconds??60),v=a(),y=Number(e.dataset.unread)||0,b=(t,i=!0)=>{let a=Math.max(0,Number(t)||0),s=a!==y;y=a,e.dataset.unread=String(a),r&&(r.textContent=gr(a),r.hidden=a===0),n?.setAttribute(`aria-label`,a===0?d:_r(g,{label:d,count:gr(a)})),i&&s&&o&&(o.textContent=a===0?m:_r(h,{count:gr(a)}))},x=()=>c?.classList.contains(`show`)??!1,S=()=>{let e=xr(`wui-bell-state`,`Could not load notifications. `),t=document.createElement(`button`);t.type=`button`,t.className=`btn btn-link btn-sm`,t.dataset.wuiBellRetry=``,t.textContent=`Retry`,e.append(t),s.replaceChildren(e)},C=async t=>{t&&(s.setAttribute(`aria-busy`,`true`),s.querySelector(`.wui-bell-item`)||s.replaceChildren(xr(`wui-bell-state`,p)));let n=await v.run(l);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(s.removeAttribute(`aria-busy`),!n.ok){t&&S();return}let r=br(n.html),i=r.querySelector(`[data-wui-unread]`),a=i?Number(i.getAttribute(`data-wui-unread`)):y;b(a),(t||x())&&(r.querySelector(`.wui-bell-item`)?s.replaceChildren(r):s.replaceChildren(xr(`wui-bell-state`,f))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:a}}))};e.addEventListener(`show.bs.dropdown`,()=>C(!0)),e.addEventListener(`click`,async e=>{if(e.target.closest(`[data-wui-bell-retry]`)){C(!0);return}let t=e.target.closest(`[data-wui-bell-read]`);if(!t||!u)return;t.disabled=!0;let n=await i(u,{method:`POST`});t.disabled=!1,n.ok&&(b(0),C(!0))});let w=null,T=()=>{_>0&&w===null&&(w=setInterval(()=>C(x()),_*1e3))},E=()=>{w!==null&&clearInterval(w),w=null},ee=()=>{document.hidden?E():(C(x()),T())};return _>0&&(document.addEventListener(`visibilitychange`,ee),document.hidden||T()),t.push(()=>{E(),v.abort(),document.removeEventListener(`visibilitychange`,ee)}),{setUnread:e=>b(e),refresh:()=>C(x())}}var Cr=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),wr=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function Tr(e,t){let n=e.querySelector(`input.search-input`),r=e.querySelector(`.wui-topsearch-results`),i=e.querySelector(`.wui-topsearch-open`),o=e.querySelector(`[data-wui-topsearch-live]`),{src:s,param:c=`q`,resultsHref:l}=e.dataset,u=Number(e.dataset.minChars??2),d=Number(e.dataset.debounceMs??250),f=e.dataset.noResultsText??`No results`,p=e.dataset.resultsCountText??`{count} results`,m=e.dataset.resultCountText??`{count} result`,h=a(),g=null,_=-1,v=()=>[...r.querySelectorAll(`.wui-topsearch-hit`)],y=e=>{let t=v();_=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===_;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)}),_>=0?(n.setAttribute(`aria-activedescendant`,t[_].id),t[_].scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},b=()=>{r.hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),_=-1},x=()=>{r.hidden=!1,n.setAttribute(`aria-expanded`,`true`)},S=t=>{e.classList.toggle(`is-open`,t),i?.setAttribute(`aria-expanded`,t?`true`:`false`)},C=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},w=async t=>{e.classList.add(`is-loading`);let n=await h.run(wr(s,c,t));if(n.kind!==`aborted`&&n.kind!==`stale`&&n.kind!==`session`){if(e.classList.remove(`is-loading`),n.ok){let e=br(n.html),t=e.querySelector(`[data-wui-count]`);r.replaceChildren(e),v().forEach((e,t)=>{e.id=`${r.id}-opt-${t}`});let i=t?Number(t.getAttribute(`data-wui-count`)):v().length;o&&(o.textContent=i===0?f:_r(i===1?m:p,{count:i}))}else r.replaceChildren(xr(`wui-topsearch-empty`,`Search is unavailable right now.`));_=-1,x()}};n.addEventListener(`input`,()=>{clearTimeout(g);let t=n.value.trim();t.length<u?(h.abort(),e.classList.remove(`is-loading`),r.replaceChildren(),b()):g=setTimeout(()=>w(t),d)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(r.hidden||v().length===0)return;t.preventDefault(),y(_+(t.key===`ArrowDown`?1:-1))}else if(t.key===`Enter`){let e=v();!r.hidden&&_>=0&&e[_]?(t.preventDefault(),C(e[_].getAttribute(`href`))):l&&n.value.trim()!==``&&(t.preventDefault(),C(wr(l,c,n.value.trim())))}else t.key===`Escape`&&(r.hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),S(!1),i?.focus()):(t.preventDefault(),t.stopPropagation(),b()))}),r.addEventListener(`click`,e=>{let t=e.target.closest(`.wui-topsearch-hit`);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),C(t.getAttribute(`href`)))}),i?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);S(t),t&&n.focus()});let T=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||Cr(e.target)||(e.preventDefault(),S(!0),n.focus())},E=t=>{e.contains(t.target)||(b(),e.classList.contains(`is-open`)&&S(!1))};document.addEventListener(`keydown`,T),document.addEventListener(`pointerdown`,E),t.push(()=>{clearTimeout(g),h.abort(),document.removeEventListener(`keydown`,T),document.removeEventListener(`pointerdown`,E)})}function Er(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>vr(n,!!e.detail?.collapsed));let r=e.dataset.wuiFoldedCookie;r&&e.addEventListener(`wui:shell:nav-fold`,e=>yr(r,e.detail?.key,!!e.detail?.folded)),e.addEventListener(`click`,t=>{t.target.closest(`[data-wui-tabbar-more]`)&&e.querySelector(`[data-app-shell-menu]`)?.click()});let i=e.querySelector(`[data-wui-bell]`),a=i?Sr(i,t):null,o=e.querySelector(`[data-wui-topsearch]`);o&&Tr(o,t);let s={el:e,setUnread(e){if(!a)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);a.setUnread(e)},refreshNotifications(){if(!a)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);return a.refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=e.querySelector(`[data-app-shell-collapse]`);n?n.click():e.classList.toggle(`collapsed`,!!t)}};hr.set(e,s);let c=n=>{if(n.target===e||n.target.contains?.(e)){for(let e of t)e();hr.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,c)}};return document.addEventListener(`wui:teardown`,c),s}function Dr(e=document){let t=[];e instanceof Element&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...e.querySelectorAll(`[data-app-shell]`));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,Er(e))}function Or(e){let t=e?.closest?.(`[data-app-shell]`)??null;return t?(hr.has(t)||Dr(t),hr.get(t)??null):null}export{it as A,et as C,lt as D,ct as E,Xe as F,Je as I,Qe as L,ut as M,$e as N,ft as O,qe as P,m as R,ht as S,tt as T,sn as _,Wn as a,pt as b,hn as c,J as d,Ot as f,Ut as g,Y as h,Pn as i,at as j,rt as k,Mn as l,kt as m,Dr as n,pr as o,At as p,Fn as r,cn as s,Or as t,Nn as u,Et as v,K as w,gt as x,Tt as y};
|