@tabworthy/components 0.14.3 → 0.15.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.
Files changed (31) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tabworthy-components.cjs.js +1 -1
  3. package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +2 -2
  4. package/dist/cjs/tabworthy-times-picker.cjs.entry.js +29 -8
  5. package/dist/cjs/tabworthy-times.cjs.entry.js +26 -4
  6. package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.js +2 -2
  7. package/dist/collection/components/tabworthy-times/tabworthy-times.js +46 -4
  8. package/dist/collection/components/tabworthy-times-picker/tabworthy-times-picker.js +49 -8
  9. package/dist/components/p-BvcvP308.js +1 -0
  10. package/dist/components/{p-CMIEIvTW.js → p-DXCumu2Y.js} +1 -1
  11. package/dist/components/tabworthy-dates-modal.js +1 -1
  12. package/dist/components/tabworthy-dates.js +1 -1
  13. package/dist/components/tabworthy-times-picker.js +1 -1
  14. package/dist/components/tabworthy-times.js +1 -1
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/tabworthy-components.js +1 -1
  17. package/dist/esm/tabworthy-dates-calendar_2.entry.js +2 -2
  18. package/dist/esm/tabworthy-times-picker.entry.js +29 -8
  19. package/dist/esm/tabworthy-times.entry.js +26 -4
  20. package/dist/tabworthy-components/p-3e890a9c.entry.js +1 -0
  21. package/dist/tabworthy-components/p-5b21364f.entry.js +1 -0
  22. package/dist/tabworthy-components/{p-f65438fb.entry.js → p-66c929f1.entry.js} +1 -1
  23. package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
  24. package/dist/themes/light.css +1 -1
  25. package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +3 -0
  26. package/dist/types/components/tabworthy-times-picker/tabworthy-times-picker.d.ts +6 -0
  27. package/dist/types/components.d.ts +18 -0
  28. package/package.json +1 -1
  29. package/dist/components/p-C_uZGgcG.js +0 -1
  30. package/dist/tabworthy-components/p-3af91c7f.entry.js +0 -1
  31. package/dist/tabworthy-components/p-69334c34.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{p as t,H as s,c as i,h as e,d as h,t as n}from"./p-BiJ0HZVY.js";const a={hours:"Hours",minutes:"Minutes",seconds:"Seconds",am:"AM",pm:"PM",timePicker:"Time picker",incrementHours:"Increment hours",decrementHours:"Decrement hours",incrementMinutes:"Increment minutes",decrementMinutes:"Decrement minutes",incrementSeconds:"Increment seconds",decrementSeconds:"Decrement seconds"},o=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.timeChanged=i(this,"timeChanged",7),this.hours=12,this.minutes=0,this.seconds=0,this.useTwelveHourFormat=!1,this.showSeconds=!1,this.labels=a,this.labelsSrOnly=!0,this.disabled=!1,this.elementClassName="tabworthy-times-picker",this.modalIsOpen=!1,this.internalHours=this.hours,this.internalMinutes=this.minutes,this.internalSeconds=this.seconds,this.period=this.hours>=12?"PM":"AM",this.handleHourChange=t=>{const s=parseInt(t.target.value,10);isNaN(s)||(this.internalHours=this.useTwelveHourFormat?"AM"===this.period?12===s?0:s:12===s?12:s+12:s,this.emitTimeChange())},this.handleMinuteChange=t=>{const s=parseInt(t.target.value,10);isNaN(s)||(this.internalMinutes=s,this.emitTimeChange())},this.handlePeriodChange=t=>{if(this.period===t||!this.useTwelveHourFormat)return;this.period=t;const s=this.getDisplayHours();this.internalHours="AM"===t?12===s?0:s:12===s?12:s+12,this.emitTimeChange()},this.handleHourIncrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),s=12===t?1:t+1;this.internalHours="AM"===this.period?12===s?0:s:12===s?12:s+12}else this.internalHours=(this.internalHours+1)%24;this.emitTimeChange()},this.handleHourDecrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),s=1===t?12:t-1;this.internalHours="AM"===this.period?12===s?0:s:12===s?12:s+12}else this.internalHours=0===this.internalHours?23:this.internalHours-1;this.emitTimeChange()},this.handleMinuteIncrement=()=>{this.internalMinutes=(this.internalMinutes+1)%60,this.emitTimeChange()},this.handleMinuteDecrement=()=>{this.internalMinutes=0===this.internalMinutes?59:this.internalMinutes-1,this.emitTimeChange()},this.handleSecondChange=t=>{const s=parseInt(t.target.value,10);isNaN(s)||(this.internalSeconds=s,this.emitTimeChange())},this.handleSecondIncrement=()=>{this.internalSeconds=(this.internalSeconds+1)%60,this.emitTimeChange()},this.handleSecondDecrement=()=>{this.internalSeconds=0===this.internalSeconds?59:this.internalSeconds-1,this.emitTimeChange()}}watchModalIsOpen(){!0===this.modalIsOpen&&(this.moveFocusOnModalOpen=!0)}watchHours(t){this.internalHours=t,this.period=t>=12?"PM":"AM"}watchMinutes(t){this.internalMinutes=t}watchSeconds(t){this.internalSeconds=t}componentWillLoad(){this.internalHours=this.hours,this.internalMinutes=this.minutes,this.internalSeconds=this.seconds,this.period=this.hours>=12?"PM":"AM"}componentDidRender(){this.moveFocusOnModalOpen&&setTimeout((()=>{this.focusHoursInput(),this.moveFocusOnModalOpen=!1}),100)}focusHoursInput(){var t;null===(t=this.hoursInputRef)||void 0===t||t.focus()}getDisplayHours(){return this.useTwelveHourFormat?0===this.internalHours?12:this.internalHours>12?this.internalHours-12:this.internalHours:this.internalHours}get24HourValue(){if(!this.useTwelveHourFormat)return this.internalHours;const t=this.getDisplayHours();return"AM"===this.period?12===t?0:t:12===t?12:t+12}emitTimeChange(){this.clampToBounds(),this.timeChanged.emit({hours:this.get24HourValue(),minutes:this.internalMinutes,seconds:this.showSeconds?this.internalSeconds:void 0,period:this.useTwelveHourFormat?this.period:void 0})}clampToBounds(){var t,s;const i=this.get24HourValue(),e=this.internalMinutes;if(this.minTime){const s=null!==(t=this.minTime.seconds)&&void 0!==t?t:0;(i<this.minTime.hours||i===this.minTime.hours&&e<this.minTime.minutes||i===this.minTime.hours&&e===this.minTime.minutes&&this.internalSeconds<s)&&(this.setInternal24Hours(this.minTime.hours),this.internalMinutes=this.minTime.minutes,this.internalSeconds=s)}if(this.maxTime){const t=null!==(s=this.maxTime.seconds)&&void 0!==s?s:59,i=this.get24HourValue(),e=this.internalMinutes;(i>this.maxTime.hours||i===this.maxTime.hours&&e>this.maxTime.minutes||i===this.maxTime.hours&&e===this.maxTime.minutes&&this.internalSeconds>t)&&(this.setInternal24Hours(this.maxTime.hours),this.internalMinutes=this.maxTime.minutes,this.internalSeconds=t)}}setInternal24Hours(t){this.internalHours=t,this.period=t>=12?"PM":"AM"}isAtMinHour(){return!!this.minTime&&this.get24HourValue()<=this.minTime.hours}isAtMaxHour(){return!!this.maxTime&&this.get24HourValue()>=this.maxTime.hours}isAtMinMinute(){return this.isAtMinHour()&&!!this.minTime&&this.internalMinutes<=this.minTime.minutes}isAtMaxMinute(){return this.isAtMaxHour()&&!!this.maxTime&&this.internalMinutes>=this.maxTime.minutes}isAtMinSecond(){var t;return this.isAtMinMinute()&&!!this.minTime&&this.internalSeconds<=(null!==(t=this.minTime.seconds)&&void 0!==t?t:0)}isAtMaxSecond(){var t;return this.isAtMaxMinute()&&!!this.maxTime&&this.internalSeconds>=(null!==(t=this.maxTime.seconds)&&void 0!==t?t:59)}padZero(t){return t.toString().padStart(2,"0")}render(){const t=this.getDisplayHours(),s=this.useTwelveHourFormat?12:23,i=this.useTwelveHourFormat?1:0;return e(h,{key:"c307a1b94d1ec25702c286c7f36e4746df8c6bb7",class:this.elementClassName,"aria-label":this.labels.timePicker},e("div",{key:"c446911a0ddcb6282ab5507d359d56a42f533db3",class:`${this.elementClassName}__container`},e("div",{key:"302c7e7e0c1bf71629ef2a71bb564f9571aad7be",class:`${this.elementClassName}__field`},e("label",{key:"8ce64af4f416c3cdc0dd8943fc02ab9016d62099",htmlFor:`${this.elementClassName}-hours`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.hours),e("div",{key:"3f541e096c7bb3f436f358800588d5da7fccb34e",class:`${this.elementClassName}__control`},e("button",{key:"31039ad972122c2a6f963190d38f379bb7dce71f",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleHourIncrement,disabled:this.disabled||this.isAtMaxHour(),"aria-label":this.labels.incrementHours},e("svg",{key:"4b16f261f4fecc91973d858b6235fc8aac4f7605",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"fe60640cfa75911b862913a3076cbeea037a38f7",points:"18 15 12 9 6 15"}))),e("input",{key:"a3a7eed2efc8b1789de698771e82e3f31f50e885",id:`${this.elementClassName}-hours`,ref:t=>this.hoursInputRef=t,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(t),min:i,max:s,onInput:this.handleHourChange,disabled:this.disabled,"aria-label":this.labels.hours}),e("button",{key:"421b70976c21b2b33e21962780d13609a6b762a5",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleHourDecrement,disabled:this.disabled||this.isAtMinHour(),"aria-label":this.labels.decrementHours},e("svg",{key:"ab87c0de149d43edcbebd1b2d4d00e4a3ebed5b3",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"32f2d112c44434249d506d1e8222e25b34fb0d44",points:"6 9 12 15 18 9"}))))),e("div",{key:"54449a42e67f6f3c2318310bc12eeba24cebc56f",class:`${this.elementClassName}__separator`},":"),e("div",{key:"f65d84751223424c3649d0fb9589cf3c1af091eb",class:`${this.elementClassName}__field`},e("label",{key:"911244fd360371ee26b97eb9690c7b04340d6e88",htmlFor:`${this.elementClassName}-minutes`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.minutes),e("div",{key:"e5574834dd59e9c08dcee56b07bf8bf186f7ba4b",class:`${this.elementClassName}__control`},e("button",{key:"2b091d643aa785b8ddeae55dd8c523cd5282719d",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleMinuteIncrement,disabled:this.disabled||this.isAtMaxMinute(),"aria-label":this.labels.incrementMinutes},e("svg",{key:"23668a0f1299f86901d0e32e9f7f37bacd376665",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"7f030c2d35147651ad86352c65dc6f8f00b2ba93",points:"18 15 12 9 6 15"}))),e("input",{key:"b73ed30b3a7d25ef84bab23afa45172ce5d03944",id:`${this.elementClassName}-minutes`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(this.internalMinutes),min:0,max:59,onInput:this.handleMinuteChange,disabled:this.disabled,"aria-label":this.labels.minutes}),e("button",{key:"7ce7a36ef59e44afd474c427250adc352a8a6694",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleMinuteDecrement,disabled:this.disabled||this.isAtMinMinute(),"aria-label":this.labels.decrementMinutes},e("svg",{key:"49bcd0c73fde1f77c0d42978a76086abb5be6cc4",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"c503c319467e0aac6883db25b7d84a1d752aeaf9",points:"6 9 12 15 18 9"}))))),this.showSeconds&&[e("div",{key:"be25b2045f9e74b0414e55f8d508f7c192e1772e",class:`${this.elementClassName}__separator`},":"),e("div",{key:"85ceb01427ea52c231f1b6a3d78c95c6d603215c",class:`${this.elementClassName}__field`},e("label",{key:"1a1adf9081b3e763e4fbc45b8bab812ae869edbb",htmlFor:`${this.elementClassName}-seconds`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.seconds),e("div",{key:"abce976c9d3143819c41ff64b54dfbcea41ddd88",class:`${this.elementClassName}__control`},e("button",{key:"1416ee09b69a6d62d8ecd1394bb375fc01601e4a",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleSecondIncrement,disabled:this.disabled||this.isAtMaxSecond(),"aria-label":this.labels.incrementSeconds},e("svg",{key:"1ab4adae2efa4a54286605be221cf2d424e98deb",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"61ef61c721a39732a3aacdc9db5b63950796706b",points:"18 15 12 9 6 15"}))),e("input",{key:"d5b40cf419b007e28f7f69ffe333601fcc3c701e",id:`${this.elementClassName}-seconds`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(this.internalSeconds),min:0,max:59,onInput:this.handleSecondChange,disabled:this.disabled,"aria-label":this.labels.seconds}),e("button",{key:"177306df5ba004bbd58df462a7d010f8903656eb",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleSecondDecrement,disabled:this.disabled||this.isAtMinSecond(),"aria-label":this.labels.decrementSeconds},e("svg",{key:"971169fce6fee5ccb8241faef04d633a0396e347",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},e("polyline",{key:"4c31a4b794cc6b421e8e2b3cdb322d584fe40e81",points:"6 9 12 15 18 9"})))))],this.useTwelveHourFormat&&e("div",{key:"b6e9916c6d14aaac6aa3ee1f1c3bd2624f01a344",class:`${this.elementClassName}__period`},e("button",{key:"c476a13007f840b5f9e5f058623b1846b33b72cf",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"AM"===this.period},onClick:()=>this.handlePeriodChange("AM"),disabled:this.disabled,"aria-label":this.labels.am,"aria-pressed":"AM"===this.period},this.labels.am),e("button",{key:"f4cc8df59e07cb53e9b72f376a17e10df357a335",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"PM"===this.period},onClick:()=>this.handlePeriodChange("PM"),disabled:this.disabled,"aria-label":this.labels.pm,"aria-pressed":"PM"===this.period},this.labels.pm))))}get el(){return this}static get watchers(){return{modalIsOpen:[{watchModalIsOpen:0}],hours:[{watchHours:0}],minutes:[{watchMinutes:0}],seconds:[{watchSeconds:0}]}}},[2,"tabworthy-times-picker",{hours:[1026],minutes:[1026],seconds:[1026],useTwelveHourFormat:[4,"use-twelve-hour-format"],showSeconds:[4,"show-seconds"],labels:[16],labelsSrOnly:[4,"labels-sr-only"],disabled:[4],elementClassName:[1,"element-class-name"],minTime:[16],maxTime:[16],modalIsOpen:[4,"modal-is-open"],internalHours:[32],internalMinutes:[32],internalSeconds:[32],period:[32]},void 0,{modalIsOpen:[{watchModalIsOpen:0}],hours:[{watchHours:0}],minutes:[{watchMinutes:0}],seconds:[{watchSeconds:0}]}]);function c(){"undefined"!=typeof customElements&&["tabworthy-times-picker"].forEach((t=>{"tabworthy-times-picker"===t&&(customElements.get(n(t))||customElements.define(n(t),o))}))}export{o as T,c as d}
