@expressivecss/expressive 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/README.md +1 -1
- package/dist/js/expressive.cjs +55 -8
- package/dist/js/expressive.cjs.map +2 -2
- package/dist/js/expressive.js +55 -8
- package/dist/js/expressive.js.map +2 -2
- package/dist/js/expressive.min.js +9 -9
- package/dist/js/expressive.min.js.map +3 -3
- package/dist/js/expressive.mjs +55 -8
- package/dist/js/expressive.mjs.map +2 -2
- package/dist/types/components/datepicker.d.ts +4 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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,g=t.scrollTop,p=e.left-u,_=e.top-g,y=e.top+r.height-g;return s.spaceOnRight=n?window.innerWidth-(r.left+e.width):l-(p+e.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=n?r.right-e.width:p-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):y-(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(),g=0,p=0,_=u.top+O.getDocumentScrollTop(),y=u.left+O.getDocumentScrollLeft();e==="top"?(_+=-l-i,n==="center"&&(y+=h/2-r/2),p=-s):e==="right"?(_+=a/2-l/2,y=h+i,g=s):e==="left"?(_+=a/2-l/2,y=-r-i,g=-s):(_+=a+i,n==="center"&&(y+=h/2-r/2),p=s),n==="right"&&(y+=h-r-i);let I=O._repositionWithinScreen(y,_,r,l,i,s,n);return t.style.top=I.y+"px",t.style.left=I.x+"px",{x:g,y:p}}static _repositionWithinScreen(o,t,e,i,s,n,a){let h=O.getDocumentScrollLeft(),l=O.getDocumentScrollTop(),r=o-h,u=t-l,g={left:r,top:u,width:e,height:i},p;a==="left"||a=="center"?p=s+n:a==="right"&&(p=s-n);let _=O.checkWithinContainer(document.body,g,p);return _.left?r=p:_.right&&(r-=r+e-window.innerWidth),_.top?u=p:_.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 yt=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",g=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[g]){let p=g==="left"?"right":"left";r[p]?g=p:r.spaceOnLeft>r.spaceOnRight?(g="right",n+=r.spaceOnLeft,a-=r.spaceOnLeft):(g="left",n+=r.spaceOnRight)}return u==="bottom"&&(h=h-i.height+(this.options.coverTrigger?e.height:0)),g==="right"&&(a=a-i.width+e.width),{x:a,y:h,verticalAlignment:u,horizontalAlignment:g,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>=yt?i:Math.min(Gt,Math.max(yt,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 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">
|
|
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 g=document.createElement("span");g.style.paddingLeft="21px",r.append(u,g),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,g=parseFloat(this.el.step);if(g>0&&Number.isFinite(g)){let p=Math.round((r-u)/g)+1;h.style.setProperty("--md-comp-slider-stop-count",String(Math.max(2,p)))}}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 bt=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),g=(o(l)-r.last)/u;d.onRelease?.(Math.abs(r.shift)>te),(r.direction===1?r.shift>bt||g>Lt:r.shift<-bt||g<-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(p=>p.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(p=>p>=0&&p<e.length),u=new Map;if(r.length===1){let p=r[0];u.set(p,Math.min(l,this._compressionCapacity(e[p],s[p])))}else{let p=l/2;for(let y of r)u.set(y,Math.min(p,this._compressionCapacity(e[y],s[y])));let _=l-[...u.values()].reduce((y,I)=>y+I,0);for(let y of r){if(_<=0)break;let I=this._compressionCapacity(e[y],s[y])-u.get(y),H=Math.min(_,I);u.set(y,u.get(y)+H),_-=H}}let g=[...u.values()].reduce((p,_)=>p+_,0);g<=0||(e.forEach((p,_)=>{this._pressedStyles.set(p,{width:p.style.width,baseWidth:s[_].width}),p.style.width=`${s[_].width}px`}),this.el.offsetWidth,e.forEach((p,_)=>{let y=_===i?g:-(u.get(_)||0);p.style.width=`${s[_].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"}},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,g=Math.abs(u-(t?i:e));g<n&&(n=g,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,g=this._vertical?r:l;if(Math.abs(u-g)<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 p=()=>{this._ignoreScroll=!1};this._scroller.addEventListener("scrollend",p,{once:!0}),window.setTimeout(p,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 l=document.createElement("label"),r=document.createElement("input");r.type="checkbox",r.tabIndex=-1;let u=document.createElement("span");u.textContent=s,l.append(r,u),n.appendChild(l)}else n.textContent=s;i.appendChild(n);let a=t.getAttribute("data-icon"),h=t.getAttribute("class")?.split(" ").filter(Boolean);if(a){let l=document.createElement("img");h?.length&&l.classList.add(...h),l.src=a,l.ariaHidden="true",i.prepend(l)}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>`,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=`
|
|
6
6
|
transform ${this.options.duration}ms ease-out,
|
|
7
7
|
opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform=`translateX(${o.x}px) translateY(${o.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},v=class v extends E{constructor(t,e){super(t,e,v);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||!v._compareDates(t,this.endDate)){if(v._isDate(this.date)&&v._comparePastDate(t,this.date))return;this.setDate(t,!1,v._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)),v._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={...v.defaults,...e},e&&e.hasOwnProperty("i18n")&&typeof e.i18n=="object"&&(this.options.i18n={...v.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(v._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;v._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,v)}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){v._isDate(t)&&t.setHours(0,0,0,0)}static _getDaysInMonth(t,e){return[31,v._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):v._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),v._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))),!v._isDate(t))return;let e=this.options.minDate,i=this.options.maxDate;return v._isDate(e)&&t<e?t=e:v._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=v._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let s=v._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(s,"mmm d")}`}}gotoDate(t){let e=!0;if(v._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=v._getDaysInMonth(t,e),a=[],h=new Date(t,e,1).getDay(),l=[];v._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,g=e===0?t-1:t,p=e===11?t+1:t,_=v._getDaysInMonth(g,r),y=n+h,I=y;for(;I>7;)I-=7;y+=7-I;let H=!1;for(let k=0,ht=0;k<y;k++){let C=new Date(t,e,1+(k-h)),Dt=v._compareDates(C,s),kt=this.options.events.indexOf(C.toDateString())!==-1,Et=k<h||k>=n+h,Ot=this.options.startRange&&v._compareDates(this.options.startRange,C),St=this.options.endRange&&v._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&&v._isWeekend(C)||this.options.disableDayFn&&this.options.disableDayFn(C),Pt=this.options.isDateRange&&this.date&&this.endDate&&v._compareDates(this.date,C),Rt=this.options.isDateRange&&this.endDate&&v._compareDates(this.endDate,C),Bt=this.options.isDateRange&&v._isDate(this.endDate)&&v._compareWithinRange(C,this.date,this.endDate),nt=1+(k-h),ct=e,dt=t,ot=!1;v._isDate(this.date)&&(ot=v._compareDates(C,this.date)),!ot&&v._isDate(this.endDate)&&(ot=v._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=g):(nt=nt-n,ct=u,dt=p));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(n=>!!(t.hasOwnProperty(n)&&t[n]===!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[n,a]of Object.entries(e))t.hasOwnProperty(n)&&t[n]&&s.push(a);return`<td data-day="${t.day}" class="${s.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${t.year}" data-month="${t.month}" data-day="${t.day}">${t.day}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+i+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let s=v._escape(this.renderDayName(t,i)),n=v._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>"+t.join("")+"</tbody>"}_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,g,p=[],_='<div id="'+a+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:y,next:I}=this._arrowState(i,s);for(u=0;u<12;u++)p.push('<option value="'+(i===n?u-e:12+u-e)+'"'+(u===s?' selected="selected"':"")+(l&&u<h.minMonth||r&&u>h.maxMonth?'disabled="disabled"':"")+">"+v._escape(h.i18n.months[u])+"</option>");let H='<select class="datepicker-select orig-select-month" tabindex="-1">'+p.join("")+"</select>";for(Array.isArray(h.yearRange)?(u=h.yearRange[0],g=h.yearRange[1]+1):(u=i-h.yearRange,g=1+i+h.yearRange),p=[];u<g&&u<=h.maxYear;u++)u>=h.minYear&&p.push(`<option value="${u}" ${u===i?'selected="selected"':""}>${u}</option>`);h.yearRangeReverse&&p.reverse();let k=`<select class="datepicker-select orig-select-year" tabindex="-1">${p.join("")}</select>`;return _+=`<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>`,_+='<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=v._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}};v._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=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=`
|
|
10
10
|
<div class="datepicker-container">
|
|
11
11
|
<div class="datepicker-date-display">
|
|
12
12
|
<span class="year-text"></span>
|
|
@@ -16,7 +16,7 @@ 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=p;var de={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},Q=class d extends E{constructor(t,e){super(t,e,d);this._handleLightboxClick=()=>{this._handleLightboxToggle()};this._handleLightboxKeypress=t=>{t.key===c.keys.ENTER&&this._handleLightboxToggle()};this._handleLightboxToggle=()=>{this.doneAnimating===!1||this.overlayActive&&this.doneAnimating?this.close():this.open()};this._handleWindowScroll=()=>{this.overlayActive&&this.close()};this._handleWindowResize=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{t.key===c.keys.ESC&&this.doneAnimating&&this.overlayActive&&this.close()};this.open=()=>{this._updateVars();let t=this.el.getBoundingClientRect(),e=this.placeholder.getBoundingClientRect();this.originalWidth=t.width,this.originalHeight=t.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.placeholder.style.width=e.width+"px",this.placeholder.style.height=e.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 i=this.originalWidth/this.windowWidth,s=this.originalHeight/this.windowHeight;if(this.newWidth=0,this.newHeight=0,i>s){let n=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*n}else{let n=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*n,this.newHeight=this.windowHeight*.9}this._animateImageIn(),window.addEventListener("scroll",this._handleWindowScroll,{passive:!0}),window.addEventListener("resize",this._handleWindowResize,{passive:!0}),window.addEventListener("keyup",this._handleWindowEscape)};this.close=()=>{this._updateVars(),this.doneAnimating=!1,typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._removeOverlay(),this._animateImageOut(),this.caption!==""&&this._removeCaption()};this.el.Expressive_Lightbox=this,this.options={...d.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.el.tabIndex=0,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,d)}static getInstance(t){return t.Expressive_Lightbox}destroy(){this._removeEventHandlers(),this.el.Expressive_Lightbox=void 0,this.placeholder.remove(),this.el.removeAttribute("style")}_setupEventHandlers(){this.el.addEventListener("click",this._handleLightboxClick),this.el.addEventListener("keypress",this._handleLightboxKeypress)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleLightboxClick),this.el.removeEventListener("keypress",this._handleLightboxKeypress)}_makeAncestorsOverflowVisible(){this._changedAncestorList=[];let t=this.placeholder.parentNode;for(;t!=null&&t!==document;){let e=t;e.style&&e.style.overflow!=="visible"&&(this._changedAncestorList.push([e,e.style.overflow]),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.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",setTimeout(()=>{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
|
|
@@ -24,9 +24,9 @@ var Expressive=(()=>{var ut=Object.defineProperty;var Ft=Object.getOwnPropertyDe
|
|
|
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},f=class f extends E{constructor(o,t){super(o,t,f),this.el.Expressive_ScrollSpy=this,this.options={...f.defaults,...t},this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),f._elements.push(this),f._ensureObserver(this.options.scrollOffset),f._observer?.observe(this.el)}static get defaults(){return ue}static init(o,t={}){return super.init(o,t,f)}static getInstance(o){return o.Expressive_ScrollSpy}destroy(){let o=f._elements.indexOf(this);o>=0&&f._elements.splice(o,1),f._ratios.delete(this.el),f._observer?.unobserve(this.el);let t=f._linkFor(this.el.id,this.options);t&&t===f._active?f._clearActive(this.options):(t?.classList.remove(this.options.activeClass),t?.removeAttribute("aria-current")),f._elements.length===0?(f._observer?.disconnect(),f._observer=null,f._ratios.clear(),f._active=null):f._syncActive(),this.el.Expressive_ScrollSpy=void 0}static _ensureObserver(o){f._observer||typeof IntersectionObserver>"u"||(f._observer=new IntersectionObserver(f._onIntersect,{rootMargin:`-${o}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}))}static _syncActive(){if(!f._elements.length)return;let o=f._elements[0].options,t=null,e=0;for(let s of f._elements){let n=f._ratios.get(s.el)??0;n>e&&(e=n,t=s)}if(!t)if(o.keepTopElementActive)t=f._nearestAbove()??f._elements[0];else{f._clearActive(o);return}let i=f._linkFor(t.el.id,t.options);i!==f._active&&(f._clearActive(o),i&&(i.classList.add(t.options.activeClass),i.setAttribute("aria-current","true"),f._active=i))}static _nearestAbove(){let o=null,t=-1/0;for(let e of f._elements){let i=e.el.getBoundingClientRect().top;i<=0&&i>=t&&(t=i,o=e)}return o}static _clearActive(o){f._active&&(f._active.classList.remove(o.activeClass),f._active.removeAttribute("aria-current"),f._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}};f._elements=[],f._observer=null,f._ratios=new Map,f._active=null,f._onIntersect=o=>{for(let t of o)t.isIntersecting&&t.intersectionRatio>0?f._ratios.set(t.target,t.intersectionRatio):f._ratios.delete(t.target);f._syncActive()};var J=f;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",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=`
|
|
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},b=class b extends E{constructor(t,e){super(t,e,b);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?"":b._addLeadingZero(this.hours)+":"+b._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={...b.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,b)}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=b._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=b._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let n=b._createSVGEl("g");n.setAttribute("transform","translate("+t+","+t+")");let a=b._createSVGEl("circle");a.setAttribute("class","timepicker-canvas-bearing"),a.setAttribute("cx","0"),a.setAttribute("cy","0"),a.setAttribute("r","4");let h=b._createSVGEl("line");h.setAttribute("x1","0"),h.setAttribute("y1","0");let l=b._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=b._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=b._addLeadingZero(this.hours),this.inputMinutes.value=b._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=b._addLeadingZero(u):this.inputMinutes.value=b._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=b._addLeadingZero(Number(this.inputHours.value))}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=b._addLeadingZero(Number(this.inputMinutes.value))}setHoursDefault(){this.hours=new Date().getHours(),this.inputHours.value=(this.hours%(this.options.twelveHour?12:24)).toString()}};b._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 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">
|
|
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,14 @@ 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=y;var _e={text:"",action:"",onAction:null,dismissible:!1,displayLength:4e3,inDuration:300,outDuration:375,classes:"",completeCallback:null,activationPercent:.8,root:null},f=class f{constructor(o={}){this._dismissed=!1;if(this.options={...f.defaults,...o},o.displayLength===void 0&&this.options.action&&(this.options.displayLength=1e4),this.message=this.options.text,this.panning=!1,this.timeRemaining=this.options.displayLength,f._snackbars.length>0){for(let i of[...f._snackbars])i._dismissed=!0,clearTimeout(i.counterTimeout),i.el.remove();f._snackbars.length=0}let t=c.portalRoot(this.options.root??document.body);(!f._container||!f._container.isConnected||f._container.parentNode!==t)&&(f._container&&f._removeContainer(),f._createContainer(t)),f._snackbars.push(this);let e=this._createSnackbar();e.Expressive_Snackbar=this,this.el=e,this._animateIn(),this._setTimer()}static get defaults(){return _e}static getInstance(o){return o.Expressive_Snackbar}static _createContainer(o=document.body){let t=document.createElement("div");t.setAttribute("id","snackbar-container"),t.addEventListener("pointerdown",f._onDragStart),document.addEventListener("pointermove",f._onDragMove),document.addEventListener("pointerup",f._onDragEnd),document.addEventListener("pointercancel",f._onDragCancel),o.appendChild(t),f._container=t}static _removeContainer(){document.removeEventListener("pointermove",f._onDragMove),document.removeEventListener("pointerup",f._onDragEnd),document.removeEventListener("pointercancel",f._onDragCancel),f._container.remove(),f._container=null}static _onDragStart(o){if(!o.isPrimary||o.pointerType==="mouse"&&o.button!==0)return;let t=o.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(),f._draggedSnackbar=i,i.el.classList.add("panning"),i.el.style.transition="",f._dragPointerId=o.pointerId,i.startingXPos=o.clientX,i.time=Date.now(),i.xPos=o.clientX}}static _onDragMove(o){if(f._dragPointerId===o.pointerId&&f._draggedSnackbar){o.preventDefault();let t=f._draggedSnackbar;t.deltaX=Math.abs(t.xPos-o.clientX),t.xPos=o.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(o){if(f._dragPointerId===o.pointerId&&(f._dragPointerId=null,f._draggedSnackbar)){let t=f._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()),f._draggedSnackbar=null}}static _onDragCancel(o){if(f._dragPointerId!==o.pointerId)return;f._dragPointerId=null;let t=f._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(),f._draggedSnackbar=null)}static dismissAll(){for(let o of[...f._snackbars])o.dismiss()}_createSnackbar(){let o=this.options.snackbarId?c.getElementById(this.options.root??document.body,this.options.snackbarId):document.createElement("div");if(o instanceof HTMLTemplateElement&&(o=o.content.cloneNode(!0).firstElementChild),o.classList.add("snackbar"),o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true"),this.options.classes.length>0&&o.classList.add(...this.options.classes.split(" ").filter(Boolean)),this.message){let t=document.createElement("p");t.textContent=this.message,o.replaceChildren(t)}if(this.options.action){let t=document.createElement("button");t.type="button",t.textContent=this.options.action,t.addEventListener("click",e=>{e.stopPropagation(),typeof this.options.onAction=="function"&&this.options.onAction(),this.dismiss()}),o.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()}),o.appendChild(t)}return f._container.appendChild(o),o}_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
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==null&&this._setTimer()}dismiss(){if(this._dismissed)return;this._dismissed=!0,clearTimeout(this.counterTimeout),this.counterTimeout=null;let o=this.el.offsetWidth*this.options.activationPercent;this.wasSwiped&&(this.el.style.transition="transform .05s, opacity .05s",this.el.style.transform=`translateX(${o}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=
|
|
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=f._snackbars.indexOf(this);t>=0&&f._snackbars.splice(t,1),f._snackbars.length===0&&f._container&&f._container.childElementCount===0&&f._removeContainer()}},this.options.outDuration)}};f._dragPointerId=null,f._snackbars=[],f._container=null,f._draggedSnackbar=null;var lt=f;var be={exitDelay:200,enterDelay:0,text:"",margin:4,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10,opacity:1},st=class d extends E{constructor(t,e){super(t,e,d);this.open=t=>{this.isOpen||(t=t===void 0?!0:void 0,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,this._setExitDelayTimeout())};this._handleMouseEnter=()=>{this.isHovered=!0,this.isFocused=!1,this.open(!1)};this._handleMouseLeave=()=>{this.isHovered=!1,this.isFocused=!1,this.close()};this._handleFocus=()=>{this.el.matches(":focus-visible")&&(this.isFocused=!0,this.open(!1))};this._handleBlur=()=>{this.isFocused=!1,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 be}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-${c.guid()}`,this.tooltipEl.setAttribute("role","tooltip"),this.el.setAttribute("aria-describedby",this.tooltipEl.id);let t=this.options.tooltipId?c.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),c.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(){this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.el.addEventListener("focus",this._handleFocus,!0),this.el.addEventListener("blur",this._handleBlur,!0)}_removeEventHandlers(){this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.el.removeEventListener("focus",this._handleFocus,!0),this.el.removeEventListener("blur",this._handleBlur,!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,n=t.offsetHeight,a=t.offsetWidth,h=this.options.margin;this.xMovement=0,this.yMovement=0;let l=e.getBoundingClientRect(),r=l.top+c.getDocumentScrollTop(),u=l.left+c.getDocumentScrollLeft();this.options.position==="top"?(r+=-n-h,u+=s/2-a/2,this.yMovement=-this.options.transitionMovement):this.options.position==="right"?(r+=i/2-n/2,u+=s+h,this.xMovement=this.options.transitionMovement):this.options.position==="left"?(r+=i/2-n/2,u+=-a-h,this.xMovement=-this.options.transitionMovement):(r+=i+h,u+=s/2-a/2,this.yMovement=this.options.transitionMovement);let v=this._repositionWithinScreen(u,r,a,n);t.style.top=v.y+"px",t.style.left=v.x+"px"}_repositionWithinScreen(t,e,i,s){return c._repositionWithinScreen(t,e,i,s,this.options.margin,this.options.transitionMovement,"center")}_animateIn(){this._positionTooltip(),this.tooltipEl.style.visibility="visible";let t=this.options.inDuration;this.tooltipEl.style.transition=`
|
|
62
62
|
transform ${t}ms ease-out,
|
|
63
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
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.
|
|
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);})();
|
|
66
66
|
//# sourceMappingURL=expressive.min.js.map
|