@webority/ui-elements 0.68.3 → 0.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/{WuiAutocomplete-5pVUMbGl.js → WuiAutocomplete-CYpMjHs3.js} +1 -1
  2. package/dist/{WuiCommentThread-BrCd4o4b.js → WuiCommentThread-BHtcGLX0.js} +1 -1
  3. package/dist/{WuiContextMenu-CBy0O4HT.js → WuiContextMenu-BLNKaFsB.js} +1 -1
  4. package/dist/{WuiCountrySelect-B4O8uijt.js → WuiCountrySelect-DlmQ6qeN.js} +1 -1
  5. package/dist/{WuiDatePicker-CeqLTVTD.js → WuiDatePicker-CpRYPtYz.js} +1 -1
  6. package/dist/{WuiDateRange-Bk45QgnB.js → WuiDateRange-h4lDtS-H.js} +1 -1
  7. package/dist/{WuiHoverCard-BsYAwmbA.js → WuiHoverCard-Ql6CD3BL.js} +1 -1
  8. package/dist/{WuiMentionInput-U87MXi2S.js → WuiMentionInput-BxYXpBRt.js} +1 -1
  9. package/dist/{WuiMenubar-D2tb_3eU.js → WuiMenubar-4MOZ51R_.js} +1 -1
  10. package/dist/{WuiMultiSelect-CR4meVOZ.js → WuiMultiSelect-CBbY_sPD.js} +1 -1
  11. package/dist/{WuiOverflow-CB3j6q6n.js → WuiOverflow-Ixc3PRuW.js} +1 -1
  12. package/dist/{WuiPhone-Cbt2ekvK.js → WuiPhone-BfM_ttOi.js} +1 -1
  13. package/dist/{WuiSelect-C-NN9ZSX.js → WuiSelect-DJgzL9Z_.js} +1 -1
  14. package/dist/{WuiTimePicker-F0KkpOGq.js → WuiTimePicker-BIhwlHuA.js} +1 -1
  15. package/dist/{WuiTour-DW3kPaR9.js → WuiTour-Bi_0ayiH.js} +1 -1
  16. package/dist/{WuiWhatsNew-BO78119Z.js → WuiWhatsNew-68sOQOTO.js} +1 -1
  17. package/dist/{anchorOverlay-WcDeH46q.js → anchorOverlay-HAWsGzlr.js} +1 -1
  18. package/dist/elements/autocomplete.js +1 -1
  19. package/dist/elements/comment-thread.js +1 -1
  20. package/dist/elements/context-menu.js +1 -1
  21. package/dist/elements/country-select.js +1 -1
  22. package/dist/elements/date-range.js +1 -1
  23. package/dist/elements/datepicker.js +1 -1
  24. package/dist/elements/filter-popover.js +1 -1
  25. package/dist/elements/hover-card.js +1 -1
  26. package/dist/elements/kanban.js +1 -1
  27. package/dist/elements/mention-input.js +1 -1
  28. package/dist/elements/menubar.js +1 -1
  29. package/dist/elements/multiselect.js +1 -1
  30. package/dist/elements/overflow.js +1 -1
  31. package/dist/elements/phone.js +1 -1
  32. package/dist/elements/select.js +1 -1
  33. package/dist/elements/timepicker.js +1 -1
  34. package/dist/elements/tour.js +1 -1
  35. package/dist/elements/whats-new.js +1 -1
  36. package/dist/{fileViewerImage-DEhhKbIU.js → fileViewerImage-Du71Tgbf.js} +1 -1
  37. package/dist/{fileViewerMedia-B12HzBnN.js → fileViewerMedia-BWRNH-we.js} +1 -1
  38. package/dist/{fileViewerPdf-L8OJZRPO.js → fileViewerPdf-CL451vuw.js} +1 -1
  39. package/dist/fileViewerUi-DAWY2fNB.js +1 -0
  40. package/dist/{filterPopover-B4nw2nUP.js → filterPopover-BD8kwDfx.js} +1 -1
  41. package/dist/kanban-C0RiKTUx.js +1 -0
  42. package/dist/ui-elements.global.js +112 -112
  43. package/dist/ui-elements.js +1 -1
  44. package/dist/ui-file-viewer.global.js +11 -11
  45. package/dist/ui-file-viewer.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/fileViewerUi-KPTQsM_Y.js +0 -1
  48. package/dist/kanban-DclZZohi.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n}from"./anchorOverlay-WcDeH46q.js";import{t as r}from"./tourOpenMark-nPeAJFSo.js";var i=`data-advance`,a=`wui-tour-hint`,o=`Click {actionName} to continue.`,s=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,c=(e,t)=>e?.advanceOn===`click`&&!!t,l=e=>(e??``).replace(/\s+/g,` `).trim();function u(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=l(e);if(t)return t}return``}function d(e){for(let t of[e,...e.querySelectorAll(s)])if(t.tabIndex>=0&&!t.disabled)return t;return null}function f(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 p(e,t){let n=e.querySelector(`.${a}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t){n?.remove(),i&&f(e,i,!1);return}n||(n=e.ownerDocument.createElement(`p`),n.className=a,i&&(n.id=i),e.querySelector(`.wui-tour-actions`).before(n)),n.textContent=t,i&&f(e,i,!0)}var m=e=>getComputedStyle(e).animationName;function h(e,{layer:t,spot:n,card:r},a,s){let d=c(a,s);t.toggleAttribute(i,d&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(i)&&(n.removeAttribute(i),d&&m(n)),d&&n.setAttribute(i,``);let f=r.querySelector(`.wui-tour-next`);f.classList.toggle(`btn-primary`,!d),f.classList.toggle(`btn-link`,d);let h=d?l(a.actionLabel)||u(s):``,g=e.getAttribute(`advance-label`)||o,_=h?g.replace(/\{actionName\}/g,()=>h):``;return p(r,_),_}function g(e,t,n){if(!c(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)||c(t,n)&&n.contains(r)}function ee(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=c(r,i)?d(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 te=2/3,ne=1e3,v=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`,re=e=>v.has(e.transitionProperty),S=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,ne);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function ie(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?b(t,re):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*te-r)}return n}function w(e){let t=ie(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,S);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function T(e){return e.dataset.state=`leaving`,C(b(e,x))}function ae(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(b(t,x)):null;if(!n){e.remove();return}e.setAttribute(`inert`,``),n.then(()=>e.remove())}var E=2,D=12,O=8,k=4,A=20,oe=`(max-width: 575.98px)`,se=[`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 ce(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=z(e),r=e.offsetHeight+D;if(t.getBoundingClientRect().height+E*2+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 F(e,t,n){let r=e.style,i=t.style,a=B(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`,le(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=z(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(oe).matches,p=se.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?I(t,a,p,o,l,c):m>=Math.min(c.height,u)+k*2?L(t,a,o,l,c):R(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function le(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 I(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 L(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 R(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 z(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 B(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 V=0;function H(e,t,n){let r=`wui-tour-end-${++V}`,i=e.createElement(`div`);return i.className=`wui-tour-card wui-tour-end`,i.dataset.layout=`center`,i.setAttribute(`role`,`dialog`),n&&i.setAttribute(`aria-modal`,`true`),i.tabIndex=-1,i.setAttribute(`aria-labelledby`,`${r}-title`),i.setAttribute(`aria-describedby`,`${r}-message`),i.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="btn btn-sm btn-primary wui-tour-end-button"></button></div>`,i.querySelector(`.wui-tour-end-title`).textContent=t.title,i.querySelector(`.wui-tour-end-message`).textContent=t.message,i.querySelector(`.wui-tour-end-button`).textContent=t.button,i}function U(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=H(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,F(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 W=` :host { all: initial; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay":`0 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out-quart":`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-ink":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-primary-text":`#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-primary-text); } .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-ink); 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-overlay); } .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-quart) 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-quart) calc(var(--wui-tour-card-delay, 0ms) + 120ms) both; } } `,G=`wui-tour-media`,ue=`wui-tour-media-toggle`,K=`http://www.w3.org/2000/svg`,de=`M6 5h4v14H6zM14 5h4v14h-4z`,fe=`M8 5v14l11-7z`,pe={pause:`Pause animation`,play:`Play animation`},me=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function he(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 ge(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 _e(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 ve(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=ue;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(he(r?de:fe))};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 ye(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 be(e,t,n=pe){if(ye(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=G,t.mediaType===`video`){let e=_e(t,!me());r.append(e,ve(e,n))}else r.appendChild(ge(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var xe=`Step {current} of {total}`;function Se(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 Ce(e,t,n){return(e.getAttribute(`progress-label`)||xe).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function we(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 Te=`wui-tour-step`,Ee=`wui-tour-host`,De=`wui-tour-seen:`,q=`data-tracking`,Oe={back:`Back`,next:`Next`,skip:`Skip`,done:`Done`,mediaPause:`Pause animation`,mediaPlay:`Play animation`,endTitle:`You're all set`,endMessage:`You know your way around now. Enjoy exploring.`,endButton:`Done`},ke={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},Ae=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],J={index:null,position:null,total:null},je=0;function Y(e=De,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var X=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Z=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Q=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Me(e){if(`adoptedStyleSheets`in e&&typeof CSSStyleSheet==`function`&&`replaceSync`in CSSStyleSheet.prototype){$||($=new CSSStyleSheet,$.replaceSync(W)),e.adoptedStyleSheets=[$];return}let t=document.createElement(`style`);t.textContent=W,e.appendChild(t)}var Ne=class extends e{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 > ${Te}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:e.textContent.trim()};for(let[n,r]of Ae)e.hasAttribute(r)&&(t[n]=e.getAttribute(r));return t})}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Y():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(ke[e])||Oe[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=Se(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&&!X(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);if(e===this._run){if(!n){this._finish(`noTargets`);return}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))}}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(X(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-${++je}`,n=document.createElement(`div`);n.className=`wui-tour-layer`,n.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="btn btn-sm btn-outline-secondary wui-tour-back"></button> <button type="button" class="btn btn-sm btn-primary wui-tour-next"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let i=n;this._shadow=null,this.isolated&&(i=document.createElement(Ee),this._shadow=i.attachShadow({mode:`open`}),Me(this._shadow),this._shadow.appendChild(n)),document.body.appendChild(i),document.documentElement.setAttribute(r,``),this._outer=i,this._layer=n,this._spot=n.querySelector(`.wui-tour-spot`),this._card=n.querySelector(`.wui-tour-card`),this._live=n.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),t(i,()=>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=Ce(this,a,o);we(i,{text:c,position:a,total:o}),be(i,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)});let l=h(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,ce(i,n),this._spot.removeAttribute(q),this._place(),w(i),this._unbindAdvance?.(),this._unbindAdvance=g(r,n,()=>this._move(1));let f=this._active();(i.contains(f)?!f.hidden:this._shadow!==null&&Z(Q()))||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||F(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(q,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=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,h(this,{layer:this._layer,spot:this._spot,card:this._card},null,null),this._spot.removeAttribute(q),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),U(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(Z(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;ee(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,n(this._outer),ae(this._outer),document.documentElement.removeAttribute(r),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()}:J,a=this._seenMark;this._teardown();try{n===this._run&&await(a??this._markSeen(e))}finally{this._finish(e,i,t)}}_finish(e,t=J,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}};export{Y as n,Ne as t};
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n}from"./anchorOverlay-HAWsGzlr.js";import{t as r}from"./tourOpenMark-nPeAJFSo.js";var i=`data-advance`,a=`wui-tour-hint`,o=`Click {actionName} to continue.`,s=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,c=(e,t)=>e?.advanceOn===`click`&&!!t,l=e=>(e??``).replace(/\s+/g,` `).trim();function u(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=l(e);if(t)return t}return``}function d(e){for(let t of[e,...e.querySelectorAll(s)])if(t.tabIndex>=0&&!t.disabled)return t;return null}function f(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 p(e,t){let n=e.querySelector(`.${a}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t){n?.remove(),i&&f(e,i,!1);return}n||(n=e.ownerDocument.createElement(`p`),n.className=a,i&&(n.id=i),e.querySelector(`.wui-tour-actions`).before(n)),n.textContent=t,i&&f(e,i,!0)}var m=e=>getComputedStyle(e).animationName;function h(e,{layer:t,spot:n,card:r},a,s){let d=c(a,s);t.toggleAttribute(i,d&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(i)&&(n.removeAttribute(i),d&&m(n)),d&&n.setAttribute(i,``);let f=r.querySelector(`.wui-tour-next`);f.classList.toggle(`btn-primary`,!d),f.classList.toggle(`btn-link`,d);let h=d?l(a.actionLabel)||u(s):``,g=e.getAttribute(`advance-label`)||o,_=h?g.replace(/\{actionName\}/g,()=>h):``;return p(r,_),_}function g(e,t,n){if(!c(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)||c(t,n)&&n.contains(r)}function ee(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=c(r,i)?d(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 te=2/3,ne=1e3,v=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`,re=e=>v.has(e.transitionProperty),S=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,ne);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function ie(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?b(t,re):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*te-r)}return n}function w(e){let t=ie(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,S);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function T(e){return e.dataset.state=`leaving`,C(b(e,x))}function ae(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(b(t,x)):null;if(!n){e.remove();return}e.setAttribute(`inert`,``),n.then(()=>e.remove())}var E=2,D=12,O=8,k=4,A=20,oe=`(max-width: 575.98px)`,se=[`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 ce(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=z(e),r=e.offsetHeight+D;if(t.getBoundingClientRect().height+E*2+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 F(e,t,n){let r=e.style,i=t.style,a=B(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`,le(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=z(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(oe).matches,p=se.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?I(t,a,p,o,l,c):m>=Math.min(c.height,u)+k*2?L(t,a,o,l,c):R(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function le(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 I(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 L(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 R(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 z(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 B(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 V=0;function H(e,t,n){let r=`wui-tour-end-${++V}`,i=e.createElement(`div`);return i.className=`wui-tour-card wui-tour-end`,i.dataset.layout=`center`,i.setAttribute(`role`,`dialog`),n&&i.setAttribute(`aria-modal`,`true`),i.tabIndex=-1,i.setAttribute(`aria-labelledby`,`${r}-title`),i.setAttribute(`aria-describedby`,`${r}-message`),i.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="btn btn-sm btn-primary wui-tour-end-button"></button></div>`,i.querySelector(`.wui-tour-end-title`).textContent=t.title,i.querySelector(`.wui-tour-end-message`).textContent=t.message,i.querySelector(`.wui-tour-end-button`).textContent=t.button,i}function U(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=H(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,F(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 W=` :host { all: initial; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay":`0 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out-quart":`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-ink":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-primary-text":`#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-primary-text); } .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-ink); 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-overlay); } .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-quart) 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-quart) calc(var(--wui-tour-card-delay, 0ms) + 120ms) both; } } `,G=`wui-tour-media`,ue=`wui-tour-media-toggle`,K=`http://www.w3.org/2000/svg`,de=`M6 5h4v14H6zM14 5h4v14h-4z`,fe=`M8 5v14l11-7z`,pe={pause:`Pause animation`,play:`Play animation`},me=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function he(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 ge(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 _e(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 ve(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=ue;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(he(r?de:fe))};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 ye(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 be(e,t,n=pe){if(ye(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=G,t.mediaType===`video`){let e=_e(t,!me());r.append(e,ve(e,n))}else r.appendChild(ge(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var xe=`Step {current} of {total}`;function Se(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 Ce(e,t,n){return(e.getAttribute(`progress-label`)||xe).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function we(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 Te=`wui-tour-step`,Ee=`wui-tour-host`,De=`wui-tour-seen:`,q=`data-tracking`,Oe={back:`Back`,next:`Next`,skip:`Skip`,done:`Done`,mediaPause:`Pause animation`,mediaPlay:`Play animation`,endTitle:`You're all set`,endMessage:`You know your way around now. Enjoy exploring.`,endButton:`Done`},ke={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},Ae=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],J={index:null,position:null,total:null},je=0;function Y(e=De,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var X=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Z=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Q=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Me(e){if(`adoptedStyleSheets`in e&&typeof CSSStyleSheet==`function`&&`replaceSync`in CSSStyleSheet.prototype){$||($=new CSSStyleSheet,$.replaceSync(W)),e.adoptedStyleSheets=[$];return}let t=document.createElement(`style`);t.textContent=W,e.appendChild(t)}var Ne=class extends e{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 > ${Te}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:e.textContent.trim()};for(let[n,r]of Ae)e.hasAttribute(r)&&(t[n]=e.getAttribute(r));return t})}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Y():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(ke[e])||Oe[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=Se(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&&!X(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);if(e===this._run){if(!n){this._finish(`noTargets`);return}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))}}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(X(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-${++je}`,n=document.createElement(`div`);n.className=`wui-tour-layer`,n.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="btn btn-sm btn-outline-secondary wui-tour-back"></button> <button type="button" class="btn btn-sm btn-primary wui-tour-next"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let i=n;this._shadow=null,this.isolated&&(i=document.createElement(Ee),this._shadow=i.attachShadow({mode:`open`}),Me(this._shadow),this._shadow.appendChild(n)),document.body.appendChild(i),document.documentElement.setAttribute(r,``),this._outer=i,this._layer=n,this._spot=n.querySelector(`.wui-tour-spot`),this._card=n.querySelector(`.wui-tour-card`),this._live=n.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),t(i,()=>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=Ce(this,a,o);we(i,{text:c,position:a,total:o}),be(i,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)});let l=h(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,ce(i,n),this._spot.removeAttribute(q),this._place(),w(i),this._unbindAdvance?.(),this._unbindAdvance=g(r,n,()=>this._move(1));let f=this._active();(i.contains(f)?!f.hidden:this._shadow!==null&&Z(Q()))||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||F(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(q,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=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,h(this,{layer:this._layer,spot:this._spot,card:this._card},null,null),this._spot.removeAttribute(q),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),U(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(Z(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;ee(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,n(this._outer),ae(this._outer),document.documentElement.removeAttribute(r),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()}:J,a=this._seenMark;this._teardown();try{n===this._run&&await(a??this._markSeen(e))}finally{this._finish(e,i,t)}}_finish(e,t=J,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}};export{Y as n,Ne as t};
@@ -1 +1 @@
1
- import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-WcDeH46q.js";var i=`wui-whats-new-read`,a=`wui-whats-new:`,o=`data-open`,s=`data-wui-unread`,c=0,l=class extends e{static get observedAttributes(){return[`storage-key`]}constructor(){super(),this._doc=null,this._seen=``,this._observer=null,this._onTriggerClick=()=>this.isOpen?this.close(!0):this.open(),this._onKeyDown=e=>{e.key===`Escape`&&this.isOpen&&(e.stopPropagation(),this.close(!0))},this._onPointerDown=e=>{this.isOpen&&!this.contains(e.target)&&this.close(!1)}}get isOpen(){return this.hasAttribute(o)}get _trigger(){return this.querySelector(`.wui-whats-new-trigger`)}get _panel(){return this.querySelector(`.wui-whats-new-panel`)}connectedCallback(){this._doc=this.ownerDocument;let e=this._panel,t=this._trigger;!e||!t||(e.id||=`wui-whats-new-${++c}`,t.setAttribute(`aria-controls`,e.id),t.setAttribute(`aria-expanded`,`false`),t.addEventListener(`click`,this._onTriggerClick),this.addEventListener(`keydown`,this._onKeyDown),this._seen=this._load(),this._refresh(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(()=>this._refresh()),this._observer.observe(e,{childList:!0,subtree:!0})))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._trigger?.removeEventListener(`click`,this._onTriggerClick),this.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`pointerdown`,this._onPointerDown,!0),n(this),this.removeAttribute(o),this._doc=null}attributeChangedCallback(e,t,n){t===n||!this._doc||(this._seen=this._load(),this._refresh())}open(){let e=this._panel;!e||this.isOpen||(this.setAttribute(o,``),this._trigger?.setAttribute(`aria-expanded`,`true`),this._place(),t(this,()=>this._place()),this._doc.addEventListener(`pointerdown`,this._onPointerDown,!0),e.focus({preventScroll:!0}),this._markRead())}close(e){this.isOpen&&(this.removeAttribute(o),this._trigger?.setAttribute(`aria-expanded`,`false`),this._doc.removeEventListener(`pointerdown`,this._onPointerDown,!0),n(this),this._refresh(),e&&this._trigger?.focus())}_place(){r(this._trigger,this._panel,{clampHeight:!0})}_entries(){return[...this.querySelectorAll(`.wui-whats-new-entry`)].map(e=>({entry:e,date:e.querySelector(`time[datetime]`)?.getAttribute(`datetime`)??``}))}_newest(){return this._entries().reduce((e,{date:t})=>t>e?t:e,``)}_refresh(){let e=this._entries(),t=0;for(let{entry:n,date:r}of e){let e=r>this._seen;e&&t++,!(this.isOpen&&n.hasAttribute(s))&&n.toggleAttribute(s,e)}this.toggleAttribute(s,t>0)}_markRead(){let e=this._newest();!e||e<=this._seen||(this._seen=e,this._save(e),this.toggleAttribute(s,!1),this.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:{through:e}})))}_storage(){let e=this.getAttribute(`storage-key`);if(!e)return null;try{return{store:this.ownerDocument.defaultView.localStorage,key:a+e}}catch{return null}}_load(){let e=this._storage();return e?e.store.getItem(e.key)??``:this._seen}_save(e){let t=this._storage();t&&t.store.setItem(t.key,e)}};export{l as n,i as t};
1
+ import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-HAWsGzlr.js";var i=`wui-whats-new-read`,a=`wui-whats-new:`,o=`data-open`,s=`data-wui-unread`,c=0,l=class extends e{static get observedAttributes(){return[`storage-key`]}constructor(){super(),this._doc=null,this._seen=``,this._observer=null,this._onTriggerClick=()=>this.isOpen?this.close(!0):this.open(),this._onKeyDown=e=>{e.key===`Escape`&&this.isOpen&&(e.stopPropagation(),this.close(!0))},this._onPointerDown=e=>{this.isOpen&&!this.contains(e.target)&&this.close(!1)}}get isOpen(){return this.hasAttribute(o)}get _trigger(){return this.querySelector(`.wui-whats-new-trigger`)}get _panel(){return this.querySelector(`.wui-whats-new-panel`)}connectedCallback(){this._doc=this.ownerDocument;let e=this._panel,t=this._trigger;!e||!t||(e.id||=`wui-whats-new-${++c}`,t.setAttribute(`aria-controls`,e.id),t.setAttribute(`aria-expanded`,`false`),t.addEventListener(`click`,this._onTriggerClick),this.addEventListener(`keydown`,this._onKeyDown),this._seen=this._load(),this._refresh(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(()=>this._refresh()),this._observer.observe(e,{childList:!0,subtree:!0})))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._trigger?.removeEventListener(`click`,this._onTriggerClick),this.removeEventListener(`keydown`,this._onKeyDown),this._doc?.removeEventListener(`pointerdown`,this._onPointerDown,!0),n(this),this.removeAttribute(o),this._doc=null}attributeChangedCallback(e,t,n){t===n||!this._doc||(this._seen=this._load(),this._refresh())}open(){let e=this._panel;!e||this.isOpen||(this.setAttribute(o,``),this._trigger?.setAttribute(`aria-expanded`,`true`),this._place(),t(this,()=>this._place()),this._doc.addEventListener(`pointerdown`,this._onPointerDown,!0),e.focus({preventScroll:!0}),this._markRead())}close(e){this.isOpen&&(this.removeAttribute(o),this._trigger?.setAttribute(`aria-expanded`,`false`),this._doc.removeEventListener(`pointerdown`,this._onPointerDown,!0),n(this),this._refresh(),e&&this._trigger?.focus())}_place(){r(this._trigger,this._panel,{clampHeight:!0})}_entries(){return[...this.querySelectorAll(`.wui-whats-new-entry`)].map(e=>({entry:e,date:e.querySelector(`time[datetime]`)?.getAttribute(`datetime`)??``}))}_newest(){return this._entries().reduce((e,{date:t})=>t>e?t:e,``)}_refresh(){let e=this._entries(),t=0;for(let{entry:n,date:r}of e){let e=r>this._seen;e&&t++,!(this.isOpen&&n.hasAttribute(s))&&n.toggleAttribute(s,e)}this.toggleAttribute(s,t>0)}_markRead(){let e=this._newest();!e||e<=this._seen||(this._seen=e,this._save(e),this.toggleAttribute(s,!1),this.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:{through:e}})))}_storage(){let e=this.getAttribute(`storage-key`);if(!e)return null;try{return{store:this.ownerDocument.defaultView.localStorage,key:a+e}}catch{return null}}_load(){let e=this._storage();return e?e.store.getItem(e.key)??``:this._seen}_save(e){let t=this._storage();t&&t.store.setItem(t.key,e)}};export{l as n,i as t};
@@ -1 +1 @@
1
- function e(e,t,n={}){if(!e||!t)return;let r=e.getBoundingClientRect(),i=n.clampHeight?t.scrollTop:0;n.clampHeight&&(t.style.maxHeight=``);let a=t.offsetHeight,o=window.innerHeight-r.bottom,s=o<a+4&&r.top>o;if(t.classList.toggle(`drop-up`,s),t.style.position=`fixed`,t.style.top=s?`${Math.max(4,r.top-a-4)}px`:`${r.bottom+4}px`,n.clampHeight){let e=s?r.top-8:window.innerHeight-r.bottom-8;e<a&&(t.style.maxHeight=`${Math.max(e,0)}px`),t.scrollTop=i}n.matchWidth&&(r.width>=300?(t.style.minWidth=`${r.width}px`,t.style.width=`${r.width}px`,t.style.maxWidth=`${r.width}px`):(t.style.minWidth=`${r.width}px`,t.style.width=`max-content`,t.style.maxWidth=`${Math.min(400,window.innerWidth-8)}px`));let c=t.offsetWidth,l=Math.min(r.left,window.innerWidth-c-4);t.style.left=`${Math.max(4,l)}px`}function t(e,t){n(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 n(e){e?._reanchor&&(window.removeEventListener(`resize`,e._reanchor),window.removeEventListener(`scroll`,e._reanchorScroll,!0),e._reanchor=null,e._reanchorScroll=null)}export{t as n,n as r,e as t};
1
+ function e(e,t,n={}){if(!e||!t)return;let r=e.getBoundingClientRect(),i=n.clampHeight?t.scrollTop:0;n.clampHeight&&(t.style.maxHeight=``);let a=t.offsetHeight,o=window.innerHeight-r.bottom,s=o<a+4&&r.top>o;if(t.classList.toggle(`drop-up`,s),t.style.position=`fixed`,t.style.top=s?`${Math.max(4,r.top-a-4)}px`:`${r.bottom+4}px`,n.clampHeight){let e=s?r.top-8:window.innerHeight-r.bottom-8;e<a&&(t.style.maxHeight=`${Math.max(e,0)}px`),t.scrollTop=i}n.matchWidth&&(r.width>=300?(t.style.minWidth=`${r.width}px`,t.style.width=`${r.width}px`,t.style.maxWidth=`${r.width}px`):(t.style.minWidth=`${r.width}px`,t.style.width=`max-content`,t.style.maxWidth=`${Math.min(400,window.innerWidth-8)}px`));let c=t.offsetWidth;if(n.alignEnd){let e=r.right-c,n=Math.min(e,window.innerWidth-c-8);t.style.left=`${Math.max(8,n)}px`}else{let e=Math.min(r.left,window.innerWidth-c-4);t.style.left=`${Math.max(4,e)}px`}}function t(e,t){n(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 n(e){e?._reanchor&&(window.removeEventListener(`resize`,e._reanchor),window.removeEventListener(`scroll`,e._reanchorScroll,!0),e._reanchor=null,e._reanchorScroll=null)}export{t as n,n as r,e as t};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiAutocomplete-5pVUMbGl.js";e(`wui-autocomplete`,t);export{t as WuiAutocomplete};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiAutocomplete-CYpMjHs3.js";e(`wui-autocomplete`,t);export{t as WuiAutocomplete};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{i as t,n,r,t as i}from"../WuiCommentThread-BrCd4o4b.js";import"./mention-input.js";e(`wui-comment-thread`,t);export{i as COMMENT_INTENTS,n as COMMENT_REACTIONS,r as COMMENT_TEXT,t as WuiCommentThread};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{i as t,n,r,t as i}from"../WuiCommentThread-BHtcGLX0.js";import"./mention-input.js";e(`wui-comment-thread`,t);export{i as COMMENT_INTENTS,n as COMMENT_REACTIONS,r as COMMENT_TEXT,t as WuiCommentThread};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiContextMenu-CBy0O4HT.js";e(`wui-context-menu`,t);export{t as WuiContextMenu};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiContextMenu-BLNKaFsB.js";e(`wui-context-menu`,t);export{t as WuiContextMenu};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCountrySelect-B4O8uijt.js";e(`wui-country-select`,t);export{t as WuiCountrySelect};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiCountrySelect-DlmQ6qeN.js";e(`wui-country-select`,t);export{t as WuiCountrySelect};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDateRange-Bk45QgnB.js";e(`wui-date-range`,t);export{t as WuiDateRange};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDateRange-h4lDtS-H.js";e(`wui-date-range`,t);export{t as WuiDateRange};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDatePicker-CeqLTVTD.js";e(`wui-datepicker`,t);export{t as WuiDatePicker};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDatePicker-CpRYPtYz.js";e(`wui-datepicker`,t);export{t as WuiDatePicker};
@@ -1 +1 @@
1
- import{n as e,t}from"../filterPopover-B4nw2nUP.js";e();export{t as FILTER_POPOVER_MAX_CHIPS};
1
+ import{n as e,t}from"../filterPopover-BD8kwDfx.js";e();export{t as FILTER_POPOVER_MAX_CHIPS};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiHoverCard-BsYAwmbA.js";e(`wui-hover-card`,t);export{t as WuiHoverCard};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiHoverCard-Ql6CD3BL.js";e(`wui-hover-card`,t);export{t as WuiHoverCard};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"../kanban-DclZZohi.js";e(`wui-kanban`,n);export{h as KANBAN_DRAG_THRESHOLD_PX,u as KANBAN_LONG_PRESS_MS,p as KANBAN_PHONE_QUERY,s as KANBAN_STORAGE_PREFIX,t as KANBAN_SUMMARY_FORMATS,d as KANBAN_TEXT,m as KANBAN_TONES,n as WuiKanban,c as kanbanCardLabel,g as kanbanOverflow,r as kanbanStorageKey,i as kanbanSummaryFormat,f as kanbanVisibleLimit,l as readKanbanCollapsed,o as sumKanbanValues,a as writeKanbanCollapsed};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"../kanban-C0RiKTUx.js";e(`wui-kanban`,n);export{h as KANBAN_DRAG_THRESHOLD_PX,u as KANBAN_LONG_PRESS_MS,p as KANBAN_PHONE_QUERY,s as KANBAN_STORAGE_PREFIX,t as KANBAN_SUMMARY_FORMATS,d as KANBAN_TEXT,m as KANBAN_TONES,n as WuiKanban,c as kanbanCardLabel,g as kanbanOverflow,r as kanbanStorageKey,i as kanbanSummaryFormat,f as kanbanVisibleLimit,l as readKanbanCollapsed,o as sumKanbanValues,a as writeKanbanCollapsed};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"../WuiMentionInput-U87MXi2S.js";e(`wui-mention-input`,r);export{t as MENTION_ID_PATTERN,l as MENTION_MAX_QUERY,a as MENTION_MAX_RESULTS,s as MENTION_TEXT,r as WuiMentionInput,o as mentionLabel,c as mentionTextFromValue,n as mentionValueFromText,i as mentionedIds,u as parseMentionValue};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"../WuiMentionInput-BxYXpBRt.js";e(`wui-mention-input`,r);export{t as MENTION_ID_PATTERN,l as MENTION_MAX_QUERY,a as MENTION_MAX_RESULTS,s as MENTION_TEXT,r as WuiMentionInput,o as mentionLabel,c as mentionTextFromValue,n as mentionValueFromText,i as mentionedIds,u as parseMentionValue};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiMenubar-D2tb_3eU.js";e(`wui-menubar`,t);export{t as WuiMenubar};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiMenubar-4MOZ51R_.js";e(`wui-menubar`,t);export{t as WuiMenubar};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiMultiSelect-CR4meVOZ.js";e(`wui-multiselect`,t);export{t as WuiMultiSelect};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiMultiSelect-CBbY_sPD.js";e(`wui-multiselect`,t);export{t as WuiMultiSelect};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiOverflow-CB3j6q6n.js";e(`wui-overflow`,t);export{t as WuiOverflow};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiOverflow-Ixc3PRuW.js";e(`wui-overflow`,t);export{t as WuiOverflow};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiPhone-Cbt2ekvK.js";e(`wui-phone`,t);export{t as WuiPhone};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiPhone-BfM_ttOi.js";e(`wui-phone`,t);export{t as WuiPhone};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiSelect-C-NN9ZSX.js";e(`wui-select`,t);export{t as WuiSelect};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiSelect-DJgzL9Z_.js";e(`wui-select`,t);export{t as WuiSelect};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiTimePicker-F0KkpOGq.js";e(`wui-timepicker`,t);export{t as WuiTimePicker};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiTimePicker-BIhwlHuA.js";e(`wui-timepicker`,t);export{t as WuiTimePicker};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,t as n}from"../WuiTour-DW3kPaR9.js";e(`wui-tour`,n);export{n as WuiTour,t as createLocalSeenStore};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,t as n}from"../WuiTour-Bi_0ayiH.js";e(`wui-tour`,n);export{n as WuiTour,t as createLocalSeenStore};
@@ -1 +1 @@
1
- import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,t as n}from"../WuiWhatsNew-BO78119Z.js";e(`wui-whats-new`,t);export{n as WHATS_NEW_READ_EVENT,t as WuiWhatsNew};
1
+ import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,t as n}from"../WuiWhatsNew-68sOQOTO.js";e(`wui-whats-new`,t);export{n as WHATS_NEW_READ_EVENT,t as WuiWhatsNew};
@@ -1,4 +1,4 @@
1
- import{a as e,n as t,t as n}from"./fileViewerUi-KPTQsM_Y.js";var r=[.1,.25,.5,.75,1,1.5,2,3,4],i=[.25,.5,1,2,4],a=16,o=5,s=class{constructor(e,t){this.shell=e,this.source=t,this.zoom=`fit`,this.rotation=0,this.area={width:0,height:0},this.destroyed=!1}load(){let e=document.createElement(`img`);e.className=`wui-file-viewer-image`,e.alt=this.shell.name(),e.decoding=`async`,e.draggable=!1,e.addEventListener(`load`,()=>{this.destroyed||(this.natural={width:e.naturalWidth||300,height:e.naturalHeight||150},this._build(e),this.shell.loaded({kind:`image`,pages:1}))}),e.addEventListener(`error`,()=>{this.destroyed||this.shell.fail(Error(`The image could not be decoded.`))}),e.src=this.source.src,this.img=e}destroy(){this.destroyed=!0,this._resizeObserver?.disconnect(),this._onKeyDown&&this.shell.host.removeEventListener(`keydown`,this._onKeyDown),this._printFrame?.remove(),this.img?.removeAttribute(`src`)}_build(e){let{center:r,end:a,body:o,host:s}=this.shell;this.zoomOutButton=n(`zoom-out`,`Zoom out`),this.zoomOutButton.addEventListener(`click`,()=>this._stepZoom(-1)),this.zoomButton=document.createElement(`button`),this.zoomButton.type=`button`,this.zoomButton.className=`wui-file-viewer-zoom`,t(this.zoomButton,{label:`Zoom`,items:()=>[...i.map(e=>({key:String(e),label:`${Math.round(e*100)}%`,checked:this.zoom===e})),{key:`fit-divider`,divider:!0},{key:`fit`,label:`Fit`,checked:this.zoom===`fit`}],onPick:e=>this._setZoom(e===`fit`?`fit`:Number(e))}),this.zoomInButton=n(`zoom-in`,`Zoom in`),this.zoomInButton.addEventListener(`click`,()=>this._stepZoom(1));let c=n(`rotate-ccw`,`Rotate left`);c.addEventListener(`click`,()=>this._rotate(-90));let l=n(`rotate-cw`,`Rotate right`);l.addEventListener(`click`,()=>this._rotate(90));let u=document.createElement(`span`);u.className=`wui-file-viewer-divider wui-file-viewer-print`;let d=n(`printer`,`Print`,{className:`wui-file-viewer-print`});d.addEventListener(`click`,()=>this.print()),u.hidden=d.hidden=!this.shell.print(),r.append(this.zoomOutButton,this.zoomButton,this.zoomInButton),a.prepend(c,l,u,d),this.scroller=document.createElement(`div`),this.scroller.className=`wui-file-viewer-scroll wui-file-viewer-image-scroll wui-scroll`,this.scroller.tabIndex=0,this.scroller.setAttribute(`role`,`region`),this.scroller.setAttribute(`aria-label`,`Image`),this.stage=document.createElement(`div`),this.stage.className=`wui-file-viewer-image-stage`,this.stage.append(e),this.scroller.append(this.stage),o.replaceChildren(this.scroller),this.scroller.addEventListener(`pointerdown`,e=>this._panStart(e)),this.scroller.addEventListener(`pointermove`,e=>this._panMove(e));for(let e of[`pointerup`,`pointercancel`,`lostpointercapture`])this.scroller.addEventListener(e,()=>this._panEnd());this.scroller.addEventListener(`wheel`,e=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let t=performance.now();t-(this._lastWheelZoom??0)<120||(this._lastWheelZoom=t,this._stepZoom(e.deltaY<0?1:-1))},{passive:!1}),this._onKeyDown=e=>this._keyDown(e),s.addEventListener(`keydown`,this._onKeyDown),this._resizeObserver=new ResizeObserver(()=>{let e=this.scroller.clientWidth,t=this.scroller.clientHeight;e===this.area.width&&t===this.area.height||(this.area={width:e,height:t},this._layout())}),this._resizeObserver.observe(this.scroller),this.area={width:this.scroller.clientWidth,height:this.scroller.clientHeight},this._layout()}_turned(){let{width:e,height:t}=this.natural;return this.rotation%180==0?{width:e,height:t}:{width:t,height:e}}scale(){if(typeof this.zoom==`number`)return this.zoom;let{width:e,height:t}=this._turned(),n=Math.min((this.area.width-2*a)/e,(this.area.height-2*a)/t);return Math.max(n,.01)}_layout(){if(!this.stage)return;let t=this.scale(),n=this._turned();this.stage.style.width=`${Math.round(n.width*t)}px`,this.stage.style.height=`${Math.round(n.height*t)}px`,this.img.style.width=`${Math.round(this.natural.width*t)}px`,this.img.style.height=`${Math.round(this.natural.height*t)}px`,this.img.style.transform=`translate(-50%, -50%) rotate(${this.rotation}deg)`;let r=Math.round(t*100);this.zoomButton.innerHTML=`${r}%${e(`chevron-down`,{size:12})}`,this.zoomButton.setAttribute(`aria-label`,`Zoom, ${r}%`),this.zoomOutButton.disabled=this._zoomStep(-1)==null,this.zoomInButton.disabled=this._zoomStep(1)==null}_zoomStep(e){let t=this.scale();return e>0?r.find(e=>e>t+.001)??null:[...r].reverse().find(e=>e<t-.001)??null}_stepZoom(e){let t=this._zoomStep(e);t!=null&&this._setZoom(t)}_setZoom(e){let t=this.scroller,n=(t.scrollLeft+t.clientWidth/2)/Math.max(t.scrollWidth,1),r=(t.scrollTop+t.clientHeight/2)/Math.max(t.scrollHeight,1);this.zoom=e,this._layout(),t.scrollLeft=n*t.scrollWidth-t.clientWidth/2,t.scrollTop=r*t.scrollHeight-t.clientHeight/2}_rotate(e){this.rotation=(this.rotation+e+360)%360,this._setZoom(this.zoom)}_keyDown(e){if(!(e.defaultPrevented||e.altKey||!(e.ctrlKey||e.metaKey))){if(e.key===`+`||e.key===`=`)this._stepZoom(1);else if(e.key===`-`||e.key===`_`)this._stepZoom(-1);else if(e.key===`0`)this._setZoom(`fit`);else return;e.preventDefault()}}_panStart(e){let t=this.scroller;e.button!==0||t.scrollWidth<=t.clientWidth&&t.scrollHeight<=t.clientHeight||(this._pan={id:e.pointerId,x:e.clientX,y:e.clientY,left:t.scrollLeft,top:t.scrollTop,active:!1})}_panMove(e){let t=this._pan;if(!t)return;let n=e.clientX-t.x,r=e.clientY-t.y;if(!t.active){if(Math.abs(n)<o&&Math.abs(r)<o)return;t.active=!0,this.scroller.setPointerCapture(t.id),this.scroller.classList.add(`wui-file-viewer-panning`)}this.scroller.scrollLeft=t.left-n,this.scroller.scrollTop=t.top-r}_panEnd(){let e=this._pan;e?.active&&(this.scroller.hasPointerCapture(e.id)&&this.scroller.releasePointerCapture(e.id),this.scroller.classList.remove(`wui-file-viewer-panning`)),this._pan=null}print(){this._printFrame?.remove();let e=document.createElement(`iframe`);e.className=`wui-file-viewer-print-frame`,e.title=`Image for printing`,e.tabIndex=-1,e.setAttribute(`aria-hidden`,`true`);let t=this.rotation%180!=0,n=new URL(this.source.src,document.baseURI).href,r=t?`max-width: 100vh; max-height: 100vw;`:`max-width: 100vw; max-height: 100vh;`;e.srcdoc=`<!doctype html><html><head><title>${c(this.shell.name())}</title><style>
1
+ import{a as e,n as t,t as n}from"./fileViewerUi-DAWY2fNB.js";var r=[.1,.25,.5,.75,1,1.5,2,3,4],i=[.25,.5,1,2,4],a=16,o=5,s=class{constructor(e,t){this.shell=e,this.source=t,this.zoom=`fit`,this.rotation=0,this.area={width:0,height:0},this.destroyed=!1}load(){let e=document.createElement(`img`);e.className=`wui-file-viewer-image`,e.alt=this.shell.name(),e.decoding=`async`,e.draggable=!1,e.addEventListener(`load`,()=>{this.destroyed||(this.natural={width:e.naturalWidth||300,height:e.naturalHeight||150},this._build(e),this.shell.loaded({kind:`image`,pages:1}))}),e.addEventListener(`error`,()=>{this.destroyed||this.shell.fail(Error(`The image could not be decoded.`))}),e.src=this.source.src,this.img=e}destroy(){this.destroyed=!0,this._resizeObserver?.disconnect(),this._onKeyDown&&this.shell.host.removeEventListener(`keydown`,this._onKeyDown),this._printFrame?.remove(),this.img?.removeAttribute(`src`)}_build(e){let{center:r,end:a,body:o,host:s}=this.shell;this.zoomOutButton=n(`zoom-out`,`Zoom out`),this.zoomOutButton.addEventListener(`click`,()=>this._stepZoom(-1)),this.zoomButton=document.createElement(`button`),this.zoomButton.type=`button`,this.zoomButton.className=`wui-file-viewer-zoom`,t(this.zoomButton,{label:`Zoom`,items:()=>[...i.map(e=>({key:String(e),label:`${Math.round(e*100)}%`,checked:this.zoom===e})),{key:`fit-divider`,divider:!0},{key:`fit`,label:`Fit`,checked:this.zoom===`fit`}],onPick:e=>this._setZoom(e===`fit`?`fit`:Number(e))}),this.zoomInButton=n(`zoom-in`,`Zoom in`),this.zoomInButton.addEventListener(`click`,()=>this._stepZoom(1));let c=n(`rotate-ccw`,`Rotate left`);c.addEventListener(`click`,()=>this._rotate(-90));let l=n(`rotate-cw`,`Rotate right`);l.addEventListener(`click`,()=>this._rotate(90));let u=document.createElement(`span`);u.className=`wui-file-viewer-divider wui-file-viewer-print`;let d=n(`printer`,`Print`,{className:`wui-file-viewer-print`});d.addEventListener(`click`,()=>this.print()),u.hidden=d.hidden=!this.shell.print(),r.append(this.zoomOutButton,this.zoomButton,this.zoomInButton),a.prepend(c,l,u,d),this.scroller=document.createElement(`div`),this.scroller.className=`wui-file-viewer-scroll wui-file-viewer-image-scroll wui-scroll`,this.scroller.tabIndex=0,this.scroller.setAttribute(`role`,`region`),this.scroller.setAttribute(`aria-label`,`Image`),this.stage=document.createElement(`div`),this.stage.className=`wui-file-viewer-image-stage`,this.stage.append(e),this.scroller.append(this.stage),o.replaceChildren(this.scroller),this.scroller.addEventListener(`pointerdown`,e=>this._panStart(e)),this.scroller.addEventListener(`pointermove`,e=>this._panMove(e));for(let e of[`pointerup`,`pointercancel`,`lostpointercapture`])this.scroller.addEventListener(e,()=>this._panEnd());this.scroller.addEventListener(`wheel`,e=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let t=performance.now();t-(this._lastWheelZoom??0)<120||(this._lastWheelZoom=t,this._stepZoom(e.deltaY<0?1:-1))},{passive:!1}),this._onKeyDown=e=>this._keyDown(e),s.addEventListener(`keydown`,this._onKeyDown),this._resizeObserver=new ResizeObserver(()=>{let e=this.scroller.clientWidth,t=this.scroller.clientHeight;e===this.area.width&&t===this.area.height||(this.area={width:e,height:t},this._layout())}),this._resizeObserver.observe(this.scroller),this.area={width:this.scroller.clientWidth,height:this.scroller.clientHeight},this._layout()}_turned(){let{width:e,height:t}=this.natural;return this.rotation%180==0?{width:e,height:t}:{width:t,height:e}}scale(){if(typeof this.zoom==`number`)return this.zoom;let{width:e,height:t}=this._turned(),n=Math.min((this.area.width-2*a)/e,(this.area.height-2*a)/t);return Math.max(n,.01)}_layout(){if(!this.stage)return;let t=this.scale(),n=this._turned();this.stage.style.width=`${Math.round(n.width*t)}px`,this.stage.style.height=`${Math.round(n.height*t)}px`,this.img.style.width=`${Math.round(this.natural.width*t)}px`,this.img.style.height=`${Math.round(this.natural.height*t)}px`,this.img.style.transform=`translate(-50%, -50%) rotate(${this.rotation}deg)`;let r=Math.round(t*100);this.zoomButton.innerHTML=`${r}%${e(`chevron-down`,{size:12})}`,this.zoomButton.setAttribute(`aria-label`,`Zoom, ${r}%`),this.zoomOutButton.disabled=this._zoomStep(-1)==null,this.zoomInButton.disabled=this._zoomStep(1)==null}_zoomStep(e){let t=this.scale();return e>0?r.find(e=>e>t+.001)??null:[...r].reverse().find(e=>e<t-.001)??null}_stepZoom(e){let t=this._zoomStep(e);t!=null&&this._setZoom(t)}_setZoom(e){let t=this.scroller,n=(t.scrollLeft+t.clientWidth/2)/Math.max(t.scrollWidth,1),r=(t.scrollTop+t.clientHeight/2)/Math.max(t.scrollHeight,1);this.zoom=e,this._layout(),t.scrollLeft=n*t.scrollWidth-t.clientWidth/2,t.scrollTop=r*t.scrollHeight-t.clientHeight/2}_rotate(e){this.rotation=(this.rotation+e+360)%360,this._setZoom(this.zoom)}_keyDown(e){if(!(e.defaultPrevented||e.altKey||!(e.ctrlKey||e.metaKey))){if(e.key===`+`||e.key===`=`)this._stepZoom(1);else if(e.key===`-`||e.key===`_`)this._stepZoom(-1);else if(e.key===`0`)this._setZoom(`fit`);else return;e.preventDefault()}}_panStart(e){let t=this.scroller;e.button!==0||t.scrollWidth<=t.clientWidth&&t.scrollHeight<=t.clientHeight||(this._pan={id:e.pointerId,x:e.clientX,y:e.clientY,left:t.scrollLeft,top:t.scrollTop,active:!1})}_panMove(e){let t=this._pan;if(!t)return;let n=e.clientX-t.x,r=e.clientY-t.y;if(!t.active){if(Math.abs(n)<o&&Math.abs(r)<o)return;t.active=!0,this.scroller.setPointerCapture(t.id),this.scroller.classList.add(`wui-file-viewer-panning`)}this.scroller.scrollLeft=t.left-n,this.scroller.scrollTop=t.top-r}_panEnd(){let e=this._pan;e?.active&&(this.scroller.hasPointerCapture(e.id)&&this.scroller.releasePointerCapture(e.id),this.scroller.classList.remove(`wui-file-viewer-panning`)),this._pan=null}print(){this._printFrame?.remove();let e=document.createElement(`iframe`);e.className=`wui-file-viewer-print-frame`,e.title=`Image for printing`,e.tabIndex=-1,e.setAttribute(`aria-hidden`,`true`);let t=this.rotation%180!=0,n=new URL(this.source.src,document.baseURI).href,r=t?`max-width: 100vh; max-height: 100vw;`:`max-width: 100vw; max-height: 100vh;`;e.srcdoc=`<!doctype html><html><head><title>${c(this.shell.name())}</title><style>
2
2
  @page { margin: 10mm; }
3
3
  html, body { margin: 0; height: 100%; }
4
4
  body { display: flex; align-items: center; justify-content: center; }
@@ -1 +1 @@
1
- import{a as e,i as t,n,r,t as i}from"./fileViewerUi-KPTQsM_Y.js";var a=[.5,.75,1,1.25,1.5,2],o=5,s=.1;function c(e){if(!Number.isFinite(e)||e<0)return`0:00`;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=String(t%60).padStart(2,`0`);return n?`${n}:${String(r).padStart(2,`0`)}:${i}`:`${r}:${i}`}var l=e=>e instanceof Element&&e.closest(`input, textarea, select, button, a, .dropdown-menu`),u=class{constructor(e,t){this.shell=e,this.source=t,this.destroyed=!1}load(){let{kind:e,src:t,captions:n}=this.source,r=document.createElement(e);if(r.className=`wui-file-viewer-${e}`,r.preload=`metadata`,r.playsInline=!0,e===`video`&&n){let e=document.createElement(`track`);e.kind=`captions`,e.label=`Captions`,e.srclang=`en`,e.src=n,r.append(e)}let i=this.shell.prefs;typeof i.volume==`number`&&(r.volume=Math.min(Math.max(i.volume,0),1)),r.muted=i.muted===!0,r.addEventListener(`loadedmetadata`,()=>{this.destroyed||(r.playbackRate=a.includes(i.speed)?i.speed:1,this._build(),this.shell.loaded({kind:e,pages:1}))},{once:!0}),r.addEventListener(`error`,()=>{this.destroyed||this.shell.fail(Error(`The file could not be played.`))}),r.src=t,this.media=r}destroy(){this.destroyed=!0,this._onKeyDown&&this.shell.host.removeEventListener(`keydown`,this._onKeyDown),this.media&&(this.media.pause(),this.media.removeAttribute(`src`),this.media.load())}_build(){let{body:t,host:r}=this.shell,o=this.media,s=this.source.kind,c=document.createElement(`div`);c.className=`wui-file-viewer-player wui-file-viewer-player-${s}`;let l=document.createElement(`div`);if(l.className=`wui-file-viewer-stage`,l.tabIndex=0,l.setAttribute(`role`,`group`),l.setAttribute(`aria-label`,s===`video`?`Video`:`Audio`),s===`audio`){let t=document.createElement(`div`);t.className=`wui-file-viewer-audio-art`,t.innerHTML=e(`music`,{size:40}),l.append(t,o)}else l.append(o),o.addEventListener(`click`,()=>this.togglePlay());let u=document.createElement(`div`);u.className=`wui-file-viewer-controls`,this.playButton=i(`play`,`Play`,{size:18}),this.playButton.addEventListener(`click`,()=>this.togglePlay()),this.timeNow=document.createElement(`span`),this.timeNow.className=`wui-file-viewer-time`,this.seek=document.createElement(`input`),this.seek.type=`range`,this.seek.className=`form-range wui-file-viewer-seek`,this.seek.min=`0`,this.seek.step=`any`,this.seek.setAttribute(`aria-label`,`Seek`),this.seek.addEventListener(`input`,()=>{o.currentTime=Number(this.seek.value)}),this.timeTotal=document.createElement(`span`),this.timeTotal.className=`wui-file-viewer-time`,this.muteButton=i(`volume-high`,`Mute`,{size:18}),this.muteButton.addEventListener(`click`,()=>this._setMuted(!o.muted)),this.volume=document.createElement(`input`),this.volume.type=`range`,this.volume.className=`form-range wui-file-viewer-volume`,this.volume.min=`0`,this.volume.max=`1`,this.volume.step=`0.05`,this.volume.setAttribute(`aria-label`,`Volume`),this.volume.addEventListener(`input`,()=>this._setVolume(Number(this.volume.value))),this.speedButton=document.createElement(`button`),this.speedButton.type=`button`,this.speedButton.className=`wui-file-viewer-zoom wui-file-viewer-speed`,n(this.speedButton,{label:`Playback speed`,items:()=>a.map(e=>({key:String(e),label:`${e}x`,checked:o.playbackRate===e})),onPick:e=>this._setSpeed(Number(e))}),u.append(this.playButton,this.timeNow,this.seek,this.timeTotal,this.muteButton,this.volume,this.speedButton),s===`video`&&this.source.captions&&(this.captionsButton=i(`subtitle`,`Show captions`,{size:18}),this.captionsButton.addEventListener(`click`,()=>this._setCaptions(!this._captionsOn())),u.append(this.captionsButton)),c.append(l,u),t.replaceChildren(c);for(let e of[`play`,`pause`,`ended`])o.addEventListener(e,()=>this._syncPlay());o.addEventListener(`timeupdate`,()=>this._syncTime()),o.addEventListener(`durationchange`,()=>this._syncTime()),o.addEventListener(`volumechange`,()=>this._syncVolume()),o.addEventListener(`ratechange`,()=>this._syncSpeed()),this._onKeyDown=e=>this._keyDown(e),r.addEventListener(`keydown`,this._onKeyDown),this._syncPlay(),this._syncTime(),this._syncVolume(),this._syncSpeed(),this._syncCaptions()}seekTo(e){let t=this.media.duration;this.media.currentTime=Math.min(Math.max(e,0),Number.isFinite(t)?t:1/0)}togglePlay(){this.media.paused||this.media.ended?this.media.play().catch(e=>{console.warn(`[wui-file-viewer] play refused:`,e?.message)}):this.media.pause()}_setMuted(e){this.media.muted=e,!e&&this.media.volume===0&&(this.media.volume=.5),this.shell.savePrefs({muted:this.media.muted,volume:this.media.volume})}_setVolume(e){this.media.volume=Math.min(Math.max(e,0),1),this.media.muted=this.media.volume===0,this.shell.savePrefs({muted:this.media.muted,volume:this.media.volume})}_setSpeed(e){this.media.playbackRate=e,this.shell.savePrefs({speed:e})}_captionsOn(){return this.media.textTracks?.[0]?.mode===`showing`}_setCaptions(e){let t=this.media.textTracks?.[0];t&&(t.mode=e?`showing`:`hidden`),this._syncCaptions()}_syncPlay(){let e=!this.media.paused&&!this.media.ended;r(this.playButton,e?`pause`:`play`,18),t(this.playButton,e?`Pause`:`Play`),this.shell.host.classList.toggle(`wui-file-viewer-playing`,e)}_syncTime(){let e=this.media.currentTime,t=this.media.duration;this.timeNow.textContent=c(e),this.timeTotal.textContent=c(t),this.seek.max=String(Number.isFinite(t)?t:0),this.seek.value=String(e),this.seek.setAttribute(`aria-valuetext`,`${c(e)} of ${c(t)}`)}_syncVolume(){let e=this.media.muted||this.media.volume===0;r(this.muteButton,e?`volume-mute`:`volume-high`,18),t(this.muteButton,e?`Unmute`:`Mute`),this.volume.value=String(this.media.muted?0:this.media.volume)}_syncSpeed(){let e=`${this.media.playbackRate}x`;this.speedButton.textContent=e,this.speedButton.setAttribute(`aria-label`,`Playback speed, ${e}`)}_syncCaptions(){if(!this.captionsButton)return;let e=this._captionsOn();this.captionsButton.setAttribute(`aria-pressed`,String(e)),t(this.captionsButton,e?`Hide captions`:`Show captions`)}_keyDown(e){if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||l(e.target))return;let t=this.media,n=e.key.toLowerCase();if(n===` `||n===`k`)this.togglePlay();else if(n===`arrowleft`)t.currentTime=Math.max(0,t.currentTime-o);else if(n===`arrowright`)t.currentTime=Math.min(t.duration||0,t.currentTime+o);else if(n===`arrowup`)this._setVolume(t.volume+s);else if(n===`arrowdown`)this._setVolume(t.volume-s);else if(n===`m`)this._setMuted(!t.muted);else if(n===`c`&&this.captionsButton)this._setCaptions(!this._captionsOn());else return;e.preventDefault()}};export{u as MediaView};
1
+ import{a as e,i as t,n,r,t as i}from"./fileViewerUi-DAWY2fNB.js";var a=[.5,.75,1,1.25,1.5,2],o=5,s=.1;function c(e){if(!Number.isFinite(e)||e<0)return`0:00`;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=String(t%60).padStart(2,`0`);return n?`${n}:${String(r).padStart(2,`0`)}:${i}`:`${r}:${i}`}var l=e=>e instanceof Element&&e.closest(`input, textarea, select, button, a, .dropdown-menu`),u=class{constructor(e,t){this.shell=e,this.source=t,this.destroyed=!1}load(){let{kind:e,src:t,captions:n}=this.source,r=document.createElement(e);if(r.className=`wui-file-viewer-${e}`,r.preload=`metadata`,r.playsInline=!0,e===`video`&&n){let e=document.createElement(`track`);e.kind=`captions`,e.label=`Captions`,e.srclang=`en`,e.src=n,r.append(e)}let i=this.shell.prefs;typeof i.volume==`number`&&(r.volume=Math.min(Math.max(i.volume,0),1)),r.muted=i.muted===!0,r.addEventListener(`loadedmetadata`,()=>{this.destroyed||(r.playbackRate=a.includes(i.speed)?i.speed:1,this._build(),this.shell.loaded({kind:e,pages:1}))},{once:!0}),r.addEventListener(`error`,()=>{this.destroyed||this.shell.fail(Error(`The file could not be played.`))}),r.src=t,this.media=r}destroy(){this.destroyed=!0,this._onKeyDown&&this.shell.host.removeEventListener(`keydown`,this._onKeyDown),this.media&&(this.media.pause(),this.media.removeAttribute(`src`),this.media.load())}_build(){let{body:t,host:r}=this.shell,o=this.media,s=this.source.kind,c=document.createElement(`div`);c.className=`wui-file-viewer-player wui-file-viewer-player-${s}`;let l=document.createElement(`div`);if(l.className=`wui-file-viewer-stage`,l.tabIndex=0,l.setAttribute(`role`,`group`),l.setAttribute(`aria-label`,s===`video`?`Video`:`Audio`),s===`audio`){let t=document.createElement(`div`);t.className=`wui-file-viewer-audio-art`,t.innerHTML=e(`music`,{size:40}),l.append(t,o)}else l.append(o),o.addEventListener(`click`,()=>this.togglePlay());let u=document.createElement(`div`);u.className=`wui-file-viewer-controls`,this.playButton=i(`play`,`Play`,{size:18}),this.playButton.addEventListener(`click`,()=>this.togglePlay()),this.timeNow=document.createElement(`span`),this.timeNow.className=`wui-file-viewer-time`,this.seek=document.createElement(`input`),this.seek.type=`range`,this.seek.className=`form-range wui-file-viewer-seek`,this.seek.min=`0`,this.seek.step=`any`,this.seek.setAttribute(`aria-label`,`Seek`),this.seek.addEventListener(`input`,()=>{o.currentTime=Number(this.seek.value)}),this.timeTotal=document.createElement(`span`),this.timeTotal.className=`wui-file-viewer-time`,this.muteButton=i(`volume-high`,`Mute`,{size:18}),this.muteButton.addEventListener(`click`,()=>this._setMuted(!o.muted)),this.volume=document.createElement(`input`),this.volume.type=`range`,this.volume.className=`form-range wui-file-viewer-volume`,this.volume.min=`0`,this.volume.max=`1`,this.volume.step=`0.05`,this.volume.setAttribute(`aria-label`,`Volume`),this.volume.addEventListener(`input`,()=>this._setVolume(Number(this.volume.value))),this.speedButton=document.createElement(`button`),this.speedButton.type=`button`,this.speedButton.className=`wui-file-viewer-zoom wui-file-viewer-speed`,n(this.speedButton,{label:`Playback speed`,items:()=>a.map(e=>({key:String(e),label:`${e}x`,checked:o.playbackRate===e})),onPick:e=>this._setSpeed(Number(e))}),u.append(this.playButton,this.timeNow,this.seek,this.timeTotal,this.muteButton,this.volume,this.speedButton),s===`video`&&this.source.captions&&(this.captionsButton=i(`subtitle`,`Show captions`,{size:18}),this.captionsButton.addEventListener(`click`,()=>this._setCaptions(!this._captionsOn())),u.append(this.captionsButton)),c.append(l,u),t.replaceChildren(c);for(let e of[`play`,`pause`,`ended`])o.addEventListener(e,()=>this._syncPlay());o.addEventListener(`timeupdate`,()=>this._syncTime()),o.addEventListener(`durationchange`,()=>this._syncTime()),o.addEventListener(`volumechange`,()=>this._syncVolume()),o.addEventListener(`ratechange`,()=>this._syncSpeed()),this._onKeyDown=e=>this._keyDown(e),r.addEventListener(`keydown`,this._onKeyDown),this._syncPlay(),this._syncTime(),this._syncVolume(),this._syncSpeed(),this._syncCaptions()}seekTo(e){let t=this.media.duration;this.media.currentTime=Math.min(Math.max(e,0),Number.isFinite(t)?t:1/0)}togglePlay(){this.media.paused||this.media.ended?this.media.play().catch(e=>{console.warn(`[wui-file-viewer] play refused:`,e?.message)}):this.media.pause()}_setMuted(e){this.media.muted=e,!e&&this.media.volume===0&&(this.media.volume=.5),this.shell.savePrefs({muted:this.media.muted,volume:this.media.volume})}_setVolume(e){this.media.volume=Math.min(Math.max(e,0),1),this.media.muted=this.media.volume===0,this.shell.savePrefs({muted:this.media.muted,volume:this.media.volume})}_setSpeed(e){this.media.playbackRate=e,this.shell.savePrefs({speed:e})}_captionsOn(){return this.media.textTracks?.[0]?.mode===`showing`}_setCaptions(e){let t=this.media.textTracks?.[0];t&&(t.mode=e?`showing`:`hidden`),this._syncCaptions()}_syncPlay(){let e=!this.media.paused&&!this.media.ended;r(this.playButton,e?`pause`:`play`,18),t(this.playButton,e?`Pause`:`Play`),this.shell.host.classList.toggle(`wui-file-viewer-playing`,e)}_syncTime(){let e=this.media.currentTime,t=this.media.duration;this.timeNow.textContent=c(e),this.timeTotal.textContent=c(t),this.seek.max=String(Number.isFinite(t)?t:0),this.seek.value=String(e),this.seek.setAttribute(`aria-valuetext`,`${c(e)} of ${c(t)}`)}_syncVolume(){let e=this.media.muted||this.media.volume===0;r(this.muteButton,e?`volume-mute`:`volume-high`,18),t(this.muteButton,e?`Unmute`:`Mute`),this.volume.value=String(this.media.muted?0:this.media.volume)}_syncSpeed(){let e=`${this.media.playbackRate}x`;this.speedButton.textContent=e,this.speedButton.setAttribute(`aria-label`,`Playback speed, ${e}`)}_syncCaptions(){if(!this.captionsButton)return;let e=this._captionsOn();this.captionsButton.setAttribute(`aria-pressed`,String(e)),t(this.captionsButton,e?`Hide captions`:`Show captions`)}_keyDown(e){if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||l(e.target))return;let t=this.media,n=e.key.toLowerCase();if(n===` `||n===`k`)this.togglePlay();else if(n===`arrowleft`)t.currentTime=Math.max(0,t.currentTime-o);else if(n===`arrowright`)t.currentTime=Math.min(t.duration||0,t.currentTime+o);else if(n===`arrowup`)this._setVolume(t.volume+s);else if(n===`arrowdown`)this._setVolume(t.volume-s);else if(n===`m`)this._setMuted(!t.muted);else if(n===`c`&&this.captionsButton)this._setCaptions(!this._captionsOn());else return;e.preventDefault()}};export{u as MediaView};