@webority/ui-elements 0.160.0 → 0.163.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 (85) hide show
  1. package/dist/{WuiCommentThread-CnwvJUDn.js → WuiCommentThread-CclWHz4C.js} +1 -1
  2. package/dist/WuiContextMenu-B2MrH_LK.js +1 -0
  3. package/dist/WuiDataTable-C1Rrxmh_.js +1 -0
  4. package/dist/WuiInlineEdit-pG9Z5tUQ.js +1 -0
  5. package/dist/WuiMentionInput-B_K8AXM5.js +1 -0
  6. package/dist/WuiPhone-icMSUnua.js +16 -0
  7. package/dist/WuiSelect-B199VL24.js +9 -0
  8. package/dist/WuiTimePicker-wo9BlOFs.js +9 -0
  9. package/dist/WuiTour-D3Sx7JCM.js +1 -0
  10. package/dist/{WuiTree-JK4JqcBr.js → WuiTree-COd5leOB.js} +1 -1
  11. package/dist/chips-0jT9fpA9.js +2 -0
  12. package/dist/{drawerDiscard-Cra-QhD5.js → drawerDiscard-C-STs39f.js} +1 -1
  13. package/dist/elements/comment-thread.js +1 -1
  14. package/dist/elements/context-menu.js +1 -1
  15. package/dist/elements/data-table.js +1 -1
  16. package/dist/elements/inline-edit.js +1 -1
  17. package/dist/elements/mention-input.js +1 -1
  18. package/dist/elements/phone.js +1 -1
  19. package/dist/elements/select.js +1 -1
  20. package/dist/elements/timepicker.js +1 -1
  21. package/dist/elements/tour.js +1 -1
  22. package/dist/elements/tree.js +1 -1
  23. package/dist/{fileViewerPdf-CdaDuaRJ.js → fileViewerPdf-CAbiTCHl.js} +2 -2
  24. package/dist/helpers.js +1 -1
  25. package/dist/imeSafeEnter-DPs9qL3S.js +1 -0
  26. package/dist/listboxKeyNav-DkLHwzJE.js +1 -0
  27. package/dist/{loader-ByHAB1wi.js → loader-DRYPWxQL.js} +1 -1
  28. package/dist/{search-DMniXhEK.js → search-C0IYOzso.js} +1 -1
  29. package/dist/server.js +1 -1
  30. package/dist/themeTransition-CwE2VwQa.js +1 -0
  31. package/dist/ui-calendar.global.js +1 -1
  32. package/dist/ui-calendar.js +1 -1
  33. package/dist/ui-chart.global.js +1 -1
  34. package/dist/ui-chart.js +1 -1
  35. package/dist/ui-elements/carousel.global.js +1 -1
  36. package/dist/ui-elements/code-block.global.js +1 -1
  37. package/dist/ui-elements/command-palette.global.js +1 -1
  38. package/dist/ui-elements/comment-thread.global.js +1 -1
  39. package/dist/ui-elements/consent-banner.global.js +1 -1
  40. package/dist/ui-elements/context-menu.global.js +1 -1
  41. package/dist/ui-elements/date-range.global.js +1 -1
  42. package/dist/ui-elements/drawer.global.js +1 -1
  43. package/dist/ui-elements/glyphs.global.js +1 -1
  44. package/dist/ui-elements/image-crop.global.js +1 -1
  45. package/dist/ui-elements/inline-edit.global.js +1 -1
  46. package/dist/ui-elements/kanban.global.js +1 -1
  47. package/dist/ui-elements/lead-popup.global.js +1 -1
  48. package/dist/ui-elements/lightbox.global.js +1 -1
  49. package/dist/ui-elements/markdown.global.js +1 -1
  50. package/dist/ui-elements/org-tree.global.js +1 -1
  51. package/dist/ui-elements/phone.global.js +8 -8
  52. package/dist/ui-elements/resizable.global.js +1 -1
  53. package/dist/ui-elements/saved-views.global.js +1 -1
  54. package/dist/ui-elements/select-chips.global.js +2 -2
  55. package/dist/ui-elements/select-recents.global.js +1 -1
  56. package/dist/ui-elements/select-search.global.js +1 -1
  57. package/dist/ui-elements/slider.global.js +1 -1
  58. package/dist/ui-elements/sortable.global.js +1 -1
  59. package/dist/ui-elements/status-icon.global.js +1 -1
  60. package/dist/ui-elements/timepicker.global.js +2 -2
  61. package/dist/ui-elements/tour.global.js +1 -1
  62. package/dist/ui-elements/tree.global.js +1 -1
  63. package/dist/ui-elements/wizard.global.js +1 -1
  64. package/dist/ui-elements.global.js +18 -18
  65. package/dist/ui-elements.js +1 -1
  66. package/dist/ui-file-viewer.global.js +3 -3
  67. package/dist/ui-file-viewer.js +1 -1
  68. package/dist/ui-rich-text.global.js +55 -55
  69. package/dist/ui-rich-text.js +55 -55
  70. package/dist/ui-tour.global.js +1 -1
  71. package/package.json +4 -4
  72. package/types/global/shared.d.ts +2 -0
  73. package/types/helpers.d.ts +1 -0
  74. package/types/imeSafeEnter.d.ts +10 -0
  75. package/dist/WuiContextMenu-Re2CG8yT.js +0 -1
  76. package/dist/WuiDataTable-8nQDiTHE.js +0 -1
  77. package/dist/WuiInlineEdit-BlBuWkHG.js +0 -1
  78. package/dist/WuiMentionInput-HwsLGhyr.js +0 -1
  79. package/dist/WuiPhone-NdIYg_Gb.js +0 -16
  80. package/dist/WuiSelect-CWul-aM1.js +0 -9
  81. package/dist/WuiTimePicker-DOodgU2O.js +0 -9
  82. package/dist/WuiTour-Cx61ijsm.js +0 -1
  83. package/dist/chips-DD_C4G0w.js +0 -2
  84. package/dist/listboxKeyNav-Bxkq7dvu.js +0 -1
  85. package/dist/themeTransition-CfrJtERx.js +0 -1
