!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx"],t);else{var o="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx);for(var i in o)("object"==typeof exports?exports:e)[i]=o[i]}}(self,(e,t,o,i,a,r,s,n)=>(()=>{"use strict";var l,d={329(e,t,o){o.r(t),o.d(t,{Modal:()=>y,modalAlignment:()=>v,modalType:()=>u}),o(5983),o(1821);var i=o(2900),a=o(3876),r=o(7704),s=o(9609),n=o(4084),l=o(7161),d=o(429),p=o(5125),m=o(291),c=o(6005),h=function(e,t,o,i){var a,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,o,s):a(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s};const u=["default","full","large","small","dialog"],v=["leading","center"];var y;!function(e){let t=class extends((0,r.dY)(l.LitElement)){constructor(){super(...arguments),this.show=!1,this.headerLabel="",this.headerMessage="",this.htmlId="",this.ariaLabel="modal",this.ariaLabelClose="Close Modal",this.ariaLabelCancel="Cancel Modal",this.ariaLabelSubmit="Submit Modal",this.ariaDescription="",this.showCloseButton=!1,this.backdropClickExit=!1,this.noExitOnEsc=!1,this.size="default",this.closeBtnName="",this.hideFooter=!1,this.hideHeader=!1,this.disableInitialFocus=!1,this.alignment=void 0,this.animating=!1,this.handleCloseOutside=e=>{e.code===i.Uz.Escape&&(e.preventDefault(),this.show&&!this.noExitOnEsc&&(this.show=!1))}}static get styles(){return[n.A,c.A]}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleCloseOutside)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleCloseOutside)}update(e){super.update(e),e.has("show")&&(this.show?this.modalFadeIn():!0===e.get("show")&&this.modalFadeOut())}get computedAlignment(){return void 0===this.alignment?a.themeManager.isMomentumV2Enabled?"leading":"center":this.alignment}notifyModalClose(){this.dispatchEvent(new CustomEvent("close-modal",{composed:!0,bubbles:!0}))}focusInsideModal(){var e;(null===(e=this.focusableElements)||void 0===e?void 0:e.length)&&this.setInitialFocus()}handleKeyDown(e){e.code!==i.Uz.Enter&&e.code!==i.Uz.Space||this.show&&(this.show=!0)}transitionPromise(e){return new Promise(t=>{const o=()=>{e.removeEventListener("transitionend",o),this.activateFocusTrap(),this.setFocusableElements(),requestAnimationFrame(()=>{t()})},i=()=>{e.removeEventListener("transitioncancel",i),this.deactivateFocusTrap(),this.modalFadeOut(),t()};e.addEventListener("transitionend",o),e.addEventListener("transitioncancel",i),setTimeout(()=>{this.animating=!0},13)})}modalFadeIn(){return e=this,t=void 0,i=function*(){this.backDrop&&(yield this.transitionPromise(this.backDrop),this.disableInitialFocus||this.focusInsideModal())},new((o=void 0)||(o=Promise))(function(a,r){function s(e){try{l(i.next(e))}catch(e){r(e)}}function n(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(s,n)}l((i=i.apply(e,t||[])).next())});var e,t,o,i}modalFadeOut(){this.animating=!1,this.deactivateFocusTrap(),this.notifyModalClose()}handleCloseBackdrop(){this.backdropClickExit&&(this.show=!1)}hideModal(){this.animating=!1,this.show=!1}topCloseBtnTemplate(){return l.html`
        ${this.showCloseButton?l.html`
              <md-button
                variant="ghost"
                size="20"
                circle
                class="md-close md-modal__close"
                @click=${this.hideModal}
                @keydown=${this.handleKeyDown}
                ariaLabel=${this.ariaLabelClose}
              >
                <md-icon name="cancel-bold" size="16" iconSet="momentumDesign"></md-icon>
              </md-button>
            `:l.nothing}
      `}handleFooterClick(){this.show=!1}headerTemplate(){return this.hideHeader?l.html`
            <div id="modal_header" part="modal-header" class="md-modal__header">
              <slot name="header"></slot>
            </div>
          `:l.html`
            <div id="modal_header" part="modal-header" class="md-modal__header">
              <h2 class="md-modal__title">${this.headerLabel}</h2>
              ${this.headerMessage?l.html` <span class="md-modal__message">${this.headerMessage}</span> `:l.nothing}
            </div>
          `}footerTemplate(){return this.hideFooter?l.html`
            <div part="modal-footer" class="md-modal__footer">
              <slot name="footer"></slot>
            </div>
          `:l.html`
            <div part="modal-footer" class="md-modal__footer">
              <md-button
                aria-label=${this.ariaLabelCancel}
                @click=${this.handleFooterClick}
                @keydown=${this.handleKeyDown}
                variant="secondary"
              >
                <span>Cancel</span>
              </md-button>
              <md-button
                type="submit"
                variant="primary"
                aria-label=${this.ariaLabelSubmit}
                @click=${this.handleFooterClick}
                @keydown=${this.handleKeyDown}
              >
                <span>${this.closeBtnName}</span>
              </md-button>
            </div>
          `}get modalBackDropClassMap(){return{in:this.show&&this.animating}}get modalContainerClassMap(){return{in:this.show,[`md-modal--${this.size}`]:!!this.size,[`md-modal--${this.computedAlignment}`]:!!this.computedAlignment}}render(){return l.html`
        ${this.show?l.html`
              <div part="modal-backdrop" class="md-modal__backdrop fade ${(0,p.classMap)(this.modalBackDropClassMap)}">
                ${this.backdropClickExit?l.html` <div class="md-modal_overlay" @click=${this.handleCloseBackdrop}></div> `:l.nothing}

                <div
                  part="modal-container"
                  role="dialog"
                  id="${this.htmlId}"
                  class="md-modal ${(0,p.classMap)(this.modalContainerClassMap)}"
                  aria-label="${(0,m.ifDefined)(this.headerLabel||this.ariaLabel||void 0)}"
                  aria-describedby=${(0,m.ifDefined)(this.ariaDescription||void 0)}
                >
                  <div part="modal-content" class="md-modal__content">
                    <div class="md-modal__flex-container" part="modal-flex-container">
                      ${this.headerTemplate()} ${this.topCloseBtnTemplate()}
                      <div id="modal-body" part="modal-body" class="md-modal__body">
                        <slot></slot>
                      </div>
                      ${this.footerTemplate()}
                    </div>
                  </div>
                </div>
              </div>
            `:l.nothing}
      `}};h([(0,d.property)({type:Boolean})],t.prototype,"show",void 0),h([(0,d.property)({type:String})],t.prototype,"headerLabel",void 0),h([(0,d.property)({type:String})],t.prototype,"headerMessage",void 0),h([(0,d.property)({type:String})],t.prototype,"htmlId",void 0),h([(0,d.property)({type:String,attribute:"aria-label"})],t.prototype,"ariaLabel",void 0),h([(0,d.property)({type:String})],t.prototype,"ariaLabelClose",void 0),h([(0,d.property)({type:String})],t.prototype,"ariaLabelCancel",void 0),h([(0,d.property)({type:String})],t.prototype,"ariaLabelSubmit",void 0),h([(0,d.property)({type:String})],t.prototype,"ariaDescription",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"showCloseButton",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"backdropClickExit",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"noExitOnEsc",void 0),h([(0,d.property)({type:String})],t.prototype,"size",void 0),h([(0,d.property)({type:String})],t.prototype,"closeBtnName",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"hideFooter",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"hideHeader",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"disableInitialFocus",void 0),h([(0,d.property)({type:String})],t.prototype,"alignment",void 0),h([(0,d.state)()],t.prototype,"animating",void 0),h([(0,d.query)(".md-modal__backdrop")],t.prototype,"backDrop",void 0),t=h([(0,s.w)("md-modal")],t),e.ELEMENT=t}(y||(y={}))},2022(e){e.exports=r},554(e){e.exports=s},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=o},291(e){e.exports=a},318(e){e.exports=i},5314(e){e.exports=n}},p={};function m(e){var t=p[e];if(void 0!==t)return t.exports;var o=p[e]={exports:{}};return d[e](o,o.exports,m),o.exports}m.m=d,l=[],m.O=(e,t,o,i)=>{if(!t){var a=1/0;for(d=0;d<l.length;d++){for(var[t,o,i]=l[d],r=!0,s=0;s<t.length;s++)(!1&i||a>=i)&&Object.keys(m.O).every(e=>m.O[e](t[s]))?t.splice(s--,1):(r=!1,i<a&&(a=i));if(r){l.splice(d--,1);var n=o();void 0!==n&&(e=n)}}return e}i=i||0;for(var d=l.length;d>0&&l[d-1][2]>i;d--)l[d]=l[d-1];l[d]=[t,o,i]},m.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return m.d(t,{a:t}),t},m.d=(e,t)=>{for(var o in t)m.o(t,o)&&!m.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},m.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={6433:0};m.O.j=t=>0===e[t];var t=(t,o)=>{var i,a,[r,s,n]=o,l=0;if(r.some(t=>0!==e[t])){for(i in s)m.o(s,i)&&(m.m[i]=s[i]);if(n)var d=n(m)}for(t&&t(o);l<r.length;l++)a=r[l],m.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return m.O(d)},o=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var c=m.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,4781,519,5201,5584,8227,4700,3876,6005,561],()=>m(329));return m.O(c)})());