@webority/ui-elements 0.53.0 → 0.54.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.
- package/dist/WuiCarousel-C33Z8FBt.js +1 -0
- package/dist/WuiCodeBlock-BcLJhLBJ.js +1 -0
- package/dist/WuiCommandPalette-B5OB6lsf.js +2 -0
- package/dist/WuiCommentThread-Bww7P_cu.js +1 -0
- package/dist/WuiConsentBanner-DWdHLSx9.js +1 -0
- package/dist/WuiDataTable-tR8Lp4XZ.js +1 -0
- package/dist/WuiDateRange-B5sO9usZ.js +25 -0
- package/dist/WuiDrawer-BuvDLR6M.js +1 -0
- package/dist/WuiHoverCard-CNEawHmO.js +1 -0
- package/dist/WuiInlineEdit-CI-3C7yP.js +1 -0
- package/dist/WuiLightbox-hluak_-q.js +1 -0
- package/dist/WuiMentionInput-DW7N1Zne.js +1 -0
- package/dist/WuiMenubar-D2tb_3eU.js +1 -0
- package/dist/WuiNavigationMenu-BsLnvz2Y.js +1 -0
- package/dist/WuiNotificationCenter-DKdvaSbm.js +1 -0
- package/dist/WuiOnboardingChecklist-s2DG6PZ0.js +1 -0
- package/dist/WuiOverflow-CB3j6q6n.js +1 -0
- package/dist/WuiRating-BzeW6iDC.js +1 -0
- package/dist/WuiRecordPager-yXv4g2ZR.js +1 -0
- package/dist/WuiRelativeTime-Cfc8TMd8.js +1 -0
- package/dist/WuiResizable-m2Ypa-zD.js +1 -0
- package/dist/WuiRollingNumber-DBgi_3l7.js +1 -0
- package/dist/WuiShortcuts-CMibF1XM.js +1 -0
- package/dist/WuiShowMore-Bu7IQcXS.js +1 -0
- package/dist/{WuiTour-D0zFmfkz.js → WuiTour-CUWrh5MD.js} +5 -5
- package/dist/WuiTruncate-BLl2u3b-.js +1 -0
- package/dist/WuiWhatsNew-BO78119Z.js +1 -0
- package/dist/copyText-DM5HhXjf.js +1 -0
- package/dist/elements/carousel.js +1 -0
- package/dist/elements/code-block.js +1 -0
- package/dist/elements/command-palette.js +1 -1
- package/dist/elements/comment-thread.js +1 -0
- package/dist/elements/consent-banner.js +1 -1
- package/dist/elements/data-table.js +1 -0
- package/dist/elements/date-range.js +1 -1
- package/dist/elements/drawer.js +1 -0
- package/dist/elements/hover-card.js +1 -0
- package/dist/elements/inline-edit.js +1 -0
- package/dist/elements/lightbox.js +1 -0
- package/dist/elements/mention-input.js +1 -0
- package/dist/elements/menubar.js +1 -0
- package/dist/elements/navigation-menu.js +1 -0
- package/dist/elements/notification-center.js +1 -0
- package/dist/elements/onboarding-checklist.js +1 -0
- package/dist/elements/overflow.js +1 -0
- package/dist/elements/rating.js +1 -0
- package/dist/elements/record-pager.js +1 -0
- package/dist/elements/relative-time.js +1 -0
- package/dist/elements/resizable.js +1 -0
- package/dist/elements/rolling-number.js +1 -0
- package/dist/elements/shortcuts.js +1 -0
- package/dist/elements/show-more.js +1 -0
- package/dist/elements/tour.js +1 -1
- package/dist/elements/truncate.js +1 -0
- package/dist/elements/whats-new.js +1 -0
- package/dist/helpers.js +1 -1
- package/dist/notificationDays-pYmoU0g6.js +1 -0
- package/dist/shortcutKeys-BQiDpsTJ.js +1 -0
- package/dist/themeTransition-C61cbmZ4.js +1 -0
- package/dist/ui-consent-banner.global.js +1 -1
- package/dist/ui-elements.global.js +123 -123
- package/dist/ui-elements.js +1 -1
- package/dist/ui-tour.global.js +1 -1
- package/package.json +24 -1
- package/dist/WuiCommandPalette-CfbMtT6z.js +0 -2
- package/dist/WuiConsentBanner-BgLJlAnE.js +0 -1
- package/dist/WuiDateRange-BFpOjqWn.js +0 -25
- package/dist/themeTransition-lkmQm8FR.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiRecordPager-yXv4g2ZR.js";e(`wui-record-pager`,t);export{t as WuiRecordPager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"../WuiRelativeTime-Cfc8TMd8.js";e(`wui-relative-time`,r);export{r as WuiRelativeTime,t as formatRelativeTime,n as relativeTimeTitle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiResizable-m2Ypa-zD.js";e(`wui-resizable`,t);export{t as WuiResizable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiRollingNumber-DBgi_3l7.js";e(`wui-rolling-number`,t);export{t as WuiRollingNumber};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiShortcuts-CMibF1XM.js";e(`wui-shortcuts`,t);export{t as WuiShortcuts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiShowMore-Bu7IQcXS.js";e(`wui-show-more`,t);export{t as WuiShowMore};
|
package/dist/elements/tour.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,t as n}from"../WuiTour-
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,t as n}from"../WuiTour-CUWrh5MD.js";e(`wui-tour`,n);export{n as WuiTour,t as createLocalSeenStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiTruncate-BLl2u3b-.js";e(`wui-truncate`,t);export{t as WuiTruncate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,t as n}from"../WuiWhatsNew-BO78119Z.js";e(`wui-whats-new`,t);export{n as WHATS_NEW_READ_EVENT,t as WuiWhatsNew};
|
package/dist/helpers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./formatters-BAE__8ye.js";import{t as h}from"./iconGlyphs.g-CUm_mfze.js";import{i as g}from"./optionLabel-DOZb8ERB.js";import{t as
|
|
1
|
+
import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./formatters-BAE__8ye.js";import{t as h}from"./iconGlyphs.g-CUm_mfze.js";import{i as g}from"./optionLabel-DOZb8ERB.js";import{n as _,t as v}from"./copyText-DM5HhXjf.js";import{t as y}from"./textMatch-wdY7XLIc.js";import{a as b,c as x,i as S,n as C,o as w,r as T,s as E,t as D}from"./notificationDays-pYmoU0g6.js";import{a as O,c as k,d as A,f as j,i as M,l as N,m as P,n as F,o as I,p as L,r as R,s as z,t as B,u as V}from"./shortcutKeys-BQiDpsTJ.js";import{$ as H,A as U,B as W,C as G,D as K,E as q,F as J,G as Y,H as X,I as Z,J as Q,K as $,L as ee,M as te,N as ne,O as re,P as ie,Q as ae,R as oe,S as se,T as ce,U as le,V as ue,W as de,X as fe,Y as pe,Z as me,_ as he,a as ge,b as _e,c as ve,d as ye,f as be,g as xe,h as Se,i as Ce,j as we,k as Te,l as Ee,m as De,n as Oe,o as ke,p as Ae,q as je,s as Me,t as Ne,u as Pe,v as Fe,w as Ie,x as Le,y as Re,z as ze}from"./themeTransition-C61cbmZ4.js";export{Y as AVATAR_ACCEPT,$ as AVATAR_MAX_SIZE_MB,je as AVATAR_OUTPUT_SIZE,Q as AVATAR_OUTPUT_TYPE,pe as AVATAR_PREVIEW_SIZES,fe as AVATAR_TEXT,v as COPY_FEEDBACK_MS,p as CURRENCIES,c as DATE_PATTERNS,ee as DEFAULT_IMAGE_ACCEPT,oe as DEFAULT_MAX_SIZE_MB,se as DEFAULT_PASSWORD_RULES,G as DEFAULT_REQUIREMENTS_TITLE,Ne as DEFAULT_THEME_EFFECT,Oe as DEFAULT_THEME_STORAGE_KEY,d as DURATION_UNITS,a as EMPTY_VALUE,e as FORMAT_STYLES,l as IST_TIME_ZONE,B as LIST_KEYS,K as MASK_INPUT_TYPES,re as MASK_NAMES,f as MONEY_UNITS,D as NOTIFICATION_COUNT_CAP,C as NOTIFICATION_TEXT,Re as SCROLL_EDGE_SELECTOR,F as SELECT_KEY,R as SHORTCUTS_OFF_ATTRIBUTE,M as SHORTCUT_EVENT,O as SHORTCUT_SCOPE_ATTRIBUTE,I as SHORTCUT_TEXT,Ce as THEME_CHANGE_EVENT,ge as THEME_EFFECTS,ke as THEME_EFFECT_DURATION,Me as THEME_LIVE_NAME,ve as THEME_MODES,Ee as THEME_SWITCHING_CLASS,ze as acceptLabel,Pe as applyTheme,z as ariaKeyShortcuts,Te as attachInputMask,_e as attachScrollEdges,me as avatarCropOptions,ae as avatarUnreadableMessage,Ie as buildPasswordRules,_ as copyTextToClipboard,ce as evaluatePassword,t as formatCompact,o as formatCurrency,m as formatDate,n as formatDuration,U as formatMasked,r as formatNumber,u as formatPercent,s as formatValue,h as glyphSvg,T as groupNotificationsByDay,k as inShortcutScope,we as initInputMasks,Le as initScrollEdges,H as isHeicFile,W as isImageFile,ue as isImageOnlyAccept,te as isMaskPattern,X as isPdfFile,N as isTypingTarget,ne as maskedPostValue,y as matchSegments,le as matchesAccept,V as moveFocus,ye as nextTheme,S as notificationCountText,b as notificationDayHeading,w as notificationTime,E as notificationTriggerLabel,x as notificationUnreadAnnouncement,q as passwordSatisfies,ie as postedMasked,J as rawMasked,be as readStoredTheme,Z as resolveMask,Ae as resolveTheme,A as runShortcut,j as shortcutKey,L as shortcutName,P as shortcutsOff,De as storeTheme,Se as themeBootScript,xe as themeKeyframes,i as toInstant,he as transitionTheme,de as validateFile,Fe as watchSystemTheme,g as withTrustedLabel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,u as t}from"./formatters-BAE__8ye.js";var n=99,r=1440*60*1e3,i=Object.freeze({label:`Notifications`,empty:`You are all caught up.`,markAll:`Mark all read`,viewAll:`View all`,unreadPrefix:`Unread: `,today:`Today`,yesterday:`Yesterday`,allRead:`All notifications marked as read.`,noneUnread:`No unread notifications`,failed:Object.freeze({forbidden:`You do not have permission to mark these as read.`,client:`These could not be marked as read. Refresh the page and try again.`,validation:`These could not be marked as read. Refresh the page and try again.`,server:`Something went wrong on our side, so these were not marked as read. Try again in a moment.`,network:`Could not reach the server, so these were not marked as read. Check your connection and try again.`})});function a(e){return e>99?`99+`:String(e)}function o(e,t){return t===0?e:`${e}, ${a(t)} unread`}function s(e){return e===0?i.noneUnread:`${a(e)} unread notifications`}function c(e){return t(e,{pattern:`time`})}function l(n,a=Date.now()){let o=t(n);return o===t(a)?i.today:o===t(e(a)-r)?i.yesterday:o}function u(n,r=Date.now()){let i=new Map;for(let a of n){if(!Number.isFinite(e(a.at)))throw Error(`<AppNotificationCenter> item "${a.id}": at must be an ISO date-time with its zone (or a YYYY-MM-DD day), got ${String(a.at)}.`);let n=t(a.at);i.has(n)||i.set(n,{key:n,heading:l(a.at,r),items:[]}),i.get(n).items.push(a)}return[...i.values()]}export{l as a,s as c,a as i,i as n,c as o,u as r,o as s,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`data-wui-shortcuts`,t=`data-shortcut-scope`,n=`wui:shortcut`,r={title:`Keyboard shortcuts`,close:`Close`,help:`Show these shortcuts`},i=[{key:`J`,label:`Next item`},{key:`K`,label:`Previous item`},{key:`Enter`,label:`Open the item`}],a={key:`X`,label:`Select the item`},o={"/":`slash`,"?":`help`,Escape:`esc`,Esc:`esc`,Enter:`enter`},s={esc:`Esc`,escape:`Esc`,enter:`Enter`,slash:`/`,help:`?`},c={esc:`Escape`,ctrl:`Control`,cmd:`Meta`,option:`Alt`,opt:`Alt`},l=new Set([`checkbox`,`radio`,`button`,`submit`,`reset`,`range`,`color`,`file`,`image`]),u=new Set([`textbox`,`searchbox`,`combobox`]),d=`a[href], button, summary, input, select, textarea, [role="button"], [role="link"], [role="menuitem"], [role="option"], [role="tab"], [role="checkbox"], [role="switch"]`;function f(e){if(!e||e.ctrlKey||e.metaKey||e.altKey)return null;let t=e.key;return typeof t!=`string`||!t?null:o[t]?o[t]:t.length===1&&t.trim()?t.toLowerCase():null}function p(e){let t=String(e??``).trim();return t.length===1?t.toUpperCase():s[t.toLowerCase()]??t}function m(e){return String(e??``).trim().split(/\s+/).filter(Boolean).map(e=>c[e.toLowerCase()]??(e.length===1?e.toUpperCase():e)).join(`+`)}function h(e){return!e||e.nodeType!==1?!1:e.isContentEditable||e.closest?.(`[contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]`)||e.tagName===`TEXTAREA`||e.tagName===`SELECT`?!0:e.tagName===`INPUT`?!l.has(String(e.type||`text`).toLowerCase()):u.has(e.getAttribute?.(`role`))}function g(t=typeof document>`u`?null:document){return t?.documentElement?.getAttribute(e)===`off`}function _(e,t){if(!t||e&&t.contains(e))return!0;let n=t.ownerDocument;return(!e||e===n.body||e===n.documentElement)&&n.querySelector(`[data-shortcut-scope]`)===t}function v(e,t,n=null){if(!t||e.defaultPrevented||g(e.target?.ownerDocument??void 0))return!1;let r=f(e);if(!r)return!1;let i=e.target;if(!_(i,n)||h(i))return!1;let a=t[r]??(r.length===1?t[r.toUpperCase()]:void 0);return typeof a!=`function`||r===`enter`&&i?.closest?.(d)?!1:(e.preventDefault(),a(e),!0)}function y(e,t){if(!e.length)return null;let n=e[0].ownerDocument,r=n.activeElement,i=e.findIndex(e=>e===r||e.contains(r));if(i<0&&r&&r!==n.body){let t=r.closest?.(`li, tr`);t&&(i=e.findIndex(e=>t.contains(e)))}i<0&&(i=e.findIndex(e=>e.getAttribute(`aria-current`)===`true`));let a=i<0?t>0?0:e.length-1:Math.min(e.length-1,Math.max(0,i+t));return e[a].focus(),e[a].scrollIntoView?.({block:`nearest`}),e[a]}export{t as a,_ as c,v as d,p as f,n as i,h as l,g as m,a as n,r as o,f as p,e as r,m as s,i as t,y as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`image/jpeg,image/png,image/webp,image/heic,image/heif,.heic,.heif`,t=10,n=512,r=`image/webp`,i=[96,48],a={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 o(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 s(e){return o(e)?a.heicUnreadable:a.unreadable}function c(e,t){let n=Number(t);return{name:e?.name||`photo`,type:r,size:Number.isInteger(n)&&n>0?n:512}}var l=`image/png,image/jpeg,image/webp`,u=5,d={"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`]},f={"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`,".png":`PNG`,".jpg":`JPG`,".jpeg":`JPG`,".webp":`WEBP`,".gif":`GIF`,".svg":`SVG`,".heic":`HEIC`,".heif":`HEIC`,".pdf":`PDF`,".txt":`text file`},p=e=>String(e||``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),m=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.gif`,`.svg`,`.bmp`,`.avif`,`.heic`,`.heif`];function h(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 m.some(e=>r.endsWith(e))}function g(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().split(/[?#]/)[0].endsWith(`.pdf`)}function _(e){let t=p(e);return t.length?t.every(e=>e.startsWith(`.`)?m.includes(e):e===`image/*`||e.startsWith(`image/`)):!1}function v(e){let t=[];for(let n of p(e)){let e=f[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 y(e,t){let n=p(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&&(d[e]||[]).some(e=>i.endsWith(e)))}function b(e,t={}){if(!e)return null;let n=t.accept===void 0?l:t.accept,r=t.maxSizeMb===void 0?5:t.maxSizeMb;if(!y(e,n)){let e=v(n);return`Choose a ${e.endsWith(` file`)?e:`${e} file`}.`}return r>0&&e.size>r*1024*1024?`Keep the file under ${r} MB.`:null}var x=/[0-9]/,S={9:x,A:/[A-Za-z]/,"*":/[0-9A-Za-z]/},C=/[9A*]/,w=new Set([`text`,`tel`,`search`,`url`,`password`]),T=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},E=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},D=e=>e.length<=3?e:`${e.slice(0,-3).replace(/\B(?=(\d{2})+(?!\d))/g,`,`)},${e.slice(-3)}`,O=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());return t?`${t[3]}-${t[2]}-${t[1]}`:e};function k(e,{upper:t=!1,normalize:n,valid:r,post:i=e=>e,message:a=`Enter the full value`}={}){let o=[...e].map(e=>S[e]?{re:S[e]}:{lit:e}),s=o.filter(e=>e.re).length;return{inputMode:o.every(e=>!e.re||e.re===x)?`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++)o[i].lit===void 0?(t+=e[r++],n.push(!0)):(t+=o[i].lit,n.push(!1));return{text:t,isRaw:n}},isValid:e=>e.length===s&&(!r||r(e))}}function A(){return{inputMode:`decimal`,post:e=>e,message:`Enter a valid amount`,extract(e){let t=``,n=!1,r=0;for(let i of e)x.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=D(t)+(e.includes(`.`)?`.${n}`:``);return{text:r,isRaw:[...r].map(e=>e!==`,`)}},isValid:e=>/^\d+(\.\d{1,2})?$/.test(e)}}var j={"phone-in":()=>k(`99999 99999`,{normalize:T,valid:e=>/^[6-9]/.test(e),message:`Enter a 10-digit mobile number`}),pan:()=>k(`AAAAA9999A`,{upper:!0,valid:e=>/^[A-Z]{5}\d{4}[A-Z]$/.test(e),message:`Enter a valid PAN`}),gstin:()=>k(`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:()=>k(`9999 9999 9999`,{valid:e=>/^[2-9]/.test(e),message:`Enter a valid 12-digit Aadhaar number`}),ifsc:()=>k(`AAAA*******`,{upper:!0,valid:e=>/^[A-Z]{4}0[A-Z0-9]{6}$/.test(e),message:`Enter a valid IFSC`}),"pin-code":()=>k(`999999`,{valid:e=>/^[1-9]/.test(e),message:`Enter a valid 6-digit PIN code`}),date:()=>k(`99-99-9999`,{normalize:O,valid:E,post:(e,t)=>e.length===8&&E(e)?`${e.slice(4)}-${e.slice(2,4)}-${e.slice(0,2)}`:t,message:`Enter a valid date as DD-MM-YYYY`}),amount:A},M=Object.keys(j),N=e=>{let t=String(e).toLowerCase();return Object.hasOwn(j,t)?t:void 0},ee=e=>C.test(String(e))&&N(e)===void 0,P=new Map;function F(e){if(e==null||e===``)return null;let t=String(e);return P.has(t)||(ee(t)?P.set(t,k(t)):P.set(t,Object.hasOwn(j,t)?j[t]():null)),P.get(t)}var I=(e,t)=>e.normalize?e.normalize(t):t;function te(e,t){let n=F(e);return n?n.extract(I(n,String(t??``))):String(t??``)}function ne(e,t){let n=F(e);if(!n)return String(t??``);let r=n.extract(I(n,String(t??``)));return n.post(r,n.layout(r).text)}function re(e,t){let n=F(e);return n?n.layout(n.extract(I(n,String(t??``)))).text:String(t??``)}var ie=(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},L=new WeakMap,ae=e=>L.get(e)?.(),oe=new WeakMap;function se(e,t,n,r){let i=e.getAll(t),a=oe.get(e);a||oe.set(e,a=new Set);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);return}e.delete(t);for(let n of i)e.append(t,n)}}function ce(e){let t=null,n=null,r=!1,i=(t,n)=>n===null?e.removeAttribute(t):e.setAttribute(t,n),a,o,s=()=>{t?.remove(),t=null,n&&(n.hidden=!1),n=null,r&&e.classList.remove(`error`),r=!1,a!==void 0&&i(`aria-invalid`,a),o!==void 0&&i(`aria-describedby`,o),a=void 0,o=void 0};return i=>{if(!i){s();return}let c=e.closest(`.field`),l=c?.querySelector(`.field-error`);l&&l!==t&&l.textContent.trim()||(t||(r=!e.classList.contains(`error`),e.classList.add(`error`),a=e.getAttribute(`aria-invalid`),o=e.getAttribute(`aria-describedby`),c&&(t=document.createElement(`div`),t.className=`field-error`,e.id&&(t.id=`${e.id}-error`),n=c.querySelector(`.field-hint`),n&&(n.hidden=!0),c.insertBefore(t,[...c.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 le(e,{mask:t,postFormatted:n=!1,onChange:r,onInvalidChange:i}={}){let a=F(t);if(!a||!w.has(e.type))return()=>{};let o=Object.getPrototypeOf(e),s=Object.getOwnPropertyDescriptor(o,`value`).set,c=!e.hasAttribute(`inputmode`);c&&e.setAttribute(`inputmode`,a.inputMode);let l=i??ce(e),u=null,d=!1,f=!1,p=!1,m=``,h=``,g,_=()=>{let e=p?m:``;e!==h&&(h=e,l(h))},v=(t,n,i)=>{let o=a.extract(t.slice(0,n)).length,c=a.extract(t),{text:l,isRaw:d}=a.layout(c);if(e.value!==l&&(s.call(e,l),document.activeElement===e&&w.has(e.type))){let t=ie(d,o);e.setSelectionRange(t,t)}e.dataset.maskRaw=c,m=c&&!a.isValid(c)?a.message:``,e.setCustomValidity(m),_(),i&&c!==u&&r?.(c,l),u=c},y=Object.getOwnPropertyDescriptor(e,`value`),b=y??Object.getOwnPropertyDescriptor(o,`value`);Object.defineProperty(e,"value",{configurable:!0,enumerable:b.enumerable,get:()=>b.get.call(e),set:t=>{if(b.set.call(e,t),f)return;let n=I(a,e.value);v(n,n.length,!0)}});let x=()=>{d=!0,e.dispatchEvent(new Event(`input`,{bubbles:!0})),d=!1},S=t=>{if(d||f||t.isComposing)return;let n=t.inputType===`insertText`&&(t.data?.length??0)<=1||t.inputType?.startsWith(`delete`)?e.value:I(a,e.value);v(n,e.selectionStart??n.length,!0)},C=()=>{f=!0},T=()=>{f=!1;let t=I(a,e.value);v(t,e.selectionStart??t.length,!0),x()},E=t=>{let n=t.inputType===`deleteContentBackward`;if(!n&&t.inputType!==`deleteContentForward`||t.isComposing)return;let r=e.selectionStart;if(r==null||r!==e.selectionEnd)return;let{isRaw:i}=a.layout(a.extract(e.value)),o=n?r-1:r;for(;o>=0&&o<i.length&&!i[o];)o+=n?-1:1;o!==(n?r-1:r)&&(t.preventDefault(),!(o<0||o>=i.length)&&(v(e.value.slice(0,o)+e.value.slice(o+1),n?o:r,!0),x()))},D=t=>{if(e.readOnly||e.disabled)return;let n=t.clipboardData?.getData(`text`);if(n==null)return;t.preventDefault();let r=I(a,n),i=e.selectionStart??e.value.length,o=e.selectionEnd??i;v(e.value.slice(0,i)+r+e.value.slice(o),i+r.length,!0),x()},O=()=>{let t=a.extract(e.value);return a.post(t,a.layout(t).text)},k=()=>{p=!0,_()};e.addEventListener(`input`,S),e.addEventListener(`beforeinput`,E),e.addEventListener(`paste`,D),e.addEventListener(`compositionstart`,C),e.addEventListener(`compositionend`,T),e.addEventListener(`blur`,k),e.addEventListener(`invalid`,k);let A=e.form,j=t=>{e.name&&!e.disabled&&se(t.formData,e.name,e.value,O())},M=()=>{clearTimeout(g),g=setTimeout(()=>{p=!1,v(I(a,e.value),e.value.length,!0)},0)};n||(A?.addEventListener(`formdata`,j),L.set(e,O)),A?.addEventListener(`reset`,M),A?.addEventListener(`submit`,k);let N=I(a,e.value);return v(N,N.length,!1),()=>{clearTimeout(g),e.removeEventListener(`input`,S),e.removeEventListener(`beforeinput`,E),e.removeEventListener(`paste`,D),e.removeEventListener(`compositionstart`,C),e.removeEventListener(`compositionend`,T),e.removeEventListener(`blur`,k),e.removeEventListener(`invalid`,k),A?.removeEventListener(`formdata`,j),A?.removeEventListener(`reset`,M),A?.removeEventListener(`submit`,k),L.delete(e),y?Object.defineProperty(e,"value",y):delete e.value,p=!1,m=``,_(),e.setCustomValidity(``),delete e.dataset.maskRaw,c&&e.removeAttribute(`inputmode`)}}function ue(){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=ae(e);return n===void 0?t.call(this,e):n},e.wuiMaskHook=!0}var R=new WeakMap,z,de=e=>{R.has(e)||R.set(e,le(e,{mask:e.dataset.appMask,postFormatted:e.hasAttribute(`data-mask-post-formatted`)}))},B=e=>e.nodeType===1?[...e.matches(`input[data-app-mask]`)?[e]:[],...e.querySelectorAll(`input[data-app-mask]`)]:[];function fe(){z||typeof MutationObserver>`u`||(z=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of B(e))R.get(t)?.(),R.delete(t);for(let e of t.addedNodes)for(let t of B(e))de(t)}}),z.observe(document.documentElement,{childList:!0,subtree:!0}))}function pe(e=document){ue();for(let t of e.querySelectorAll(`input[data-app-mask]`))de(t);e===document&&fe()}var V={minLength:10,uppercase:!0,lowercase:!0,digit:!0,special:!0,uniqueChars:0,customRules:[]},me=`Password requirements`;function he(e){return e===!0||e==null?{...V}:{...V,...e}}function H(e){let t=he(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 U(e,t){let n=e==null?``:String(e);return H(t).map(e=>({key:e.key,label:e.label,met:e.test(n)}))}function ge(e,t){return U(e,t).every(e=>e.met)}var W=`.table-wrap, .table-responsive, [class*="table-responsive-"]`,G=1;function _e(e){let t=()=>{let t=e.scrollWidth-e.clientWidth,n=Math.abs(e.scrollLeft);e.toggleAttribute(`data-wui-overflow-start`,t>G&&n>G),e.toggleAttribute(`data-wui-overflow-end`,t>G&&n<t-G),e.toggleAttribute(`data-wui-overflow-top`,e.scrollTop>G)};e.addEventListener(`scroll`,t,{passive:!0});let n=null;if(typeof ResizeObserver<`u`){n=new ResizeObserver(t),n.observe(e);for(let t of e.children)n.observe(t)}return t(),()=>{e.removeEventListener(`scroll`,t),n?.disconnect(),e.removeAttribute(`data-wui-overflow-start`),e.removeAttribute(`data-wui-overflow-end`),e.removeAttribute(`data-wui-overflow-top`)}}var K=new WeakMap,q,ve=e=>{K.has(e)||K.set(e,_e(e))},ye=e=>e.nodeType===1?[...e.matches(`.table-wrap, .table-responsive, [class*="table-responsive-"]`)?[e]:[],...e.querySelectorAll(W)]:[];function be(){q||typeof MutationObserver>`u`||(q=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of ye(e))K.get(t)?.(),K.delete(t);for(let e of t.addedNodes)for(let t of ye(e))ve(t)}}),q.observe(document.documentElement,{childList:!0,subtree:!0}))}function xe(e=document){for(let t of e.querySelectorAll(W))ve(t);e===document&&be()}var Se=[`light`,`dark`,`auto`],Ce=[`wave`,`circle`,`slide`,`blinds`,`fade`,`none`],we=`wave`,J=`theme`,Y={wave:1100,circle:700,slide:600,blinds:900,fade:350,none:0},X=`wui-theme-switching`,Te=`wui:theme:change`,Ee=`wui-theme-toggle`,De=`(prefers-color-scheme: dark)`,Oe=e=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(e).matches,ke=e=>Se.includes(e);function Ae(e){return e===`dark`||e===`auto`&&Oe(De)?`dark`:`light`}function je(e=J){let t=null;try{t=window.localStorage.getItem(e)}catch{}return ke(t)?t:`auto`}function Me(e,t=J){try{window.localStorage.setItem(t,e)}catch{}}function Ne(e){let t=document.documentElement,n=Ae(e);t.setAttribute(`data-theme`,e),t.setAttribute(`data-bs-theme`,n),document.dispatchEvent(new CustomEvent(Te,{detail:{mode:n,preference:e}}))}var Pe=`(function(k){var m;try{m=localStorage.getItem(k)}catch{}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 Fe(e=J){return`${Pe}${JSON.stringify(String(e)).replace(/</g,`\\u003c`)})`}function Ie(e,{includeAuto:t=!1}={}){return e===`light`?`dark`:e===`dark`&&t?`auto`:`light`}function Le(e){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(De),n=()=>e(t.matches?`dark`:`light`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var Re=60,ze=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,Z=e=>e.toFixed(1),Q=(e,t)=>`${Z(e)}px ${Z(t)}px`,Be={amplitude:22,segments:36,cycles:1.5,ripples:2},Ve=6,He=(e,t,n,r,i)=>{let{amplitude:a,segments:o,cycles:s}=Be,c=n*(t+2*a),l=i?t+a-c:c-a,u=i?t+2*a:-2*a,d=[Q(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(Q(n,i))}return d.push(Q(e,u)),`polygon(${d.join(`, `)})`},Ue=(e,t,n,r)=>{let i=t/Ve,a=[];for(let t=0;t<Ve;t++){let o=t*i,s=i*n,c=r?o+i-s:o,l=r?o+i:o+s;a.push(Q(0,c),Q(e,c),Q(e,l),Q(0,l))}return`polygon(${a.join(`, `)})`};function $(e,{width:t,height:n,to:r=`dark`,origin:i}={}){let a=r===`dark`,o=[];for(let r=0;r<=Re;r++){let s=r/Re,c=ze(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(${Z(a*c)}px at ${Z(e)}px ${Z(r)}px)`});break}case`slide`:{let e=n*(1-c);o.push({clipPath:a?`inset(${Z(e)}px 0px 0px 0px)`:`inset(0px 0px ${Z(e)}px 0px)`});break}case`blinds`:o.push({clipPath:Ue(t,n,c,a)});break;case`fade`:o.push({clipPath:`none`,opacity:c});break;case`none`:return[];default:o.push({clipPath:He(t,n,c,s*Be.ripples*2*Math.PI,a)})}}return o}function We(e,{effect:t=we,to:n,origin:r,duration:i,live:a}={}){let o=document.documentElement,s=n!==void 0&&o.getAttribute(`data-bs-theme`)===n;if(t===`none`||s||Oe(`(prefers-reduced-motion: reduce)`)||typeof document.startViewTransition!=`function`||typeof o.animate!=`function`)return e(),Promise.resolve(!1);o.classList.add(X);let c=a instanceof Element?a:null;c&&(c.style.viewTransitionName=Ee);let l=document.startViewTransition(e),u=i??Y[t]??Y.wave;return l.ready.then(()=>{let e=$(t,{width:window.innerWidth,height:window.innerHeight,to:n,origin:r});o.animate(e,{duration:u,easing:`linear`,fill:`both`,pseudoElement:`::view-transition-new(root)`})}).catch(()=>{}),l.finished.catch(()=>{}).then(()=>(o.classList.remove(X),c&&(c.style.viewTransitionName=``),!0))}export{o as $,re as A,h as B,me as C,w as D,ge as E,te as F,e as G,g as H,F as I,r as J,t as K,l as L,ee as M,ae as N,M as O,ne as P,s as Q,u as R,V as S,U as T,y as U,_ as V,b as W,a as X,i as Y,c as Z,We as _,Ce as a,_e as b,Se as c,Ie as d,je as f,$ as g,Fe as h,Te as i,pe as j,le as k,X as l,Me as m,J as n,Y as o,Ae as p,n as q,Pe as r,Ee as s,we as t,Ne as u,Le as v,H as w,xe as x,W as y,v as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){var e={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-ink":`#4F46E5`,"--color-primary-text":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay-lg":`0 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-fixed":`1030`},t=t=>`var(${t}, ${e[t]})`,n=` :host { all: initial; position: fixed; bottom: 20px; left: 20px; right: auto; z-index: ${t(`--wui-z-fixed`)}; display: block; width: 420px; max-width: calc(100vw - 40px); font-family: inherit; font-size: 16px; line-height: 1.5; color: ${t(`--color-text`)}; } :host([position="bottom-right"]) { right: 20px; left: auto; } :host(:not([open])) { pointer-events: none; } :host([tour-open]) { visibility: hidden; } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .wui-consent-banner-panel { padding: 20px; background: ${t(`--color-surface`)}; border: 1px solid ${t(`--color-border`)}; border-radius: ${t(`--wui-radius-lg`)}; box-shadow: ${t(`--wui-shadow-overlay-lg`)}; text-align: start; pointer-events: auto; } .wui-consent-banner-heading { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: ${t(`--color-text`)}; } .wui-consent-banner-description { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: ${t(`--color-text-muted`)}; } .wui-consent-banner-policy { color: ${t(`--color-primary-ink`)}; font-weight: 500; } .wui-consent-banner-settings { display: grid; gap: 12px; max-height: 50vh; margin: 0 0 16px; padding: 12px 0; overflow-y: auto; border-top: 1px solid ${t(`--color-border`)}; border-bottom: 1px solid ${t(`--color-border`)}; } .wui-consent-banner-category-description { margin: 2px 0 0; padding-inline-start: 2.5em; font-size: 12px; line-height: 1.4; color: ${t(`--color-text-muted`)}; } .form-check { display: flex; align-items: center; gap: 0.5em; margin: 0; font-size: 14px; } .form-check-input { appearance: none; flex: none; width: 2em; height: 1em; margin: 0; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2em; background: ${t(`--color-surface`)} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat; cursor: pointer; transition: background-position 0.15s ease-in-out; } .form-check-input:checked { border-color: ${t(`--color-primary`)}; background: ${t(`--color-primary`)} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat; } .form-check-input:disabled { opacity: 0.5; cursor: default; } .form-check-input:focus-visible { outline: 2px solid ${t(`--color-primary`)}; outline-offset: 2px; } .form-check-label { cursor: pointer; } .wui-consent-banner-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } .btn { display: inline-block; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid ${t(`--color-primary`)}; outline-offset: 2px; } .btn-primary { background: ${t(`--color-primary`)}; border-color: ${t(`--color-primary`)}; color: ${t(`--color-primary-text`)}; } .btn-primary:hover { background: ${t(`--color-primary-hover`)}; border-color: ${t(`--color-primary-hover`)}; } .btn-outline-secondary { border-color: ${t(`--color-text-muted`)}; color: ${t(`--color-text-muted`)}; } .btn-outline-secondary:hover { background: ${t(`--color-text-muted`)}; color: #fff; } .btn-link { font-weight: 400; color: ${t(`--color-primary-ink`)}; text-decoration: underline; } .btn-link:hover { color: ${t(`--color-primary-hover`)}; } .wui-consent-banner-settings-toggle { margin-inline-end: auto; padding-inline: 0; } .wui-consent-banner-save { flex: 1 1 100%; } @media (max-width: 480px) { :host, :host([position="bottom-right"]) { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; } } `,r=typeof HTMLElement>`u`?class{}:HTMLElement,i=`data-wui-tour-open`,a=`wui-consent-save`,o=`[data-consent-settings]`,s=`tour-open`,c={heading:`Cookies on this site`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,policyLabel:`Cookie policy`,essentialLabel:`Essential cookies`,essentialDescription:`Required for the site to work and stay secure. Always on.`,analyticsLabel:`Analytics cookies`,analyticsDescription:`Help us understand how visitors use the site.`,functionalLabel:`Functional cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,marketingLabel:`Marketing cookies`,marketingDescription:`Measure how well our campaigns work.`,settingsLabel:`Cookie settings`,rejectLabel:`Reject all`,acceptLabel:`Accept all`,saveLabel:`Save preferences`},l=[`analytics`,`functional`,`marketing`],u=0,d=class extends r{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`]}constructor(){super(),u+=1,this._uid=`wui-consent-${u}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(o)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null}get position(){return this.getAttribute(`position`)===`bottom-right`?`bottom-right`:`bottom-left`}set position(e){this.setAttribute(`position`,String(e??`bottom-left`))}get standalone(){return this.hasAttribute(`standalone`)}set standalone(e){this.toggleAttribute(`standalone`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||c.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||c.description}set description(e){this.setAttribute(`description`,String(e??``))}get policyHref(){return this.getAttribute(`policy-href`)||``}set policyHref(e){this.setAttribute(`policy-href`,String(e??``))}get policyLabel(){return this.getAttribute(`policy-label`)||c.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||c.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||c.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||c.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get preferences(){return{...this._preferences}}set preferences(e){this._preferences={analytics:e?.analytics===!0,functional:e?.functional===!0,marketing:e?.marketing===!0},this._applyPreferences()}get isOpen(){return this.hasAttribute(`open`)}connectedCallback(){this._rendered||this.render(),document.addEventListener(`click`,this._onDocumentClick),this._syncTour(),this._tourWatch??=new MutationObserver(()=>this._syncTour()),this._tourWatch.observe(document.documentElement,{attributes:!0,attributeFilter:[i]})}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect()}_syncTour(){this.toggleAttribute(s,document.documentElement.hasAttribute(i))}attributeChangedCallback(){this._rendered&&this.render()}render(){let e=this.isOpen,t=this._uid,r=this.policyHref?` <a class="wui-consent-banner-policy" href="${m(this.policyHref)}">${p(this.policyLabel)}</a>`:``,i=this._root();i.innerHTML=`${i===this?``:`<style>${n}</style>`} <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden> <h2 class="wui-consent-banner-heading" id="${t}-heading">${p(this.heading)}</h2> <p class="wui-consent-banner-description" id="${t}-description">${p(this.description)}${r}</p> <div class="wui-consent-banner-settings" hidden> ${f(t,`essential`,c.essentialLabel,c.essentialDescription,!0)} ${f(t,`analytics`,c.analyticsLabel,this.analyticsDescription,!1)} ${f(t,`functional`,c.functionalLabel,this.functionalDescription,!1)} ${f(t,`marketing`,c.marketingLabel,this.marketingDescription,!1)} </div> <div class="wui-consent-banner-actions"> <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${c.settingsLabel}</button> <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${c.rejectLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${c.acceptLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${c.saveLabel}</button> </div> </div>`,this._rendered=!0,this._wire(),this._applyPreferences(),this._showSettings(this._settings),e&&(this._panel().hidden=!1)}open({settings:e=!1,focus:t=!1}={}){this._rendered||this.render(),this._applyPreferences(),this._showSettings(e),this._panel().hidden=!1,this.setAttribute(`open`,``),t&&(e?this._root().querySelector(`.wui-consent-banner-category input:not([disabled])`):this._root().querySelector(`.wui-consent-banner-accept`))?.focus()}close(){let e=this._panel();e&&(e.hidden=!0),this.removeAttribute(`open`),this._showSettings(!1)}_root(){return this.shadowRoot?this.shadowRoot:this.standalone?this.attachShadow({mode:`open`}):this}_panel(){return this._root().querySelector(`.wui-consent-banner-panel`)}_wire(){let e=this._root();e.querySelector(`.wui-consent-banner-accept`)?.addEventListener(`click`,()=>this._save({analytics:!0,functional:!0,marketing:!0})),e.querySelector(`.wui-consent-banner-reject`)?.addEventListener(`click`,()=>this._save({analytics:!1,functional:!1,marketing:!1})),e.querySelector(`.wui-consent-banner-save`)?.addEventListener(`click`,()=>this._save(this._switchValues())),e.querySelector(`.wui-consent-banner-settings-toggle`)?.addEventListener(`click`,()=>this._showSettings(!this._settings))}_save(e){this._preferences={...e},this.dispatchEvent(new CustomEvent(a,{bubbles:!0,composed:!0,detail:{...e}})),this.close()}_switchValues(){let e={};for(let t of l)e[t]=this._root().querySelector(`input[data-category="${t}"]`)?.checked===!0;return e}_applyPreferences(){for(let e of l){let t=this._root().querySelector(`input[data-category="${e}"]`);t&&(t.checked=this._preferences[e])}}_showSettings(e){this._settings=e;let t=this._root(),n=t.querySelector(`.wui-consent-banner-settings`);if(!n)return;n.hidden=!e,t.querySelector(`.wui-consent-banner-settings-toggle`)?.setAttribute(`aria-expanded`,e?`true`:`false`);let r=t.querySelector(`.wui-consent-banner-save`);r&&(r.hidden=!e);for(let n of[`.wui-consent-banner-reject`,`.wui-consent-banner-accept`]){let r=t.querySelector(n);r&&(r.hidden=e)}}};function f(e,t,n,r,i){let a=`${e}-${t}`;return`<div class="wui-consent-banner-category"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i?` checked disabled`:``} /> <label class="form-check-label" for="${a}">${p(n)}</label> </div> <p class="wui-consent-banner-category-description">${p(r)}</p> </div>`}var p=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),m=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`);typeof customElements<`u`&&!customElements.get(`wui-consent-banner`)&&customElements.define(`wui-consent-banner`,d)})();
|
|
1
|
+
(function(){var e={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-ink":`#4F46E5`,"--color-primary-text":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay-lg":`0 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-fixed":`1030`},t=t=>`var(${t}, ${e[t]})`,n=` :host { all: initial; position: fixed; bottom: 20px; left: 20px; right: auto; z-index: ${t(`--wui-z-fixed`)}; display: block; width: 420px; max-width: calc(100vw - 40px); font-family: inherit; font-size: 16px; line-height: 1.5; color: ${t(`--color-text`)}; } :host([position="bottom-right"]) { right: 20px; left: auto; } :host(:not([open])) { pointer-events: none; } :host([tour-open]) { visibility: hidden; } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .wui-consent-banner-panel { padding: 20px; background: ${t(`--color-surface`)}; border: 1px solid ${t(`--color-border`)}; border-radius: ${t(`--wui-radius-lg`)}; box-shadow: ${t(`--wui-shadow-overlay-lg`)}; text-align: start; pointer-events: auto; } .wui-consent-banner-heading { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: ${t(`--color-text`)}; } .wui-consent-banner-description { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: ${t(`--color-text-muted`)}; } .wui-consent-banner-policy { color: ${t(`--color-primary-ink`)}; font-weight: 500; } .wui-consent-banner-settings { display: grid; gap: 12px; max-height: 50vh; margin: 0 0 16px; padding: 12px 0; overflow-y: auto; border-top: 1px solid ${t(`--color-border`)}; border-bottom: 1px solid ${t(`--color-border`)}; } .wui-consent-banner-category-description { margin: 2px 0 0; padding-inline-start: 2.5em; font-size: 12px; line-height: 1.4; color: ${t(`--color-text-muted`)}; } .form-check { display: flex; align-items: center; gap: 0.5em; margin: 0; font-size: 14px; } .form-check-input { appearance: none; flex: none; width: 2em; height: 1em; margin: 0; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2em; background: ${t(`--color-surface`)} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat; cursor: pointer; transition: background-position 0.15s ease-in-out; } .form-check-input:checked { border-color: ${t(`--color-primary`)}; background: ${t(`--color-primary`)} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat; } .form-check-input:disabled { opacity: 0.5; cursor: default; } .form-check-input:focus-visible { outline: 2px solid ${t(`--color-primary`)}; outline-offset: 2px; } .form-check-label { cursor: pointer; } .wui-consent-banner-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } .btn { display: inline-block; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid ${t(`--color-primary`)}; outline-offset: 2px; } .btn-primary { background: ${t(`--color-primary`)}; border-color: ${t(`--color-primary`)}; color: ${t(`--color-primary-text`)}; } .btn-primary:hover { background: ${t(`--color-primary-hover`)}; border-color: ${t(`--color-primary-hover`)}; } .btn-outline-secondary { border-color: ${t(`--color-text-muted`)}; color: ${t(`--color-text-muted`)}; } .btn-outline-secondary:hover { background: ${t(`--color-bg-muted`)}; color: ${t(`--color-text`)}; } .btn-link { font-weight: 400; color: ${t(`--color-primary-ink`)}; text-decoration: underline; } .btn-link:hover { color: ${t(`--color-primary-hover`)}; } .wui-consent-banner-settings-toggle { margin-inline-end: auto; padding-inline: 0; } .wui-consent-banner-save { flex: 1 1 100%; } @media (max-width: 480px) { :host, :host([position="bottom-right"]) { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; } } `,r=typeof HTMLElement>`u`?class{}:HTMLElement,i=`data-wui-tour-open`,a=`wui-consent-save`,o=`[data-consent-settings]`,s=`tour-open`,c={heading:`Cookies on this site`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,policyLabel:`Cookie policy`,essentialLabel:`Essential cookies`,essentialDescription:`Required for the site to work and stay secure. Always on.`,analyticsLabel:`Analytics cookies`,analyticsDescription:`Help us understand how visitors use the site.`,functionalLabel:`Functional cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,marketingLabel:`Marketing cookies`,marketingDescription:`Measure how well our campaigns work.`,settingsLabel:`Cookie settings`,rejectLabel:`Reject all`,acceptLabel:`Accept all`,saveLabel:`Save preferences`},l=[`analytics`,`functional`,`marketing`],u=0,d=class extends r{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`]}constructor(){super(),u+=1,this._uid=`wui-consent-${u}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(o)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null}get position(){return this.getAttribute(`position`)===`bottom-right`?`bottom-right`:`bottom-left`}set position(e){this.setAttribute(`position`,String(e??`bottom-left`))}get standalone(){return this.hasAttribute(`standalone`)}set standalone(e){this.toggleAttribute(`standalone`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||c.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||c.description}set description(e){this.setAttribute(`description`,String(e??``))}get policyHref(){return this.getAttribute(`policy-href`)||``}set policyHref(e){this.setAttribute(`policy-href`,String(e??``))}get policyLabel(){return this.getAttribute(`policy-label`)||c.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||c.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||c.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||c.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get preferences(){return{...this._preferences}}set preferences(e){this._preferences={analytics:e?.analytics===!0,functional:e?.functional===!0,marketing:e?.marketing===!0},this._applyPreferences()}get isOpen(){return this.hasAttribute(`open`)}connectedCallback(){this._rendered||this.render(),document.addEventListener(`click`,this._onDocumentClick),this._syncTour(),this._tourWatch??=new MutationObserver(()=>this._syncTour()),this._tourWatch.observe(document.documentElement,{attributes:!0,attributeFilter:[i]})}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect()}_syncTour(){this.toggleAttribute(s,document.documentElement.hasAttribute(i))}attributeChangedCallback(){this._rendered&&this.render()}render(){let e=this.isOpen,t=this._uid,r=this.policyHref?` <a class="wui-consent-banner-policy" href="${m(this.policyHref)}">${p(this.policyLabel)}</a>`:``,i=this._root();i.innerHTML=`${i===this?``:`<style>${n}</style>`} <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden> <h2 class="wui-consent-banner-heading" id="${t}-heading">${p(this.heading)}</h2> <p class="wui-consent-banner-description" id="${t}-description">${p(this.description)}${r}</p> <div class="wui-consent-banner-settings" hidden> ${f(t,`essential`,c.essentialLabel,c.essentialDescription,!0)} ${f(t,`analytics`,c.analyticsLabel,this.analyticsDescription,!1)} ${f(t,`functional`,c.functionalLabel,this.functionalDescription,!1)} ${f(t,`marketing`,c.marketingLabel,this.marketingDescription,!1)} </div> <div class="wui-consent-banner-actions"> <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${c.settingsLabel}</button> <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${c.rejectLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${c.acceptLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${c.saveLabel}</button> </div> </div>`,this._rendered=!0,this._wire(),this._applyPreferences(),this._showSettings(this._settings),e&&(this._panel().hidden=!1)}open({settings:e=!1,focus:t=!1}={}){this._rendered||this.render(),this._applyPreferences(),this._showSettings(e),this._panel().hidden=!1,this.setAttribute(`open`,``),t&&(e?this._root().querySelector(`.wui-consent-banner-category input:not([disabled])`):this._root().querySelector(`.wui-consent-banner-accept`))?.focus()}close(){let e=this._panel();e&&(e.hidden=!0),this.removeAttribute(`open`),this._showSettings(!1)}_root(){return this.shadowRoot?this.shadowRoot:this.standalone?this.attachShadow({mode:`open`}):this}_panel(){return this._root().querySelector(`.wui-consent-banner-panel`)}_wire(){let e=this._root();e.querySelector(`.wui-consent-banner-accept`)?.addEventListener(`click`,()=>this._save({analytics:!0,functional:!0,marketing:!0})),e.querySelector(`.wui-consent-banner-reject`)?.addEventListener(`click`,()=>this._save({analytics:!1,functional:!1,marketing:!1})),e.querySelector(`.wui-consent-banner-save`)?.addEventListener(`click`,()=>this._save(this._switchValues())),e.querySelector(`.wui-consent-banner-settings-toggle`)?.addEventListener(`click`,()=>this._showSettings(!this._settings))}_save(e){this._preferences={...e},this.dispatchEvent(new CustomEvent(a,{bubbles:!0,composed:!0,detail:{...e}})),this.close()}_switchValues(){let e={};for(let t of l)e[t]=this._root().querySelector(`input[data-category="${t}"]`)?.checked===!0;return e}_applyPreferences(){for(let e of l){let t=this._root().querySelector(`input[data-category="${e}"]`);t&&(t.checked=this._preferences[e])}}_showSettings(e){this._settings=e;let t=this._root(),n=t.querySelector(`.wui-consent-banner-settings`);if(!n)return;n.hidden=!e,t.querySelector(`.wui-consent-banner-settings-toggle`)?.setAttribute(`aria-expanded`,e?`true`:`false`);let r=t.querySelector(`.wui-consent-banner-save`);r&&(r.hidden=!e);for(let n of[`.wui-consent-banner-reject`,`.wui-consent-banner-accept`]){let r=t.querySelector(n);r&&(r.hidden=e)}}};function f(e,t,n,r,i){let a=`${e}-${t}`;return`<div class="wui-consent-banner-category"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i?` checked disabled`:``} /> <label class="form-check-label" for="${a}">${p(n)}</label> </div> <p class="wui-consent-banner-category-description">${p(r)}</p> </div>`}var p=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),m=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`);typeof customElements<`u`&&!customElements.get(`wui-consent-banner`)&&customElements.define(`wui-consent-banner`,d)})();
|