package/dist/helpers.js CHANGED
@@ -1 +1 @@
1
- import{r as e}from"./dom-Do1pAA12.js";import{n as t,r as n,t as r}from"./commentText-BnX7rA2-.js";import{n as i,t as a}from"./copyText-Q-QZKBmx.js";import{_ as o,a as s,b as c,c as l,d as u,f as d,g as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,x as w,y as T}from"./formatters-ljfITOZ3.js";import{A as E,C as D,D as O,E as k,M as A,O as j,S as M,T as N,_ as P,a as ee,b as te,c as ne,d as re,f as ie,g as ae,h as oe,i as se,j as ce,k as le,l as ue,m as de,n as fe,o as pe,p as me,r as he,s as ge,t as _e,u as ve,v as ye,w as be,x as xe,y as Se}from"./dataTable-CcH1lBIM.js";import{t as Ce}from"./iconGlyphs.g-DPqoOoXy.js";import{i as we,n as Te,r as Ee,t as De}from"./inlineEditText-CsLCQbcg.js";import{a as Oe,c as ke,d as Ae,f as je,h as Me,i as Ne,l as Pe,m as Fe,n as Ie,o as Le,p as Re,r as ze,s as Be,t as Ve,u as He}from"./kanbanModel-BaT75e-b.js";import{a as Ue,i as We,n as Ge,o as Ke,r as qe,t as Je}from"./mentionText-BJsw_opZ.js";import{a as Ye,c as Xe,i as Ze,n as Qe,o as $e,r as et,s as tt,t as nt}from"./notificationDays-BIWczft0.js";import{o as rt}from"./optionLabel-4xjXWy74.js";import{n as it,r as at,t as ot}from"./relativeTime-BahImc8F.js";import{a as st,c as ct,d as lt,f as ut,g as dt,h as ft,i as pt,l as mt,m as ht,n as gt,o as _t,p as vt,r as yt,s as bt,t as xt,u as St,v as Ct,y as wt}from"./themeTransition-CfrJtERx.js";import{a as Tt,c as Et,d as Dt,f as Ot,i as kt,l as At,m as jt,n as Mt,o as Nt,p as Pt,r as Ft,s as It,t as Lt,u as Rt}from"./shortcutKeys-COVLox98.js";import{n as zt,t as Bt}from"./stepperHeader-yinJ_7Dk.js";import{t as Vt}from"./textMatch-wdY7XLIc.js";import{t as Ht}from"./tourSeenStore-z0Y_Znzx.js";import{i as Ut,n as Wt,o as Gt,r as Kt,s as qt,t as Jt}from"./zone-BR02ZkHF.js";var Yt=`image/jpeg,image/png,image/webp,image/heic,image/heif,.heic,.heif`,Xt=10,Zt=512,Qt=`image/webp`,$t=[96,48],F={dialogTitle:`Edit photo`,dialogSubtitle:`Drag to position the photo, then zoom or rotate it.`,save:`Save photo`,cancel:`Cancel`,choose:`Upload photo`,change:`Change photo`,camera:`Take photo`,remove:`Remove photo`,unreadable:`That photo could not be opened. Choose a JPG, PNG or WebP image.`,heicUnreadable:`This browser cannot open HEIC photos. Choose a JPG, PNG or WebP image instead.`,cropFailed:`That photo could not be saved. Try again, or choose another one.`};function en(e){if(!e)return!1;let t=String(e.type||``).toLowerCase();return t===`image/heic`||t===`image/heif`||/\.hei[cf]$/i.test(String(e.name||``))}function tn(e){return en(e)?F.heicUnreadable:F.unreadable}function nn(e,t){let n=Number(t);return{name:e?.name||`photo`,type:Qt,size:Number.isInteger(n)&&n>0?n:512}}var rn=`data-wui-command-shortcut`,an=`k`,on=/* @__PURE__ */ new WeakSet;function sn(e,t){return!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.repeat?!1:String(e.key).toLowerCase()===String(t).toLowerCase()}function cn(e){return e.nodeType===Node.DOCUMENT_NODE}function ln(t){let n=e(window.bootstrap?.Modal,`data-wui-command-shortcut: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`),r=t.closest(`.modal`);r&&n.getOrCreateInstance(r).show()}function un(e){let t=cn(e)?e:e.ownerDocument;!on.has(t)&&e.querySelector(`[data-wui-command-shortcut]`)&&(on.add(t),t.addEventListener(`keydown`,e=>{for(let n of t.querySelectorAll(`[${rn}]`))if(sn(e,n.getAttribute(`data-wui-command-shortcut`)||an)){e.preventDefault(),n.localName===`wui-command-palette`||n.classList.contains(`modal`)?ln(n):(n.focus(),`select`in n&&typeof n.select==`function`&&n.select());return}}))}function dn(e){return typeof customElements<`u`&&customElements.get(e)!==void 0}async function fn(e){await customElements.whenDefined(e)}var pn=`image/png,image/jpeg,image/webp`,mn=5,hn={"image/png":[`.png`],"image/jpeg":[`.jpg`,`.jpeg`],"image/webp":[`.webp`],"image/gif":[`.gif`],"image/svg+xml":[`.svg`],"image/heic":[`.heic`],"image/heif":[`.heif`],"application/pdf":[`.pdf`],"text/plain":[`.txt`]},gn={"image/png":`PNG`,"image/jpeg":`JPG`,"image/webp":`WEBP`,"image/gif":`GIF`,"image/svg+xml":`SVG`,"image/heic":`HEIC`,"image/heif":`HEIC`,"application/pdf":`PDF`,"text/plain":`text file`,"image/*":`images`,"video/*":`videos`,"audio/*":`audio`,".png":`PNG`,".jpg":`JPG`,".jpeg":`JPG`,".webp":`WEBP`,".gif":`GIF`,".svg":`SVG`,".heic":`HEIC`,".heif":`HEIC`,".pdf":`PDF`,".txt":`text file`},I=e=>String(e||``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),_n=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.gif`,`.svg`,`.bmp`,`.avif`,`.heic`,`.heif`];function vn(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t.startsWith(`image/`);let n=typeof e==`string`?e:e.name||e.url||``,r=String(n).toLowerCase();return _n.some(e=>r.endsWith(e))}var yn=[`KB`,`MB`,`GB`];function bn(e){if(e<1024)return`${e} B`;let t=e/1024,n=0;for(;t>=1024&&n<yn.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${yn[n]}`}function xn(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t===`application/pdf`;let n=typeof e==`string`?e:e.name||e.url||``;return String(n).toLowerCase().replace(/[?#][\s\S]*$/,``).endsWith(`.pdf`)}function Sn(e){let t=I(e);return t.length?t.every(e=>e.startsWith(`.`)?_n.includes(e):e===`image/*`||e.startsWith(`image/`)):!1}function Cn(e){let t=[];for(let n of I(e)){let e=gn[n]||(n.startsWith(`.`)?n.slice(1).toUpperCase():n.toUpperCase());t.includes(e)||t.push(e)}return t.length<=1?t[0]||`supported`:`${t.slice(0,-1).join(`, `)} or ${t[t.length-1]}`}function wn(e,t){let n=I(t);if(!n.length)return!0;let r=(e.type||``).toLowerCase(),i=(e.name||``).toLowerCase();return n.some(e=>e.startsWith(`.`)?i.endsWith(e):e.endsWith(`/*`)?r.startsWith(e.slice(0,-1)):r&&r===e?!0:!r&&(hn[e]||[]).some(e=>i.endsWith(e)))}function Tn(e,t={}){if(!e)return null;let n=t.accept===void 0?pn:t.accept,r=t.maxSizeMb===void 0?5:t.maxSizeMb;if(!wn(e,n)){let e=Cn(n),t=I(n).map(e=>[`images`,`videos`,`audio`].includes(gn[e]??``));return t.every(Boolean)?`Choose ${e}.`:t.some(Boolean)?`Choose ${e.endsWith(` file`)?`${e}s`:`${e} files`}.`:`Choose a ${e.endsWith(` file`)?e:`${e} file`}.`}return r!==null&&r>0&&e.size>r*1024*1024?`Keep the file under ${r} MB.`:null}function En(e,t){let n=Array.from(e||[]),r=t.multiple?n:n.slice(0,1),i=[],a=[];for(let e of r){let n=Tn(e,{accept:t.accept,maxSizeMb:t.maxSizeMb});n?a.push({file:e,message:n}):i.push(e)}return{files:i,rejections:a}}function Dn(e,t){let{overClass:n,isDisabled:r=()=>!1,onFiles:i,onReject:a,...o}=t,s=0,c=t=>e.classList.toggle(n,t),l=e=>{e.preventDefault(),r()||(s+=1,c(!0))},u=e=>{e.preventDefault(),r()||c(!0)},d=e=>{e.preventDefault(),r()||(s=Math.max(0,s-1),s===0&&c(!1))},f=e=>{if(e.preventDefault(),s=0,c(!1),r())return;let{files:t,rejections:n}=En(e.dataTransfer?.files,o);t.length&&i(t);let l=n[0];l&&a(l)};return e.addEventListener(`dragenter`,l),e.addEventListener(`dragover`,u),e.addEventListener(`dragleave`,d),e.addEventListener(`drop`,f),()=>{e.removeEventListener(`dragenter`,l),e.removeEventListener(`dragover`,u),e.removeEventListener(`dragleave`,d),e.removeEventListener(`drop`,f)}}var L=/[0-9]/,On={9:L,A:/[A-Za-z]/,"*":/[0-9A-Za-z]/},kn=/[9A*]/,R=/* @__PURE__ */ new Set([`text`,`tel`,`search`,`url`,`password`]),An=e=>{let t=e.replace(/\D/g,``);return t.length===12&&t.startsWith(`91`)?t.slice(2):t.length===11&&t.startsWith(`0`)?t.slice(1):e},jn=e=>{let t=Number(e.slice(0,2)),n=Number(e.slice(2,4)),r=Number(e.slice(4,8));if(r<1)return!1;let i=new Date(Date.UTC(r,n-1,t));return i.getUTCFullYear()===r&&i.getUTCMonth()===n-1&&i.getUTCDate()===t},Mn=e=>e.length<=3?e:`${e.slice(0,-3).replace(/\B(?=(\d{2})+(?!\d))/g,`,`)},${e.slice(-3)}`,Nn=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());return t?`${t[3]}-${t[2]}-${t[1]}`:e};function z(e,{upper:t=!1,normalize:n,valid:r,post:i=e=>e,message:a=`Enter the full value`}={}){let o=[...e].map(e=>{let t=On[e];return t?{re:t}:{lit:e}}),s=o.filter(e=>e.re).length;return{inputMode:o.every(e=>!e.re||e.re===L)?`numeric`:`text`,normalize:n,post:i,message:a,extract(e){let n=``,r=0;for(let i of e){for(;r<o.length&&o[r]?.lit!==void 0&&o[r]?.lit!==i;)r++;if(r>=o.length)break;let e=o[r];e?.lit===void 0?e?.re.test(i)&&(n+=t?i.toUpperCase():i,r++):r++}return n},layout(e){let t=``,n=[],r=0;for(let i=0;i<o.length&&r<e.length;i++){let a=o[i];a?.lit===void 0?(t+=e.charAt(r++),n.push(!0)):(t+=a.lit,n.push(!1))}return{text:t,isRaw:n}},isValid:e=>e.length===s&&(!r||r(e))}}function Pn(){return{inputMode:`decimal`,post:e=>e,message:`Enter a valid amount`,extract(e){let t=``,n=!1,r=0;for(let i of e)L.test(i)?n?r<2&&(t+=i,r++):t+=i:i===`.`&&!n&&(n=!0,t+=i);return t.startsWith(`.`)&&(t=`0${t}`),t.replace(/^0+(?=\d)/,``)},layout(e){let[t=``,n]=e.split(`.`),r=Mn(t)+(e.includes(`.`)?`.${n}`:``);return{text:r,isRaw:[...r].map(e=>e!==`,`)}},isValid:e=>/^\d+(\.\d{1,2})?$/.test(e)}}var B={"phone-in":()=>z(`99999 99999`,{normalize:An,valid:e=>/^[6-9]/.test(e),message:`Enter a 10-digit mobile number`}),pan:()=>z(`AAAAA9999A`,{upper:!0,valid:e=>/^[A-Z]{5}\d{4}[A-Z]$/.test(e),message:`Enter a valid PAN`}),gstin:()=>z(`99AAAAA9999A***`,{upper:!0,valid:e=>/^\d{2}[A-Z]{5}\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$/.test(e),message:`Enter a valid GSTIN`}),aadhaar:()=>z(`9999 9999 9999`,{valid:e=>/^[2-9]/.test(e),message:`Enter a valid 12-digit Aadhaar number`}),ifsc:()=>z(`AAAA*******`,{upper:!0,valid:e=>/^[A-Z]{4}0[A-Z0-9]{6}$/.test(e),message:`Enter a valid IFSC`}),"pin-code":()=>z(`999999`,{valid:e=>/^[1-9]/.test(e),message:`Enter a valid 6-digit PIN code`}),date:()=>z(`99-99-9999`,{normalize:Nn,valid:jn,post:(e,t)=>e.length===8&&jn(e)?`${e.slice(4)}-${e.slice(2,4)}-${e.slice(0,2)}`:t,message:`Enter a valid date as DD-MM-YYYY`}),amount:Pn},Fn=Object.keys(B),In=e=>{let t=String(e).toLowerCase();return Object.hasOwn(B,t)?t:void 0},Ln=e=>kn.test(String(e))&&In(e)===void 0,Rn=/* @__PURE__ */ new Map;function V(e){if(e==null||e===``)return null;let t=String(e),n=Rn.get(t);return n===void 0&&(n=Ln(t)?z(t):Object.hasOwn(B,t)?B[t]?.()??null:null,Rn.set(t,n)),n}var H=(e,t)=>e.normalize?e.normalize(t):t;function zn(e,t){let n=V(e);return n?n.extract(H(n,String(t??``))):String(t??``)}function Bn(e,t){let n=V(e);if(!n)return String(t??``);let r=n.extract(H(n,String(t??``)));return n.post(r,n.layout(r).text)}function Vn(e,t){let n=V(e);return n?n.layout(n.extract(H(n,String(t??``)))).text:String(t??``)}var Hn=(e,t)=>{if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(e[r]&&++n===t)return r+1;return e.length},U=/* @__PURE__ */ new WeakMap,Un=e=>U.get(e)?.(),Wn=/* @__PURE__ */ new WeakMap;function Gn(e,t,n,r){let i=e.getAll(t),a=Wn.get(e)??/* @__PURE__ */ new Set;Wn.set(e,a);let o=i.findIndex((e,r)=>e===n&&!a.has(`${t}\u0000${r}`));if(!(o<0)){if(a.add(`${t}\u0000${o}`),i[o]=r,i.length===1)e.set(t,r);else{e.delete(t);for(let n of i)e.append(t,n)}}}function Kn(e){let t=null,n=null,r=!1,i=(t,n)=>{n===null?e.removeAttribute(t):n!==void 0&&e.setAttribute(t,n)},a,o,s=()=>{t?.remove(),t=null,n&&(n.hidden=!1),n=null,r&&e.classList.remove(`error`),r=!1,i(`aria-invalid`,a),i(`aria-describedby`,o),a=void 0,o=void 0};return i=>{if(!i){s();return}let c=e.closest(`.field`),l=c instanceof HTMLElement?c:null,u=l?.querySelector(`.field-error`);if(!(u&&u!==t&&u.textContent?.trim())){if(!t){if(r=!e.classList.contains(`error`),e.classList.add(`error`),a=e.getAttribute(`aria-invalid`),o=e.getAttribute(`aria-describedby`),l){t=document.createElement(`div`),t.className=`field-error`,e.id&&(t.id=`${e.id}-error`);let r=l.querySelector(`.field-hint`);n=r instanceof HTMLElement?r:null,n&&(n.hidden=!0),l.insertBefore(t,[...l.children].find(e=>e.classList.contains(`field-count`))??null),t.id&&e.setAttribute(`aria-describedby`,t.id)}e.setAttribute(`aria-invalid`,`true`)}t&&(t.textContent=i)}}}function qn(t,{mask:n,postFormatted:r=!1,onChange:i,onInvalidChange:a}={}){let o=V(n);if(!o||!R.has(t.type))return()=>{};let s=Object.getPrototypeOf(t),c=Object.getOwnPropertyDescriptor(s,`value`);if(!c?.set)throw Error(`input value setter missing`);let l=c.set,u=!t.hasAttribute(`inputmode`);u&&t.setAttribute(`inputmode`,o.inputMode);let d=a??Kn(t),f=null,p=!1,m=!1,h=!1,g=``,_=``,v,y=()=>{let e=h?g:``;e!==_&&(_=e,d(_))},b=(e,n,r)=>{let a=o.extract(e.slice(0,n)).length,s=o.extract(e),{text:c,isRaw:u}=o.layout(s);if(t.value!==c&&(l.call(t,c),document.activeElement===t&&R.has(t.type))){let e=Hn(u,a);t.setSelectionRange(e,e)}t.dataset.maskRaw=s,g=s&&!o.isValid(s)?o.message:``,t.setCustomValidity(g),y(),r&&s!==f&&i?.(s,c),f=s},x=Object.getOwnPropertyDescriptor(t,`value`),S=x??c;Object.defineProperty(t,"value",{configurable:!0,...S.enumerable===void 0?{}:{enumerable:S.enumerable},get:()=>e(S.get,`input value getter missing`).call(t),set:n=>{if(e(S.set,`input value setter missing`).call(t,n),m)return;let r=H(o,t.value);b(r,r.length,!0)}});let C=()=>{p=!0,t.dispatchEvent(new Event(`input`,{bubbles:!0})),p=!1},w=e=>{let n=e instanceof InputEvent?e:null;if(p||m||n?.isComposing)return;let r=n?.inputType===`insertText`&&(n.data?.length??0)<=1||n?.inputType?.startsWith(`delete`)?t.value:H(o,t.value);b(r,t.selectionStart??r.length,!0)},T=()=>{m=!0},E=()=>{m=!1;let e=H(o,t.value);b(e,t.selectionStart??e.length,!0),C()},D=e=>{let n=e.inputType===`deleteContentBackward`;if(!n&&e.inputType!==`deleteContentForward`||e.isComposing)return;let r=t.selectionStart;if(r==null||r!==t.selectionEnd)return;let{isRaw:i}=o.layout(o.extract(t.value)),a=n?r-1:r;for(;a>=0&&a<i.length&&!i[a];)a+=n?-1:1;a!==(n?r-1:r)&&(e.preventDefault(),a<0||a>=i.length||(b(t.value.slice(0,a)+t.value.slice(a+1),n?a:r,!0),C()))},O=e=>{if(t.readOnly||t.disabled)return;let n=e.clipboardData?.getData(`text`);if(n==null)return;e.preventDefault();let r=H(o,n),i=t.selectionStart??t.value.length,a=t.selectionEnd??i;b(t.value.slice(0,i)+r+t.value.slice(a),i+r.length,!0),C()},k=()=>{let e=o.extract(t.value);return o.post(e,o.layout(e).text)},A=()=>{h=!0,y()};t.addEventListener(`input`,w),t.addEventListener(`beforeinput`,D),t.addEventListener(`paste`,O),t.addEventListener(`compositionstart`,T),t.addEventListener(`compositionend`,E),t.addEventListener(`blur`,A),t.addEventListener(`invalid`,A);let j=t.form,M=e=>{t.name&&!t.disabled&&Gn(e.formData,t.name,t.value,k())},N=()=>{clearTimeout(v),v=setTimeout(()=>{h=!1,b(H(o,t.value),t.value.length,!0)},0)};r||(j?.addEventListener(`formdata`,M),U.set(t,k)),j?.addEventListener(`reset`,N),j?.addEventListener(`submit`,A);let P=H(o,t.value);return b(P,P.length,!1),()=>{clearTimeout(v),t.removeEventListener(`input`,w),t.removeEventListener(`beforeinput`,D),t.removeEventListener(`paste`,O),t.removeEventListener(`compositionstart`,T),t.removeEventListener(`compositionend`,E),t.removeEventListener(`blur`,A),t.removeEventListener(`invalid`,A),j?.removeEventListener(`formdata`,M),j?.removeEventListener(`reset`,N),j?.removeEventListener(`submit`,A),U.delete(t),x?Object.defineProperty(t,"value",x):Reflect.deleteProperty(t,`value`),h=!1,g=``,y(),t.setCustomValidity(``),delete t.dataset.maskRaw,u&&t.removeAttribute(`inputmode`)}}function Jn(){let e=typeof window>`u`?void 0:window.jQuery?.validator?.prototype;if(!e||e.wuiMaskHook)return;let t=e.elementValue;e.elementValue=function(e){let n=Un(e);return n===void 0?t.call(this,e):n},e.wuiMaskHook=!0}var W=/* @__PURE__ */ new WeakMap,G,Yn=e=>{W.has(e)||W.set(e,qn(e,{mask:e.dataset.appMask,postFormatted:e.hasAttribute(`data-mask-post-formatted`)}))},Xn=e=>[...e.querySelectorAll(`input[data-app-mask]`)].filter(e=>e instanceof HTMLInputElement),Zn=e=>e instanceof Element?[...e instanceof HTMLInputElement&&e.matches(`input[data-app-mask]`)?[e]:[],...Xn(e)]:[];function Qn(){G||typeof MutationObserver>`u`||(G=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of Zn(e))W.get(t)?.(),W.delete(t);for(let e of t.addedNodes)for(let t of Zn(e))Yn(t)}}),G.observe(document.documentElement,{childList:!0,subtree:!0}))}function $n(e=document){Jn();for(let t of Xn(e))Yn(t);e===document&&Qn()}function er(e){if(!e)return;let t=e.querySelector(`[aria-current="page"]`);if(!t)return;let n=t.getBoundingClientRect();if(n.height===0)return;let r=e.getBoundingClientRect(),i=r.height,a=t=>t.top-r.top-e.clientTop+e.scrollTop,o=a(n),s=o+n.height,c=(t.closest(`.app-nav-group`)?.querySelector(`:scope > .app-nav-group-label`))?.getBoundingClientRect(),l;if(c&&c.height>0)l=Math.min(Math.max(a(c),s-i),o);else if(o<e.scrollTop)l=o;else if(s>e.scrollTop+i)l=s-i;else return;e.scrollTop=Math.max(0,l)}var K={minLength:10,uppercase:!0,lowercase:!0,digit:!0,special:!0,uniqueChars:0,customRules:[]},tr=`Password requirements`;function nr(e){return e===!0||e==null?{...K}:{...K,...e}}function rr(e){let t=nr(e),n=[];if(t.minLength>0&&n.push({key:`length`,label:`At least ${t.minLength} characters long`,test:e=>e.length>=t.minLength}),t.uppercase&&n.push({key:`uppercase`,label:`At least one uppercase letter`,test:e=>/[A-Z]/.test(e)}),t.lowercase&&n.push({key:`lowercase`,label:`At least one lowercase letter`,test:e=>/[a-z]/.test(e)}),t.digit&&n.push({key:`digit`,label:`At least one digit`,test:e=>/[0-9]/.test(e)}),t.special&&n.push({key:`special`,label:`At least one special character`,test:e=>/[^A-Za-z0-9]/.test(e)}),t.uniqueChars>0){let e=t.uniqueChars;n.push({key:`unique`,label:`At least ${e} unique character${e>1?`s`:``}`,test:t=>new Set(t).size>=e})}for(let[e,r]of(t.customRules??[]).entries()){let t=new RegExp(r.pattern);n.push({key:`custom-${e}`,label:r.label,test:e=>t.test(e)})}return n}function ir(e,t){let n=e==null?``:String(e);return rr(t).map(e=>({key:e.key,label:e.label,met:e.test(n)}))}function ar(e,t){return ir(e,t).every(e=>e.met)}var q=`.table-wrap, .table-responsive, [class*="table-responsive-"]`,J=1;function or(e){let t=()=>{let t=e.scrollWidth-e.clientWidth,n=Math.abs(e.scrollLeft);e.toggleAttribute(`data-wui-overflow-start`,t>J&&n>J),e.toggleAttribute(`data-wui-overflow-end`,t>J&&n<t-J),e.toggleAttribute(`data-wui-overflow-top`,e.scrollTop>J)},n=()=>{if(e.scrollWidth-e.clientWidth>J){let t=getComputedStyle(e);e.style.setProperty(`--wui-scroll-pad-start`,t.paddingInlineStart),e.style.setProperty(`--wui-scroll-pad-end`,t.paddingInlineEnd)}else e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))},r=()=>{n(),t()};e.addEventListener(`scroll`,t,{passive:!0});let i=null;if(typeof ResizeObserver<`u`){i=new ResizeObserver(r),i.observe(e);for(let t of e.children)i.observe(t)}return r(),()=>{e.removeEventListener(`scroll`,t),i?.disconnect(),e.removeAttribute(`data-wui-overflow-start`),e.removeAttribute(`data-wui-overflow-end`),e.removeAttribute(`data-wui-overflow-top`),e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))}}var Y=/* @__PURE__ */ new WeakMap,X,sr=e=>{Y.has(e)||Y.set(e,or(e))},cr=e=>{if(!(e instanceof HTMLElement))return[];let t=e.matches(`.table-wrap, .table-responsive, [class*="table-responsive-"]`)?[e]:[];if(e.firstElementChild===null)return t;let n=[...e.querySelectorAll(q)].filter(e=>e instanceof HTMLElement);return[...t,...n]};function lr(){X||typeof MutationObserver>`u`||(X=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of cr(e))Y.get(t)?.(),Y.delete(t);for(let e of t.addedNodes)for(let t of cr(e))sr(t)}}),X.observe(document.documentElement,{childList:!0,subtree:!0}))}function ur(e=document){for(let t of e.querySelectorAll(q))t instanceof HTMLElement&&sr(t);e===document&&lr()}var dr=`data-wui-submit-once`,Z=`data-wui-submit-pending`,Q=`wui-submit-spinner`,fr=/* @__PURE__ */ new WeakSet,$=/* @__PURE__ */ new WeakMap;function pr(e){return e instanceof HTMLButtonElement||e instanceof HTMLInputElement?e:null}function mr(e){if(e.setAttribute(`aria-busy`,`true`),e.tagName===`INPUT`||e.querySelector(`.${Q}`))return;let t=e.ownerDocument.createElement(`span`);t.className=`spinner-border spinner-border-sm me-2 ${Q}`,t.setAttribute(`aria-hidden`,`true`),e.prepend(t)}function hr(e){e.removeAttribute(`aria-busy`),e.querySelector(`.${Q}`)?.remove()}function gr(e){return e.method===`post`&&e.target!==`_blank`&&e.getAttribute(`data-wui-submit-once`)!==`off`}function _r(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!gr(t))return;if(t.hasAttribute(Z)){e.preventDefault();return}t.setAttribute(Z,``);let n=pr(e.submitter);setTimeout(()=>{t.hasAttribute(Z)&&(e.defaultPrevented?t.removeAttribute(Z):n&&(n.disabled=!0,mr(n),$.set(t,n)))},0)}var vr=e=>[...e.querySelectorAll(`form[${Z}]`)].filter(e=>e instanceof HTMLFormElement);function yr(e){for(let t of vr(e)){t.removeAttribute(Z);let e=$.get(t);e&&(e.disabled=!1,hr(e),$.delete(t))}}function br(e){let t=e.ownerDocument===null?e:e.ownerDocument;fr.has(t)||(fr.add(t),t.addEventListener(`submit`,_r,!0),t.defaultView?.addEventListener(`pageshow`,()=>yr(t)))}export{Yt as AVATAR_ACCEPT,Xt as AVATAR_MAX_SIZE_MB,Zt as AVATAR_OUTPUT_SIZE,Qt as AVATAR_OUTPUT_TYPE,$t as AVATAR_PREVIEW_SIZES,F as AVATAR_TEXT,_e as COLUMN_MAX_WIDTH,fe as COLUMN_MIN_WIDTH,rn as COMMAND_SHORTCUT_ATTRIBUTE,r as COMMENT_INTENTS,t as COMMENT_REACTIONS,n as COMMENT_TEXT,a as COPY_FEEDBACK_MS,x as CURRENCIES,C as CURRENCY_SYMBOLS,he as DATA_TABLE_TEXT,g as DATE_PATTERNS,T as DEFAULT_CURRENCY,pn as DEFAULT_IMAGE_ACCEPT,mn as DEFAULT_MAX_SIZE_MB,K as DEFAULT_PASSWORD_RULES,tr as DEFAULT_REQUIREMENTS_TITLE,xt as DEFAULT_THEME_EFFECT,gt as DEFAULT_THEME_STORAGE_KEY,y as DURATION_UNITS,p as EMPTY_VALUE,s as FORMAT_STYLES,De as INLINE_EDIT_SAVED_MS,Te as INLINE_EDIT_TEXT,Ee as INLINE_EDIT_TYPES,Jt as IST_TIME_ZONE,Ve as KANBAN_DRAG_THRESHOLD_PX,Ie as KANBAN_LONG_PRESS_MS,ze as KANBAN_PHONE_QUERY,Ne as KANBAN_STORAGE_PREFIX,Oe as KANBAN_SUMMARY_FORMATS,Le as KANBAN_TEXT,Be as KANBAN_TONES,Lt as LIST_KEYS,R as MASK_INPUT_TYPES,Fn as MASK_NAMES,Je as MENTION_ID_PATTERN,_ as MONEY_UNITS,nt as NOTIFICATION_COUNT_CAP,Qe as NOTIFICATION_TEXT,se as PIN_AT_VAR,ee as PIN_SIDES,ot as RELATIVE_LIMIT_DAYS,pe as RESIZE_STEP,ge as RESIZE_STEP_LARGE,ne as ROW_HEIGHTS,ue as ROW_MOVE_LIMIT,ve as ROW_MOVE_MS,re as ROW_SAVE_ATTR,ie as ROW_SAVE_ERROR_CLASS,me as ROW_SAVE_STATES,q as SCROLL_EDGE_SELECTOR,Mt as SELECT_KEY,Ft as SHORTCUTS_OFF_ATTRIBUTE,kt as SHORTCUT_EVENT,Tt as SHORTCUT_SCOPE_ATTRIBUTE,Nt as SHORTCUT_TEXT,dr as SUBMIT_ONCE_ATTRIBUTE,yt as THEME_CHANGE_EVENT,pt as THEME_EFFECTS,st as THEME_EFFECT_DURATION,_t as THEME_MODES,bt as THEME_SWITCHING_CLASS,de as VIRTUAL_OVERSCAN,En as acceptDroppedFiles,Cn as acceptLabel,ct as applyTheme,It as ariaKeyShortcuts,Dn as attachFileDrop,qn as attachInputMask,Ct as attachRowDrag,or as attachScrollEdges,nn as avatarCropOptions,tn as avatarUnreadableMessage,rr as buildPasswordRules,oe as clampColumnWidth,i as copyTextToClipboard,Ht as createLocalSeenStore,c as currencyPrefix,Bt as deriveStepStatus,ir as evaluatePassword,b as formatCompact,l as formatCurrency,m as formatDate,S as formatDateTime,u as formatDuration,bn as formatFileSize,Vn as formatMasked,d as formatNumber,v as formatPercent,it as formatRelativeTime,h as formatValue,Ce as glyphSvg,ae as groupCount,P as groupItems,et as groupNotificationsByDay,ye as identityCell,Et as inShortcutScope,un as initCommandShortcuts,$n as initInputMasks,ur as initScrollEdges,br as initSubmitOnce,we as inlineEditText,sn as isCommandChord,w as isCurrencyCode,dn as isElementDefined,en as isHeicFile,vn as isImageFile,Sn as isImageOnlyAccept,Ln as isMaskPattern,xn as isPdfFile,Wt as isTimeZone,At as isTypingTarget,ke as kanbanCardLabel,Pe as kanbanOverflow,He as kanbanStorageKey,Ae as kanbanSummaryFormat,je as kanbanVisibleLimit,Un as maskedPostValue,Vt as matchSegments,wn as matchesAccept,Se as measureRows,Ge as mentionLabel,qe as mentionTextFromValue,We as mentionValueFromText,Ue as mentionedIds,Rt as moveFocus,mt as nextTheme,Ze as notificationCountText,Ye as notificationDayHeading,$e as notificationTime,tt as notificationTriggerLabel,Xe as notificationUnreadAnnouncement,Ke as parseMentionValue,ar as passwordSatisfies,te as pinAtValue,xe as pinClasses,M as pinOffsetVar,D as planPins,be as playRowMoves,Bn as postedMasked,zn as rawMasked,N as readColumnWidths,Re as readKanbanCollapsed,St as readStoredTheme,at as relativeTimeTitle,V as resolveMask,lt as resolveTheme,er as revealActiveNavItem,k as rowLabel,O as rowOrderChanged,Dt as runShortcut,j as saveOutcomeText,le as setRowSaveState,E as settledRows,Ot as shortcutKey,Pt as shortcutName,jt as shortcutsOff,zt as stepperHeaderItems,ut as storeTheme,Fe as sumKanbanValues,wt as syncTargets,vt as themeBootScript,ht as themeKeyframes,f as timeZoneLabel,o as toInstant,Kt as todayIn,ft as transitionTheme,Tn as validateFile,ce as virtualRange,Ut as wallClockOf,dt as watchSystemTheme,fn as whenElementDefined,rt as withTrustedLabel,A as writeColumnWidths,Me as writeKanbanCollapsed,Gt as zoneOffsetMs,qt as zoneParts};
1
+ import{r as e}from"./dom-Do1pAA12.js";import{n as t,r as n,t as r}from"./commentText-BnX7rA2-.js";import{n as i,t as a}from"./copyText-Q-QZKBmx.js";import{_ as o,a as s,b as c,c as l,d as u,f as d,g as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,x as w,y as T}from"./formatters-ljfITOZ3.js";import{A as E,C as D,D as O,E as k,M as A,O as j,S as M,T as N,_ as P,a as ee,b as te,c as ne,d as re,f as ie,g as ae,h as oe,i as se,j as ce,k as le,l as ue,m as de,n as fe,o as pe,p as me,r as he,s as ge,t as _e,u as ve,v as ye,w as be,x as xe,y as Se}from"./dataTable-CcH1lBIM.js";import{t as Ce}from"./iconGlyphs.g-DPqoOoXy.js";import{t as we}from"./imeSafeEnter-DPs9qL3S.js";import{i as Te,n as Ee,r as De,t as Oe}from"./inlineEditText-CsLCQbcg.js";import{a as ke,c as Ae,d as je,f as Me,h as Ne,i as Pe,l as Fe,m as Ie,n as Le,o as Re,p as ze,r as Be,s as Ve,t as He,u as Ue}from"./kanbanModel-BaT75e-b.js";import{a as We,i as Ge,n as Ke,o as qe,r as Je,t as Ye}from"./mentionText-BJsw_opZ.js";import{a as Xe,c as Ze,i as Qe,n as $e,o as et,r as tt,s as nt,t as rt}from"./notificationDays-BIWczft0.js";import{o as it}from"./optionLabel-4xjXWy74.js";import{n as at,r as ot,t as st}from"./relativeTime-BahImc8F.js";import{a as ct,c as lt,d as ut,f as dt,g as ft,h as pt,i as mt,l as ht,m as gt,n as _t,o as vt,p as yt,r as bt,s as xt,t as St,u as Ct,v as wt,y as Tt}from"./themeTransition-CwE2VwQa.js";import{a as Et,c as Dt,d as Ot,f as kt,i as At,l as jt,m as Mt,n as Nt,o as Pt,p as Ft,r as It,s as Lt,t as Rt,u as zt}from"./shortcutKeys-COVLox98.js";import{n as Bt,t as Vt}from"./stepperHeader-yinJ_7Dk.js";import{t as Ht}from"./textMatch-wdY7XLIc.js";import{t as Ut}from"./tourSeenStore-z0Y_Znzx.js";import{i as Wt,n as Gt,o as Kt,r as qt,s as Jt,t as Yt}from"./zone-BR02ZkHF.js";var Xt=`image/jpeg,image/png,image/webp,image/heic,image/heif,.heic,.heif`,Zt=10,Qt=512,$t=`image/webp`,en=[96,48],F={dialogTitle:`Edit photo`,dialogSubtitle:`Drag to position the photo, then zoom or rotate it.`,save:`Save photo`,cancel:`Cancel`,choose:`Upload photo`,change:`Change photo`,camera:`Take photo`,remove:`Remove photo`,unreadable:`That photo could not be opened. Choose a JPG, PNG or WebP image.`,heicUnreadable:`This browser cannot open HEIC photos. Choose a JPG, PNG or WebP image instead.`,cropFailed:`That photo could not be saved. Try again, or choose another one.`};function tn(e){if(!e)return!1;let t=String(e.type||``).toLowerCase();return t===`image/heic`||t===`image/heif`||/\.hei[cf]$/i.test(String(e.name||``))}function nn(e){return tn(e)?F.heicUnreadable:F.unreadable}function rn(e,t){let n=Number(t);return{name:e?.name||`photo`,type:$t,size:Number.isInteger(n)&&n>0?n:512}}var an=`data-wui-command-shortcut`,on=`k`,sn=/* @__PURE__ */ new WeakSet;function cn(e,t){return!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.repeat?!1:String(e.key).toLowerCase()===String(t).toLowerCase()}function ln(e){return e.nodeType===Node.DOCUMENT_NODE}function un(t){let n=e(window.bootstrap?.Modal,`data-wui-command-shortcut: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`),r=t.closest(`.modal`);r&&n.getOrCreateInstance(r).show()}function dn(e){let t=ln(e)?e:e.ownerDocument;!sn.has(t)&&e.querySelector(`[data-wui-command-shortcut]`)&&(sn.add(t),t.addEventListener(`keydown`,e=>{for(let n of t.querySelectorAll(`[${an}]`))if(cn(e,n.getAttribute(`data-wui-command-shortcut`)||on)){e.preventDefault(),n.localName===`wui-command-palette`||n.classList.contains(`modal`)?un(n):(n.focus(),`select`in n&&typeof n.select==`function`&&n.select());return}}))}function fn(e){return typeof customElements<`u`&&customElements.get(e)!==void 0}async function pn(e){await customElements.whenDefined(e)}var mn=`image/png,image/jpeg,image/webp`,hn=5,gn={"image/png":[`.png`],"image/jpeg":[`.jpg`,`.jpeg`],"image/webp":[`.webp`],"image/gif":[`.gif`],"image/svg+xml":[`.svg`],"image/heic":[`.heic`],"image/heif":[`.heif`],"application/pdf":[`.pdf`],"text/plain":[`.txt`]},_n={"image/png":`PNG`,"image/jpeg":`JPG`,"image/webp":`WEBP`,"image/gif":`GIF`,"image/svg+xml":`SVG`,"image/heic":`HEIC`,"image/heif":`HEIC`,"application/pdf":`PDF`,"text/plain":`text file`,"image/*":`images`,"video/*":`videos`,"audio/*":`audio`,".png":`PNG`,".jpg":`JPG`,".jpeg":`JPG`,".webp":`WEBP`,".gif":`GIF`,".svg":`SVG`,".heic":`HEIC`,".heif":`HEIC`,".pdf":`PDF`,".txt":`text file`},I=e=>String(e||``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),vn=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.gif`,`.svg`,`.bmp`,`.avif`,`.heic`,`.heif`];function yn(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t.startsWith(`image/`);let n=typeof e==`string`?e:e.name||e.url||``,r=String(n).toLowerCase();return vn.some(e=>r.endsWith(e))}var bn=[`KB`,`MB`,`GB`];function xn(e){if(e<1024)return`${e} B`;let t=e/1024,n=0;for(;t>=1024&&n<bn.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${bn[n]}`}function Sn(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t===`application/pdf`;let n=typeof e==`string`?e:e.name||e.url||``;return String(n).toLowerCase().replace(/[?#][\s\S]*$/,``).endsWith(`.pdf`)}function Cn(e){let t=I(e);return t.length?t.every(e=>e.startsWith(`.`)?vn.includes(e):e===`image/*`||e.startsWith(`image/`)):!1}function wn(e){let t=[];for(let n of I(e)){let e=_n[n]||(n.startsWith(`.`)?n.slice(1).toUpperCase():n.toUpperCase());t.includes(e)||t.push(e)}return t.length<=1?t[0]||`supported`:`${t.slice(0,-1).join(`, `)} or ${t[t.length-1]}`}function Tn(e,t){let n=I(t);if(!n.length)return!0;let r=(e.type||``).toLowerCase(),i=(e.name||``).toLowerCase();return n.some(e=>e.startsWith(`.`)?i.endsWith(e):e.endsWith(`/*`)?r.startsWith(e.slice(0,-1)):r&&r===e?!0:!r&&(gn[e]||[]).some(e=>i.endsWith(e)))}function En(e,t={}){if(!e)return null;let n=t.accept===void 0?mn:t.accept,r=t.maxSizeMb===void 0?5:t.maxSizeMb;if(!Tn(e,n)){let e=wn(n),t=I(n).map(e=>[`images`,`videos`,`audio`].includes(_n[e]??``));return t.every(Boolean)?`Choose ${e}.`:t.some(Boolean)?`Choose ${e.endsWith(` file`)?`${e}s`:`${e} files`}.`:`Choose a ${e.endsWith(` file`)?e:`${e} file`}.`}return r!==null&&r>0&&e.size>r*1024*1024?`Keep the file under ${r} MB.`:null}function Dn(e,t){let n=Array.from(e||[]),r=t.multiple?n:n.slice(0,1),i=[],a=[];for(let e of r){let n=En(e,{accept:t.accept,maxSizeMb:t.maxSizeMb});n?a.push({file:e,message:n}):i.push(e)}return{files:i,rejections:a}}function On(e,t){let{overClass:n,isDisabled:r=()=>!1,onFiles:i,onReject:a,...o}=t,s=0,c=t=>e.classList.toggle(n,t),l=e=>{e.preventDefault(),r()||(s+=1,c(!0))},u=e=>{e.preventDefault(),r()||c(!0)},d=e=>{e.preventDefault(),r()||(s=Math.max(0,s-1),s===0&&c(!1))},f=e=>{if(e.preventDefault(),s=0,c(!1),r())return;let{files:t,rejections:n}=Dn(e.dataTransfer?.files,o);t.length&&i(t);let l=n[0];l&&a(l)};return e.addEventListener(`dragenter`,l),e.addEventListener(`dragover`,u),e.addEventListener(`dragleave`,d),e.addEventListener(`drop`,f),()=>{e.removeEventListener(`dragenter`,l),e.removeEventListener(`dragover`,u),e.removeEventListener(`dragleave`,d),e.removeEventListener(`drop`,f)}}var L=/[0-9]/,kn={9:L,A:/[A-Za-z]/,"*":/[0-9A-Za-z]/},An=/[9A*]/,R=/* @__PURE__ */ new Set([`text`,`tel`,`search`,`url`,`password`]),jn=e=>{let t=e.replace(/\D/g,``);return t.length===12&&t.startsWith(`91`)?t.slice(2):t.length===11&&t.startsWith(`0`)?t.slice(1):e},Mn=e=>{let t=Number(e.slice(0,2)),n=Number(e.slice(2,4)),r=Number(e.slice(4,8));if(r<1)return!1;let i=new Date(Date.UTC(r,n-1,t));return i.getUTCFullYear()===r&&i.getUTCMonth()===n-1&&i.getUTCDate()===t},Nn=e=>e.length<=3?e:`${e.slice(0,-3).replace(/\B(?=(\d{2})+(?!\d))/g,`,`)},${e.slice(-3)}`,Pn=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());return t?`${t[3]}-${t[2]}-${t[1]}`:e};function z(e,{upper:t=!1,normalize:n,valid:r,post:i=e=>e,message:a=`Enter the full value`}={}){let o=[...e].map(e=>{let t=kn[e];return t?{re:t}:{lit:e}}),s=o.filter(e=>e.re).length;return{inputMode:o.every(e=>!e.re||e.re===L)?`numeric`:`text`,normalize:n,post:i,message:a,extract(e){let n=``,r=0;for(let i of e){for(;r<o.length&&o[r]?.lit!==void 0&&o[r]?.lit!==i;)r++;if(r>=o.length)break;let e=o[r];e?.lit===void 0?e?.re.test(i)&&(n+=t?i.toUpperCase():i,r++):r++}return n},layout(e){let t=``,n=[],r=0;for(let i=0;i<o.length&&r<e.length;i++){let a=o[i];a?.lit===void 0?(t+=e.charAt(r++),n.push(!0)):(t+=a.lit,n.push(!1))}return{text:t,isRaw:n}},isValid:e=>e.length===s&&(!r||r(e))}}function Fn(){return{inputMode:`decimal`,post:e=>e,message:`Enter a valid amount`,extract(e){let t=``,n=!1,r=0;for(let i of e)L.test(i)?n?r<2&&(t+=i,r++):t+=i:i===`.`&&!n&&(n=!0,t+=i);return t.startsWith(`.`)&&(t=`0${t}`),t.replace(/^0+(?=\d)/,``)},layout(e){let[t=``,n]=e.split(`.`),r=Nn(t)+(e.includes(`.`)?`.${n}`:``);return{text:r,isRaw:[...r].map(e=>e!==`,`)}},isValid:e=>/^\d+(\.\d{1,2})?$/.test(e)}}var B={"phone-in":()=>z(`99999 99999`,{normalize:jn,valid:e=>/^[6-9]/.test(e),message:`Enter a 10-digit mobile number`}),pan:()=>z(`AAAAA9999A`,{upper:!0,valid:e=>/^[A-Z]{5}\d{4}[A-Z]$/.test(e),message:`Enter a valid PAN`}),gstin:()=>z(`99AAAAA9999A***`,{upper:!0,valid:e=>/^\d{2}[A-Z]{5}\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$/.test(e),message:`Enter a valid GSTIN`}),aadhaar:()=>z(`9999 9999 9999`,{valid:e=>/^[2-9]/.test(e),message:`Enter a valid 12-digit Aadhaar number`}),ifsc:()=>z(`AAAA*******`,{upper:!0,valid:e=>/^[A-Z]{4}0[A-Z0-9]{6}$/.test(e),message:`Enter a valid IFSC`}),"pin-code":()=>z(`999999`,{valid:e=>/^[1-9]/.test(e),message:`Enter a valid 6-digit PIN code`}),date:()=>z(`99-99-9999`,{normalize:Pn,valid:Mn,post:(e,t)=>e.length===8&&Mn(e)?`${e.slice(4)}-${e.slice(2,4)}-${e.slice(0,2)}`:t,message:`Enter a valid date as DD-MM-YYYY`}),amount:Fn},In=Object.keys(B),Ln=e=>{let t=String(e).toLowerCase();return Object.hasOwn(B,t)?t:void 0},Rn=e=>An.test(String(e))&&Ln(e)===void 0,zn=/* @__PURE__ */ new Map;function V(e){if(e==null||e===``)return null;let t=String(e),n=zn.get(t);return n===void 0&&(n=Rn(t)?z(t):Object.hasOwn(B,t)?B[t]?.()??null:null,zn.set(t,n)),n}var H=(e,t)=>e.normalize?e.normalize(t):t;function Bn(e,t){let n=V(e);return n?n.extract(H(n,String(t??``))):String(t??``)}function Vn(e,t){let n=V(e);if(!n)return String(t??``);let r=n.extract(H(n,String(t??``)));return n.post(r,n.layout(r).text)}function Hn(e,t){let n=V(e);return n?n.layout(n.extract(H(n,String(t??``)))).text:String(t??``)}var Un=(e,t)=>{if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(e[r]&&++n===t)return r+1;return e.length},U=/* @__PURE__ */ new WeakMap,Wn=e=>U.get(e)?.(),Gn=/* @__PURE__ */ new WeakMap;function Kn(e,t,n,r){let i=e.getAll(t),a=Gn.get(e)??/* @__PURE__ */ new Set;Gn.set(e,a);let o=i.findIndex((e,r)=>e===n&&!a.has(`${t}\u0000${r}`));if(!(o<0)){if(a.add(`${t}\u0000${o}`),i[o]=r,i.length===1)e.set(t,r);else{e.delete(t);for(let n of i)e.append(t,n)}}}function qn(e){let t=null,n=null,r=!1,i=(t,n)=>{n===null?e.removeAttribute(t):n!==void 0&&e.setAttribute(t,n)},a,o,s=()=>{t?.remove(),t=null,n&&(n.hidden=!1),n=null,r&&e.classList.remove(`error`),r=!1,i(`aria-invalid`,a),i(`aria-describedby`,o),a=void 0,o=void 0};return i=>{if(!i){s();return}let c=e.closest(`.field`),l=c instanceof HTMLElement?c:null,u=l?.querySelector(`.field-error`);if(!(u&&u!==t&&u.textContent?.trim())){if(!t){if(r=!e.classList.contains(`error`),e.classList.add(`error`),a=e.getAttribute(`aria-invalid`),o=e.getAttribute(`aria-describedby`),l){t=document.createElement(`div`),t.className=`field-error`,e.id&&(t.id=`${e.id}-error`);let r=l.querySelector(`.field-hint`);n=r instanceof HTMLElement?r:null,n&&(n.hidden=!0),l.insertBefore(t,[...l.children].find(e=>e.classList.contains(`field-count`))??null),t.id&&e.setAttribute(`aria-describedby`,t.id)}e.setAttribute(`aria-invalid`,`true`)}t&&(t.textContent=i)}}}function Jn(t,{mask:n,postFormatted:r=!1,onChange:i,onInvalidChange:a}={}){let o=V(n);if(!o||!R.has(t.type))return()=>{};let s=Object.getPrototypeOf(t),c=Object.getOwnPropertyDescriptor(s,`value`);if(!c?.set)throw Error(`input value setter missing`);let l=c.set,u=!t.hasAttribute(`inputmode`);u&&t.setAttribute(`inputmode`,o.inputMode);let d=a??qn(t),f=null,p=!1,m=!1,h=!1,g=``,_=``,v,y=()=>{let e=h?g:``;e!==_&&(_=e,d(_))},b=(e,n,r)=>{let a=o.extract(e.slice(0,n)).length,s=o.extract(e),{text:c,isRaw:u}=o.layout(s);if(t.value!==c&&(l.call(t,c),document.activeElement===t&&R.has(t.type))){let e=Un(u,a);t.setSelectionRange(e,e)}t.dataset.maskRaw=s,g=s&&!o.isValid(s)?o.message:``,t.setCustomValidity(g),y(),r&&s!==f&&i?.(s,c),f=s},x=Object.getOwnPropertyDescriptor(t,`value`),S=x??c;Object.defineProperty(t,"value",{configurable:!0,...S.enumerable===void 0?{}:{enumerable:S.enumerable},get:()=>e(S.get,`input value getter missing`).call(t),set:n=>{if(e(S.set,`input value setter missing`).call(t,n),m)return;let r=H(o,t.value);b(r,r.length,!0)}});let C=()=>{p=!0,t.dispatchEvent(new Event(`input`,{bubbles:!0})),p=!1},w=e=>{let n=e instanceof InputEvent?e:null;if(p||m||n?.isComposing)return;let r=n?.inputType===`insertText`&&(n.data?.length??0)<=1||n?.inputType?.startsWith(`delete`)?t.value:H(o,t.value);b(r,t.selectionStart??r.length,!0)},T=()=>{m=!0},E=()=>{m=!1;let e=H(o,t.value);b(e,t.selectionStart??e.length,!0),C()},D=e=>{let n=e.inputType===`deleteContentBackward`;if(!n&&e.inputType!==`deleteContentForward`||e.isComposing)return;let r=t.selectionStart;if(r==null||r!==t.selectionEnd)return;let{isRaw:i}=o.layout(o.extract(t.value)),a=n?r-1:r;for(;a>=0&&a<i.length&&!i[a];)a+=n?-1:1;a!==(n?r-1:r)&&(e.preventDefault(),a<0||a>=i.length||(b(t.value.slice(0,a)+t.value.slice(a+1),n?a:r,!0),C()))},O=e=>{if(t.readOnly||t.disabled)return;let n=e.clipboardData?.getData(`text`);if(n==null)return;e.preventDefault();let r=H(o,n),i=t.selectionStart??t.value.length,a=t.selectionEnd??i;b(t.value.slice(0,i)+r+t.value.slice(a),i+r.length,!0),C()},k=()=>{let e=o.extract(t.value);return o.post(e,o.layout(e).text)},A=()=>{h=!0,y()};t.addEventListener(`input`,w),t.addEventListener(`beforeinput`,D),t.addEventListener(`paste`,O),t.addEventListener(`compositionstart`,T),t.addEventListener(`compositionend`,E),t.addEventListener(`blur`,A),t.addEventListener(`invalid`,A);let j=t.form,M=e=>{t.name&&!t.disabled&&Kn(e.formData,t.name,t.value,k())},N=()=>{clearTimeout(v),v=setTimeout(()=>{h=!1,b(H(o,t.value),t.value.length,!0)},0)};r||(j?.addEventListener(`formdata`,M),U.set(t,k)),j?.addEventListener(`reset`,N),j?.addEventListener(`submit`,A);let P=H(o,t.value);return b(P,P.length,!1),()=>{clearTimeout(v),t.removeEventListener(`input`,w),t.removeEventListener(`beforeinput`,D),t.removeEventListener(`paste`,O),t.removeEventListener(`compositionstart`,T),t.removeEventListener(`compositionend`,E),t.removeEventListener(`blur`,A),t.removeEventListener(`invalid`,A),j?.removeEventListener(`formdata`,M),j?.removeEventListener(`reset`,N),j?.removeEventListener(`submit`,A),U.delete(t),x?Object.defineProperty(t,"value",x):Reflect.deleteProperty(t,`value`),h=!1,g=``,y(),t.setCustomValidity(``),delete t.dataset.maskRaw,u&&t.removeAttribute(`inputmode`)}}function Yn(){let e=typeof window>`u`?void 0:window.jQuery?.validator?.prototype;if(!e||e.wuiMaskHook)return;let t=e.elementValue;e.elementValue=function(e){let n=Wn(e);return n===void 0?t.call(this,e):n},e.wuiMaskHook=!0}var W=/* @__PURE__ */ new WeakMap,G,Xn=e=>{W.has(e)||W.set(e,Jn(e,{mask:e.dataset.appMask,postFormatted:e.hasAttribute(`data-mask-post-formatted`)}))},Zn=e=>[...e.querySelectorAll(`input[data-app-mask]`)].filter(e=>e instanceof HTMLInputElement),Qn=e=>e instanceof Element?[...e instanceof HTMLInputElement&&e.matches(`input[data-app-mask]`)?[e]:[],...Zn(e)]:[];function $n(){G||typeof MutationObserver>`u`||(G=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of Qn(e))W.get(t)?.(),W.delete(t);for(let e of t.addedNodes)for(let t of Qn(e))Xn(t)}}),G.observe(document.documentElement,{childList:!0,subtree:!0}))}function er(e=document){Yn();for(let t of Zn(e))Xn(t);e===document&&$n()}function tr(e){if(!e)return;let t=e.querySelector(`[aria-current="page"]`);if(!t)return;let n=t.getBoundingClientRect();if(n.height===0)return;let r=e.getBoundingClientRect(),i=r.height,a=t=>t.top-r.top-e.clientTop+e.scrollTop,o=a(n),s=o+n.height,c=(t.closest(`.app-nav-group`)?.querySelector(`:scope > .app-nav-group-label`))?.getBoundingClientRect(),l;if(c&&c.height>0)l=Math.min(Math.max(a(c),s-i),o);else if(o<e.scrollTop)l=o;else if(s>e.scrollTop+i)l=s-i;else return;e.scrollTop=Math.max(0,l)}var K={minLength:10,uppercase:!0,lowercase:!0,digit:!0,special:!0,uniqueChars:0,customRules:[]},nr=`Password requirements`;function rr(e){return e===!0||e==null?{...K}:{...K,...e}}function ir(e){let t=rr(e),n=[];if(t.minLength>0&&n.push({key:`length`,label:`At least ${t.minLength} characters long`,test:e=>e.length>=t.minLength}),t.uppercase&&n.push({key:`uppercase`,label:`At least one uppercase letter`,test:e=>/[A-Z]/.test(e)}),t.lowercase&&n.push({key:`lowercase`,label:`At least one lowercase letter`,test:e=>/[a-z]/.test(e)}),t.digit&&n.push({key:`digit`,label:`At least one digit`,test:e=>/[0-9]/.test(e)}),t.special&&n.push({key:`special`,label:`At least one special character`,test:e=>/[^A-Za-z0-9]/.test(e)}),t.uniqueChars>0){let e=t.uniqueChars;n.push({key:`unique`,label:`At least ${e} unique character${e>1?`s`:``}`,test:t=>new Set(t).size>=e})}for(let[e,r]of(t.customRules??[]).entries()){let t=new RegExp(r.pattern);n.push({key:`custom-${e}`,label:r.label,test:e=>t.test(e)})}return n}function ar(e,t){let n=e==null?``:String(e);return ir(t).map(e=>({key:e.key,label:e.label,met:e.test(n)}))}function or(e,t){return ar(e,t).every(e=>e.met)}var q=`.table-wrap, .table-responsive, [class*="table-responsive-"]`,J=1;function sr(e){let t=()=>{let t=e.scrollWidth-e.clientWidth,n=Math.abs(e.scrollLeft);e.toggleAttribute(`data-wui-overflow-start`,t>J&&n>J),e.toggleAttribute(`data-wui-overflow-end`,t>J&&n<t-J),e.toggleAttribute(`data-wui-overflow-top`,e.scrollTop>J)},n=()=>{if(e.scrollWidth-e.clientWidth>J){let t=getComputedStyle(e);e.style.setProperty(`--wui-scroll-pad-start`,t.paddingInlineStart),e.style.setProperty(`--wui-scroll-pad-end`,t.paddingInlineEnd)}else e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))},r=()=>{n(),t()};e.addEventListener(`scroll`,t,{passive:!0});let i=null;if(typeof ResizeObserver<`u`){i=new ResizeObserver(r),i.observe(e);for(let t of e.children)i.observe(t)}return r(),()=>{e.removeEventListener(`scroll`,t),i?.disconnect(),e.removeAttribute(`data-wui-overflow-start`),e.removeAttribute(`data-wui-overflow-end`),e.removeAttribute(`data-wui-overflow-top`),e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))}}var Y=/* @__PURE__ */ new WeakMap,X,cr=e=>{Y.has(e)||Y.set(e,sr(e))},lr=e=>{if(!(e instanceof HTMLElement))return[];let t=e.matches(`.table-wrap, .table-responsive, [class*="table-responsive-"]`)?[e]:[];if(e.firstElementChild===null)return t;let n=[...e.querySelectorAll(q)].filter(e=>e instanceof HTMLElement);return[...t,...n]};function ur(){X||typeof MutationObserver>`u`||(X=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of lr(e))Y.get(t)?.(),Y.delete(t);for(let e of t.addedNodes)for(let t of lr(e))cr(t)}}),X.observe(document.documentElement,{childList:!0,subtree:!0}))}function dr(e=document){for(let t of e.querySelectorAll(q))t instanceof HTMLElement&&cr(t);e===document&&ur()}var fr=`data-wui-submit-once`,Z=`data-wui-submit-pending`,Q=`wui-submit-spinner`,pr=/* @__PURE__ */ new WeakSet,$=/* @__PURE__ */ new WeakMap;function mr(e){return e instanceof HTMLButtonElement||e instanceof HTMLInputElement?e:null}function hr(e){if(e.setAttribute(`aria-busy`,`true`),e.tagName===`INPUT`||e.querySelector(`.${Q}`))return;let t=e.ownerDocument.createElement(`span`);t.className=`spinner-border spinner-border-sm me-2 ${Q}`,t.setAttribute(`aria-hidden`,`true`),e.prepend(t)}function gr(e){e.removeAttribute(`aria-busy`),e.querySelector(`.${Q}`)?.remove()}function _r(e){return e.method===`post`&&e.target!==`_blank`&&e.getAttribute(`data-wui-submit-once`)!==`off`}function vr(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!_r(t))return;if(t.hasAttribute(Z)){e.preventDefault();return}t.setAttribute(Z,``);let n=mr(e.submitter);setTimeout(()=>{t.hasAttribute(Z)&&(e.defaultPrevented?t.removeAttribute(Z):n&&(n.disabled=!0,hr(n),$.set(t,n)))},0)}var yr=e=>[...e.querySelectorAll(`form[${Z}]`)].filter(e=>e instanceof HTMLFormElement);function br(e){for(let t of yr(e)){t.removeAttribute(Z);let e=$.get(t);e&&(e.disabled=!1,gr(e),$.delete(t))}}function xr(e){let t=e.ownerDocument===null?e:e.ownerDocument;pr.has(t)||(pr.add(t),t.addEventListener(`submit`,vr,!0),t.defaultView?.addEventListener(`pageshow`,()=>br(t)))}export{Xt as AVATAR_ACCEPT,Zt as AVATAR_MAX_SIZE_MB,Qt as AVATAR_OUTPUT_SIZE,$t as AVATAR_OUTPUT_TYPE,en as AVATAR_PREVIEW_SIZES,F as AVATAR_TEXT,_e as COLUMN_MAX_WIDTH,fe as COLUMN_MIN_WIDTH,an as COMMAND_SHORTCUT_ATTRIBUTE,r as COMMENT_INTENTS,t as COMMENT_REACTIONS,n as COMMENT_TEXT,a as COPY_FEEDBACK_MS,x as CURRENCIES,C as CURRENCY_SYMBOLS,he as DATA_TABLE_TEXT,g as DATE_PATTERNS,T as DEFAULT_CURRENCY,mn as DEFAULT_IMAGE_ACCEPT,hn as DEFAULT_MAX_SIZE_MB,K as DEFAULT_PASSWORD_RULES,nr as DEFAULT_REQUIREMENTS_TITLE,St as DEFAULT_THEME_EFFECT,_t as DEFAULT_THEME_STORAGE_KEY,y as DURATION_UNITS,p as EMPTY_VALUE,s as FORMAT_STYLES,Oe as INLINE_EDIT_SAVED_MS,Ee as INLINE_EDIT_TEXT,De as INLINE_EDIT_TYPES,Yt as IST_TIME_ZONE,He as KANBAN_DRAG_THRESHOLD_PX,Le as KANBAN_LONG_PRESS_MS,Be as KANBAN_PHONE_QUERY,Pe as KANBAN_STORAGE_PREFIX,ke as KANBAN_SUMMARY_FORMATS,Re as KANBAN_TEXT,Ve as KANBAN_TONES,Rt as LIST_KEYS,R as MASK_INPUT_TYPES,In as MASK_NAMES,Ye as MENTION_ID_PATTERN,_ as MONEY_UNITS,rt as NOTIFICATION_COUNT_CAP,$e as NOTIFICATION_TEXT,se as PIN_AT_VAR,ee as PIN_SIDES,st as RELATIVE_LIMIT_DAYS,pe as RESIZE_STEP,ge as RESIZE_STEP_LARGE,ne as ROW_HEIGHTS,ue as ROW_MOVE_LIMIT,ve as ROW_MOVE_MS,re as ROW_SAVE_ATTR,ie as ROW_SAVE_ERROR_CLASS,me as ROW_SAVE_STATES,q as SCROLL_EDGE_SELECTOR,Nt as SELECT_KEY,It as SHORTCUTS_OFF_ATTRIBUTE,At as SHORTCUT_EVENT,Et as SHORTCUT_SCOPE_ATTRIBUTE,Pt as SHORTCUT_TEXT,fr as SUBMIT_ONCE_ATTRIBUTE,bt as THEME_CHANGE_EVENT,mt as THEME_EFFECTS,ct as THEME_EFFECT_DURATION,vt as THEME_MODES,xt as THEME_SWITCHING_CLASS,de as VIRTUAL_OVERSCAN,Dn as acceptDroppedFiles,wn as acceptLabel,lt as applyTheme,Lt as ariaKeyShortcuts,On as attachFileDrop,Jn as attachInputMask,wt as attachRowDrag,sr as attachScrollEdges,rn as avatarCropOptions,nn as avatarUnreadableMessage,ir as buildPasswordRules,oe as clampColumnWidth,i as copyTextToClipboard,Ut as createLocalSeenStore,c as currencyPrefix,Vt as deriveStepStatus,ar as evaluatePassword,b as formatCompact,l as formatCurrency,m as formatDate,S as formatDateTime,u as formatDuration,xn as formatFileSize,Hn as formatMasked,d as formatNumber,v as formatPercent,at as formatRelativeTime,h as formatValue,Ce as glyphSvg,ae as groupCount,P as groupItems,tt as groupNotificationsByDay,ye as identityCell,Dt as inShortcutScope,dn as initCommandShortcuts,er as initInputMasks,dr as initScrollEdges,xr as initSubmitOnce,Te as inlineEditText,cn as isCommandChord,w as isCurrencyCode,fn as isElementDefined,tn as isHeicFile,yn as isImageFile,Cn as isImageOnlyAccept,we as isImeSafeEnter,Rn as isMaskPattern,Sn as isPdfFile,Gt as isTimeZone,jt as isTypingTarget,Ae as kanbanCardLabel,Fe as kanbanOverflow,Ue as kanbanStorageKey,je as kanbanSummaryFormat,Me as kanbanVisibleLimit,Wn as maskedPostValue,Ht as matchSegments,Tn as matchesAccept,Se as measureRows,Ke as mentionLabel,Je as mentionTextFromValue,Ge as mentionValueFromText,We as mentionedIds,zt as moveFocus,ht as nextTheme,Qe as notificationCountText,Xe as notificationDayHeading,et as notificationTime,nt as notificationTriggerLabel,Ze as notificationUnreadAnnouncement,qe as parseMentionValue,or as passwordSatisfies,te as pinAtValue,xe as pinClasses,M as pinOffsetVar,D as planPins,be as playRowMoves,Vn as postedMasked,Bn as rawMasked,N as readColumnWidths,ze as readKanbanCollapsed,Ct as readStoredTheme,ot as relativeTimeTitle,V as resolveMask,ut as resolveTheme,tr as revealActiveNavItem,k as rowLabel,O as rowOrderChanged,Ot as runShortcut,j as saveOutcomeText,le as setRowSaveState,E as settledRows,kt as shortcutKey,Ft as shortcutName,Mt as shortcutsOff,Bt as stepperHeaderItems,dt as storeTheme,Ie as sumKanbanValues,Tt as syncTargets,yt as themeBootScript,gt as themeKeyframes,f as timeZoneLabel,o as toInstant,qt as todayIn,pt as transitionTheme,En as validateFile,ce as virtualRange,Wt as wallClockOf,ft as watchSystemTheme,pn as whenElementDefined,it as withTrustedLabel,A as writeColumnWidths,Ne as writeKanbanCollapsed,Kt as zoneOffsetMs,Jt as zoneParts};
@@ -0,0 +1 @@
1
+ function e(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}export{e as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./imeSafeEnter-DPs9qL3S.js";var t=e=>e.target instanceof Element?e.target.tagName:void 0;function n(n){let{getVisibleOptions:r,getActive:i,setActive:a,onEnter:o,onEscape:s,onTypeahead:c,typeaheadMs:l=500}=n,u=``,d=null,f=()=>{clearTimeout(d??void 0),d=null,u=``};return{handler:n=>{let p=r(),m=i(),h=t(n)===`INPUT`||t(n)===`TEXTAREA`;if(n.key===`ArrowDown`)n.preventDefault(),a(Math.min(m+1,p.length-1));else if(n.key===`ArrowUp`)n.preventDefault(),a(Math.max(m-1,0));else if(n.key===`Home`&&!h)n.preventDefault(),p.length&&a(0);else if(n.key===`End`&&!h)n.preventDefault(),p.length&&a(p.length-1);else if(n.key===`PageDown`&&!h){if(n.preventDefault(),!p.length)return;a(Math.min(Math.max(0,m)+8,p.length-1))}else if(n.key===`PageUp`&&!h){if(n.preventDefault(),!p.length)return;a(Math.max(Math.max(0,m)-8,0))}else if(e(n))o&&(n.preventDefault(),o(p[m],p));else if(n.key===`Escape`)s&&s();else if(n.key.length===1&&!n.ctrlKey&&!n.metaKey&&!n.altKey&&t(n)!==`INPUT`&&t(n)!==`TEXTAREA`){n.preventDefault(),clearTimeout(d??void 0),u+=n.key.toLowerCase(),d=setTimeout(f,l);let e=p.findIndex(e=>e.textContent.trim().toLowerCase().startsWith(u));e>=0&&(a(e),c&&c(n.key,e,p))}},clearTypeahead:f,teardown:f}}function r(e,t){let n=e.querySelector(`.is-active`);n!==t&&(n?.classList.remove(`is-active`),t?.classList.add(`is-active`))}export{r as n,n as t};
@@ -1 +1 @@
1
- var e=Object.freeze({carousel:{entries:[`elements/carousel.ts`],tags:[`wui-carousel`]},"code-block":{entries:[`elements/code-block.ts`],tags:[`wui-code-block`]},"command-palette":{entries:[`elements/command-palette.ts`],tags:[`wui-command-palette`]},"comment-thread":{entries:[`elements/comment-thread.ts`],tags:[`wui-mention-input`,`wui-comment-thread`]},"consent-banner":{entries:[`elements/consent-banner.ts`],tags:[`wui-consent-banner`]},"context-menu":{entries:[`elements/context-menu.ts`],tags:[`wui-context-menu`]},"date-range":{entries:[`elements/date-range.ts`],tags:[`wui-date-range`]},drawer:{entries:[`elements/drawer.ts`],tags:[`wui-drawer`]},"image-crop":{entries:[`elements/image-crop.ts`],tags:[`wui-image-crop`]},"inline-edit":{entries:[`elements/inline-edit.ts`],tags:[`wui-inline-edit`]},kanban:{entries:[`elements/kanban.ts`],tags:[`wui-kanban`]},"lead-popup":{entries:[`elements/lead-popup.ts`],tags:[`wui-lead-popup`]},lightbox:{entries:[`elements/lightbox.ts`],tags:[`wui-lightbox`]},"org-tree":{entries:[`elements/org-tree.ts`],tags:[`wui-org-tree`]},markdown:{entries:[`elements/markdown.ts`],tags:[`wui-markdown`]},phone:{entries:[`elements/phone.ts`,`global/parts/select-country.ts`],tags:[`wui-phone`]},resizable:{entries:[`elements/resizable.ts`],tags:[`wui-resizable`]},"saved-views":{entries:[`elements/saved-views.ts`],tags:[`wui-saved-views`]},glyphs:{entries:[`global/parts/glyphs.ts`],tags:[]},"select-chips":{entries:[`global/parts/select-chips.ts`],tags:[]},"select-recents":{entries:[`global/parts/select-recents.ts`],tags:[]},"select-search":{entries:[`global/parts/select-search.ts`],tags:[]},slider:{entries:[`elements/slider.ts`],tags:[`wui-slider`]},sortable:{entries:[`elements/sortable.ts`],tags:[`wui-sortable`]},"status-icon":{entries:[`elements/status-icon.ts`],tags:[`wui-status-icon`]},timepicker:{entries:[`elements/timepicker.ts`],tags:[`wui-timepicker`]},tour:{entries:[`elements/tour.ts`],tags:[`wui-tour`]},tree:{entries:[`elements/tree.ts`],tags:[`wui-tree`]},wizard:{entries:[`elements/wizard.ts`],tags:[`wui-wizard-step`,`wui-wizard`]},chart:{file:`ui-chart.global.js`,tags:[`wui-chart`],selfContained:!0},calendar:{file:`ui-calendar.global.js`,tags:[`wui-calendar`],selfContained:!0},"rich-text":{file:`ui-rich-text.global.js`,tags:[`wui-rich-text`],selfContained:!0},"file-viewer":{file:`ui-file-viewer.global.js`,tags:[`wui-file-viewer`],selfContained:!0}});Object.freeze({anchorOverlay:`anchorOverlay.ts`,buttonClass:`buttonClass.ts`,calendarMath:`calendarMath.ts`,copyText:`copyText.ts`,dataTable:`dataTable.ts`,defineElement:`defineElement.ts`,devWarn:`devWarn.ts`,elementBase:`elementBase.ts`,fieldState:`fieldState.ts`,formatters:`formatters.ts`,formMirror:`formMirror.ts`,glyphs:`global/glyphs.ts`,iconGlyphs:`iconGlyphs.g.ts`,listboxKeyNav:`listboxKeyNav.ts`,loader:`global/loader.ts`,mentionText:`mentionText.ts`,notificationDays:`notificationDays.ts`,optionLabel:`optionLabel.ts`,partRegistry:`select/partRegistry.ts`,selectList:`select/list.ts`,selectRemote:`select/remote.ts`,stepperHeader:`stepperHeader.ts`,tableSelect:`tableSelect.ts`,textMatch:`textMatch.ts`,wuiHttp:`server/wuiHttp.ts`,WuiSelect:`WuiSelect.ts`,zone:`zone.ts`});var t=`wui-elements:defined`,n=`wui-elements:load-error`,r=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(e))for(let e of n.tags)r.set(e,t);[...r.keys()].join(`,`);export{n,t};
1
+ var e=Object.freeze({carousel:{entries:[`elements/carousel.ts`],tags:[`wui-carousel`]},"code-block":{entries:[`elements/code-block.ts`],tags:[`wui-code-block`]},"command-palette":{entries:[`elements/command-palette.ts`],tags:[`wui-command-palette`]},"comment-thread":{entries:[`elements/comment-thread.ts`],tags:[`wui-mention-input`,`wui-comment-thread`]},"consent-banner":{entries:[`elements/consent-banner.ts`],tags:[`wui-consent-banner`]},"context-menu":{entries:[`elements/context-menu.ts`],tags:[`wui-context-menu`]},"date-range":{entries:[`elements/date-range.ts`],tags:[`wui-date-range`]},drawer:{entries:[`elements/drawer.ts`],tags:[`wui-drawer`]},"image-crop":{entries:[`elements/image-crop.ts`],tags:[`wui-image-crop`]},"inline-edit":{entries:[`elements/inline-edit.ts`],tags:[`wui-inline-edit`]},kanban:{entries:[`elements/kanban.ts`],tags:[`wui-kanban`]},"lead-popup":{entries:[`elements/lead-popup.ts`],tags:[`wui-lead-popup`]},lightbox:{entries:[`elements/lightbox.ts`],tags:[`wui-lightbox`]},"org-tree":{entries:[`elements/org-tree.ts`],tags:[`wui-org-tree`]},markdown:{entries:[`elements/markdown.ts`],tags:[`wui-markdown`]},phone:{entries:[`elements/phone.ts`,`global/parts/select-country.ts`],tags:[`wui-phone`]},resizable:{entries:[`elements/resizable.ts`],tags:[`wui-resizable`]},"saved-views":{entries:[`elements/saved-views.ts`],tags:[`wui-saved-views`]},glyphs:{entries:[`global/parts/glyphs.ts`],tags:[]},"select-chips":{entries:[`global/parts/select-chips.ts`],tags:[]},"select-recents":{entries:[`global/parts/select-recents.ts`],tags:[]},"select-search":{entries:[`global/parts/select-search.ts`],tags:[]},slider:{entries:[`elements/slider.ts`],tags:[`wui-slider`]},sortable:{entries:[`elements/sortable.ts`],tags:[`wui-sortable`]},"status-icon":{entries:[`elements/status-icon.ts`],tags:[`wui-status-icon`]},timepicker:{entries:[`elements/timepicker.ts`],tags:[`wui-timepicker`]},tour:{entries:[`elements/tour.ts`],tags:[`wui-tour`]},tree:{entries:[`elements/tree.ts`],tags:[`wui-tree`]},wizard:{entries:[`elements/wizard.ts`],tags:[`wui-wizard-step`,`wui-wizard`]},chart:{file:`ui-chart.global.js`,tags:[`wui-chart`],selfContained:!0},calendar:{file:`ui-calendar.global.js`,tags:[`wui-calendar`],selfContained:!0},"rich-text":{file:`ui-rich-text.global.js`,tags:[`wui-rich-text`],selfContained:!0},"file-viewer":{file:`ui-file-viewer.global.js`,tags:[`wui-file-viewer`],selfContained:!0}});Object.freeze({anchorOverlay:`anchorOverlay.ts`,buttonClass:`buttonClass.ts`,calendarMath:`calendarMath.ts`,copyText:`copyText.ts`,dataTable:`dataTable.ts`,defineElement:`defineElement.ts`,devWarn:`devWarn.ts`,elementBase:`elementBase.ts`,fieldState:`fieldState.ts`,formatters:`formatters.ts`,formMirror:`formMirror.ts`,glyphs:`global/glyphs.ts`,iconGlyphs:`iconGlyphs.g.ts`,imeSafeEnter:`imeSafeEnter.ts`,listboxKeyNav:`listboxKeyNav.ts`,loader:`global/loader.ts`,mentionText:`mentionText.ts`,notificationDays:`notificationDays.ts`,optionLabel:`optionLabel.ts`,partRegistry:`select/partRegistry.ts`,selectList:`select/list.ts`,selectRemote:`select/remote.ts`,stepperHeader:`stepperHeader.ts`,tableSelect:`tableSelect.ts`,textMatch:`textMatch.ts`,wuiHttp:`server/wuiHttp.ts`,WuiSelect:`WuiSelect.ts`,zone:`zone.ts`});var t=`wui-elements:defined`,n=`wui-elements:load-error`,r=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(e))for(let e of n.tags)r.set(e,t);[...r.keys()].join(`,`);export{n,t};
@@ -1 +1 @@
1
- import{n as e}from"./devWarn-DXdRWZs3.js";import{i as t}from"./optionLabel-4xjXWy74.js";import{t as n}from"./customRule-Chp7YwFb.js";import{n as r}from"./WuiSelect-CWul-aM1.js";var i=(e,n)=>{let r=n.toLowerCase(),i=e.getAttribute(`value-label`);return i&&String(e.value??``)!==``&&i.toLowerCase()===r?!0:e.options.some(e=>t(e).toLowerCase()===r||String(e.value??``).toLowerCase()===r)},a=e=>{let t=[...e.querySelectorAll(`.wui-select-option`)].filter(e=>e.dataset.custom!==`true`&&e.getAttribute(`aria-disabled`)!==`true`);return t.length===1?t[0]?.dataset.value??null:null};function o(){let t,o,s=0,c,l=null,u=null,d=``,f=null,p=!1,m=()=>r(t),h=()=>typeof t.loadOptions!=`function`&&!t.getAttribute(`source`),g=(e,n,r)=>{let i=t.getAttribute(e);if(i==null||i.trim()===``)return n;let a=Number(i);return r(a)?a:n},_=()=>g(`min-chars`,1,e=>Number.isInteger(e)&&e>=0),v=()=>g(`debounce`,250,e=>Number.isFinite(e)&&e>=0),y=()=>{l?.abort(),l=null};function b(e,n){if(typeof t.loadOptions==`function`)return t.loadOptions(e,{signal:n});let r=t.getAttribute(`source`);if(r===null)throw Error(`search source attribute missing`);let i=`${r}${r.includes(`?`)?`&`:`?`}q=${encodeURIComponent(e)}`;return fetch(i,{signal:n,credentials:`same-origin`,headers:{Accept:`application/json`}}).then(e=>{if(!e.ok)throw Error(`search request failed with status ${e.status}`);return e.json()})}function x(n,r,i){r?(e(`wui-select: search failed`,i),t.setPartOptions([]),t.setStatus(`empty`)):(t.setPartOptions(n),t.setStatus(n.length?`idle`:`empty`))}async function S(e,t,n){let r=[],i=!1,a=null;try{if(r=await b(e,n),!Array.isArray(r))throw TypeError(`search results must be an array`)}catch(e){i=!0,a=e??/* @__PURE__ */ Error(`search failed`)}finally{t===s&&(l=null,x(r,i,a))}}function C(e){let n=s;y(),h()?(p=!0,t.setStatus(`loading`)):(l=new AbortController,t.setStatus(`loading`),S(e,n,l.signal))}let w=(e,n)=>t.dispatchEvent(new CustomEvent(`search`,{bubbles:!0,detail:{query:e,seq:n}}));function T(e){s+=1,y(),clearTimeout(c),c=void 0,e.trim().length<_()?(t.setPartOptions([]),t.setStatus(`hint`)):(w(e,s),C(e))}return{mount(e,n,r={}){t=e,o=n;let i=o.search?.value??``;o.search&&r.carry?.query&&i===``&&(o.search.value=r.carry.query),i.trim()!==``&&t._onQueryChange(i)},onQuery(e){if(s+=1,y(),clearTimeout(c),c=void 0,d=e,f=null,p=!1,!m())return!1;if(e.trim().length<_())return t.setPartOptions([]),t.setStatus(`hint`),!0;let n=s;return c=setTimeout(()=>{c=void 0,w(e,n),C(e)},v()),!0},onOpen(){if(m()){if(f!==null){let e=f;f=null,T(e)}else _()===0&&t._query.trim()===``&&T(``)}},onOptions(){p&&(p=!1,t.setStatus(t.options.length?`idle`:`empty`))},onBlur(){if(t.mode!==`search`)return!1;let e=(o.search?.value??``).trim();if(!e||e===String(t.value))return!1;if(t.hasAttribute(`allow-custom`)&&!i(t,e)){let r=n(t,e);return r?(t.setError(r),!1):(t.commit(e,{isCustom:!0}),!0)}let r=a(o.list);return r===null||r===String(t.value)?!1:(t.commit(r,{isCustom:!1}),t.closeMenu(),!0)},actionRow(e){if(u=null,t.mode===`tag`||!t.hasAttribute(`allow-custom`))return null;let n=e.trim();return!n||i(t,n)?null:(u={position:`bottom`,label:(t.getAttribute(`add-label`)??`Add '{query}'`).replaceAll(`{query}`,n),value:n},u)},onPick(e){if(!u||e.value!==u.value||e.label!==u.label)return!1;let n=u.value;return u=null,t.commit(n,{isCustom:!0}),!0},renderValue(){let e=t.value;if(!e||t.options.some(t=>String(t.value)===String(e)))return!1;let n=t.getAttribute(`value-label`);return n?(o.value.classList.remove(`wui-select-placeholder`),o.value.textContent=n,!0):!1},teardown(){(c!==void 0||l!==null||p)&&(f=d),p=!1,s+=1,clearTimeout(c),c=void 0,y(),u=null}}}export{o as default};
1
+ import{n as e}from"./devWarn-DXdRWZs3.js";import{i as t}from"./optionLabel-4xjXWy74.js";import{t as n}from"./customRule-Chp7YwFb.js";import{n as r}from"./WuiSelect-B199VL24.js";var i=(e,n)=>{let r=n.toLowerCase(),i=e.getAttribute(`value-label`);return i&&String(e.value??``)!==``&&i.toLowerCase()===r?!0:e.options.some(e=>t(e).toLowerCase()===r||String(e.value??``).toLowerCase()===r)},a=e=>{let t=[...e.querySelectorAll(`.wui-select-option`)].filter(e=>e.dataset.custom!==`true`&&e.getAttribute(`aria-disabled`)!==`true`);return t.length===1?t[0]?.dataset.value??null:null};function o(){let t,o,s=0,c,l=null,u=null,d=``,f=null,p=!1,m=()=>r(t),h=()=>typeof t.loadOptions!=`function`&&!t.getAttribute(`source`),g=(e,n,r)=>{let i=t.getAttribute(e);if(i==null||i.trim()===``)return n;let a=Number(i);return r(a)?a:n},_=()=>g(`min-chars`,1,e=>Number.isInteger(e)&&e>=0),v=()=>g(`debounce`,250,e=>Number.isFinite(e)&&e>=0),y=()=>{l?.abort(),l=null};function b(e,n){if(typeof t.loadOptions==`function`)return t.loadOptions(e,{signal:n});let r=t.getAttribute(`source`);if(r===null)throw Error(`search source attribute missing`);let i=`${r}${r.includes(`?`)?`&`:`?`}q=${encodeURIComponent(e)}`;return fetch(i,{signal:n,credentials:`same-origin`,headers:{Accept:`application/json`}}).then(e=>{if(!e.ok)throw Error(`search request failed with status ${e.status}`);return e.json()})}function x(n,r,i){r?(e(`wui-select: search failed`,i),t.setPartOptions([]),t.setStatus(`empty`)):(t.setPartOptions(n),t.setStatus(n.length?`idle`:`empty`))}async function S(e,t,n){let r=[],i=!1,a=null;try{if(r=await b(e,n),!Array.isArray(r))throw TypeError(`search results must be an array`)}catch(e){i=!0,a=e??/* @__PURE__ */ Error(`search failed`)}finally{t===s&&(l=null,x(r,i,a))}}function C(e){let n=s;y(),h()?(p=!0,t.setStatus(`loading`)):(l=new AbortController,t.setStatus(`loading`),S(e,n,l.signal))}let w=(e,n)=>t.dispatchEvent(new CustomEvent(`search`,{bubbles:!0,detail:{query:e,seq:n}}));function T(e){s+=1,y(),clearTimeout(c),c=void 0,e.trim().length<_()?(t.setPartOptions([]),t.setStatus(`hint`)):(w(e,s),C(e))}return{mount(e,n,r={}){t=e,o=n;let i=o.search?.value??``;o.search&&r.carry?.query&&i===``&&(o.search.value=r.carry.query),i.trim()!==``&&t._onQueryChange(i)},onQuery(e){if(s+=1,y(),clearTimeout(c),c=void 0,d=e,f=null,p=!1,!m())return!1;if(e.trim().length<_())return t.setPartOptions([]),t.setStatus(`hint`),!0;let n=s;return c=setTimeout(()=>{c=void 0,w(e,n),C(e)},v()),!0},onOpen(){if(m()){if(f!==null){let e=f;f=null,T(e)}else _()===0&&t._query.trim()===``&&T(``)}},onOptions(){p&&(p=!1,t.setStatus(t.options.length?`idle`:`empty`))},onBlur(){if(t.mode!==`search`)return!1;let e=(o.search?.value??``).trim();if(!e||e===String(t.value))return!1;if(t.hasAttribute(`allow-custom`)&&!i(t,e)){let r=n(t,e);return r?(t.setError(r),!1):(t.commit(e,{isCustom:!0}),!0)}let r=a(o.list);return r===null||r===String(t.value)?!1:(t.commit(r,{isCustom:!1}),t.closeMenu(),!0)},actionRow(e){if(u=null,t.mode!==`search`||!t.hasAttribute(`allow-custom`))return null;let n=e.trim();return!n||i(t,n)?null:(u={position:`bottom`,label:(t.getAttribute(`add-label`)??`Add '{query}'`).replaceAll(`{query}`,n),value:n},u)},onPick(e){if(!u||e.value!==u.value||e.label!==u.label)return!1;let n=u.value;return u=null,t.commit(n,{isCustom:!0}),!0},renderValue(){let e=t.value;if(t.mode!==`search`||!e||t.options.some(t=>String(t.value)===String(e)))return!1;let n=t.getAttribute(`value-label`);return n?(o.value.classList.remove(`wui-select-placeholder`),o.value.textContent=n,!0):!1},teardown(){(c!==void 0||l!==null||p)&&(f=d),p=!1,s+=1,clearTimeout(c),c=void 0,y(),u=null}}}export{o as default};
package/dist/server.js CHANGED
@@ -1 +1 @@
1
- import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,t as y,u as b,v as x,w as S,x as C,y as w}from"./drawerDiscard-Cra-QhD5.js";import{r as T}from"./dom-Do1pAA12.js";import{a as E,c as D,d as O,i as k,l as A,n as j,o as M,r as N,s as P,t as F,u as I}from"./wuiHttp-DGbD7Fra.js";var L=31536e3,R=/* @__PURE__ */ new WeakMap,z=e=>e>99?`99+`:String(e),B=(e,t)=>Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,()=>String(n)),e);function V(e,t,n=document){try{n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${L}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}function H(e,t,n,r=document){try{let i=`${e}=`,a=r.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(i)),o=new Set(a?a.slice(i.length).split(`.`).filter(Boolean):[]);n?o.add(t):o.delete(t),r.cookie=`${e}=${[...o].join(`.`)}; Path=/; Max-Age=${L}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}var U=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},W=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},G=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},K=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],q=e=>{if(!(e.target instanceof Element))throw Error(`event target is not an element`);return e.target},J=e=>{let t=e.getAttribute(`href`);if(t===null)throw Error(`search hit has no href`);return t},Y=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function X(e,t){let n=W(e,`.wui-bell-trigger`,HTMLElement),r=W(e,`.wui-bell-count`,HTMLElement),i=W(e,`[data-wui-bell-live]`,HTMLElement),a=W(e,`[data-wui-bell-list]`,HTMLElement),o=()=>T(a,`bell list missing`),s=W(e,`.wui-bell-menu`,HTMLElement),{src:c,readAction:l}=e.dataset,u=e.dataset.label||`Notifications`,d=e.dataset.emptyText||`You are all caught up.`,f=e.dataset.loadingText??`Loading…`,p=e.dataset.noUnreadText??`No unread notifications`,m=e.dataset.unreadText??`{count} unread notifications`,h=e.dataset.bellLabel??`{label}, {count} unread`,g=Number(e.dataset.pollSeconds??60),_=P(),v=Number(e.dataset.unread)||0,y=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==v;v=o,e.dataset.unread=String(o),r&&(r.textContent=z(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?u:B(h,{label:u,count:z(o)})),a&&s&&i&&(i.textContent=o===0?p:B(m,{count:z(o)}))},b=()=>s?.classList.contains(`show`)??!1,x=()=>{let e=Y(`wui-bell-state`,`Could not load notifications. `),t=document.createElement(`button`);t.type=`button`,t.className=`btn btn-link btn-sm`,t.dataset.wuiBellRetry=``,t.textContent=`Retry`,e.append(t),o().replaceChildren(e)},S=async t=>{if(t&&(o().setAttribute(`aria-busy`,`true`),o().querySelector(`.wui-bell-item`)||o().replaceChildren(Y(`wui-bell-state`,f))),c===void 0)throw Error(`bell has no data-src`);let n=await _.run(c);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(o().removeAttribute(`aria-busy`),!n.ok){t&&x();return}let r=U(n.html),i=W(r,`[data-wui-unread]`,HTMLElement),a=i?Number(i.getAttribute(`data-wui-unread`)):v;y(a),(t||b())&&(r.querySelector(`.wui-bell-item`)?o().replaceChildren(r):o().replaceChildren(Y(`wui-bell-state`,d))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:a}}))};e.addEventListener(`show.bs.dropdown`,()=>S(!0)),e.addEventListener(`click`,async e=>{let t=q(e);if(t.closest(`[data-wui-bell-retry]`)){await S(!0);return}let n=G(t,`[data-wui-bell-read]`,HTMLButtonElement);if(!n||!l)return;n.disabled=!0;let r=await A(l,{method:`POST`});n.disabled=!1,r.ok&&(y(0),await S(!0))});let C=null,w=()=>{g>0&&C===null&&(C=setInterval(()=>S(b()),g*1e3))},E=()=>{C!==null&&clearInterval(C),C=null},D=()=>{document.hidden?E():(S(b()),w())};return g>0&&(document.addEventListener(`visibilitychange`,D),document.hidden||w()),t.push(()=>{E(),_.abort(),document.removeEventListener(`visibilitychange`,D)}),{setUnread:e=>y(e),refresh:()=>S(b())}}var Z=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Q=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function ee(e,t){let n=T(W(e,`input.search-input`,HTMLInputElement),`search input missing`),r=W(e,`.wui-topsearch-results`,HTMLElement),i=()=>T(r,`search results missing`),a=W(e,`.wui-topsearch-open`,HTMLElement),o=W(e,`[data-wui-topsearch-live]`,HTMLElement),{src:s,param:c=`q`,resultsHref:l}=e.dataset,u=Number(e.dataset.minChars??2),d=Number(e.dataset.debounceMs??250),f=e.dataset.noResultsText??`No results`,p=e.dataset.resultsCountText??`{count} results`,m=e.dataset.resultCountText??`{count} result`,h=P(),g,_=-1,v=()=>K(i(),`.wui-topsearch-hit`,HTMLElement),y=e=>{let t=v();_=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===_;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)});let r=_>=0?t[_]:void 0;r?(n.setAttribute(`aria-activedescendant`,r.id),r.scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},b=()=>{i().hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),_=-1},x=()=>{i().hidden=!1,n.setAttribute(`aria-expanded`,`true`)},S=t=>{e.classList.toggle(`is-open`,t),a?.setAttribute(`aria-expanded`,t?`true`:`false`)},C=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},w=async t=>{if(e.classList.add(`is-loading`),s===void 0)throw Error(`search has no data-src`);let n=await h.run(Q(s,c,t));if(n.kind!==`aborted`&&n.kind!==`stale`&&n.kind!==`session`){if(e.classList.remove(`is-loading`),n.ok){let e=U(n.html),t=W(e,`[data-wui-count]`,HTMLElement);i().replaceChildren(e),v().forEach((e,t)=>{e.id=`${i().id}-opt-${t}`});let r=t?Number(t.getAttribute(`data-wui-count`)):v().length;o&&(o.textContent=r===0?f:B(r===1?m:p,{count:r}))}else i().replaceChildren(Y(`wui-topsearch-empty`,`Search is unavailable right now.`));_=-1,x()}};n.addEventListener(`input`,()=>{clearTimeout(g);let t=n.value.trim();t.length<u?(h.abort(),e.classList.remove(`is-loading`),i().replaceChildren(),b()):g=setTimeout(()=>w(t),d)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(i().hidden||v().length===0)return;t.preventDefault(),y(_+(t.key===`ArrowDown`?1:-1))}else if(t.key===`Enter`){let e=v(),r=_>=0?e[_]:void 0;!i().hidden&&r?(t.preventDefault(),C(J(r))):l&&n.value.trim()!==``&&(t.preventDefault(),C(Q(l,c,n.value.trim())))}else t.key===`Escape`&&(i().hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),S(!1),a?.focus()):(t.preventDefault(),t.stopPropagation(),b()))}),i().addEventListener(`click`,e=>{let t=G(q(e),`.wui-topsearch-hit`,HTMLElement);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),C(J(t)))}),a?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);S(t),t&&n.focus()});let E=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||Z(e.target)||(e.preventDefault(),S(!0),n.focus())},D=t=>{t.target instanceof Node&&e.contains(t.target)||(b(),e.classList.contains(`is-open`)&&S(!1))};document.addEventListener(`keydown`,E),document.addEventListener(`pointerdown`,D),t.push(()=>{clearTimeout(g),h.abort(),document.removeEventListener(`keydown`,E),document.removeEventListener(`pointerdown`,D)})}function te(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>{V(n,!!e.detail?.collapsed)});let r=e.dataset.wuiFoldedCookie;r&&e.addEventListener(`wui:shell:nav-fold`,e=>{H(r,e.detail?.key,!!e.detail?.folded)}),e.addEventListener(`click`,t=>{q(t).closest(`[data-wui-tabbar-more]`)&&W(e,`[data-app-shell-menu]`,HTMLElement)?.click()});let i=W(e,`[data-wui-bell]`,HTMLElement),a=i?X(i,t):null,o=W(e,`[data-wui-topsearch]`,HTMLElement);o&&ee(o,t);let s={el:e,setUnread(e){T(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).setUnread(e)},refreshNotifications(){return T(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=W(e,`[data-app-shell-collapse]`,HTMLElement);n?n.click():e.classList.toggle(`collapsed`,!!t)}};R.set(e,s);let c=n=>{if(n.target===e||n.target instanceof Node&&n.target.contains(e)){for(let e of t)e();R.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,c)}};return document.addEventListener(`wui:teardown`,c),s}function $(e=document){let t=[];e instanceof HTMLElement&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...K(e,`[data-app-shell]`,HTMLElement));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,te(e))}function ne(e){let t=G(e,`[data-app-shell]`,HTMLElement);return t?(R.has(t)||$(t),R.get(t)??null):null}export{f as CONFIRM_DIALOG_ID,b as CONFIRM_TONES,F as CSRF_META_NAME,j as DEFAULT_CSRF_HEADER,y as DISCARD_EVENT,m as DISCARD_TEXT,s as FLASH_STORAGE_KEY,c as FLASH_VARIANTS,N as HTTP_KINDS,g as SERVER_ACTION_TEXT,I as TOAST_ACTION_METHODS,C as TOAST_ACTION_MS,i as UNSAVED_TEXT,k as WUI_HEADERS,E as classifyStatus,l as closeRemotePane,M as configureCsrf,p as confirmAction,_ as createDiscardPrompt,P as createRequestQueue,h as formValues,S as getServerTable,ne as getShell,d as initDrawerDiscard,r as initRemoteModals,u as initServerActions,n as initServerTables,$ as initShellParts,v as initUnsavedChanges,x as loadRemoteDrawer,w as loadRemoteModal,a as loadRemotePane,O as parseToastAction,D as readCsrf,o as resetUnsavedChanges,t as runToastAction,e as showResultToast,A as wuiFetch};
1
+ import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,t as y,u as b,v as x,w as S,x as C,y as w}from"./drawerDiscard-C-STs39f.js";import{r as T}from"./dom-Do1pAA12.js";import{t as E}from"./imeSafeEnter-DPs9qL3S.js";import{a as D,c as O,d as k,i as A,l as j,n as M,o as N,r as P,s as F,t as I,u as L}from"./wuiHttp-DGbD7Fra.js";var R=31536e3,z=/* @__PURE__ */ new WeakMap,B=e=>e>99?`99+`:String(e),V=(e,t)=>Object.entries(t).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,()=>String(n)),e);function H(e,t,n=document){try{n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${R}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}function U(e,t,n,r=document){try{let i=`${e}=`,a=r.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(i)),o=new Set(a?a.slice(i.length).split(`.`).filter(Boolean):[]);n?o.add(t):o.delete(t),r.cookie=`${e}=${[...o].join(`.`)}; Path=/; Max-Age=${R}; SameSite=Lax`}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}var W=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},G=(e,t,n)=>{let r=e?.querySelector(t);return r instanceof n?r:null},K=(e,t,n)=>{let r=e?.closest(t);return r instanceof n?r:null},q=(e,t,n)=>e?[...e.querySelectorAll(t)].filter(e=>e instanceof n):[],J=e=>{if(!(e.target instanceof Element))throw Error(`event target is not an element`);return e.target},Y=e=>{let t=e.getAttribute(`href`);if(t===null)throw Error(`search hit has no href`);return t},X=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function Z(e,t){let n=G(e,`.wui-bell-trigger`,HTMLElement),r=G(e,`.wui-bell-count`,HTMLElement),i=G(e,`[data-wui-bell-live]`,HTMLElement),a=G(e,`[data-wui-bell-list]`,HTMLElement),o=()=>T(a,`bell list missing`),s=G(e,`.wui-bell-menu`,HTMLElement),{src:c,readAction:l}=e.dataset,u=e.dataset.label||`Notifications`,d=e.dataset.emptyText||`You are all caught up.`,f=e.dataset.loadingText??`Loading…`,p=e.dataset.noUnreadText??`No unread notifications`,m=e.dataset.unreadText??`{count} unread notifications`,h=e.dataset.bellLabel??`{label}, {count} unread`,g=Number(e.dataset.pollSeconds??60),_=F(),v=Number(e.dataset.unread)||0,y=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==v;v=o,e.dataset.unread=String(o),r&&(r.textContent=B(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?u:V(h,{label:u,count:B(o)})),a&&s&&i&&(i.textContent=o===0?p:V(m,{count:B(o)}))},b=()=>s?.classList.contains(`show`)??!1,x=()=>{let e=X(`wui-bell-state`,`Could not load notifications. `),t=document.createElement(`button`);t.type=`button`,t.className=`btn btn-link btn-sm`,t.dataset.wuiBellRetry=``,t.textContent=`Retry`,e.append(t),o().replaceChildren(e)},S=async t=>{if(t&&(o().setAttribute(`aria-busy`,`true`),o().querySelector(`.wui-bell-item`)||o().replaceChildren(X(`wui-bell-state`,f))),c===void 0)throw Error(`bell has no data-src`);let n=await _.run(c);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(o().removeAttribute(`aria-busy`),!n.ok){t&&x();return}let r=W(n.html),i=G(r,`[data-wui-unread]`,HTMLElement),a=i?Number(i.getAttribute(`data-wui-unread`)):v;y(a),(t||b())&&(r.querySelector(`.wui-bell-item`)?o().replaceChildren(r):o().replaceChildren(X(`wui-bell-state`,d))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:a}}))};e.addEventListener(`show.bs.dropdown`,()=>S(!0)),e.addEventListener(`click`,async e=>{let t=J(e);if(t.closest(`[data-wui-bell-retry]`)){await S(!0);return}let n=K(t,`[data-wui-bell-read]`,HTMLButtonElement);if(!n||!l)return;n.disabled=!0;let r=await j(l,{method:`POST`});n.disabled=!1,r.ok&&(y(0),await S(!0))});let C=null,w=()=>{g>0&&C===null&&(C=setInterval(()=>S(b()),g*1e3))},E=()=>{C!==null&&clearInterval(C),C=null},D=()=>{document.hidden?E():(S(b()),w())};return g>0&&(document.addEventListener(`visibilitychange`,D),document.hidden||w()),t.push(()=>{E(),_.abort(),document.removeEventListener(`visibilitychange`,D)}),{setUnread:e=>y(e),refresh:()=>S(b())}}var ee=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),Q=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function te(e,t){let n=T(G(e,`input.search-input`,HTMLInputElement),`search input missing`),r=G(e,`.wui-topsearch-results`,HTMLElement),i=()=>T(r,`search results missing`),a=G(e,`.wui-topsearch-open`,HTMLElement),o=G(e,`[data-wui-topsearch-live]`,HTMLElement),{src:s,param:c=`q`,resultsHref:l}=e.dataset,u=Number(e.dataset.minChars??2),d=Number(e.dataset.debounceMs??250),f=e.dataset.noResultsText??`No results`,p=e.dataset.resultsCountText??`{count} results`,m=e.dataset.resultCountText??`{count} result`,h=F(),g,_=-1,v=()=>q(i(),`.wui-topsearch-hit`,HTMLElement),y=e=>{let t=v();_=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===_;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)});let r=_>=0?t[_]:void 0;r?(n.setAttribute(`aria-activedescendant`,r.id),r.scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},b=()=>{i().hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),_=-1},x=()=>{i().hidden=!1,n.setAttribute(`aria-expanded`,`true`)},S=t=>{e.classList.toggle(`is-open`,t),a?.setAttribute(`aria-expanded`,t?`true`:`false`)},C=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},w=async t=>{if(e.classList.add(`is-loading`),s===void 0)throw Error(`search has no data-src`);let n=await h.run(Q(s,c,t));if(n.kind!==`aborted`&&n.kind!==`stale`&&n.kind!==`session`){if(e.classList.remove(`is-loading`),n.ok){let e=W(n.html),t=G(e,`[data-wui-count]`,HTMLElement);i().replaceChildren(e),v().forEach((e,t)=>{e.id=`${i().id}-opt-${t}`});let r=t?Number(t.getAttribute(`data-wui-count`)):v().length;o&&(o.textContent=r===0?f:V(r===1?m:p,{count:r}))}else i().replaceChildren(X(`wui-topsearch-empty`,`Search is unavailable right now.`));_=-1,x()}};n.addEventListener(`input`,()=>{clearTimeout(g);let t=n.value.trim();t.length<u?(h.abort(),e.classList.remove(`is-loading`),i().replaceChildren(),b()):g=setTimeout(()=>w(t),d)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(i().hidden||v().length===0)return;t.preventDefault(),y(_+(t.key===`ArrowDown`?1:-1))}else if(E(t)){let e=v(),r=_>=0?e[_]:void 0;!i().hidden&&r?(t.preventDefault(),C(Y(r))):l&&n.value.trim()!==``&&(t.preventDefault(),C(Q(l,c,n.value.trim())))}else t.key===`Escape`&&(i().hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),S(!1),a?.focus()):(t.preventDefault(),t.stopPropagation(),b()))}),i().addEventListener(`click`,e=>{let t=K(J(e),`.wui-topsearch-hit`,HTMLElement);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),C(Y(t)))}),a?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);S(t),t&&n.focus()});let D=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||ee(e.target)||(e.preventDefault(),S(!0),n.focus())},O=t=>{t.target instanceof Node&&e.contains(t.target)||(b(),e.classList.contains(`is-open`)&&S(!1))};document.addEventListener(`keydown`,D),document.addEventListener(`pointerdown`,O),t.push(()=>{clearTimeout(g),h.abort(),document.removeEventListener(`keydown`,D),document.removeEventListener(`pointerdown`,O)})}function ne(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>{H(n,!!e.detail?.collapsed)});let r=e.dataset.wuiFoldedCookie;r&&e.addEventListener(`wui:shell:nav-fold`,e=>{U(r,e.detail?.key,!!e.detail?.folded)}),e.addEventListener(`click`,t=>{J(t).closest(`[data-wui-tabbar-more]`)&&G(e,`[data-app-shell-menu]`,HTMLElement)?.click()});let i=G(e,`[data-wui-bell]`,HTMLElement),a=i?Z(i,t):null,o=G(e,`[data-wui-topsearch]`,HTMLElement);o&&te(o,t);let s={el:e,setUnread(e){T(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).setUnread(e)},refreshNotifications(){return T(a,`WUI.shell: this <app-shell> has no <app-shell-notifications>.`).refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=G(e,`[data-app-shell-collapse]`,HTMLElement);n?n.click():e.classList.toggle(`collapsed`,!!t)}};z.set(e,s);let c=n=>{if(n.target===e||n.target instanceof Node&&n.target.contains(e)){for(let e of t)e();z.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,c)}};return document.addEventListener(`wui:teardown`,c),s}function $(e=document){let t=[];e instanceof HTMLElement&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...q(e,`[data-app-shell]`,HTMLElement));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,ne(e))}function re(e){let t=K(e,`[data-app-shell]`,HTMLElement);return t?(z.has(t)||$(t),z.get(t)??null):null}export{f as CONFIRM_DIALOG_ID,b as CONFIRM_TONES,I as CSRF_META_NAME,M as DEFAULT_CSRF_HEADER,y as DISCARD_EVENT,m as DISCARD_TEXT,s as FLASH_STORAGE_KEY,c as FLASH_VARIANTS,P as HTTP_KINDS,g as SERVER_ACTION_TEXT,L as TOAST_ACTION_METHODS,C as TOAST_ACTION_MS,i as UNSAVED_TEXT,A as WUI_HEADERS,D as classifyStatus,l as closeRemotePane,N as configureCsrf,p as confirmAction,_ as createDiscardPrompt,F as createRequestQueue,h as formValues,S as getServerTable,re as getShell,d as initDrawerDiscard,r as initRemoteModals,u as initServerActions,n as initServerTables,$ as initShellParts,v as initUnsavedChanges,x as loadRemoteDrawer,w as loadRemoteModal,a as loadRemotePane,k as parseToastAction,O as readCsrf,o as resetUnsavedChanges,t as runToastAction,e as showResultToast,j as wuiFetch};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./dom-Do1pAA12.js";import{t as n}from"./devWarn-DXdRWZs3.js";import{t as r}from"./imeSafeEnter-DPs9qL3S.js";var i=`wui:row-drop`,a=`is-drop-over`,o=`application/x-wui-rows`,s=`wui-row-dragging`,c=`[data-wui-drop-target]`,l=`tbody tr[data-row-key]`,u=`input, button, a, select, textarea, label`,d=`.wui-select-cell .wui-check`,f=/* @__PURE__ */ new WeakMap,p=/* @__PURE__ */ new WeakSet,m=null,h=null;function g(e){let t=e.querySelector(d);return t instanceof HTMLInputElement&&t.checked}function _(e){let t=[];for(let n of e.querySelectorAll(`tbody tr`))n instanceof HTMLElement&&g(n)&&t.push(n.dataset.rowKey);return t}function v(e,n){return t(e,n)}function y(e,t){let n=v(e,t);return n instanceof HTMLElement?n:null}function ee(e){let t=e.textContent;if(t===null)throw Error(`A drop target has no text content.`);return t.trim()}var b=e=>typeof e==`object`&&!!e&&`selected`in e&&typeof e.selected==`number`;function x(){m=null,document.body.classList.remove(s);for(let e of document.querySelectorAll(`${c}.${a}`))e.classList.remove(a)}function S(e,t,n){e.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:{keys:t,target:n.dataset.wuiDropTarget}}))}function C(t){let n=y(t.target,c);if(!n||!m)return;t.preventDefault();let r=e(t.dataTransfer,`A drag event arrived without its DataTransfer.`);r.dropEffect=`move`,n.classList.add(a)}function te(e){let t=y(e.target,c);!t||e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||t.classList.remove(a)}function w(e){let t=y(e.target,c);if(!t||!m)return;e.preventDefault(),t.classList.remove(a);let{root:n,keys:r}=m;S(n,r,t),x()}function T(e){let t=y(e.target,c);t&&h?.keys.length&&(e.preventDefault(),S(h.root,h.keys,t))}function E(e){(r(e)||e.key===` `)&&T(e)}function D(e){p.has(e)||(p.add(e),e.addEventListener(`dragover`,C),e.addEventListener(`dragenter`,C),e.addEventListener(`dragleave`,te),e.addEventListener(`drop`,w),e.addEventListener(`click`,T),e.addEventListener(`keydown`,E))}function ne(t){let n=f.get(t);if(n)return n;D(t.ownerDocument||t);let r=e=>{let n=y(e.target,l);if(!n||!t.contains(n))return;let r=v(e.target,u);r&&n.contains(r)||(n.draggable=!0)},i=n=>{let r=y(n.target,l);if(!r||!t.contains(r))return;let i=g(r)?_(t):[r.dataset.rowKey],a=e(n.dataTransfer,`A drag event arrived without its DataTransfer.`);a.setData(o,JSON.stringify(i)),a.setData(`text/plain`,i.join(`,`)),a.effectAllowed=`move`,m={root:t,keys:i},document.body.classList.add(s)},a=e=>{let n=e instanceof CustomEvent?e.detail:void 0;if(b(n)){let{keys:e}=n;n.selected>0?h={root:t,keys:Array.isArray(e)?e:_(t)}:n.selected===0&&(h=null)}O(document)};t.addEventListener(`pointerdown`,r),t.addEventListener(`dragstart`,i),t.addEventListener(`dragend`,x),t.addEventListener(`selectionchange`,a);let c=()=>{t.removeEventListener(`pointerdown`,r),t.removeEventListener(`dragstart`,i),t.removeEventListener(`dragend`,x),t.removeEventListener(`selectionchange`,a),f.delete(t)};return f.set(t,c),c}function O(e=document){let t=e.querySelector(`[data-wui-row-drag] tbody tr ${d}:checked`)!==null;for(let n of e.querySelectorAll(c)){n.tagName!==`BUTTON`&&(n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`)),t?n.removeAttribute(`aria-disabled`):n.setAttribute(`aria-disabled`,`true`);let e=n.getAttribute(`data-wui-drop-label`)||ee(n);n.setAttribute(`aria-label`,`Move to ${e}`)}for(let t of e.querySelectorAll(`.wui-drop-tray`))t.hasAttribute(`role`)||(t.setAttribute(`role`,`toolbar`),t.setAttribute(`aria-label`,`Move to`))}var k=[`light`,`dark`,`auto`],A=[`wave`,`circle`,`slide`,`blinds`,`fade`,`none`],j=`wave`,M=`theme`,N={wave:1100,circle:700,slide:600,blinds:900,fade:350,none:0},P=`wui-theme-switching`,F=`wui:theme:change`,I=`(prefers-color-scheme: dark)`,L=e=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(e).matches,re=e=>k.some(t=>t===e);function R(e){return e===`dark`||e===`auto`&&L(I)?`dark`:`light`}function z(e=M){let t=null;try{t=window.localStorage.getItem(e)}catch(e){if(!(e instanceof DOMException))throw e}return re(t)?t:`auto`}function B(e,t=M){try{window.localStorage.setItem(t,e)}catch(e){if(!(e instanceof DOMException))throw e}}function V(e){let t=document.documentElement,n=R(e);t.setAttribute(`data-theme`,e),t.setAttribute(`data-bs-theme`,n),document.dispatchEvent(new CustomEvent(F,{detail:{mode:n,preference:e}}))}var H=`(function(k){var m;try{m=localStorage.getItem(k)}catch{m=null}if(m!=='light'&&m!=='dark')m='auto';var r=document.documentElement,q=window.matchMedia?window.matchMedia('(prefers-color-scheme: dark)'):null;function s(){var t=r.getAttribute('data-theme');r.setAttribute('data-bs-theme',t==='auto'?(q&&q.matches?'dark':'light'):t)}r.setAttribute('data-theme',m);s();if(q&&q.addEventListener)q.addEventListener('change',function(){if(r.getAttribute('data-theme')==='auto')s()})})(`;function U(e=M){return`${H}${JSON.stringify(String(e)).replace(/</g,`\\u003c`)})`}function W(e,{includeAuto:t=!1}={}){return e===`light`?`dark`:e===`dark`&&t?`auto`:`light`}function G(e){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(I),n=()=>e(t.matches?`dark`:`light`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var K=60,q=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,J=e=>e.toFixed(1),Y=(e,t)=>`${J(e)}px ${J(t)}px`,X={amplitude:22,segments:36,cycles:1.5,ripples:2},Z=6,ie=(e,t,n,r,i)=>{let{amplitude:a,segments:o,cycles:s}=X,c=n*(t+2*a),l=i?t+a-c:c-a,u=i?t+2*a:-2*a,d=[Y(0,u)];for(let t=0;t<=o;t++){let n=e*t/o,i=l+a*Math.sin(2*Math.PI*s*t/o+r);d.push(Y(n,i))}return d.push(Y(e,u)),`polygon(${d.join(`, `)})`},ae=(e,t,n,r)=>{let i=t/Z,a=[];for(let t=0;t<Z;t++){let o=t*i,s=i*n,c=r?o+i-s:o,l=r?o+i:o+s;a.push(Y(0,c),Y(e,c),Y(e,l),Y(0,l))}return`polygon(${a.join(`, `)})`};function Q(e,{width:t,height:n,to:r=`dark`,origin:i}){let a=r===`dark`,o=[];for(let r=0;r<=K;r++){let s=r/K,c=q(s);switch(e){case`circle`:{let e=i?.x??t/2,r=i?.y??n/2,a=Math.hypot(Math.max(e,t-e),Math.max(r,n-r));o.push({clipPath:`circle(${J(a*c)}px at ${J(e)}px ${J(r)}px)`});break}case`slide`:{let e=n*(1-c);o.push({clipPath:a?`inset(${J(e)}px 0px 0px 0px)`:`inset(0px 0px ${J(e)}px 0px)`});break}case`blinds`:o.push({clipPath:ae(t,n,c,a)});break;case`fade`:o.push({clipPath:`none`,opacity:c});break;case`none`:return[];default:o.push({clipPath:ie(t,n,c,s*X.ripples*2*Math.PI,a)})}}return o}var $=e=>{e instanceof DOMException&&(e.name===`AbortError`||e.name===`InvalidStateError`)||n(`[@webority/ui-elements] The theme view transition failed:`,e)};function oe(e,{effect:t=j,to:n,origin:r,duration:i}={}){let a=document.documentElement,o=n!==void 0&&a.getAttribute(`data-bs-theme`)===n;if(t===`none`||o||L(`(prefers-reduced-motion: reduce)`)||typeof document.startViewTransition!=`function`||typeof a.animate!=`function`)return e(),Promise.resolve(!1);a.classList.add(P);let s=document.startViewTransition(e),c=i??N[t]??N.wave;return s.ready.then(()=>{let e=Q(t,{width:window.innerWidth,height:window.innerHeight,to:n,origin:r});a.animate(e,{duration:c,easing:`linear`,fill:`both`,pseudoElement:`::view-transition-new(root)`})}).catch($),s.finished.catch($).finally(()=>a.classList.remove(P)).then(()=>!0)}export{i as _,N as a,V as c,R as d,B as f,G as g,oe as h,A as i,W as l,Q as m,M as n,k as o,U as p,F as r,P as s,j as t,z as u,ne as v,O as y};