@@ -1 +1 @@
1
- import{p as t,H as n,c as e,h as i,d as r,t as o}from"./p-BiJ0HZVY.js";function a(t,n,e,i=20,r=0){let o=[];if(r>=i)return o;const s=t=>{const o=t.assignedNodes().filter((t=>1===t.nodeType));return o.length>0?a(o[0].parentElement,n,e,i,r+1):[]},u=Array.from(t.children||[]);for(const t of u)n(t)||(e(t)&&o.push(t),null!=t.shadowRoot?o.push(...a(t.shadowRoot,n,e,i,r+1)):"SLOT"===t.tagName?o.push(...s(t)):o.push(...a(t,n,e,i,r+1)));return o}function s(t){return t.hasAttribute("hidden")||t.hasAttribute("aria-hidden")&&"false"!==t.getAttribute("aria-hidden")||"none"===t.style.display||"0"===t.style.opacity||"hidden"===t.style.visibility||"collapse"===t.style.visibility}function u(t){return"-1"!==t.getAttribute("tabindex")&&!s(t)&&!function(t){return t.hasAttribute("disabled")||t.hasAttribute("aria-disabled")&&"false"!==t.getAttribute("aria-disabled")}(t)&&(t.hasAttribute("tabindex")||(t instanceof HTMLAnchorElement||t instanceof HTMLAreaElement)&&t.hasAttribute("href")||t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLIFrameElement)}const c=new Map,f=document.createElement("template");f.innerHTML='\n\t<div id="start"></div>\n\t<div id="backup"></div>\n\t<slot></slot>\n\t<div id="end"></div>\n';class d extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const t=this.attachShadow({mode:"open"});t.appendChild(f.content.cloneNode(!0)),this.$backup=t.querySelector("#backup"),this.$start=t.querySelector("#start"),this.$end=t.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(t){t?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return a(this,s,u)}trapFocus(t){if(this.inactive)return;let n=this.getFocusableElements();n.length>0?(t?n[n.length-1].focus():n[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(t){!function(t,n,e){const i=c.get(e);null!=i&&window.clearTimeout(i),c.set(e,window.setTimeout((()=>{t(),c.delete(e)}),0))}((()=>{this.focused!==t&&(this._focused=t,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}window.customElements.define("focus-trap",d);var h=new WeakMap,l=new WeakMap,p={},v=0,b=function(t){return t&&(t.host||b(t.parentNode))},m=function(t,n,e){void 0===e&&(e="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=function(t){return"undefined"==typeof document?null:(Array.isArray(t)?t[0]:t).ownerDocument.body}(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live]"))),function(t,n,e,i){var r=function(t,n){return n.map((function(n){if(t.contains(n))return n;var e=b(n);return e&&t.contains(e)?e:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)})).filter((function(t){return Boolean(t)}))}(n,Array.isArray(t)?t:[t]);p[e]||(p[e]=new WeakMap);var o=p[e],a=[],s=new Set,u=new Set(r),c=function(t){t&&!s.has(t)&&(s.add(t),c(t.parentNode))};r.forEach(c);var f=function(t){t&&!u.has(t)&&Array.prototype.forEach.call(t.children,(function(t){if(s.has(t))f(t);else{var n=t.getAttribute(i),r=null!==n&&"false"!==n,u=(h.get(t)||0)+1,c=(o.get(t)||0)+1;h.set(t,u),o.set(t,c),a.push(t),1===u&&r&&l.set(t,!0),1===c&&t.setAttribute(e,"true"),r||t.setAttribute(i,"true")}}))};return f(n),s.clear(),v++,function(){a.forEach((function(t){var n=h.get(t)-1,r=o.get(t)-1;h.set(t,n),o.set(t,r),n||(l.has(t)||t.removeAttribute(i),l.delete(t)),r||t.removeAttribute(e)})),--v||(h=new WeakMap,h=new WeakMap,l=new WeakMap,p={})}}(i,r,e,"aria-hidden")):function(){return null}},y="top",w="bottom",g="right",x="left",O="auto",j=[y,w,g,x],k="start",M="end",E="viewport",A="popper",T=j.reduce((function(t,n){return t.concat([n+"-"+k,n+"-"+M])}),[]),S=[].concat(j,[O]).reduce((function(t,n){return t.concat([n,n+"-"+k,n+"-"+M])}),[]),L=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function P(t){return t?(t.nodeName||"").toLowerCase():null}function H(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function W(t){return t instanceof H(t).Element||t instanceof Element}function B(t){return t instanceof H(t).HTMLElement||t instanceof HTMLElement}function F(t){return"undefined"!=typeof ShadowRoot&&(t instanceof H(t).ShadowRoot||t instanceof ShadowRoot)}function q(t){return t.split("-")[0]}var C=Math.max,I=Math.min,R=Math.round;function z(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function D(){return!/^((?!chrome|android).)*safari/i.test(z())}function V(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var i=t.getBoundingClientRect(),r=1,o=1;n&&B(t)&&(r=t.offsetWidth>0&&R(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&R(i.height)/t.offsetHeight||1);var a=(W(t)?H(t):window).visualViewport,s=!D()&&e,u=(i.left+(s&&a?a.offsetLeft:0))/r,c=(i.top+(s&&a?a.offsetTop:0))/o,f=i.width/r,d=i.height/o;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function J(t){var n=V(t),e=t.offsetWidth,i=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-i)<=1&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:i}}function K(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&F(e)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function U(t){return H(t).getComputedStyle(t)}function Y(t){return["table","td","th"].indexOf(P(t))>=0}function Z(t){return((W(t)?t.ownerDocument:t.document)||window.document).documentElement}function _(t){return"html"===P(t)?t:t.assignedSlot||t.parentNode||(F(t)?t.host:null)||Z(t)}function G(t){return B(t)&&"fixed"!==U(t).position?t.offsetParent:null}function N(t){for(var n=H(t),e=G(t);e&&Y(e)&&"static"===U(e).position;)e=G(e);return e&&("html"===P(e)||"body"===P(e)&&"static"===U(e).position)?n:e||function(t){var n=/firefox/i.test(z());if(/Trident/i.test(z())&&B(t)&&"fixed"===U(t).position)return null;var e=_(t);for(F(e)&&(e=e.host);B(e)&&["html","body"].indexOf(P(e))<0;){var i=U(e);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return e;e=e.parentNode}return null}(t)||n}function Q(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function X(t,n,e){return C(t,I(n,e))}function $(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function tt(t,n){return n.reduce((function(n,e){return n[e]=t,n}),{})}function nt(t){return t.split("-")[1]}var et={top:"auto",right:"auto",bottom:"auto",left:"auto"};function it(t){var n,e=t.popper,i=t.popperRect,r=t.placement,o=t.variation,a=t.offsets,s=t.position,u=t.gpuAcceleration,c=t.adaptive,f=t.roundOffsets,d=t.isFixed,h=a.x,l=void 0===h?0:h,p=a.y,v=void 0===p?0:p,b="function"==typeof f?f({x:l,y:v}):{x:l,y:v};l=b.x,v=b.y;var m=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),j=x,k=y,E=window;if(c){var A=N(e),T="clientHeight",S="clientWidth";A===H(e)&&"static"!==U(A=Z(e)).position&&"absolute"===s&&(T="scrollHeight",S="scrollWidth"),(r===y||(r===x||r===g)&&o===M)&&(k=w,v-=(d&&A===E&&E.visualViewport?E.visualViewport.height:A[T])-i.height,v*=u?1:-1),r!==x&&(r!==y&&r!==w||o!==M)||(j=g,l-=(d&&A===E&&E.visualViewport?E.visualViewport.width:A[S])-i.width,l*=u?1:-1)}var L,P=Object.assign({position:s},c&&et),W=!0===f?function(t,n){var e=t.y,i=n.devicePixelRatio||1;return{x:R(t.x*i)/i||0,y:R(e*i)/i||0}}({x:l,y:v},H(e)):{x:l,y:v};return l=W.x,v=W.y,Object.assign({},P,u?((L={})[k]=O?"0":"",L[j]=m?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+l+"px, "+v+"px)":"translate3d("+l+"px, "+v+"px, 0)",L):((n={})[k]=O?v+"px":"",n[j]=m?l+"px":"",n.transform="",n))}var rt={passive:!0},ot={left:"right",right:"left",bottom:"top",top:"bottom"};function at(t){return t.replace(/left|right|bottom|top/g,(function(t){return ot[t]}))}var st={start:"end",end:"start"};function ut(t){return t.replace(/start|end/g,(function(t){return st[t]}))}function ct(t){var n=H(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function ft(t){return V(Z(t)).left+ct(t).scrollLeft}function dt(t){var n=U(t);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function ht(t){return["html","body","#document"].indexOf(P(t))>=0?t.ownerDocument.body:B(t)&&dt(t)?t:ht(_(t))}function lt(t,n){var e;void 0===n&&(n=[]);var i=ht(t),r=i===(null==(e=t.ownerDocument)?void 0:e.body),o=H(i),a=r?[o].concat(o.visualViewport||[],dt(i)?i:[]):i,s=n.concat(a);return r?s:s.concat(lt(_(a)))}function pt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vt(t,n,e){return n===E?pt(function(t,n){var e=H(t),i=Z(t),r=e.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,u=0;if(r){o=r.width,a=r.height;var c=D();(c||!c&&"fixed"===n)&&(s=r.offsetLeft,u=r.offsetTop)}return{width:o,height:a,x:s+ft(t),y:u}}(t,e)):W(n)?function(t,n){var e=V(t,!1,"fixed"===n);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(n,e):pt(function(t){var n,e=Z(t),i=ct(t),r=null==(n=t.ownerDocument)?void 0:n.body,o=C(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=C(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+ft(t),u=-i.scrollTop;return"rtl"===U(r||e).direction&&(s+=C(e.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}(Z(t)))}function bt(t){var n,e=t.reference,i=t.element,r=t.placement,o=r?q(r):null,a=r?nt(r):null,s=e.x+e.width/2-i.width/2,u=e.y+e.height/2-i.height/2;switch(o){case y:n={x:s,y:e.y-i.height};break;case w:n={x:s,y:e.y+e.height};break;case g:n={x:e.x+e.width,y:u};break;case x:n={x:e.x-i.width,y:u};break;default:n={x:e.x,y:e.y}}var c=o?Q(o):null;if(null!=c){var f="y"===c?"height":"width";switch(a){case k:n[c]=n[c]-(e[f]/2-i[f]/2);break;case M:n[c]=n[c]+(e[f]/2-i[f]/2)}}return n}function mt(t,n){void 0===n&&(n={});var e=n.placement,i=void 0===e?t.placement:e,r=n.strategy,o=void 0===r?t.strategy:r,a=n.boundary,s=void 0===a?"clippingParents":a,u=n.rootBoundary,c=void 0===u?E:u,f=n.elementContext,d=void 0===f?A:f,h=n.altBoundary,l=void 0!==h&&h,p=n.padding,v=void 0===p?0:p,b=$("number"!=typeof v?v:tt(v,j)),m=t.rects.popper,x=t.elements[l?d===A?"reference":A:d],O=function(t,n,e,i){var r="clippingParents"===n?function(t){var n=lt(_(t)),e=["absolute","fixed"].indexOf(U(t).position)>=0&&B(t)?N(t):t;return W(e)?n.filter((function(t){return W(t)&&K(t,e)&&"body"!==P(t)})):[]}(t):[].concat(n),o=[].concat(r,[e]),a=o.reduce((function(n,e){var r=vt(t,e,i);return n.top=C(r.top,n.top),n.right=I(r.right,n.right),n.bottom=I(r.bottom,n.bottom),n.left=C(r.left,n.left),n}),vt(t,o[0],i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(W(x)?x:x.contextElement||Z(t.elements.popper),s,c,o),k=V(t.elements.reference),M=bt({reference:k,element:m,placement:i}),T=pt(Object.assign({},m,M)),S=d===A?T:k,L={top:O.top-S.top+b.top,bottom:S.bottom-O.bottom+b.bottom,left:O.left-S.left+b.left,right:S.right-O.right+b.right},H=t.modifiersData.offset;if(d===A&&H){var F=H[i];Object.keys(L).forEach((function(t){var n=[g,w].indexOf(t)>=0?1:-1,e=[y,w].indexOf(t)>=0?"y":"x";L[t]+=F[e]*n}))}return L}function yt(t,n){void 0===n&&(n={});var e=n.boundary,i=n.rootBoundary,r=n.padding,o=n.flipVariations,a=n.allowedAutoPlacements,s=void 0===a?S:a,u=nt(n.placement),c=u?o?T:T.filter((function(t){return nt(t)===u})):j,f=c.filter((function(t){return s.indexOf(t)>=0}));0===f.length&&(f=c);var d=f.reduce((function(n,o){return n[o]=mt(t,{placement:o,boundary:e,rootBoundary:i,padding:r})[q(o)],n}),{});return Object.keys(d).sort((function(t,n){return d[t]-d[n]}))}var wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var r=e.mainAxis,o=void 0===r||r,a=e.altAxis,s=void 0===a||a,u=e.fallbackPlacements,c=e.padding,f=e.boundary,d=e.rootBoundary,h=e.altBoundary,l=e.flipVariations,p=void 0===l||l,v=e.allowedAutoPlacements,b=n.options.placement,m=q(b),j=u||(m!==b&&p?function(t){if(q(t)===O)return[];var n=at(t);return[ut(t),n,ut(n)]}(b):[at(b)]),M=[b].concat(j).reduce((function(t,e){return t.concat(q(e)===O?yt(n,{placement:e,boundary:f,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:v}):e)}),[]),E=n.rects.reference,A=n.rects.popper,T=new Map,S=!0,L=M[0],P=0;P<M.length;P++){var H=M[P],W=q(H),B=nt(H)===k,F=[y,w].indexOf(W)>=0,C=F?"width":"height",I=mt(n,{placement:H,boundary:f,rootBoundary:d,altBoundary:h,padding:c}),R=F?B?g:x:B?w:y;E[C]>A[C]&&(R=at(R));var z=at(R),D=[];if(o&&D.push(I[W]<=0),s&&D.push(I[R]<=0,I[z]<=0),D.every((function(t){return t}))){L=H,S=!1;break}T.set(H,D)}if(S)for(var V=function(t){var n=M.find((function(n){var e=T.get(n);if(e)return e.slice(0,t).every((function(t){return t}))}));if(n)return L=n,"break"},J=p?3:1;J>0&&"break"!==V(J);J--);n.placement!==L&&(n.modifiersData[i]._skip=!0,n.placement=L,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function gt(t,n,e){return void 0===e&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function xt(t){return[y,g,w,x].some((function(n){return t[n]>=0}))}function Ot(t,n,e){void 0===e&&(e=!1);var i,r,o=B(n),a=B(n)&&function(t){var n=t.getBoundingClientRect(),e=R(n.width)/t.offsetWidth||1,i=R(n.height)/t.offsetHeight||1;return 1!==e||1!==i}(n),s=Z(n),u=V(t,a,e),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(o||!o&&!e)&&(("body"!==P(n)||dt(s))&&(c=(i=n)!==H(i)&&B(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:ct(i)),B(n)?((f=V(n,!0)).x+=n.clientLeft,f.y+=n.clientTop):s&&(f.x=ft(s))),{x:u.left+c.scrollLeft-f.x,y:u.top+c.scrollTop-f.y,width:u.width,height:u.height}}function jt(t){var n=new Map,e=new Set,i=[];function r(t){e.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!e.has(t)){var i=n.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){e.has(t.name)||r(t)})),i}var kt={placement:"bottom",modifiers:[],strategy:"absolute"};function Mt(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Et(t){void 0===t&&(t={});var n=t.defaultModifiers,e=void 0===n?[]:n,i=t.defaultOptions,r=void 0===i?kt:i;return function(t,n,i){void 0===i&&(i=r);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},kt,r),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],c=!1,f={state:s,setOptions:function(i){var o="function"==typeof i?i(s.options):i;d(),s.options=Object.assign({},r,s.options,o),s.scrollParents={reference:W(t)?lt(t):t.contextElement?lt(t.contextElement):[],popper:lt(n)};var a,c,h=function(t){var n=jt(t);return L.reduce((function(t,e){return t.concat(n.filter((function(t){return t.phase===e})))}),[])}((a=[].concat(e,s.options.modifiers),c=a.reduce((function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return s.orderedModifiers=h.filter((function(t){return t.enabled})),s.orderedModifiers.forEach((function(t){var n=t.options,e=t.effect;if("function"==typeof e){var i=e({state:s,name:t.name,instance:f,options:void 0===n?{}:n});u.push(i||function(){})}})),f.update()},forceUpdate:function(){if(!c){var t=s.elements,n=t.reference,e=t.popper;if(Mt(n,e)){s.rects={reference:Ot(n,N(e),"fixed"===s.options.strategy),popper:J(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(t){return s.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<s.orderedModifiers.length;i++)if(!0!==s.reset){var r=s.orderedModifiers[i],o=r.fn,a=r.options;"function"==typeof o&&(s=o({state:s,options:void 0===a?{}:a,name:r.name,instance:f})||s)}else s.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(t){f.forceUpdate(),t(s)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(o())}))}))),a}),destroy:function(){d(),c=!0}};if(!Mt(t,n))return f;function d(){u.forEach((function(t){return t()})),u=[]}return f.setOptions(i).then((function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)})),f}}var At=Et({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,e=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,u=H(n.elements.popper),c=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",e.update,rt)})),s&&u.addEventListener("resize",e.update,rt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",e.update,rt)})),s&&u.removeEventListener("resize",e.update,rt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state;n.modifiersData[t.name]=bt({reference:n.rects.reference,element:n.rects.popper,placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=t.options,i=e.gpuAcceleration,r=void 0===i||i,o=e.adaptive,a=void 0===o||o,s=e.roundOffsets,u=void 0===s||s,c={placement:q(n.placement),variation:nt(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,it(Object.assign({},c,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,it(Object.assign({},c,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach((function(t){var e=n.styles[t]||{},i=n.attributes[t]||{},r=n.elements[t];B(r)&&P(r)&&(Object.assign(r.style,e),Object.keys(i).forEach((function(t){var n=i[t];!1===n?r.removeAttribute(t):r.setAttribute(t,!0===n?"":n)})))}))},effect:function(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach((function(t){var i=n.elements[t],r=n.attributes[t]||{},o=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:e[t]).reduce((function(t,n){return t[n]="",t}),{});B(i)&&P(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,e=t.name,i=t.options.offset,r=void 0===i?[0,0]:i,o=S.reduce((function(t,e){return t[e]=function(t,n,e){var i=q(t),r=[x,y].indexOf(i)>=0?-1:1,o="function"==typeof e?e(Object.assign({},n,{placement:t})):e,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[x,g].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(e,n.rects,r),t}),{}),a=o[n.placement],s=a.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=a.x,n.modifiersData.popperOffsets.y+=s),n.modifiersData[e]=o}},wt,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name,r=e.mainAxis,o=void 0===r||r,a=e.altAxis,s=void 0!==a&&a,u=e.tether,c=void 0===u||u,f=e.tetherOffset,d=void 0===f?0:f,h=mt(n,{boundary:e.boundary,rootBoundary:e.rootBoundary,padding:e.padding,altBoundary:e.altBoundary}),l=q(n.placement),p=nt(n.placement),v=!p,b=Q(l),m="x"===b?"y":"x",O=n.modifiersData.popperOffsets,j=n.rects.reference,M=n.rects.popper,E="function"==typeof d?d(Object.assign({},n.rects,{placement:n.placement})):d,A="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,S={x:0,y:0};if(O){if(o){var L,P="y"===b?y:x,H="y"===b?w:g,W="y"===b?"height":"width",B=O[b],F=B+h[P],R=B-h[H],z=c?-M[W]/2:0,D=p===k?j[W]:M[W],V=p===k?-M[W]:-j[W],K=n.elements.arrow,U=c&&K?J(K):{width:0,height:0},Y=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=Y[P],_=Y[H],G=X(0,j[W],U[W]),$=v?j[W]/2-z-G-Z-A.mainAxis:D-G-Z-A.mainAxis,tt=v?-j[W]/2+z+G+_+A.mainAxis:V+G+_+A.mainAxis,et=n.elements.arrow&&N(n.elements.arrow),it=null!=(L=null==T?void 0:T[b])?L:0,rt=B+tt-it,ot=X(c?I(F,B+$-it-(et?"y"===b?et.clientTop||0:et.clientLeft||0:0)):F,B,c?C(R,rt):R);O[b]=ot,S[b]=ot-B}if(s){var at,st=O[m],ut="y"===m?"height":"width",ct=st+h["x"===b?y:x],ft=st-h["x"===b?w:g],dt=-1!==[y,x].indexOf(l),ht=null!=(at=null==T?void 0:T[m])?at:0,lt=dt?ct:st-j[ut]-M[ut]-ht+A.altAxis,pt=dt?st+j[ut]+M[ut]-ht-A.altAxis:ft,vt=c&&dt?function(t,n,e){var i=X(t,n,e);return i>e?e:i}(lt,st,pt):X(c?lt:ct,st,c?pt:ft);O[m]=vt,S[m]=vt-st}n.modifiersData[i]=S}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e=t.state,i=t.name,r=t.options,o=e.elements.arrow,a=e.modifiersData.popperOffsets,s=q(e.placement),u=Q(s),c=[x,g].indexOf(s)>=0?"height":"width";if(o&&a){var f=function(t,n){return $("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:tt(t,j))}(r.padding,e),d=J(o),h="y"===u?y:x,l="y"===u?w:g,p=e.rects.reference[c]+e.rects.reference[u]-a[u]-e.rects.popper[c],v=a[u]-e.rects.reference[u],b=N(o),m=b?"y"===u?b.clientHeight||0:b.clientWidth||0:0,O=m/2-d[c]/2+(p/2-v/2),k=X(f[h],O,m-d[c]-f[l]);e.modifiersData[i]=((n={})[u]=k,n.centerOffset=k-O,n)}},effect:function(t){var n=t.state,e=t.options.element,i=void 0===e?"[data-popper-arrow]":e;null!=i&&("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&K(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,e=t.name,i=n.rects.reference,r=n.rects.popper,o=n.modifiersData.preventOverflow,a=mt(n,{elementContext:"reference"}),s=mt(n,{altBoundary:!0}),u=gt(a,i),c=gt(s,r,o),f=xt(u),d=xt(c);n.modifiersData[e]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}}]});const Tt=t(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.opened=e(this,"opened",7),this.closed=e(this,"closed",7),this.inline=!1,this.placement="bottom-start",this.offset=[0,8],this.closing=!1,this.showing=this.inline||!1,this.positioned=!1,this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1,this.popperInstance=null,this.onKeyDown=t=>{"Escape"===t.code&&this.close()}}watchShowing(t){t||(this.destroyPopperInstance(),this.cleanupPortal()),this.positioned=!1}getAppendToElement(){return this.appendTo?"body"===this.appendTo?document.body:"string"==typeof this.appendTo?document.querySelector(this.appendTo):this.appendTo:null}setupPortal(){const t=this.getAppendToElement();t&&(this.originalParent=this.hostElement.parentElement,this.originalNextSibling=this.hostElement.nextSibling,this.isMovingPortal=!0,t.appendChild(this.hostElement),this.isMovingPortal=!1)}cleanupPortal(){this.isMovingPortal||this.originalParent&&(this.isMovingPortal=!0,this.originalNextSibling?this.originalParent.insertBefore(this.hostElement,this.originalNextSibling):this.originalParent.appendChild(this.hostElement),this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1)}createPopperInstance(){if(!this.triggerElement||!this.bodyRef)return;const t=!!this.appendTo,n=t?"viewport":"clippingParents";this.popperInstance=At(this.triggerElement,this.bodyRef,{placement:this.placement,strategy:t?"fixed":"absolute",modifiers:[{name:"offset",options:{offset:this.offset}},{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-end"],boundary:n}},{name:"preventOverflow",options:{boundary:n,altAxis:!0,padding:8}},{name:"computeStyles",options:{gpuAcceleration:!0}},{name:"applyStyles",enabled:!0}]}),this.popperInstance.forceUpdate(),this.positioned=!0}destroyPopperInstance(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null)}async open(){this.inline||(this.showing=!0,this.undo=m(this.el),this.opened.emit(void 0))}async close(){var t;this.inline||(this.showing=!1,this.closed.emit(void 0),null===(t=this.undo)||void 0===t||t.call(this),this.triggerElement&&this.triggerElement.focus())}disconnectedCallback(){this.isMovingPortal||(this.destroyPopperInstance(),this.cleanupPortal())}async getState(){return this.showing}async setTriggerElement(t){this.triggerElement=t}async updatePosition(){var t;await(null===(t=this.popperInstance)||void 0===t?void 0:t.update())}handleClick(t){var n;if(this.showing){const e=t.target;this.hostElement.contains(e)||(null===(n=this.triggerElement)||void 0===n?void 0:n.contains(e))||this.originalParent&&this.originalParent.contains(e)||this.close()}}render(){return i(r,{key:"488fb845bb3a168c45f715b5f7315a80e1857589",showing:this.showing,ref:t=>t&&(this.el=t)},!this.inline&&this.showing&&i("div",{key:"d6263beffa3dbeaa7f0e5e65c1f2627c07164648",part:"body",ref:t=>{t&&(this.bodyRef=t,this.showing&&this.triggerElement&&!this.popperInstance&&(this.setupPortal(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.createPopperInstance()}))}))))},style:{visibility:this.positioned?"visible":"hidden"},onKeyDown:this.onKeyDown,role:"dialog",tabindex:-1,"aria-hidden":!this.showing,"aria-label":this.label,"aria-modal":this.showing},i("focus-trap",{key:"7ffb9cc684198ab9f3b127a4abe5f60f3241cd49"},i("div",{key:"c6c7c14220c01969f3a5c92dda882685f4c43268",part:"content"},i("slot",{key:"a1e6ce7ed152f61b3970e20b40e36bb13ee7580a"})))),this.inline&&i("div",{key:"632750cfce76139771642e03051f5c4a654db56a",part:"content"},i("slot",{key:"c1aa297a6ffdeee55840a9e05adddb7220e7f954"})))}get hostElement(){return this}static get watchers(){return{showing:[{watchShowing:0}]}}static get style(){return":host::part(body){position:absolute;top:0;left:0;width:-moz-fit-content;width:fit-content;z-index:1200}:host::part(backdrop){}:host::part(content){}"}},[257,"tabworthy-dates-modal",{label:[1],inline:[4],placement:[1],offset:[16],appendTo:[1,"append-to"],closing:[32],showing:[32],positioned:[32],open:[64],close:[64],getState:[64],setTriggerElement:[64],updatePosition:[64]},[[10,"click","handleClick"]],{showing:[{watchShowing:0}]}]);function St(){"undefined"!=typeof customElements&&["tabworthy-dates-modal"].forEach((t=>{"tabworthy-dates-modal"===t&&(customElements.get(o(t))||customElements.define(o(t),Tt))}))}export{Tt as T,St as d}
1
+ import{p as t,H as n,c as e,h as i,d as r,t as o}from"./p-BiJ0HZVY.js";function a(t,n,e,i=20,r=0){let o=[];if(r>=i)return o;const s=t=>{const o=t.assignedNodes().filter((t=>1===t.nodeType));return o.length>0?a(o[0].parentElement,n,e,i,r+1):[]},u=Array.from(t.children||[]);for(const t of u)n(t)||(e(t)&&o.push(t),null!=t.shadowRoot?o.push(...a(t.shadowRoot,n,e,i,r+1)):"SLOT"===t.tagName?o.push(...s(t)):o.push(...a(t,n,e,i,r+1)));return o}function s(t){return t.hasAttribute("hidden")||t.hasAttribute("aria-hidden")&&"false"!==t.getAttribute("aria-hidden")||"none"===t.style.display||"0"===t.style.opacity||"hidden"===t.style.visibility||"collapse"===t.style.visibility}function u(t){return"-1"!==t.getAttribute("tabindex")&&!s(t)&&!function(t){return t.hasAttribute("disabled")||t.hasAttribute("aria-disabled")&&"false"!==t.getAttribute("aria-disabled")}(t)&&(t.hasAttribute("tabindex")||(t instanceof HTMLAnchorElement||t instanceof HTMLAreaElement)&&t.hasAttribute("href")||t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLIFrameElement)}const c=new Map,f=document.createElement("template");f.innerHTML='\n\t<div id="start"></div>\n\t<div id="backup"></div>\n\t<slot></slot>\n\t<div id="end"></div>\n';class d extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const t=this.attachShadow({mode:"open"});t.appendChild(f.content.cloneNode(!0)),this.$backup=t.querySelector("#backup"),this.$start=t.querySelector("#start"),this.$end=t.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(t){t?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return a(this,s,u)}trapFocus(t){if(this.inactive)return;let n=this.getFocusableElements();n.length>0?(t?n[n.length-1].focus():n[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(t){!function(t,n,e){const i=c.get(e);null!=i&&window.clearTimeout(i),c.set(e,window.setTimeout((()=>{t(),c.delete(e)}),0))}((()=>{this.focused!==t&&(this._focused=t,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}window.customElements.define("focus-trap",d);var h=new WeakMap,l=new WeakMap,p={},v=0,b=function(t){return t&&(t.host||b(t.parentNode))},m=function(t,n,e){void 0===e&&(e="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=function(t){return"undefined"==typeof document?null:(Array.isArray(t)?t[0]:t).ownerDocument.body}(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live]"))),function(t,n,e,i){var r=function(t,n){return n.map((function(n){if(t.contains(n))return n;var e=b(n);return e&&t.contains(e)?e:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)})).filter((function(t){return Boolean(t)}))}(n,Array.isArray(t)?t:[t]);p[e]||(p[e]=new WeakMap);var o=p[e],a=[],s=new Set,u=new Set(r),c=function(t){t&&!s.has(t)&&(s.add(t),c(t.parentNode))};r.forEach(c);var f=function(t){t&&!u.has(t)&&Array.prototype.forEach.call(t.children,(function(t){if(s.has(t))f(t);else{var n=t.getAttribute(i),r=null!==n&&"false"!==n,u=(h.get(t)||0)+1,c=(o.get(t)||0)+1;h.set(t,u),o.set(t,c),a.push(t),1===u&&r&&l.set(t,!0),1===c&&t.setAttribute(e,"true"),r||t.setAttribute(i,"true")}}))};return f(n),s.clear(),v++,function(){a.forEach((function(t){var n=h.get(t)-1,r=o.get(t)-1;h.set(t,n),o.set(t,r),n||(l.has(t)||t.removeAttribute(i),l.delete(t)),r||t.removeAttribute(e)})),--v||(h=new WeakMap,h=new WeakMap,l=new WeakMap,p={})}}(i,r,e,"aria-hidden")):function(){return null}},y="top",w="bottom",g="right",x="left",O="auto",j=[y,w,g,x],k="start",M="end",E="viewport",A="popper",T=j.reduce((function(t,n){return t.concat([n+"-"+k,n+"-"+M])}),[]),S=[].concat(j,[O]).reduce((function(t,n){return t.concat([n,n+"-"+k,n+"-"+M])}),[]),L=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function P(t){return t?(t.nodeName||"").toLowerCase():null}function H(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function W(t){return t instanceof H(t).Element||t instanceof Element}function B(t){return t instanceof H(t).HTMLElement||t instanceof HTMLElement}function F(t){return"undefined"!=typeof ShadowRoot&&(t instanceof H(t).ShadowRoot||t instanceof ShadowRoot)}function q(t){return t.split("-")[0]}var C=Math.max,I=Math.min,R=Math.round;function z(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function D(){return!/^((?!chrome|android).)*safari/i.test(z())}function V(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var i=t.getBoundingClientRect(),r=1,o=1;n&&B(t)&&(r=t.offsetWidth>0&&R(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&R(i.height)/t.offsetHeight||1);var a=(W(t)?H(t):window).visualViewport,s=!D()&&e,u=(i.left+(s&&a?a.offsetLeft:0))/r,c=(i.top+(s&&a?a.offsetTop:0))/o,f=i.width/r,d=i.height/o;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function J(t){var n=V(t),e=t.offsetWidth,i=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-i)<=1&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:i}}function K(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&F(e)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function U(t){return H(t).getComputedStyle(t)}function Y(t){return["table","td","th"].indexOf(P(t))>=0}function Z(t){return((W(t)?t.ownerDocument:t.document)||window.document).documentElement}function _(t){return"html"===P(t)?t:t.assignedSlot||t.parentNode||(F(t)?t.host:null)||Z(t)}function G(t){return B(t)&&"fixed"!==U(t).position?t.offsetParent:null}function N(t){for(var n=H(t),e=G(t);e&&Y(e)&&"static"===U(e).position;)e=G(e);return e&&("html"===P(e)||"body"===P(e)&&"static"===U(e).position)?n:e||function(t){var n=/firefox/i.test(z());if(/Trident/i.test(z())&&B(t)&&"fixed"===U(t).position)return null;var e=_(t);for(F(e)&&(e=e.host);B(e)&&["html","body"].indexOf(P(e))<0;){var i=U(e);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return e;e=e.parentNode}return null}(t)||n}function Q(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function X(t,n,e){return C(t,I(n,e))}function $(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function tt(t,n){return n.reduce((function(n,e){return n[e]=t,n}),{})}function nt(t){return t.split("-")[1]}var et={top:"auto",right:"auto",bottom:"auto",left:"auto"};function it(t){var n,e=t.popper,i=t.popperRect,r=t.placement,o=t.variation,a=t.offsets,s=t.position,u=t.gpuAcceleration,c=t.adaptive,f=t.roundOffsets,d=t.isFixed,h=a.x,l=void 0===h?0:h,p=a.y,v=void 0===p?0:p,b="function"==typeof f?f({x:l,y:v}):{x:l,y:v};l=b.x,v=b.y;var m=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),j=x,k=y,E=window;if(c){var A=N(e),T="clientHeight",S="clientWidth";A===H(e)&&"static"!==U(A=Z(e)).position&&"absolute"===s&&(T="scrollHeight",S="scrollWidth"),(r===y||(r===x||r===g)&&o===M)&&(k=w,v-=(d&&A===E&&E.visualViewport?E.visualViewport.height:A[T])-i.height,v*=u?1:-1),r!==x&&(r!==y&&r!==w||o!==M)||(j=g,l-=(d&&A===E&&E.visualViewport?E.visualViewport.width:A[S])-i.width,l*=u?1:-1)}var L,P=Object.assign({position:s},c&&et),W=!0===f?function(t,n){var e=t.y,i=n.devicePixelRatio||1;return{x:R(t.x*i)/i||0,y:R(e*i)/i||0}}({x:l,y:v},H(e)):{x:l,y:v};return l=W.x,v=W.y,Object.assign({},P,u?((L={})[k]=O?"0":"",L[j]=m?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+l+"px, "+v+"px)":"translate3d("+l+"px, "+v+"px, 0)",L):((n={})[k]=O?v+"px":"",n[j]=m?l+"px":"",n.transform="",n))}var rt={passive:!0},ot={left:"right",right:"left",bottom:"top",top:"bottom"};function at(t){return t.replace(/left|right|bottom|top/g,(function(t){return ot[t]}))}var st={start:"end",end:"start"};function ut(t){return t.replace(/start|end/g,(function(t){return st[t]}))}function ct(t){var n=H(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function ft(t){return V(Z(t)).left+ct(t).scrollLeft}function dt(t){var n=U(t);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function ht(t){return["html","body","#document"].indexOf(P(t))>=0?t.ownerDocument.body:B(t)&&dt(t)?t:ht(_(t))}function lt(t,n){var e;void 0===n&&(n=[]);var i=ht(t),r=i===(null==(e=t.ownerDocument)?void 0:e.body),o=H(i),a=r?[o].concat(o.visualViewport||[],dt(i)?i:[]):i,s=n.concat(a);return r?s:s.concat(lt(_(a)))}function pt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vt(t,n,e){return n===E?pt(function(t,n){var e=H(t),i=Z(t),r=e.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,u=0;if(r){o=r.width,a=r.height;var c=D();(c||!c&&"fixed"===n)&&(s=r.offsetLeft,u=r.offsetTop)}return{width:o,height:a,x:s+ft(t),y:u}}(t,e)):W(n)?function(t,n){var e=V(t,!1,"fixed"===n);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(n,e):pt(function(t){var n,e=Z(t),i=ct(t),r=null==(n=t.ownerDocument)?void 0:n.body,o=C(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=C(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+ft(t),u=-i.scrollTop;return"rtl"===U(r||e).direction&&(s+=C(e.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}(Z(t)))}function bt(t){var n,e=t.reference,i=t.element,r=t.placement,o=r?q(r):null,a=r?nt(r):null,s=e.x+e.width/2-i.width/2,u=e.y+e.height/2-i.height/2;switch(o){case y:n={x:s,y:e.y-i.height};break;case w:n={x:s,y:e.y+e.height};break;case g:n={x:e.x+e.width,y:u};break;case x:n={x:e.x-i.width,y:u};break;default:n={x:e.x,y:e.y}}var c=o?Q(o):null;if(null!=c){var f="y"===c?"height":"width";switch(a){case k:n[c]=n[c]-(e[f]/2-i[f]/2);break;case M:n[c]=n[c]+(e[f]/2-i[f]/2)}}return n}function mt(t,n){void 0===n&&(n={});var e=n.placement,i=void 0===e?t.placement:e,r=n.strategy,o=void 0===r?t.strategy:r,a=n.boundary,s=void 0===a?"clippingParents":a,u=n.rootBoundary,c=void 0===u?E:u,f=n.elementContext,d=void 0===f?A:f,h=n.altBoundary,l=void 0!==h&&h,p=n.padding,v=void 0===p?0:p,b=$("number"!=typeof v?v:tt(v,j)),m=t.rects.popper,x=t.elements[l?d===A?"reference":A:d],O=function(t,n,e,i){var r="clippingParents"===n?function(t){var n=lt(_(t)),e=["absolute","fixed"].indexOf(U(t).position)>=0&&B(t)?N(t):t;return W(e)?n.filter((function(t){return W(t)&&K(t,e)&&"body"!==P(t)})):[]}(t):[].concat(n),o=[].concat(r,[e]),a=o.reduce((function(n,e){var r=vt(t,e,i);return n.top=C(r.top,n.top),n.right=I(r.right,n.right),n.bottom=I(r.bottom,n.bottom),n.left=C(r.left,n.left),n}),vt(t,o[0],i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(W(x)?x:x.contextElement||Z(t.elements.popper),s,c,o),k=V(t.elements.reference),M=bt({reference:k,element:m,placement:i}),T=pt(Object.assign({},m,M)),S=d===A?T:k,L={top:O.top-S.top+b.top,bottom:S.bottom-O.bottom+b.bottom,left:O.left-S.left+b.left,right:S.right-O.right+b.right},H=t.modifiersData.offset;if(d===A&&H){var F=H[i];Object.keys(L).forEach((function(t){var n=[g,w].indexOf(t)>=0?1:-1,e=[y,w].indexOf(t)>=0?"y":"x";L[t]+=F[e]*n}))}return L}function yt(t,n){void 0===n&&(n={});var e=n.boundary,i=n.rootBoundary,r=n.padding,o=n.flipVariations,a=n.allowedAutoPlacements,s=void 0===a?S:a,u=nt(n.placement),c=u?o?T:T.filter((function(t){return nt(t)===u})):j,f=c.filter((function(t){return s.indexOf(t)>=0}));0===f.length&&(f=c);var d=f.reduce((function(n,o){return n[o]=mt(t,{placement:o,boundary:e,rootBoundary:i,padding:r})[q(o)],n}),{});return Object.keys(d).sort((function(t,n){return d[t]-d[n]}))}var wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var r=e.mainAxis,o=void 0===r||r,a=e.altAxis,s=void 0===a||a,u=e.fallbackPlacements,c=e.padding,f=e.boundary,d=e.rootBoundary,h=e.altBoundary,l=e.flipVariations,p=void 0===l||l,v=e.allowedAutoPlacements,b=n.options.placement,m=q(b),j=u||(m!==b&&p?function(t){if(q(t)===O)return[];var n=at(t);return[ut(t),n,ut(n)]}(b):[at(b)]),M=[b].concat(j).reduce((function(t,e){return t.concat(q(e)===O?yt(n,{placement:e,boundary:f,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:v}):e)}),[]),E=n.rects.reference,A=n.rects.popper,T=new Map,S=!0,L=M[0],P=0;P<M.length;P++){var H=M[P],W=q(H),B=nt(H)===k,F=[y,w].indexOf(W)>=0,C=F?"width":"height",I=mt(n,{placement:H,boundary:f,rootBoundary:d,altBoundary:h,padding:c}),R=F?B?g:x:B?w:y;E[C]>A[C]&&(R=at(R));var z=at(R),D=[];if(o&&D.push(I[W]<=0),s&&D.push(I[R]<=0,I[z]<=0),D.every((function(t){return t}))){L=H,S=!1;break}T.set(H,D)}if(S)for(var V=function(t){var n=M.find((function(n){var e=T.get(n);if(e)return e.slice(0,t).every((function(t){return t}))}));if(n)return L=n,"break"},J=p?3:1;J>0&&"break"!==V(J);J--);n.placement!==L&&(n.modifiersData[i]._skip=!0,n.placement=L,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function gt(t,n,e){return void 0===e&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function xt(t){return[y,g,w,x].some((function(n){return t[n]>=0}))}function Ot(t,n,e){void 0===e&&(e=!1);var i,r,o=B(n),a=B(n)&&function(t){var n=t.getBoundingClientRect(),e=R(n.width)/t.offsetWidth||1,i=R(n.height)/t.offsetHeight||1;return 1!==e||1!==i}(n),s=Z(n),u=V(t,a,e),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(o||!o&&!e)&&(("body"!==P(n)||dt(s))&&(c=(i=n)!==H(i)&&B(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:ct(i)),B(n)?((f=V(n,!0)).x+=n.clientLeft,f.y+=n.clientTop):s&&(f.x=ft(s))),{x:u.left+c.scrollLeft-f.x,y:u.top+c.scrollTop-f.y,width:u.width,height:u.height}}function jt(t){var n=new Map,e=new Set,i=[];function r(t){e.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!e.has(t)){var i=n.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){e.has(t.name)||r(t)})),i}var kt={placement:"bottom",modifiers:[],strategy:"absolute"};function Mt(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Et(t){void 0===t&&(t={});var n=t.defaultModifiers,e=void 0===n?[]:n,i=t.defaultOptions,r=void 0===i?kt:i;return function(t,n,i){void 0===i&&(i=r);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},kt,r),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],c=!1,f={state:s,setOptions:function(i){var o="function"==typeof i?i(s.options):i;d(),s.options=Object.assign({},r,s.options,o),s.scrollParents={reference:W(t)?lt(t):t.contextElement?lt(t.contextElement):[],popper:lt(n)};var a,c,h=function(t){var n=jt(t);return L.reduce((function(t,e){return t.concat(n.filter((function(t){return t.phase===e})))}),[])}((a=[].concat(e,s.options.modifiers),c=a.reduce((function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return s.orderedModifiers=h.filter((function(t){return t.enabled})),s.orderedModifiers.forEach((function(t){var n=t.options,e=t.effect;if("function"==typeof e){var i=e({state:s,name:t.name,instance:f,options:void 0===n?{}:n});u.push(i||function(){})}})),f.update()},forceUpdate:function(){if(!c){var t=s.elements,n=t.reference,e=t.popper;if(Mt(n,e)){s.rects={reference:Ot(n,N(e),"fixed"===s.options.strategy),popper:J(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(t){return s.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<s.orderedModifiers.length;i++)if(!0!==s.reset){var r=s.orderedModifiers[i],o=r.fn,a=r.options;"function"==typeof o&&(s=o({state:s,options:void 0===a?{}:a,name:r.name,instance:f})||s)}else s.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(t){f.forceUpdate(),t(s)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(o())}))}))),a}),destroy:function(){d(),c=!0}};if(!Mt(t,n))return f;function d(){u.forEach((function(t){return t()})),u=[]}return f.setOptions(i).then((function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)})),f}}var At=Et({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,e=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,u=H(n.elements.popper),c=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",e.update,rt)})),s&&u.addEventListener("resize",e.update,rt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",e.update,rt)})),s&&u.removeEventListener("resize",e.update,rt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state;n.modifiersData[t.name]=bt({reference:n.rects.reference,element:n.rects.popper,placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=t.options,i=e.gpuAcceleration,r=void 0===i||i,o=e.adaptive,a=void 0===o||o,s=e.roundOffsets,u=void 0===s||s,c={placement:q(n.placement),variation:nt(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,it(Object.assign({},c,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,it(Object.assign({},c,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach((function(t){var e=n.styles[t]||{},i=n.attributes[t]||{},r=n.elements[t];B(r)&&P(r)&&(Object.assign(r.style,e),Object.keys(i).forEach((function(t){var n=i[t];!1===n?r.removeAttribute(t):r.setAttribute(t,!0===n?"":n)})))}))},effect:function(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach((function(t){var i=n.elements[t],r=n.attributes[t]||{},o=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:e[t]).reduce((function(t,n){return t[n]="",t}),{});B(i)&&P(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,e=t.name,i=t.options.offset,r=void 0===i?[0,0]:i,o=S.reduce((function(t,e){return t[e]=function(t,n,e){var i=q(t),r=[x,y].indexOf(i)>=0?-1:1,o="function"==typeof e?e(Object.assign({},n,{placement:t})):e,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[x,g].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(e,n.rects,r),t}),{}),a=o[n.placement],s=a.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=a.x,n.modifiersData.popperOffsets.y+=s),n.modifiersData[e]=o}},wt,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name,r=e.mainAxis,o=void 0===r||r,a=e.altAxis,s=void 0!==a&&a,u=e.tether,c=void 0===u||u,f=e.tetherOffset,d=void 0===f?0:f,h=mt(n,{boundary:e.boundary,rootBoundary:e.rootBoundary,padding:e.padding,altBoundary:e.altBoundary}),l=q(n.placement),p=nt(n.placement),v=!p,b=Q(l),m="x"===b?"y":"x",O=n.modifiersData.popperOffsets,j=n.rects.reference,M=n.rects.popper,E="function"==typeof d?d(Object.assign({},n.rects,{placement:n.placement})):d,A="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,S={x:0,y:0};if(O){if(o){var L,P="y"===b?y:x,H="y"===b?w:g,W="y"===b?"height":"width",B=O[b],F=B+h[P],R=B-h[H],z=c?-M[W]/2:0,D=p===k?j[W]:M[W],V=p===k?-M[W]:-j[W],K=n.elements.arrow,U=c&&K?J(K):{width:0,height:0},Y=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=Y[P],_=Y[H],G=X(0,j[W],U[W]),$=v?j[W]/2-z-G-Z-A.mainAxis:D-G-Z-A.mainAxis,tt=v?-j[W]/2+z+G+_+A.mainAxis:V+G+_+A.mainAxis,et=n.elements.arrow&&N(n.elements.arrow),it=null!=(L=null==T?void 0:T[b])?L:0,rt=B+tt-it,ot=X(c?I(F,B+$-it-(et?"y"===b?et.clientTop||0:et.clientLeft||0:0)):F,B,c?C(R,rt):R);O[b]=ot,S[b]=ot-B}if(s){var at,st=O[m],ut="y"===m?"height":"width",ct=st+h["x"===b?y:x],ft=st-h["x"===b?w:g],dt=-1!==[y,x].indexOf(l),ht=null!=(at=null==T?void 0:T[m])?at:0,lt=dt?ct:st-j[ut]-M[ut]-ht+A.altAxis,pt=dt?st+j[ut]+M[ut]-ht-A.altAxis:ft,vt=c&&dt?function(t,n,e){var i=X(t,n,e);return i>e?e:i}(lt,st,pt):X(c?lt:ct,st,c?pt:ft);O[m]=vt,S[m]=vt-st}n.modifiersData[i]=S}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e=t.state,i=t.name,r=t.options,o=e.elements.arrow,a=e.modifiersData.popperOffsets,s=q(e.placement),u=Q(s),c=[x,g].indexOf(s)>=0?"height":"width";if(o&&a){var f=function(t,n){return $("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:tt(t,j))}(r.padding,e),d=J(o),h="y"===u?y:x,l="y"===u?w:g,p=e.rects.reference[c]+e.rects.reference[u]-a[u]-e.rects.popper[c],v=a[u]-e.rects.reference[u],b=N(o),m=b?"y"===u?b.clientHeight||0:b.clientWidth||0:0,O=m/2-d[c]/2+(p/2-v/2),k=X(f[h],O,m-d[c]-f[l]);e.modifiersData[i]=((n={})[u]=k,n.centerOffset=k-O,n)}},effect:function(t){var n=t.state,e=t.options.element,i=void 0===e?"[data-popper-arrow]":e;null!=i&&("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&K(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,e=t.name,i=n.rects.reference,r=n.rects.popper,o=n.modifiersData.preventOverflow,a=mt(n,{elementContext:"reference"}),s=mt(n,{altBoundary:!0}),u=gt(a,i),c=gt(s,r,o),f=xt(u),d=xt(c);n.modifiersData[e]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}}]});const Tt=t(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.opened=e(this,"opened",7),this.closed=e(this,"closed",7),this.inline=!1,this.placement="bottom-start",this.offset=[0,8],this.closing=!1,this.showing=this.inline||!1,this.positioned=!1,this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1,this.popperInstance=null,this.onKeyDown=t=>{"Escape"===t.code&&this.close()}}watchShowing(t){t||(this.destroyPopperInstance(),this.cleanupPortal()),this.positioned=!1}getAppendToElement(){return this.appendTo?"body"===this.appendTo?document.body:"string"==typeof this.appendTo?document.querySelector(this.appendTo):this.appendTo:null}setupPortal(){const t=this.getAppendToElement();t&&(this.originalParent=this.hostElement.parentElement,this.originalNextSibling=this.hostElement.nextSibling,this.isMovingPortal=!0,t.appendChild(this.hostElement),this.isMovingPortal=!1)}cleanupPortal(){this.isMovingPortal||this.originalParent&&(this.isMovingPortal=!0,this.originalNextSibling?this.originalParent.insertBefore(this.hostElement,this.originalNextSibling):this.originalParent.appendChild(this.hostElement),this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1)}createPopperInstance(){if(!this.triggerElement||!this.bodyRef)return;const t=!!this.appendTo,n=t?"viewport":"clippingParents";this.popperInstance=At(this.triggerElement,this.bodyRef,{placement:this.placement,strategy:t?"fixed":"absolute",modifiers:[{name:"offset",options:{offset:this.offset}},{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-end"],boundary:n}},{name:"preventOverflow",options:{boundary:n,altAxis:!0,padding:8}},{name:"computeStyles",options:{gpuAcceleration:!0}},{name:"applyStyles",enabled:!0}]}),this.popperInstance.forceUpdate(),this.positioned=!0}destroyPopperInstance(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null)}async open(){this.inline||(this.showing=!0,this.undo=m(this.el),this.opened.emit(void 0))}async close(){var t;this.inline||(this.showing=!1,this.closed.emit(void 0),null===(t=this.undo)||void 0===t||t.call(this),this.triggerElement&&this.triggerElement.focus())}disconnectedCallback(){this.isMovingPortal||(this.destroyPopperInstance(),this.cleanupPortal())}async getState(){return this.showing}async setTriggerElement(t){this.triggerElement=t}async updatePosition(){var t;await(null===(t=this.popperInstance)||void 0===t?void 0:t.update())}handleClick(t){var n;if(this.showing){const e=t.target;this.hostElement.contains(e)||(null===(n=this.triggerElement)||void 0===n?void 0:n.contains(e))||this.originalParent&&this.originalParent.contains(e)||this.close()}}render(){return i(r,{key:"2c9c3ade4eb4964dbb5ba86bd196240851dbb996",showing:this.showing,ref:t=>t&&(this.el=t)},!this.inline&&this.showing&&i("div",{key:"961c2d9e34d7ddadb512f8652f14ed4ed4ec6ce5",part:"body",ref:t=>{t&&(this.bodyRef=t,this.showing&&this.triggerElement&&!this.popperInstance&&(this.setupPortal(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.createPopperInstance()}))}))))},style:{visibility:this.positioned?"visible":"hidden"},onKeyDown:this.onKeyDown,role:"dialog",tabindex:-1,"aria-hidden":!this.showing,"aria-label":this.label,"aria-modal":this.showing},i("focus-trap",{key:"719a3e82aab59326d1aa069b237d158d2311cd62"},i("div",{key:"b33e1aabdb7477409d97f757bf7121697979d50c",part:"content"},i("slot",{key:"c7e85552f37b930e298484c0040c138fdccb8ea7"})))),this.inline&&i("div",{key:"59e0333fb0e980c17e0a1da041e6bc492d025bd8",part:"content"},i("slot",{key:"d52759f124c038fbde4b510ae1df8c3a1bdad25e"})))}get hostElement(){return this}static get watchers(){return{showing:[{watchShowing:0}]}}static get style(){return":host::part(body){position:absolute;top:0;left:0;width:-moz-fit-content;width:fit-content;z-index:1200}:host::part(backdrop){}:host::part(content){}"}},[257,"tabworthy-dates-modal",{label:[1],inline:[4],placement:[1],offset:[16],appendTo:[1,"append-to"],closing:[32],showing:[32],positioned:[32],open:[64],close:[64],getState:[64],setTriggerElement:[64],updatePosition:[64]},[[10,"click","handleClick"]],{showing:[{watchShowing:0}]}]);function St(){"undefined"!=typeof customElements&&["tabworthy-dates-modal"].forEach((t=>{"tabworthy-dates-modal"===t&&(customElements.get(o(t))||customElements.define(o(t),Tt))}))}export{Tt as T,St as d}
@@ -1 +1 @@
1
- import{T as o,d as s}from"./p-CMIEIvTW.js";const p=o,r=s;export{p as TabworthyDatesModal,r as defineCustomElement}
1
+ import{T as o,d as s}from"./p-DXCumu2Y.js";const m=o,p=s;export{m as TabworthyDatesModal,p as defineCustomElement}