var t,e,o={6709(t,e,o){o(2273);var r,i=o(9609),a=o(4084),s=o(526),n=o(457),l=o(2927),p=o(8899),d=o(4955),c=o(2577),u=o(8373),h=function(t,e,o,r){var i,a=arguments.length,s=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(s=(a<3?i(s):a>3?i(e,o,s):i(e,o))||s);return a>3&&s&&Object.defineProperty(e,o,s),s};!function(t){let e=class extends l.LitElement{constructor(){super(...arguments),this.codePlaceholder="+1",this.countryCallingCode="",this.showFlags=!1,this.pill=!1,this.disabled=!1,this.ariaLabel="",this.clearAriaLabel="Clear Country Code",this.id="",this.newMomentum=!1,this.isDropdownArrow=!0,this.countryCode="US",this.codeList=[]}connectedCallback(){super.connectedCallback(),this.codeList=(0,s.customArray)({name:"{countryNameEn}",value:"{countryCallingCode}",code:"{countryCode}"}),""===this.id&&(this.id=`md-country-code-picker-${Math.random().toString(36).substring(2,6)}`)}getCountryFlag(t){return l.html`
        <span class="flag-svg-wrapper">
          <img src="${(0,n.findFlagUrlByIso2Code)(t)}" />
        </span>
      `}countryCodeOptionTemplate(t,e){return l.html`
        <div
          part="option"
          class="md-country-code-picker__option"
          display-value="+${t.value}"
          slot=${e}
          aria-label="+${t.value}, ${t.name}, ${t.code}"
        >
          ${this.showFlags?this.getCountryFlag(t.code):l.nothing}
          <span>${t.name}</span>
          <span>+${t.value}</span>
        </div>
      `}handleCountryChange(t){var e,o;t.detail.value&&(null===(e=t.detail.value)||void 0===e?void 0:e.id)?(this.countryCallingCode=t.detail.value.id,this.countryCode=null===(o=t.detail.value.id.split(",")[2])||void 0===o?void 0:o.trim()):(this.countryCode="US",this.countryCallingCode=""),this.dispatchEvent(new CustomEvent("country-code-changed",{bubbles:!0,composed:!0,detail:{srcEvent:t}}))}get flagClassMap(){return{"new-momentum":this.newMomentum}}get containerClassMap(){return{"md-country-code-picker__container":!0,"show-flags":this.showFlags}}getFormatedCountryCallingCode(){var t;return{id:this.countryCallingCode,value:null===(t=this.countryCallingCode.split(",")[0])||void 0===t?void 0:t.trim()}}static get styles(){return[a.A,u.A]}get sortedCodeList(){return[...this.codeList].sort((t,e)=>t.name.localeCompare(e.name))}render(){return l.html`
        <div class="${(0,d.classMap)(this.containerClassMap)}">
          ${this.showFlags?l.html`
                <span class="flag-box ${(0,d.classMap)(this.flagClassMap)}">${this.getCountryFlag(this.countryCode)}</span>
              `:l.nothing}
          <md-combobox
            part="combobox"
            exportparts="group: combobox-group, combobox-options: options-container"
            ?disabled=${this.disabled}
            shape="${this.pill?"pill":"none"}"
            ariaLabel=${this.ariaLabel}
            placeholder="${this.codePlaceholder}"
            .value="${this.countryCallingCode?[this.getFormatedCountryCallingCode()]:[]}"
            @change-selected=${t=>this.handleCountryChange(t)}
            with-custom-content
            ?newMomentum=${this.newMomentum}
            ?is-dropdown-arrow=${this.isDropdownArrow}
            .clearAriaLabel="${this.clearAriaLabel}"
          >
            ${(0,c.repeat)(this.sortedCodeList,t=>t.name,(t,e)=>this.countryCodeOptionTemplate(t,e))}
          </md-combobox>
        </div>
      `}};h([(0,p.property)({type:String,reflect:!0})],e.prototype,"codePlaceholder",void 0),h([(0,p.property)({type:String,attribute:"country-calling-code"})],e.prototype,"countryCallingCode",void 0),h([(0,p.property)({type:Boolean,attribute:"show-flags"})],e.prototype,"showFlags",void 0),h([(0,p.property)({type:Boolean})],e.prototype,"pill",void 0),h([(0,p.property)({type:Boolean})],e.prototype,"disabled",void 0),h([(0,p.property)({type:String})],e.prototype,"ariaLabel",void 0),h([(0,p.property)({type:String})],e.prototype,"clearAriaLabel",void 0),h([(0,p.property)({type:String})],e.prototype,"id",void 0),h([(0,p.property)({type:Boolean})],e.prototype,"newMomentum",void 0),h([(0,p.property)({type:Boolean})],e.prototype,"isDropdownArrow",void 0),h([(0,p.state)()],e.prototype,"countryCode",void 0),h([(0,p.state)()],e.prototype,"codeList",void 0),h([(0,p.query)("md-combobox")],e.prototype,"combobox",void 0),e=h([(0,i.w)("md-country-code-picker")],e),t.ELEMENT=e}(r||(r={}))},5566(t,e,o){o.d(e,{L:()=>r}),o(2273),o(6709),o(9189);var r,i=o(9609),a=o(8682),s=o(2927),n=o(8899),l=o(4955),p=o(6429),d=function(t,e,o,r){var i,a=arguments.length,s=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(s=(a<3?i(s):a>3?i(e,o,s):i(e,o))||s);return a>3&&s&&Object.defineProperty(e,o,s),s};!function(t){let e=class extends s.LitElement{constructor(){super(...arguments),this.codePlaceholder="+1",this.numberPlaceholder="Enter Phone Number",this.countryCallingCode="",this.showFlags=!1,this.pill=!1,this.disabled=!1,this.value="",this.errorMessage="",this.showErrorMessage=!1,this.countryCodeAriaLabel="",this.dialNumberAriaLabel="",this.clearAriaLabel="Clear Input",this.clearCountryCodeAriaLabel="Clear Country Code",this.id="",this.newMomentum=!1,this.countryCode="US",this.formattedValue="",this.isValid=!0}get isRtl(){try{if(!this.isConnected)return!1;const t=getComputedStyle(this);return"rtl"===(null==t?void 0:t.direction)}catch(t){return!1}}connectedCallback(){super.connectedCallback(),""===this.id&&(this.id=`md-phone-input-${Math.random().toString(36).substring(2,6)}`),this.validateInput(this.value)}validateNumber(){this.isValid=!this.value||(0,a.isValidNumberForRegion)(this.value,this.countryCode)}handleCountryChange(t){var e,o;const r=t.detail.srcEvent;r.detail.value&&(null===(e=r.detail.value)||void 0===e?void 0:e.id)?(this.countryCallingCode=r.detail.value.id,this.countryCode=null===(o=r.detail.value.id.split(",")[2])||void 0===o?void 0:o.trim()):(this.countryCode="US",this.countryCallingCode=""),this.validateNumber(),this.dispatchEvent(new CustomEvent("countrycode-change",{bubbles:!0,composed:!0,detail:{srcEvent:r,isValid:this.isValid}}))}handlePhoneChange(t){this.value=t.detail.value,t.stopPropagation(),this.dispatchEvent(new CustomEvent("phoneinput-change",{bubbles:!0,composed:!0,detail:{srcEvent:t,value:`${this.countryCallingCode}${this.value}`,isValid:this.isValid,phoneNumber:this.value}}))}handleKeydown(t){this.isValid=!0,t.stopPropagation(),this.dispatchEvent(new CustomEvent("phoneinput-keydown",{bubbles:!0,composed:!0,detail:{srcEvent:t,value:`${this.countryCallingCode}${this.value}`,isValid:this.isValid,phoneNumber:this.value}}))}handleBlur(t){this.validateInput(this.value),this.validateNumber(),t.stopPropagation(),this.removeCountryCode(),this.dispatchEvent(new CustomEvent("phoneinput-blur",{bubbles:!0,composed:!0,detail:{srcEvent:t,value:`${this.countryCallingCode}${this.value}`,isValid:this.isValid,phoneNumber:this.value}}))}removeCountryCode(){var t;const e=null===(t=this.countryCallingCode.split(",")[0])||void 0===t?void 0:t.trim();if(this.value.startsWith(e)){const t=this.value.slice(e.length).replace(/^-/,"");this.value=t}}validateInput(t){this.formattedValue=new a.AsYouType(this.countryCode).input(t)}get flagClassMap(){return{"new-momentum":this.newMomentum}}get containerClassMap(){return{"md-phone-input__container":!0,rtl:this.isRtl}}static get styles(){return[p.A]}render(){return s.html`
        <div class=${(0,l.classMap)(this.containerClassMap)}>
          <md-country-code-picker
            part="md-country-code-picker"
            exportparts="option: option"
            ?disabled=${this.disabled}
            ?pill=${this.pill}
            ?show-flags=${this.showFlags}
            ariaLabel=${this.countryCodeAriaLabel}
            codePlaceholder="${this.codePlaceholder}"
            .countryCallingCode="${this.countryCallingCode}"
            @country-code-changed=${t=>this.handleCountryChange(t)}
            ?newMomentum=${this.newMomentum}
            ?isDropdownArrow=${!0}
            .clearAriaLabel="${this.clearCountryCodeAriaLabel}"
          ></md-country-code-picker>

          <md-input
            part="md-input"
            ?disabled=${this.disabled}
            placeholder=${this.numberPlaceholder}
            .ariaInvalid=${this.isValid?"false":"true"}
            .ariaLabel=${`${this.dialNumberAriaLabel}`}
            @input-change=${t=>this.handlePhoneChange(t)}
            @input-blur=${t=>this.handleBlur(t)}
            @input-keydown=${t=>this.handleKeydown(t)}
            shape="${this.pill?"pill":"none"}"
            .ariaControls=${this.id}
            clear
            ?newMomentum=${this.newMomentum}
            clearAriaLabel="${this.clearAriaLabel}"
            type="tel"
            value="${this.formattedValue}"
            .messageArr="${!this.isValid||this.showErrorMessage?[{type:"error",id:this.id,ariaLive:"polite",message:this.errorMessage}]:[]}"
          ></md-input>
        </div>
      `}};d([(0,n.property)({type:String,reflect:!0})],e.prototype,"codePlaceholder",void 0),d([(0,n.property)({type:String})],e.prototype,"numberPlaceholder",void 0),d([(0,n.property)({type:String,attribute:"country-calling-code"})],e.prototype,"countryCallingCode",void 0),d([(0,n.property)({type:Boolean,attribute:"show-flags"})],e.prototype,"showFlags",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"pill",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"disabled",void 0),d([(0,n.property)({type:String})],e.prototype,"value",void 0),d([(0,n.property)({type:String})],e.prototype,"errorMessage",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"showErrorMessage",void 0),d([(0,n.property)({type:String})],e.prototype,"countryCodeAriaLabel",void 0),d([(0,n.property)({type:String})],e.prototype,"dialNumberAriaLabel",void 0),d([(0,n.property)({type:String})],e.prototype,"clearAriaLabel",void 0),d([(0,n.property)({type:String})],e.prototype,"clearCountryCodeAriaLabel",void 0),d([(0,n.property)({type:String})],e.prototype,"id",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"newMomentum",void 0),d([(0,n.state)()],e.prototype,"countryCode",void 0),d([(0,n.state)()],e.prototype,"formattedValue",void 0),d([(0,n.state)()],e.prototype,"isValid",void 0),e=d([(0,i.w)("md-phone-input")],e),t.ELEMENT=e}(r||(r={}))}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var a=r[t]={exports:{}};return o[t].call(a.exports,a,a.exports,i),a.exports}i.m=o,t=[],i.O=(e,o,r,a)=>{if(!o){var s=1/0;for(d=0;d<t.length;d++){for(var[o,r,a]=t[d],n=!0,l=0;l<o.length;l++)(!1&a||s>=a)&&Object.keys(i.O).every(t=>i.O[t](o[l]))?o.splice(l--,1):(n=!1,a<s&&(s=a));if(n){t.splice(d--,1);var p=r();void 0!==p&&(e=p)}}return e}a=a||0;for(var d=t.length;d>0&&t[d-1][2]>a;d--)t[d]=t[d-1];t[d]=[o,r,a]},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{i as __webpack_require__};e={445:0,6709:0},i.C=t=>{var o,r,{__webpack_esm_ids__:a,__webpack_esm_modules__:s,__webpack_esm_runtime__:n}=t,l=0;for(o in s)i.o(s,o)&&(i.m[o]=s[o]);for(n&&n(i);l<a.length;l++)r=a[l],i.o(e,r)&&e[r]&&e[r][0](),e[a[l]]=0;i.O()},i.O.j=t=>0===e[t];import*as a from"../7103.js";i.C(a);import*as s from"../9609.js";i.C(s);import*as n from"../4084.js";i.C(n);import*as l from"../4955.js";i.C(l);import*as p from"../3517.js";i.C(p);import*as d from"../1156.js";i.C(d);import*as c from"../3305.js";i.C(c);import*as u from"../4739.js";i.C(u);import*as h from"../7154.js";i.C(h);import*as m from"../9773.js";i.C(m);import*as y from"../5983.js";i.C(y);import*as C from"../7755.js";i.C(C);import*as v from"../1821.js";i.C(v);import*as g from"../2364.js";i.C(g);import*as b from"../4980.js";i.C(b);import*as f from"../5308.js";i.C(f);import*as w from"../9938.js";i.C(w);import*as $ from"../4781.js";i.C($);import*as j from"../5201.js";i.C(j);import*as L from"../5584.js";i.C(L);import*as M from"../8227.js";i.C(M);import*as E from"../7704.js";i.C(E);import*as A from"../2577.js";i.C(A);import*as _ from"../2797.js";i.C(_);import*as P from"../3970.js";i.C(P);import*as S from"../7906.js";i.C(S);import*as x from"../9336.js";i.C(x);import*as O from"../2369.js";i.C(O);import*as V from"../7119.js";i.C(V);import*as k from"../9189.js";i.C(k);import*as F from"../4047.js";i.C(F);import*as N from"../4613.js";i.C(N);import*as B from"../4431.js";i.C(B);import*as R from"../8138.js";i.C(R);import*as I from"../4654.js";i.C(I);import*as T from"../2458.js";i.C(T);import*as D from"../7838.js";i.C(D);var U=i.O(void 0,[7103,9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,2364,4980,5308,9938,4781,5201,5584,8227,7704,2577,2797,3970,7906,9336,2369,7119,9189,4047,4613,4431,8138,4654,2458,7838],()=>i(5566));const K=(U=i.O(U)).L;export{K as PhoneInput};