@openremote/or-attribute-picker 1.2.0-snapshot.20240616202404 → 1.2.0-snapshot.20240819101332

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/umd/index.js CHANGED
@@ -481,7 +481,7 @@
481
481
  </div>
482
482
  ${t?V`<div style="min-width: 70px; width: 70px;">${t}</div>`:""}
483
483
  </span>
484
- `}return t}}}return V`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){const t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){if(super.updated(t),t.has("type")){const t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case qi.LIST:const e=new $n(t);this._mdcComponent=e,e.selectedIndex=this._selectedIndex;break;case qi.SELECT:const n=new oi(t);this._mdcComponent=n,this.value||(n.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return-1;const t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),n.useDefaultValidation=!this.multiple,n.valid=!this.required||!this.multiple&&n.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const i=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(i),this._mdcComponent.foundation.adapter.floatLabel(!!i),this._menuObserver||(this._menuObserver=new IntersectionObserver(((t,e)=>{var n,i;t[0].target.style.minWidth!=(null===(n=t[0].target.parentElement)||void 0===n?void 0:n.clientWidth)+"px"&&(t[0].target.style.minWidth=(null===(i=t[0].target.parentElement)||void 0===i?void 0:i.clientWidth)+"px")})),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));const r=void 0!==this.searchProvider,o=this.multiple;n.menu.menuSurface_.foundation.handleBodyClick=function(t){const e=t.composedPath()[0];if(this.adapter.isElementInContainer(e)){if(!r)return;if(e instanceof Element&&!e.className.includes("mdc-list-item"))return;if(o)return}n.menu.menuSurface_.close()};break;case qi.RADIO:case qi.CHECKBOX_LIST:case qi.COLOUR:break;case qi.BUTTON:case qi.BUTTON_MOMENTARY:const a=!this.action&&!this.label,l=new fe(t);a&&(l.unbounded=!0),this._mdcComponent=l;break;case qi.BUTTON_TOGGLE:this._mdcComponent=new fi(t);break;case qi.CHECKBOX:this._mdcComponent=new Ge(t);const d=this.shadowRoot.getElementById("field");if(d){const t=new ci(d);t.input=this._mdcComponent,this._mdcComponent2=t}break;case qi.SWITCH:this._mdcComponent=new tn(t);break;case qi.RANGE:this._mdcComponent=new _n(t);const c=this.shadowRoot.getElementById("number");if(c){const t=new Me(c);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:const s=new Me(t);s.useNativeValidation=!1,this._mdcComponent=s}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===qi.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!(!this.disabled&&!this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const e=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(e),this._mdcComponent.foundation.adapter.floatLabel(!!e)}else if(this.type===qi.RANGE&&this._mdcComponent){const t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===qi.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===qi.CHECKBOX&&this._mdcComponent){const t=this._mdcComponent;t.checked=!!this.value,t.disabled=!(!this.disabled&&!this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}this.autoValidate&&this.reportValidity()}renderOutlined(t){return V`
484
+ `}return t}}}return V`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){const t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){var e,n;if(super.updated(t),t.has("type")){const t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case qi.LIST:const e=new $n(t);this._mdcComponent=e,e.selectedIndex=this._selectedIndex;break;case qi.SELECT:const n=new oi(t);this._mdcComponent=n,null!==this.value&&void 0!==this.value||(n.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return-1;const t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),n.useDefaultValidation=!this.multiple,n.valid=!this.required||!this.multiple&&n.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const i=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(i),this._mdcComponent.foundation.adapter.floatLabel(!!i),this._menuObserver||(this._menuObserver=new IntersectionObserver(((t,e)=>{var n,i;t[0].target.style.minWidth!=(null===(n=t[0].target.parentElement)||void 0===n?void 0:n.clientWidth)+"px"&&(t[0].target.style.minWidth=(null===(i=t[0].target.parentElement)||void 0===i?void 0:i.clientWidth)+"px")})),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));const r=void 0!==this.searchProvider,o=this.multiple;n.menu.menuSurface_.foundation.handleBodyClick=function(t){const e=t.composedPath()[0];if(this.adapter.isElementInContainer(e)){if(!r)return;if(e instanceof Element&&!e.className.includes("mdc-list-item"))return;if(o)return}n.menu.menuSurface_.close()};break;case qi.RADIO:case qi.CHECKBOX_LIST:case qi.COLOUR:break;case qi.BUTTON:case qi.BUTTON_MOMENTARY:const a=!this.action&&!this.label,l=new fe(t);a&&(l.unbounded=!0),this._mdcComponent=l;break;case qi.BUTTON_TOGGLE:this._mdcComponent=new fi(t);break;case qi.CHECKBOX:this._mdcComponent=new Ge(t);const d=this.shadowRoot.getElementById("field");if(d){const t=new ci(d);t.input=this._mdcComponent,this._mdcComponent2=t}break;case qi.SWITCH:this._mdcComponent=new tn(t);break;case qi.RANGE:this._mdcComponent=new _n(t);const c=this.shadowRoot.getElementById("number");if(c){const t=new Me(c);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:const s=new Me(t);s.useNativeValidation=!1,this._mdcComponent=s}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===qi.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!(!this.disabled&&!this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const e=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(e),this._mdcComponent.foundation.adapter.floatLabel(!!e)}else if(this.type===qi.RANGE&&this._mdcComponent){const t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===qi.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===qi.CHECKBOX&&this._mdcComponent){const t=this._mdcComponent;t.checked=!!this.value,t.disabled=!(!this.disabled&&!this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}t.has("label")&&(null===(n=null===(e=this._mdcComponent)||void 0===e?void 0:e.layout)||void 0===n||n.call(e)),this.autoValidate&&this.reportValidity()}renderOutlined(t){return V`
485
485
  <span class="mdc-notched-outline">
