@expressivecss/expressive 0.9.1 → 0.10.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/CHANGELOG.md +157 -1
- package/README.md +178 -25
- package/dist/css/expressive.css +365 -1222
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/fonts/material-symbols-outlined.woff2 +0 -0
- package/dist/fonts/material-symbols-rounded.woff2 +0 -0
- package/dist/fonts/material-symbols-sharp.woff2 +0 -0
- package/dist/js/chunks/chunk-7MM4VJJO.mjs +509 -0
- package/dist/js/chunks/chunk-7MM4VJJO.mjs.map +7 -0
- package/dist/js/chunks/chunk-7UXHSYIA.mjs +183 -0
- package/dist/js/chunks/chunk-7UXHSYIA.mjs.map +7 -0
- package/dist/js/chunks/chunk-A3BJA7V4.mjs +28 -0
- package/dist/js/chunks/chunk-A3BJA7V4.mjs.map +7 -0
- package/dist/js/chunks/chunk-AOGFNMXS.mjs +691 -0
- package/dist/js/chunks/chunk-AOGFNMXS.mjs.map +7 -0
- package/dist/js/chunks/chunk-D4UZ4HFN.mjs +560 -0
- package/dist/js/chunks/chunk-D4UZ4HFN.mjs.map +7 -0
- package/dist/js/chunks/chunk-EP3CVKB5.mjs +88 -0
- package/dist/js/chunks/chunk-EP3CVKB5.mjs.map +7 -0
- package/dist/js/chunks/chunk-G576EP5O.mjs +459 -0
- package/dist/js/chunks/chunk-G576EP5O.mjs.map +7 -0
- package/dist/js/chunks/chunk-GY2Z5CJ2.mjs +320 -0
- package/dist/js/chunks/chunk-GY2Z5CJ2.mjs.map +7 -0
- package/dist/js/chunks/chunk-JKNPQQWY.mjs +191 -0
- package/dist/js/chunks/chunk-JKNPQQWY.mjs.map +7 -0
- package/dist/js/chunks/chunk-JNPIWFJT.mjs +365 -0
- package/dist/js/chunks/chunk-JNPIWFJT.mjs.map +7 -0
- package/dist/js/chunks/chunk-JODJAGFS.mjs +267 -0
- package/dist/js/chunks/chunk-JODJAGFS.mjs.map +7 -0
- package/dist/js/chunks/chunk-JR24UB4X.mjs +100 -0
- package/dist/js/chunks/chunk-JR24UB4X.mjs.map +7 -0
- package/dist/js/chunks/chunk-KR44BSYQ.mjs +55 -0
- package/dist/js/chunks/chunk-KR44BSYQ.mjs.map +7 -0
- package/dist/js/chunks/chunk-LZVBJ33S.mjs +102 -0
- package/dist/js/chunks/chunk-LZVBJ33S.mjs.map +7 -0
- package/dist/js/chunks/chunk-MISGHDUU.mjs +326 -0
- package/dist/js/chunks/chunk-MISGHDUU.mjs.map +7 -0
- package/dist/js/chunks/chunk-N3UHGN3N.mjs +175 -0
- package/dist/js/chunks/chunk-N3UHGN3N.mjs.map +7 -0
- package/dist/js/chunks/chunk-PB5L3EXF.mjs +7 -0
- package/dist/js/chunks/chunk-PB5L3EXF.mjs.map +7 -0
- package/dist/js/chunks/chunk-PIIAEYAJ.mjs +85 -0
- package/dist/js/chunks/chunk-PIIAEYAJ.mjs.map +7 -0
- package/dist/js/chunks/chunk-QSQ24FYT.mjs +59 -0
- package/dist/js/chunks/chunk-QSQ24FYT.mjs.map +7 -0
- package/dist/js/chunks/chunk-QYCYP443.mjs +1111 -0
- package/dist/js/chunks/chunk-QYCYP443.mjs.map +7 -0
- package/dist/js/chunks/chunk-SLFNPY5M.mjs +78 -0
- package/dist/js/chunks/chunk-SLFNPY5M.mjs.map +7 -0
- package/dist/js/chunks/chunk-TK6PX2GC.mjs +663 -0
- package/dist/js/chunks/chunk-TK6PX2GC.mjs.map +7 -0
- package/dist/js/chunks/chunk-TYM6U5DY.mjs +76 -0
- package/dist/js/chunks/chunk-TYM6U5DY.mjs.map +7 -0
- package/dist/js/chunks/chunk-TZZ24ZQS.mjs +154 -0
- package/dist/js/chunks/chunk-TZZ24ZQS.mjs.map +7 -0
- package/dist/js/chunks/chunk-VAS6JQ6P.mjs +94 -0
- package/dist/js/chunks/chunk-VAS6JQ6P.mjs.map +7 -0
- package/dist/js/chunks/chunk-WWPAPHMA.mjs +1 -0
- package/dist/js/chunks/chunk-WWPAPHMA.mjs.map +7 -0
- package/dist/js/chunks/chunk-XDB3G6RL.mjs +114 -0
- package/dist/js/chunks/chunk-XDB3G6RL.mjs.map +7 -0
- package/dist/js/chunks/chunk-XO5WX3TK.mjs +226 -0
- package/dist/js/chunks/chunk-XO5WX3TK.mjs.map +7 -0
- package/dist/js/chunks/chunk-YFXEJ7GR.mjs +286 -0
- package/dist/js/chunks/chunk-YFXEJ7GR.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZIZVUWRL.mjs +120 -0
- package/dist/js/chunks/chunk-ZIZVUWRL.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZZBZI2XN.mjs +338 -0
- package/dist/js/chunks/chunk-ZZBZI2XN.mjs.map +7 -0
- package/dist/js/expressive.cjs +747 -754
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +747 -754
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +11 -15
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +83 -7490
- package/dist/js/expressive.mjs.map +4 -4
- package/dist/js/internal/behaviors/bottomSheets.mjs +9 -0
- package/dist/js/internal/behaviors/bottomSheets.mjs.map +7 -0
- package/dist/js/internal/behaviors/dialogs.mjs +8 -0
- package/dist/js/internal/behaviors/dialogs.mjs.map +7 -0
- package/dist/js/internal/behaviors/forms.mjs +8 -0
- package/dist/js/internal/behaviors/forms.mjs.map +7 -0
- package/dist/js/internal/behaviors/sheetDrag.mjs +8 -0
- package/dist/js/internal/behaviors/sheetDrag.mjs.map +7 -0
- package/dist/js/internal/behaviors/sideSheets.mjs +9 -0
- package/dist/js/internal/behaviors/sideSheets.mjs.map +7 -0
- package/dist/js/internal/components/appBar.mjs +8 -0
- package/dist/js/internal/components/appBar.mjs.map +7 -0
- package/dist/js/internal/components/autocomplete.mjs +10 -0
- package/dist/js/internal/components/autocomplete.mjs.map +7 -0
- package/dist/js/internal/components/buttonGroup.mjs +8 -0
- package/dist/js/internal/components/buttonGroup.mjs.map +7 -0
- package/dist/js/internal/components/buttons.mjs +9 -0
- package/dist/js/internal/components/buttons.mjs.map +7 -0
- package/dist/js/internal/components/cards.mjs +13 -0
- package/dist/js/internal/components/cards.mjs.map +7 -0
- package/dist/js/internal/components/carousel.mjs +9 -0
- package/dist/js/internal/components/carousel.mjs.map +7 -0
- package/dist/js/internal/components/characterCounter.mjs +8 -0
- package/dist/js/internal/components/characterCounter.mjs.map +7 -0
- package/dist/js/internal/components/chips.mjs +11 -0
- package/dist/js/internal/components/chips.mjs.map +7 -0
- package/dist/js/internal/components/datepicker.mjs +12 -0
- package/dist/js/internal/components/datepicker.mjs.map +7 -0
- package/dist/js/internal/components/expandingCard.mjs +11 -0
- package/dist/js/internal/components/expandingCard.mjs.map +7 -0
- package/dist/js/internal/components/index.mjs +88 -0
- package/dist/js/internal/components/index.mjs.map +7 -0
- package/dist/js/internal/components/lightbox.mjs +9 -0
- package/dist/js/internal/components/lightbox.mjs.map +7 -0
- package/dist/js/internal/components/menu.mjs +9 -0
- package/dist/js/internal/components/menu.mjs.map +7 -0
- package/dist/js/internal/components/navigationRail.mjs +8 -0
- package/dist/js/internal/components/navigationRail.mjs.map +7 -0
- package/dist/js/internal/components/registry.mjs +33 -0
- package/dist/js/internal/components/registry.mjs.map +7 -0
- package/dist/js/internal/components/scrollspy.mjs +8 -0
- package/dist/js/internal/components/scrollspy.mjs.map +7 -0
- package/dist/js/internal/components/select.mjs +10 -0
- package/dist/js/internal/components/select.mjs.map +7 -0
- package/dist/js/internal/components/slider.mjs +9 -0
- package/dist/js/internal/components/slider.mjs.map +7 -0
- package/dist/js/internal/components/snackbar.mjs +8 -0
- package/dist/js/internal/components/snackbar.mjs.map +7 -0
- package/dist/js/internal/components/tabs.mjs +10 -0
- package/dist/js/internal/components/tabs.mjs.map +7 -0
- package/dist/js/internal/components/timepicker.mjs +10 -0
- package/dist/js/internal/components/timepicker.mjs.map +7 -0
- package/dist/js/internal/components/tooltip.mjs +9 -0
- package/dist/js/internal/components/tooltip.mjs.map +7 -0
- package/dist/js/internal/core/component.mjs +7 -0
- package/dist/js/internal/core/component.mjs.map +7 -0
- package/dist/js/internal/core/utils.mjs +7 -0
- package/dist/js/internal/core/utils.mjs.map +7 -0
- package/dist/js/internal/plugins/dockedDisplayPlugin.mjs +8 -0
- package/dist/js/internal/plugins/dockedDisplayPlugin.mjs.map +7 -0
- package/dist/js/modular.mjs +113 -0
- package/dist/js/modular.mjs.map +7 -0
- package/dist/types/behaviors/sheetDrag.d.ts +1 -1
- package/dist/types/components/appBar.d.ts +1 -1
- package/dist/types/components/autocomplete.d.ts +9 -0
- package/dist/types/components/buttons.d.ts +4 -39
- package/dist/types/components/carousel.d.ts +10 -1
- package/dist/types/components/chips.d.ts +1 -0
- package/dist/types/components/datepicker.d.ts +7 -0
- package/dist/types/components/index.d.ts +0 -2
- package/dist/types/components/lightbox.d.ts +12 -0
- package/dist/types/components/menu.d.ts +3 -0
- package/dist/types/components/registry.d.ts +0 -4
- package/dist/types/components/select.d.ts +4 -0
- package/dist/types/components/slider.d.ts +2 -1
- package/dist/types/components/snackbar.d.ts +4 -2
- package/dist/types/components/tabs.d.ts +2 -1
- package/dist/types/components/timepicker.d.ts +5 -3
- package/dist/types/components/tooltip.d.ts +5 -3
- package/dist/types/index.d.ts +1 -8
- package/dist/types/modular.d.ts +28 -0
- package/package.json +16 -4
- package/src/sass/README.md +8 -0
- package/src/sass/components/_badges.scss +1 -6
- package/src/sass/components/_button-groups.scss +5 -1
- package/src/sass/components/_buttons.scss +8 -287
- package/src/sass/components/_chips.scss +17 -2
- package/src/sass/components/_dialog.scss +9 -4
- package/src/sass/components/_fab-menu.scss +11 -9
- package/src/sass/components/_icon-buttons.scss +0 -5
- package/src/sass/components/_index.scss +0 -5
- package/src/sass/components/_menu.scss +2 -2
- package/src/sass/components/_navigation-rail.scss +1 -1
- package/src/sass/components/_panes.scss +50 -78
- package/src/sass/components/_progress.scss +73 -13
- package/src/sass/components/_scrim.scss +4 -4
- package/src/sass/components/_side-sheet.scss +22 -12
- package/src/sass/components/_toolbar.scss +1 -4
- package/src/sass/components/_tooltip.scss +20 -2
- package/src/sass/components/forms/_input-fields.scss +5 -1
- package/src/sass/components/forms/_select.scss +1 -0
- package/src/sass/components/forms/_slider.scss +81 -25
- package/src/sass/custom.scss +38 -0
- package/dist/types/components/navigationDrawer.d.ts +0 -110
- package/src/sass/components/_banners.scss +0 -298
- package/src/sass/components/_bottom-app-bar.scss +0 -180
- package/src/sass/components/_floating-sheet.scss +0 -86
- package/src/sass/components/_navigation-drawer.scss +0 -476
- package/src/sass/components/_segmented-buttons.scss +0 -188
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var Expressive=(()=>{var ut=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var qt=Object.prototype.hasOwnProperty;var $t=(d,o)=>{for(var t in o)ut(d,t,{get:o[t],enumerable:!0})},Kt=(d,o,t,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Vt(o))!qt.call(d,i)&&i!==t&&ut(d,i,{get:()=>o[i],enumerable:!(e=Ft(o,i))||e.enumerable});return d};var zt=d=>Kt(ut({},"__esModule",{value:!0}),d);var Te={};$t(Te,{AppBar:()=>Y,AutoInit:()=>It,Autocomplete:()=>B,BottomSheets:()=>K,ButtonGroup:()=>G,Cards:()=>P,Carousel:()=>W,CharacterCounter:()=>rt,Chips:()=>N,Datepicker:()=>Z,Dialogs:()=>$,ExpandingCard:()=>R,FloatingActionButton:()=>X,FormSelect:()=>D,Forms:()=>U,Lightbox:()=>Q,Menu:()=>S,NavigationDrawer:()=>q,NavigationRail:()=>tt,Range:()=>F,ScrollSpy:()=>J,SideSheets:()=>z,Sidenav:()=>q,Slider:()=>F,Snackbar:()=>lt,Tabs:()=>et,Timepicker:()=>it,Tooltip:()=>st,version:()=>Le});var O=class O{static onDocumentReady(o){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",o,{once:!0}):o())}static guid(){return globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}static portalRoot(o){let t=o.getRootNode();return t.host?t:document.body}static getElementById(o,t){let e=o.getRootNode();return e.getElementById?e.getElementById(t):document.getElementById(t)}static checkWithinContainer(o,t,e){let i={top:!1,right:!1,bottom:!1,left:!1},s=o.getBoundingClientRect(),n=o===document.body?Math.max(s.bottom,window.innerHeight):s.bottom,a=o.scrollLeft,h=o.scrollTop,l=t.left-a,r=t.top-h;return(l<s.left+e||l<e)&&(i.left=!0),(l+t.width>s.right-e||l+t.width>window.innerWidth-e)&&(i.right=!0),(r<s.top+e||r<e)&&(i.top=!0),(r+t.height>n-e||r+t.height>window.innerHeight-e)&&(i.bottom=!0),i}static checkPossibleAlignments(o,t,e,i){let s={top:!0,right:!0,bottom:!0,left:!0,spaceOnTop:null,spaceOnRight:null,spaceOnBottom:null,spaceOnLeft:null},n=getComputedStyle(t).overflow==="visible",a=t.getBoundingClientRect(),h=Math.min(a.height,window.innerHeight),l=Math.min(a.width,window.innerWidth),r=o.getBoundingClientRect(),u=t.scrollLeft,v=t.scrollTop,m=e.left-u,_=e.top-v,b=e.top+r.height-v;return s.spaceOnRight=n?window.innerWidth-(r.left+e.width):l-(m+e.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=n?r.right-e.width:m-e.width+r.width,s.spaceOnLeft<0&&(s.right=!1),s.spaceOnBottom=n?window.innerHeight-(r.top+e.height+i):h-(_+e.height+i),s.spaceOnBottom<0&&(s.top=!1),s.spaceOnTop=n?r.bottom-(e.height+i):b-(e.height-i),s.spaceOnTop<0&&(s.bottom=!1),s}static getIdFromTrigger(o){let t=o.dataset.target;return t||(t=o.getAttribute("href"),t?t.slice(1):"")}static getDocumentScrollTop(){return window.scrollY}static getDocumentScrollLeft(){return window.scrollX}static throttle(o,t){let e=null,i=null,s=0;return(...n)=>{let a=Date.now(),h=t-(a-s);h<=0?(clearTimeout(e),e=null,s=a,i=null,o(...n)):e?i=n:(i=n,e=setTimeout(()=>{s=Date.now(),e=null,o(...i??[]),i=null},h))}}static createConfirmationContainer(o,t,e,i,s){let n=document.createElement("div");n.classList.add("confirmation-btns"),o.append(n),this.createButton(n,e,["btn-cancel"],!0,s),this.createButton(n,t,["btn-confirm"],!0,i)}static createButton(o,t,e=[],i=!0,s=null){e=e.concat(["text"]);let n=document.createElement("button");n.className=e.join(" "),n.style.visibility=i?"visible":"hidden",n.type="button",n.tabIndex=i?0:-1,n.innerText=t,typeof s=="function"&&(n.addEventListener("click",s),n.addEventListener("keypress",a=>{a.key===O.keys.ENTER&&s(a)})),o.append(n)}static _setAbsolutePosition(o,t,e,i,s,n="center"){let a=o.offsetHeight,h=o.offsetWidth,l=t.offsetHeight,r=t.offsetWidth,u=o.getBoundingClientRect(),v=0,m=0,_=u.top+O.getDocumentScrollTop(),b=u.left+O.getDocumentScrollLeft();e==="top"?(_+=-l-i,n==="center"&&(b+=h/2-r/2),m=-s):e==="right"?(_+=a/2-l/2,b=h+i,v=s):e==="left"?(_+=a/2-l/2,b=-r-i,v=-s):(_+=a+i,n==="center"&&(b+=h/2-r/2),m=s),n==="right"&&(b+=h-r-i);let I=O._repositionWithinScreen(b,_,r,l,i,s,n);return t.style.top=I.y+"px",t.style.left=I.x+"px",{x:v,y:m}}static _repositionWithinScreen(o,t,e,i,s,n,a){let h=O.getDocumentScrollLeft(),l=O.getDocumentScrollTop(),r=o-h,u=t-l,v={left:r,top:u,width:e,height:i},m;a==="left"||a=="center"?m=s+n:a==="right"&&(m=s-n);let _=O.checkWithinContainer(document.body,v,m);return _.left?r=m:_.right&&(r-=r+e-window.innerWidth),_.top?u=m:_.bottom&&(u-=u+i-window.innerHeight),{x:r+h,y:u+l}}};O.keys={TAB:"Tab",ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",DELETE:"Delete"};var c=O;var E=class{constructor(o,t,e){o instanceof HTMLElement||console.error(Error(o+" is not an HTML Element"));let i=e.getInstance(o);i&&i.destroy(),this.el=o}static init(o,t,e){let i=null;if(o instanceof Element)i=new e(o,t);else if(o&&o.length){i=[];for(let s=0;s<o.length;s++)i.push(new e(o[s],t))}return i}static get defaults(){return{}}static getInstance(o){throw new Error("This method must be implemented.")}destroy(){throw new Error("This method must be implemented.")}};var Ut={onOpen:null,onClose:null},mt='article:has(> aside[id]:not([id=""])):not(:has(> aside ~ aside)):has(> button.card-reveal-trigger[type="button"], > :not(aside) button.card-reveal-trigger[type="button"])',pt="card-reveal-initialized";function Yt(d){if(d.getAttribute("aria-label")?.trim())return!0;let t=d.getAttribute("aria-labelledby");if(t&&t.trim().split(/\s+/).map(s=>d.ownerDocument.getElementById(s)?.textContent??"").join(" ").trim())return!0;let e=d.cloneNode(!0);return e.querySelectorAll('[aria-hidden="true"]').forEach(i=>i.remove()),!!e.textContent?.trim()}function _t(d,o,t){return d.closest("article")===o&&!t.contains(d)&&!d.disabled&&d.getAttribute("aria-disabled")!=="true"&&Yt(d)}function ft(d){if(d.tagName!=="ARTICLE")return!1;let o=d.querySelectorAll(":scope > aside");return o.length!==1||!o[0].id?!1:Array.from(d.querySelectorAll('button.card-reveal-trigger[type="button"]')).some(t=>_t(t,d,o[0]))}var P=class d extends E{constructor(t,e={}){super(t,e,d);this.isOpen=!1;this._ownsRevealInitializedClass=!1;this._initialAriaControls=new Map;this._lastActivator=null;this._setupEventHandlers=()=>{this._activators.forEach(t=>{t.addEventListener("click",this._handleClickInteraction)}),this.el.addEventListener("keydown",this._handleKeydownEvent)};this._removeEventHandlers=()=>{this._activators.forEach(t=>{t.removeEventListener("click",this._handleClickInteraction)}),this.el.removeEventListener("keydown",this._handleKeydownEvent)};this._handleClickInteraction=t=>{this._lastActivator=t.currentTarget,this._handleRevealEvent()};this._handleKeydownEvent=t=>{(t.target instanceof Element?t.target.closest("article"):null)!==this.el||t.key!=="Escape"||!this.isOpen||(t.preventDefault(),this.close())};this._handleRevealEvent=()=>{this.isOpen?this.close():this.open()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.classList.add("open"),this.cardReveal.inert=!1,this._activators.forEach(t=>t.ariaExpanded="true"),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.cardReveal)return;let t=this.cardReveal.contains(document.activeElement);this.isOpen=!1,this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._activators.forEach(e=>e.ariaExpanded="false"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el),t&&(this._lastActivator??this._activators[0])?.focus()};this.el.Expressive_Cards=this,this.options={...d.defaults,...e};let i=this.el.querySelectorAll(":scope > aside"),s=i.length===1?i[0]:null,n=s?Array.from(this.el.querySelectorAll('button.card-reveal-trigger[type="button"]')).filter(a=>_t(a,this.el,s)):[];this.cardReveal=s?.id&&n.length>0?s:null,this._activators=this.cardReveal?n:[],this.cardReveal&&(this._ownsRevealInitializedClass=!this.el.classList.contains(pt),this.el.classList.add(pt),this._activators.forEach(a=>{this._initialAriaControls.set(a,a.getAttribute("aria-controls")),a.ariaExpanded="false",a.setAttribute("aria-controls",this.cardReveal.id)}),this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._setupEventHandlers())}static get defaults(){return Ut}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Cards}destroy(){this._removeEventHandlers(),this.cardReveal&&(this.cardReveal.classList.remove("open"),this.cardReveal.inert=!1,this._ownsRevealInitializedClass&&this.el.classList.remove(pt)),this._activators.forEach(t=>{t.removeAttribute("aria-expanded");let e=this._initialAriaControls.get(t);e===null?t.removeAttribute("aria-controls"):e!==void 0&&t.setAttribute("aria-controls",e)}),this.isOpen=!1,this._activators=[],this._initialAriaControls.clear(),this._lastActivator=null,this.el.Expressive_Cards=void 0}static Init(){c.onDocumentReady(()=>{Array.from(document.querySelectorAll(mt)).filter(ft).forEach(e=>{e&&e.Expressive_Cards==null&&this.init(e)})})}};var Xt={onOpen:null,onClose:null},gt="article.expanding-card:has(> dialog.expanding-card-dialog)",R=class d extends E{constructor(t,e){super(t,e,d);this.isOpen=!1;this.closeGeneration=0;this._setupEventHandlers=()=>{this.trigger?.addEventListener("click",this.open),this.trigger?.addEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.addEventListener("click",this.close),this.dialog?.addEventListener("cancel",this._handleCancel),this.dialog?.addEventListener("close",this._handleNativeClose)};this._removeEventHandlers=()=>{this.trigger?.removeEventListener("click",this.open),this.trigger?.removeEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.removeEventListener("click",this.close),this.dialog?.removeEventListener("cancel",this._handleCancel),this.dialog?.removeEventListener("close",this._handleNativeClose)};this._handleTriggerKeypress=t=>{(t.key===c.keys.ENTER||t.key===" ")&&(t.preventDefault(),this.open())};this._handleCancel=t=>{t.preventDefault(),this.close()};this._handleNativeClose=()=>{this.dialog.open||(this.closeGeneration++,this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"))};this._setTransitionOrigin=()=>{if(!this.dialog)return;let t=this.el.getBoundingClientRect(),i=this.el.querySelector(":scope > figure, :scope > img")?.getBoundingClientRect();this.dialog.style.setProperty("--md-comp-expanding-card-from-top",`${Math.max(0,t.top)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-right",`${Math.max(0,window.innerWidth-t.right)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-bottom",`${Math.max(0,window.innerHeight-t.bottom)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-left",`${Math.max(0,t.left)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-media-height",`${Math.max(0,i?.height??0)}px`)};this.open=()=>{this.isOpen||!this.dialog||!this.trigger||(this.closeGeneration++,this._setTransitionOrigin(),this.isOpen=!0,this.trigger.ariaExpanded="true",this.dialog.ariaExpanded="true",this.dialog.showModal(),this.dialog.offsetWidth,this.dialog.classList.add("expanded"),this.closeButton?.focus(),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.dialog||!this.trigger)return;let t=++this.closeGeneration;this._setTransitionOrigin(),this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el);let e=()=>{t!==this.closeGeneration||this.isOpen||!this.dialog.open||(this.dialog.close(),this.dialog.isConnected&&this.trigger.isConnected&&this.trigger.focus())},s=window.matchMedia("(prefers-reduced-motion: reduce)").matches?[]:(this.dialog.getAnimations?.()??[]).filter(n=>n.transitionProperty==="clip-path");s.length===0?e():Promise.allSettled(s.map(n=>n.finished)).then(e)};this.el.Expressive_ExpandingCard=this,this.options={...d.defaults,...e},this.dialog=this.el.querySelector(":scope > dialog.expanding-card-dialog"),this.trigger=this.el.querySelector(":scope > .expanding-card-trigger, :scope > figure > .expanding-card-trigger"),this.closeButton=this.dialog?.querySelector(".expanding-card-close")??null,this.trigger&&this.dialog&&(this.trigger.ariaExpanded="false",this.dialog.id&&this.trigger.setAttribute("aria-controls",this.dialog.id),this.trigger.matches("a[href], button, input, select, textarea")||(this.trigger.tabIndex=0,this.trigger.setAttribute("role","button")),this.dialog.ariaExpanded="false",this._setupEventHandlers())}static get defaults(){return Xt}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ExpandingCard}destroy(){this._removeEventHandlers(),this.closeGeneration++,this.isOpen=!1,this.trigger&&(this.trigger.ariaExpanded="false"),this.dialog&&(this.dialog.ariaExpanded="false"),this.dialog?.classList.remove("expanded"),this.dialog?.open&&this.dialog.close(),this.el.Expressive_ExpandingCard=void 0}static Init(){c.onDocumentReady(()=>{document.querySelectorAll(gt).forEach(t=>{t&&t.Expressive_ExpandingCard==null&&this.init(t)})})}};var bt=112,Gt=280,jt={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!1,closeOnClick:!0,hover:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},vt=" ",A=class A extends E{constructor(t,e){super(t,e,A);this._pendingTimers=new Set;this._transition=0;this._handleClick=t=>{t.preventDefault(),this.isOpen?this.close():this.open()};this._handleMouseEnter=()=>{this.open()};this._handleMouseLeave=t=>{let e=t.relatedTarget;if(!e){this.close();return}let i=!!(this.menuEl&&e&&this.menuEl.contains(e)),s=!1,n=e.closest(".menu-trigger");n&&n.Expressive_Menu&&n.Expressive_Menu.isOpen&&(s=!0),!s&&!i&&this.close()};this._handleDocumentClick=t=>{let e=t.target;this._isSubmenuTriggerClick(e)||(this.options.closeOnClick&&this.menuEl?.contains(e)&&!this.isTouchMoving?this.close():this.menuEl?.contains(e)||this._schedule(()=>{this.isOpen&&this.close()},0),this.isTouchMoving=!1)};this._handleTriggerKeydown=t=>{(t.key===vt||t.key===c.keys.ENTER||t.key===c.keys.ARROW_DOWN||t.key===c.keys.ARROW_UP)&&!this.isOpen&&(t.preventDefault(),this.open())};this._handleDocumentTouchmove=t=>{let e=t.target;this.menuEl?.contains(e)&&(this.isTouchMoving=!0)};this._handleMenuClick=t=>{let e=t.target,i=e.closest("li");if(i?.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),t.stopPropagation();return}if(i&&this._isSubmenuTriggerClick(e)){t.preventDefault(),t.stopPropagation(),this._toggleSubmenu(i);return}i&&typeof this.options.onItemClick=="function"&&this.options.onItemClick.call(this,i)};this._handleSubmenuAlign=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("li");i?.querySelector(":scope > menu")&&this.menuEl?.contains(i)&&this._alignSubmenu(i)};this._handleMenuKeydown=t=>{let e=t.key===c.keys.ARROW_DOWN||t.key===c.keys.ARROW_UP;if(t.key===c.keys.TAB)t.preventDefault(),this.close();else if(t.key===c.keys.ARROW_RIGHT&&this.isOpen){let a=this._focusedRow(t);a?.querySelector(":scope > menu")&&(t.preventDefault(),a.classList.add("open"),this._alignSubmenu(a),this._syncSubmenuAria(a,!0),a.querySelector(":scope > menu > li")?.focus())}else if(t.key===c.keys.ARROW_LEFT&&this.isOpen){let a=this._containingSubmenu(t);if(a){t.preventDefault();let h=a.parentElement;h.classList.remove("open","submenu-start"),this._syncSubmenuAria(h,!1),h.focus()}}else if(e&&this.isOpen){t.preventDefault();let a=t.key===c.keys.ARROW_DOWN?1:-1,h=this._containingSubmenu(t)??this.menuEl,l=this.focusedIndex,r=!1;do if(l=l+a,h.children[l]&&h.children[l].tabIndex!==-1){r=!0;break}while(l<h.children.length&&l>=0);if(r){this.focusedIndex>=0&&h.children[this.focusedIndex]?.classList.remove("active"),this.focusedIndex=l;let u=h.children[this.focusedIndex];u.classList.add("active"),u.focus({preventScroll:!0})}}else if((t.key===c.keys.ENTER||t.key===vt)&&this.isOpen){let a=this._focusedRow(t);if(t.preventDefault(),a?.matches('.disabled, [aria-disabled="true"]'))return;if(a?.querySelector(":scope > menu")){this._toggleSubmenu(a);return}let h=a??this.menuEl.children[this.focusedIndex],l=h?.querySelector("a, button");l?l.click():h instanceof HTMLElement&&h.click()}else if(t.key===c.keys.ESC&&this.isOpen){t.preventDefault();let a=this.menuEl.querySelector("li.open");a?(a.classList.remove("open","submenu-start"),this._syncSubmenuAria(a,!1),a.focus()):this.close()}let i=t.key.toLowerCase(),s=/[a-zA-Z0-9-_]/.test(i),n=[c.keys.ARROW_DOWN,c.keys.ARROW_UP,c.keys.ENTER,c.keys.ESC,c.keys.TAB,vt];if(s&&!n.includes(t.key)){this.filterQuery.push(i);let a=this.filterQuery.join(""),h=this._containingSubmenu(t)??this.menuEl,l=Array.from(h.querySelectorAll(":scope > li")).find(r=>r.textContent.trim().toLowerCase().indexOf(a)===0);l&&(this.focusedIndex=[...l.parentNode.children].indexOf(l),this._focusFocusedItem())}clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this.open=()=>{if(this.isOpen||this.el.Expressive_Menu!==this)return;let t=this._clearPendingTimers();this.isOpen=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t===this._transition&&(this._resetMenuStyles(),this.menuEl.style.display="block",this._placeMenu(),this._schedule(()=>this._setupTemporaryEventHandlers(),0),this._animateIn(),this.el.ariaExpanded="true")};this.close=()=>{if(!this.isOpen)return;let t=this._clearPendingTimers();this.isOpen=!1,this.focusedIndex=-1,this._closeSubmenus(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._transition&&(this._animateOut(),this._removeTemporaryEventHandlers(),this.el.ariaExpanded="false",this.options.autoFocus&&this.el.focus())};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};this.el.Expressive_Menu=this,A._menus.push(this),this.id=c.getIdFromTrigger(t),this.menuEl=c.getElementById(t,this.id),this.options={...A.defaults,...e},this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this.el.ariaExpanded="false",this.el.hasAttribute("aria-haspopup")||this.el.setAttribute("aria-haspopup","menu"),this.id&&!this.el.hasAttribute("aria-controls")&&this.el.setAttribute("aria-controls",this.id),this._moveMenuToElement(),this._setupAccessibility(),this._makeMenuFocusable(),this._setupSubmenus(),this._setupEventHandlers()}static get defaults(){return jt}static init(t,e={}){return super.init(t,e,A)}static getInstance(t){return t.Expressive_Menu}destroy(){this._clearPendingTimers(),this.isOpen=!1,this.el.ariaExpanded="false",clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._removeEventHandlers(),this._removeTemporaryEventHandlers();let t=A._menus.indexOf(this);t>=0&&A._menus.splice(t,1),this.el.Expressive_Menu=void 0}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.addEventListener("click",this._handleMenuClick),this.menuEl?.querySelector(":scope > li > menu")&&this.menuEl.addEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.menuEl.addEventListener("mouseleave",this._handleMouseLeave)):this.el.addEventListener("click",this._handleClick)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.removeEventListener("click",this._handleMenuClick),this.menuEl?.removeEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.menuEl?.removeEventListener("mouseleave",this._handleMouseLeave)):this.el.removeEventListener("click",this._handleClick)}_setupTemporaryEventHandlers(){document.body.addEventListener("click",this._handleDocumentClick),document.body.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),this.menuEl?.addEventListener("keydown",this._handleMenuKeydown),window.addEventListener("resize",this._handleWindowResize)}_removeTemporaryEventHandlers(){document.body.removeEventListener("click",this._handleDocumentClick),document.body.removeEventListener("touchmove",this._handleDocumentTouchmove),this.menuEl?.removeEventListener("keydown",this._handleMenuKeydown),window.removeEventListener("resize",this._handleWindowResize)}_setupAccessibility(){if(!this.menuEl)return;this.menuEl.hasAttribute("role")||this.menuEl.setAttribute("role","menu"),[this.menuEl,...this.menuEl.querySelectorAll("menu")].forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","menu"),e.getAttribute("role")==="menu"&&e.querySelectorAll(":scope > li").forEach(i=>{if(i.classList.contains("divider")){i.hasAttribute("role")||i.setAttribute("role","separator");return}if(i.classList.contains("gap")){i.setAttribute("aria-hidden","true");return}if(i.classList.contains("label")||i.classList.contains("optgroup")){i.hasAttribute("role")||i.setAttribute("role","presentation");return}i.hasAttribute("role")||i.setAttribute("role","menuitem"),i.classList.contains("disabled")&&!i.hasAttribute("aria-disabled")&&i.setAttribute("aria-disabled","true")})})}_isSubmenuTriggerClick(t){if(!this.menuEl)return!1;let e=t.closest("li");if(!e||!this.menuEl.contains(e))return!1;let i=e.querySelector(":scope > menu");return i?!i.contains(t):!1}_setupSubmenus(){this.menuEl?.querySelectorAll("li").forEach(t=>{if(!t.querySelector(":scope > menu"))return;let e=t.querySelector(":scope > a, :scope > button, :scope > span")??t;e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","false")})}_toggleSubmenu(t){let e=!t.classList.contains("open");t.parentElement?.querySelectorAll(":scope > li.open").forEach(i=>{i!==t&&(i.classList.remove("open","submenu-start"),this._syncSubmenuAria(i,!1))}),t.classList.toggle("open",e),e&&this._alignSubmenu(t),this._syncSubmenuAria(t,e)}_syncSubmenuAria(t,e){(t.querySelector(":scope > a, :scope > button, :scope > span")??t).setAttribute("aria-expanded",e?"true":"false")}_alignSubmenu(t){let e=t.querySelector(":scope > menu");if(!e)return;t.classList.remove("submenu-start"),e.getBoundingClientRect().right>window.innerWidth-8&&t.classList.add("submenu-start")}_closeSubmenus(){this.menuEl?.querySelectorAll("li.open").forEach(t=>{t.classList.remove("open","submenu-start"),this._syncSubmenuAria(t,!1)})}_containingSubmenu(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li > menu");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_focusedRow(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_resetMenuStyles(){this.menuEl.style.display="",this._resetMenuPositioningStyles(),this.menuEl.style.transform="",this.menuEl.style.opacity=""}_resetMenuPositioningStyles(){this.menuEl.style.width="",this.menuEl.style.height="",this.menuEl.style.left="",this.menuEl.style.top="",this.menuEl.style.transformOrigin=""}_moveMenuToElement(t=null){if(this.options.container){this.options.container.append(this.menuEl);return}if(t){t.contains(this.menuEl)||t.append(this.menuEl);return}this.el.after(this.menuEl)}_makeMenuFocusable(){this.menuEl&&(this.menuEl.popover="",this.menuEl.tabIndex=-1,this.menuEl.querySelectorAll(":scope li, :scope > hr").forEach(t=>{if(t instanceof HTMLHRElement||t.classList.contains("divider")||t.classList.contains("gap")||t.classList.contains("label")||t.classList.contains("optgroup")){t.setAttribute("tabindex","-1");return}t.getAttribute("tabindex")||t.setAttribute("tabindex","0")}))}_focusInitialItem(){if(!this.menuEl||!this.options.autoFocus)return;let t=Array.from(this.menuEl.children).find(e=>e instanceof HTMLElement&&e.tabIndex!==-1);t&&(this.focusedIndex=Array.from(this.menuEl.children).indexOf(t),t.focus({preventScroll:!0}))}_focusFocusedItem(){this.focusedIndex>=0&&this.focusedIndex<this.menuEl.children.length&&this.options.autoFocus&&(this.menuEl.children[this.focusedIndex].focus({preventScroll:!0}),this.menuEl.children[this.focusedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}_getMenuPosition(t){let e=this.el.getBoundingClientRect(),i=this.menuEl.getBoundingClientRect(),s=i.height,n=i.width,a=e.left-i.left,h=e.top-i.top,l={left:a,top:h,height:s,width:n},r=c.checkPossibleAlignments(this.el,t,l,this.options.coverTrigger?0:e.height),u="top",v=this.options.alignment;if(h+=this.options.coverTrigger?0:e.height,this.isScrollable=!1,r.top||(r.bottom?(u="bottom",this.options.coverTrigger||(h-=e.height)):(this.isScrollable=!0,s-=20,r.spaceOnTop>r.spaceOnBottom?(u="bottom",s+=r.spaceOnTop,h-=this.options.coverTrigger?r.spaceOnTop-20:r.spaceOnTop-20+e.height):s+=r.spaceOnBottom)),!r[v]){let m=v==="left"?"right":"left";r[m]?v=m:r.spaceOnLeft>r.spaceOnRight?(v="right",n+=r.spaceOnLeft,a-=r.spaceOnLeft):(v="left",n+=r.spaceOnRight)}return u==="bottom"&&(h=h-i.height+(this.options.coverTrigger?e.height:0)),v==="right"&&(a=a-i.width+e.width),{x:a,y:h,verticalAlignment:u,horizontalAlignment:v,height:s,width:n}}_schedule(t,e){let i=setTimeout(()=>{this._pendingTimers.delete(i),t()},e);this._pendingTimers.add(i)}_clearPendingTimers(){for(let t of this._pendingTimers)clearTimeout(t);return this._pendingTimers.clear(),++this._transition}_animateIn(){let t=this._transition,e=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this.menuEl.style.transition=`opacity ${e}ms ease, transform ${e}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),this._schedule(()=>{this._focusInitialItem(),t===this._transition&&typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},e)}_animateOut(){let t=this.options.outDuration;this.menuEl.style.transition=`opacity ${t}ms ease, transform ${t}ms ease`,this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this._resetMenuStyles(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_getClosestAncestor(t,e){let i=t.parentNode;for(;i!=null&&i!==document;){if(i.nodeType===Node.ELEMENT_NODE&&e(i))return i;i=i.parentNode??i.host}return null}_placeMenu(){let t=this._getClosestAncestor(this.menuEl,a=>!["HTML","BODY"].includes(a.tagName)&&getComputedStyle(a).overflow!=="visible");if(!t){let a=this.menuEl.offsetParent?this.menuEl.offsetParent:this.menuEl.parentNode;t=a.host??a}getComputedStyle(t).position==="static"&&(t.style.position="relative");let e=this.menuEl.getBoundingClientRect().width,i=this.el.getBoundingClientRect().width,s=this.options.constrainWidth&&i>=bt?i:Math.min(Gt,Math.max(bt,e));this.menuEl.style.width=s+"px";let n=this._getMenuPosition(t);this.menuEl.style.left=n.x+"px",this.menuEl.style.top=n.y+"px",this.menuEl.style.height=n.height+"px",this.menuEl.style.width=n.width+"px",this.menuEl.style.transformOrigin=`${n.horizontalAlignment==="left"?"0":"100%"} ${n.verticalAlignment==="top"?"0":"100%"}`}};A._menus=[];var S=A;var Zt={data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,isMultiSelect:!1,onSearch:(d,o)=>{let t=d.toLocaleLowerCase();o.setMenuItems(o.options.data.filter(e=>e.id.toString().toLocaleLowerCase().includes(t)||e.text?.toLocaleLowerCase().includes(t)))},maxMenuHeight:"300px",allowUnsafeHTML:!1,selected:[]},w=class w extends E{constructor(t,e){super(t,e,w);this._handleInputBlur=()=>{this._pointerDown||(this.close(),this._resetAutocomplete())};this._handleInputKeyup=t=>{t.type==="keyup"&&(w._keydown=!1),this.count=0;let e=this.el.value.toLocaleLowerCase();t.key===c.keys.ENTER||t.key===c.keys.ARROW_UP||t.key===c.keys.ARROW_DOWN||(this.oldVal!==e&&this.el.matches(":focus-visible")&&this.open(),this._inputChangeDetection(e))};this._handleInputFocus=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=t=>{this.oldVal!==t&&(this._setStatusLoading(),this.options.onSearch(this.el.value,this)),!this.options.isMultiSelect&&this.el.value.length===0&&(this.selectedValues=[],this._triggerChanged()),this.oldVal=t};this._handleInputKeydown=t=>{w._keydown=!0;let e=this.container.querySelectorAll("li").length;if(t.key===c.keys.ENTER&&this.activeIndex>=0){let i=this.container.querySelectorAll("li")[this.activeIndex];i&&(this.selectOption(i.getAttribute("data-id")),t.preventDefault());return}(t.key===c.keys.ARROW_UP||t.key===c.keys.ARROW_DOWN)&&(t.preventDefault(),t.key===c.keys.ARROW_UP&&this.activeIndex>0&&this.activeIndex--,t.key===c.keys.ARROW_DOWN&&this.activeIndex<e-1&&this.activeIndex++,this._setActive(null),this.activeIndex>=0&&(this._setActive(this.container.querySelectorAll("li")[this.activeIndex]),this.container.children[this.activeIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})))};this._handleInputClick=()=>{this.open()};this._handleContainerPointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0))};this._handleContainerPointerUp=()=>{this._pointerDown=!1};this.open=()=>{let t=this.el.value.toLocaleLowerCase();this._resetAutocomplete(),t.length>=this.options.minLength&&(this.isOpen=!0,this._renderMenu()),this.menu.isOpen?this.menu.recalculateDimensions():(this._openTimer!==void 0&&clearTimeout(this._openTimer),this._openTimer=setTimeout(()=>{this._openTimer=void 0,this.menu.open()},0))};this.close=()=>{this.menu.close()};this.el.Expressive_Autocomplete=this,this.options={...w.defaults,...e},this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="",this.selectedValues=this.selectedValues||this.options.selected.map(i=>({id:i}))||[],this.menuItems=this.options.data||[],this.$active=null,this._pointerDown=!1,this._setupMenu(),this._setupEventHandlers()}_setActive(t){this.$active?.classList.remove("active"),this.$active=t,t?(t.classList.add("active"),this.el.setAttribute("aria-activedescendant",t.id)):this.el.removeAttribute("aria-activedescendant")}static get defaults(){return Zt}static init(t,e={}){return super.init(t,e,w)}static getInstance(t){return t.Expressive_Autocomplete}static _loadingIndicator(){if(!w._loadingTemplate){let t=document.createElement("template");t.innerHTML=`<div style="height:100%;width:50px;"><svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
|
|
1
|
+
var Expressive=(()=>{var dt=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Ft=Object.getOwnPropertyNames;var Vt=Object.prototype.hasOwnProperty;var qt=(d,n)=>{for(var t in n)dt(d,t,{get:n[t],enumerable:!0})},$t=(d,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Ft(n))!Vt.call(d,i)&&i!==t&&dt(d,i,{get:()=>n[i],enumerable:!(e=Nt(n,i))||e.enumerable});return d};var Kt=d=>$t(dt({},"__esModule",{value:!0}),d);var be={};qt(be,{AppBar:()=>Y,AutoInit:()=>wt,Autocomplete:()=>B,BottomSheets:()=>K,ButtonGroup:()=>X,Cards:()=>R,Carousel:()=>N,CharacterCounter:()=>rt,Chips:()=>W,Datepicker:()=>Z,Dialogs:()=>$,ExpandingCard:()=>P,FloatingActionButton:()=>G,FormSelect:()=>k,Forms:()=>U,Lightbox:()=>Q,Menu:()=>O,NavigationRail:()=>tt,Range:()=>V,ScrollSpy:()=>J,SideSheets:()=>z,Slider:()=>V,Snackbar:()=>lt,Tabs:()=>et,Timepicker:()=>it,Tooltip:()=>st,version:()=>ye});var S=class S{static onDocumentReady(n){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n())}static guid(){return globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}static portalRoot(n){let t=n.getRootNode();return t.host?t:document.body}static getElementById(n,t){let e=n.getRootNode();return e.getElementById?e.getElementById(t):document.getElementById(t)}static checkWithinContainer(n,t,e){let i={top:!1,right:!1,bottom:!1,left:!1},s=n.getBoundingClientRect(),o=n===document.body?Math.max(s.bottom,window.innerHeight):s.bottom,r=n.scrollLeft,c=n.scrollTop,h=t.left-r,l=t.top-c;return(h<s.left+e||h<e)&&(i.left=!0),(h+t.width>s.right-e||h+t.width>window.innerWidth-e)&&(i.right=!0),(l<s.top+e||l<e)&&(i.top=!0),(l+t.height>o-e||l+t.height>window.innerHeight-e)&&(i.bottom=!0),i}static checkPossibleAlignments(n,t,e,i){let s={top:!0,right:!0,bottom:!0,left:!0,spaceOnTop:null,spaceOnRight:null,spaceOnBottom:null,spaceOnLeft:null},o=getComputedStyle(t).overflow==="visible",r=t.getBoundingClientRect(),c=Math.min(r.height,window.innerHeight),h=Math.min(r.width,window.innerWidth),l=n.getBoundingClientRect(),a=t.scrollLeft,m=t.scrollTop,p=e.left-a,v=e.top-m,y=e.top+l.height-m;return s.spaceOnRight=o?window.innerWidth-(l.left+e.width):h-(p+e.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=o?l.right-e.width:p-e.width+l.width,s.spaceOnLeft<0&&(s.right=!1),s.spaceOnBottom=o?window.innerHeight-(l.top+e.height+i):c-(v+e.height+i),s.spaceOnBottom<0&&(s.top=!1),s.spaceOnTop=o?l.bottom-(e.height+i):y-(e.height-i),s.spaceOnTop<0&&(s.bottom=!1),s}static getIdFromTrigger(n){let t=n.dataset.target;return t||(t=n.getAttribute("href"),t?t.slice(1):"")}static getDocumentScrollTop(){return window.scrollY}static getDocumentScrollLeft(){return window.scrollX}static throttle(n,t){let e=null,i=null,s=0;return(...o)=>{let r=Date.now(),c=t-(r-s);c<=0?(clearTimeout(e),e=null,s=r,i=null,n(...o)):e?i=o:(i=o,e=setTimeout(()=>{s=Date.now(),e=null,n(...i??[]),i=null},c))}}static createConfirmationContainer(n,t,e,i,s){let o=document.createElement("div");o.classList.add("confirmation-btns"),n.append(o),this.createButton(o,e,["btn-cancel"],!0,s),this.createButton(o,t,["btn-confirm"],!0,i)}static createButton(n,t,e=[],i=!0,s=null){e=e.concat(["text"]);let o=document.createElement("button");o.className=e.join(" "),o.style.visibility=i?"visible":"hidden",o.type="button",o.tabIndex=i?0:-1,o.innerText=t,typeof s=="function"&&(o.addEventListener("click",s),o.addEventListener("keypress",r=>{r.key===S.keys.ENTER&&s(r)})),n.append(o)}static _setAbsolutePosition(n,t,e,i,s,o="center"){let r=n.offsetHeight,c=n.offsetWidth,h=t.offsetHeight,l=t.offsetWidth,a=n.getBoundingClientRect(),m=0,p=0,v=a.top+S.getDocumentScrollTop(),y=a.left+S.getDocumentScrollLeft();e==="top"?(v+=-h-i,o==="center"&&(y+=c/2-l/2),p=-s):e==="right"?(v+=r/2-h/2,y=c+i,m=s):e==="left"?(v+=r/2-h/2,y=-l-i,m=-s):(v+=r+i,o==="center"&&(y+=c/2-l/2),p=s),o==="right"&&(y+=c-l-i);let b=S._repositionWithinScreen(y,v,l,h,i,s,o);return t.style.top=b.y+"px",t.style.left=b.x+"px",{x:m,y:p}}static _repositionWithinScreen(n,t,e,i,s,o,r){let c=S.getDocumentScrollLeft(),h=S.getDocumentScrollTop(),l=n-c,a=t-h,m={left:l,top:a,width:e,height:i},p;r==="left"||r=="center"?p=s+o:r==="right"&&(p=s-o);let v=S.checkWithinContainer(document.body,m,p);return v.left?l=p:v.right&&(l-=l+e-window.innerWidth),v.top?a=p:v.bottom&&(a-=a+i-window.innerHeight),{x:l+c,y:a+h}}};S.keys={TAB:"Tab",ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",DELETE:"Delete"};var u=S;var _=class{constructor(n,t,e){n instanceof HTMLElement||console.error(Error(n+" is not an HTML Element"));let i=e.getInstance(n);i&&i.destroy(),this.el=n}static init(n,t,e){let i=null;if(n instanceof Element)i=new e(n,t);else if(n&&n.length){i=[];for(let s=0;s<n.length;s++)i.push(new e(n[s],t))}return i}static get defaults(){return{}}static getInstance(n){throw new Error("This method must be implemented.")}destroy(){throw new Error("This method must be implemented.")}};var zt={onOpen:null,onClose:null},pt='article:has(> aside[id]:not([id=""])):not(:has(> aside ~ aside)):has(> button.card-reveal-trigger[type="button"], > :not(aside) button.card-reveal-trigger[type="button"])',ut="card-reveal-initialized";function Ut(d){if(d.getAttribute("aria-label")?.trim())return!0;let t=d.getAttribute("aria-labelledby");if(t&&t.trim().split(/\s+/).map(s=>d.ownerDocument.getElementById(s)?.textContent??"").join(" ").trim())return!0;let e=d.cloneNode(!0);return e.querySelectorAll('[aria-hidden="true"]').forEach(i=>i.remove()),!!e.textContent?.trim()}function Et(d,n,t){return d.closest("article")===n&&!t.contains(d)&&!d.disabled&&d.getAttribute("aria-disabled")!=="true"&&Ut(d)}function mt(d){if(d.tagName!=="ARTICLE")return!1;let n=d.querySelectorAll(":scope > aside");return n.length!==1||!n[0].id?!1:Array.from(d.querySelectorAll('button.card-reveal-trigger[type="button"]')).some(t=>Et(t,d,n[0]))}var R=class d extends _{constructor(t,e={}){super(t,e,d);this.isOpen=!1;this._ownsRevealInitializedClass=!1;this._initialAriaControls=new Map;this._lastActivator=null;this._setupEventHandlers=()=>{this._activators.forEach(t=>{t.addEventListener("click",this._handleClickInteraction)}),this.el.addEventListener("keydown",this._handleKeydownEvent)};this._removeEventHandlers=()=>{this._activators.forEach(t=>{t.removeEventListener("click",this._handleClickInteraction)}),this.el.removeEventListener("keydown",this._handleKeydownEvent)};this._handleClickInteraction=t=>{this._lastActivator=t.currentTarget,this._handleRevealEvent()};this._handleKeydownEvent=t=>{(t.target instanceof Element?t.target.closest("article"):null)!==this.el||t.key!=="Escape"||!this.isOpen||(t.preventDefault(),this.close())};this._handleRevealEvent=()=>{this.isOpen?this.close():this.open()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.classList.add("open"),this.cardReveal.inert=!1,this._activators.forEach(t=>t.ariaExpanded="true"),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.cardReveal)return;let t=this.cardReveal.contains(document.activeElement);this.isOpen=!1,this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._activators.forEach(e=>e.ariaExpanded="false"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el),t&&(this._lastActivator??this._activators[0])?.focus()};this.el.Expressive_Cards=this,this.options={...d.defaults,...e};let i=this.el.querySelectorAll(":scope > aside"),s=i.length===1?i[0]:null,o=s?Array.from(this.el.querySelectorAll('button.card-reveal-trigger[type="button"]')).filter(r=>Et(r,this.el,s)):[];this.cardReveal=s?.id&&o.length>0?s:null,this._activators=this.cardReveal?o:[],this.cardReveal&&(this._ownsRevealInitializedClass=!this.el.classList.contains(ut),this.el.classList.add(ut),this._activators.forEach(r=>{this._initialAriaControls.set(r,r.getAttribute("aria-controls")),r.ariaExpanded="false",r.setAttribute("aria-controls",this.cardReveal.id)}),this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._setupEventHandlers())}static get defaults(){return zt}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Cards}destroy(){this._removeEventHandlers(),this.cardReveal&&(this.cardReveal.classList.remove("open"),this.cardReveal.inert=!1,this._ownsRevealInitializedClass&&this.el.classList.remove(ut)),this._activators.forEach(t=>{t.removeAttribute("aria-expanded");let e=this._initialAriaControls.get(t);e===null?t.removeAttribute("aria-controls"):e!==void 0&&t.setAttribute("aria-controls",e)}),this.isOpen=!1,this._activators=[],this._initialAriaControls.clear(),this._lastActivator=null,this.el.Expressive_Cards=void 0}static Init(){u.onDocumentReady(()=>{Array.from(document.querySelectorAll(pt)).filter(mt).forEach(e=>{e&&e.Expressive_Cards==null&&this.init(e)})})}};var Yt={onOpen:null,onClose:null},ft="article.expanding-card:has(> dialog.expanding-card-dialog)",P=class d extends _{constructor(t,e){super(t,e,d);this.isOpen=!1;this.closeGeneration=0;this._setupEventHandlers=()=>{this.trigger?.addEventListener("click",this.open),this.trigger?.addEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.addEventListener("click",this.close),this.dialog?.addEventListener("cancel",this._handleCancel),this.dialog?.addEventListener("close",this._handleNativeClose)};this._removeEventHandlers=()=>{this.trigger?.removeEventListener("click",this.open),this.trigger?.removeEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.removeEventListener("click",this.close),this.dialog?.removeEventListener("cancel",this._handleCancel),this.dialog?.removeEventListener("close",this._handleNativeClose)};this._handleTriggerKeypress=t=>{(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this.open())};this._handleCancel=t=>{t.preventDefault(),this.close()};this._handleNativeClose=()=>{this.dialog.open||(this.closeGeneration++,this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"))};this._setTransitionOrigin=()=>{if(!this.dialog)return;let t=this.el.getBoundingClientRect(),i=this.el.querySelector(":scope > figure, :scope > img")?.getBoundingClientRect();this.dialog.style.setProperty("--md-comp-expanding-card-from-top",`${Math.max(0,t.top)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-right",`${Math.max(0,window.innerWidth-t.right)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-bottom",`${Math.max(0,window.innerHeight-t.bottom)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-left",`${Math.max(0,t.left)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-media-height",`${Math.max(0,i?.height??0)}px`)};this.open=()=>{this.isOpen||!this.dialog||!this.trigger||(this.closeGeneration++,this._setTransitionOrigin(),this.isOpen=!0,this.trigger.ariaExpanded="true",this.dialog.ariaExpanded="true",this.dialog.showModal(),this.dialog.offsetWidth,this.dialog.classList.add("expanded"),this.closeButton?.focus(),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.dialog||!this.trigger)return;let t=++this.closeGeneration;this._setTransitionOrigin(),this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el);let e=()=>{t!==this.closeGeneration||this.isOpen||!this.dialog.open||(this.dialog.close(),this.dialog.isConnected&&this.trigger.isConnected&&this.trigger.focus())},s=window.matchMedia("(prefers-reduced-motion: reduce)").matches?[]:(this.dialog.getAnimations?.()??[]).filter(o=>o.transitionProperty==="clip-path");s.length===0?e():Promise.allSettled(s.map(o=>o.finished)).then(e)};this.el.Expressive_ExpandingCard=this,this.options={...d.defaults,...e},this.dialog=this.el.querySelector(":scope > dialog.expanding-card-dialog"),this.trigger=this.el.querySelector(":scope > .expanding-card-trigger, :scope > figure > .expanding-card-trigger"),this.closeButton=this.dialog?.querySelector(".expanding-card-close")??null,this.trigger&&this.dialog&&(this.trigger.ariaExpanded="false",this.dialog.id&&this.trigger.setAttribute("aria-controls",this.dialog.id),this.trigger.matches("a[href], button, input, select, textarea")||(this.trigger.tabIndex=0,this.trigger.setAttribute("role","button")),this.dialog.ariaExpanded="false",this._setupEventHandlers())}static get defaults(){return Yt}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ExpandingCard}destroy(){this._removeEventHandlers(),this.closeGeneration++,this.isOpen=!1,this.trigger&&(this.trigger.ariaExpanded="false"),this.dialog&&(this.dialog.ariaExpanded="false"),this.dialog?.classList.remove("expanded"),this.dialog?.open&&this.dialog.close(),this.el.Expressive_ExpandingCard=void 0}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(ft).forEach(t=>{t&&t.Expressive_ExpandingCard==null&&this.init(t)})})}};var _t=112,Gt=280,Xt={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!1,closeOnClick:!0,hover:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},vt=" ",H=class H extends _{constructor(t,e){super(t,e,H);this._pendingTimers=new Set;this._transition=0;this._handleClick=t=>{t.preventDefault(),this.isOpen?this.close():this.open()};this._handleMouseEnter=()=>{this.open()};this._handleMouseLeave=t=>{let e=t.relatedTarget;if(!e){this.close();return}let i=!!(this.menuEl&&e&&this.menuEl.contains(e)),s=!1,o=e.closest(".menu-trigger");o&&o.Expressive_Menu&&o.Expressive_Menu.isOpen&&(s=!0),!s&&!i&&this.close()};this._handleDocumentClick=t=>{let e=t.target;this._isSubmenuTriggerClick(e)||(this.options.closeOnClick&&this.menuEl?.contains(e)&&!this.isTouchMoving?this.close():this.menuEl?.contains(e)||this._schedule(()=>{this.isOpen&&this.close()},0),this.isTouchMoving=!1)};this._handleTriggerKeydown=t=>{(t.key===vt||t.key===u.keys.ENTER||t.key===u.keys.ARROW_DOWN||t.key===u.keys.ARROW_UP)&&!this.isOpen&&(t.preventDefault(),this.open())};this._handleDocumentTouchmove=t=>{let e=t.target;this.menuEl?.contains(e)&&(this.isTouchMoving=!0)};this._handleMenuClick=t=>{let e=t.target,i=e.closest("li");if(i?.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),t.stopPropagation();return}if(i&&this._isSubmenuTriggerClick(e)){t.preventDefault(),t.stopPropagation(),this._toggleSubmenu(i);return}i&&typeof this.options.onItemClick=="function"&&this.options.onItemClick.call(this,i)};this._handleSubmenuAlign=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("li");i?.querySelector(":scope > menu")&&this.menuEl?.contains(i)&&this._alignSubmenu(i)};this._handleMenuKeydown=t=>{if(!this.isOpen||t.ctrlKey||t.metaKey||t.altKey||t.isComposing)return;let e=this._containingSubmenu(t)??this.menuEl,i=getComputedStyle(e).direction==="rtl",s=i?u.keys.ARROW_LEFT:u.keys.ARROW_RIGHT,o=i?u.keys.ARROW_RIGHT:u.keys.ARROW_LEFT;[s,o,u.keys.ARROW_UP,u.keys.ARROW_DOWN,u.keys.ESC,u.keys.TAB].includes(t.key)&&(clearTimeout(this.filterTimeout),this._resetFilterQuery());let r=t.key===u.keys.ARROW_DOWN||t.key===u.keys.ARROW_UP;if(t.key===u.keys.TAB)t.preventDefault(),this.close();else if(t.key===s){let h=this._focusedRow(t);if(h?.querySelector(":scope > menu")&&!h.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),h.classList.add("open"),this._alignSubmenu(h),this._syncSubmenuAria(h,!0);let l=Array.from(h.querySelector(":scope > menu").children).find(a=>a instanceof HTMLElement&&a.tabIndex!==-1);l&&this._focusRow(l)}}else if(t.key===o){let h=this._containingSubmenu(t);if(h){t.preventDefault();let l=h.parentElement;l.classList.remove("open","submenu-start"),this._syncSubmenuAria(l,!1),this._focusRow(l)}}else if(r&&this.isOpen){t.preventDefault();let h=t.key===u.keys.ARROW_DOWN?1:-1,l=this._focusedRow(t),a=l?Array.from(e.children).indexOf(l):this.focusedIndex,m=!1;do if(a=a+h,e.children[a]&&e.children[a].tabIndex!==-1){m=!0;break}while(a<e.children.length&&a>=0);if(m){this.focusedIndex>=0&&e.children[this.focusedIndex]?.classList.remove("active");let p=e.children[a];p.classList.add("active"),this._focusRow(p)}}else if((t.key===u.keys.ENTER||t.key===vt)&&this.isOpen){let h=this._focusedRow(t);if(t.preventDefault(),h?.matches('.disabled, [aria-disabled="true"]'))return;if(h?.querySelector(":scope > menu")){this._toggleSubmenu(h);return}let l=h??this.menuEl.children[this.focusedIndex],a=l?.querySelector(":scope > a, :scope > button");a?a.click():l instanceof HTMLElement&&l.click()}else if(t.key===u.keys.ESC&&this.isOpen){t.preventDefault();let h=this._containingSubmenu(t)?.parentElement??Array.from(this.menuEl.querySelectorAll("li.open")).reverse()[0];h?(h.classList.remove("open","submenu-start"),this._syncSubmenuAria(h,!1),this._focusRow(h)):this.close()}let c=t.key.toLowerCase();if(t.key.length===1&&t.key!==vt&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.isComposing){this.filterQuery.push(c);let h=this.filterQuery.join(""),l=Array.from(e.querySelectorAll(":scope > li")).find(a=>a.tabIndex!==-1&&!a.matches('.disabled, [aria-disabled="true"]')&&Array.from(a.childNodes).filter(m=>!(m instanceof Element&&m.matches("menu"))).map(m=>m.textContent).join("").trim().toLowerCase().startsWith(h));l&&this._focusRow(l),clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)}};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this.open=()=>{if(this.isOpen||this.el.Expressive_Menu!==this)return;let t=this._clearPendingTimers();this.isOpen=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t===this._transition&&(this._resetMenuStyles(),this.menuEl.style.display="block",this._restoreInert(),this._placeMenu(),this._schedule(()=>this._setupTemporaryEventHandlers(),0),this._animateIn(),this.el.ariaExpanded="true")};this.close=()=>{if(!this.isOpen)return;let t=this._clearPendingTimers(),e=this.menuEl.getRootNode(),i=e.activeElement;this.isOpen=!1,this.menuEl.setAttribute("inert",""),clearTimeout(this.filterTimeout),this._resetFilterQuery(),this.focusedIndex=-1,this._closeSubmenus(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._transition&&(this._animateOut(),this._removeTemporaryEventHandlers(),this.el.ariaExpanded="false",this.options.autoFocus&&(e.activeElement===i||!e.activeElement||e.activeElement===document.body)&&this.el.focus())};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};this.el.Expressive_Menu=this,H._menus.push(this),this.id=u.getIdFromTrigger(t),this.menuEl=u.getElementById(t,this.id),this._originalInert=this.menuEl?.getAttribute("inert")??null,this.options={...H.defaults,...e},this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this.el.ariaExpanded="false",this.el.hasAttribute("aria-haspopup")||this.el.setAttribute("aria-haspopup","menu"),this.id&&!this.el.hasAttribute("aria-controls")&&this.el.setAttribute("aria-controls",this.id),this._moveMenuToElement(),this._setupAccessibility(),this._makeMenuFocusable(),this._setupSubmenus(),this._setupEventHandlers()}static get defaults(){return Xt}static init(t,e={}){return super.init(t,e,H)}static getInstance(t){return t.Expressive_Menu}destroy(){this._clearPendingTimers(),this.isOpen=!1,this.el.ariaExpanded="false",clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._restoreInert(),this._removeEventHandlers(),this._removeTemporaryEventHandlers();let t=H._menus.indexOf(this);t>=0&&H._menus.splice(t,1),this.el.Expressive_Menu=void 0}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.addEventListener("click",this._handleMenuClick),this.menuEl?.querySelector(":scope > li > menu")&&this.menuEl.addEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.menuEl.addEventListener("mouseleave",this._handleMouseLeave)):this.el.addEventListener("click",this._handleClick)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.removeEventListener("click",this._handleMenuClick),this.menuEl?.removeEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.menuEl?.removeEventListener("mouseleave",this._handleMouseLeave)):this.el.removeEventListener("click",this._handleClick)}_setupTemporaryEventHandlers(){document.body.addEventListener("click",this._handleDocumentClick),document.body.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),this.menuEl?.addEventListener("keydown",this._handleMenuKeydown),window.addEventListener("resize",this._handleWindowResize)}_removeTemporaryEventHandlers(){document.body.removeEventListener("click",this._handleDocumentClick),document.body.removeEventListener("touchmove",this._handleDocumentTouchmove),this.menuEl?.removeEventListener("keydown",this._handleMenuKeydown),window.removeEventListener("resize",this._handleWindowResize)}_setupAccessibility(){if(!this.menuEl)return;this.menuEl.hasAttribute("role")||this.menuEl.setAttribute("role","menu"),[this.menuEl,...this.menuEl.querySelectorAll("menu")].forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","menu"),e.getAttribute("role")==="menu"&&e.querySelectorAll(":scope > li").forEach(i=>{if(i.classList.contains("divider")){i.hasAttribute("role")||i.setAttribute("role","separator");return}if(i.classList.contains("gap")){i.setAttribute("aria-hidden","true");return}if(i.classList.contains("label")||i.classList.contains("optgroup")){i.hasAttribute("role")||i.setAttribute("role","presentation");return}i.hasAttribute("role")||i.setAttribute("role","menuitem"),i.classList.contains("disabled")&&!i.hasAttribute("aria-disabled")&&i.setAttribute("aria-disabled","true")})})}_isSubmenuTriggerClick(t){if(!this.menuEl)return!1;let e=t.closest("li");if(!e||!this.menuEl.contains(e))return!1;let i=e.querySelector(":scope > menu");return i?!i.contains(t):!1}_setupSubmenus(){this.menuEl?.querySelectorAll("li").forEach(t=>{if(!t.querySelector(":scope > menu"))return;let e=t.querySelector(":scope > a, :scope > button, :scope > span")??t;e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","false")})}_toggleSubmenu(t){let e=!t.classList.contains("open");t.parentElement?.querySelectorAll(":scope > li.open").forEach(i=>{i!==t&&(i.classList.remove("open","submenu-start"),this._syncSubmenuAria(i,!1))}),t.classList.toggle("open",e),e&&this._alignSubmenu(t),this._syncSubmenuAria(t,e)}_syncSubmenuAria(t,e){(t.querySelector(":scope > a, :scope > button, :scope > span")??t).setAttribute("aria-expanded",e?"true":"false")}_alignSubmenu(t){let e=t.querySelector(":scope > menu");if(!e)return;t.classList.remove("submenu-start");let i=e.getBoundingClientRect();(i.left<8||i.right>window.innerWidth-8)&&t.classList.add("submenu-start")}_closeSubmenus(){this.menuEl?.querySelectorAll("li.open").forEach(t=>{t.classList.remove("open","submenu-start"),this._syncSubmenuAria(t,!1)})}_containingSubmenu(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li > menu");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_focusedRow(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_restoreInert(){this._originalInert===null?this.menuEl?.removeAttribute("inert"):this.menuEl?.setAttribute("inert",this._originalInert)}_focusRow(t){this.focusedIndex=Array.from(t.parentElement.children).indexOf(t),t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest",inline:"nearest"})}_resetMenuStyles(){this.menuEl.style.display="",this._resetMenuPositioningStyles(),this.menuEl.style.transform="",this.menuEl.style.opacity=""}_resetMenuPositioningStyles(){this.menuEl.style.width="",this.menuEl.style.height="",this.menuEl.style.left="",this.menuEl.style.top="",this.menuEl.style.transformOrigin=""}_moveMenuToElement(t=null){if(this.options.container){this.options.container.append(this.menuEl);return}if(t){t.contains(this.menuEl)||t.append(this.menuEl);return}this.el.after(this.menuEl)}_makeMenuFocusable(){this.menuEl&&(this.menuEl.popover="",this.menuEl.tabIndex=-1,this.menuEl.querySelectorAll(":scope li, :scope > hr").forEach(t=>{if(t instanceof HTMLHRElement||t.classList.contains("divider")||t.classList.contains("gap")||t.classList.contains("label")||t.classList.contains("optgroup")){t.setAttribute("tabindex","-1");return}t.getAttribute("tabindex")||t.setAttribute("tabindex","0")}))}_focusInitialItem(){if(!this.menuEl||!this.options.autoFocus)return;let t=Array.from(this.menuEl.children).find(e=>e instanceof HTMLElement&&e.tabIndex!==-1);t&&(this.focusedIndex=Array.from(this.menuEl.children).indexOf(t),t.focus({preventScroll:!0}))}_focusFocusedItem(){this.focusedIndex>=0&&this.focusedIndex<this.menuEl.children.length&&this.options.autoFocus&&(this.menuEl.children[this.focusedIndex].focus({preventScroll:!0}),this.menuEl.children[this.focusedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}_getMenuPosition(t){let e=this.el.getBoundingClientRect(),i=this.menuEl.getBoundingClientRect(),s=i.height,o=i.width,r=e.left-i.left,c=e.top-i.top,h={left:r,top:c,height:s,width:o},l=u.checkPossibleAlignments(this.el,t,h,this.options.coverTrigger?0:e.height),a="top",m=this.options.alignment;if(c+=this.options.coverTrigger?0:e.height,this.isScrollable=!1,l.top||(l.bottom?(a="bottom",this.options.coverTrigger||(c-=e.height)):(this.isScrollable=!0,s-=20,l.spaceOnTop>l.spaceOnBottom?(a="bottom",s+=l.spaceOnTop,c-=this.options.coverTrigger?l.spaceOnTop-20:l.spaceOnTop-20+e.height):s+=l.spaceOnBottom)),!l[m]){let p=m==="left"?"right":"left";l[p]?m=p:l.spaceOnLeft>l.spaceOnRight?(m="right",o+=l.spaceOnLeft,r-=l.spaceOnLeft):(m="left",o+=l.spaceOnRight)}return a==="bottom"&&(c=c-i.height+(this.options.coverTrigger?e.height:0)),m==="right"&&(r=r-i.width+e.width),{x:r,y:c,verticalAlignment:a,horizontalAlignment:m,height:s,width:o}}_schedule(t,e){let i=setTimeout(()=>{this._pendingTimers.delete(i),t()},e);this._pendingTimers.add(i)}_clearPendingTimers(){for(let t of this._pendingTimers)clearTimeout(t);return this._pendingTimers.clear(),++this._transition}_animateIn(){let t=this._transition,e=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this.menuEl.style.transition=`opacity ${e}ms ease, transform ${e}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),this._schedule(()=>{this._focusInitialItem(),t===this._transition&&typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},e)}_animateOut(){let t=this.options.outDuration;this.menuEl.style.transition=`opacity ${t}ms ease, transform ${t}ms ease`,this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this._resetMenuStyles(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_getClosestAncestor(t,e){let i=t.parentNode;for(;i!=null&&i!==document;){if(i.nodeType===Node.ELEMENT_NODE&&e(i))return i;i=i.parentNode??i.host}return null}_placeMenu(){let t=this._getClosestAncestor(this.menuEl,r=>!["HTML","BODY"].includes(r.tagName)&&getComputedStyle(r).overflow!=="visible");if(!t){let r=this.menuEl.offsetParent?this.menuEl.offsetParent:this.menuEl.parentNode;t=r.host??r}getComputedStyle(t).position==="static"&&(t.style.position="relative");let e=this.menuEl.getBoundingClientRect().width,i=this.el.getBoundingClientRect().width,s=this.options.constrainWidth&&i>=_t?i:Math.min(Gt,Math.max(_t,e));this.menuEl.style.width=s+"px";let o=this._getMenuPosition(t);this.menuEl.style.left=o.x+"px",this.menuEl.style.top=o.y+"px",this.menuEl.style.height=o.height+"px",this.menuEl.style.width=o.width+"px",this.menuEl.style.transformOrigin=`${o.horizontalAlignment==="left"?"0":"100%"} ${o.verticalAlignment==="top"?"0":"100%"}`}};H._menus=[];var O=H;var jt={i18n:{loading:"Loading results.",noResults:"No results.",results:d=>`${d} ${d===1?"result":"results"} available.`,selected:d=>`${d} ${d===1?"item":"items"} selected.`},data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,isMultiSelect:!1,onSearch:(d,n)=>{let t=d.toLocaleLowerCase(),e=n.options.data;n.setMenuItems(e.filter(i=>i.id.toString().toLocaleLowerCase().includes(t)||i.text?.toLocaleLowerCase().includes(t))),n.options.data=e},maxMenuHeight:"300px",allowUnsafeHTML:!1,selected:[]},I=class I extends _{constructor(t,e){super(t,e,I);this._handleInputBlur=()=>{this._pointerDown||(this.close(),this._resetAutocomplete())};this._handleInputKeyup=t=>{t.type==="keyup"&&(I._keydown=!1),this.count=0;let e=this.el.value.toLocaleLowerCase();t.key===u.keys.ENTER||t.key===u.keys.ARROW_UP||t.key===u.keys.ARROW_DOWN||t.key===u.keys.ESC||t.key==="Tab"||(this.oldVal!==e&&this.el.matches(":focus-visible")&&this.open(),this._inputChangeDetection(e))};this._handleInputFocus=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=t=>{!this.options.isMultiSelect&&this.selectedValues.length&&this.el.value!==(this.selectedValues[0].text||String(this.selectedValues[0].id))&&(this.selectedValues=[]),this.oldVal!==t&&(this._setStatusLoading(),this.options.onSearch(this.el.value,this)),!this.options.isMultiSelect&&this.el.value.length===0&&(this.selectedValues=[],this._triggerChanged()),this.oldVal=t};this._handleInputKeydown=t=>{if(I._keydown=!0,t.key===u.keys.ESC||t.key==="Tab"){this.close(),this._resetCurrentElementPosition();return}let e=this.container.querySelectorAll("li").length;if(t.key===u.keys.ENTER&&this.activeIndex>=0){let i=this.container.querySelectorAll("li")[this.activeIndex];i&&(this.selectOption(i.getAttribute("data-id")),t.preventDefault());return}(t.key===u.keys.ARROW_UP||t.key===u.keys.ARROW_DOWN)&&(t.preventDefault(),t.key===u.keys.ARROW_UP&&this.activeIndex>0&&this.activeIndex--,t.key===u.keys.ARROW_DOWN&&this.activeIndex<e-1&&this.activeIndex++,this._setActive(null),this.activeIndex>=0&&(this._setActive(this.container.querySelectorAll("li")[this.activeIndex]),this.container.children[this.activeIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})))};this._handleInputClick=()=>{this.open()};this._handleContainerPointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0))};this._handleContainerPointerUp=()=>{this._pointerDown=!1};this.open=()=>{let t=this.el.value.toLocaleLowerCase();this._resetAutocomplete(),t.length>=this.options.minLength&&(this.isOpen=!0,this._renderMenu(),this._announce(this.menuItems.length?this.options.i18n.results(this.menuItems.length):this.options.i18n.noResults)),this.menu.isOpen?this.menu.recalculateDimensions():(this._openTimer!==void 0&&clearTimeout(this._openTimer),this._openTimer=setTimeout(()=>{this._openTimer=void 0,this.menu.open()},0))};this.close=()=>{this._announcer&&(this._announcer.textContent=""),this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this.isOpen=!1,this.menu.close()};this.el.Expressive_Autocomplete=this,this.options={...I.defaults,...e,i18n:{...I.defaults.i18n,...e?.i18n}},this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="",this.selectedValues=this.options.selected.map(i=>this.options.data.find(s=>s.id===i)??{id:i}),this.menuItems=this.options.data||[],this.$active=null,this._pointerDown=!1,this._setupMenu(),this._setupEventHandlers()}_setActive(t){this.$active?.classList.remove("active"),this.$active=t,t?(t.classList.add("active"),this.el.setAttribute("aria-activedescendant",t.id)):this.el.removeAttribute("aria-activedescendant")}static get defaults(){return jt}static init(t,e={}){return super.init(t,e,I)}static getInstance(t){return t.Expressive_Autocomplete}static _loadingIndicator(){if(!I._loadingTemplate){let t=document.createElement("template");t.innerHTML=`<div style="height:100%;width:50px;"><svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
|
|
2
2
|
<circle fill="#888c" stroke="none" cx="6" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1"/></circle>
|
|
3
3
|
<circle fill="#888c" stroke="none" cx="26" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.2"/></circle>
|
|
4
4
|
<circle fill="#888c" stroke="none" cx="46" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3"/></circle>
|
|
5
|
-
</svg></div>`,w._loadingTemplate=t.content.firstElementChild}return w._loadingTemplate.cloneNode(!0)}destroy(){this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._removeEventHandlers(),this._removeMenu(),this.el.Expressive_Autocomplete=void 0}_setupEventHandlers(){this.el.addEventListener("blur",this._handleInputBlur),this.el.addEventListener("keyup",this._handleInputKeyup),this.el.addEventListener("focus",this._handleInputFocus),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("click",this._handleInputClick),this.container.addEventListener("pointerdown",this._handleContainerPointerDown),this.container.addEventListener("pointerup",this._handleContainerPointerUp),this.container.addEventListener("pointercancel",this._handleContainerPointerUp)}_removeEventHandlers(){this.el.removeEventListener("blur",this._handleInputBlur),this.el.removeEventListener("keyup",this._handleInputKeyup),this.el.removeEventListener("focus",this._handleInputFocus),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("click",this._handleInputClick),this.container.removeEventListener("pointerdown",this._handleContainerPointerDown),this.container.removeEventListener("pointerup",this._handleContainerPointerUp),this.container.removeEventListener("pointercancel",this._handleContainerPointerUp)}_setupMenu(){this.container=document.createElement("menu"),this.container.style.maxHeight=this.options.maxMenuHeight,this.container.id=`autocomplete-options-${c.guid()}`,this.container.classList.add("autocomplete-content"),this.container.ariaExpanded="true",this.container.setAttribute("role","listbox"),this.el.setAttribute("role","combobox"),this.el.setAttribute("aria-autocomplete","list"),this.el.setAttribute("aria-controls",this.container.id),this.el.setAttribute("data-target",this.container.id),this.menuItems.forEach(n=>{let a=this._createMenuItem(n);this.container.append(a)}),this.el.parentElement.appendChild(this.container);let t={...w.defaults.menuOptions,...this.options.menuOptions},e=t.onItemClick;t.onItemClick=n=>{if(!n)return;let a=n.getAttribute("data-id");this.selectOption(a),typeof e=="function"&&e.call(this.menu,n)},this.menu=S.init(this.el,t);let i=this.el.parentElement.querySelector("label");if(i&&this.el.after(i),this.el.removeEventListener("click",this.menu._handleClick),!this.options.isMultiSelect&&this.options.selected.length!==0){let n=this.menuItems.filter(a=>a.id===this.selectedValues[0].id);this.el.value=n[0].text}this.el.value&&this.selectOption(this.el.value);let s=document.createElement("div");s.classList.add("status-info"),s.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(s),this._updateSelectedInfo()}_removeMenu(){this.container.ariaExpanded="false",this.container.parentNode.removeChild(this.container)}_resetCurrentElementPosition(){this.activeIndex=-1,this._setActive(null)}_resetAutocomplete(){this.container.replaceChildren(),this._resetCurrentElementPosition(),this.oldVal=null,this.isOpen=!1,this._pointerDown=!1}_highlightPartialText(t,e){let i=e.toLocaleLowerCase().indexOf(""+t.toLocaleLowerCase()),s=i+t.length-1;return i==-1||s==-1?[e,"",""]:[e.slice(0,i),e.slice(i,s+1),e.slice(s+1)]}_createMenuItem(t){let e=document.createElement("li");e.id=`autocomplete-option-${c.guid()}`,e.setAttribute("role","option");let i=this.selectedValues.some(r=>r.id===t.id);if(e.setAttribute("aria-selected",i?"true":"false"),e.setAttribute("data-id",t.id),e.setAttribute("style","display:grid; grid-auto-flow: column; user-select: none; align-items: center;"),e.tabIndex=0,this.options.isMultiSelect){let r=document.createElement("div");r.classList.add("item-selection"),r.style.textAlign="center";let u=document.createElement("input");u.type="checkbox",u.checked=i;let v=document.createElement("span");v.style.paddingLeft="21px",r.append(u,v),e.appendChild(r)}if(t.image){let r=document.createElement("img");r.classList.add("circle"),r.src=t.image,e.appendChild(r)}let s=this.el.value.toLocaleLowerCase(),n=this._highlightPartialText(s,(t.text||t.id).toString()),a=document.createElement("div");if(a.setAttribute("style","line-height:1.2;font-weight:500;"),this.options.allowUnsafeHTML)a.innerHTML=n[0]+'<span class="highlight">'+n[1]+"</span>"+n[2];else if(a.appendChild(document.createTextNode(n[0])),n[1]){let r=document.createElement("span");r.textContent=n[1],r.classList.add("highlight"),a.appendChild(r),a.appendChild(document.createTextNode(n[2]))}let h=document.createElement("div");if(h.classList.add("item-text"),h.setAttribute("style","padding:5px;overflow:hidden;"),e.appendChild(h),e.querySelector(".item-text").appendChild(a),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let r=document.createElement("small");r.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),r.innerText=t.description,e.querySelector(".item-text").appendChild(r)}let l=()=>this.options.isMultiSelect?t.image?"40px min-content auto":"40px auto":t.image?"min-content auto":"auto";return e.style.gridTemplateColumns=l(),e}_renderMenu(){this._resetAutocomplete(),this.menuItems.length===0&&(this.menuItems=this.selectedValues);for(let t=0;t<this.menuItems.length;t++){let e=this._createMenuItem(this.menuItems[t]);this.container.append(e)}}_setStatusLoading(){let t=this.el.parentElement.querySelector(".status-info");t&&t.replaceChildren(w._loadingIndicator())}_updateSelectedInfo(){let t=this.el.parentElement.querySelector(".status-info");t&&(this.options.isMultiSelect?t.textContent=this.selectedValues.length.toString():t.replaceChildren())}_refreshInputText(){if(this.selectedValues.length===1){let t=this.selectedValues[0];this.el.value=t.text||t.id}}_triggerChanged(){this.el.dispatchEvent(new Event("change")),typeof this.options.onAutocomplete=="function"&&this.options.onAutocomplete.call(this,this.selectedValues)}setMenuItems(t,e=null,i=!0){this.menuItems=t,this.options.data=t,e&&(this.selectedValues=this.menuItems.filter(s=>e.indexOf(s.id)!==-1)),this.options.isMultiSelect?this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._triggerChanged()}selectOption(t){let e=this.menuItems.find(i=>i.id==t);e&&(this.options.isMultiSelect?(this.selectedValues.filter(i=>i.id===e.id).length>=1?this.selectedValues=this.selectedValues.filter(i=>i.id!==e.id):this.selectedValues.push(e),this._renderMenu(),this.el.focus()):(this.selectedValues=[e],this._refreshInputText(),this._resetAutocomplete(),this.close()),this._updateSelectedInfo(),this._triggerChanged())}};w._loadingTemplate=null;var B=w;var Qt={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-symbols",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,allowUserInput:!1,i18n:{remove:"Remove"},onChipAdd:null,onChipSelect:null,onChipDelete:null},x=class x extends E{constructor(t,e){super(t,e,x);this._handleChipClick=t=>{let e=t.target.closest(".chip"),i=!!t.target.closest(".close");if(e){let s=this._chips.indexOf(e);if(s<0)return;i?(this.deleteChip(s),this._input.focus()):this.selectChip(s)}else this._input.focus()};this._handleInputFocus=()=>{this.el.classList.add("focus")};this._handleInputBlur=()=>{this.el.classList.remove("focus")};this._handleInputKeydown=t=>{if(x._keydown=!0,t.key===c.keys.ENTER){if(this.hasAutocomplete&&this.autocomplete&&this.autocomplete.isOpen)return;t.preventDefault(),(!this.hasAutocomplete||this.hasAutocomplete&&!this.options.autocompleteOnly)&&this.addChip({id:this._input.value}),this._input.value=""}else(t.key===c.keys.BACKSPACE||t.key===c.keys.ARROW_LEFT)&&this._input.value===""&&this.chipsData.length&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))};this.el.Expressive_Chips=this,this.options={...x.defaults,...e},e?.i18n&&(this.options.i18n={...x.defaults.i18n,...e.i18n}),this.el.classList.add("chips"),this.chipsData=[],this._chips=[],this.options.data.length&&(this.chipsData=this.options.data,this._renderChips()),this.options.allowUserInput&&(this.el.classList.add("field"),this._setupInput(),this._setupEventHandlers(),this.el.append(this._input)),this._setupLabel()}_setSelected(t){this._selectedChip?.classList.remove("selected"),this._selectedChip=t,t?.classList.add("selected")}static get defaults(){return Qt}static init(t,e={}){return super.init(t,e,x)}static getInstance(t){return t.Expressive_Chips}getData(){return this.chipsData}destroy(){this.options.allowUserInput&&this._removeEventHandlers(),this._chips.forEach(t=>t.remove()),this._chips=[],this.el.Expressive_Chips=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleChipClick),document.addEventListener("keydown",x._handleChipsKeydown),document.addEventListener("keyup",x._handleChipsKeyup),this.el.addEventListener("blur",x._handleChipsBlur,!0),this._input.addEventListener("focus",this._handleInputFocus),this._input.addEventListener("blur",this._handleInputBlur),this._input.addEventListener("keydown",this._handleInputKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleChipClick),document.removeEventListener("keydown",x._handleChipsKeydown),document.removeEventListener("keyup",x._handleChipsKeyup),this.el.removeEventListener("blur",x._handleChipsBlur,!0),this._input.removeEventListener("focus",this._handleInputFocus),this._input.removeEventListener("blur",this._handleInputBlur),this._input.removeEventListener("keydown",this._handleInputKeydown)}static _handleChipsKeydown(t){x._keydown=!0;let e=t.target.closest(".chips"),i=t.target&&e,s=t.target.tagName;if(s==="INPUT"||s==="TEXTAREA"||!i)return;let n=e.Expressive_Chips;if(n){if(t.key===c.keys.BACKSPACE||t.key===c.keys.DELETE){t.preventDefault();let a=n.chipsData.length;if(n._selectedChip){let h=n._chips.indexOf(n._selectedChip);n.deleteChip(h),n._setSelected(null),a=Math.max(h-1,0)}n.chipsData.length?n.selectChip(a):n._input.focus()}else if(t.key===c.keys.ARROW_LEFT){if(n._selectedChip){let a=n._chips.indexOf(n._selectedChip)-1;if(a<0)return;n.selectChip(a)}}else if(t.key===c.keys.ARROW_RIGHT&&n._selectedChip){let a=n._chips.indexOf(n._selectedChip)+1;a>=n.chipsData.length?(n._setSelected(null),n._input.focus()):n.selectChip(a)}}}static _handleChipsKeyup(){x._keydown=!1}static _handleChipsBlur(t){if(!x._keydown&&document.hidden){let i=t.target.closest(".chips")?.Expressive_Chips;i&&i._setSelected(null)}}_renderChip(t){if(!t.id)return;let e=t.text||t.id,i=document.createElement("span");if(i.classList.add("chip"),i.innerText=e,t.image){let s=document.createElement("img");s.setAttribute("src",t.image),i.insertBefore(s,i.firstChild)}if(this.options.allowUserInput){let s=document.createElement("button");s.type="button",s.classList.add("close"),s.setAttribute("aria-label",`${this.options.i18n.remove} ${e}`);let n=document.createElement("span");n.classList.add(this.options.closeIconClass),n.setAttribute("aria-hidden","true"),n.innerText="close",s.appendChild(n),i.appendChild(s)}return i}_renderChips(){this._chips=[];for(let t=0;t<this.chipsData.length;t++){let e=this._renderChip(this.chipsData[t]);this.el.appendChild(e),this._chips.push(e)}}_setupAutocomplete(){this.options.autocompleteOptions.onAutocomplete=t=>{t.length>0&&this.addChip({id:t[0].id,text:t[0].text,image:t[0].image}),this._input.value="",this._input.focus()},this.autocomplete=B.init(this._input,this.options.autocompleteOptions)}_setupInput(){this._input=this.el.querySelector("input"),this._input||(this._input=document.createElement("input"),this.el.append(this._input)),this._input.classList.add("input"),this.hasAutocomplete=Object.keys(this.options.autocompleteOptions).length>0,this.hasAutocomplete&&this._setupAutocomplete(),this._setPlaceholder(),this._input.getAttribute("id")||this._input.setAttribute("id",c.guid())}_setupLabel(){this._label=this.el.querySelector("label"),this._label&&this._input&&this._label.setAttribute("for",this._input.getAttribute("id"))}_setPlaceholder(){this.chipsData!==void 0&&!this.chipsData.length&&this.options.placeholder?this._input.placeholder=this.options.placeholder:(this.chipsData===void 0||this.chipsData.length)&&this.options.secondaryPlaceholder&&(this._input.placeholder=this.options.secondaryPlaceholder)}_isValidAndNotExist(t){let e=!!t.id,i=!this.chipsData.some(s=>s.id==t.id);return e&&i}addChip(t){if(!this._isValidAndNotExist(t)||this.chipsData.length>=this.options.limit)return;let e=this._renderChip(t);this._chips.push(e),this.chipsData.push(t),this._input.before(e),this._setPlaceholder(),typeof this.options.onChipAdd=="function"&&this.options.onChipAdd(this.el,e)}deleteChip(t){let e=this._chips[t];e&&(this._selectedChip===e&&this._setSelected(null),e.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder(),typeof this.options.onChipDelete=="function"&&this.options.onChipDelete(this.el,e))}selectChip(t){let e=this._chips[t];e&&(this._setSelected(e),e.querySelector(".close")?.focus(),typeof this.options.onChipSelect=="function"&&this.options.onChipSelect(this.el,e))}static Init(){c.onDocumentReady(()=>{document.querySelectorAll(".chips").forEach(e=>{e.addEventListener("click",i=>{if(!e.Expressive_Chips&&i.target.closest(".close")){let s=i.target.closest(".chip");s&&s.remove()}})})})}};x._keydown=!1;var N=x;var Jt={},F=class d extends E{constructor(t,e){super(t,e,d);this._handleRangeChange=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0,this.el.classList.add("active"),this._clampDual(),this._sync(),this.thumb.classList.add("active")))};this._handleRangeInputOrMove=()=>{this._pointerDown&&(this._clampDual(),this._sync(),this.thumb.classList.add("active"))};this._handleRangePointerUp=t=>{t.isPrimary&&(this._pointerDown=!1,this.el.classList.remove("active"))};this._handleRangeRelease=()=>{this._pointerDown||this.thumb.classList.remove("active")};this.el.Expressive_Slider=this,this.options={...d.defaults,...e},this._pointerDown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers()}static get defaults(){return Jt}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Slider}destroy(){this._removeEventHandlers(),this._removeThumb(),this.el.Expressive_Slider=void 0}_setupEventHandlers(){this.el.addEventListener("change",this._handleRangeChange),this.el.addEventListener("pointerdown",this._handleRangePointerDown),this.el.addEventListener("input",this._handleRangeInputOrMove),this.el.addEventListener("pointermove",this._handleRangeInputOrMove,{passive:!0}),this.el.addEventListener("pointerup",this._handleRangePointerUp),this.el.addEventListener("pointercancel",this._handleRangePointerUp),this.el.addEventListener("blur",this._handleRangeRelease),this.el.addEventListener("mouseout",this._handleRangeRelease)}_removeEventHandlers(){this.el.removeEventListener("change",this._handleRangeChange),this.el.removeEventListener("pointerdown",this._handleRangePointerDown),this.el.removeEventListener("input",this._handleRangeInputOrMove),this.el.removeEventListener("pointermove",this._handleRangeInputOrMove),this.el.removeEventListener("pointerup",this._handleRangePointerUp),this.el.removeEventListener("pointercancel",this._handleRangePointerUp),this.el.removeEventListener("blur",this._handleRangeRelease),this.el.removeEventListener("mouseout",this._handleRangeRelease)}_setupThumb(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),this.thumb.classList.add("thumb"),this.value.classList.add("value"),this.thumb.append(this.value),this.el.after(this.thumb)}_removeThumb(){this.thumb.remove()}_isVertical(){return!!this.el.closest(".vertical")}_host(){return this.el.closest(".slider, .range, .range-field, label")}_clampDual(){let e=this._host()?.querySelectorAll('input[type="range"]');if(!e||e.length!==2)return;let i=e[0],s=e[1];this.el===i&&+i.value>+s.value&&(i.value=s.value),this.el===s&&+s.value<+i.value&&(s.value=i.value)}_fraction(t){let e=parseFloat(t.max)||100,i=parseFloat(t.min)||0,s=parseFloat(t.value)||0;return e===i?0:(s-i)/(e-i)}_sync(){let t=this._fraction(this.el),e=`${t*100}%`,i=this.el.offsetLeft,s=this.el.offsetTop,n=this.el.offsetWidth,a=this.el.offsetHeight;this.el.style.setProperty("--md-comp-slider-active-fraction",e);let h=this._host(),l=h?.querySelectorAll('input[type="range"]');if(h&&l&&l.length===2){let r=Array.from(l).map(u=>this._fraction(u));h.style.setProperty("--md-comp-slider-start-fraction",`${Math.min(...r)*100}%`),h.style.setProperty("--md-comp-slider-end-fraction",`${Math.max(...r)*100}%`)}if(h?.classList.contains("stops")){let r=parseFloat(this.el.max)||100,u=parseFloat(this.el.min)||0,v=parseFloat(this.el.step);if(v>0&&Number.isFinite(v)){let m=Math.round((r-u)/v)+1;h.style.setProperty("--md-comp-slider-stop-count",String(Math.max(2,m)))}}this.value.textContent=this.el.value,this._isVertical()?(this.thumb.style.left=`${i+n/2}px`,this.thumb.style.top=`${s+(1-t)*a}px`):(this.thumb.style.left=`${i+t*n}px`,this.thumb.style.top=`${s}px`)}static Init(){c.onDocumentReady(()=>{d.init(document.querySelectorAll("input[type=range]"),{})})}};var L=class L{static Init(){c.onDocumentReady(()=>{document.addEventListener("pointerdown",L._onPointerDown,{passive:!0}),document.addEventListener("pointerup",L._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",L._onPointerCancel,{passive:!0})})}static _onPointerDown(o){if(!L._isPrimaryPress(o)){L._down=null;return}let t=L._backdropDialog(o);if(!t||!L._lightDismissible(t)||!L._outside(o,t)){L._down=null;return}L._down={dialog:t,pointerId:o.pointerId}}static _onPointerUp(o){let t=L._down;L._down=null,!(!t||t.pointerId!==o.pointerId)&&o.isPrimary&&(!t.dialog.isConnected||!t.dialog.open||L._lightDismissible(t.dialog)&&L._backdropDialog(o)===t.dialog&&L._outside(o,t.dialog)&&t.dialog.close())}static _onPointerCancel(){L._down=null}static _backdropDialog(o){let t=o.target;return!(t instanceof HTMLDialogElement)||!t.open?null:t}static _outside(o,t){let e=t.getBoundingClientRect();return o.clientX<e.left||o.clientX>e.right||o.clientY<e.top||o.clientY>e.bottom}static _isPrimaryPress(o){return o.isPrimary?o.pointerType!=="mouse"||o.button===0:!1}static _lightDismissible(o){let t=L._closedBy(o);return!(t==="none"||t==="closerequest"||t==="any"&&"closedBy"in HTMLDialogElement.prototype)}static _closedBy(o){let t=o.getAttribute("closedby");return t==="any"||t==="closerequest"||t==="none"?t:null}};L._down=null;var $=L;var yt=96,Lt=.5,te=4;function at(d){let o=l=>d.axis==="x"?l.clientX:l.clientY,t=null,e=l=>{if(!(l instanceof Element))return null;let r=l.closest(d.selector);return r instanceof HTMLDialogElement?r:null},i=l=>{l.style.transition="",l.style.setProperty(d.property,"0px")},s=l=>{if(d.onPress?.(),!l.isPrimary||l.pointerType==="mouse"&&l.button!==0)return;let r=e(l.target);if(!r?.open){t=null;return}if(!d.inHandle(l,r)){t=null;return}r.style.transition="none",t={dialog:r,pointerId:l.pointerId,direction:d.direction(r),start:o(l),last:o(l),lastT:Date.now(),shift:0}},n=l=>{if(!t||t.pointerId!==l.pointerId)return;let r=o(l)-t.start;t.shift=t.direction===1?Math.max(0,r):Math.min(0,r),t.last=o(l),t.lastT=Date.now(),t.dialog.style.setProperty(d.property,`${t.shift}px`)},a=l=>{let r=t;if(!r||r.pointerId!==l.pointerId)return;t=null,r.dialog.style.transition="";let u=Math.max(1,Date.now()-r.lastT),v=(o(l)-r.last)/u;d.onRelease?.(Math.abs(r.shift)>te),(r.direction===1?r.shift>yt||v>Lt:r.shift<-yt||v<-Lt)&&r.dialog.open&&r.dialog.close(),r.dialog.style.setProperty(d.property,"0px")},h=()=>{d.onRelease?.(!1);let l=t;t=null,l&&i(l.dialog)};c.onDocumentReady(()=>{document.addEventListener("pointerdown",s,{passive:!0}),document.addEventListener("pointermove",n,{passive:!0}),document.addEventListener("pointerup",a,{passive:!0}),document.addEventListener("pointercancel",h,{passive:!0})})}var Tt="dialog.bottom-sheet, dialog.bottom",V=class V{static Init(){at({selector:Tt,axis:"y",property:"--md-comp-bottom-sheet-shift",direction:()=>1,inHandle:(o,t)=>{let e=o.target;if(e instanceof Element&&e.closest(".handle"))return!0;let i=t.getBoundingClientRect();return o.clientY>=i.top&&o.clientY<=i.top+48},onPress:()=>{V._dragged=!1},onRelease:o=>{V._dragged=o}}),c.onDocumentReady(()=>{document.addEventListener("click",V._onClick)})}static _onClick(o){let t=o.target;if(!(t instanceof Element))return;let e=t.closest(".handle, .drag-handle");if(!(e instanceof HTMLButtonElement)||o.detail!==0&&V._dragged)return;let i=e.closest(Tt);i instanceof HTMLDialogElement&&i.open&&i.close()}};V._dragged=!1;var K=V;var Ct=d=>d.classList.contains("left")||d.classList.contains("left-sheet")||d.classList.contains("start"),z=class{static Init(){at({selector:"dialog.side-sheet, dialog.right, dialog.right-sheet, dialog.left, dialog.left-sheet",axis:"x",property:"--md-comp-side-sheet-shift",direction:o=>Ct(o)?-1:1,inHandle:(o,t)=>{let e=o.target;if(e instanceof Element&&e.closest("header"))return!0;let i=t.getBoundingClientRect();return Ct(t)?o.clientX>=i.right-24&&o.clientX<=i.right:o.clientX>=i.left&&o.clientX<=i.left+24}})}};var U=class d{static validateField(o){if(!o){console.error("No text field element found");return}let t=o.getAttribute("data-length")!==null,e=parseInt(o.getAttribute("data-length")),i=o.value.length;i===0&&o.validity.badInput===!1&&!o.required&&o.classList.contains("validate")?o.classList.remove("invalid"):o.classList.contains("validate")&&(o.validity.valid&&t&&i<=e||o.validity.valid&&!t?o.classList.remove("invalid"):o.classList.add("invalid"))}static textareaAutoResize(o){let t=o;if(!t)return;t.hasAttribute("original-height")||t.setAttribute("original-height",t.getBoundingClientRect().height.toString());let e=parseInt(t.getAttribute("original-height"));if(isNaN(e))return;t.style.height="auto";let i=t.offsetHeight-t.clientHeight,s=t.scrollHeight+i;t.style.height=Math.max(e,s)+"px"}static Init(){c.onDocumentReady(()=>{document.addEventListener("change",o=>{let t=o.target;t instanceof HTMLInputElement&&d.validateField(t)}),document.addEventListener("keyup",o=>{let t=o.target;t instanceof HTMLInputElement&&["radio","checkbox"].includes(t.type)&&o.key===c.keys.TAB&&(t.classList.add("tabbed"),t.addEventListener("blur",()=>t.classList.remove("tabbed"),{once:!0}))}),document.querySelectorAll(".expressive-textarea").forEach(o=>{d.InitTextarea(o)}),document.querySelectorAll('.file-field input[type="file"]').forEach(o=>{d.InitFileInputPath(o)})})}static InitTextarea(o){o.setAttribute("original-height",o.getBoundingClientRect().height.toString()),d.textareaAutoResize(o),o.addEventListener("input",t=>d.textareaAutoResize(t.target))}static InitFileInputPath(o){o.addEventListener("change",()=>{let e=o.closest(".file-field").querySelector("input.file-path"),i=o.files,s=[];for(let n=0;n<i.length;n++)s.push(i[n].name);e.value=s.join(", "),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))})}};var ee={},Y=class d extends E{constructor(t,e){super(t,e,d);this._observer=null;this._sentinel=null;this._input=null;this._view=null;this._suppressSearchOpen=!1;this._onIntersect=t=>{let e=t[0];e&&this.el.classList.toggle("collapsed",!e.isIntersecting)};this._onSearchViewClose=()=>{this._suppressSearchOpen=!0};this._onSearchFocus=()=>{if(this._view){if(this._suppressSearchOpen){this._suppressSearchOpen=!1;return}if(this._view instanceof HTMLDialogElement){this._view.open||this._view.showModal();return}this._view.hidden=!1,this._input?.setAttribute("aria-expanded","true")}};this.el.Expressive_AppBar=this,this.options={...d.defaults,...e},this._setupCollapse(),this._setupSearch()}static get defaults(){return ee}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_AppBar}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._input?.removeEventListener("focus",this._onSearchFocus),this._view?.removeEventListener("close",this._onSearchViewClose),this.el.classList.remove("collapsed"),this.el.Expressive_AppBar=void 0}_setupCollapse(){!this.el.classList.contains("medium")&&!this.el.classList.contains("large")||typeof IntersectionObserver>"u"||(this._sentinel=document.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="display:block;width:100%;height:1px;margin-top:-1px;pointer-events:none;visibility:hidden",this.el.insertAdjacentElement("beforebegin",this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel))}_setupSearch(){if(this._input=this.el.querySelector('input[type="search"]'),!this._input)return;let t=this._input.getAttribute("aria-controls");t&&(this._view=document.getElementById(t)),this._view||(this._view=this.el.querySelector(".search-view")),this._view&&(this._input.addEventListener("focus",this._onSearchFocus),this._view instanceof HTMLDialogElement&&this._view.addEventListener("close",this._onSearchViewClose))}};var ie={direction:"top",hoverEnabled:!0,toolbarEnabled:!1},X=class d extends E{constructor(t,e){super(t,e,d);this.open=()=>{this.isOpen||(this.isOpen=!0,this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{this.isOpen&&(this.isOpen=!1,this.el.classList.remove("active"),this._anchor?.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._handleDocumentClick),document.removeEventListener("keydown",this._handleDocumentKeydown))};this._handleFABClick=t=>{t.stopPropagation(),this._toggle()};this._handleAnchorKeydown=t=>{(t.key===c.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{t.key===c.keys.ESC&&this.close()};this._handleDocumentClick=t=>{let e=t.target;!(e instanceof Node)||this.el.contains(e)||this.close()};this.el.Expressive_FloatingActionButton=this;let i=this._directionFromClass(),s=t.classList.contains("toolbar")||e.toolbarEnabled===!0,n=t.classList.contains("click-to-toggle")||e.hoverEnabled===!1;this.options={...d.defaults,...e,direction:e.direction??i??d.defaults.direction,hoverEnabled:!n,toolbarEnabled:s},this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this.el.classList.add(`direction-${this.options.direction}`),n&&this.el.classList.add("click-to-toggle"),s&&this.el.classList.add("toolbar"),this._anchor&&(this._anchor.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&this._anchor.tabIndex<0&&(this._anchor.tabIndex=0)),this._setupEventHandlers()}static get defaults(){return ie}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FloatingActionButton}destroy(){this.close(),this._removeEventHandlers(),this.el.Expressive_FloatingActionButton=void 0}_directionFromClass(){let e=[...this.el.classList].find(i=>i.startsWith("direction-"))?.slice(10);return e==="top"||e==="right"||e==="bottom"||e==="left"?e:null}_setupEventHandlers(){this.el.addEventListener("click",this._handleFABClick),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&this._anchor.addEventListener("keydown",this._handleAnchorKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleFABClick),this._anchor?.removeEventListener("keydown",this._handleAnchorKeydown)}_toggle(){this.isOpen?this.close():this.open()}};var se={},ne=new Set(["single","multiple"]),xt="button-group-pressed",oe=.15,G=class d extends E{constructor(t,e={}){super(t,e,d);this._pressedStyles=new Map;this._releaseStyles=new Map;this._releaseTimer=null;this._originalPressed=new Map;this._activeItem=null;this._handleClick=t=>{if(!this._selectionMode)return;let e=this._itemFromEvent(t);if(!(e instanceof HTMLButtonElement)||this._isDisabled(e))return;this._rememberPressed(e);let i=e.getAttribute("aria-pressed")!=="true",s=this._toggleItems.filter(n=>n.getAttribute("aria-pressed")==="true").length;!i&&this.el.hasAttribute("data-selection-required")&&s===1||(this._selectionMode==="single"&&i&&this._toggleItems.forEach(n=>{this._rememberPressed(n),n.setAttribute("aria-pressed","false")}),e.setAttribute("aria-pressed",i?"true":"false"))};this._handlePointerDown=t=>{if(t.button!==0)return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyDown=t=>{if(t.repeat||t.key!==" "&&t.key!=="Enter")return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyUp=t=>{(t.key===" "||t.key==="Enter")&&this._resetPress()};this._handleFocusOut=t=>{t.target===this._activeItem&&this._resetPress()};this._resetPress=()=>{if(this._activeItem?.classList.remove(xt),this._activeItem=null,!!this._pressedStyles.size){this._finishRelease(),this._releaseStyles=new Map(this._pressedStyles);for(let[t,e]of this._releaseStyles)t.style.width=`${e.baseWidth}px`;this._pressedStyles.clear(),this._releaseTimer=window.setTimeout(this._finishRelease,200)}};this._finishRelease=()=>{this._releaseTimer!==null&&window.clearTimeout(this._releaseTimer),this._releaseTimer=null;for(let[t,e]of this._releaseStyles)t.style.width=e.width;this._releaseStyles.clear()};this.el.Expressive_ButtonGroup=this,this.options={...d.defaults,...e},this._selectionMode&&(this._normalizeSelection(),this.el.addEventListener("click",this._handleClick,!0)),this.el.addEventListener("pointerdown",this._handlePointerDown),this.el.addEventListener("keydown",this._handleKeyDown),this.el.addEventListener("focusout",this._handleFocusOut),document.addEventListener("pointerup",this._resetPress),document.addEventListener("pointercancel",this._resetPress),document.addEventListener("keyup",this._handleKeyUp),window.addEventListener("blur",this._resetPress)}static get defaults(){return se}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ButtonGroup}destroy(){this._resetPress(),this._finishRelease(),this.el.removeEventListener("click",this._handleClick,!0),this.el.removeEventListener("pointerdown",this._handlePointerDown),this.el.removeEventListener("keydown",this._handleKeyDown),this.el.removeEventListener("focusout",this._handleFocusOut),document.removeEventListener("pointerup",this._resetPress),document.removeEventListener("pointercancel",this._resetPress),document.removeEventListener("keyup",this._handleKeyUp),window.removeEventListener("blur",this._resetPress);for(let[t,e]of this._originalPressed)e===null?t.removeAttribute("aria-pressed"):t.setAttribute("aria-pressed",e);this._originalPressed.clear(),this.el.Expressive_ButtonGroup=void 0}get _selectionMode(){let t=this.el.dataset.selection;return ne.has(t)?t:null}get _items(){return Array.from(this.el.children).filter(t=>t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement&&t.classList.contains("button"))}get _toggleItems(){return this._items.filter(t=>t instanceof HTMLButtonElement)}_normalizeSelection(){let t=this._toggleItems;t.forEach(e=>{this._rememberPressed(e),["true","false"].includes(e.getAttribute("aria-pressed")||"")||e.setAttribute("aria-pressed","false")}),this._selectionMode==="single"&&t.filter(i=>i.getAttribute("aria-pressed")==="true").slice(1).forEach(i=>i.setAttribute("aria-pressed","false")),this.el.hasAttribute("data-selection-required")&&!t.some(e=>e.getAttribute("aria-pressed")==="true")&&t.find(e=>!this._isDisabled(e))?.setAttribute("aria-pressed","true")}_itemFromEvent(t){if(!(t.target instanceof Element))return null;let e=t.target.closest("button, a.button");return e instanceof HTMLElement&&e.parentElement===this.el?e:null}_isDisabled(t){return t instanceof HTMLButtonElement&&t.disabled||t.getAttribute("aria-disabled")==="true"||t.classList.contains("disabled")}_rememberPressed(t){this._originalPressed.has(t)||this._originalPressed.set(t,t.getAttribute("aria-pressed"))}_startPress(t){if(this._activeItem)return;this._finishRelease();let e=this._items,i=e.indexOf(t);if(i<0||(this._activeItem=t,t.classList.add(xt),this.el.classList.contains("connected")||e.length<2))return;let s=e.map(m=>m.getBoundingClientRect()),n=s[i].width;if(n<=0)return;let a=Number.parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-button-group-pressed-item-width-multiplier")),h=Number.isFinite(a)?a:.15,l=n*h,r=[i-1,i+1].filter(m=>m>=0&&m<e.length),u=new Map;if(r.length===1){let m=r[0];u.set(m,Math.min(l,this._compressionCapacity(e[m],s[m])))}else{let m=l/2;for(let b of r)u.set(b,Math.min(m,this._compressionCapacity(e[b],s[b])));let _=l-[...u.values()].reduce((b,I)=>b+I,0);for(let b of r){if(_<=0)break;let I=this._compressionCapacity(e[b],s[b])-u.get(b),H=Math.min(_,I);u.set(b,u.get(b)+H),_-=H}}let v=[...u.values()].reduce((m,_)=>m+_,0);v<=0||(e.forEach((m,_)=>{this._pressedStyles.set(m,{width:m.style.width,baseWidth:s[_].width}),m.style.width=`${s[_].width}px`}),this.el.offsetWidth,e.forEach((m,_)=>{let b=_===i?v:-(u.get(_)||0);m.style.width=`${s[_].width+b}px`}))}_compressionCapacity(t,e){let i=t.classList.contains("icon-button")?e.width*(1-oe):e.height;return Math.max(0,e.width-i)}};var ae={duration:200,fullWidth:!1,indicators:!1,noWrap:!1,interval:0,height:null,onCycleTo:null,i18n:{carousel:"Carousel",item:"Item",of:"of",indicators:"Slides",slide:"Slide"}},T=class T extends E{constructor(t,e){super(t,e,T);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._trackRaf=null;this._started=!1;this._vertical=!1;this._resizeObserver=null;this._usesWindowResize=!1;this._dragPointerId=null;this._dragStartX=0;this._dragStartY=0;this._dragStartScroll=0;this._suppressClick=!1;this._suppressClickTimeout=null;this._generatedContainerRole=!1;this._generatedContainerLabel=!1;this._generatedContainerDescription=!1;this._generatedWideLayout=!1;this._generatedFixedHeight=!1;this._authoredInlineHeight=null;this._autoAdvanceTimer=null;this._autoAdvances=!1;this._autoPaused=!1;this._hovered=!1;this._focused=!1;this._generatedItemTabIndexes=new Set;this._generatedItemLabels=new Set;this._generatedItemDescriptions=new Set;this._generatedItemSizes=new Set;this._authoredItemSizes=new Set;this._itemA11yOriginal=new Map;this._handleThrottledResize=c.throttle(()=>this._handleResize(),200);this._handleAutoAdvanceState=t=>{t.type==="mouseenter"?this._hovered=!0:t.type==="mouseleave"?this._hovered=!1:t.type==="focusin"?this._focused=!0:t.type==="focusout"&&(this._focused=!1),this._syncAutoAdvance()};this._tick=()=>{this._autoAdvanceTimer=null,this._advance(),this._syncAutoAdvance()};this._advance=()=>{let t=this.center+1;if(t<this.count){this.set(t);return}if(this.options.noWrap){this._autoAdvances=!1,this._syncAutoAdvance();return}this.set(0)};this._handleTrackPointerDown=t=>{if(!(t.pointerType!=="mouse"||t.button!==0)){this.pressed=!0,this.dragged=!1,this._suppressClick=!1,this._dragPointerId=t.pointerId,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._dragStartScroll=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft;try{this._scroller.setPointerCapture(t.pointerId)}catch{}}};this._handleTrackPointerMove=t=>{if(!this.pressed||t.pointerId!==this._dragPointerId)return;let e=t.clientX-this._dragStartX,i=t.clientY-this._dragStartY,s=this._vertical?i:e,n=this._vertical?e:i;if(!this.dragged){if(Math.abs(s)<6||Math.abs(s)<=Math.abs(n))return;this.dragged=!0,this.el.classList.add("dragging")}this._vertical?this._scroller.scrollTop=this._dragStartScroll-i:this._scroller.scrollLeft=this._dragStartScroll-e,t.preventDefault()};this._handleTrackPointerUp=t=>{if(!(!this.pressed||t.pointerId!==this._dragPointerId)){this.pressed=!1,this._dragPointerId=null,this.el.classList.remove("dragging");try{this._scroller.releasePointerCapture(t.pointerId)}catch{}this.dragged&&(this._suppressClick=!0,window.clearTimeout(this._suppressClickTimeout),this._suppressClickTimeout=setTimeout(()=>{this._suppressClick=!1},0),this._syncActive(this._nearestIndex(),!0))}};this._handleTrackClick=t=>{this._suppressClick&&(this._suppressClick=!1,t.preventDefault(),t.stopImmediatePropagation())};this._handleTrackDragStart=t=>{t.target.closest("img, picture, video")&&t.preventDefault()};this._handleIndicatorClick=t=>{t.stopPropagation();let e=t.target.closest(".indicator-item");if(!e||!this._indicators.contains(e))return;let i=[...this._indicators.children].indexOf(e);i<0||this._cycleTo(i)};this._handleKeydown=t=>{if(t.target.closest('input, textarea, select, [contenteditable="true"]'))return;let i=this._vertical?t.key==="ArrowDown":t.key===c.keys.ARROW_RIGHT,s=this._vertical?t.key==="ArrowUp":t.key===c.keys.ARROW_LEFT;t.key==="Home"?(t.preventDefault(),this.set(0),this._focusItem(0)):t.key==="End"?(t.preventDefault(),this.set(this.count-1),this._focusItem(this.count-1)):i?(t.preventDefault(),this.next(),this._focusItem(this.center)):s&&(t.preventDefault(),this.prev(),this._focusItem(this.center))};this._handleTrackScroll=()=>{this.el.classList.contains("scrolling")||this.el.classList.add("scrolling"),window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=setTimeout(()=>this.el.classList.remove("scrolling"),120),this._trackRaf===null&&(this._trackRaf=requestAnimationFrame(()=>{if(this._trackRaf=null,this._updateParallax(),this._ignoreScroll)return;let t=this._nearestIndex();t!==this.center&&this._syncActive(t,this.dragged)}))};this._handleResize=()=>{this.images.length&&(this._syncAdaptiveMode(),this._syncLayoutRoles(this.center),this._scrollToIndex(this.center,!1),this._updateParallax())};this.el.Expressive_Carousel=this,this.options={...T.defaults,...e},e?.i18n&&(this.options.i18n={...T.defaults.i18n,...e.i18n}),(this.options.fullWidth||this.el.classList.contains("flat"))&&(this.el.classList.add("flat"),this.options.fullWidth=!0),this._vertical=this.el.classList.contains("full-screen");let i=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(i&&(this.options.duration=1),this.pressed=!1,this.dragged=!1,this.images=this._collectItems(),!this.images.length){console.error("Carousel: no .carousel-item elements to show");return}this.images.forEach(n=>{this._itemA11yOriginal.set(n,{ariaHidden:n.getAttribute("aria-hidden"),tabIndex:n.getAttribute("tabindex")}),n.hasAttribute("data-carousel-size")&&this._authoredItemSizes.add(n)}),this.hasMultipleSlides=this.images.length>1,this.showIndicators=this.options.indicators&&this.hasMultipleSlides,this.count=this.images.length,this._autoAdvances=this.options.interval>0&&this.hasMultipleSlides&&!i,this.images.forEach(n=>n.classList.add("carousel-item")),this.options.height!==null&&(this._generatedFixedHeight=!this.el.classList.contains("fixed-height"),this._authoredInlineHeight=this.el.style.getPropertyValue("--carousel-height")||null,this.el.classList.add("fixed-height"),this.el.style.setProperty("--carousel-height",`${this.options.height}px`)),this._wrapTrack(),this._syncAdaptiveMode(),this.showIndicators&&this._setupIndicators(),this._setupAccessibility(),this._setupEventHandlers(),this._started=!0;let s=Math.max(0,this.images.findIndex(n=>n.classList.contains("active")));this.center=s,this._syncActive(s,!1),this._updateParallax(),this._scrollToIndex(s,!1),this._syncAutoAdvance()}get _scroller(){return this._trackEl??this.el}static get defaults(){return ae}static init(t,e={}){return super.init(t,e,T)}static getInstance(t){return t.Expressive_Carousel}destroy(){this._started&&this._teardown(),this.el.Expressive_Carousel=void 0}_collectItems(){let t=Array.from(this.el.children).filter(e=>e instanceof HTMLElement&&e.classList.contains("carousel-item"));return t.length?t:Array.from(this.el.children).filter(e=>!(e instanceof HTMLElement)||e.classList.contains("indicators")||e.classList.contains("carousel-fixed-item")?!1:e.tagName!=="NAV")}_setupAccessibility(){this.el.hasAttribute("role")||(this.el.setAttribute("role","region"),this._generatedContainerRole=!0),!this.el.hasAttribute("aria-label")&&!this.el.hasAttribute("aria-labelledby")&&(this.el.setAttribute("aria-label",this.options.i18n.carousel),this._generatedContainerLabel=!0),this.el.hasAttribute("aria-roledescription")||(this.el.setAttribute("aria-roledescription","carousel"),this._generatedContainerDescription=!0);let t='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';this.images.forEach((e,i)=>{if(e.hasAttribute("aria-roledescription")||(e.setAttribute("aria-roledescription","slide"),this._generatedItemDescriptions.add(e)),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")){let s=e.querySelector("img[alt]")?.getAttribute("alt")?.trim(),n=e.textContent?.replace(/\s+/g," ").trim(),a=s||n,h=`${this.options.i18n.item} ${i+1} ${this.options.i18n.of} ${this.count}`;e.setAttribute("aria-label",a?`${a}, ${h}`:h),this._generatedItemLabels.add(e)}!e.matches(t)&&!e.querySelector(t)&&(e.tabIndex=0,this._generatedItemTabIndexes.add(e))})}_setupIndicators(){let t=Array.from(this.el.children).find(e=>e instanceof HTMLElement&&e.classList.contains("indicators"));this._indicators=t??document.createElement("nav"),this._ownIndicators=!t,this._indicators.classList.add("indicators"),this._indicators.setAttribute("aria-label",this.options.i18n.indicators),this._indicators.replaceChildren(),this.images.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.classList.add("indicator-item"),i===0&&(s.classList.add("active"),s.setAttribute("aria-current","true")),s.setAttribute("aria-label",`${this.options.i18n.slide} ${i+1}`),this._indicators.appendChild(s)}),this._ownIndicators&&this.el.appendChild(this._indicators),this.el.querySelector(".carousel-fixed-item")?.classList.add("with-indicators")}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleKeydown),this._autoAdvances&&(this.el.addEventListener("mouseenter",this._handleAutoAdvanceState),this.el.addEventListener("mouseleave",this._handleAutoAdvanceState),this.el.addEventListener("focusin",this._handleAutoAdvanceState),this.el.addEventListener("focusout",this._handleAutoAdvanceState),document.addEventListener("visibilitychange",this._handleAutoAdvanceState)),this.showIndicators&&this._indicators&&this._indicators.addEventListener("click",this._handleIndicatorClick),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._handleThrottledResize()),this._resizeObserver.observe(this.el)),this._usesWindowResize=!this._resizeObserver||this.el.classList.contains("full-screen"),this._usesWindowResize&&(T._live.add(this),T._resizeListening||(window.addEventListener("resize",T._onResize,{passive:!0}),T._resizeListening=!0)),this._scroller.addEventListener("scroll",this._handleTrackScroll,{passive:!0}),this._scroller.addEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.addEventListener("pointermove",this._handleTrackPointerMove),this._scroller.addEventListener("pointerup",this._handleTrackPointerUp),this._scroller.addEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.addEventListener("click",this._handleTrackClick,!0),this._scroller.addEventListener("dragstart",this._handleTrackDragStart)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleKeydown),this.el.removeEventListener("mouseenter",this._handleAutoAdvanceState),this.el.removeEventListener("mouseleave",this._handleAutoAdvanceState),this.el.removeEventListener("focusin",this._handleAutoAdvanceState),this.el.removeEventListener("focusout",this._handleAutoAdvanceState),document.removeEventListener("visibilitychange",this._handleAutoAdvanceState),this._indicators&&this._indicators.removeEventListener("click",this._handleIndicatorClick),this._scroller.removeEventListener("scroll",this._handleTrackScroll),this._scroller.removeEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.removeEventListener("pointermove",this._handleTrackPointerMove),this._scroller.removeEventListener("pointerup",this._handleTrackPointerUp),this._scroller.removeEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.removeEventListener("click",this._handleTrackClick,!0),this._scroller.removeEventListener("dragstart",this._handleTrackDragStart),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._usesWindowResize&&(T._live.delete(this),T._live.size===0&&T._resizeListening&&(window.removeEventListener("resize",T._onResize),T._resizeListening=!1))}_teardown(){this._removeEventHandlers(),this._autoAdvances=!1,this._syncAutoAdvance(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),window.clearTimeout(this._suppressClickTimeout),this._ownIndicators&&this._indicators?.remove(),this._unwrapTrack(),this.images.forEach(t=>{t.style.removeProperty("--md-comp-carousel-item-parallax"),this._generatedItemLabels.has(t)&&t.removeAttribute("aria-label"),this._generatedItemDescriptions.has(t)&&t.removeAttribute("aria-roledescription"),this._generatedItemSizes.has(t)&&t.removeAttribute("data-carousel-size");let e=this._itemA11yOriginal.get(t);e?.ariaHidden===null?t.removeAttribute("aria-hidden"):e&&t.setAttribute("aria-hidden",e.ariaHidden),e?.tabIndex===null?t.removeAttribute("tabindex"):e&&t.setAttribute("tabindex",e.tabIndex)}),this._generatedContainerRole&&this.el.removeAttribute("role"),this._generatedContainerLabel&&this.el.removeAttribute("aria-label"),this._generatedContainerDescription&&this.el.removeAttribute("aria-roledescription"),this._generatedFixedHeight&&this.el.classList.remove("fixed-height"),this.options.height!==null&&(this._authoredInlineHeight===null?this.el.style.removeProperty("--carousel-height"):this.el.style.setProperty("--carousel-height",this._authoredInlineHeight)),this._generatedWideLayout&&this.el.classList.remove("multi-wide","multi-large","multi-extra-large","full-screen-horizontal")}_syncAutoAdvance(){let t=this._autoAdvances&&!this._autoPaused&&!this._hovered&&!this._focused&&!document.hidden;t&&this._autoAdvanceTimer===null?this._autoAdvanceTimer=setTimeout(this._tick,this.options.duration+this.options.interval):!t&&this._autoAdvanceTimer!==null&&(clearTimeout(this._autoAdvanceTimer),this._autoAdvanceTimer=null)}_paintIndicators(t){if(!this.showIndicators||!this._indicators)return;let e=(t%this.count+this.count)%this.count;this._indicators.querySelectorAll(".indicator-item").forEach((i,s)=>{let n=s===e;i.classList.toggle("active",n),n?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")})}_syncActive(t,e){let i=this.center;this.center=t,this.images.forEach((n,a)=>n.classList.toggle("active",a===t)),this._paintIndicators(t),this._syncLayoutRoles(t);let s=this.images[t];i!==t&&typeof this.options.onCycleTo=="function"&&this.options.onCycleTo.call(this,s,e),typeof this.oneTimeCallback=="function"&&(this.oneTimeCallback.call(this,s,e),this.oneTimeCallback=null)}_syncLayoutRoles(t){let e=(l,r)=>{this._authoredItemSizes.has(l)||(l.setAttribute("data-carousel-size",r),this._generatedItemSizes.add(l))};if(this.images.forEach(l=>e(l,"large")),this.el.classList.contains("flat")||this.el.classList.contains("uncontained")||this.el.classList.contains("full-screen")&&this._vertical)return;if(this.el.classList.contains("hero")||this.el.classList.contains("full-screen-horizontal")){let l=this.images[t+1];if(l&&e(l,"small"),this.el.classList.contains("center-aligned")){let r=this.images[t-1];r&&e(r,"small")}return}let i=this.el.clientWidth,s=i>=1600?4:i>=1200?3:i>=600?2:1,n=Math.min(s,Math.max(1,this.count-2));this.el.classList.remove("multi-wide","multi-large","multi-extra-large"),n===2?this.el.classList.add("multi-wide"):n===3?this.el.classList.add("multi-large"):n>=4&&this.el.classList.add("multi-extra-large"),this._generatedWideLayout=this._generatedWideLayout||n>1;for(let l=1;l<n;l+=1){let r=this.images[t+l];r&&e(r,"large")}let a=this.images[t+n],h=this.images[t+n+1];a&&e(a,"medium"),h&&e(h,"small")}_syncAdaptiveMode(){if(!this.el.classList.contains("full-screen"))return;let t=window.matchMedia("(orientation: landscape)").matches,e=this.el.clientWidth>=840||t,i=this._vertical;this._vertical=!e,this.el.classList.toggle("full-screen-horizontal",e),this._generatedWideLayout=this._generatedWideLayout||e,this._started&&i!==this._vertical&&this._scroller.scrollTo({left:0,top:0,behavior:"auto"})}_focusItem(t){let e=this.images[t];if(!e)return;((e.matches('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')?e:e.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??e).focus({preventScroll:!0})}_updateParallax(){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){this.images.forEach(s=>s.style.setProperty("--md-comp-carousel-item-parallax","0px"));return}let t=this._scroller.getBoundingClientRect(),e=this._vertical?t.top+t.height/2:t.left+t.width/2,i=Math.max(1,this._vertical?t.height:t.width);this.images.forEach(s=>{let n=s.getBoundingClientRect(),a=this._vertical?n.top+n.height/2:n.left+n.width/2,h=Math.max(-1,Math.min(1,(a-e)/i));s.style.setProperty("--md-comp-carousel-item-parallax",`${h*-24}px`)})}_wrapTrack(){let t=document.createElement("div");t.className="carousel-track",this.images[0].before(t),this.images.forEach(e=>t.appendChild(e)),this._trackEl=t}_unwrapTrack(){this._trackEl&&(this.images.forEach(t=>this.el.insertBefore(t,this._trackEl)),this._trackEl.remove(),this._trackEl=null)}_nearestIndex(){let t=this.el.classList.contains("center-aligned"),e=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,i=e+(this._vertical?this._scroller.clientHeight:this._scroller.clientWidth)/2,s=0,n=1/0;return this.images.forEach((a,h)=>{let l=this._vertical?a.offsetTop:a.offsetLeft,r=this._vertical?a.offsetHeight:a.offsetWidth,u=t?l+r/2:l,v=Math.abs(u-(t?i:e));v<n&&(n=v,s=h)}),s}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;let s=this.el.classList.contains("center-aligned"),n=getComputedStyle(this._scroller),a=Number.parseFloat(n.paddingInlineStart)||0,h=Number.parseFloat(n.paddingBlockStart)||0,l=s?i.offsetLeft-(this._scroller.clientWidth-i.offsetWidth)/2:i.offsetLeft-a,r=i.offsetTop-h,u=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,v=this._vertical?r:l;if(Math.abs(u-v)<1){this._syncActive(t,!1);return}this._ignoreScroll=!0,this._scroller.scrollTo({left:this._vertical?0:l,top:this._vertical?r:0,behavior:e?"smooth":"auto"});let m=()=>{this._ignoreScroll=!1};this._scroller.addEventListener("scrollend",m,{once:!0}),window.setTimeout(m,this.options.duration+350)}_cycleTo(t,e=null){typeof e=="function"&&(this.oneTimeCallback=e),this._syncActive(t,!1),this._scrollToIndex(t)}pause(){this._autoPaused=!0,this._syncAutoAdvance()}start(){this._autoPaused=!1,this._syncAutoAdvance()}next(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center+t;e>=this.count||e<0||this._cycleTo(e)}prev(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center-t;e>=this.count||e<0||this._cycleTo(e)}set(t,e){(t===void 0||isNaN(t))&&(t=0),!(t>=this.count||t<0)&&this._cycleTo(t,e)}};T._live=new Set,T._resizeListening=!1,T._onResize=c.throttle(()=>{T._live.forEach(t=>t._handleResize())},200);var W=T;var re=Object.freeze({}),rt=class d extends E{constructor(t,e){super(t,{},d);this.updateCounter=()=>{let t=parseInt(this.el.getAttribute("maxlength")),e=this.el.value.length;this.isValidLength=e<=t;let i=e.toString();t&&(i+="/"+t,this._validateInput()),this.counterEl.textContent=i};this.el.Expressive_CharacterCounter=this,this.options={...d.defaults,...e},this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers()}static get defaults(){return re}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_CharacterCounter}destroy(){this._removeEventHandlers(),this.el.Expressive_CharacterCounter=void 0,this._removeCounter()}_setupEventHandlers(){this.el.addEventListener("focus",this.updateCounter,!0),this.el.addEventListener("input",this.updateCounter,!0)}_removeEventHandlers(){this.el.removeEventListener("focus",this.updateCounter,!0),this.el.removeEventListener("input",this.updateCounter,!0)}_setupCounter(){this.counterEl=document.createElement("span"),this.counterEl.classList.add("character-counter"),this.counterEl.setAttribute("aria-live","polite"),this.counterEl.setAttribute("aria-atomic","true"),this.counterEl.style.float="right",this.counterEl.style.fontSize="12px",this.counterEl.style.height="1",this.el.parentElement.appendChild(this.counterEl)}_removeCounter(){this.counterEl.remove()}_validateInput(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.el.classList.remove("invalid")):!this.isValidLength&&!this.isInvalid&&(this.isInvalid=!0,this.el.classList.remove("valid"),this.el.classList.add("invalid"))}};var le={classes:"",menuOptions:{}},D=class d extends E{constructor(t,e){super(t,e,d);this._handleSelectChange=()=>{this._setValueToInput()};this._handleOptionKeydown=t=>{(t.key===" "||t.key==="Enter")&&this._handleOptionClick(t)};this._handleOptionClick=t=>{t.preventDefault();let e=t.target.closest("li");this._selectOptionElement(e),t.stopPropagation()};this._handleOptionFocus=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest('li[role="option"]');i?.id&&this.input.setAttribute("aria-activedescendant",i.id)};this._handleInputClick=()=>{this.menu&&this.menu.isOpen&&(this._setValueToInput(),this._setSelectedStates())};!this.el.classList.contains("browser-default")&&(this.el.Expressive_FormSelect=this,this.options={...d.defaults,...e},this.isMultiple=this.el.multiple,this.nativeTabIndex=this.el.tabIndex??-1,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._originalLabelFor=null,this._setupMenu(),this._setupEventHandlers())}static get defaults(){return le}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FormSelect}destroy(){this._removeEventHandlers(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,this.el.Expressive_FormSelect=void 0}refresh(){this.menuEl&&(this._rebuildOptions(),this._setValueToInput(),this._setSelectedStates())}_setupEventHandlers(){this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange),this.input.addEventListener("click",this._handleInputClick),this.menuEl.addEventListener("focusin",this._handleOptionFocus)}_removeEventHandlers(){this._removeOptionHandlers(),this.el.removeEventListener("change",this._handleSelectChange),this.input?.removeEventListener("click",this._handleInputClick),this.menuEl?.removeEventListener("focusin",this._handleOptionFocus)}_setupOptionHandlers(){this.menuEl.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.addEventListener("click",this._handleOptionClick),t.addEventListener("keydown",this._handleOptionKeydown)})}_removeOptionHandlers(){this.menuEl?.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.removeEventListener("click",this._handleOptionClick),t.removeEventListener("keydown",this._handleOptionKeydown)})}_arraysEqual(t,e){if(t===e)return!0;if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}_selectOptionElement(t){if(!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(a=>a.optionEl===t);if(!e)return;let i=this.getSelectedValues();this.isMultiple?this._toggleEntryFromArray(e):(this._deselectAll(),this._selectValue(e)),this._setValueToInput();let s=this.getSelectedValues();!this._arraysEqual(i,s)&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))}this.isMultiple||this.menu?.close()}_setupMenu(){this.labelEl=this.el.labels?.[0]??null,this._setupWrapper(),this._hideNativeSelect(),this.el.disabled&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement("menu"),this.menuEl.id=`select-options-${c.guid()}`,this.menuEl.setAttribute("popover","auto"),this.menuEl.setAttribute("role","listbox"),this.menuEl.ariaMultiSelectable=this.isMultiple.toString(),this.isMultiple&&this.menuEl.classList.add("multiple-select-menu"),this._buildOptions(),this.wrapper.append(this.menuEl),this._buildInput(),this._buildCaret(),this._initMenu(),this._setSelectedStates(),this.labelEl&&this.input.after(this.labelEl)}_setupWrapper(){let t=this.el.parentElement;t&&t.matches(".field")&&!t.querySelector(":scope > .hide-select")&&!t.querySelector(":scope > input, :scope > textarea")?(this.wrapper=t,this._createdWrapper=!1):(this.wrapper=document.createElement("div"),this.wrapper.classList.add("field"),this._createdWrapper=!0,this.el.before(this.wrapper)),this.options.classes.length>0&&this.wrapper.classList.add(...this.options.classes.split(" ").filter(Boolean))}_hideNativeSelect(){let t=document.createElement("div");t.classList.add("hide-select"),this.el.before(t),t.appendChild(this.el),this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+c.guid(),this.input.classList.add("menu-trigger","no-autoinit"),this.input.type="text",this.input.readOnly=!0,this.input.setAttribute("data-target",this.menuEl.id),this.input.ariaReadOnly="true",this.input.ariaRequired=this.el.hasAttribute("required").toString(),this.el.disabled&&(this.input.disabled=!0),this.input.setAttribute("tabindex",this.nativeTabIndex.toString());let t=this.el.attributes;for(let e=0;e<t.length;++e){let i=t[e];i.name.startsWith("aria-")&&this.input.setAttribute(i.name,i.value)}this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","listbox"),this.input.ariaExpanded="false",this.input.setAttribute("aria-controls",this.menuEl.id),this.input.placeholder=" ",this.labelEl&&(this._originalLabelFor=this.labelEl.htmlFor,this.labelEl.htmlFor=this.input.id),this.wrapper.prepend(this.input),this._setValueToInput()}_buildCaret(){let t=document.createElement("span");t.classList.add("caret"),t.setAttribute("aria-hidden","true"),this.wrapper.prepend(t)}_initMenu(){if(this.el.disabled)return;let t={...this.options.menuOptions};t.coverTrigger=!1;let e=t.onOpenEnd,i=t.onCloseEnd;t.onOpenEnd=()=>{let s=this.menuEl.querySelector(".selected");if(s){if(this.menu.focusedIndex=[...s.parentNode.children].indexOf(s),this.menu._focusFocusedItem(),this.menu.isScrollable){let n=s.getBoundingClientRect().top-this.menuEl.getBoundingClientRect().top;n-=this.menuEl.clientHeight/2,this.menuEl.scrollTop=n}s.id&&this.input.setAttribute("aria-activedescendant",s.id)}this.input.ariaExpanded="true",e&&typeof e=="function"&&e.call(this.menu,this.el)},t.onCloseEnd=()=>{this.input.ariaExpanded="false",this.input.removeAttribute("aria-activedescendant"),i&&typeof i=="function"&&i.call(this.menu,this.el)},t.closeOnClick=!1,this.menu=S.init(this.input,t)}_nativeOptions(){return Array.from(this.el.children).filter(t=>["OPTION","OPTGROUP"].includes(t.tagName))}_buildOptions(){this.selectOptions=this._nativeOptions(),this._values=[],this.selectOptions.forEach(t=>{if(t.tagName==="OPTION"){let e=this._createAndAppendOptionWithIcon(t,this.isMultiple?"multiple":void 0);this._addOptionToValues(t,e)}else if(t.tagName==="OPTGROUP"){let e="opt-group-"+c.guid(),i=document.createElement("li");i.classList.add("optgroup"),i.tabIndex=-1,i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e);let s=document.createElement("span");s.id=e,s.setAttribute("role","presentation"),s.textContent=t.getAttribute("label")??"",i.replaceChildren(s),this.menuEl.append(i);let n=[];Array.from(t.children).filter(h=>h.tagName==="OPTION").forEach(h=>{let l=this._createAndAppendOptionWithIcon(h,"optgroup-option");n.push(l.id),this._addOptionToValues(h,l)}),i.setAttribute("aria-owns",n.join(" "))}})}_rebuildOptions(){this._removeOptionHandlers(),this.menuEl.replaceChildren(),this._buildOptions(),this._setupOptionHandlers(),this.menu?._makeMenuFocusable()}_addOptionToValues(t,e){this._values.push({el:t,optionEl:e})}_removeMenu(){this.wrapper?.querySelector(":scope > .caret")?.remove(),this.input?.remove(),this.menuEl?.remove();let t=this.el.parentElement;t?.classList.contains("hide-select")&&t.replaceWith(this.el),this.labelEl&&this._originalLabelFor!==null&&(this.labelEl.htmlFor=this._originalLabelFor),this.wrapper&&(this._createdWrapper?this.wrapper.replaceWith(this.el):(this.wrapper.classList.remove("disabled"),this.options.classes.length>0&&this.wrapper.classList.remove(...this.options.classes.split(" ").filter(Boolean))))}_createAndAppendOptionWithIcon(t,e){let i=document.createElement("li");i.id="select-option-"+c.guid(),i.setAttribute("role","option"),i.tabIndex=0,t.disabled&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let s=t.textContent,n=document.createElement("span");if(this.isMultiple&&!t.disabled){let r=document.createElement("label"),u=document.createElement("input");u.type="checkbox",u.tabIndex=-1;let v=document.createElement("span");v.textContent=s,r.append(u,v),n.appendChild(r)}else n.textContent=s;i.appendChild(n);let a=t.getAttribute("data-icon"),h;if(a)try{let r=new URL(a,this.el.ownerDocument.baseURI);(["http:","https:","blob:"].includes(r.protocol)||/^data:image\/(?:avif|bmp|gif|jpeg|png|svg\+xml|webp|x-icon)(?:;|,)/i.test(r.href))&&(h=r)}catch{}let l=t.getAttribute("class")?.split(" ").filter(Boolean);if(h){let r=document.createElement("img");l?.length&&r.classList.add(...l),r.src=h.href,r.ariaHidden="true",i.prepend(r)}return this.menuEl.append(i),i}_selectValue(t){t.el.selected=!0,t.optionEl.classList.add("selected"),t.optionEl.ariaSelected="true";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!0)}_deselectValue(t){t.el.selected=!1,t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!1)}_deselectAll(){this._values.forEach(t=>this._deselectValue(t))}_isValueSelected(t){return this.getSelectedValues().some(i=>i===t.el.value)}_toggleEntryFromArray(t){this._isValueSelected(t)?this._deselectValue(t):this._selectValue(t)}_getSelectedOptions(){return Array.prototype.filter.call(this.el.selectedOptions,t=>t)}_setValueToInput(){let t=this._getSelectedOptions(),s=this._values.filter(n=>t.indexOf(n.el)>=0).filter(n=>!n.el.disabled).map(n=>n.optionEl.querySelector("span").textContent.trim());if(s.length===0){let n=this.el.querySelector("option:disabled");if(n&&n.value===""){this.input.value=n.textContent;return}}this.input.value=s.join(", ")}_setSelectedStates(){this._values.forEach(t=>{let e=t.el.selected,i=t.optionEl.querySelector('input[type="checkbox"]');i&&(i.checked=e),e?this._activateOption(this.menuEl,t.optionEl):(t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false")})}_activateOption(t,e){e&&(this.isMultiple||t.querySelectorAll("li.selected").forEach(i=>i.classList.remove("selected")),e.classList.add("selected"),e.ariaSelected="true")}getSelectedValues(){return this._getSelectedOptions().map(t=>t.value)}};var he={margin:5,transition:10,duration:250,align:"left"},j=class d{constructor(o,t,e){this._handleDocumentClick=o=>{this.visible&&this.el!==o.target&&!o.target.closest(".display-docked")&&this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{if(this.visible)return;this.visible=!0;let o=c._setAbsolutePosition(this.el,this.container,"bottom",this.options.margin,this.options.transition,this.options.align);this.container.style.visibility="visible",this.container.style.transition=`
|
|
5
|
+
</svg></div>`,I._loadingTemplate=t.content.firstElementChild}return I._loadingTemplate.cloneNode(!0)}destroy(){this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._removeEventHandlers(),this.menu.destroy(),this._removeMenu(),this._statusInfo.remove(),this._announcer.remove(),this.el.Expressive_Autocomplete=void 0}_setupEventHandlers(){this.el.addEventListener("blur",this._handleInputBlur),this.el.addEventListener("keyup",this._handleInputKeyup),this.el.addEventListener("focus",this._handleInputFocus),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("click",this._handleInputClick),this.container.addEventListener("pointerdown",this._handleContainerPointerDown),this.container.addEventListener("pointerup",this._handleContainerPointerUp),this.container.addEventListener("pointercancel",this._handleContainerPointerUp)}_removeEventHandlers(){this.el.removeEventListener("blur",this._handleInputBlur),this.el.removeEventListener("keyup",this._handleInputKeyup),this.el.removeEventListener("focus",this._handleInputFocus),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("click",this._handleInputClick),this.container.removeEventListener("pointerdown",this._handleContainerPointerDown),this.container.removeEventListener("pointerup",this._handleContainerPointerUp),this.container.removeEventListener("pointercancel",this._handleContainerPointerUp)}_setupMenu(){this.container=document.createElement("menu"),this.container.style.maxHeight=this.options.maxMenuHeight,this.container.id=`autocomplete-options-${u.guid()}`,this.container.classList.add("autocomplete-content"),this.container.ariaExpanded="true",this.container.setAttribute("role","listbox"),this.el.setAttribute("role","combobox"),this.el.setAttribute("aria-autocomplete","list"),this.el.setAttribute("aria-controls",this.container.id),this.el.setAttribute("data-target",this.container.id),this.menuItems.forEach(o=>{let r=this._createMenuItem(o);this.container.append(r)}),this.el.parentElement.appendChild(this.container);let t={...I.defaults.menuOptions,...this.options.menuOptions},e=t.onItemClick;t.onItemClick=o=>{if(!o)return;let r=o.getAttribute("data-id");this.selectOption(r),typeof e=="function"&&e.call(this.menu,o)},this.menu=O.init(this.el,t),this.el.setAttribute("aria-haspopup","listbox");let i=this.el.parentElement.querySelector("label");if(i&&this.el.after(i),this.el.removeEventListener("click",this.menu._handleClick),!this.options.isMultiSelect&&this.options.selected.length!==0){let o=this.menuItems.filter(r=>r.id===this.selectedValues[0].id);this.el.value=o[0].text}this.el.value&&this.selectOption(this.el.value);let s=document.createElement("div");s.classList.add("status-info"),s.setAttribute("aria-hidden","true"),s.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(s),this._statusInfo=s,this._announcer=document.createElement("div"),this._announcer.classList.add("autocomplete-status"),this._announcer.setAttribute("role","status"),this._announcer.setAttribute("aria-live","polite"),this._announcer.setAttribute("aria-atomic","true"),this.el.parentElement.appendChild(this._announcer),this._updateSelectedInfo()}_removeMenu(){this.container.ariaExpanded="false",this.container.parentNode.removeChild(this.container)}_resetCurrentElementPosition(){this.activeIndex=-1,this._setActive(null)}_resetAutocomplete(){this.container.replaceChildren(),this._resetCurrentElementPosition(),this.oldVal=null,this.isOpen=!1,this._pointerDown=!1}_highlightPartialText(t,e){let i=e.toLocaleLowerCase().indexOf(""+t.toLocaleLowerCase()),s=i+t.length-1;return i==-1||s==-1?[e,"",""]:[e.slice(0,i),e.slice(i,s+1),e.slice(s+1)]}_createMenuItem(t){let e=document.createElement("li");e.id=`autocomplete-option-${u.guid()}`,e.setAttribute("role","option");let i=this.selectedValues.some(l=>l.id===t.id);if(e.setAttribute("aria-selected",i?"true":"false"),e.setAttribute("data-id",t.id),e.setAttribute("style","display:grid; grid-auto-flow: column; user-select: none; align-items: center;"),e.tabIndex=-1,this.options.isMultiSelect){let l=document.createElement("div");l.classList.add("item-selection"),l.style.textAlign="center";let a=document.createElement("input");a.type="checkbox",a.tabIndex=-1,a.checked=i;let m=document.createElement("span");m.style.paddingLeft="21px",l.append(a,m),e.appendChild(l)}if(t.image){let l=document.createElement("img");l.classList.add("circle"),l.src=t.image,e.appendChild(l)}let s=this.el.value.toLocaleLowerCase(),o=this._highlightPartialText(s,(t.text||t.id).toString()),r=document.createElement("div");if(r.setAttribute("style","line-height:1.2;font-weight:500;"),this.options.allowUnsafeHTML)r.innerHTML=o[0]+'<span class="highlight">'+o[1]+"</span>"+o[2];else if(r.appendChild(document.createTextNode(o[0])),o[1]){let l=document.createElement("span");l.textContent=o[1],l.classList.add("highlight"),r.appendChild(l),r.appendChild(document.createTextNode(o[2]))}let c=document.createElement("div");if(c.classList.add("item-text"),c.setAttribute("style","padding:5px;overflow:hidden;"),e.appendChild(c),e.querySelector(".item-text").appendChild(r),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let l=document.createElement("small");l.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),l.innerText=t.description,e.querySelector(".item-text").appendChild(l)}let h=()=>this.options.isMultiSelect?t.image?"40px min-content auto":"40px auto":t.image?"min-content auto":"auto";return e.style.gridTemplateColumns=h(),e}_renderMenu(){this._resetAutocomplete(),this.menuItems.length===0&&(this.menuItems=this.selectedValues);for(let t=0;t<this.menuItems.length;t++){let e=this._createMenuItem(this.menuItems[t]);this.container.append(e)}}_setStatusLoading(){let t=this._statusInfo;t&&t.replaceChildren(I._loadingIndicator()),this._announce(this.options.i18n.loading)}_announce(t){if(!this._announcer)return;let e=this.el.matches(":focus")&&this.el.value.length>=this.options.minLength?t:"";this._announcer.textContent!==e&&(this._announcer.textContent=e)}_updateSelectedInfo(){let t=this._statusInfo;t&&(this.options.isMultiSelect?t.textContent=this.selectedValues.length.toString():t.replaceChildren())}_refreshInputText(){if(this.selectedValues.length===1){let t=this.selectedValues[0];this.el.value=t.text||t.id}}_triggerChanged(){this.el.dispatchEvent(new Event("change")),typeof this.options.onAutocomplete=="function"&&this.options.onAutocomplete.call(this,this.selectedValues)}setMenuItems(t,e=null,i=!0){if(this.el.Expressive_Autocomplete!==this)return;let s=t.length;this.menuItems=t,this.options.data=t,e&&(this.selectedValues=this.menuItems.filter(o=>e.indexOf(o.id)!==-1)),this.options.isMultiSelect?this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._announce(i?s?this.options.i18n.results(s):this.options.i18n.noResults:""),this._triggerChanged()}selectOption(t){let e=this.menuItems.find(i=>i.id==t);e&&(this.options.isMultiSelect?(this.selectedValues.filter(i=>i.id===e.id).length>=1?this.selectedValues=this.selectedValues.filter(i=>i.id!==e.id):this.selectedValues.push(e),this._renderMenu(),this.el.focus()):(this.selectedValues=[e],this._refreshInputText(),this._resetAutocomplete(),this.close()),this._updateSelectedInfo(),this.options.isMultiSelect&&this._announce(this.options.i18n.selected(this.selectedValues.length)),this._triggerChanged())}};I._loadingTemplate=null;var B=I;var Zt={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-symbols",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,allowUserInput:!1,i18n:{remove:"Remove"},onChipAdd:null,onChipSelect:null,onChipDelete:null},C=class C extends _{constructor(t,e){super(t,e,C);this._handleChipClick=t=>{let e=t.target.closest(".chip"),i=!!t.target.closest(".close");if(e){let s=this._chips.indexOf(e);if(s<0)return;i?this._deleteChip(s,"input"):this.selectChip(s)}else this._input.focus()};this._handleInputFocus=()=>{this.el.classList.add("focus")};this._handleInputBlur=()=>{this.el.classList.remove("focus")};this._handleInputKeydown=t=>{if(C._keydown=!0,t.key===u.keys.ENTER){if(this.hasAutocomplete&&this.autocomplete&&this.autocomplete.isOpen)return;t.preventDefault(),(!this.hasAutocomplete||this.hasAutocomplete&&!this.options.autocompleteOnly)&&this.addChip({id:this._input.value}),this._input.value=""}else(t.key===u.keys.BACKSPACE||t.key===u.keys.ARROW_LEFT)&&this._input.value===""&&this.chipsData.length&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))};this.el.Expressive_Chips=this,this.options={...C.defaults,...e},e?.i18n&&(this.options.i18n={...C.defaults.i18n,...e.i18n}),this.el.classList.add("chips"),this.chipsData=[],this._chips=[],this.options.data.length&&(this.chipsData=this.options.data,this._renderChips()),this.options.allowUserInput&&(this.el.classList.add("field"),this._setupInput(),this._setupEventHandlers(),this.el.append(this._input)),this._setupLabel()}_setSelected(t){this._selectedChip?.classList.remove("selected"),this._selectedChip=t,t?.classList.add("selected")}static get defaults(){return Zt}static init(t,e={}){return super.init(t,e,C)}static getInstance(t){return t.Expressive_Chips}getData(){return this.chipsData}destroy(){this.options.allowUserInput&&this._removeEventHandlers(),this._chips.forEach(t=>t.remove()),this._chips=[],this.el.Expressive_Chips=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleChipClick),this.el.addEventListener("keydown",C._handleChipsKeydown),this.el.addEventListener("keyup",C._handleChipsKeyup),this.el.addEventListener("blur",C._handleChipsBlur,!0),this._input.addEventListener("focus",this._handleInputFocus),this._input.addEventListener("blur",this._handleInputBlur),this._input.addEventListener("keydown",this._handleInputKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleChipClick),this.el.removeEventListener("keydown",C._handleChipsKeydown),this.el.removeEventListener("keyup",C._handleChipsKeyup),this.el.removeEventListener("blur",C._handleChipsBlur,!0),this._input.removeEventListener("focus",this._handleInputFocus),this._input.removeEventListener("blur",this._handleInputBlur),this._input.removeEventListener("keydown",this._handleInputKeydown)}static _handleChipsKeydown(t){C._keydown=!0;let e=t.target.closest(".chips"),i=t.target&&e,s=t.target.tagName;if(s==="INPUT"||s==="TEXTAREA"||!i)return;let o=e.Expressive_Chips;if(o){if(t.key===u.keys.BACKSPACE||t.key===u.keys.DELETE){let r=o._chips.indexOf(t.target.closest(".chip"));if(r<0)return;t.preventDefault(),o._deleteChip(r,"previous")}else if(t.key===u.keys.ARROW_LEFT){if(o._selectedChip){let r=o._chips.indexOf(o._selectedChip)-1;if(r<0)return;o.selectChip(r)}}else if(t.key===u.keys.ARROW_RIGHT&&o._selectedChip){let r=o._chips.indexOf(o._selectedChip)+1;r>=o.chipsData.length?(o._setSelected(null),o._input.focus()):o.selectChip(r)}}}static _handleChipsKeyup(){C._keydown=!1}static _handleChipsBlur(t){if(!C._keydown&&document.hidden){let i=t.target.closest(".chips")?.Expressive_Chips;i&&i._setSelected(null)}}_renderChip(t){if(!t.id)return;let e=t.text||t.id,i=document.createElement("span");if(i.classList.add("chip"),i.innerText=e,t.image){let s=document.createElement("img");s.setAttribute("src",t.image),i.insertBefore(s,i.firstChild)}if(this.options.allowUserInput){let s=document.createElement("button");s.type="button",s.classList.add("close"),s.setAttribute("aria-label",`${this.options.i18n.remove} ${e}`);let o=document.createElement("span");o.classList.add(this.options.closeIconClass),o.setAttribute("aria-hidden","true"),o.innerText="close",s.appendChild(o),i.appendChild(s)}return i}_renderChips(){this._chips=[];for(let t=0;t<this.chipsData.length;t++){let e=this._renderChip(this.chipsData[t]);this.el.appendChild(e),this._chips.push(e)}}_setupAutocomplete(){this.options.autocompleteOptions.onAutocomplete=t=>{t.length>0&&this.addChip({id:t[0].id,text:t[0].text,image:t[0].image}),this._input.value="",this._input.focus()},this.autocomplete=B.init(this._input,this.options.autocompleteOptions)}_setupInput(){this._input=this.el.querySelector("input"),this._input||(this._input=document.createElement("input"),this.el.append(this._input)),this._input.classList.add("input"),this.hasAutocomplete=Object.keys(this.options.autocompleteOptions).length>0,this.hasAutocomplete&&this._setupAutocomplete(),this._setPlaceholder(),this._input.getAttribute("id")||this._input.setAttribute("id",u.guid())}_setupLabel(){this._label=this.el.querySelector("label"),this._label&&this._input&&this._label.setAttribute("for",this._input.getAttribute("id"))}_setPlaceholder(){this.chipsData!==void 0&&!this.chipsData.length&&this.options.placeholder?this._input.placeholder=this.options.placeholder:(this.chipsData===void 0||this.chipsData.length)&&this.options.secondaryPlaceholder&&(this._input.placeholder=this.options.secondaryPlaceholder)}_isValidAndNotExist(t){let e=!!t.id,i=!this.chipsData.some(s=>s.id==t.id);return e&&i}addChip(t){if(!this._isValidAndNotExist(t)||this.chipsData.length>=this.options.limit)return;let e=this._renderChip(t);this._chips.push(e),this.chipsData.push(t),this._input.before(e),this._setPlaceholder(),typeof this.options.onChipAdd=="function"&&this.options.onChipAdd(this.el,e)}deleteChip(t){let e=this.el.getRootNode();this._deleteChip(t,this._chips[t]?.contains(e.activeElement)?"input":null)}_deleteChip(t,e){let i=this._chips[t];if(!i)return;this._selectedChip===i&&this._setSelected(null),i.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder();let s=[],o=this.el.getRootNode();for(;o;)s.push({root:o,element:o.activeElement}),o="host"in o?o.host.getRootNode():null;typeof this.options.onChipDelete=="function"&&this.options.onChipDelete(this.el,i),!(!e||s.some(({root:r,element:c})=>r.activeElement!==c)||this.el.Expressive_Chips!==this)&&(e==="previous"&&this._chips.length?this.selectChip(Math.max(t-1,0)):(this._setSelected(null),this._input?.focus()))}selectChip(t){let e=this._chips[t];e&&(this._setSelected(e),e.querySelector(".close")?.focus(),typeof this.options.onChipSelect=="function"&&this.options.onChipSelect(this.el,e))}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(".chips").forEach(e=>{e.addEventListener("click",i=>{if(!e.Expressive_Chips&&i.target.closest(".close")){let s=i.target.closest(".chip");s&&s.remove()}})})})}};C._keydown=!1;var W=C;var Qt={},V=class d extends _{constructor(t,e){super(t,e,d);this._resizeObserver=null;this._handleRangeChange=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0,this.el.classList.add("active"),this._clampDual(),this._sync(),this.thumb.classList.add("active")))};this._handleRangeInputOrMove=t=>{(t.type==="input"||this._pointerDown)&&(this._clampDual(),this._sync(),this.thumb.classList.add("active"))};this._handleRangePointerUp=t=>{t.isPrimary&&(this._pointerDown=!1,this.el.classList.remove("active"))};this._handleRangeRelease=()=>{this._pointerDown||this.thumb.classList.remove("active")};this.el.Expressive_Slider=this,this.options={...d.defaults,...e},this._pointerDown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers(),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._sync()),this._resizeObserver.observe(this.el))}static get defaults(){return Qt}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Slider}destroy(){this._resizeObserver?.disconnect(),this._removeEventHandlers(),this._removeThumb(),this.el.Expressive_Slider=void 0}_setupEventHandlers(){this.el.addEventListener("change",this._handleRangeChange),this.el.addEventListener("pointerdown",this._handleRangePointerDown),this.el.addEventListener("input",this._handleRangeInputOrMove),this.el.addEventListener("pointermove",this._handleRangeInputOrMove,{passive:!0}),this.el.addEventListener("pointerup",this._handleRangePointerUp),this.el.addEventListener("pointercancel",this._handleRangePointerUp),this.el.addEventListener("blur",this._handleRangeRelease),this.el.addEventListener("mouseout",this._handleRangeRelease)}_removeEventHandlers(){this.el.removeEventListener("change",this._handleRangeChange),this.el.removeEventListener("pointerdown",this._handleRangePointerDown),this.el.removeEventListener("input",this._handleRangeInputOrMove),this.el.removeEventListener("pointermove",this._handleRangeInputOrMove),this.el.removeEventListener("pointerup",this._handleRangePointerUp),this.el.removeEventListener("pointercancel",this._handleRangePointerUp),this.el.removeEventListener("blur",this._handleRangeRelease),this.el.removeEventListener("mouseout",this._handleRangeRelease)}_setupThumb(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),this.thumb.classList.add("thumb"),this.value.classList.add("value"),this.thumb.append(this.value),this.el.after(this.thumb)}_removeThumb(){this.thumb.remove()}_isVertical(){return!!this.el.closest(".vertical")}_host(){return this.el.closest(".slider, .range, .range-field, label")}_clampDual(){let e=this._host()?.querySelectorAll('input[type="range"]');if(!e||e.length!==2)return;let i=e[0],s=e[1];this.el===i&&+i.value>+s.value&&(i.value=s.value),this.el===s&&+s.value<+i.value&&(s.value=i.value)}_fraction(t){let e=parseFloat(t.max),i=Number.isNaN(e)?100:e,s=parseFloat(t.min)||0,o=parseFloat(t.value)||0;return i===s?0:(o-s)/(i-s)}_sync(){let t=this._fraction(this.el),e=`${t*100}%`,i=this.el.offsetLeft,s=this.el.offsetTop,o=this.el.offsetWidth,r=this.el.offsetHeight,c=getComputedStyle(this.el),h=c.direction==="rtl",l=this._isVertical(),a=parseFloat(c.getPropertyValue("--md-comp-slider-handle-width"))||4,m=l?r:o,p=a/2+t*(m-a);this.el.style.setProperty("--md-comp-slider-active-fraction",e),this.el.style.setProperty("--md-comp-slider-active-position",`${p}px`);let v=this._host(),y=v?.querySelectorAll('input[type="range"]');if(v&&y&&y.length===2){let b=Array.from(y).map(w=>this._fraction(w));v.style.setProperty("--md-comp-slider-start-fraction",`${Math.min(...b)*100}%`),v.style.setProperty("--md-comp-slider-end-fraction",`${Math.max(...b)*100}%`),v.style.setProperty("--md-comp-slider-start-position",`${a/2+Math.min(...b)*(m-a)}px`),v.style.setProperty("--md-comp-slider-end-position",`${a/2+Math.max(...b)*(m-a)}px`)}if(v?.classList.contains("stops")){let b=parseFloat(this.el.max),w=Number.isNaN(b)?100:b,D=parseFloat(this.el.min)||0,F=parseFloat(this.el.step);if(F>0&&Number.isFinite(F)){let M=Math.round((w-D)/F)+1;v.style.setProperty("--md-comp-slider-stop-count",String(Math.max(2,M)))}}this.value.textContent=this.el.value,l?(this.thumb.style.left=`${i+o/2}px`,this.thumb.style.top=`${s+r-p}px`):(this.thumb.style.left=`${i+(h?o-p:p)}px`,this.thumb.style.top=`${s}px`)}static Init(){u.onDocumentReady(()=>{d.init(document.querySelectorAll("input[type=range]"),{})})}};var T=class T{static Init(){u.onDocumentReady(()=>{document.addEventListener("pointerdown",T._onPointerDown,{passive:!0}),document.addEventListener("pointerup",T._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",T._onPointerCancel,{passive:!0})})}static _onPointerDown(n){if(!T._isPrimaryPress(n)){T._down=null;return}let t=T._backdropDialog(n);if(!t||!T._lightDismissible(t)||!T._outside(n,t)){T._down=null;return}T._down={dialog:t,pointerId:n.pointerId}}static _onPointerUp(n){let t=T._down;T._down=null,!(!t||t.pointerId!==n.pointerId)&&n.isPrimary&&(!t.dialog.isConnected||!t.dialog.open||T._lightDismissible(t.dialog)&&T._backdropDialog(n)===t.dialog&&T._outside(n,t.dialog)&&t.dialog.close())}static _onPointerCancel(){T._down=null}static _backdropDialog(n){let t=n.target;return!(t instanceof HTMLDialogElement)||!t.open?null:t}static _outside(n,t){let e=t.getBoundingClientRect();return n.clientX<e.left||n.clientX>e.right||n.clientY<e.top||n.clientY>e.bottom}static _isPrimaryPress(n){return n.isPrimary?n.pointerType!=="mouse"||n.button===0:!1}static _lightDismissible(n){let t=T._closedBy(n);return!(t==="none"||t==="closerequest"||t==="any"&&"closedBy"in HTMLDialogElement.prototype)}static _closedBy(n){let t=n.getAttribute("closedby");return t==="any"||t==="closerequest"||t==="none"?t:null}};T._down=null;var $=T;var yt=96,bt=.5,Jt=4;function at(d){let n=l=>d.axis==="x"?l.clientX:l.clientY,t,e=null,i=l=>{if(!(l instanceof Element))return null;let a=l.closest(d.selector);return a instanceof HTMLDialogElement?a:null},s=l=>{l.style.transition="",l.style.setProperty(d.property,"0px")},o=l=>{if(!l.isPrimary||l.pointerType==="mouse"&&l.button!==0)return;h(),d.onPress?.();let a=i(l.target);if(!a?.open){e=null;return}if(!d.inHandle(l,a)){e=null;return}a.style.transition="none",e={dialog:a,pointerId:l.pointerId,direction:d.direction(a),start:n(l),last:n(l),lastT:Date.now(),shift:0},t.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open"],attributeOldValue:!0})},r=l=>{if(!e||e.pointerId!==l.pointerId)return;if(!e.dialog.open||!e.dialog.isConnected){h();return}let a=n(l)-e.start;e.shift=e.direction===1?Math.max(0,a):Math.min(0,a),e.last=n(l),e.lastT=Date.now(),e.dialog.style.setProperty(d.property,`${e.shift}px`)},c=l=>{let a=e;if(!a||a.pointerId!==l.pointerId)return;if(!a.dialog.open||!a.dialog.isConnected){h();return}e=null,t.disconnect(),a.dialog.style.transition="";let m=Math.max(1,Date.now()-a.lastT),p=(n(l)-a.last)/m;d.onRelease?.(Math.abs(a.shift)>Jt),(a.direction===1?a.shift>yt||p>bt:a.shift<-yt||p<-bt)&&a.dialog.open&&a.dialog.close(),a.dialog.style.setProperty(d.property,"0px")},h=l=>{if(l&&e?.pointerId!==l.pointerId)return;t.disconnect(),d.onRelease?.(!1);let a=e;e=null,a&&s(a.dialog)};u.onDocumentReady(()=>{t=new MutationObserver(l=>{let a=e?.dialog;a&&(!a.open||!a.isConnected||l.some(m=>m.type==="attributes"&&m.target===a&&m.oldValue===null||[...m.removedNodes].some(p=>p.contains(a))))&&h()}),document.addEventListener("pointerdown",o,{passive:!0}),document.addEventListener("pointermove",r,{passive:!0}),document.addEventListener("pointerup",c,{passive:!0}),document.addEventListener("pointercancel",h,{passive:!0})})}var Lt="dialog.bottom-sheet, dialog.bottom",q=class q{static Init(){at({selector:Lt,axis:"y",property:"--md-comp-bottom-sheet-shift",direction:()=>1,inHandle:(n,t)=>{let e=n.target;if(e instanceof Element&&e.closest(".handle"))return!0;let i=t.getBoundingClientRect();return n.clientY>=i.top&&n.clientY<=i.top+48},onPress:()=>{q._dragged=!1},onRelease:n=>{q._dragged=n}}),u.onDocumentReady(()=>{document.addEventListener("click",q._onClick)})}static _onClick(n){let t=n.target;if(!(t instanceof Element))return;let e=t.closest(".handle, .drag-handle");if(!(e instanceof HTMLButtonElement)||n.detail!==0&&q._dragged)return;let i=e.closest(Lt);i instanceof HTMLDialogElement&&i.open&&i.close()}};q._dragged=!1;var K=q;var te=d=>d.classList.contains("left")||d.classList.contains("left-sheet")||d.classList.contains("start"),Tt=d=>te(d)!==(getComputedStyle(d).direction==="rtl"),z=class{static Init(){at({selector:"dialog.side-sheet, dialog.right, dialog.right-sheet, dialog.left, dialog.left-sheet",axis:"x",property:"--md-comp-side-sheet-shift",direction:n=>Tt(n)?-1:1,inHandle:(n,t)=>{let e=n.target;if(e instanceof Element&&e.closest("header"))return!0;let i=t.getBoundingClientRect();return Tt(t)?n.clientX>=i.right-24&&n.clientX<=i.right:n.clientX>=i.left&&n.clientX<=i.left+24}})}};var U=class d{static validateField(n){if(!n){console.error("No text field element found");return}let t=n.getAttribute("data-length")!==null,e=parseInt(n.getAttribute("data-length")),i=n.value.length;i===0&&n.validity.badInput===!1&&!n.required&&n.classList.contains("validate")?n.classList.remove("invalid"):n.classList.contains("validate")&&(n.validity.valid&&t&&i<=e||n.validity.valid&&!t?n.classList.remove("invalid"):n.classList.add("invalid"))}static textareaAutoResize(n){let t=n;if(!t)return;t.hasAttribute("original-height")||t.setAttribute("original-height",t.getBoundingClientRect().height.toString());let e=parseInt(t.getAttribute("original-height"));if(isNaN(e))return;t.style.height="auto";let i=t.offsetHeight-t.clientHeight,s=t.scrollHeight+i;t.style.height=Math.max(e,s)+"px"}static Init(){u.onDocumentReady(()=>{document.addEventListener("change",n=>{let t=n.target;t instanceof HTMLInputElement&&d.validateField(t)}),document.addEventListener("keyup",n=>{let t=n.target;t instanceof HTMLInputElement&&["radio","checkbox"].includes(t.type)&&n.key===u.keys.TAB&&(t.classList.add("tabbed"),t.addEventListener("blur",()=>t.classList.remove("tabbed"),{once:!0}))}),document.querySelectorAll(".expressive-textarea").forEach(n=>{d.InitTextarea(n)}),document.querySelectorAll('.file-field input[type="file"]').forEach(n=>{d.InitFileInputPath(n)})})}static InitTextarea(n){n.setAttribute("original-height",n.getBoundingClientRect().height.toString()),d.textareaAutoResize(n),n.addEventListener("input",t=>d.textareaAutoResize(t.target))}static InitFileInputPath(n){n.addEventListener("change",()=>{let e=n.closest(".file-field").querySelector("input.file-path"),i=n.files,s=[];for(let o=0;o<i.length;o++)s.push(i[o].name);e.value=s.join(", "),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))})}};var ee={},Y=class d extends _{constructor(t,e){super(t,e,d);this._observer=null;this._sentinel=null;this._input=null;this._view=null;this._searchOpen=!1;this._onIntersect=t=>{let e=t[0];e&&this.el.classList.toggle("collapsed",!e.isIntersecting)};this._onSearchViewClose=()=>{this._searchOpen=this._view.open};this._onSearchFocus=()=>{if(!(!this._view||this._searchOpen)){if(this._view instanceof HTMLDialogElement){this._searchOpen=!0,this._view.open||this._view.showModal();return}this._view.hidden=!1,this._input?.setAttribute("aria-expanded","true")}};this.el.Expressive_AppBar=this,this.options={...d.defaults,...e},this._setupCollapse(),this._setupSearch()}static get defaults(){return ee}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_AppBar}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._input?.removeEventListener("focus",this._onSearchFocus),this._input?.removeEventListener("click",this._onSearchFocus),this._view?.removeEventListener("close",this._onSearchViewClose),this.el.classList.remove("collapsed"),this.el.Expressive_AppBar=void 0}_setupCollapse(){!this.el.classList.contains("medium")&&!this.el.classList.contains("large")||typeof IntersectionObserver>"u"||(this._sentinel=document.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="display:block;width:100%;height:1px;margin-top:-1px;pointer-events:none;visibility:hidden",this.el.insertAdjacentElement("beforebegin",this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel))}_setupSearch(){if(this._input=this.el.querySelector('input[type="search"]'),!this._input)return;let t=this._input.getAttribute("aria-controls");t&&(this._view=document.getElementById(t)),this._view||(this._view=this.el.querySelector(".search-view")),this._view&&(this._input.addEventListener("focus",this._onSearchFocus),this._input.addEventListener("click",this._onSearchFocus),this._view instanceof HTMLDialogElement&&this._view.addEventListener("close",this._onSearchViewClose))}};var ie={},G=class d extends _{constructor(t,e){super(t,e,d);this.open=()=>{this.isOpen||(this.isOpen=!0,this._list&&(this._list.inert=!1),this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{if(!this.isOpen)return;let t=this.el.getRootNode().activeElement;t&&this._list?.contains(t)&&this._anchor?.focus(),this._list&&(this._list.inert=!0),this.isOpen=!1,this.el.classList.remove("active"),this._anchor?.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._handleDocumentClick),document.removeEventListener("keydown",this._handleDocumentKeydown)};this._handleFABClick=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("a, button");!i||i.matches(':disabled, [aria-disabled="true"]')||(i===this._anchor?this._toggle():this._list?.contains(i)&&this.close())};this._handleAnchorKeydown=t=>{(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{t.key===u.keys.ESC&&!t.defaultPrevented&&this.close()};this._handleDocumentClick=t=>{t.composedPath().includes(this.el)||this.close()};this.el.Expressive_FloatingActionButton=this,this.options={...d.defaults,...e},this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this._list=this.el.querySelector(":scope > ul, :scope > menu"),this._listWasInert=this._list?.inert??!1,this.el.classList.remove("active"),this._list&&(this._list.inert=!0),this._anchor?.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&(this._anchor.tabIndex<0&&(this._anchor.tabIndex=0),this._anchor.addEventListener("keydown",this._handleAnchorKeydown)),this.el.addEventListener("click",this._handleFABClick)}static get defaults(){return ie}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FloatingActionButton}destroy(){this.close(),this._list&&(this._list.inert=this._listWasInert),this.el.removeEventListener("click",this._handleFABClick),this._anchor?.removeEventListener("keydown",this._handleAnchorKeydown),this.el.Expressive_FloatingActionButton=void 0}_toggle(){this.isOpen?this.close():this.open()}};var se={},ne=new Set(["single","multiple"]),Mt="button-group-pressed",oe=.15,X=class d extends _{constructor(t,e={}){super(t,e,d);this._pressedStyles=new Map;this._releaseStyles=new Map;this._releaseTimer=null;this._originalPressed=new Map;this._activeItem=null;this._handleClick=t=>{if(!this._selectionMode)return;let e=this._itemFromEvent(t);if(!(e instanceof HTMLButtonElement)||this._isDisabled(e))return;this._rememberPressed(e);let i=e.getAttribute("aria-pressed")!=="true",s=this._toggleItems.filter(o=>o.getAttribute("aria-pressed")==="true").length;!i&&this.el.hasAttribute("data-selection-required")&&s===1||(this._selectionMode==="single"&&i&&this._toggleItems.forEach(o=>{this._rememberPressed(o),o.setAttribute("aria-pressed","false")}),e.setAttribute("aria-pressed",i?"true":"false"))};this._handlePointerDown=t=>{if(t.button!==0)return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyDown=t=>{if(t.repeat||t.key!==" "&&t.key!=="Enter")return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyUp=t=>{(t.key===" "||t.key==="Enter")&&this._resetPress()};this._handleFocusOut=t=>{t.target===this._activeItem&&this._resetPress()};this._resetPress=()=>{if(this._activeItem?.classList.remove(Mt),this._activeItem=null,!!this._pressedStyles.size){this._finishRelease(),this._releaseStyles=new Map(this._pressedStyles);for(let[t,e]of this._releaseStyles)t.style.width=`${e.baseWidth}px`;this._pressedStyles.clear(),this._releaseTimer=window.setTimeout(this._finishRelease,200)}};this._finishRelease=()=>{this._releaseTimer!==null&&window.clearTimeout(this._releaseTimer),this._releaseTimer=null;for(let[t,e]of this._releaseStyles)t.style.width=e.width;this._releaseStyles.clear()};this.el.Expressive_ButtonGroup=this,this.options={...d.defaults,...e},this._selectionMode&&(this._normalizeSelection(),this.el.addEventListener("click",this._handleClick,!0)),this.el.addEventListener("pointerdown",this._handlePointerDown),this.el.addEventListener("keydown",this._handleKeyDown),this.el.addEventListener("focusout",this._handleFocusOut),document.addEventListener("pointerup",this._resetPress),document.addEventListener("pointercancel",this._resetPress),document.addEventListener("keyup",this._handleKeyUp),window.addEventListener("blur",this._resetPress)}static get defaults(){return se}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ButtonGroup}destroy(){this._resetPress(),this._finishRelease(),this.el.removeEventListener("click",this._handleClick,!0),this.el.removeEventListener("pointerdown",this._handlePointerDown),this.el.removeEventListener("keydown",this._handleKeyDown),this.el.removeEventListener("focusout",this._handleFocusOut),document.removeEventListener("pointerup",this._resetPress),document.removeEventListener("pointercancel",this._resetPress),document.removeEventListener("keyup",this._handleKeyUp),window.removeEventListener("blur",this._resetPress);for(let[t,e]of this._originalPressed)e===null?t.removeAttribute("aria-pressed"):t.setAttribute("aria-pressed",e);this._originalPressed.clear(),this.el.Expressive_ButtonGroup=void 0}get _selectionMode(){let t=this.el.dataset.selection;return ne.has(t)?t:null}get _items(){return Array.from(this.el.children).filter(t=>t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement&&t.classList.contains("button"))}get _toggleItems(){return this._items.filter(t=>t instanceof HTMLButtonElement)}_normalizeSelection(){let t=this._toggleItems;t.forEach(e=>{this._rememberPressed(e),["true","false"].includes(e.getAttribute("aria-pressed")||"")||e.setAttribute("aria-pressed","false")}),this._selectionMode==="single"&&t.filter(i=>i.getAttribute("aria-pressed")==="true").slice(1).forEach(i=>i.setAttribute("aria-pressed","false")),this.el.hasAttribute("data-selection-required")&&!t.some(e=>e.getAttribute("aria-pressed")==="true")&&t.find(e=>!this._isDisabled(e))?.setAttribute("aria-pressed","true")}_itemFromEvent(t){if(!(t.target instanceof Element))return null;let e=t.target.closest("button, a.button");return e instanceof HTMLElement&&e.parentElement===this.el?e:null}_isDisabled(t){return t instanceof HTMLButtonElement&&t.disabled||t.getAttribute("aria-disabled")==="true"||t.classList.contains("disabled")}_rememberPressed(t){this._originalPressed.has(t)||this._originalPressed.set(t,t.getAttribute("aria-pressed"))}_startPress(t){if(this._activeItem)return;this._finishRelease();let e=this._items,i=e.indexOf(t);if(i<0||(this._activeItem=t,t.classList.add(Mt),this.el.classList.contains("connected")||e.length<2))return;let s=e.map(p=>p.getBoundingClientRect()),o=s[i].width;if(o<=0)return;let r=Number.parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-button-group-pressed-item-width-multiplier")),c=Number.isFinite(r)?r:.15,h=o*c,l=[i-1,i+1].filter(p=>p>=0&&p<e.length),a=new Map;if(l.length===1){let p=l[0];a.set(p,Math.min(h,this._compressionCapacity(e[p],s[p])))}else{let p=h/2;for(let y of l)a.set(y,Math.min(p,this._compressionCapacity(e[y],s[y])));let v=h-[...a.values()].reduce((y,b)=>y+b,0);for(let y of l){if(v<=0)break;let b=this._compressionCapacity(e[y],s[y])-a.get(y),w=Math.min(v,b);a.set(y,a.get(y)+w),v-=w}}let m=[...a.values()].reduce((p,v)=>p+v,0);m<=0||(e.forEach((p,v)=>{this._pressedStyles.set(p,{width:p.style.width,baseWidth:s[v].width}),p.style.width=`${s[v].width}px`}),this.el.offsetWidth,e.forEach((p,v)=>{let y=v===i?m:-(a.get(v)||0);p.style.width=`${s[v].width+y}px`}))}_compressionCapacity(t,e){let i=t.classList.contains("icon-button")?e.width*(1-oe):e.height;return Math.max(0,e.width-i)}};var ae={duration:200,fullWidth:!1,indicators:!1,noWrap:!1,interval:0,height:null,onCycleTo:null,i18n:{carousel:"Carousel",item:"Item",of:"of",indicators:"Slides",slide:"Slide"}},x=class x extends _{constructor(t,e){super(t,e,x);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._alignAfterResize=!1;this._trackRaf=null;this._started=!1;this._vertical=!1;this._resizeObserver=null;this._resizeTimeout=null;this._usesWindowResize=!1;this._dragPointerId=null;this._dragStartX=0;this._dragStartY=0;this._dragStartScroll=0;this._suppressClick=!1;this._suppressClickTimeout=null;this._generatedContainerRole=!1;this._generatedContainerLabel=!1;this._generatedContainerDescription=!1;this._generatedWideLayout=!1;this._generatedFixedHeight=!1;this._authoredInlineHeight=null;this._autoAdvanceTimer=null;this._autoAdvances=!1;this._autoPaused=!1;this._hovered=!1;this._focused=!1;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._generatedItemTabIndexes=new Set;this._generatedItemLabels=new Set;this._generatedItemDescriptions=new Set;this._generatedItemSizes=new Set;this._authoredItemSizes=new Set;this._itemA11yOriginal=new Map;this._handleThrottledResize=()=>{!this._started||this._resizeTimeout!==null||(this._handleResize(),this._resizeTimeout=setTimeout(()=>{this._resizeTimeout=null,this._handleResize()},200))};this._handleAutoAdvanceState=t=>{t.type==="mouseenter"?this._hovered=!0:t.type==="mouseleave"?this._hovered=!1:t.type==="focusin"?this._focused=!0:t.type==="focusout"&&(this._focused=this.el.contains(t.relatedTarget)),this._syncAutoAdvance()};this._handleMotionChange=()=>{this._syncAutoAdvance(),this._motion.matches&&this._scrollToIndex(this.center,!1),this._updateParallax()};this._tick=()=>{this._autoAdvanceTimer=null,this._advance(),this._syncAutoAdvance()};this._advance=()=>{let t=this.center+1;if(t<this.count){this.set(t);return}if(this.options.noWrap){this._autoAdvances=!1,this._syncAutoAdvance();return}this.set(0)};this._handleNativeScroll=()=>{this._alignAfterResize=!1,this._finishScroll()};this._handleTrackPointerDown=t=>{if(this._handleNativeScroll(),!(t.pointerType!=="mouse"||t.button!==0)){this.pressed=!0,this.dragged=!1,this._suppressClick=!1,this._dragPointerId=t.pointerId,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._dragStartScroll=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft;try{this._scroller.setPointerCapture(t.pointerId)}catch{}}};this._handleTrackPointerMove=t=>{if(!this.pressed||t.pointerId!==this._dragPointerId)return;let e=t.clientX-this._dragStartX,i=t.clientY-this._dragStartY,s=this._vertical?i:e,o=this._vertical?e:i;if(!this.dragged){if(Math.abs(s)<6||Math.abs(s)<=Math.abs(o))return;this.dragged=!0,this.el.classList.add("dragging")}this._vertical?this._scroller.scrollTop=this._dragStartScroll-i:this._scroller.scrollLeft=this._dragStartScroll-e,t.preventDefault()};this._handleTrackPointerUp=t=>{if(!(!this.pressed||t.pointerId!==this._dragPointerId)){this.pressed=!1,this._dragPointerId=null,this.el.classList.remove("dragging");try{this._scroller.releasePointerCapture(t.pointerId)}catch{}this.dragged&&(this._suppressClick=!0,window.clearTimeout(this._suppressClickTimeout),this._suppressClickTimeout=setTimeout(()=>{this._suppressClick=!1},0),this._syncActive(this._nearestIndex(),!0))}};this._handleTrackClick=t=>{this._suppressClick&&(this._suppressClick=!1,t.preventDefault(),t.stopImmediatePropagation())};this._handleTrackDragStart=t=>{t.target.closest("img, picture, video")&&t.preventDefault()};this._handleItemResize=t=>{this._alignAfterResize&&!this.pressed&&t.propertyName==="flex-basis"&&this.images.includes(t.target)&&this._scrollToIndex(this.center,!1)};this._handleIndicatorClick=t=>{t.stopPropagation();let e=t.target.closest(".indicator-item");if(!e||!this._indicators.contains(e))return;let i=[...this._indicators.children].indexOf(e);i<0||this._cycleTo(i)};this._handleKeydown=t=>{let e=t.target;if(e.isContentEditable||e.closest("input, textarea, select"))return;let i=getComputedStyle(this._scroller).direction==="rtl",s=this._vertical?t.key==="ArrowDown":t.key===(i?u.keys.ARROW_LEFT:u.keys.ARROW_RIGHT),o=this._vertical?t.key==="ArrowUp":t.key===(i?u.keys.ARROW_RIGHT:u.keys.ARROW_LEFT);t.key==="Home"?(t.preventDefault(),this.set(0),this._focusItem(0)):t.key==="End"?(t.preventDefault(),this.set(this.count-1),this._focusItem(this.count-1)):s?(t.preventDefault(),this.next(),this._focusItem(this.center)):o&&(t.preventDefault(),this.prev(),this._focusItem(this.center))};this._handleTrackScroll=()=>{this.el.classList.contains("scrolling")||this.el.classList.add("scrolling"),window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=setTimeout(()=>this.el.classList.remove("scrolling"),120),this._trackRaf===null&&(this._trackRaf=requestAnimationFrame(()=>{if(this._trackRaf=null,this._updateParallax(),this._ignoreScroll)return;let t=this._nearestIndex();t!==this.center&&this._syncActive(t,this.dragged)}))};this._handleResize=()=>{!this._started||!this.images.length||(this._syncAdaptiveMode(),this._syncLayoutRoles(this.center),this._scrollToIndex(this.center,!1),this._updateParallax())};this._finishScroll=()=>{this._ignoreScroll=!1,clearTimeout(this._scrollEndTimeout),this._scroller.removeEventListener("scrollend",this._handleScrollEnd)};this._handleScrollEnd=()=>{this.images.some(t=>t.getAnimations().some(e=>e.playState==="running"))||this._finishScroll()};if(this.el.Expressive_Carousel=this,this.options={...x.defaults,...e},e?.i18n&&(this.options.i18n={...x.defaults.i18n,...e.i18n}),(this.options.fullWidth||this.el.classList.contains("flat"))&&(this.el.classList.add("flat"),this.options.fullWidth=!0),this._vertical=this.el.classList.contains("full-screen"),this.pressed=!1,this.dragged=!1,this.images=this._collectItems(),!this.images.length){console.error("Carousel: no .carousel-item elements to show");return}this.images.forEach(s=>{this._itemA11yOriginal.set(s,{ariaHidden:s.getAttribute("aria-hidden"),tabIndex:s.getAttribute("tabindex")}),s.hasAttribute("data-carousel-size")&&this._authoredItemSizes.add(s)}),this.hasMultipleSlides=this.images.length>1,this.showIndicators=this.options.indicators&&this.hasMultipleSlides,this.count=this.images.length,this._autoAdvances=this.options.interval>0&&this.hasMultipleSlides,this.images.forEach(s=>s.classList.add("carousel-item")),this.options.height!==null&&(this._generatedFixedHeight=!this.el.classList.contains("fixed-height"),this._authoredInlineHeight=this.el.style.getPropertyValue("--carousel-height")||null,this.el.classList.add("fixed-height"),this.el.style.setProperty("--carousel-height",`${this.options.height}px`)),this._wrapTrack(),this._syncAdaptiveMode(),this.showIndicators&&this._setupIndicators(),this._setupAccessibility(),this._setupEventHandlers(),this._started=!0;let i=Math.max(0,this.images.findIndex(s=>s.classList.contains("active")));this.center=i,this._syncActive(i,!1),this._updateParallax(),this._scrollToIndex(i,!1),this._syncAutoAdvance()}get _scroller(){return this._trackEl??this.el}static get defaults(){return ae}static init(t,e={}){return super.init(t,e,x)}static getInstance(t){return t.Expressive_Carousel}destroy(){this._started&&this._teardown(),this.el.Expressive_Carousel=void 0}_collectItems(){let t=Array.from(this.el.children).filter(e=>e instanceof HTMLElement&&e.classList.contains("carousel-item"));return t.length?t:Array.from(this.el.children).filter(e=>!(e instanceof HTMLElement)||e.classList.contains("indicators")||e.classList.contains("carousel-fixed-item")?!1:e.tagName!=="NAV")}_setupAccessibility(){this.el.hasAttribute("role")||(this.el.setAttribute("role","region"),this._generatedContainerRole=!0),!this.el.hasAttribute("aria-label")&&!this.el.hasAttribute("aria-labelledby")&&(this.el.setAttribute("aria-label",this.options.i18n.carousel),this._generatedContainerLabel=!0),this.el.hasAttribute("aria-roledescription")||(this.el.setAttribute("aria-roledescription","carousel"),this._generatedContainerDescription=!0);let t='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';this.images.forEach((e,i)=>{if(e.hasAttribute("aria-roledescription")||(e.setAttribute("aria-roledescription","slide"),this._generatedItemDescriptions.add(e)),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")){let s=e.querySelector("img[alt]")?.getAttribute("alt")?.trim(),o=e.textContent?.replace(/\s+/g," ").trim(),r=s||o,c=`${this.options.i18n.item} ${i+1} ${this.options.i18n.of} ${this.count}`;e.setAttribute("aria-label",r?`${r}, ${c}`:c),this._generatedItemLabels.add(e)}!e.matches(t)&&!e.querySelector(t)&&(e.tabIndex=0,this._generatedItemTabIndexes.add(e))})}_setupIndicators(){let t=Array.from(this.el.children).find(e=>e instanceof HTMLElement&&e.classList.contains("indicators"));this._indicators=t??document.createElement("nav"),this._ownIndicators=!t,this._indicators.classList.add("indicators"),this._indicators.setAttribute("aria-label",this.options.i18n.indicators),this._indicators.replaceChildren(),this.images.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.classList.add("indicator-item"),i===0&&(s.classList.add("active"),s.setAttribute("aria-current","true")),s.setAttribute("aria-label",`${this.options.i18n.slide} ${i+1}`),this._indicators.appendChild(s)}),this._ownIndicators&&this.el.appendChild(this._indicators),this.el.querySelector(".carousel-fixed-item")?.classList.add("with-indicators")}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleKeydown),this._motion.addEventListener("change",this._handleMotionChange),this._autoAdvances&&(this.el.addEventListener("mouseenter",this._handleAutoAdvanceState),this.el.addEventListener("mouseleave",this._handleAutoAdvanceState),this.el.addEventListener("focusin",this._handleAutoAdvanceState),this.el.addEventListener("focusout",this._handleAutoAdvanceState),document.addEventListener("visibilitychange",this._handleAutoAdvanceState)),this.showIndicators&&this._indicators&&this._indicators.addEventListener("click",this._handleIndicatorClick),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._handleThrottledResize()),this._resizeObserver.observe(this.el)),this._usesWindowResize=!this._resizeObserver||this.el.classList.contains("full-screen"),this._usesWindowResize&&(x._live.add(this),x._resizeListening||(window.addEventListener("resize",x._onResize,{passive:!0}),x._resizeListening=!0)),this._scroller.addEventListener("scroll",this._handleTrackScroll,{passive:!0}),this._scroller.addEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.addEventListener("wheel",this._handleNativeScroll,{passive:!0}),this._scroller.addEventListener("pointermove",this._handleTrackPointerMove),this._scroller.addEventListener("pointerup",this._handleTrackPointerUp),this._scroller.addEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.addEventListener("click",this._handleTrackClick,!0),this._scroller.addEventListener("dragstart",this._handleTrackDragStart),this._scroller.addEventListener("transitionend",this._handleItemResize)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleKeydown),this._motion.removeEventListener("change",this._handleMotionChange),this.el.removeEventListener("mouseenter",this._handleAutoAdvanceState),this.el.removeEventListener("mouseleave",this._handleAutoAdvanceState),this.el.removeEventListener("focusin",this._handleAutoAdvanceState),this.el.removeEventListener("focusout",this._handleAutoAdvanceState),document.removeEventListener("visibilitychange",this._handleAutoAdvanceState),this._indicators&&this._indicators.removeEventListener("click",this._handleIndicatorClick),this._scroller.removeEventListener("scroll",this._handleTrackScroll),this._scroller.removeEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.removeEventListener("wheel",this._handleNativeScroll),this._scroller.removeEventListener("pointermove",this._handleTrackPointerMove),this._scroller.removeEventListener("pointerup",this._handleTrackPointerUp),this._scroller.removeEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.removeEventListener("click",this._handleTrackClick,!0),this._scroller.removeEventListener("dragstart",this._handleTrackDragStart),this._scroller.removeEventListener("transitionend",this._handleItemResize),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._usesWindowResize&&(x._live.delete(this),x._live.size===0&&x._resizeListening&&(window.removeEventListener("resize",x._onResize),x._resizeListening=!1))}_teardown(){this._started=!1,this._removeEventHandlers(),this._finishScroll(),this._autoAdvances=!1,this._syncAutoAdvance(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),window.clearTimeout(this._suppressClickTimeout),clearTimeout(this._resizeTimeout),this._ownIndicators&&this._indicators?.remove(),this._unwrapTrack(),this.images.forEach(t=>{t.style.removeProperty("--md-comp-carousel-item-parallax"),this._generatedItemLabels.has(t)&&t.removeAttribute("aria-label"),this._generatedItemDescriptions.has(t)&&t.removeAttribute("aria-roledescription"),this._generatedItemSizes.has(t)&&t.removeAttribute("data-carousel-size");let e=this._itemA11yOriginal.get(t);e?.ariaHidden===null?t.removeAttribute("aria-hidden"):e&&t.setAttribute("aria-hidden",e.ariaHidden),e?.tabIndex===null?t.removeAttribute("tabindex"):e&&t.setAttribute("tabindex",e.tabIndex)}),this._generatedContainerRole&&this.el.removeAttribute("role"),this._generatedContainerLabel&&this.el.removeAttribute("aria-label"),this._generatedContainerDescription&&this.el.removeAttribute("aria-roledescription"),this._generatedFixedHeight&&this.el.classList.remove("fixed-height"),this.options.height!==null&&(this._authoredInlineHeight===null?this.el.style.removeProperty("--carousel-height"):this.el.style.setProperty("--carousel-height",this._authoredInlineHeight)),this._generatedWideLayout&&this.el.classList.remove("multi-wide","multi-large","multi-extra-large","full-screen-horizontal")}_syncAutoAdvance(){let t=this._autoAdvances&&!this._autoPaused&&!this._hovered&&!this._focused&&!this._motion.matches&&!document.hidden;t&&this._autoAdvanceTimer===null?this._autoAdvanceTimer=setTimeout(this._tick,this.options.duration+this.options.interval):!t&&this._autoAdvanceTimer!==null&&(clearTimeout(this._autoAdvanceTimer),this._autoAdvanceTimer=null)}_paintIndicators(t){if(!this.showIndicators||!this._indicators)return;let e=(t%this.count+this.count)%this.count;this._indicators.querySelectorAll(".indicator-item").forEach((i,s)=>{let o=s===e;i.classList.toggle("active",o),o?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")})}_syncActive(t,e){let i=this.center;this.center=t,this.images.forEach((o,r)=>o.classList.toggle("active",r===t)),this._paintIndicators(t),this._syncLayoutRoles(t);let s=this.images[t];i!==t&&typeof this.options.onCycleTo=="function"&&this.options.onCycleTo.call(this,s,e),typeof this.oneTimeCallback=="function"&&(this.oneTimeCallback.call(this,s,e),this.oneTimeCallback=null)}_syncLayoutRoles(t){let e=(h,l)=>{this._authoredItemSizes.has(h)||(h.setAttribute("data-carousel-size",l),this._generatedItemSizes.add(h))};if(this.images.forEach(h=>e(h,"large")),this.el.classList.contains("flat")||this.el.classList.contains("uncontained")||this.el.classList.contains("full-screen")&&this._vertical)return;if(this.el.classList.contains("hero")||this.el.classList.contains("full-screen-horizontal")){let h=this.images[t+1];if(h&&e(h,"small"),this.el.classList.contains("center-aligned")){let l=this.images[t-1];l&&e(l,"small")}return}let i=this.el.clientWidth,s=i>=1600?4:i>=1200?3:i>=600?2:1,o=Math.min(s,Math.max(1,this.count-2));this.el.classList.remove("multi-wide","multi-large","multi-extra-large"),o===2?this.el.classList.add("multi-wide"):o===3?this.el.classList.add("multi-large"):o>=4&&this.el.classList.add("multi-extra-large"),this._generatedWideLayout=this._generatedWideLayout||o>1;for(let h=1;h<o;h+=1){let l=this.images[t+h];l&&e(l,"large")}let r=this.images[t+o],c=this.images[t+o+1];r&&e(r,"medium"),c&&e(c,"small")}_syncAdaptiveMode(){if(!this.el.classList.contains("full-screen"))return;let t=window.matchMedia("(orientation: landscape)").matches,e=this.el.clientWidth>=840||t,i=this._vertical;this._vertical=!e,this.el.classList.toggle("full-screen-horizontal",e),this._generatedWideLayout=this._generatedWideLayout||e,this._started&&i!==this._vertical&&this._scroller.scrollTo({left:0,top:0,behavior:"auto"})}_focusItem(t){let e=this.images[t];if(!e)return;((e.matches('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')?e:e.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??e).focus({preventScroll:!0})}_updateParallax(){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){this.images.forEach(s=>s.style.setProperty("--md-comp-carousel-item-parallax","0px"));return}let t=this._scroller.getBoundingClientRect(),e=this._vertical?t.top+t.height/2:t.left+t.width/2,i=Math.max(1,this._vertical?t.height:t.width);this.images.forEach(s=>{let o=s.getBoundingClientRect(),r=this._vertical?o.top+o.height/2:o.left+o.width/2,c=Math.max(-1,Math.min(1,(r-e)/i));s.style.setProperty("--md-comp-carousel-item-parallax",`${c*-24}px`)})}_wrapTrack(){let t=document.createElement("div");t.className="carousel-track",this.images[0].before(t),this.images.forEach(e=>t.appendChild(e)),this._trackEl=t}_unwrapTrack(){this._trackEl&&(this.images.forEach(t=>this.el.insertBefore(t,this._trackEl)),this._trackEl.remove(),this._trackEl=null)}_nearestIndex(){let t=this.el.classList.contains("center-aligned"),e=getComputedStyle(this._scroller),i=!this._vertical&&e.direction==="rtl",s=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,o=this._vertical?this._scroller.clientHeight:this._scroller.clientWidth,r=(this._vertical?this._scroller.scrollHeight:this._scroller.scrollWidth)-o,c=parseFloat(this._vertical?e.paddingBlockStart:e.paddingInlineStart)||0,h=this.center,l=1/0;return this.images.forEach((a,m)=>{let p=this._vertical?a.offsetTop:a.offsetLeft,v=this._vertical?a.offsetHeight:a.offsetWidth,y=t?p-(o-v)/2:p+(i?v-o+c:-c),b=Math.max(i?-r:0,Math.min(i?0:r,y)),w=Math.abs(b-s);(w<l||w===l&&m===this.center)&&(l=w,h=m)}),h}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;this._finishScroll();let s=this.el.classList.contains("center-aligned"),o=getComputedStyle(this._scroller),r=Number.parseFloat(o.paddingInlineStart)||0,c=Number.parseFloat(o.paddingBlockStart)||0,h=s?i.offsetLeft-(this._scroller.clientWidth-i.offsetWidth)/2:o.direction==="rtl"?i.offsetLeft+i.offsetWidth-this._scroller.clientWidth+r:i.offsetLeft-r,l=i.offsetTop-c;this._ignoreScroll=!0,this._scroller.scrollTo({left:this._vertical?0:h,top:this._vertical?l:0,behavior:e&&!this._motion.matches?"smooth":"instant"}),this._scroller.addEventListener("scrollend",this._handleScrollEnd),this._scrollEndTimeout=setTimeout(this._finishScroll,this.options.duration+350)}_cycleTo(t,e=null){this._alignAfterResize=!0,typeof e=="function"&&(this.oneTimeCallback=e),this._syncActive(t,!1),this._scrollToIndex(t)}pause(){this._autoPaused=!0,this._syncAutoAdvance()}start(){this._autoPaused=!1,this._syncAutoAdvance()}next(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center+t;e>=this.count||e<0||this._cycleTo(e)}prev(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center-t;e>=this.count||e<0||this._cycleTo(e)}set(t,e){(t===void 0||isNaN(t))&&(t=0),!(t>=this.count||t<0)&&this._cycleTo(t,e)}};x._live=new Set,x._resizeListening=!1,x._onResize=u.throttle(()=>{x._live.forEach(t=>t._handleResize())},200);var N=x;var re=Object.freeze({}),rt=class d extends _{constructor(t,e){super(t,{},d);this.updateCounter=()=>{let t=parseInt(this.el.getAttribute("maxlength")),e=this.el.value.length;this.isValidLength=e<=t;let i=e.toString();t&&(i+="/"+t,this._validateInput()),this.counterEl.textContent=i};this.el.Expressive_CharacterCounter=this,this.options={...d.defaults,...e},this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers()}static get defaults(){return re}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_CharacterCounter}destroy(){this._removeEventHandlers(),this.el.Expressive_CharacterCounter=void 0,this._removeCounter()}_setupEventHandlers(){this.el.addEventListener("focus",this.updateCounter,!0),this.el.addEventListener("input",this.updateCounter,!0)}_removeEventHandlers(){this.el.removeEventListener("focus",this.updateCounter,!0),this.el.removeEventListener("input",this.updateCounter,!0)}_setupCounter(){this.counterEl=document.createElement("span"),this.counterEl.classList.add("character-counter"),this.counterEl.setAttribute("aria-live","polite"),this.counterEl.setAttribute("aria-atomic","true"),this.counterEl.style.float="right",this.counterEl.style.fontSize="12px",this.counterEl.style.height="1",this.el.parentElement.appendChild(this.counterEl)}_removeCounter(){this.counterEl.remove()}_validateInput(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.el.classList.remove("invalid")):!this.isValidLength&&!this.isInvalid&&(this.isInvalid=!0,this.el.classList.remove("valid"),this.el.classList.add("invalid"))}};var le={classes:"",menuOptions:{}},k=class d extends _{constructor(t,e){super(t,e,d);this._handleSelectChange=()=>{this._setValueToInput(),this._setSelectedStates()};this._handleReset=t=>{clearTimeout(this._resetTimer),this._resetTimer=setTimeout(()=>{t.defaultPrevented||this._handleSelectChange()},0)};this._handleOptionKeydown=t=>{(t.key===" "||t.key==="Enter")&&this._handleOptionClick(t)};this._handleOptionClick=t=>{t.preventDefault();let e=t.target.closest("li");this._selectOptionElement(e),t.stopPropagation()};this._handleOptionFocus=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest('li[role="option"]');i?.id&&this.input.setAttribute("aria-activedescendant",i.id)};this._handleInputClick=()=>{this.menu&&this.menu.isOpen&&(this._setValueToInput(),this._setSelectedStates())};!this.el.classList.contains("browser-default")&&(this.el.Expressive_FormSelect=this,this.options={...d.defaults,...e},this.isMultiple=this.el.multiple,this.nativeTabIndex=this.el.tabIndex??-1,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._originalLabelFor=null,this._setupMenu(),this._setupEventHandlers())}static get defaults(){return le}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FormSelect}destroy(){this._removeEventHandlers(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,this.el.Expressive_FormSelect=void 0}refresh(){if(!this.menuEl)return;this._bindForm();let t=this.menuEl.getRootNode(),e=this._values.find(i=>i.optionEl.contains(t.activeElement))?.el;this.input.disabled=this.el.matches(":disabled"),this.wrapper.classList.toggle("disabled",this.input.disabled),this.input.disabled?this.menu?.close():this.menu||this._initMenu(),this.input.removeAttribute("aria-activedescendant"),this._rebuildOptions(),this._handleSelectChange(),this.menu&&(this.menu.focusedIndex=-1),this.menu?.isOpen&&(this.menu.recalculateDimensions(),e&&(this._values.find(i=>i.el===e)?.optionEl??this.input).focus())}_setupEventHandlers(){this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange),this.input.addEventListener("click",this._handleInputClick),this.menuEl.addEventListener("focusin",this._handleOptionFocus),this._bindForm()}_bindForm(){this._form?.removeEventListener("reset",this._handleReset),this._form=this.el.form,this._form?.addEventListener("reset",this._handleReset)}_removeEventHandlers(){this._removeOptionHandlers(),this.el.removeEventListener("change",this._handleSelectChange),this.input?.removeEventListener("click",this._handleInputClick),this.menuEl?.removeEventListener("focusin",this._handleOptionFocus),this._form?.removeEventListener("reset",this._handleReset),clearTimeout(this._resetTimer)}_setupOptionHandlers(){this.menuEl.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.addEventListener("click",this._handleOptionClick),t.addEventListener("keydown",this._handleOptionKeydown)})}_removeOptionHandlers(){this.menuEl?.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.removeEventListener("click",this._handleOptionClick),t.removeEventListener("keydown",this._handleOptionKeydown)})}_arraysEqual(t,e){if(t===e)return!0;if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}_selectOptionElement(t){if(!this.el.matches(":disabled")){if(!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(r=>r.optionEl===t);if(!e||e.el.matches(":disabled"))return;let i=this.getSelectedValues();this.isMultiple?this._toggleEntryFromArray(e):(this._deselectAll(),this._selectValue(e)),this._handleSelectChange();let s=this.getSelectedValues();!this._arraysEqual(i,s)&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))}this.isMultiple||this.menu?.close()}}_setupMenu(){this.labelEl=this.el.labels?.[0]??null,this._setupWrapper(),this._hideNativeSelect(),this.el.matches(":disabled")&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement("menu"),this.menuEl.id=`select-options-${u.guid()}`,this.menuEl.setAttribute("popover","auto"),this.menuEl.setAttribute("role","listbox"),this.menuEl.ariaMultiSelectable=this.isMultiple.toString(),this.isMultiple&&this.menuEl.classList.add("multiple-select-menu"),this._buildOptions(),this.wrapper.append(this.menuEl),this._buildInput(),this._buildCaret(),this._initMenu(),this._setSelectedStates(),this.labelEl&&this.input.after(this.labelEl)}_setupWrapper(){let t=this.el.parentElement;t&&t.matches(".field")&&!t.querySelector(":scope > .hide-select")&&!t.querySelector(":scope > input, :scope > textarea")?(this.wrapper=t,this._createdWrapper=!1):(this.wrapper=document.createElement("div"),this.wrapper.classList.add("field"),this._createdWrapper=!0,this.el.before(this.wrapper)),this.options.classes.length>0&&this.wrapper.classList.add(...this.options.classes.split(" ").filter(Boolean))}_hideNativeSelect(){let t=document.createElement("div");t.classList.add("hide-select"),this.el.before(t),t.appendChild(this.el),this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+u.guid(),this.input.classList.add("menu-trigger","no-autoinit"),this.input.type="text",this.input.readOnly=!0,this.input.setAttribute("data-target",this.menuEl.id),this.input.ariaReadOnly="true",this.input.ariaRequired=this.el.hasAttribute("required").toString(),this.input.disabled=this.el.matches(":disabled"),this.input.setAttribute("tabindex",this.nativeTabIndex.toString());let t=this.el.attributes;for(let e=0;e<t.length;++e){let i=t[e];i.name.startsWith("aria-")&&this.input.setAttribute(i.name,i.value)}this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","listbox"),this.input.ariaExpanded="false",this.input.setAttribute("aria-controls",this.menuEl.id),this.input.placeholder=" ",this.labelEl&&(this._originalLabelFor=this.labelEl.htmlFor,this.labelEl.htmlFor=this.input.id),this.wrapper.prepend(this.input),this._setValueToInput()}_buildCaret(){let t=document.createElement("span");t.classList.add("caret"),t.setAttribute("aria-hidden","true"),this.wrapper.prepend(t)}_initMenu(){if(this.el.matches(":disabled"))return;let t={...this.options.menuOptions};t.coverTrigger=!1;let e=t.onOpenEnd,i=t.onCloseEnd;t.onOpenEnd=()=>{let s=this.menuEl.querySelector(".selected");if(s){if(this.menu.focusedIndex=[...s.parentNode.children].indexOf(s),this.menu._focusFocusedItem(),this.menu.isScrollable){let o=s.getBoundingClientRect().top-this.menuEl.getBoundingClientRect().top;o-=this.menuEl.clientHeight/2,this.menuEl.scrollTop=o}s.id&&this.input.setAttribute("aria-activedescendant",s.id)}this.input.ariaExpanded="true",e&&typeof e=="function"&&e.call(this.menu,this.el)},t.onCloseEnd=()=>{this.input.ariaExpanded="false",this.input.removeAttribute("aria-activedescendant"),i&&typeof i=="function"&&i.call(this.menu,this.el)},t.closeOnClick=!1,this.menu=O.init(this.input,t)}_nativeOptions(){return Array.from(this.el.children).filter(t=>["OPTION","OPTGROUP"].includes(t.tagName))}_buildOptions(){this.selectOptions=this._nativeOptions(),this._values=[],this.selectOptions.forEach(t=>{if(t.tagName==="OPTION"){let e=this._createAndAppendOptionWithIcon(t,this.isMultiple?"multiple":void 0);this._addOptionToValues(t,e)}else if(t.tagName==="OPTGROUP"){let e="opt-group-"+u.guid(),i=document.createElement("li");i.classList.add("optgroup"),i.tabIndex=-1,i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e);let s=document.createElement("span");s.id=e,s.setAttribute("role","presentation"),s.textContent=t.getAttribute("label")??"",i.replaceChildren(s),this.menuEl.append(i);let o=[];Array.from(t.children).filter(c=>c.tagName==="OPTION").forEach(c=>{let h=this._createAndAppendOptionWithIcon(c,"optgroup-option");o.push(h.id),this._addOptionToValues(c,h)}),i.setAttribute("aria-owns",o.join(" "))}})}_rebuildOptions(){this._removeOptionHandlers(),this.menuEl.replaceChildren(),this._buildOptions(),this._setupOptionHandlers(),this.menu?._makeMenuFocusable()}_addOptionToValues(t,e){this._values.push({el:t,optionEl:e})}_removeMenu(){this.wrapper?.querySelector(":scope > .caret")?.remove(),this.input?.remove(),this.menuEl?.remove();let t=this.el.parentElement;t?.classList.contains("hide-select")&&t.replaceWith(this.el),this.labelEl&&this._originalLabelFor!==null&&(this.labelEl.htmlFor=this._originalLabelFor),this.wrapper&&(this._createdWrapper?this.wrapper.replaceWith(this.el):(this.wrapper.classList.remove("disabled"),this.options.classes.length>0&&this.wrapper.classList.remove(...this.options.classes.split(" ").filter(Boolean))))}_createAndAppendOptionWithIcon(t,e){let i=document.createElement("li");i.id="select-option-"+u.guid(),i.setAttribute("role","option"),i.tabIndex=0;let s=this.el.matches(":disabled")||t.matches(":disabled");s&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let o=t.textContent,r=document.createElement("span");if(this.isMultiple&&!s){let a=document.createElement("label"),m=document.createElement("input");m.type="checkbox",m.tabIndex=-1;let p=document.createElement("span");p.textContent=o,a.append(m,p),r.appendChild(a)}else r.textContent=o;i.appendChild(r);let c=t.getAttribute("data-icon"),h;if(c)try{let a=new URL(c,this.el.ownerDocument.baseURI);(["http:","https:","blob:"].includes(a.protocol)||/^data:image\/(?:avif|bmp|gif|jpeg|png|svg\+xml|webp|x-icon)(?:;|,)/i.test(a.href))&&(h=a)}catch{}let l=t.getAttribute("class")?.split(" ").filter(Boolean);if(h){let a=document.createElement("img");l?.length&&a.classList.add(...l),a.src=h.href,a.ariaHidden="true",i.prepend(a)}return this.menuEl.append(i),i}_selectValue(t){t.el.selected=!0,t.optionEl.classList.add("selected"),t.optionEl.ariaSelected="true";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!0)}_deselectValue(t){t.el.selected=!1,t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!1)}_deselectAll(){this._values.forEach(t=>this._deselectValue(t))}_isValueSelected(t){return this.getSelectedValues().some(i=>i===t.el.value)}_toggleEntryFromArray(t){this._isValueSelected(t)?this._deselectValue(t):this._selectValue(t)}_getSelectedOptions(){return Array.prototype.filter.call(this.el.selectedOptions,t=>t)}_setValueToInput(){this.input.value=this._getSelectedOptions().map(t=>t.textContent.trim()).join(", ")}_setSelectedStates(){this._values.forEach(t=>{let e=t.el.selected,i=t.optionEl.querySelector('input[type="checkbox"]');i&&(i.checked=e),e?this._activateOption(this.menuEl,t.optionEl):(t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false")})}_activateOption(t,e){e&&(this.isMultiple||t.querySelectorAll("li.selected").forEach(i=>i.classList.remove("selected")),e.classList.add("selected"),e.ariaSelected="true")}getSelectedValues(){return this._getSelectedOptions().map(t=>t.value)}};var he={margin:5,transition:10,duration:250,align:"left"},j=class d{constructor(n,t,e){this._handleDocumentClick=n=>{this.visible&&!n.composedPath().includes(this.el)&&!n.composedPath().includes(this.container)&&this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{if(this.visible)return;this.visible=!0;let n=u._setAbsolutePosition(this.el,this.container,"bottom",this.options.margin,this.options.transition,this.options.align);this.container.style.visibility="visible",this.container.style.transition=`
|
|
6
6
|
transform ${this.options.duration}ms ease-out,
|
|
7
|
-
opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform=`translateX(${
|
|
7
|
+
opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform=`translateX(${n.x}px) translateY(${n.y}px)`,this.container.style.opacity="1"},1)};this.hide=()=>{this.visible&&(this.visible=!1,this.container.removeAttribute("style"),this.container.style.transition=`
|
|
8
8
|
transform ${this.options.duration}ms ease-out,
|
|
9
|
-
opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform="translateX(0px) translateY(0px)",this.container.style.opacity="0"},1))};this.el=o,this.options={...he,...e},this.container=document.createElement("div"),this.container.classList.add("display-docked"),this.container.append(t),o.parentElement.append(this.container),document.addEventListener("click",this._handleDocumentClick)}static init(o,t,e){return new d(o,t,e)}};var ce={format:"mmm dd, yyyy",parse:null,isDateRange:!1,dateRangeEndEl:null,isMultipleSelection:!1,defaultDate:null,defaultEndDate:null,setDefaultDate:!1,setDefaultEndDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearRangeReverse:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,openByDefault:!1,container:null,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"\u2039",nextMonth:"\u203A",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onDraw:null,onInputInteraction:null,displayPlugin:null,displayPluginOptions:null,onConfirm:null,onCancel:null},p=class p extends E{constructor(t,e){super(t,e,p);this.multiple=!1;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._handleInputClick=t=>{t.type=="date"&&t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw(),this.gotoDate(t.target===this.el?this.date:this.endDate)}),this.displayPlugin&&this.displayPlugin.show(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===c.keys.ENTER&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))};this._handleCalendarClick=t=>{let e=t.target;e.classList.contains("is-disabled")||this._batchDraws(()=>{if(e.classList.contains("datepicker-day-button")&&!e.classList.contains("is-empty")&&!e.parentElement.classList.contains("is-disabled")){let i=new Date(t.target.getAttribute("data-year"),t.target.getAttribute("data-month"),t.target.getAttribute("data-day"));(!this.multiple||this.multiple&&this.options.isMultipleSelection)&&this.setDate(i),this.options.isDateRange&&this._handleDateRangeCalendarClick(i),this.options.autoSubmit&&this._finishSelection()}else e.closest(".month-prev")?this.prevMonth():e.closest(".month-next")&&this.nextMonth()})};this._handleDateRangeCalendarClick=t=>{if(this.endDate==null||!p._compareDates(t,this.endDate)){if(p._isDate(this.date)&&p._comparePastDate(t,this.date))return;this.setDate(t,!1,p._isDate(this.date));return}this._clearDates(),this.draw()};this._handleClearClick=()=>{this._clearDates(),this.setInputValues()};this._clearDates=()=>{this.date=null,this.endDate=null,this.draw()};this._handleMonthChange=t=>{this.gotoMonth(t.target.value)};this._handleYearChange=t=>{this.gotoYear(t.target.value)};this._handleInputChange=t=>{let e,i=t.target;t.detail?.firedBy!==this&&(i==this.endDateEl&&!this.date||(this.options.parse?e=this.options.parse(t.target.value,typeof this.options.format=="function"?this.options.format(new Date(this.el.value)):this.options.format):e=new Date(Date.parse(t.target.value)),p._isDate(e)&&(this.setDate(e,!1,i==this.endDateEl,!0),t.type=="date"&&(this.setDataDate(t,e),this.setInputValues()))))};this._finishSelection=()=>{this.setInputValues()};this._confirm=()=>{this._finishSelection(),typeof this.options.onConfirm=="function"&&this.options.onConfirm.call(this)};this._cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.el.Expressive_Datepicker=this,this.options={...p.defaults,...e},e&&e.hasOwnProperty("i18n")&&typeof e.i18n=="object"&&(this.options.i18n={...p.defaults.i18n,...e.i18n}),this.options.minDate&&this.options.minDate.setHours(0,0,0,0),this.options.maxDate&&this.options.maxDate.setHours(0,0,0,0),this.id=c.guid(),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers(),this.options.defaultDate||(this.options.defaultDate=new Date(Date.parse(this.el.value)));let i=this.options.defaultDate;if(p._isDate(i)?this.options.setDefaultDate?(this.setDate(i,!0),this.setInputValue(this.el,i)):this.gotoDate(i):this.gotoDate(new Date),this.options.isDateRange){this.multiple=!0;let s=this.options.defaultEndDate;p._isDate(s)&&this.options.setDefaultEndDate&&(this.setDate(s,!0,!0),this.setInputValue(this.endDateEl,s))}this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[],this.dateEls.push(t)),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=j.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return ce}static init(t,e={}){return super.init(t,e,p)}static _escape(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}static _isWeekend(t){let e=t.getDay();return e===0||e===6}static _setToStartOfDay(t){p._isDate(t)&&t.setHours(0,0,0,0)}static _getDaysInMonth(t,e){return[31,p._isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}static _isLeapYear(t){return t%4===0&&t%100!==0||t%400===0}static _compareDates(t,e){return t.getTime()===e.getTime()}static _compareWithinRange(t,e,i){return t.getTime()>e.getTime()&&t.getTime()<i.getTime()}static _comparePastDate(t,e){return t.getTime()<e.getTime()}static getInstance(t){return t.Expressive_Datepicker}destroy(){this._removeEventHandlers(),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this.el.Expressive_Datepicker=void 0}destroySelects(){let t=this.calendarEl.querySelector(".orig-select-year");t&&D.getInstance(t).destroy();let e=this.calendarEl.querySelector(".orig-select-month");e&&D.getInstance(e).destroy()}_insertHTMLIntoDOM(){if(this.el.type=="date"&&this.el.classList.add("datepicker-date-input"),this._renderDateInputFormat(this.el),this.options.isDateRange&&(this.containerEl.classList.add("daterange"),this.options.dateRangeEndEl?(this.endDateEl=document.querySelector(this.options.dateRangeEndEl),this.endDateEl?this._renderDateInputFormat(this.endDateEl):console.warn("Specified date range end input element in dateRangeEndEl not found")):(this.endDateEl=this.createDateInput(),this.endDateEl.classList.add("datepicker-end-date"))),c.createButton(this.footer,this.options.i18n.clear,["datepicker-clear"],this.options.showClearBtn,this._handleClearClick),this.options.autoSubmit||c.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this._confirm,this._cancel),this.options.container){let t=this.options.container;this.options.container=t instanceof HTMLElement?t:document.querySelector(t),this.options.container.append(this.containerEl)}else{let t=this.endDateEl?this.endDateEl:this.el;this.options.openByDefault||this.containerEl.setAttribute("style","display: none; visibility: hidden;"),t.parentElement.after(this.containerEl)}}_renderDateInputFormat(t){let e=t.parentElement?.querySelector(".datepicker-format");e&&(e.textContent=typeof this.options.format=="function"?"":String(this.options.format))}toString(t=this.date,e=null){return e=e||this.options.format,typeof e=="function"?e(t):p._isDate(t)?this.formatDate(t,e):""}formatDate(t,e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(s=>this.formats[s]?this.formats[s](t):s).join("")}setDateFromInput(t){let e=new Date(Date.parse(t.value));this.setDate(e,!1,t==this.endDateEl,!0)}setDate(t=null,e=!1,i=!1,s=!1){let n=this.validateDate(t);n&&(this.options.isMultipleSelection?s||this.setMultiDate(n):this.setSingleDate(n,i),p._setToStartOfDay(n),this.gotoDate(n),!e&&typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,n))}validateDate(t){if(!t)return this._renderDateDisplay(t),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!p._isDate(t))return;let e=this.options.minDate,i=this.options.maxDate;return p._isDate(e)&&t<e?t=e:p._isDate(i)&&t>i&&(t=i),new Date(t.getTime())}setSingleDate(t,e){e?e&&(this.endDate=t):this.date=t}setMultiDate(t){let e=this.dates?.find(i=>i.getTime()===t.getTime()?i:!1);e?this.dates.splice(this.dates.indexOf(e),1):this.dates.push(t),this.dates.sort((i,s)=>i.getTime()<s.getTime()?-1:0)}setDataDate(t,e){t.setAttribute("data-date",this.toString(e))}setInputValues(){if(!this.options?.isMultipleSelection){this.setInputValue(this.el,this.date),this.options?.isDateRange&&this.setInputValue(this.endDateEl,this.endDate);return}this.setMultipleSelectionInputValues()}setMultipleSelectionInputValues(){Array.from(this.dateEls).filter((e,i)=>{if(i>this.dates.length-1)return e}).forEach(e=>{e.remove()}),this.dates.forEach((e,i)=>{if(Array.from(this.dateEls)[i]){this.setInputValue(this.dateEls[i],e);return}let s=this.createDateInput();this.setInputValue(s,e),this.dateEls.push(s)})}setInputValue(t,e){t.type=="date"?(this.setDataDate(t,e),t.value=this.formatDate(e,"yyyy-mm-dd")):t.value=this.toString(e),this.el.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{firedBy:this}}))}_renderDateDisplay(t,e=null){let i=p._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let s=p._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(s,"mmm d")}`}}gotoDate(t){let e=!0;if(p._isDate(t)){if(this.calendars){let i=new Date(this.calendars[0].year,this.calendars[0].month,1),s=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),n=t.getTime();s.setMonth(s.getMonth()+1),s.setDate(s.getDate()-1),e=n<i.getTime()||s.getTime()<n}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}]),this.adjustCalendars()}}adjustCalendars(){this.calendars[0]=this.adjustCalendar(this.calendars[0]),this.draw()}adjustCalendar(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t}nextMonth(){this.calendars[0].month++,this.adjustCalendars()}prevMonth(){this.calendars[0].month--,this.adjustCalendars()}render(t,e,i){let s=new Date,n=p._getDaysInMonth(t,e),a=[],h=new Date(t,e,1).getDay(),l=[];p._setToStartOfDay(s),this.options.firstDay>0&&(h-=this.options.firstDay,h<0&&(h+=7));let r=e===0?11:e-1,u=e===11?0:e+1,v=e===0?t-1:t,m=e===11?t+1:t,_=p._getDaysInMonth(v,r),b=n+h,I=b;for(;I>7;)I-=7;b+=7-I;let H=!1;for(let k=0,ht=0;k<b;k++){let C=new Date(t,e,1+(k-h)),Dt=p._compareDates(C,s),kt=this.options.events.indexOf(C.toDateString())!==-1,Et=k<h||k>=n+h,Ot=this.options.startRange&&p._compareDates(this.options.startRange,C),St=this.options.endRange&&p._compareDates(this.options.endRange,C),At=this.options.startRange&&this.options.endRange&&this.options.startRange<C&&C<this.options.endRange,Ht=this.options.minDate&&C<this.options.minDate||this.options.maxDate&&C>this.options.maxDate||this.options.disableWeekends&&p._isWeekend(C)||this.options.disableDayFn&&this.options.disableDayFn(C),Pt=this.options.isDateRange&&this.date&&this.endDate&&p._compareDates(this.date,C),Rt=this.options.isDateRange&&this.endDate&&p._compareDates(this.endDate,C),Bt=this.options.isDateRange&&p._isDate(this.endDate)&&p._compareWithinRange(C,this.date,this.endDate),nt=1+(k-h),ct=e,dt=t,ot=!1;p._isDate(this.date)&&(ot=p._compareDates(C,this.date)),!ot&&p._isDate(this.endDate)&&(ot=p._compareDates(C,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(Wt=>Wt.getTime()===C.getTime())&&(ot=!0),Et&&(k<h?(nt=_+nt,ct=r,dt=v):(nt=nt-n,ct=u,dt=m));let Nt={day:nt,month:ct,year:dt,hasEvent:kt,isSelected:ot,isToday:Dt,isDisabled:Ht,isEmpty:Et,isStartRange:Ot,isEndRange:St,isInRange:At,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:Pt,isDateRangeEnd:Rt,isDateRange:Bt};l.push(this.renderDay(Nt)),++ht===7&&(a.push(this.renderRow(l,this.options.isRTL,H)),l=[],ht=0,H=!1)}return this.renderTable(this.options,a,i)}renderDay(t){let e={isDisabled:"is-disabled",isToday:"is-today",isSelected:"is-selected",hasEvent:"has-event",isInRange:"is-inrange",isStartRange:"is-startrange",isEndRange:"is-endrange",isDateRangeStart:"is-daterange-start",isDateRangeEnd:"is-daterange-end",isDateRange:"is-daterange"},i=["isSelected","isDateRange"].filter(l=>!!(t.hasOwnProperty(l)&&t[l]===!0)).length!==0,s=["datepicker-day"];if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)s.push("is-outside-current-month"),s.push("is-selection-disabled");else return'<td class="is-empty"></td>';for(let[l,r]of Object.entries(e))t.hasOwnProperty(l)&&t[l]&&s.push(r);let n=p._escape(t.day),a=p._escape(t.month),h=p._escape(t.year);return`<td data-day="${n}" class="${s.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${h}" data-month="${a}" data-day="${n}">${n}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+p._calendarMarkup((e?t.reverse():t).join(""),"tr")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+p._escape(i)+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let s=p._escape(this.renderDayName(t,i)),n=p._escape(this.renderDayName(t,i,!0));e.push(`<th scope="col"><abbr title="${s}">${n}</abbr></th>`)}return"<thead><tr>"+(t.isRTL?e.reverse():e).join("")+"</tr></thead>"}renderBody(t){return"<tbody>"+p._calendarMarkup(t.join(""),"tbody")+"</tbody>"}static _calendarMarkup(t,e){let i=document.createElement("template");i.innerHTML=t;let s={tr:["class"],td:["class","data-day","aria-selected"],button:["class","type","data-year","data-month","data-day","aria-label","disabled","tabindex"]},n=(a,h)=>{if(a.nodeType===Node.TEXT_NODE){if((h==="tbody"||h==="tr")&&a.textContent.trim())throw new TypeError("Unsupported calendar row content");return p._escape(a.textContent)}if(!(a instanceof HTMLElement))throw new TypeError("Unsupported calendar row content");let l=a.localName==="tr"?"tr":a.localName==="td"?"td":a.localName==="button"?"button":null;if(!l||!(h==="tbody"&&l==="tr"||h==="tr"&&l==="td"||h==="td"&&l==="button"))throw new TypeError("Unsupported calendar row element");if([...a.attributes].some(u=>!s[l].includes(u.name)))throw new TypeError("Unsupported calendar row attribute");if(l==="button"&&a.getAttribute("type")!=="button")throw new TypeError('Calendar day buttons require type="button"');let r=s[l].filter(u=>a.hasAttribute(u)).map(u=>` ${u}="${p._escape(a.getAttribute(u))}"`).join("");return`<${l}${r}>${[...a.childNodes].map(u=>n(u,l)).join("")}</${l}>`};return[...i.content.childNodes].map(a=>n(a,e)).join("")}_arrowState(t,e){let i=this.options,s=t===i.minYear,n=t===i.maxYear;return{prev:!(s&&(e===0||i.minMonth>=e)),next:!(n&&(e===11||i.maxMonth<=e))}}_controlsCacheKey(t){let e=this.options;return[t,e.minYear,e.maxYear,e.minMonth,e.maxMonth,Array.isArray(e.yearRange)?e.yearRange.join("-"):e.yearRange,e.yearRangeReverse,e.showMonthAfterYear].join("|")}renderTitle(t,e,i,s,n,a){let h=this.options,l=i===h.minYear,r=i===h.maxYear,u,v,m=[],_='<div id="'+p._escape(a)+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:b,next:I}=this._arrowState(i,s);for(u=0;u<12;u++)m.push('<option value="'+(i===n?u-e:12+u-e)+'"'+(u===s?' selected="selected"':"")+(l&&u<h.minMonth||r&&u>h.maxMonth?'disabled="disabled"':"")+">"+p._escape(h.i18n.months[u])+"</option>");let H='<select class="datepicker-select orig-select-month" tabindex="-1">'+m.join("")+"</select>";for(Array.isArray(h.yearRange)?(u=h.yearRange[0],v=h.yearRange[1]+1):(u=i-h.yearRange,v=1+i+h.yearRange),m=[];u<v&&u<=h.maxYear;u++)u>=h.minYear&&m.push(`<option value="${u}" ${u===i?'selected="selected"':""}>${u}</option>`);h.yearRangeReverse&&m.reverse();let k=`<select class="datepicker-select orig-select-year" tabindex="-1">${m.join("")}</select>`;return _+=`<button class="month-prev${b?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg></button>`,_+='<div class="selects-container">',h.showMonthAfterYear?_+=k+H:_+=H+k,_+="</div>",_+=`<button class="month-next${I?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg></button>`,_+="</div>"}_batchDraws(t){this._drawDepth++;try{t()}finally{this._drawDepth--,this._drawDepth===0&&this._drawDirty&&(this._drawDirty=!1,this.draw())}}draw(){if(this._drawDepth>0){this._drawDirty=!0;return}let t=this.options,e=t.minYear,i=t.maxYear,s=t.minMonth,n=t.maxMonth;this._y<=e&&(this._y=e,!isNaN(s)&&this._m<s&&(this._m=s)),this._y>=i&&(this._y=i,!isNaN(n)&&this._m>n&&(this._m=n));let a=this.calendars[0].year,h=this.calendars[0].month;this.options.isDateRange?this._renderDateDisplay(this.date,this.endDate):this._renderDateDisplay(this.date);let l=this._controlsCacheKey(a);l===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(a,h):(this._controlsKey=l,this._randId="datepicker-title-"+c.guid(),this._rebuildControls(a,h)),this._renderCalendarTable(a,h),typeof this.options.onDraw=="function"&&this.options.onDraw.call(this)}_rebuildControls(t,e){this.destroySelects(),this.calendarEl.innerHTML=this.renderTitle(this,0,t,e,t,this._randId);let i=this.calendarEl.querySelector(".orig-select-year"),s=this.calendarEl.querySelector(".orig-select-month");D.init(i,{classes:"select-year",menuOptions:{container:c.portalRoot(this.el),constrainWidth:!1}}),D.init(s,{classes:"select-month",menuOptions:{container:c.portalRoot(this.el),constrainWidth:!1}}),i.addEventListener("change",this._handleYearChange),s.addEventListener("change",this._handleMonthChange)}_reuseControls(t,e){let i=this.calendarEl.querySelector(".orig-select-month");i&&i.value!==e.toString()&&(i.value=e.toString(),D.getInstance(i)?.refresh());let{prev:s,next:n}=this._arrowState(t,e);this.calendarEl.querySelector(".month-prev")?.classList.toggle("is-disabled",!s),this.calendarEl.querySelector(".month-next")?.classList.toggle("is-disabled",!n)}_renderCalendarTable(t,e){let i=this.render(t,e,this._randId),s=this.calendarEl.querySelector(".datepicker-table-wrapper");s?s.outerHTML=i:this.calendarEl.insertAdjacentHTML("beforeend",i)}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("change",this._handleInputChange),this.calendarEl.addEventListener("click",this._handleCalendarClick)}_setupVariables(){let t=document.createElement("template");t.innerHTML=p._template.trim(),this.containerEl=t.content.firstChild,this.calendarEl=this.containerEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.containerEl.querySelector(".year-text"),this.dateTextEl=this.containerEl.querySelector(".date-text"),this.footer=this.containerEl.querySelector(".datepicker-footer"),this.formats={d:e=>e.getDate(),dd:e=>{let i=e.getDate();return(i<10?"0":"")+i},ddd:e=>this.options.i18n.weekdaysShort[e.getDay()],dddd:e=>this.options.i18n.weekdays[e.getDay()],m:e=>e.getMonth()+1,mm:e=>{let i=e.getMonth()+1;return(i<10?"0":"")+i},mmm:e=>this.options.i18n.monthsShort[e.getMonth()],mmmm:e=>this.options.i18n.months[e.getMonth()],yy:e=>(""+e.getFullYear()).slice(2),yyyy:e=>e.getFullYear()}}_removeEventHandlers(){this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("change",this._handleInputChange),this.calendarEl.removeEventListener("click",this._handleCalendarClick),this.options.isDateRange&&this.endDateEl&&(this.endDateEl.removeEventListener("click",this._handleInputClick),this.endDateEl.removeEventListener("keypress",this._handleInputKeydown),this.endDateEl.removeEventListener("change",this._handleInputChange))}gotoMonth(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}gotoYear(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}renderDayName(t,e,i=!1){for(e+=t.firstDay;e>=7;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}createDateInput(){let t=this.el.cloneNode(!0);return t.removeAttribute("id"),t.addEventListener("click",this._handleInputClick),t.addEventListener("keypress",this._handleInputKeydown),t.addEventListener("change",this._handleInputChange),this.el.parentElement.appendChild(t),t}};p._template=`
|
|
9
|
+
opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform="translateX(0px) translateY(0px)",this.container.style.opacity="0"},1))};this.el=n,this.options={...he,...e},this.container=document.createElement("div"),this.container.classList.add("display-docked"),this.container.append(t),n.parentElement.append(this.container),document.addEventListener("click",this._handleDocumentClick)}static init(n,t,e){return new d(n,t,e)}};var ce={format:"mmm dd, yyyy",parse:null,isDateRange:!1,dateRangeEndEl:null,isMultipleSelection:!1,defaultDate:null,defaultEndDate:null,setDefaultDate:!1,setDefaultEndDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearRangeReverse:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,openByDefault:!1,container:null,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"\u2039",nextMonth:"\u203A",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onDraw:null,onInputInteraction:null,displayPlugin:null,displayPluginOptions:null,onConfirm:null,onCancel:null},f=class f extends _{constructor(t,e){super(t,e,f);this.multiple=!1;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._focusedDate=null;this._handleInputClick=t=>{t.type=="date"&&t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw(),this.gotoDate(t.target===this.el?this.date:this.endDate)}),this.displayPlugin&&this.displayPlugin.show(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===u.keys.ENTER&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this._focusedDate=t.target===this.endDateEl?this.endDate:this.date,this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this._syncCalendarFocus(!0),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))};this._handleCalendarFocus=t=>{let e=t.target;e.matches(".datepicker-day-button")&&(this._focusedDate=this._dayDate(e),this._syncCalendarFocus())};this._handleCalendarKeydown=t=>{let e=t.target;if(!e.matches(".datepicker-day-button")||t.altKey||t.ctrlKey||t.metaKey)return;let i=this._dayDate(e),s=(i.getDay()-this.options.firstDay+7)%7,o={ArrowLeft:this.options.isRTL?1:-1,ArrowRight:this.options.isRTL?-1:1,ArrowUp:-7,ArrowDown:7,Home:-s,End:6-s};if(Object.hasOwn(o,t.key))i.setDate(i.getDate()+o[t.key]);else if(t.key==="PageUp"||t.key==="PageDown"){let p=i.getDate();i.setDate(1),i.setMonth(i.getMonth()+(t.key==="PageUp"?-1:1)*(t.shiftKey?12:1));let v=new Date(i.getTime());v.setMonth(v.getMonth()+1,0),i.setDate(Math.min(p,v.getDate()))}else return;t.preventDefault();let{minDate:r,maxDate:c,minYear:h,maxYear:l,minMonth:a,maxMonth:m}=this.options;r&&i<r&&i.setTime(r.getTime()),c&&i>c&&i.setTime(c.getTime()),!(i.getFullYear()<h||i.getFullYear()>l||i.getFullYear()===h&&i.getMonth()<(a??0)||i.getFullYear()===l&&i.getMonth()>(m??11))&&(this._focusedDate=i,this.gotoDate(i))};this._handleCalendarClick=t=>{let e=t.target;e.classList.contains("is-disabled")||this._batchDraws(()=>{if(e.classList.contains("datepicker-day-button")&&!e.classList.contains("is-empty")&&!e.parentElement.classList.contains("is-disabled")&&!e.parentElement.classList.contains("is-selection-disabled")){let i=new Date(t.target.getAttribute("data-year"),t.target.getAttribute("data-month"),t.target.getAttribute("data-day"));(!this.multiple||this.multiple&&this.options.isMultipleSelection)&&this.setDate(i),this.options.isDateRange&&this._handleDateRangeCalendarClick(i),this.options.autoSubmit&&this._finishSelection()}else e.closest(".month-prev")?this.prevMonth():e.closest(".month-next")&&this.nextMonth()})};this._handleDateRangeCalendarClick=t=>{if(this.endDate==null||!f._compareDates(t,this.endDate)){if(f._isDate(this.date)&&f._comparePastDate(t,this.date))return;this.setDate(t,!1,f._isDate(this.date));return}this._clearDates(),this.draw()};this._handleClearClick=()=>{this._clearDates(),this.setInputValues()};this._clearDates=()=>{this.date=null,this.endDate=null,this.dates?.splice(0),this.draw()};this._handleMonthChange=t=>{this.gotoMonth(t.target.value)};this._handleYearChange=t=>{this.gotoYear(t.target.value)};this._handleInputChange=t=>{let e,i=t.target;if(t.detail?.firedBy!==this&&!(i==this.endDateEl&&!this.date)&&(this.options.parse?e=this.options.parse(t.target.value,typeof this.options.format=="function"?this.options.format(new Date(this.el.value)):this.options.format):e=new Date(Date.parse(t.target.value)),f._isDate(e))){if(i==this.endDateEl&&e<this.date)return this.setInputValue(i,this.endDate);this.setDate(e,!1,i==this.endDateEl,!0),t.type=="date"&&(this.setDataDate(t,e),this.setInputValues())}};this._finishSelection=()=>{this.setInputValues()};this._confirm=()=>{this._finishSelection(),typeof this.options.onConfirm=="function"&&this.options.onConfirm.call(this)};this._cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.el.Expressive_Datepicker=this,this.options={...f.defaults,...e},e&&e.hasOwnProperty("i18n")&&typeof e.i18n=="object"&&(this.options.i18n={...f.defaults.i18n,...e.i18n}),this.options.minDate&&this.options.minDate.setHours(0,0,0,0),this.options.maxDate&&this.options.maxDate.setHours(0,0,0,0),this.id=u.guid(),this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[t]),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers(),this.options.defaultDate||(this.options.defaultDate=new Date(Date.parse(this.el.value)));let i=this.options.defaultDate;if(f._isDate(i)?this.options.setDefaultDate?(this.setDate(i,!0),this.setInputValue(this.el,i)):this.gotoDate(i):this.gotoDate(new Date),this.options.isDateRange){this.multiple=!0;let s=this.options.defaultEndDate;f._isDate(s)&&this.options.setDefaultEndDate&&(this.setDate(s,!0,!0),this.setInputValue(this.endDateEl,s))}this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=j.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return ce}static init(t,e={}){return super.init(t,e,f)}static _escape(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}static _isWeekend(t){let e=t.getDay();return e===0||e===6}static _setToStartOfDay(t){f._isDate(t)&&t.setHours(0,0,0,0)}static _getDaysInMonth(t,e){return[31,f._isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}static _isLeapYear(t){return t%4===0&&t%100!==0||t%400===0}static _compareDates(t,e){return t.getTime()===e.getTime()}static _compareWithinRange(t,e,i){return t.getTime()>e.getTime()&&t.getTime()<i.getTime()}static _comparePastDate(t,e){return t.getTime()<e.getTime()}static getInstance(t){return t.Expressive_Datepicker}destroy(){this._removeEventHandlers(),this.dateEls?.slice(1).forEach(t=>this._removeDateInput(t)),!this.options.dateRangeEndEl&&this.endDateEl&&this._removeDateInput(this.endDateEl),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this.el.Expressive_Datepicker=void 0}destroySelects(){let t=this.calendarEl.querySelector(".orig-select-year");t&&k.getInstance(t).destroy();let e=this.calendarEl.querySelector(".orig-select-month");e&&k.getInstance(e).destroy()}_insertHTMLIntoDOM(){if(this.el.type=="date"&&this.el.classList.add("datepicker-date-input"),this._renderDateInputFormat(this.el),this.options.isDateRange&&(this.containerEl.classList.add("daterange"),this.options.dateRangeEndEl?(this.endDateEl=document.querySelector(this.options.dateRangeEndEl),this.endDateEl?this._renderDateInputFormat(this.endDateEl):console.warn("Specified date range end input element in dateRangeEndEl not found")):(this.endDateEl=this.createDateInput(),this.endDateEl.classList.add("datepicker-end-date"))),u.createButton(this.footer,this.options.i18n.clear,["datepicker-clear"],this.options.showClearBtn,this._handleClearClick),this.options.autoSubmit||u.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this._confirm,this._cancel),this.options.container){let t=this.options.container;this.options.container=t instanceof HTMLElement?t:document.querySelector(t),this.options.container.append(this.containerEl)}else{let t=this.endDateEl?this.endDateEl:this.el;this.options.openByDefault||this.containerEl.setAttribute("style","display: none; visibility: hidden;"),t.parentElement.after(this.containerEl)}}_renderDateInputFormat(t){let e=t.parentElement?.querySelector(".datepicker-format");e&&(e.textContent=typeof this.options.format=="function"?"":String(this.options.format))}toString(t=this.date,e=null){return e=e||this.options.format,typeof e=="function"?e(t):f._isDate(t)?this.formatDate(t,e):""}formatDate(t,e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(s=>this.formats[s]?this.formats[s](t):s).join("")}setDateFromInput(t){let e=new Date(Date.parse(t.value));this.setDate(e,!1,t==this.endDateEl,!0)}setDate(t=null,e=!1,i=!1,s=!1){let o=this.validateDate(t);o&&(f._setToStartOfDay(o),this.options.isMultipleSelection?s||this.setMultiDate(o):this.setSingleDate(o,i),this.gotoDate(o),!e&&typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,o))}validateDate(t){if(!t)return this._renderDateDisplay(t),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!f._isDate(t))return;let e=this.options.minDate,i=this.options.maxDate;return f._isDate(e)&&t<e?t=e:f._isDate(i)&&t>i&&(t=i),new Date(t.getTime())}setSingleDate(t,e){e?e&&(this.endDate=t):this.date=t}setMultiDate(t){let e=this.dates?.find(i=>i.getTime()===t.getTime()?i:!1);e?this.dates.splice(this.dates.indexOf(e),1):this.dates.push(t),this.dates.sort((i,s)=>i.getTime()<s.getTime()?-1:0)}setDataDate(t,e){t.setAttribute("data-date",this.toString(e))}setInputValues(){if(!this.options?.isMultipleSelection){this.setInputValue(this.el,this.date),this.options?.isDateRange&&this.setInputValue(this.endDateEl,this.endDate);return}this.setMultipleSelectionInputValues()}setMultipleSelectionInputValues(){let t=Math.max(1,this.dates.length);for(let e of this.dateEls.splice(t))this._removeDateInput(e);for(;this.dateEls.length<t;)this.dateEls.push(this.createDateInput());this.dateEls.forEach((e,i)=>this.setInputValue(e,this.dates[i]??null))}setInputValue(t,e){t&&(f._isDate(e)?t.type=="date"?(this.setDataDate(t,e),t.value=this.formatDate(e,"yyyy-mm-dd")):t.value=this.toString(e):(t.value="",t.type==="date"&&t.setAttribute("data-date","")),this.el.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{firedBy:this}})))}_renderDateDisplay(t,e=null){let i=f._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let s=f._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(s,"mmm d")}`}}gotoDate(t){let e=!0;if(f._isDate(t)){if(this.calendars){let i=new Date(this.calendars[0].year,this.calendars[0].month,1),s=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=t.getTime();s.setMonth(s.getMonth()+1),s.setDate(s.getDate()-1),e=o<i.getTime()||s.getTime()<o}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}]),this.adjustCalendars()}}adjustCalendars(){this.calendars[0]=this.adjustCalendar(this.calendars[0]),this.draw()}adjustCalendar(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t}nextMonth(){this.calendars[0].month++,this.adjustCalendars()}prevMonth(){this.calendars[0].month--,this.adjustCalendars()}render(t,e,i){let s=new Date,o=f._getDaysInMonth(t,e),r=[],c=new Date(t,e,1).getDay(),h=[];f._setToStartOfDay(s),this.options.firstDay>0&&(c-=this.options.firstDay,c<0&&(c+=7));let l=e===0?11:e-1,a=e===11?0:e+1,m=e===0?t-1:t,p=e===11?t+1:t,v=f._getDaysInMonth(m,l),y=o+c,b=y;for(;b>7;)b-=7;y+=7-b;let w=!1;for(let D=0,F=0;D<y;D++){let M=new Date(t,e,1+(D-c)),It=f._compareDates(M,s),Dt=this.options.events.indexOf(M.toDateString())!==-1,gt=D<c||D>=o+c,kt=this.options.startRange&&f._compareDates(this.options.startRange,M),At=this.options.endRange&&f._compareDates(this.options.endRange,M),St=this.options.startRange&&this.options.endRange&&this.options.startRange<M&&M<this.options.endRange,Ot=this.options.minDate&&M<this.options.minDate||this.options.maxDate&&M>this.options.maxDate||this.options.disableWeekends&&f._isWeekend(M)||this.options.disableDayFn&&this.options.disableDayFn(M),Ht=this.options.isDateRange&&this.date&&this.endDate&&f._compareDates(this.date,M),Rt=this.options.isDateRange&&this.endDate&&f._compareDates(this.endDate,M),Pt=this.options.isDateRange&&f._isDate(this.endDate)&&f._compareWithinRange(M,this.date,this.endDate),nt=1+(D-c),ht=e,ct=t,ot=!1;f._isDate(this.date)&&(ot=f._compareDates(M,this.date)),!ot&&f._isDate(this.endDate)&&(ot=f._compareDates(M,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(Wt=>Wt.getTime()===M.getTime())&&(ot=!0),gt&&(D<c?(nt=v+nt,ht=l,ct=m):(nt=nt-o,ht=a,ct=p));let Bt={day:nt,month:ht,year:ct,hasEvent:Dt,isSelected:ot,isToday:It,isDisabled:Ot,isEmpty:gt,isStartRange:kt,isEndRange:At,isInRange:St,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:Ht,isDateRangeEnd:Rt,isDateRange:Pt};h.push(this.renderDay(Bt)),++F===7&&(r.push(this.renderRow(h,this.options.isRTL,w)),h=[],F=0,w=!1)}return this.renderTable(this.options,r,i)}renderDay(t){let e={isDisabled:"is-disabled",isToday:"is-today",isSelected:"is-selected",hasEvent:"has-event",isInRange:"is-inrange",isStartRange:"is-startrange",isEndRange:"is-endrange",isDateRangeStart:"is-daterange-start",isDateRangeEnd:"is-daterange-end",isDateRange:"is-daterange"},i=["isSelected","isDateRange"].filter(h=>!!(t.hasOwnProperty(h)&&t[h]===!0)).length!==0,s=["datepicker-day"];if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)s.push("is-outside-current-month"),s.push("is-selection-disabled");else return'<td class="is-empty"></td>';for(let[h,l]of Object.entries(e))t.hasOwnProperty(h)&&t[h]&&s.push(l);let o=f._escape(t.day),r=f._escape(t.month),c=f._escape(t.year);return`<td data-day="${o}" class="${s.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${c}" data-month="${r}" data-day="${o}">${o}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+f._calendarMarkup((e?t.reverse():t).join(""),"tr")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+f._escape(i)+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let s=f._escape(this.renderDayName(t,i)),o=f._escape(this.renderDayName(t,i,!0));e.push(`<th scope="col"><abbr title="${s}">${o}</abbr></th>`)}return"<thead><tr>"+(t.isRTL?e.reverse():e).join("")+"</tr></thead>"}renderBody(t){return"<tbody>"+f._calendarMarkup(t.join(""),"tbody")+"</tbody>"}static _calendarMarkup(t,e){let i=document.createElement("template");i.innerHTML=t;let s={tr:["class"],td:["class","data-day","aria-selected"],button:["class","type","data-year","data-month","data-day","aria-label","disabled","tabindex"]},o=(r,c)=>{if(r.nodeType===Node.TEXT_NODE){if((c==="tbody"||c==="tr")&&r.textContent.trim())throw new TypeError("Unsupported calendar row content");return f._escape(r.textContent)}if(!(r instanceof HTMLElement))throw new TypeError("Unsupported calendar row content");let h=r.localName==="tr"?"tr":r.localName==="td"?"td":r.localName==="button"?"button":null;if(!h||!(c==="tbody"&&h==="tr"||c==="tr"&&h==="td"||c==="td"&&h==="button"))throw new TypeError("Unsupported calendar row element");if([...r.attributes].some(a=>!s[h].includes(a.name)))throw new TypeError("Unsupported calendar row attribute");if(h==="button"&&r.getAttribute("type")!=="button")throw new TypeError('Calendar day buttons require type="button"');let l=s[h].filter(a=>r.hasAttribute(a)).map(a=>` ${a}="${f._escape(r.getAttribute(a))}"`).join("");return`<${h}${l}>${[...r.childNodes].map(a=>o(a,h)).join("")}</${h}>`};return[...i.content.childNodes].map(r=>o(r,e)).join("")}_arrowState(t,e){let i=this.options,s=t===i.minYear,o=t===i.maxYear;return{prev:!(s&&(e===0||i.minMonth>=e)),next:!(o&&(e===11||i.maxMonth<=e))}}_controlsCacheKey(t){let e=this.options;return[t,e.minYear,e.maxYear,e.minMonth,e.maxMonth,Array.isArray(e.yearRange)?e.yearRange.join("-"):e.yearRange,e.yearRangeReverse,e.showMonthAfterYear].join("|")}renderTitle(t,e,i,s,o,r){let c=this.options,h=i===c.minYear,l=i===c.maxYear,a,m,p=[],v='<div id="'+f._escape(r)+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:y,next:b}=this._arrowState(i,s);for(a=0;a<12;a++)p.push('<option value="'+(i===o?a-e:12+a-e)+'"'+(a===s?' selected="selected"':"")+(h&&a<c.minMonth||l&&a>c.maxMonth?'disabled="disabled"':"")+">"+f._escape(c.i18n.months[a])+"</option>");let w='<select class="datepicker-select orig-select-month" tabindex="-1">'+p.join("")+"</select>";for(Array.isArray(c.yearRange)?(a=c.yearRange[0],m=c.yearRange[1]+1):(a=i-c.yearRange,m=1+i+c.yearRange),p=[];a<m&&a<=c.maxYear;a++)a>=c.minYear&&p.push(`<option value="${a}" ${a===i?'selected="selected"':""}>${a}</option>`);c.yearRangeReverse&&p.reverse();let D=`<select class="datepicker-select orig-select-year" tabindex="-1">${p.join("")}</select>`;return v+=`<button class="month-prev${y?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg></button>`,v+='<div class="selects-container">',c.showMonthAfterYear?v+=D+w:v+=w+D,v+="</div>",v+=`<button class="month-next${b?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg></button>`,v+="</div>"}_batchDraws(t){this._drawDepth++;try{t()}finally{this._drawDepth--,this._drawDepth===0&&this._drawDirty&&(this._drawDirty=!1,this.draw())}}draw(){if(this._drawDepth>0){this._drawDirty=!0;return}let t=this.calendarEl.getRootNode().activeElement,e=t?.matches(".datepicker-day-button")&&this.calendarEl.contains(t),i=this.calendarEl.contains(t)&&t?.matches(".month-prev, .month-next")?t.classList.contains("month-prev")?".month-prev":".month-next":null,s=this.options,o=s.minYear,r=s.maxYear,c=s.minMonth,h=s.maxMonth;this._y<=o&&(this._y=o,!isNaN(c)&&this._m<c&&(this._m=c)),this._y>=r&&(this._y=r,!isNaN(h)&&this._m>h&&(this._m=h));let l=this.calendars[0].year,a=this.calendars[0].month;this.options.isDateRange?this._renderDateDisplay(this.date,this.endDate):this._renderDateDisplay(this.date);let m=this._controlsCacheKey(l);m===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(l,a):(this._controlsKey=m,this._randId="datepicker-title-"+u.guid(),this._rebuildControls(l,a)),this._renderCalendarTable(l,a),this._syncCalendarFocus(!!e),i&&this.calendarEl.querySelector(i)?.focus(),typeof this.options.onDraw=="function"&&this.options.onDraw.call(this)}_rebuildControls(t,e){this.destroySelects(),this.calendarEl.innerHTML=this.renderTitle(this,0,t,e,t,this._randId);let i=this.calendarEl.querySelector(".orig-select-year"),s=this.calendarEl.querySelector(".orig-select-month");k.init(i,{classes:"select-year",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),k.init(s,{classes:"select-month",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),i.addEventListener("change",this._handleYearChange),s.addEventListener("change",this._handleMonthChange)}_reuseControls(t,e){let i=this.calendarEl.querySelector(".orig-select-month");i&&i.value!==e.toString()&&(i.value=e.toString(),k.getInstance(i)?.refresh());let{prev:s,next:o}=this._arrowState(t,e);this.calendarEl.querySelector(".month-prev")?.classList.toggle("is-disabled",!s),this.calendarEl.querySelector(".month-next")?.classList.toggle("is-disabled",!o)}_renderCalendarTable(t,e){let i=this.render(t,e,this._randId),s=this.calendarEl.querySelector(".datepicker-table-wrapper");s?s.outerHTML=i:this.calendarEl.insertAdjacentHTML("beforeend",i)}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("change",this._handleInputChange),this.endDateEl?.addEventListener("click",this._handleInputClick),this.endDateEl?.addEventListener("keydown",this._handleInputKeydown),this.endDateEl?.addEventListener("change",this._handleInputChange),this.calendarEl.addEventListener("click",this._handleCalendarClick),this.calendarEl.addEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.addEventListener("focusin",this._handleCalendarFocus)}_setupVariables(){let t=document.createElement("template");t.innerHTML=f._template.trim(),this.containerEl=t.content.firstChild,this.calendarEl=this.containerEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.containerEl.querySelector(".year-text"),this.dateTextEl=this.containerEl.querySelector(".date-text"),this.footer=this.containerEl.querySelector(".datepicker-footer"),this.formats={d:e=>e.getDate(),dd:e=>{let i=e.getDate();return(i<10?"0":"")+i},ddd:e=>this.options.i18n.weekdaysShort[e.getDay()],dddd:e=>this.options.i18n.weekdays[e.getDay()],m:e=>e.getMonth()+1,mm:e=>{let i=e.getMonth()+1;return(i<10?"0":"")+i},mmm:e=>this.options.i18n.monthsShort[e.getMonth()],mmmm:e=>this.options.i18n.months[e.getMonth()],yy:e=>(""+e.getFullYear()).slice(2),yyyy:e=>e.getFullYear()}}_removeEventHandlers(){for(let t of this.dateEls??[this.el])this._removeInputEventHandlers(t);this.calendarEl.removeEventListener("click",this._handleCalendarClick),this.calendarEl.removeEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.removeEventListener("focusin",this._handleCalendarFocus),this.options.isDateRange&&this.endDateEl&&this._removeInputEventHandlers(this.endDateEl)}_removeInputEventHandlers(t){t.removeEventListener("click",this._handleInputClick),t.removeEventListener("keydown",this._handleInputKeydown),t.removeEventListener("change",this._handleInputChange)}_removeDateInput(t){let e=t.getRootNode().activeElement===t;this._removeInputEventHandlers(t),t.remove(),e&&document.activeElement===document.body&&this.el.focus()}_dayDate(t){let e=new Date(0);return e.setFullYear(Number(t.dataset.year),Number(t.dataset.month),Number(t.dataset.day)),f._setToStartOfDay(e),e}_syncCalendarFocus(t=!1){let e=[...this.calendarEl.querySelectorAll(".datepicker-day-button")],i=e.filter(r=>!r.parentElement.classList.contains("is-selection-disabled")),s=this._focusedDate||this.date||new Date,o=i.find(r=>f._compareDates(this._dayDate(r),s))||i.find(r=>r.parentElement.classList.contains("is-selected"))||i.find(r=>!r.parentElement.classList.contains("is-disabled"))||i[0];for(let r of e)r.tabIndex=r===o?0:-1,r.setAttribute("aria-disabled",String(r.parentElement.matches(".is-disabled, .is-selection-disabled")));o&&(this._focusedDate=this._dayDate(o),t&&o.focus())}gotoMonth(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}gotoYear(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}renderDayName(t,e,i=!1){for(e+=t.firstDay;e>=7;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}createDateInput(){let t=this.el.cloneNode(!0);return t.removeAttribute("id"),t.addEventListener("click",this._handleInputClick),t.addEventListener("keydown",this._handleInputKeydown),t.addEventListener("change",this._handleInputChange),this.el.parentElement.appendChild(t),t}};f._template=`
|
|
10
10
|
<div class="datepicker-container">
|
|
11
11
|
<div class="datepicker-date-display">
|
|
12
12
|
<span class="year-text"></span>
|
|
@@ -16,17 +16,17 @@ var Expressive=(()=>{var ut=Object.defineProperty;var Ft=Object.getOwnPropertyDe
|
|
|
16
16
|
<div class="datepicker-calendar"></div>
|
|
17
17
|
<div class="datepicker-footer"></div>
|
|
18
18
|
</div>
|
|
19
|
-
</div>`;var Z=
|
|
19
|
+
</div>`;var Z=f;var de={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},A=class A extends _{constructor(t,e){super(t,e,A);this._changedAncestorList=[];this._timers=new Map;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._isOpen=!1;this._destroyed=!1;this._revision=0;this._handleMotionChange=()=>{if(!this._motion.matches)return;let t=[...this._timers.values()],e=this._cancel();for(let i of t){if(e!==this._revision)break;i()}if(this.overlayActive)for(let i of[this.el,this._overlay,this._photoCaption])i&&(i.style.transition="none")};this._handleLightboxClick=()=>{this._handleLightboxToggle()};this._handleLightboxKeypress=t=>{this._trigger===this.el&&(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._handleLightboxToggle())};this._handleLightboxToggle=()=>{this._isOpen?this.close():this.open()};this._handleWindowScroll=()=>{this.overlayActive&&this.close()};this._handleWindowResize=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{t.key===u.keys.ESC&&this.close()};this.open=()=>{if(this._destroyed||this._isOpen)return;let t=this._cancel();this.overlayActive&&this._reset(),this._isOpen=!0,this._updateVars();let e=this.el.getBoundingClientRect(),i=this.placeholder.getBoundingClientRect();if(this.originalWidth=e.width,this.originalHeight=e.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t!==this._revision)return;this.placeholder.style.width=i.width+"px",this.placeholder.style.height=i.height+"px",this.placeholder.style.position="relative",this.placeholder.style.top="0",this.placeholder.style.left="0",this._makeAncestorsOverflowVisible(),this.el.style.position="absolute",this.el.style.zIndex="1000",this.el.style.willChange="left, top, width, height",this.attrWidth=this.el.getAttribute("width"),this.attrHeight=this.el.getAttribute("height"),this.attrWidth&&(this.el.style.width=this.attrWidth+"px",this.el.removeAttribute("width")),this.attrHeight&&(this.el.style.height=this.attrHeight+"px",this.el.removeAttribute("height")),this._addOverlay(),this.caption!==""&&this._addCaption();let s=this.originalWidth/this.windowWidth,o=this.originalHeight/this.windowHeight;if(this.newWidth=0,this.newHeight=0,s>o){let r=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*r}else{let r=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*r,this.newHeight=this.windowHeight*.9}window.addEventListener("scroll",this._handleWindowScroll,{passive:!0}),window.addEventListener("resize",this._handleWindowResize,{passive:!0}),window.addEventListener("keyup",this._handleWindowEscape),this._animateImageIn()};this.close=()=>{if(this._destroyed||!this._isOpen)return;let t=this._cancel();this._isOpen=!1,this.doneAnimating=!1,typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._revision&&(window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay&&this._removeOverlay(),this._photoCaption&&this._removeCaption(),this._animateImageOut())};this.el.Expressive_Lightbox=this,this.options={...A.defaults,...e},this.overlayActive=!1,this.doneAnimating=!0,this.placeholder=document.createElement("div"),this.placeholder.classList.add("material-placeholder"),this.originalWidth=0,this.originalHeight=0,this.originInlineStyles=this.el.getAttribute("style"),this.caption=this.el.getAttribute("data-caption")||"",this._tabindex=this.el.getAttribute("tabindex"),this._trigger=this.el.closest("button")??this.el,this.el.tabIndex=this._trigger===this.el?0:-1,this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return de}static init(t,e={}){return super.init(t,e,A)}static getInstance(t){return t.Expressive_Lightbox}destroy(){if(this._destroyed)return;this._destroyed=!0;let t=this.el.getRootNode(),e=t.activeElement===this.el;this._removeEventHandlers(),this._cancel(),this._reset(),this.placeholder.replaceWith(this.el);let i=document.activeElement;for(;i?.shadowRoot?.activeElement;)i=i.shadowRoot.activeElement;e&&(i===document.body||i===t.host)&&this._trigger.focus(),this._tabindex===null?this.el.removeAttribute("tabindex"):this.el.setAttribute("tabindex",this._tabindex),this.el.Expressive_Lightbox=void 0}_reset(){window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay?.remove(),this._photoCaption?.remove();for(let t of this._changedAncestorList){let e=A._overflow.get(t);--e.count===0&&(t.style.setProperty("overflow",e.value,e.priority),A._overflow.delete(t))}this._changedAncestorList=[],this.attrWidth!==null&&this.attrWidth!==void 0&&this.el.setAttribute("width",this.attrWidth),this.attrHeight!==null&&this.attrHeight!==void 0&&this.el.setAttribute("height",this.attrHeight),this.el.classList.remove("active"),this.placeholder.removeAttribute("style"),this.originInlineStyles===null?this.el.removeAttribute("style"):this.el.setAttribute("style",this.originInlineStyles),this.overlayActive=!1,this._isOpen=!1,this.doneAnimating=!0}_cancel(){for(let t of this._timers.keys())clearTimeout(t);return this._timers.clear(),++this._revision}_schedule(t,e){if(this._motion.matches){t();return}let i=setTimeout(()=>{this._timers.delete(i),t()},e);this._timers.set(i,t)}_setupEventHandlers(){this._motion.addEventListener("change",this._handleMotionChange),this._trigger.addEventListener("click",this._handleLightboxClick),this.el.addEventListener("keydown",this._handleLightboxKeypress)}_removeEventHandlers(){this._motion.removeEventListener("change",this._handleMotionChange),this._trigger.removeEventListener("click",this._handleLightboxClick),this.el.removeEventListener("keydown",this._handleLightboxKeypress)}_makeAncestorsOverflowVisible(){this._changedAncestorList=[];let t=this.placeholder.parentNode;for(;t!=null&&t!==document;){let e=t;if(e.style&&(e.style.overflow!=="visible"||A._overflow.has(e))){let i=A._overflow.get(e)??{count:0,value:e.style.overflow,priority:e.style.getPropertyPriority("overflow")};i.count++,A._overflow.set(e,i),this._changedAncestorList.push(e),e.style.overflow="visible"}t=t.parentNode??t.host}}_offset(t){let e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+window.scrollY-i.clientTop,left:e.left+window.scrollX-i.clientLeft}}_updateVars(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}_animateImageIn(){this.el.style.maxHeight=this.newHeight.toString()+"px",this.el.style.maxWidth=this.newWidth.toString()+"px";let t=this._motion.matches?0:this.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this._schedule(()=>{let e=this._offset(this.placeholder);this.el.style.transition=`height ${t}ms ease,
|
|
20
20
|
width ${t}ms ease,
|
|
21
21
|
left ${t}ms ease,
|
|
22
22
|
top ${t}ms ease
|
|
23
|
-
`,this.el.style.height=this.newHeight+"px",this.el.style.width=this.newWidth+"px",this.el.style.left=
|
|
23
|
+
`,this.el.style.height=this.newHeight+"px",this.el.style.width=this.newWidth+"px",this.el.style.left=u.getDocumentScrollLeft()+this.windowWidth/2-e.left-this.newWidth/2+"px",this.el.style.top=u.getDocumentScrollTop()+this.windowHeight/2-e.top-this.newHeight/2+"px"},1),this._schedule(()=>{this.doneAnimating=!0,typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},t)}_animateImageOut(){let t=this._motion.matches?0:this.options.outDuration;this.el.style.transition=`height ${t}ms ease,
|
|
24
24
|
width ${t}ms ease,
|
|
25
25
|
left ${t}ms ease,
|
|
26
26
|
top ${t}ms ease
|
|
27
|
-
`,this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this.el.style.left="0",this.el.style.top="0",setTimeout(()=>{this.placeholder.style.height="",this.placeholder.style.width="",this.placeholder.style.position="",this.placeholder.style.top="",this.placeholder.style.left="",this.attrWidth&&this.el.setAttribute("width",this.attrWidth.toString()),this.attrHeight&&this.el.setAttribute("height",this.attrHeight.toString()),this.el.removeAttribute("style"),this.originInlineStyles&&this.el.setAttribute("style",this.originInlineStyles),this.el.classList.remove("active"),this.doneAnimating=!0,this._changedAncestorList.forEach(([e,i])=>e.style.overflow=i),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_addCaption(){this._photoCaption=document.createElement("div"),this._photoCaption.classList.add("lightbox-caption"),this._photoCaption.innerText=this.caption,c.portalRoot(this.el).append(this._photoCaption),this._photoCaption.style.display="inline",this._photoCaption.style.transition="none",this._photoCaption.style.opacity="0";let t=this.options.inDuration;setTimeout(()=>{this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="1"},1)}_removeCaption(){let t=this.options.outDuration;this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="0",setTimeout(()=>{this._photoCaption.remove()},t)}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",()=>{this.doneAnimating&&this.close()},{once:!0}),this.el.before(this._overlay);let t=this._overlay.getBoundingClientRect();this._overlay.style.width=this.windowWidth+"px",this._overlay.style.height=this.windowHeight+"px",this._overlay.style.left=-1*t.left+"px",this._overlay.style.top=-1*t.top+"px",this._overlay.style.transition="none",this._overlay.style.opacity="0";let e=this.options.inDuration;setTimeout(()=>{this._overlay.style.transition=`opacity ${e}ms ease`,this._overlay.style.opacity="1"},1)}_removeOverlay(){let t=this.options.outDuration;this._overlay.style.transition=`opacity ${t}ms ease`,this._overlay.style.opacity="0",setTimeout(()=>{this.overlayActive=!1,this._overlay.remove()},t)}};var Mt=d=>`a[href="#${d}"]`,ue={scrollOffset:200,activeClass:"active",getActiveElement:Mt,keepTopElementActive:!1},g=class g extends E{constructor(o,t){super(o,t,g),this.el.Expressive_ScrollSpy=this,this.options={...g.defaults,...t},this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),g._elements.push(this),g._ensureObserver(this.options.scrollOffset),g._observer?.observe(this.el)}static get defaults(){return ue}static init(o,t={}){return super.init(o,t,g)}static getInstance(o){return o.Expressive_ScrollSpy}destroy(){let o=g._elements.indexOf(this);o>=0&&g._elements.splice(o,1),g._ratios.delete(this.el),g._observer?.unobserve(this.el);let t=g._linkFor(this.el.id,this.options);t&&t===g._active?g._clearActive(this.options):(t?.classList.remove(this.options.activeClass),t?.removeAttribute("aria-current")),g._elements.length===0?(g._observer?.disconnect(),g._observer=null,g._ratios.clear(),g._active=null):g._syncActive(),this.el.Expressive_ScrollSpy=void 0}static _ensureObserver(o){g._observer||typeof IntersectionObserver>"u"||(g._observer=new IntersectionObserver(g._onIntersect,{rootMargin:`-${o}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}))}static _syncActive(){if(!g._elements.length)return;let o=g._elements[0].options,t=null,e=0;for(let s of g._elements){let n=g._ratios.get(s.el)??0;n>e&&(e=n,t=s)}if(!t)if(o.keepTopElementActive)t=g._nearestAbove()??g._elements[0];else{g._clearActive(o);return}let i=g._linkFor(t.el.id,t.options);i!==g._active&&(g._clearActive(o),i&&(i.classList.add(t.options.activeClass),i.setAttribute("aria-current","true"),g._active=i))}static _nearestAbove(){let o=null,t=-1/0;for(let e of g._elements){let i=e.el.getBoundingClientRect().top;i<=0&&i>=t&&(t=i,o=e)}return o}static _clearActive(o){g._active&&(g._active.classList.remove(o.activeClass),g._active.removeAttribute("aria-current"),g._active=null)}static _linkFor(o,t){if(!o)return null;if(t.getActiveElement!==Mt)try{return document.querySelector(t.getActiveElement(o))}catch{return null}let e=`#${o}`,i=document.querySelectorAll('a[href^="#"]');for(let s=0;s<i.length;s++)if(i[s].getAttribute("href")===e)return i[s];return null}};g._elements=[],g._observer=null,g._ratios=new Map,g._active=null,g._onIntersect=o=>{for(let t of o)t.isIntersecting&&t.intersectionRatio>0?g._ratios.set(t.target,t.intersectionRatio):g._ratios.delete(t.target);g._syncActive()};var J=g;var pe={edge:"left",draggable:!0,dragTargetWidth:"10px",onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},me="(width >= 840px)",M=class M extends E{constructor(t,e){super(t,e,M);this.open=()=>{if(!(this._isCurrentlyFixed()||this.isOpen||!this._dialog)){if(M._sidenavs.forEach(t=>{t!==this&&t.isOpen&&t.close()}),typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.isOpen=!0,this._dialog.classList.remove("dragging"),this._clearShift(),!this._dialog.open)try{this._dialog.showModal()}catch{}this._syncTriggers(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)}};this.close=()=>{this._isCurrentlyFixed()||!this.isOpen||(this._beginClose(),this._dialog?.open?(this._closing=!0,this._dialog.close()):this._finishClose())};this._onDialogClose=()=>{if(this.isOpen){this._beginClose(),this._finishClose();return}this._closing&&(this._closing=!1,this._finishClose())};this._onBreakpointChange=()=>{this._isCurrentlyFixed()&&this.isOpen&&this.close()};this._handleCloseTriggerClick=t=>{let e=t.target;if(!(e instanceof Element))return;e.closest(".sidenav-close, .navigation-drawer-close")&&!this._isCurrentlyFixed()&&this.close()};this._handleDragTargetDrag=t=>{if(!this._isDraggable())return;let e=this._rawDelta(t),i=this.options.edge==="left"?e:-e,s=Math.min(this._width,Math.max(0,i)),n=this._width?s/this._width:0;this._applyShift(s-this._width,n)};this._handleDragTargetRelease=()=>{this.isDragged&&(this._dialog?.classList.remove("dragging"),this.percentOpen>.2?this.open():this._dialog?.open&&!this.isOpen&&(this._clearShift(),this._dialog.close()),this.isDragged=!1,this._verticallyScrolling=!1)};this._handleCloseDrag=t=>{if(!this.isOpen||!this._isDraggable())return;let e=this._rawDelta(t),i=this.options.edge==="left"?-e:e,s=Math.min(this._width,Math.max(0,i)),n=this._width?1-s/this._width:1;this._applyShift(-s,n)};this._handleCloseRelease=()=>{!this.isOpen||!this.isDragged||(this._dialog?.classList.remove("dragging"),this.percentOpen>.8?this._clearShift():this.close(),this.isDragged=!1,this._verticallyScrolling=!1)};this.el.Expressive_NavigationDrawer=this,this.options={...M.defaults,...e},this.id=this.el.id,this.isOpen=!1,this.isFixed=this.el.classList.contains("navigation-drawer-fixed")||this.el.classList.contains("sidenav-fixed"),this.isDragged=!1,this.dragTarget=null,this._dialog=null,this._createdDialog=!1,this._closing=!1,this.percentOpen=0,this._startingXpos=0,this._xPos=0,this._width=0,this._initialScrollTop=0,this._verticallyScrolling=!1,this._mql=window.matchMedia(me),this._setupDialog(),this._createDragTarget(),this._setupClasses(),this._setupEventHandlers(),this._syncTriggers(),M._sidenavs.push(this)}static get defaults(){return pe}static init(t,e={}){return super.init(t,e,M)}static getInstance(t){return t.Expressive_NavigationDrawer}destroy(){if(this._removeEventHandlers(),this._dialog?.open)try{this._dialog.close()}catch{}this._clearShift(),this._unwrapDialog(),this._removeDragTarget(),this.el.Expressive_NavigationDrawer=void 0;let t=M._sidenavs.indexOf(this);t>=0&&M._sidenavs.splice(t,1)}_beginClose(){this.isOpen=!1,this._dialog?.classList.remove("dragging"),this._clearShift(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this._syncTriggers()}_finishClose(){typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)}_setupDialog(){if(this.el instanceof HTMLDialogElement){this._dialog=this.el,this._createdDialog=!1;return}let t=this.el.parentElement;if(t instanceof HTMLDialogElement&&t.classList.contains("sidenav-overlay")){this._dialog=t,this._createdDialog=!1;return}let e=document.createElement("dialog");e.classList.add("sidenav-overlay");let i=this.el.closest("[aria-label], [aria-labelledby]")??this.el,s=i.getAttribute("aria-label"),n=i.getAttribute("aria-labelledby");s?e.setAttribute("aria-label",s):n&&e.setAttribute("aria-labelledby",n),this.el.replaceWith(e),e.appendChild(this.el),this._dialog=e,this._createdDialog=!0}_unwrapDialog(){!this._createdDialog||!this._dialog||(this._dialog.replaceWith(this.el),this._dialog=null,this._createdDialog=!1)}_createDragTarget(){if(!this.options.draggable)return;let t=document.createElement("div");t.classList.add("drag-target"),t.style.width=this.options.dragTargetWidth,this.isFixed&&(t.dataset.fixed=""),c.portalRoot(this.el).appendChild(t),this.dragTarget=t}_removeDragTarget(){this.dragTarget?.remove(),this.dragTarget=null}_setupClasses(){this.options.edge==="right"&&(this.el.classList.add("right-aligned"),this._dialog?.classList.add("right-aligned"),this.dragTarget?.classList.add("right-aligned"))}_setupEventHandlers(){M._sidenavs.length===0&&document.body.addEventListener("click",M._handleTriggerClick);let t={passive:!0};this.dragTarget?.addEventListener("touchmove",this._handleDragTargetDrag,t),this.dragTarget?.addEventListener("touchend",this._handleDragTargetRelease),this._dialog?.addEventListener("touchmove",this._handleCloseDrag,t),this._dialog?.addEventListener("touchend",this._handleCloseRelease),this._dialog?.addEventListener("close",this._onDialogClose),this.el.addEventListener("click",this._handleCloseTriggerClick),this._mql.addEventListener("change",this._onBreakpointChange)}_removeEventHandlers(){M._sidenavs.length===1&&document.body.removeEventListener("click",M._handleTriggerClick),this.dragTarget?.removeEventListener("touchmove",this._handleDragTargetDrag),this.dragTarget?.removeEventListener("touchend",this._handleDragTargetRelease),this._dialog?.removeEventListener("touchmove",this._handleCloseDrag),this._dialog?.removeEventListener("touchend",this._handleCloseRelease),this._dialog?.removeEventListener("close",this._onDialogClose),this.el.removeEventListener("click",this._handleCloseTriggerClick),this._mql.removeEventListener("change",this._onBreakpointChange)}static _handleTriggerClick(t){let e=t.target;if(!(e instanceof Element))return;let i=e.closest(".sidenav-trigger, .navigation-drawer-trigger");if(!i||!(i instanceof HTMLElement))return;let s=c.getIdFromTrigger(i),n=c.getElementById(i,s)?.Expressive_NavigationDrawer;n&&(n.open(),t.preventDefault())}_isDraggable(){return this.options.draggable&&!this._isCurrentlyFixed()&&!this._verticallyScrolling}_isCurrentlyFixed(){return this.isFixed&&this._mql.matches}_startDrag(t){let e=t.targetTouches[0].clientX;if(this.isDragged=!0,this._startingXpos=e,this._xPos=e,this._width=this._dialog?.getBoundingClientRect().width||this.el.getBoundingClientRect().width,this._initialScrollTop=this.isOpen?this.el.scrollTop:c.getDocumentScrollTop(),this._verticallyScrolling=!1,this._dialog?.classList.add("dragging"),this._dialog&&!this._dialog.open)try{this._dialog.showModal()}catch{}}_dragMoveUpdate(t){let e=t.targetTouches[0].clientX,i=this.isOpen?this.el.scrollTop:c.getDocumentScrollTop();this._xPos=e,this._initialScrollTop!==i&&(this._verticallyScrolling=!0)}_rawDelta(t){return this.isDragged||this._startDrag(t),this._dragMoveUpdate(t),this._xPos-this._startingXpos}_applyShift(t,e){this.percentOpen=e;let i=this._dialog??this.el;i.style.setProperty("--md-comp-nav-drawer-shift",`${t}px`),i.style.setProperty("--md-comp-nav-drawer-open",String(e))}_clearShift(){let t=this._dialog??this.el;t.style.removeProperty("--md-comp-nav-drawer-shift"),t.style.removeProperty("--md-comp-nav-drawer-open")}_syncTriggers(){this.id&&document.querySelectorAll(".sidenav-trigger, .navigation-drawer-trigger").forEach(t=>{t instanceof HTMLElement&&c.getIdFromTrigger(t)===this.id&&(t.setAttribute("aria-expanded",this.isOpen?"true":"false"),t.setAttribute("aria-controls",this.id))})}};M._sidenavs=[];var q=M;var fe={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},ge="(width < 600px)",tt=class d extends E{constructor(t,e){super(t,e,d);this.expand=()=>{this.isExpanded||(typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.isExpanded=!0,this.el.classList.add("expanded"),this._sync(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el))};this.collapse=()=>{this.isExpanded&&(typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this.isExpanded=!1,this.el.classList.remove("expanded"),this._sync(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el))};this.toggle=()=>{this.isExpanded?this.collapse():this.expand()};this._onClick=t=>{let e=t.target;if(e instanceof Node){if(this._toggle&&(e===this._toggle||this._toggle.contains(e))){this.toggle(),t.preventDefault();return}e===this.el&&this.isExpanded&&this._isModal()&&this.collapse()}};this._onKeyDown=t=>{t.key==="Escape"&&this.isExpanded&&this._isModal()&&this.collapse()};this.el.Expressive_NavigationRail=this,this.options={...d.defaults,...e},this._toggle=this._findToggle(),this._mql=window.matchMedia(ge),this.isExpanded=this.el.classList.contains("expanded"),this._sync(),this.el.addEventListener("click",this._onClick),document.addEventListener("keydown",this._onKeyDown)}static get defaults(){return fe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_NavigationRail}destroy(){this.el.removeEventListener("click",this._onClick),document.removeEventListener("keydown",this._onKeyDown),this.el.Expressive_NavigationRail=void 0}_findToggle(){let t=this.el.querySelector(":scope > button:not(.button)");return t instanceof HTMLButtonElement?t:null}_isCompact(){return this._mql.matches}_isModal(){return this.el.classList.contains("modal")||this._isCompact()}_sync(){this.el.setAttribute("aria-expanded",this.isExpanded?"true":"false"),this._toggle?.setAttribute("aria-expanded",this.isExpanded?"true":"false")}};var ve={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},et=class d extends E{constructor(t,e){super(t,e,d);this._handleWindowResize=()=>{this._setTabsAndTabWidth(),this._tabWidth!==0&&this._tabsWidth!==0&&(this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px")};this._handleTabClick=t=>{let e=t.target;if(!e)return;let i=e.closest("a");if(!i||!Array.from(this._tabLinks).includes(i))return;let s=i.parentElement;if(i.classList.contains("disabled")||i.getAttribute("aria-disabled")==="true"||s?.classList.contains("disabled")){t.preventDefault();return}if(i.hasAttribute("target"))return;let a=this._content;i.hash&&(this._content=document.querySelector(i.hash)),this._tabLinks=this._queryTabLinks(),this._setActiveTabLink(i);let h=this._index;this._index=Math.max(Array.from(this._tabLinks).indexOf(i),0),this.options.swipeable?this._tabsCarousel&&this._tabsCarousel.set(this._index,()=>{typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}):this._content&&(this._content.style.display="block",this._content.classList.add("active"),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content),a&&a!==this._content&&(a.style.display="none",a.classList.remove("active"))),this._setTabsAndTabWidth(),this._animateIndicator(h),t.preventDefault()};this.el.Expressive_Tabs=this,this.options={...d.defaults,...e},this._tabLinks=this._queryTabLinks(),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers()}static get defaults(){return ve}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Tabs}destroy(){this._removeEventHandlers(),this._indicator.parentNode.removeChild(this._indicator),this.options.swipeable?this._teardownSwipeableTabs():this._teardownNormalTabs(),this.el.Expressive_Tabs=void 0}get index(){return this._index}_setupEventHandlers(){window.addEventListener("resize",this._handleWindowResize),this.el.addEventListener("click",this._handleTabClick)}_removeEventHandlers(){window.removeEventListener("resize",this._handleWindowResize),this.el.removeEventListener("click",this._handleTabClick)}_queryTabLinks(){return this.el.querySelectorAll(":scope > a, :scope > .tab > a")}_createIndicator(){let t=this.el.tagName==="UL"||this.el.tagName==="OL"?"li":"span",e=document.createElement(t);e.classList.add("indicator"),this.el.appendChild(e),this._indicator=e,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}_setActiveTabLink(t){Array.from(this._tabLinks).forEach(e=>{e.classList.remove("active"),e.removeAttribute("aria-current")}),this._activeTabLink=t,t.classList.add("active"),t.setAttribute("aria-current","page")}_setupActiveTabLink(){if(this._activeTabLink=Array.from(this._tabLinks).find(t=>t.getAttribute("href")===location.hash),!this._activeTabLink){let t=this.el.querySelector("a.active");t||(t=this._tabLinks[0]),this._activeTabLink=t}this._setActiveTabLink(this._activeTabLink),this._index=Math.max(Array.from(this._tabLinks).indexOf(this._activeTabLink),0),this._activeTabLink&&this._activeTabLink.hash&&(this._content=document.querySelector(this._activeTabLink.hash),this._content&&this._content.classList.add("active"))}_setupSwipeableTabs(){window.innerWidth>this.options.responsiveThreshold&&(this.options.swipeable=!1);let t=[];this._tabLinks.forEach(i=>{if(i.hash){let s=document.querySelector(i.hash);s.classList.add("carousel-item"),t.push(s)}});let e=document.createElement("div");e.classList.add("tabs-content","carousel","flat"),t[0].parentElement.insertBefore(e,t[0]),t.forEach(i=>{e.appendChild(i),i.style.display=""}),this._tabsCarousel=W.init(e,{fullWidth:!0,noWrap:!0,onCycleTo:i=>{let s=this._index;this._index=Array.from(i.parentNode.children).indexOf(i),this._activeTabLink.classList.remove("active"),this._activeTabLink=Array.from(this._tabLinks)[this._index],this._activeTabLink.classList.add("active"),this._animateIndicator(s),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}}),this._tabsCarousel.set(this._index)}_teardownSwipeableTabs(){let t=this._tabsCarousel.el;this._tabsCarousel.destroy(),t.append(t.parentElement),t.remove()}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(t!==this._activeTabLink&&t.hash){let e=document.querySelector(t.hash);e&&(e.style.display="none")}})}_teardownNormalTabs(){this._tabLinks.forEach(t=>{if(t.hash){let e=document.querySelector(t.hash);e&&(e.style.display="")}})}_setTabsAndTabWidth(){this._tabsWidth=this.el.getBoundingClientRect().width,this._tabWidth=Math.max(this._tabsWidth,this.el.scrollWidth)/this._tabLinks.length}_calcRightPos(t){return Math.ceil(this._tabsWidth-t.offsetLeft-t.getBoundingClientRect().width)}_calcLeftPos(t){return Math.floor(t.offsetLeft)}updateTabIndicator(){this._setTabsAndTabWidth(),this._animateIndicator(this._index)}_animateIndicator(t){let e=0,i=0;this._index-t>=0?e=90:i=90,this._indicator.style.transition=`
|
|
27
|
+
`,this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this.el.style.left="0",this.el.style.top="0",this._schedule(()=>{this._reset(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_addCaption(){this._photoCaption=document.createElement("div"),this._photoCaption.classList.add("lightbox-caption"),this._photoCaption.innerText=this.caption,u.portalRoot(this.el).append(this._photoCaption),this._photoCaption.style.display="inline",this._photoCaption.style.transition="none",this._photoCaption.style.opacity="0";let t=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="1"},1)}_removeCaption(){let t=this._motion.matches?0:this.options.outDuration;this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="0"}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",i=>{i.stopPropagation(),this.close()},{once:!0}),this.el.before(this._overlay);let t=this._overlay.getBoundingClientRect();this._overlay.style.width=this.windowWidth+"px",this._overlay.style.height=this.windowHeight+"px",this._overlay.style.left=-1*t.left+"px",this._overlay.style.top=-1*t.top+"px",this._overlay.style.transition="none",this._overlay.style.opacity="0";let e=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._overlay.style.transition=`opacity ${e}ms ease`,this._overlay.style.opacity="1"},1)}_removeOverlay(){let t=this._motion.matches?0:this.options.outDuration;this._overlay.style.transition=`opacity ${t}ms ease`,this._overlay.style.opacity="0"}};A._overflow=new WeakMap;var Q=A;var xt=d=>`a[href="#${d}"]`,ue={scrollOffset:200,activeClass:"active",getActiveElement:xt,keepTopElementActive:!1},g=class g extends _{constructor(n,t){super(n,t,g),this.el.Expressive_ScrollSpy=this,this.options={...g.defaults,...t},this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),g._elements.push(this),g._ensureObserver(this.options.scrollOffset),g._observer?.observe(this.el)}static get defaults(){return ue}static init(n,t={}){return super.init(n,t,g)}static getInstance(n){return n.Expressive_ScrollSpy}destroy(){let n=g._elements.indexOf(this);n>=0&&g._elements.splice(n,1),g._ratios.delete(this.el),g._observer?.unobserve(this.el);let t=g._linkFor(this.el.id,this.options);t&&t===g._active?g._clearActive(this.options):(t?.classList.remove(this.options.activeClass),t?.removeAttribute("aria-current")),g._elements.length===0?(g._observer?.disconnect(),g._observer=null,g._ratios.clear(),g._active=null):g._syncActive(),this.el.Expressive_ScrollSpy=void 0}static _ensureObserver(n){g._observer||typeof IntersectionObserver>"u"||(g._observer=new IntersectionObserver(g._onIntersect,{rootMargin:`-${n}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}))}static _syncActive(){if(!g._elements.length)return;let n=g._elements[0].options,t=null,e=0;for(let s of g._elements){let o=g._ratios.get(s.el)??0;o>e&&(e=o,t=s)}if(!t)if(n.keepTopElementActive)t=g._nearestAbove()??g._elements[0];else{g._clearActive(n);return}let i=g._linkFor(t.el.id,t.options);i!==g._active&&(g._clearActive(n),i&&(i.classList.add(t.options.activeClass),i.setAttribute("aria-current","true"),g._active=i))}static _nearestAbove(){let n=null,t=-1/0;for(let e of g._elements){let i=e.el.getBoundingClientRect().top;i<=0&&i>=t&&(t=i,n=e)}return n}static _clearActive(n){g._active&&(g._active.classList.remove(n.activeClass),g._active.removeAttribute("aria-current"),g._active=null)}static _linkFor(n,t){if(!n)return null;if(t.getActiveElement!==xt)try{return document.querySelector(t.getActiveElement(n))}catch{return null}let e=`#${n}`,i=document.querySelectorAll('a[href^="#"]');for(let s=0;s<i.length;s++)if(i[s].getAttribute("href")===e)return i[s];return null}};g._elements=[],g._observer=null,g._ratios=new Map,g._active=null,g._onIntersect=n=>{for(let t of n)t.isIntersecting&&t.intersectionRatio>0?g._ratios.set(t.target,t.intersectionRatio):g._ratios.delete(t.target);g._syncActive()};var J=g;var pe={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},me="(width < 600px)",tt=class d extends _{constructor(t,e){super(t,e,d);this.expand=()=>{this.isExpanded||(typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.isExpanded=!0,this.el.classList.add("expanded"),this._sync(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el))};this.collapse=()=>{this.isExpanded&&(typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this.isExpanded=!1,this.el.classList.remove("expanded"),this._sync(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el))};this.toggle=()=>{this.isExpanded?this.collapse():this.expand()};this._onClick=t=>{let e=t.target;if(e instanceof Node){if(this._toggle&&(e===this._toggle||this._toggle.contains(e))){this.toggle(),t.preventDefault();return}e===this.el&&this.isExpanded&&this._isModal()&&this.collapse()}};this._onKeyDown=t=>{t.key==="Escape"&&this.isExpanded&&this._isModal()&&this.collapse()};this.el.Expressive_NavigationRail=this,this.options={...d.defaults,...e},this._toggle=this._findToggle(),this._mql=window.matchMedia(me),this.isExpanded=this.el.classList.contains("expanded"),this._sync(),this.el.addEventListener("click",this._onClick),document.addEventListener("keydown",this._onKeyDown)}static get defaults(){return pe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_NavigationRail}destroy(){this.el.removeEventListener("click",this._onClick),document.removeEventListener("keydown",this._onKeyDown),this.el.Expressive_NavigationRail=void 0}_findToggle(){let t=this.el.querySelector(":scope > button:not(.button)");return t instanceof HTMLButtonElement?t:null}_isCompact(){return this._mql.matches}_isModal(){return this.el.classList.contains("modal")||this._isCompact()}_sync(){this.el.setAttribute("aria-expanded",this.isExpanded?"true":"false"),this._toggle?.setAttribute("aria-expanded",this.isExpanded?"true":"false")}};var fe={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},et=class d extends _{constructor(t,e){var i;super(t,e,d);this._originalPanels=new Map;this._originalLinks=new Map;this._handleWindowResize=()=>{this._setTabsAndTabWidth(),this._tabWidth!==0&&this._tabsWidth!==0&&(this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px")};this._handleTabClick=t=>{let e=t.target;if(!e)return;let i=e.closest("a");if(!i||!Array.from(this._tabLinks).includes(i))return;let s=i.parentElement;if(i.classList.contains("disabled")||i.getAttribute("aria-disabled")==="true"||s?.classList.contains("disabled")){t.preventDefault();return}if(i.hasAttribute("target"))return;if(this.options.swipeable){let h=i.hash&&document.querySelector(i.hash),l=this._tabsCarousel.images.indexOf(h);l>=0&&this._tabsCarousel.set(l),t.preventDefault();return}let r=this._content;i.hash&&(this._content=document.querySelector(i.hash)),this._tabLinks=this._queryTabLinks();let c=this._index;this._setActiveTabLink(i),this._content&&(this._content.style.display="block",this._content.classList.add("active"),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content),r&&r!==this._content&&(r.style.display="none",r.classList.remove("active"))),this._setTabsAndTabWidth(),this._animateIndicator(c),t.preventDefault()};this.el.Expressive_Tabs=this,this.options={...d.defaults,...e},this._tabLinks=this._queryTabLinks(),this._tabLinks.forEach(s=>{if(this._originalLinks.set(s,{active:s.classList.contains("active"),current:s.getAttribute("aria-current")}),s.hasAttribute("target"))return;let o=s.hash&&document.querySelector(s.hash);o&&this._originalPanels.set(o,{display:o.style.display,priority:o.style.getPropertyPriority("display"),active:o.classList.contains("active"),carousel:o.classList.contains("carousel-item")})}),(i=this.options).swipeable&&(i.swipeable=window.innerWidth<=this.options.responsiveThreshold),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers()}static get defaults(){return fe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Tabs}destroy(){this._removeEventHandlers(),this._indicator.remove(),this.options.swipeable&&this._teardownSwipeableTabs(),this._originalPanels.forEach((t,e)=>{e.style.setProperty("display",t.display,t.priority),e.classList.toggle("active",t.active),e.classList.toggle("carousel-item",t.carousel),e.className||e.removeAttribute("class")}),this._originalLinks.forEach((t,e)=>{e.classList.toggle("active",t.active),t.current===null?e.removeAttribute("aria-current"):e.setAttribute("aria-current",t.current)}),this.el.Expressive_Tabs=void 0}get index(){return this._index}_setupEventHandlers(){window.addEventListener("resize",this._handleWindowResize),this.el.addEventListener("click",this._handleTabClick)}_removeEventHandlers(){window.removeEventListener("resize",this._handleWindowResize),this.el.removeEventListener("click",this._handleTabClick)}_queryTabLinks(){return this.el.querySelectorAll(":scope > a, :scope > .tab > a")}_createIndicator(){let t=this.el.tagName==="UL"||this.el.tagName==="OL"?"li":"span",e=document.createElement(t);e.classList.add("indicator"),this.el.appendChild(e),this._indicator=e,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}_setActiveTabLink(t){Array.from(this._tabLinks).forEach(e=>{e.classList.remove("active"),e.removeAttribute("aria-current")}),this._activeTabLink=t,t.classList.add("active"),t.setAttribute("aria-current","page"),this._index=Array.from(this._tabLinks).indexOf(t),this._content=t.hasAttribute("target")?null:document.getElementById(t.hash.slice(1))}_setupActiveTabLink(){if(this._activeTabLink=Array.from(this._tabLinks).find(t=>t.getAttribute("href")===location.hash),!this._activeTabLink){let t=this.el.querySelector("a.active");t||(t=this._tabLinks[0]),this._activeTabLink=t}this._setActiveTabLink(this._activeTabLink),this._originalPanels.forEach((t,e)=>e.classList.toggle("active",e===this._content))}_setupSwipeableTabs(){let t=[];this._tabLinks.forEach(i=>{if(i.hash&&!i.hasAttribute("target")){let s=document.querySelector(i.hash);if(!s)return;s.classList.add("carousel-item"),t.push(s)}});let e=document.createElement("div");e.classList.add("tabs-content","carousel","flat"),t[0].parentElement.insertBefore(e,t[0]),t.forEach(i=>{let s=document.createComment("");i.before(s),this._originalPanels.get(i).marker=s,e.appendChild(i),i.style.display=""}),this._tabsCarousel=N.init(e,{fullWidth:!0,noWrap:!0,duration:this.options.duration,onCycleTo:i=>{let s=this._index;this._setActiveTabLink(Array.from(this._tabLinks).find(o=>!o.hasAttribute("target")&&o.hash==="#"+i.id)),this._setTabsAndTabWidth(),this._animateIndicator(s),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}})}_teardownSwipeableTabs(){let t=this._tabsCarousel.el;this._tabsCarousel.destroy(),this._originalPanels.forEach((e,i)=>e.marker?.replaceWith(i)),t.remove()}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(!(t===this._activeTabLink||t.hasAttribute("target"))&&t.hash){let e=document.querySelector(t.hash);e&&(e.style.display="none")}})}_setTabsAndTabWidth(){this._tabsWidth=this.el.getBoundingClientRect().width,this._tabWidth=Math.max(this._tabsWidth,this.el.scrollWidth)/this._tabLinks.length}_calcRightPos(t){return Math.ceil(this._tabsWidth-t.offsetLeft-t.getBoundingClientRect().width)}_calcLeftPos(t){return Math.floor(t.offsetLeft)}updateTabIndicator(){this._setTabsAndTabWidth(),this._animateIndicator(this._index)}_animateIndicator(t){let e=0,i=0;this._index-t>=0?e=90:i=90,this._indicator.style.transition=`
|
|
28
28
|
left ${this.options.duration}ms ease-out ${e}ms,
|
|
29
|
-
right ${this.options.duration}ms ease-out ${i}ms`,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}select(t){let e=Array.from(this._tabLinks).find(i=>i.getAttribute("href")==="#"+t);e&&e.click()}};var Ee={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok"},twelveHour:!0,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},y=class y extends E{constructor(t,e){super(t,e,y);this._dragPointerId=null;this._clockBuilt=!1;this._handleInputClick=()=>{this._ensureClockBuilt(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this),this.displayPlugin&&this.displayPlugin.show()};this._handleInputKeydown=t=>{t.key===c.keys.ENTER&&(t.preventDefault(),this._ensureClockBuilt(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this),this.displayPlugin&&this.displayPlugin.show())};this._handleClockClickStart=t=>{if(!t.isPrimary||t.pointerType==="mouse"&&t.button!==0)return;t.preventDefault(),this._ensureClockBuilt();let e=this.plate.getBoundingClientRect(),i={x:e.left,y:e.top};this.x0=i.x+this.options.dialRadius,this.y0=i.y+this.options.dialRadius,this.moved=!1,this._dragPointerId=t.pointerId,this.dx=t.clientX-this.x0,this.dy=t.clientY-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("pointermove",this._handleDocumentClickMove),document.addEventListener("pointerup",this._handleDocumentClickEnd),document.addEventListener("pointercancel",this._handleDocumentClickCancel)};this._handleDocumentClickMove=t=>{if(t.pointerId!==this._dragPointerId)return;t.preventDefault();let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved=!0,this.setHand(e,i,!1)};this._handleDocumentClickEnd=t=>{if(t.pointerId!==this._dragPointerId)return;this._dragPointerId=null,t.preventDefault(),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel);let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved&&e===this.dx&&i===this.dy&&this.setHand(e,i),this.currentView==="hours"?(this.inputMinutes.focus(),this.showView("minutes",this.options.duration/2)):setTimeout(()=>{this.options.autoSubmit&&this.done()},this.options.duration/2),typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("pointermove",this._handleDocumentClickMove)};this._handleDocumentClickCancel=t=>{t.pointerId===this._dragPointerId&&(this._dragPointerId=null,this.moved=!1,document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel))};this._handleAmPmClick=t=>{this._handleAmPmInteraction(t.target)};this._handleAmPmKeypress=t=>{t.key===c.keys.ENTER&&this._handleAmPmInteraction(t.target)};this._handleAmPmInteraction=t=>{this.amOrPm=t.classList.contains("am-btn")?"AM":"PM",this._updateAmPmView()};this.showView=(t,e=null)=>{this._ensureClockBuilt();let i=t==="hours",s=i?this.hoursView:this.minutesView,n=i?this.minutesView:this.hoursView;this.currentView=t,n.classList.add("timepicker-dial-out"),s.style.visibility="visible",s.classList.remove("timepicker-dial-out"),this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(()=>{n.style.visibility="hidden"},this.options.duration)};this._inputFromTextField=()=>{let t=this.currentView==="hours";if(t&&this.inputHours.value!==""){let e=parseInt(this.inputHours.value);e>0&&e<(this.options.twelveHour?13:24)?this.hours=e:this.setHoursDefault(),this.drawClockFromTimeInput(this.hours,t)}else if(!t&&this.inputMinutes.value!==""){let e=parseInt(this.inputMinutes.value);e>=0&&e<60?this.minutes=e:(this.minutes=new Date().getMinutes(),this.inputMinutes.value=this.minutes.toString()),this.drawClockFromTimeInput(this.minutes,t)}};this.done=(t=null)=>{let e=this.el.value,i=t?"":y._addLeadingZero(this.hours)+":"+y._addLeadingZero(this.minutes);this.time=i,!t&&this.options.twelveHour&&(i=`${i} ${this.amOrPm}`),this.el.value=i,i!==e&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))};this.confirm=()=>{this.done(),typeof this.options.onDone=="function"&&this.options.onDone.call(this)};this.cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.clear=()=>{this.done(!0)};this.el.Expressive_Timepicker=this,this.options={...y.defaults,...e},this.id=c.guid(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=j.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return Ee}static init(t,e={}){return super.init(t,e,y)}static _addLeadingZero(t){return(t<10?"0":"")+t}static _createSVGEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}static getInstance(t){return t.Expressive_Timepicker}destroy(){this._removeEventHandlers(),this.displayPlugin?.destroy(),this.containerEl.remove(),this.el.Expressive_Timepicker=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.plate.addEventListener("pointerdown",this._handleClockClickStart),this.digitalClock.addEventListener("keyup",this._inputFromTextField),this.inputHours.addEventListener("focus",()=>this.showView("hours")),this.inputHours.addEventListener("focusout",()=>this.formatHours()),this.inputMinutes.addEventListener("focus",()=>this.showView("minutes")),this.inputMinutes.addEventListener("focusout",()=>this.formatMinutes())}_removeEventHandlers(){this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel)}_insertHTMLIntoDOM(){let t=document.createElement("template");t.innerHTML=y._template.trim(),this.containerEl=t.content.firstChild,this.containerEl.id="container-"+this.id;let e=this.options.container,i=e instanceof HTMLElement?e:document.querySelector(e);this.options.container&&i?i.append(this.containerEl):this.el.parentElement.appendChild(this.containerEl)}_setupVariables(){this.currentView="hours",this.canVibrate=typeof navigator.vibrate=="function",this._canvas=this.containerEl.querySelector(".timepicker-canvas"),this.plate=this.containerEl.querySelector(".timepicker-plate"),this.digitalClock=this.containerEl.querySelector(".timepicker-display-column"),this.hoursView=this.containerEl.querySelector(".timepicker-hours"),this.minutesView=this.containerEl.querySelector(".timepicker-minutes"),this.inputHours=this.containerEl.querySelector(".timepicker-input-hours"),this.inputMinutes=this.containerEl.querySelector(".timepicker-input-minutes"),this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_pickerSetup(){c.createButton(this.footer,this.options.i18n.clear,["timepicker-clear"],this.options.showClearBtn,this.clear),this.options.autoSubmit||c.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this.confirm,this.cancel),this._updateTimeFromInput(),this.options.displayPlugin||this.showView("hours")}_ensureClockBuilt(){this._clockBuilt||(this._clockBuilt=!0,this._clockSetup(),this._updateAmPmView())}_clockSetup(){this.options.twelveHour&&(this._amBtn=document.createElement("div"),this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.tabIndex=0,this._amBtn.addEventListener("click",this._handleAmPmClick),this._amBtn.addEventListener("keypress",this._handleAmPmKeypress),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("div"),this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.tabIndex=0,this._pmBtn.addEventListener("click",this._handleAmPmClick),this._pmBtn.addEventListener("keypress",this._handleAmPmKeypress),this.spanAmPm.appendChild(this._pmBtn)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}_buildSVGClock(){let t=this.options.dialRadius,e=this.options.tickRadius,i=t*2,s=y._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let n=y._createSVGEl("g");n.setAttribute("transform","translate("+t+","+t+")");let a=y._createSVGEl("circle");a.setAttribute("class","timepicker-canvas-bearing"),a.setAttribute("cx","0"),a.setAttribute("cy","0"),a.setAttribute("r","4");let h=y._createSVGEl("line");h.setAttribute("x1","0"),h.setAttribute("y1","0");let l=y._createSVGEl("circle");l.setAttribute("class","timepicker-canvas-bg"),l.setAttribute("r",e.toString()),n.appendChild(h),n.appendChild(l),n.appendChild(a),s.appendChild(n),this._canvas.appendChild(s),this.hand=h,this.bg=l,this.bearing=a,this.g=n}_buildHoursView(){if(this.options.twelveHour)for(let t=1;t<13;t+=1){let e=t/6*Math.PI,i=this.options.outerRadius;this._buildHoursTick(t,e,i)}else for(let t=0;t<24;t+=1){let e=t/6*Math.PI,s=t>0&&t<13?this.options.innerRadius:this.options.outerRadius;this._buildHoursTick(t,e,s)}}_buildHoursTick(t,e,i){let s=document.createElement("div");s.classList.add("timepicker-tick"),s.style.left=this.options.dialRadius+Math.sin(e)*i-this.options.tickRadius+"px",s.style.top=this.options.dialRadius-Math.cos(e)*i-this.options.tickRadius+"px",s.textContent=t===0?"00":t.toString(),this.hoursView.appendChild(s)}_buildMinutesView(){let t=document.createElement("div");t.classList.add("timepicker-tick");for(let e=0;e<60;e+=5){let i=t.cloneNode(!0),s=e/30*Math.PI;i.style.left=this.options.dialRadius+Math.sin(s)*this.options.outerRadius-this.options.tickRadius+"px",i.style.top=this.options.dialRadius-Math.cos(s)*this.options.outerRadius-this.options.tickRadius+"px",i.textContent=y._addLeadingZero(e),this.minutesView.appendChild(i)}}_updateAmPmView(){!this._amBtn||!this._pmBtn||this.options.twelveHour&&(this.amOrPm==="PM"?(this._amBtn.classList.remove("filled"),this._pmBtn.classList.add("filled")):this.amOrPm==="AM"&&(this._amBtn.classList.add("filled"),this._pmBtn.classList.remove("filled")))}_updateTimeFromInput(){let t=((this.el.value||this.options.defaultTime||"")+"").split(":");if(this.options.twelveHour&&!(typeof t[1]>"u")&&(t[1].toUpperCase().indexOf("AM")>0?this.amOrPm="AM":this.amOrPm="PM",t[1]=t[1].replace("AM","").replace("PM","")),t[0]==="now"){let e=new Date(+new Date+this.options.fromNow);t=[e.getHours().toString(),e.getMinutes().toString()],this.options.twelveHour&&(this.amOrPm=parseInt(t[0])>=12&&parseInt(t[0])<24?"PM":"AM")}this.hours=+t[0]||0,this.minutes=+t[1]||0,this.inputHours.value=y._addLeadingZero(this.hours),this.inputMinutes.value=y._addLeadingZero(this.minutes),this._updateAmPmView()}resetClock(t){let e=this.currentView,i=this[e],s=e==="hours",n=Math.PI/(s?6:30),a=i*n,h=s&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,l=Math.sin(a)*h,r=-Math.cos(a)*h;t?(this._canvas?.classList.add("timepicker-canvas-out"),setTimeout(()=>{this._canvas?.classList.remove("timepicker-canvas-out"),this.setHand(l,r)},t)):this.setHand(l,r)}drawClockFromTimeInput(t,e){let i=Math.PI/(e?6:30),s=t*i,n;this.options.twelveHour?n=this.options.outerRadius:n=e&&t>0&&t<13?this.options.innerRadius:this.options.outerRadius,this.setClockAttributes(s,n)}setHand(t,e,i=!1){let s=this.currentView==="hours",n=Math.PI/(s||i?6:30),a=Math.sqrt(t*t+e*e),h=s&&a<(this.options.outerRadius+this.options.innerRadius)/2,l=Math.atan2(t,-e),r=h?this.options.innerRadius:this.options.outerRadius;this.options.twelveHour&&(r=this.options.outerRadius),l<0&&(l=Math.PI*2+l);let u=Math.round(l/n);l=u*n,this.options.twelveHour?s?u===0&&(u=12):(i&&(u*=5),u===60&&(u=0)):s?(u===12&&(u=0),u=h?u===0?12:u:u===0?0:u+12):(i&&(u*=5),u===60&&(u=0)),this[this.currentView]!==u&&this.canVibrate&&this.options.vibrate&&(this.vibrateTimer||(navigator.vibrate(10),this.vibrateTimer=setTimeout(()=>{this.vibrateTimer=null},100))),this[this.currentView]=u,s?this.inputHours.value=y._addLeadingZero(u):this.inputMinutes.value=y._addLeadingZero(u),this.setClockAttributes(l,r)}setClockAttributes(t,e){if(!this.hand||!this.bg)return;let i=Math.sin(t)*(e-this.options.tickRadius),s=-Math.cos(t)*(e-this.options.tickRadius),n=Math.sin(t)*e,a=-Math.cos(t)*e;this.hand.setAttribute("x2",i.toString()),this.hand.setAttribute("y2",s.toString()),this.bg.setAttribute("cx",n.toString()),this.bg.setAttribute("cy",a.toString())}formatHours(){this.inputHours.value==""&&this.setHoursDefault(),this.inputHours.value=y._addLeadingZero(Number(this.inputHours.value))}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=y._addLeadingZero(Number(this.inputMinutes.value))}setHoursDefault(){this.hours=new Date().getHours(),this.inputHours.value=(this.hours%(this.options.twelveHour?12:24)).toString()}};y._template=`<div class="timepicker-container">
|
|
29
|
+
right ${this.options.duration}ms ease-out ${i}ms`,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}select(t){let e=Array.from(this._tabLinks).find(i=>i.getAttribute("href")==="#"+t);e&&e.click()}};var ve={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",hours:"Hours",minutes:"Minutes"},twelveHour:!0,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},L=class L extends _{constructor(t,e){super(t,e,L);this._dragPointerId=null;this._clockBuilt=!1;this._handleInputClick=()=>{this._ensureClockBuilt(),this.displayPlugin&&this.displayPlugin.show(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===u.keys.ENTER&&(t.preventDefault(),this._ensureClockBuilt(),this.displayPlugin&&this.displayPlugin.show(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this))};this._handleClockClickStart=t=>{if(!t.isPrimary||t.pointerType==="mouse"&&t.button!==0)return;t.preventDefault(),this._ensureClockBuilt();let e=this.plate.getBoundingClientRect(),i={x:e.left,y:e.top};this.x0=i.x+this.options.dialRadius,this.y0=i.y+this.options.dialRadius,this.moved=!1,this._dragPointerId=t.pointerId,this.dx=t.clientX-this.x0,this.dy=t.clientY-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("pointermove",this._handleDocumentClickMove),document.addEventListener("pointerup",this._handleDocumentClickEnd),document.addEventListener("pointercancel",this._handleDocumentClickCancel)};this._handleDocumentClickMove=t=>{if(t.pointerId!==this._dragPointerId)return;t.preventDefault();let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved=!0,this.setHand(e,i,!1)};this._handleDocumentClickEnd=t=>{if(t.pointerId!==this._dragPointerId)return;this._dragPointerId=null,t.preventDefault(),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel);let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved&&e===this.dx&&i===this.dy&&this.setHand(e,i),this.currentView==="hours"?(this.inputMinutes.focus(),this.showView("minutes",this.options.duration/2)):setTimeout(()=>{this.options.autoSubmit&&this.done()},this.options.duration/2),typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("pointermove",this._handleDocumentClickMove)};this._handleDocumentClickCancel=t=>{t.pointerId===this._dragPointerId&&(this._dragPointerId=null,this.moved=!1,document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel))};this._handleAmPmClick=t=>{this._handleAmPmInteraction(t.target)};this._handleAmPmInteraction=t=>{this.amOrPm=t.classList.contains("am-btn")?"AM":"PM",this._updateAmPmView()};this.showView=(t,e=null)=>{this._ensureClockBuilt();let i=t==="hours",s=i?this.hoursView:this.minutesView,o=i?this.minutesView:this.hoursView;this.currentView=t,o.classList.add("timepicker-dial-out"),s.style.visibility="visible",s.classList.remove("timepicker-dial-out"),this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(()=>{o.style.visibility="hidden"},this.options.duration)};this._inputFromTextField=t=>{let e=t.target,i=e===this.inputHours;if(!i&&e!==this.inputMinutes)return;let s=Number(e.value),o=i&&this.options.twelveHour?1:0,r=i?this.options.twelveHour?12:23:59;!e.value.trim()||!Number.isInteger(s)||s<o||s>r||(this[i?"hours":"minutes"]=s,this.drawClockFromTimeInput(s,i))};this.done=(t=null)=>{let e=this.el.value,i=t?"":L._addLeadingZero(this.hours)+":"+L._addLeadingZero(this.minutes);this.time=i,!t&&this.options.twelveHour&&(i=`${i} ${this.amOrPm}`),this.el.value=i,i!==e&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))};this.confirm=()=>{this.done(),typeof this.options.onDone=="function"&&this.options.onDone.call(this)};this.cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.clear=()=>{this.done(!0)};this.el.Expressive_Timepicker=this,this.options={...L.defaults,...e,i18n:{...L.defaults.i18n,...e?.i18n}},this.id=u.guid(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=j.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return ve}static init(t,e={}){return super.init(t,e,L)}static _addLeadingZero(t){return(t<10?"0":"")+t}static _createSVGEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}static getInstance(t){return t.Expressive_Timepicker}destroy(){this._removeEventHandlers(),this.displayPlugin?.destroy(),this.containerEl.remove(),this.el.Expressive_Timepicker=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.plate.addEventListener("pointerdown",this._handleClockClickStart),this.digitalClock.addEventListener("input",this._inputFromTextField),this.inputHours.addEventListener("focus",()=>this.showView("hours")),this.inputHours.addEventListener("focusout",()=>this.formatHours()),this.inputMinutes.addEventListener("focus",()=>this.showView("minutes")),this.inputMinutes.addEventListener("focusout",()=>this.formatMinutes())}_removeEventHandlers(){this.digitalClock.removeEventListener("input",this._inputFromTextField),this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel)}_insertHTMLIntoDOM(){let t=document.createElement("template");t.innerHTML=L._template.trim(),this.containerEl=t.content.firstChild,this.containerEl.id="container-"+this.id;let e=this.options.container,i=e instanceof HTMLElement?e:document.querySelector(e);this.options.container&&i?i.append(this.containerEl):this.el.parentElement.appendChild(this.containerEl)}_setupVariables(){this.currentView="hours",this.canVibrate=typeof navigator.vibrate=="function",this._canvas=this.containerEl.querySelector(".timepicker-canvas"),this.plate=this.containerEl.querySelector(".timepicker-plate"),this.digitalClock=this.containerEl.querySelector(".timepicker-display-column"),this.hoursView=this.containerEl.querySelector(".timepicker-hours"),this.minutesView=this.containerEl.querySelector(".timepicker-minutes"),this.inputHours=this.containerEl.querySelector(".timepicker-input-hours"),this.inputMinutes=this.containerEl.querySelector(".timepicker-input-minutes"),this.inputHours.setAttribute("aria-label",this.options.i18n.hours),this.inputMinutes.setAttribute("aria-label",this.options.i18n.minutes),this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_pickerSetup(){u.createButton(this.footer,this.options.i18n.clear,["timepicker-clear"],this.options.showClearBtn,this.clear),this.options.autoSubmit||u.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this.confirm,this.cancel),this._updateTimeFromInput(),this.options.displayPlugin||this.showView("hours")}_ensureClockBuilt(){this._clockBuilt||(this._clockBuilt=!0,this._clockSetup(),this._updateAmPmView())}_clockSetup(){this.options.twelveHour&&(this._amBtn=document.createElement("button"),this._amBtn.type="button",this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("button"),this._pmBtn.type="button",this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._pmBtn)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}_buildSVGClock(){let t=this.options.dialRadius,e=this.options.tickRadius,i=t*2,s=L._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let o=L._createSVGEl("g");o.setAttribute("transform","translate("+t+","+t+")");let r=L._createSVGEl("circle");r.setAttribute("class","timepicker-canvas-bearing"),r.setAttribute("cx","0"),r.setAttribute("cy","0"),r.setAttribute("r","4");let c=L._createSVGEl("line");c.setAttribute("x1","0"),c.setAttribute("y1","0");let h=L._createSVGEl("circle");h.setAttribute("class","timepicker-canvas-bg"),h.setAttribute("r",e.toString()),o.appendChild(c),o.appendChild(h),o.appendChild(r),s.appendChild(o),this._canvas.appendChild(s),this.hand=c,this.bg=h,this.bearing=r,this.g=o}_buildHoursView(){if(this.options.twelveHour)for(let t=1;t<13;t+=1){let e=t/6*Math.PI,i=this.options.outerRadius;this._buildHoursTick(t,e,i)}else for(let t=0;t<24;t+=1){let e=t/6*Math.PI,s=t>0&&t<13?this.options.innerRadius:this.options.outerRadius;this._buildHoursTick(t,e,s)}}_buildHoursTick(t,e,i){let s=document.createElement("div");s.classList.add("timepicker-tick"),s.style.left=this.options.dialRadius+Math.sin(e)*i-this.options.tickRadius+"px",s.style.top=this.options.dialRadius-Math.cos(e)*i-this.options.tickRadius+"px",s.textContent=t===0?"00":t.toString(),this.hoursView.appendChild(s)}_buildMinutesView(){let t=document.createElement("div");t.classList.add("timepicker-tick");for(let e=0;e<60;e+=5){let i=t.cloneNode(!0),s=e/30*Math.PI;i.style.left=this.options.dialRadius+Math.sin(s)*this.options.outerRadius-this.options.tickRadius+"px",i.style.top=this.options.dialRadius-Math.cos(s)*this.options.outerRadius-this.options.tickRadius+"px",i.textContent=L._addLeadingZero(e),this.minutesView.appendChild(i)}}_updateAmPmView(){!this._amBtn||!this._pmBtn||(this._amBtn.setAttribute("aria-pressed",String(this.amOrPm==="AM")),this._pmBtn.setAttribute("aria-pressed",String(this.amOrPm==="PM")),this._amBtn.classList.toggle("outlined",this.amOrPm!=="AM"),this._pmBtn.classList.toggle("outlined",this.amOrPm!=="PM"),this.options.twelveHour&&(this.amOrPm==="PM"?(this._amBtn.classList.remove("filled"),this._pmBtn.classList.add("filled")):this.amOrPm==="AM"&&(this._amBtn.classList.add("filled"),this._pmBtn.classList.remove("filled"))))}_updateTimeFromInput(){let t=((this.el.value||this.options.defaultTime||"")+"").trim().toUpperCase().split(":"),e=t[1]?.match(/AM|PM/)?.[0];if(t[1]=t[1]?.replace(/AM|PM/,""),t[0]==="NOW"){let i=new Date(+new Date+this.options.fromNow);t=[i.getHours().toString(),i.getMinutes().toString()]}this.hours=+t[0]||0,this.minutes=+t[1]||0,this.options.twelveHour&&(this.amOrPm=e==="AM"||e==="PM"?e:this.hours>=12?"PM":"AM",this.hours=this.hours%12||12),this.inputHours.value=L._addLeadingZero(this.hours),this.inputMinutes.value=L._addLeadingZero(this.minutes),this._updateAmPmView()}resetClock(t){let e=this.currentView,i=this[e],s=e==="hours",o=Math.PI/(s?6:30),r=i*o,c=s&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,h=Math.sin(r)*c,l=-Math.cos(r)*c;t?(this._canvas?.classList.add("timepicker-canvas-out"),setTimeout(()=>{this._canvas?.classList.remove("timepicker-canvas-out"),this.setHand(h,l)},t)):this.setHand(h,l)}drawClockFromTimeInput(t,e){let i=Math.PI/(e?6:30),s=t*i,o;this.options.twelveHour?o=this.options.outerRadius:o=e&&t>0&&t<13?this.options.innerRadius:this.options.outerRadius,this.setClockAttributes(s,o)}setHand(t,e,i=!1){let s=this.currentView==="hours",o=Math.PI/(s||i?6:30),r=Math.sqrt(t*t+e*e),c=s&&r<(this.options.outerRadius+this.options.innerRadius)/2,h=Math.atan2(t,-e),l=c?this.options.innerRadius:this.options.outerRadius;this.options.twelveHour&&(l=this.options.outerRadius),h<0&&(h=Math.PI*2+h);let a=Math.round(h/o);h=a*o,this.options.twelveHour?s?a===0&&(a=12):(i&&(a*=5),a===60&&(a=0)):s?(a===12&&(a=0),a=c?a===0?12:a:a===0?0:a+12):(i&&(a*=5),a===60&&(a=0)),this[this.currentView]!==a&&this.canVibrate&&this.options.vibrate&&(this.vibrateTimer||(navigator.vibrate(10),this.vibrateTimer=setTimeout(()=>{this.vibrateTimer=null},100))),this[this.currentView]=a,s?this.inputHours.value=L._addLeadingZero(a):this.inputMinutes.value=L._addLeadingZero(a),this.setClockAttributes(h,l)}setClockAttributes(t,e){if(!this.hand||!this.bg)return;let i=Math.sin(t)*(e-this.options.tickRadius),s=-Math.cos(t)*(e-this.options.tickRadius),o=Math.sin(t)*e,r=-Math.cos(t)*e;this.hand.setAttribute("x2",i.toString()),this.hand.setAttribute("y2",s.toString()),this.bg.setAttribute("cx",o.toString()),this.bg.setAttribute("cy",r.toString())}formatHours(){this.inputHours.value==""&&this.setHoursDefault(),this.inputHours.value=L._addLeadingZero(this.hours)}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=L._addLeadingZero(this.minutes)}setHoursDefault(){this.hours=new Date().getHours(),this.options.twelveHour&&(this.hours=this.hours%12||12),this.inputHours.value=this.hours.toString()}};L._template=`<div class="timepicker-container">
|
|
30
30
|
<div class="timepicker-digital-display">
|
|
31
31
|
<div class="timepicker-text-container">
|
|
32
32
|
<div class="timepicker-display-column timepicker-display-digital-clock">
|
|
@@ -53,14 +53,10 @@ var Expressive=(()=>{var ut=Object.defineProperty;var Ft=Object.getOwnPropertyDe
|
|
|
53
53
|
</div>
|
|
54
54
|
<div class="timepicker-footer"></div>
|
|
55
55
|
</div>
|
|
56
|
-
</div>`;var it=
|
|
56
|
+
</div>`;var it=L;var ge={text:"",action:"",onAction:null,dismissible:!1,displayLength:4e3,inDuration:300,outDuration:375,classes:"",completeCallback:null,activationPercent:.8,root:null},E=class E{constructor(n={}){this._dismissed=!1;this._returnFocus=null;for(this.options={...E.defaults,...n},n.displayLength===void 0&&this.options.action&&(this.options.displayLength=1/0),n.dismissible===void 0&&this.options.action&&(this.options.dismissible=!0),this.message=this.options.text,this.panning=!1,this.timeRemaining=this.options.displayLength;E._snackbars.length>0;){let s=E._snackbars.shift();s._dismissed=!0,clearTimeout(s.counterTimeout),s._restoreFocus(),s.el.remove()}let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;this._returnFocus=t instanceof HTMLElement?t:null;let e=u.portalRoot(this.options.root??document.body);(!E._container||!E._container.isConnected||E._container.parentNode!==e)&&(E._container&&E._removeContainer(),E._createContainer(e)),E._snackbars.push(this);let i=this._createSnackbar();i.Expressive_Snackbar=this,this.el=i,this._animateIn(),this._setTimer()}static get defaults(){return ge}static getInstance(n){return n.Expressive_Snackbar}static _createContainer(n=document.body){let t=document.createElement("div");t.setAttribute("id","snackbar-container"),t.addEventListener("pointerdown",E._onDragStart),document.addEventListener("pointermove",E._onDragMove),document.addEventListener("pointerup",E._onDragEnd),document.addEventListener("pointercancel",E._onDragCancel),n.appendChild(t),E._container=t}static _removeContainer(){document.removeEventListener("pointermove",E._onDragMove),document.removeEventListener("pointerup",E._onDragEnd),document.removeEventListener("pointercancel",E._onDragCancel),E._container.remove(),E._container=null}static _onDragStart(n){if(!n.isPrimary||n.pointerType==="mouse"&&n.button!==0)return;let t=n.target;if(t&&!t.closest("button, a")&&t.closest(".snackbar")){let i=t.closest(".snackbar").Expressive_Snackbar;if(!i)return;i.panning=!0,i._pauseTimer(),E._draggedSnackbar=i,i.el.classList.add("panning"),i.el.style.transition="",E._dragPointerId=n.pointerId,i.startingXPos=n.clientX,i.time=Date.now(),i.xPos=n.clientX}}static _onDragMove(n){if(E._dragPointerId===n.pointerId&&E._draggedSnackbar){n.preventDefault();let t=E._draggedSnackbar;t.deltaX=Math.abs(t.xPos-n.clientX),t.xPos=n.clientX,t.velocityX=t.deltaX/(Date.now()-t.time),t.time=Date.now();let e=t.xPos-t.startingXPos,i=t.el.offsetWidth*t.options.activationPercent;t.el.style.transform=`translateX(${e}px)`,t.el.style.opacity=(1-Math.abs(e/i)).toString()}}static _onDragEnd(n){if(E._dragPointerId===n.pointerId&&(E._dragPointerId=null,E._draggedSnackbar)){let t=E._draggedSnackbar;t.panning=!1,t.el.classList.remove("panning");let e=t.xPos-t.startingXPos,i=t.el.offsetWidth*t.options.activationPercent;Math.abs(e)>i||t.velocityX>1?(t.wasSwiped=!0,t.dismiss()):(t.el.style.transition="transform .2s, opacity .2s",t.el.style.transform="",t.el.style.opacity="",t._resumeTimer()),E._draggedSnackbar=null}}static _onDragCancel(n){if(E._dragPointerId!==n.pointerId)return;E._dragPointerId=null;let t=E._draggedSnackbar;t&&(t.panning=!1,t.el.classList.remove("panning"),t.el.style.transition="transform .2s, opacity .2s",t.el.style.transform="",t.el.style.opacity="",t._resumeTimer(),E._draggedSnackbar=null)}static dismissAll(){for(let n of[...E._snackbars])n.dismiss()}_createSnackbar(){let n=this.options.snackbarId?u.getElementById(this.options.root??document.body,this.options.snackbarId):document.createElement("div");if(n instanceof HTMLTemplateElement&&(n=n.content.cloneNode(!0).firstElementChild),n.classList.add("snackbar"),n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),n.inert=!1,n.addEventListener("focusin",t=>{t.relatedTarget instanceof HTMLElement&&!n.contains(t.relatedTarget)&&(this._returnFocus=t.relatedTarget),this._pauseTimer()}),n.addEventListener("keydown",t=>{t.key!=="Escape"||t.defaultPrevented||this._dismissed||(t.preventDefault(),t.stopPropagation(),this.dismiss())}),n.addEventListener("focusout",()=>setTimeout(()=>this._resumeTimer(),0)),n.addEventListener("pointerenter",()=>this._pauseTimer()),n.addEventListener("pointerleave",()=>this._resumeTimer()),this.options.classes.length>0&&n.classList.add(...this.options.classes.split(" ").filter(Boolean)),this.message){let t=document.createElement("p");t.textContent=this.message,n.replaceChildren(t)}if(this.options.action){let t=document.createElement("button");t.type="button",t.textContent=this.options.action,t.addEventListener("click",e=>{if(e.stopPropagation(),!this._dismissed)try{typeof this.options.onAction=="function"&&this.options.onAction()}finally{this.dismiss()}}),n.appendChild(t)}if(this.options.dismissible){let t=document.createElement("button");t.type="button",t.className="circle",t.setAttribute("aria-label","Dismiss");let e=document.createElement("i");e.className="material-symbols",e.setAttribute("aria-hidden","true"),e.textContent="close",t.appendChild(e),t.addEventListener("click",i=>{i.stopPropagation(),this.dismiss()}),n.appendChild(t)}return E._container.appendChild(n),n}_animateIn(){this.el.style.display="",this.el.style.opacity="0",this.el.style.transform="translateY(24px)",this.el.style.transition=`
|
|
57
57
|
transform ${this.options.inDuration}ms ease,
|
|
58
58
|
opacity ${this.options.inDuration}ms ease
|
|
59
|
-
`,setTimeout(()=>{this.el.style.transform="",this.el.style.opacity="1"},1)}_setTimer(){this.timeRemaining!==1/0&&(this._deadline=Date.now()+this.timeRemaining,this.counterTimeout=setTimeout(()=>this.dismiss(),this.timeRemaining))}_pauseTimer(){this.counterTimeout!=null&&(clearTimeout(this.counterTimeout),this.counterTimeout=null,this.timeRemaining=Math.max(0,this._deadline-Date.now()))}_resumeTimer(){this.counterTimeout
|
|
59
|
+
`,setTimeout(()=>{this.el.style.transform="",this.el.style.opacity="1"},1)}_setTimer(){this.timeRemaining!==1/0&&(this._deadline=Date.now()+this.timeRemaining,this.counterTimeout=setTimeout(()=>this.dismiss(),this.timeRemaining))}_pauseTimer(){this.counterTimeout!=null&&(clearTimeout(this.counterTimeout),this.counterTimeout=null,this.timeRemaining=Math.max(0,this._deadline-Date.now()))}_resumeTimer(){this._dismissed||this.panning||this.el.matches(":hover, :focus-within")||this.counterTimeout!=null||this._setTimer()}_restoreFocus(){let n=this.el.getRootNode().activeElement;n&&this.el.contains(n)&&this._returnFocus?.isConnected&&this._returnFocus.focus({preventScroll:!0}),this.el.inert=!0}dismiss(){if(this._dismissed)return;this._dismissed=!0,clearTimeout(this.counterTimeout),this.counterTimeout=null,this._restoreFocus();let n=this.el.offsetWidth*this.options.activationPercent;this.wasSwiped&&(this.el.style.transition="transform .05s, opacity .05s",this.el.style.transform=`translateX(${n}px)`,this.el.style.opacity="0"),this.el.style.transition=`
|
|
60
60
|
margin ${this.options.outDuration}ms ease,
|
|
61
|
-
opacity ${this.options.outDuration}ms ease`,setTimeout(()=>{this.el.style.opacity="0",this.el.style.marginTop="-40px"},1),setTimeout(()=>{if(typeof this.options.completeCallback=="function"&&this.options.completeCallback(),this.el.id!=this.options.snackbarId){this.el.remove();let t=
|
|
62
|
-
transform ${t}ms ease-out,
|
|
63
|
-
opacity ${t}ms ease-out`,clearTimeout(this._animationTimeout),this._animationTimeout=setTimeout(()=>{this.tooltipEl.style.transform=`translateX(${this.xMovement}px) translateY(${this.yMovement}px)`,this.tooltipEl.style.opacity=(this.options.opacity||1).toString()},1)}_animateOut(){let t=this.options.outDuration;this.tooltipEl.style.transition=`
|
|
64
|
-
transform ${t}ms ease-out,
|
|
65
|
-
opacity ${t}ms ease-out`,clearTimeout(this._animationTimeout),this._animationTimeout=setTimeout(()=>{this.tooltipEl.style.transform="translateX(0px) translateY(0px)",this.tooltipEl.style.opacity="0"},1)}_getAttributeOptions(){let t={},e=this.el.getAttribute("data-tooltip"),i=this.el.getAttribute("data-tooltip-id"),s=this.el.getAttribute("data-position");return e&&(t.text=e),s&&(t.position=s),i&&(t.tooltipId=i),t}};var wt={AppBar:{component:Y,selector:"header.medium, header.large, header:has(> :is(nav:not(.tabs, .navigation-bar, .navigation-rail), .bar) > :is(.search-bar, .searchbar))"},Autocomplete:{component:B,selector:".autocomplete"},ButtonGroup:{component:G,selector:".button-group"},Cards:{component:P,selector:mt,filter:ft},ExpandingCard:{component:R,selector:gt},Carousel:{component:W,selector:".carousel"},Chips:{component:N,selector:".chips"},Datepicker:{component:Z,selector:".datepicker, .date-picker"},Menu:{component:S,selector:".menu-trigger"},Lightbox:{component:Q,selector:".lightboxed"},ScrollSpy:{component:J,selector:".scrollspy"},FormSelect:{component:D,selector:"select"},NavigationDrawer:{component:q,selector:".sidenav, .navigation-drawer"},NavigationRail:{component:tt,selector:".navigation-rail"},Tabs:{component:et,selector:".tabs"},Timepicker:{component:it,selector:".timepicker, .time-picker"},Tooltip:{component:st,selector:".tooltipped"},FloatingActionButton:{component:X,selector:".fab, .fixed-action-btn, .fab-menu"}};function It(d=document.body,o){for(let t of Object.keys(wt)){let{component:e,selector:i,filter:s}=wt[t],n=d.querySelectorAll(`:is(${i}):not(.no-autoinit)`);s?n.forEach(a=>{s(a)&&e.init(a,o?.[t]??{})}):e.init(n,o?.[t]??{})}}var Le="0.9.1";U.Init();N.Init();F.Init();P.Init();R.Init();$.Init();K.Init();z.Init();return zt(Te);})();
|
|
61
|
+
opacity ${this.options.outDuration}ms ease`,setTimeout(()=>{this.el.style.opacity="0",this.el.style.marginTop="-40px"},1),setTimeout(()=>{if(typeof this.options.completeCallback=="function"&&this.options.completeCallback(),this.el.id!=this.options.snackbarId){this.el.remove();let t=E._snackbars.indexOf(this);t>=0&&E._snackbars.splice(t,1),E._snackbars.length===0&&E._container&&E._container.childElementCount===0&&E._removeContainer()}},this.options.outDuration)}};E._dragPointerId=null,E._snackbars=[],E._container=null,E._draggedSnackbar=null;var lt=E;var Ee={exitDelay:200,enterDelay:0,text:"",margin:4,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10,opacity:1},st=class d extends _{constructor(t,e){super(t,e,d);this.open=t=>{this.isOpen||(t=t===void 0?!0:void 0,clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),this.isOpen=!0,this.options={...this.options,...this._getAttributeOptions()},this._updateTooltipContent(),this._setEnterDelayTimeout(t))};this.close=()=>{this.isOpen&&(this.isHovered=!1,this.isFocused=!1,this.isOpen=!1,clearTimeout(this._enterDelayTimeout),this._setExitDelayTimeout())};this._handleMouseEnter=()=>{this.isHovered=!0,this.open(!1)};this._handleMouseLeave=t=>{let e=t.relatedTarget;e&&(this.el.contains(e)||this.tooltipEl.contains(e))||(this.isHovered=!1,this.isFocused||this.close())};this._handleKeydown=t=>{t.key!=="Escape"||!this.isOpen||(t.preventDefault(),t.stopPropagation(),this.close(),clearTimeout(this._exitDelayTimeout),this._animateOut())};this._handleFocus=t=>{t.target.matches(":focus-visible")&&(this.isFocused=!0,this.open(!1))};this._handleBlur=t=>{let e=t.relatedTarget;e&&(this.el.contains(e)||this.tooltipEl.contains(e))||(this.isFocused=!1,this.isHovered||this.close())};this.el.Expressive_Tooltip=this,this.options={...d.defaults,...this._getAttributeOptions(),...e},this.isOpen=!1,this.isHovered=!1,this.isFocused=!1,this._appendTooltipEl(),this._setupEventHandlers()}static get defaults(){return Ee}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Tooltip}destroy(){clearTimeout(this._enterDelayTimeout),clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),this.isOpen=!1,this.isHovered=!1,this.isFocused=!1,this.el.getAttribute("aria-describedby")===this.tooltipEl.id&&this.el.removeAttribute("aria-describedby"),this.tooltipEl.remove(),this._removeEventHandlers(),this.el.Expressive_Tooltip=void 0}_appendTooltipEl(){this.tooltipEl=document.createElement("div"),this.tooltipEl.classList.add("tooltip"),this.tooltipEl.id=`tooltip-${u.guid()}`,this.tooltipEl.setAttribute("role","tooltip"),this.el.setAttribute("aria-describedby",this.tooltipEl.id);let t=this.options.tooltipId?u.getElementById(this.el,this.options.tooltipId):document.createElement("div");this.options.tooltipId&&this.tooltipEl.classList.add("rich"),t.style.display="",t.classList.add("tooltip-content"),this._setTooltipContent(t),this.tooltipEl.appendChild(t),u.portalRoot(this.el).appendChild(this.tooltipEl)}_setTooltipContent(t){this.options.tooltipId||(t.innerText=this.options.text)}_updateTooltipContent(){this._setTooltipContent(this.tooltipEl.querySelector(".tooltip-content"))}_setupEventHandlers(){for(let t of[this.el,this.tooltipEl])t.addEventListener("mouseenter",this._handleMouseEnter),t.addEventListener("mouseleave",this._handleMouseLeave),t.addEventListener("focus",this._handleFocus,!0),t.addEventListener("blur",this._handleBlur,!0);this.el.ownerDocument.addEventListener("keydown",this._handleKeydown,!0)}_removeEventHandlers(){for(let t of[this.el,this.tooltipEl])t.removeEventListener("mouseenter",this._handleMouseEnter),t.removeEventListener("mouseleave",this._handleMouseLeave),t.removeEventListener("focus",this._handleFocus,!0),t.removeEventListener("blur",this._handleBlur,!0);this.el.ownerDocument.removeEventListener("keydown",this._handleKeydown,!0)}_setExitDelayTimeout(){clearTimeout(this._exitDelayTimeout),this._exitDelayTimeout=setTimeout(()=>{this.isHovered||this.isFocused||this._animateOut()},this.options.exitDelay)}_setEnterDelayTimeout(t){clearTimeout(this._enterDelayTimeout),this._enterDelayTimeout=setTimeout(()=>{!this.isHovered&&!this.isFocused&&!t||this._animateIn()},this.options.enterDelay)}_positionTooltip(){let t=this.tooltipEl,e=this.el,i=e.offsetHeight,s=e.offsetWidth,o=t.offsetHeight,r=t.offsetWidth,c=this.options.margin;this.xMovement=0,this.yMovement=0;let h=e.getBoundingClientRect(),l=h.top+u.getDocumentScrollTop(),a=h.left+u.getDocumentScrollLeft();this.options.position==="top"?(l+=-o-c,a+=s/2-r/2,this.yMovement=-this.options.transitionMovement):this.options.position==="right"?(l+=i/2-o/2,a+=s+c,this.xMovement=this.options.transitionMovement):this.options.position==="left"?(l+=i/2-o/2,a+=-r-c,this.xMovement=-this.options.transitionMovement):(l+=i+c,a+=s/2-r/2,this.yMovement=this.options.transitionMovement);let m=this._repositionWithinScreen(a,l,r,o);t.style.setProperty("--md-comp-tooltip-anchor-gap",`${Math.max(0,c)+Math.abs(this.options.transitionMovement)}px`),t.style.top=m.y+"px",t.style.left=m.x+"px"}_repositionWithinScreen(t,e,i,s){return u._repositionWithinScreen(t,e,i,s,this.options.margin,this.options.transitionMovement,"center")}_animateIn(){this._animate(!0)}_animateOut(){this._animate(!1)}_animate(t){let e=this.tooltipEl.style,i=this.el.ownerDocument.defaultView.matchMedia("(prefers-reduced-motion: reduce)").matches,s=i?0:t?this.options.inDuration:this.options.outDuration;t&&(this._positionTooltip(),e.visibility="visible",e.overflow="visible"),e.transition=`transform ${s}ms ease-out, opacity ${s}ms ease-out`,clearTimeout(this._animationTimeout),this._animationTimeout=setTimeout(()=>{e.transform=t&&!i?`translateX(${this.xMovement}px) translateY(${this.yMovement}px)`:"none",e.opacity=t?(this.options.opacity||1).toString():"0",t||(this._animationTimeout=setTimeout(()=>{e.visibility="hidden",e.overflow=""},s))},1)}_getAttributeOptions(){let t={},e=this.el.getAttribute("data-tooltip"),i=this.el.getAttribute("data-tooltip-id"),s=this.el.getAttribute("data-position");return e&&(t.text=e),s&&(t.position=s),i&&(t.tooltipId=i),t}};var Ct={AppBar:{component:Y,selector:"header.medium, header.large, header:has(> :is(nav:not(.tabs, .navigation-bar, .navigation-rail), .bar) > :is(.search-bar, .searchbar))"},Autocomplete:{component:B,selector:".autocomplete"},ButtonGroup:{component:X,selector:".button-group"},Cards:{component:R,selector:pt,filter:mt},ExpandingCard:{component:P,selector:ft},Carousel:{component:N,selector:".carousel"},Chips:{component:W,selector:".chips"},Datepicker:{component:Z,selector:".datepicker, .date-picker"},Menu:{component:O,selector:".menu-trigger"},Lightbox:{component:Q,selector:".lightboxed"},ScrollSpy:{component:J,selector:".scrollspy"},FormSelect:{component:k,selector:"select"},NavigationRail:{component:tt,selector:".navigation-rail"},Tabs:{component:et,selector:".tabs"},Timepicker:{component:it,selector:".timepicker, .time-picker"},Tooltip:{component:st,selector:".tooltipped"},FloatingActionButton:{component:G,selector:".fab-menu"}};function wt(d=document.body,n){for(let t of Object.keys(Ct)){let{component:e,selector:i,filter:s}=Ct[t],o=d.querySelectorAll(`:is(${i}):not(.no-autoinit)`);s?o.forEach(r=>{s(r)&&e.init(r,n?.[t]??{})}):e.init(o,n?.[t]??{})}}var ye="0.10.0";U.Init();W.Init();V.Init();R.Init();P.Init();$.Init();K.Init();z.Init();return Kt(be);})();
|
|
66
62
|
//# sourceMappingURL=expressive.min.js.map
|