486
486
  <span class="mdc-notched-outline__leading"></span>
487
487
  ${t?V`
@@ -491,7 +491,7 @@
491
491
  `:""}
492
492
  <span class="mdc-notched-outline__trailing"></span>
493
493
  </span>
494
- `}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==qi.JSON&&this.type!==qi.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let o,a=this.value;if("undefined"===e&&(a=null,e=void 0),"null"===e&&(a=void 0,e=null),"string"==typeof e)switch(this.type){case qi.CHECKBOX:case qi.SWITCH:e="on"===e;break;case qi.JSON:case qi.JSON_OBJECT:case qi.NUMBER:case qi.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==qi.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=_t.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===qi.JSON||this.type==qi.JSON_OBJECT?_t.i18next.t("validation.invalidJSON"):_t.i18next.t("validation.invalidNumber")}break;case qi.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=_t.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==qi.CHECKBOX_LIST&&e!==a&&(this.type===qi.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new Ki(this.value,a,n))),null!=this.searchProvider&&this.type===qi.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==qi.CHECKBOX_LIST||hi.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new Ki(e,a,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,_t.i18next.t(e,{defaultValue:hi.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};Oi([ft({type:Boolean})],Qi.prototype,"focused",void 0),Oi([ft()],Qi.prototype,"value",void 0),Oi([ft({type:String})],Qi.prototype,"type",void 0),Oi([ft({type:String})],Qi.prototype,"name",void 0),Oi([ft({type:Boolean})],Qi.prototype,"readonly",void 0),Oi([ft({type:Boolean})],Qi.prototype,"required",void 0),Oi([ft()],Qi.prototype,"max",void 0),Oi([ft()],Qi.prototype,"min",void 0),Oi([ft({type:Number})],Qi.prototype,"step",void 0),Oi([ft({type:Boolean})],Qi.prototype,"checked",void 0),Oi([ft({type:Boolean})],Qi.prototype,"indeterminate",void 0),Oi([ft({type:Number})],Qi.prototype,"maxLength",void 0),Oi([ft({type:Number})],Qi.prototype,"minLength",void 0),Oi([ft({type:Number})],Qi.prototype,"rows",void 0),Oi([ft({type:Number})],Qi.prototype,"cols",void 0),Oi([ft({type:Boolean})],Qi.prototype,"multiple",void 0),Oi([ft({type:String,attribute:!0,reflect:!1})],Qi.prototype,"pattern",void 0),Oi([ft({type:String})],Qi.prototype,"placeHolder",void 0),Oi([ft({type:Array})],Qi.prototype,"options",void 0),Oi([ft({type:Boolean})],Qi.prototype,"autoSelect",void 0),Oi([ft({type:Object})],Qi.prototype,"searchProvider",void 0),Oi([ft({type:String})],Qi.prototype,"icon",void 0),Oi([ft({type:String})],Qi.prototype,"iconColor",void 0),Oi([ft({type:String})],Qi.prototype,"iconOn",void 0),Oi([ft({type:String})],Qi.prototype,"iconTrailing",void 0),Oi([ft({type:Boolean})],Qi.prototype,"compact",void 0),Oi([ft({type:Boolean})],Qi.prototype,"comfortable",void 0),Oi([ft({type:Boolean})],Qi.prototype,"raised",void 0),Oi([ft({type:Boolean})],Qi.prototype,"action",void 0),Oi([ft({type:Boolean})],Qi.prototype,"unElevated",void 0),Oi([ft({type:Boolean})],Qi.prototype,"outlined",void 0),Oi([ft({type:Boolean})],Qi.prototype,"rounded",void 0),Oi([ft({type:Object})],Qi.prototype,"format",void 0),Oi([ft({type:Boolean})],Qi.prototype,"disableSliderNumberInput",void 0),Oi([ft({type:Boolean})],Qi.prototype,"fullWidth",void 0),Oi([ft({type:String})],Qi.prototype,"helperText",void 0),Oi([ft({type:Boolean})],Qi.prototype,"helperPersistent",void 0),Oi([ft({type:String,attribute:!0})],Qi.prototype,"validationMessage",void 0),Oi([ft({type:Boolean})],Qi.prototype,"autoValidate",void 0),Oi([ft({type:Boolean})],Qi.prototype,"charCounter",void 0),Oi([ft({type:String})],Qi.prototype,"label",void 0),Oi([ft({type:Boolean})],Qi.prototype,"disabled",void 0),Oi([ft({type:Boolean})],Qi.prototype,"continuous",void 0),Oi([ft({type:Boolean})],Qi.prototype,"resizeVertical",void 0),Oi([ht()],Qi.prototype,"isUiValid",void 0),Oi([ht()],Qi.prototype,"searchableValue",void 0),Oi([ht()],Qi.prototype,"errorMessage",void 0),Qi=Oi([mt("or-mwc-input")],Qi);var Zi="mdc-dom-focus-sentinel",tr=function(){function t(t,e){void 0===e&&(e={}),this.root=t,this.options=e,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw new Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+Zi)).forEach((function(t){t.parentElement.removeChild(t)})),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,e){var n=this.createSentinel(),i=this.createSentinel();n.addEventListener("focus",(function(){e.length>0&&e[e.length-1].focus()})),i.addEventListener("focus",(function(){e.length>0&&e[0].focus()})),t.insertBefore(n,t.children[0]),t.appendChild(i)},t.prototype.focusInitialElement=function(t,e){var n=0;e&&(n=Math.max(t.indexOf(e),0)),t[n].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter((function(t){var e="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),n=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(Zi)&&!e,i=!1;if(n){var r=getComputedStyle(t);i="none"===r.display||"hidden"===r.visibility}return n&&!i}))},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(Zi),t},t}(),er={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},nr={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:["textarea",".mdc-menu .mdc-list-item"].join(", "),SURFACE_SELECTOR:".mdc-dialog__surface"},ir={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},rr=function(t){function e(n){var i=t.call(this,Ht(Ht({},e.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=nr.CLOSE_ACTION,i.scrimClickAction_=nr.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=nr.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return $t(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return er},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nr},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return ir},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.hasClass(er.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(nr.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},e.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(er.OPENING),this.runNextAnimationFrame_((function(){t.adapter.addClass(er.OPEN),t.adapter.addBodyClass(er.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout((function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()}),ir.DIALOG_ANIMATION_OPEN_TIME_MS)}))},e.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(er.CLOSING),this.adapter.removeClass(er.OPEN),this.adapter.removeBodyClass(er.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)}),ir.DIALOG_ANIMATION_CLOSE_TIME_MS))},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},e.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},e.prototype.getScrimClickAction=function(){return this.scrimClickAction_},e.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},e.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},e.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},e.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},e.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},e.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,nr.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},e.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var n=t.composedPath?t.composedPath()[0]:t.target,i=!this.adapter.eventTargetMatches(n,this.suppressDefaultPressSelector);e&&i&&this.adapter.clickDefaultButton()}},e.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},e.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},e.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(er.OPENING),this.adapter.removeClass(er.CLOSING)},e.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame((function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)}))},e.prototype.detectStackedButtons_=function(){this.adapter.removeClass(er.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(er.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(er.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(er.SCROLLABLE)},e}(Ut),or=rr.strings,ar=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $t(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){var e,n;void 0===t&&(t=function(t,e){return new tr(t,e)});var i=this.root.querySelector(or.CONTAINER_SELECTOR);if(!i)throw new Error("Dialog component requires a "+or.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(or.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(or.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+or.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=Bt(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new fe(a))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.initialSyncWithDOM=function(){var t,e=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var n=["resize","orientationchange"];this.handleOpening_=function(){n.forEach((function(t){return window.addEventListener(t,e.handleLayout_)})),document.addEventListener("keydown",e.handleDocumentKeydown_)},this.handleClosing_=function(){n.forEach((function(t){return window.removeEventListener(t,e.handleLayout_)})),document.removeEventListener("keydown",e.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(or.OPENING_EVENT,this.handleOpening_),this.listen(or.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(or.OPENING_EVENT,this.handleOpening_),this.unlisten(or.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach((function(t){return t.destroy()})),t.prototype.destroy.call(this)},e.prototype.layout=function(){this.foundation.layout()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new rr({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(e){return t.root.classList.add(e)},areButtonsStacked:function(){return e=t.buttons_,n=new Set,[].forEach.call(e,(function(t){return n.add(t.offsetTop)})),n.size>1;var e,n},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,e){return!!t&&Kt(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=Gt(t.target,"["+or.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(or.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(e){return t.root.classList.contains(e)},isContentScrollable:function(){return!!(e=t.content_)&&e.scrollHeight>e.offsetHeight;var e},notifyClosed:function(e){return t.emit(or.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(or.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(or.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(or.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(e){return t.root.classList.remove(e)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach((function(t){t.parentElement.appendChild(t)}))},trapFocus:function(){return t.focusTrap_.trapFocus()}})},e.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+or.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(Yt),lr=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};const dr=a(40),cr=a(744);class sr extends CustomEvent{constructor(){super(sr.NAME,{bubbles:!0,composed:!0})}}sr.NAME="or-mwc-dialog-opened";class mr extends CustomEvent{constructor(t){super(mr.NAME,{detail:t,bubbles:!0,composed:!0})}}mr.NAME="or-mwc-dialog-closed";const pr=d`
494
+ `}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==qi.JSON&&this.type!==qi.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let o,a=this.value;if("undefined"===e&&(a=null,e=void 0),"null"===e&&(a=void 0,e=null),"string"==typeof e)switch(this.type){case qi.CHECKBOX:case qi.SWITCH:e="on"===e;break;case qi.JSON:case qi.JSON_OBJECT:case qi.NUMBER:case qi.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==qi.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=_t.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===qi.JSON||this.type==qi.JSON_OBJECT?_t.i18next.t("validation.invalidJSON"):_t.i18next.t("validation.invalidNumber")}break;case qi.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=_t.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==qi.CHECKBOX_LIST&&e!==a&&(this.type===qi.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new Ki(this.value,a,n))),null!=this.searchProvider&&this.type===qi.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==qi.CHECKBOX_LIST||hi.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new Ki(e,a,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,_t.i18next.t(e,{defaultValue:hi.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:null!=e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};Oi([ft({type:Boolean})],Qi.prototype,"focused",void 0),Oi([ft()],Qi.prototype,"value",void 0),Oi([ft({type:String})],Qi.prototype,"type",void 0),Oi([ft({type:String})],Qi.prototype,"name",void 0),Oi([ft({type:Boolean})],Qi.prototype,"readonly",void 0),Oi([ft({type:Boolean})],Qi.prototype,"required",void 0),Oi([ft()],Qi.prototype,"max",void 0),Oi([ft()],Qi.prototype,"min",void 0),Oi([ft({type:Number})],Qi.prototype,"step",void 0),Oi([ft({type:Boolean})],Qi.prototype,"checked",void 0),Oi([ft({type:Boolean})],Qi.prototype,"indeterminate",void 0),Oi([ft({type:Number})],Qi.prototype,"maxLength",void 0),Oi([ft({type:Number})],Qi.prototype,"minLength",void 0),Oi([ft({type:Number})],Qi.prototype,"rows",void 0),Oi([ft({type:Number})],Qi.prototype,"cols",void 0),Oi([ft({type:Boolean})],Qi.prototype,"multiple",void 0),Oi([ft({type:String,attribute:!0,reflect:!1})],Qi.prototype,"pattern",void 0),Oi([ft({type:String})],Qi.prototype,"placeHolder",void 0),Oi([ft({type:Array})],Qi.prototype,"options",void 0),Oi([ft({type:Boolean})],Qi.prototype,"autoSelect",void 0),Oi([ft({type:Object})],Qi.prototype,"searchProvider",void 0),Oi([ft({type:String})],Qi.prototype,"icon",void 0),Oi([ft({type:String})],Qi.prototype,"iconColor",void 0),Oi([ft({type:String})],Qi.prototype,"iconOn",void 0),Oi([ft({type:String})],Qi.prototype,"iconTrailing",void 0),Oi([ft({type:Boolean})],Qi.prototype,"compact",void 0),Oi([ft({type:Boolean})],Qi.prototype,"comfortable",void 0),Oi([ft({type:Boolean})],Qi.prototype,"raised",void 0),Oi([ft({type:Boolean})],Qi.prototype,"action",void 0),Oi([ft({type:Boolean})],Qi.prototype,"unElevated",void 0),Oi([ft({type:Boolean})],Qi.prototype,"outlined",void 0),Oi([ft({type:Boolean})],Qi.prototype,"rounded",void 0),Oi([ft({type:Object})],Qi.prototype,"format",void 0),Oi([ft({type:Boolean})],Qi.prototype,"disableSliderNumberInput",void 0),Oi([ft({type:Boolean})],Qi.prototype,"fullWidth",void 0),Oi([ft({type:String})],Qi.prototype,"helperText",void 0),Oi([ft({type:Boolean})],Qi.prototype,"helperPersistent",void 0),Oi([ft({type:String,attribute:!0})],Qi.prototype,"validationMessage",void 0),Oi([ft({type:Boolean})],Qi.prototype,"autoValidate",void 0),Oi([ft({type:Boolean})],Qi.prototype,"charCounter",void 0),Oi([ft({type:String})],Qi.prototype,"label",void 0),Oi([ft({type:Boolean})],Qi.prototype,"disabled",void 0),Oi([ft({type:Boolean})],Qi.prototype,"continuous",void 0),Oi([ft({type:Boolean})],Qi.prototype,"resizeVertical",void 0),Oi([ht()],Qi.prototype,"isUiValid",void 0),Oi([ht()],Qi.prototype,"searchableValue",void 0),Oi([ht()],Qi.prototype,"errorMessage",void 0),Qi=Oi([mt("or-mwc-input")],Qi);var Zi="mdc-dom-focus-sentinel",tr=function(){function t(t,e){void 0===e&&(e={}),this.root=t,this.options=e,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw new Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+Zi)).forEach((function(t){t.parentElement.removeChild(t)})),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,e){var n=this.createSentinel(),i=this.createSentinel();n.addEventListener("focus",(function(){e.length>0&&e[e.length-1].focus()})),i.addEventListener("focus",(function(){e.length>0&&e[0].focus()})),t.insertBefore(n,t.children[0]),t.appendChild(i)},t.prototype.focusInitialElement=function(t,e){var n=0;e&&(n=Math.max(t.indexOf(e),0)),t[n].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter((function(t){var e="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),n=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(Zi)&&!e,i=!1;if(n){var r=getComputedStyle(t);i="none"===r.display||"hidden"===r.visibility}return n&&!i}))},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(Zi),t},t}(),er={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},nr={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:["textarea",".mdc-menu .mdc-list-item"].join(", "),SURFACE_SELECTOR:".mdc-dialog__surface"},ir={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},rr=function(t){function e(n){var i=t.call(this,Ht(Ht({},e.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=nr.CLOSE_ACTION,i.scrimClickAction_=nr.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=nr.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return $t(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return er},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nr},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return ir},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.hasClass(er.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(nr.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},e.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(er.OPENING),this.runNextAnimationFrame_((function(){t.adapter.addClass(er.OPEN),t.adapter.addBodyClass(er.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout((function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()}),ir.DIALOG_ANIMATION_OPEN_TIME_MS)}))},e.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(er.CLOSING),this.adapter.removeClass(er.OPEN),this.adapter.removeBodyClass(er.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)}),ir.DIALOG_ANIMATION_CLOSE_TIME_MS))},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},e.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},e.prototype.getScrimClickAction=function(){return this.scrimClickAction_},e.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},e.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},e.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},e.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},e.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},e.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,nr.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},e.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var n=t.composedPath?t.composedPath()[0]:t.target,i=!this.adapter.eventTargetMatches(n,this.suppressDefaultPressSelector);e&&i&&this.adapter.clickDefaultButton()}},e.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},e.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},e.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(er.OPENING),this.adapter.removeClass(er.CLOSING)},e.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame((function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)}))},e.prototype.detectStackedButtons_=function(){this.adapter.removeClass(er.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(er.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(er.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(er.SCROLLABLE)},e}(Ut),or=rr.strings,ar=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $t(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){var e,n;void 0===t&&(t=function(t,e){return new tr(t,e)});var i=this.root.querySelector(or.CONTAINER_SELECTOR);if(!i)throw new Error("Dialog component requires a "+or.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(or.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(or.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+or.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=Bt(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new fe(a))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.initialSyncWithDOM=function(){var t,e=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var n=["resize","orientationchange"];this.handleOpening_=function(){n.forEach((function(t){return window.addEventListener(t,e.handleLayout_)})),document.addEventListener("keydown",e.handleDocumentKeydown_)},this.handleClosing_=function(){n.forEach((function(t){return window.removeEventListener(t,e.handleLayout_)})),document.removeEventListener("keydown",e.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(or.OPENING_EVENT,this.handleOpening_),this.listen(or.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(or.OPENING_EVENT,this.handleOpening_),this.unlisten(or.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach((function(t){return t.destroy()})),t.prototype.destroy.call(this)},e.prototype.layout=function(){this.foundation.layout()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new rr({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(e){return t.root.classList.add(e)},areButtonsStacked:function(){return e=t.buttons_,n=new Set,[].forEach.call(e,(function(t){return n.add(t.offsetTop)})),n.size>1;var e,n},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,e){return!!t&&Kt(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=Gt(t.target,"["+or.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(or.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(e){return t.root.classList.contains(e)},isContentScrollable:function(){return!!(e=t.content_)&&e.scrollHeight>e.offsetHeight;var e},notifyClosed:function(e){return t.emit(or.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(or.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(or.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(or.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(e){return t.root.classList.remove(e)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach((function(t){t.parentElement.appendChild(t)}))},trapFocus:function(){return t.focusTrap_.trapFocus()}})},e.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+or.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(Yt),lr=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};const dr=a(40),cr=a(744);class sr extends CustomEvent{constructor(){super(sr.NAME,{bubbles:!0,composed:!0})}}sr.NAME="or-mwc-dialog-opened";class mr extends CustomEvent{constructor(t){super(mr.NAME,{detail:t,bubbles:!0,composed:!0})}}mr.NAME="or-mwc-dialog-closed";const pr=d`
495
495
  :host {
496
496
  position: relative;
497
497
  }