/*! For license information please see woopay.js.LICENSE.txt */ (()=>{var d={436:d=>{var e;e=function(d){"use strict";return function(){for(var e=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["North Macedonia (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1,["5288","5289"]],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],t=0;tthis.countryCodeMaxLen&&(this.countryCodeMaxLen=t.length),this.countryCodes.hasOwnProperty(t)||(this.countryCodes[t]=[]);for(var n=0;n-1}))}else if(this.options.excludeCountries.length){var t=this.options.excludeCountries.map((function(d){return d.toLowerCase()}));this.countries=e.filter((function(d){return-1===t.indexOf(d.iso2)}))}else this.countries=e}},{key:"_translateCountriesByLocale",value:function(){for(var d=0;d"),$+="
"),$+="".concat(i.name,""),$+="+".concat(i.dialCode,""),$+=""}this.countryList.insertAdjacentHTML("beforeend",$)}},{key:"_setInitialState",value:function(){var d=this.telInput.getAttribute("value"),e=this.telInput.value,t=!d||"+"!==d.charAt(0)||e&&"+"===e.charAt(0)?e:d,$=this._getDialCode(t),n=this._isRegionlessNanp(t),i=this.options,o=i.initialCountry,r=i.nationalMode,a=i.autoHideDialCode,s=i.separateDialCode;$&&!n?this._updateFlagFromNumber(t):"auto"!==o&&(o?this._setFlag(o.toLowerCase()):$&&n?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,t||this._setFlag(this.defaultCountry)),t||r||a||s||(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),t&&this._updateValFromNumber(t)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoHideDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var d=this;this._handleHiddenInputSubmit=function(){d.hiddenInput.value=d.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var d=this.telInput;d&&"LABEL"!==d.tagName;)d=d.parentNode;return d}},{key:"_initDropdownListeners",value:function(){var d=this;this._handleLabelClick=function(e){d.countryList.classList.contains("iti__hide")?d.telInput.focus():e.preventDefault()};var e=this._getClosestLabel();e&&e.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!d.countryList.classList.contains("iti__hide")||d.telInput.disabled||d.telInput.readOnly||d._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(e){d.countryList.classList.contains("iti__hide")&&-1!==["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(e.key)&&(e.preventDefault(),e.stopPropagation(),d._showDropdown()),"Tab"===e.key&&d._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var d=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(d.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(d){window.intlTelInputGlobals.autoCountry=d.toLowerCase(),setTimeout((function(){return l("handleAutoCountry")}))}),(function(){return l("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var d=this;this._handleKeyupEvent=function(){d._updateFlagFromNumber(d.telInput.value)&&d._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(d._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(d){var e=this.telInput.getAttribute("maxlength");return e&&d.length>e?d.substr(0,e):d}},{key:"_initBlurListeners",value:function(){var d=this;this._handleSubmitOrBlurEvent=function(){d._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var d=this._getNumeric(this.telInput.value);d&&this.selectedCountryData.dialCode!==d||(this.telInput.value="")}}},{key:"_getNumeric",value:function(d){return d.replace(/\D/g,"")}},{key:"_trigger",value:function(d){var e=document.createEvent("Event");e.initEvent(d,!0,!0),this.telInput.dispatchEvent(e)}},{key:"_showDropdown",value:function(){this.countryList.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(d,e,t){t&&!d.classList.contains(e)?d.classList.add(e):!t&&d.classList.contains(e)&&d.classList.remove(e)}},{key:"_setDropdownPosition",value:function(){var d=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.isMobile){var e=this.telInput.getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop,$=e.top+t,n=this.countryList.offsetHeight,i=$+this.telInput.offsetHeight+nt;if(this._toggleClass(this.countryList,"iti__country-list--dropup",!i&&o),this.options.dropdownContainer){var r=!i&&o?0:this.telInput.offsetHeight;this.dropdown.style.top="".concat($+r,"px"),this.dropdown.style.left="".concat(e.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return d._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll)}}}},{key:"_getClosestListItem",value:function(d){for(var e=d;e&&e!==this.countryList&&!e.classList.contains("iti__country");)e=e.parentNode;return e===this.countryList?null:e}},{key:"_bindDropdownListeners",value:function(){var d=this;this._handleMouseoverCountryList=function(e){var t=d._getClosestListItem(e.target);t&&d._highlightListItem(t,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(e){var t=d._getClosestListItem(e.target);t&&d._selectListItem(t)},this.countryList.addEventListener("click",this._handleClickCountryList);var e=!0;this._handleClickOffToClose=function(){e||d._closeDropdown(),e=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var t="",$=null;this._handleKeydownOnDropdown=function(e){e.preventDefault(),"ArrowUp"===e.key||"Up"===e.key||"ArrowDown"===e.key||"Down"===e.key?d._handleUpDownKey(e.key):"Enter"===e.key?d._handleEnterKey():"Escape"===e.key?d._closeDropdown():/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)&&($&&clearTimeout($),t+=e.key.toLowerCase(),d._searchForCountry(t),$=setTimeout((function(){t=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown)}},{key:"_handleUpDownKey",value:function(d){var e="ArrowUp"===d||"Up"===d?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;e&&(e.classList.contains("iti__divider")&&(e="ArrowUp"===d||"Up"===d?e.previousElementSibling:e.nextElementSibling),this._highlightListItem(e,!0))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(d){for(var e=0;eo){e&&(l+=u);var c=n-r;t.scrollTop=l-c}}},{key:"_updateDialCode",value:function(d,e){var t,$=this.telInput.value,n="+".concat(d);if("+"===$.charAt(0)){var i=this._getDialCode($);t=i?$.replace(i,n):n}else{if(this.options.nationalMode||this.options.separateDialCode)return;if($)t=n+$;else{if(!e&&this.options.autoHideDialCode)return;t=n}}this.telInput.value=t}},{key:"_getDialCode",value:function(d,e){var t="";if("+"===d.charAt(0))for(var $="",n=0;n{!function(){var d=this||self;function e(e,t){e=e.split(".");var $,n=d;e[0]in n||void 0===n.execScript||n.execScript("var "+e[0]);for(;e.length&&($=e.shift());)e.length||void 0===t?n=n[$]&&n[$]!==Object.prototype[$]?n[$]:n[$]={}:n[$]=t}function t(d,e){function t(){}t.prototype=e.prototype,d.$=e.prototype,d.prototype=new t,d.prototype.constructor=d,d.fa=function(d,t,$){for(var n=Array(arguments.length-2),i=2;ie?1:dd.length)&&_d(J,d)}function dd(d){return _d(Z,d)?$d(d,F):$d(d,U)}function ed(d){var e=dd(d.toString());d.i="",d.g(e)}function td(d){return null!=d&&(1!=C(d,9)||-1!=y(d,9)[0])}function $d(d,e){for(var t,$=new k,n=d.length,i=0;ie?2:i[i.length-1]=e.i.length)throw Error("Phone number too short after IDD");d:{if(0!=(d=e.toString()).length&&"0"!=d.charAt(0))for(n=d.length,e=1;3>=e&&e<=n;++e)if((t=parseInt(d.substring(0,e),10))in O){$.g(d.substring(e)),$=t;break d}$=0}if(0!=$)return v(i,1,$),$;throw Error("Invalid country calling code")}return null!=t&&(r=""+(o=g(t,10)),0==(a=e.toString()).lastIndexOf(r,0)&&(r=new k(a.substring(r.length)),a=m(t,1),a=new RegExp(g(a,2)),yd(r,t,null),r=r.toString(),!_d(a,e.toString())&&_d(a,r)||3==fd(d,e.toString(),t,-1)))?($.g(r),n&&v(i,6,10),v(i,1,o),o):(v(i,1,0),0)}function yd(d,e,t){var $=d.toString(),n=$.length,i=m(e,15);if(0!=n&&null!=i&&0!=i.length){var o=new RegExp("^(?:"+i+")");if(n=o.exec($)){var r=_d(i=new RegExp(g(m(e,1),2)),$),a=n.length-1;null==(e=m(e,16))||0==e.length||null==n[a]||0==n[a].length?r&&!_d(i,$.substring(n[0].length))||(null!=t&&0e.i.length)throw Error("The string supplied is too short to be a phone number");if(null!=o&&(t=new k,yd(n=new k(e.toString()),o,t),2!=(d=fd(d,n.toString(),o,-1))&&4!=d&&5!=d&&(e=n,$&&0(d=($=e.toString()).length))throw Error("The string supplied is too short to be a phone number");if(17{d.exports=t(436)},5338:(d,e,t)=>{"use strict";var $=t(5795);e.H=$.createRoot,$.hydrateRoot},1020:(d,e,t)=>{"use strict";var $=t(1609),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,r=$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(d,e,t){var $,i={},s=null,l=null;for($ in void 0!==t&&(s=""+t),void 0!==e.key&&(s=""+e.key),void 0!==e.ref&&(l=e.ref),e)o.call(e,$)&&!a.hasOwnProperty($)&&(i[$]=e[$]);if(d&&d.defaultProps)for($ in e=d.defaultProps)void 0===i[$]&&(i[$]=e[$]);return{$$typeof:n,type:d,key:s,ref:l,props:i,_owner:r.current}}e.Fragment=i,e.jsx=s,e.jsxs=s},4848:(d,e,t)=>{"use strict";d.exports=t(1020)},1609:d=>{"use strict";d.exports=window.React},5795:d=>{"use strict";d.exports=window.ReactDOM}},e={};function t($){var n=e[$];if(void 0!==n)return n.exports;var i=e[$]={exports:{}};return d[$](i,i.exports,t),i.exports}t.n=d=>{var e=d&&d.__esModule?()=>d.default:()=>d;return t.d(e,{a:e}),e},t.d=(d,e)=>{for(var $ in e)t.o(e,$)&&!t.o(d,$)&&Object.defineProperty(d,$,{enumerable:!0,get:e[$]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(d){if("object"==typeof window)return window}}(),t.o=(d,e)=>Object.prototype.hasOwnProperty.call(d,e),(()=>{var d;t.g.importScripts&&(d=t.g.location+"");var e=t.g.document;if(!d&&e&&(e.currentScript&&(d=e.currentScript.src),!d)){var $=e.getElementsByTagName("script");if($.length)for(var n=$.length-1;n>-1&&(!d||!/^http(s?):/.test(d));)d=$[n--].src}if(!d)throw new Error("Automatic publicPath is not supported in this browser");d=d.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t.p=d})(),t.p=window.wcpayAssets.url,(()=>{"use strict";var d=t(5338),e=t(1609),$=t.n(e);const n=window.wp.i18n,i=window.wp.data,o=window.wc.blocksCheckout,r=window.wc.wcBlocksData;var a=t(603),s=t.n(a),l=t(4183),u=t.n(l);const c=d=>{var{onValueChange:t,value:i,id:o,onValidationChange:r=d=>d,onCountryDropdownClick:a,inputProps:l={label:"",ariaLabel:"",name:""},isBlocksCheckout:c}=d,h=function(d,e){var t={};for(var $ in d)Object.prototype.hasOwnProperty.call(d,$)&&e.indexOf($)<0&&(t[$]=d[$]);if(null!=d&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for($=Object.getOwnPropertySymbols(d);n<$.length;n++)e.indexOf($[n])<0&&Object.prototype.propertyIsEnumerable.call(d,$[n])&&(t[$[n]]=d[$[n]])}return t}(d,["onValueChange","value","id","onValidationChange","onCountryDropdownClick","inputProps","isBlocksCheckout"]);const[p,f]=(0,e.useState)(!1),[m,g]=(0,e.useState)(null),y=(0,e.useRef)(null),C=d=>{if("65"===d.getSelectedCountryData().dialCode&&!d.isValidNumber()){if(11!==d.getNumber().length)return!1;if(["800","805","806","807","808","809"].includes(d.getNumber().substr(3,3)))return!0}if("852"===d.getSelectedCountryData().dialCode&&!d.isValidNumber()){if(12!==d.getNumber().length)return!1;if(["4","7","8"].includes(d.getNumber().substr(4,1)))return!0}return d.isValidNumber()};return(0,e.useEffect)((()=>{var d,e,$;let n=null;const i=y.current,o=()=>{n&&(p||n.getNumber())&&(t(n.getNumber()),r(C(n)))};let l={initialCountry:"US",onlyCountries:[]};if("undefined"!=typeof wcpaySettings&&"JP"===(null!==(e=null===(d=null===wcpaySettings||void 0===wcpaySettings?void 0:wcpaySettings.accountStatus)||void 0===d?void 0:d.country)&&void 0!==e?e:"")&&(l={initialCountry:"JP",onlyCountries:["JP"]}),i){n=s()(i,Object.assign({customPlaceholder:()=>"",separateDialCode:!0,hiddenInput:"full",utilsScript:u(),dropdownContainer:document.body,formatOnDisplay:!1},l)),g(n),i.addEventListener("countrychange",o);const d=null===($=i.closest(".iti"))||void 0===$?void 0:$.querySelector(".iti__flag-container");d&&a&&d.addEventListener("click",a)}return()=>{var d;if(n){n.destroy(),i&&i.removeEventListener("countrychange",o);const e=null===(d=null==i?void 0:i.closest(".iti"))||void 0===d?void 0:d.querySelector(".iti__flag-container");e&&a&&e.removeEventListener("click",a)}}}),[t,r,a,p]),(0,e.useEffect)((()=>{m&&y.current&&(p||m.getNumber())&&(m.setNumber(i),r(C(m)))}),[i,m,y,r,p]),$().createElement("div",{className:c?"wc-block-components-text-input":""},$().createElement("input",Object.assign({type:"tel",ref:y,id:o,value:(v=i,m?v.replace("+"+m.getSelectedCountryData().dialCode,""):v),onBlur:()=>{f(!0)},onChange:()=>{m&&(t(m.getNumber()),r(C(m)))},placeholder:(0,n.__)("Mobile number","woocommerce-payments"),"aria-label":l.ariaLabel||(0,n.__)("Mobile phone number","woocommerce-payments"),name:l.name,className:m&&!C(m)?"phone-input input-text has-error":"phone-input input-text"},h)));var v},h=d=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[d]?wcpayConfig[d]:p(d),p=d=>{let e=null;if("undefined"!=typeof wcpay_upe_config)e=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;e=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return e[d]||null},f=d=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(d)?wcpayExpressCheckoutParams[d]:null;var m=t(4848);const g=()=>(0,m.jsx)("div",{className:"additional-information",children:(0,n.__)("Next time you buy here and on other Woo-powered stores, we'll send you a code to securely purchase with WooPay.","woocommerce-payments")});function y(d){return d.startsWith("{{/")?{type:"componentClose",value:d.replace(/\W/g,"")}:d.endsWith("/}}")?{type:"componentSelfClosing",value:d.replace(/\W/g,"")}:d.startsWith("{{")?{type:"componentOpen",value:d.replace(/\W/g,"")}:{type:"string",value:d}}function C(d,t){let $,n,i=[];for(let e=0;e{var t,$,n,i;if(!1===(null!==(t=h("isShopperTrackingEnabled"))&&void 0!==t?t:f("is_shopper_tracking_enabled")))return;const o=null!==($=h("platformTrackerNonce"))&&void 0!==$?$:null===(n=f("nonce"))||void 0===n?void 0:n.platform_tracker,r=null!==(i=h("ajaxUrl"))&&void 0!==i?i:f("ajax_url"),a=new FormData;a.append("tracksNonce",o),a.append("action","platform_tracks"),a.append("tracksEventName",d),a.append("tracksEventProp",JSON.stringify(e)),fetch(r,{method:"post",body:a}).then((d=>d.json()))},b=()=>(0,m.jsx)("div",{className:"tos",children:v({mixedString:(0,n.__)("By continuing, you agree to WooPay's {{termsOfService/}} and {{privacyPolicy/}}.","woocommerce-payments"),components:{termsOfService:(0,m.jsx)("a",{target:"_blank",href:"https://wordpress.com/tos/",rel:"noopener noreferrer",onClick:()=>{_("checkout_save_my_info_tos_click")},children:(0,n.__)("Terms of Service","woocommerce-payments")}),privacyPolicy:(0,m.jsx)("a",{target:"_blank",href:"https://automattic.com/privacy/",rel:"noopener noreferrer",onClick:()=>{_("checkout_save_my_info_privacy_policy_click")},children:(0,n.__)("Privacy Policy","woocommerce-payments")})}})}),w=({children:d,isBlocksCheckout:e})=>e?(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"woopay-save-new-user-container",children:[(0,m.jsx)("div",{className:"wc-block-components-checkout-step__heading-container",children:(0,m.jsx)("div",{className:"wc-block-components-checkout-step__heading",children:(0,m.jsx)("h2",{className:"wc-block-components-title wc-block-components-checkout-step__title",children:(0,n.__)("Save my info")})})}),d]})}):d;function S(d,e="",t){for(const $ in d){const n=d[$],i=e?e+"["+$+"]":$;"string"==typeof n||"number"==typeof n?t.append(i,n):"object"==typeof n&&S(n,i,t)}return t}async function I(d,e,t){const $=S(e,"",new FormData),n=await fetch(d,{method:"POST",body:$,...t});return await n.json()}const E=()=>document.querySelector("#payment_method_woocommerce_payments")?.checked,k=()=>document.querySelector("#wc-woocommerce_payments-payment-token-new")?.checked||!document.querySelector('[type=radio][name="wc-woocommerce_payments-payment-token"]'),L=({isBlocksCheckout:d})=>{const t="invalid-woopay-phone-number",{setValidationErrors:$,clearValidationError:a}=(0,i.useDispatch)(r.VALIDATION_STORE_KEY),[s,l]=(0,e.useState)(window.woopayCheckout?.PRE_CHECK_SAVE_MY_INFO||!1),[u,p]=(0,e.useState)(""),[f,y]=(0,e.useState)(null),[C,v]=(0,e.useState)(!1),S=(0,e.useRef)(!1),L=(0,i.useSelect)((d=>d(r.CHECKOUT_STORE_KEY).isProcessing())),N=(0,i.useSelect)((d=>d(r.CHECKOUT_STORE_KEY).getUseShippingAsBilling())),T=(()=>{const[d,t]=(0,e.useState)(!1),$=(0,e.useRef)(window);return(0,e.useEffect)((()=>{const d=d=>{t(d.detail.isRegisteredUser)},e=$.current;return e.addEventListener("woopayUserCheck",d),()=>{e.removeEventListener("woopayUserCheck",d)}}),[]),d})(),{isWCPayChosen:A,isNewPaymentTokenChosen:M}=(d=>{const{isWCPayChosenOnBlocksCheckout:t}=(0,i.useSelect)((d=>({isWCPayChosenOnBlocksCheckout:"woocommerce_payments"===d(r.PAYMENT_STORE_KEY).getActivePaymentMethod()}))),[$,n]=(0,e.useState)(!d&&E()),[o,a]=(0,e.useState)(!d&&k());return(0,e.useEffect)((()=>{if(d)return;const e=()=>{const e=E();n(e),d&&e&&(()=>{const d=document.querySelector(".wc-block-components-payment-methods__save-card-info");d&&(d.style.display="none")})()},t=()=>{a(k())},$=document.querySelectorAll('[type=radio][name="payment_method"]');$.forEach((d=>{d.addEventListener("change",e)}));const i=(d=>d?document.querySelectorAll('[type=radio][name="radio-control-wc-payment-method-saved-tokens"]'):document.querySelectorAll('[type=radio][name="wc-woocommerce_payments-payment-token"]'))(d);return i.forEach((d=>{d.addEventListener("change",t)})),()=>{$.forEach((d=>{d.removeEventListener("change",e)})),i.forEach((d=>{d.removeEventListener("change",t)}))}}),[d]),{isWCPayChosen:d?t:$,isNewPaymentTokenChosen:d?t:o}})(d),D=d?A:A&&M,P=window.document.documentElement.clientWidth,B=window.document.documentElement.clientHeight;(0,e.useEffect)((()=>{if(!d)return;const e=document.querySelector("#remember-me");if(e){if(L)return e.classList.add("wc-block-components-checkout-step--disabled"),void e.setAttribute("disabled","disabled");e.classList.remove("wc-block-components-checkout-step--disabled"),e.removeAttribute("disabled","disabled")}}),[L,d]);const x=(0,e.useCallback)((()=>{let e="";return e=d?document.getElementById("phone")?.value||document.getElementById("billing-phone")?.value||document.getElementById("shipping-phone")?.value||"":document.getElementById("billing_phone")?.value||"",e=e.replace(/[^\d+]*/g,""),e.startsWith("+")||(e="+1"+e),e}),[d]),O=(0,e.useCallback)(((d=!1)=>{const e=d?{empty:1}:{save_user_in_woopay:s?1:0,woopay_source_url:wcSettings?.storePages?.checkout?.permalink,woopay_is_blocks:1,woopay_viewport:`${P}x${B}`,woopay_user_phone_field:{full:u}};I(((d,e,t="wcpay_")=>d.toString().replace("%%endpoint%%",t+e))(h("wcAjaxUrl"),"set_woopay_phone_number"),{_ajax_nonce:h("woopaySessionNonce"),...e}).then((()=>{v(!d)}))}),[s,u,P,B]),G=(0,e.useCallback)((()=>{_("checkout_woopay_save_my_info_country_click")}),[]);(0,e.useEffect)((()=>{f&&_("checkout_woopay_save_my_info_mobile_enter")}),[f]),(0,e.useEffect)((()=>{jQuery("form.woocommerce-checkout").on("checkout_place_order",(function(){jQuery("#validate-error-invalid-woopay-phone-number").show()}))}),[]),(0,e.useEffect)((()=>s?s&&f?(a(t),void(d&&O(!1))):void(s&&!f&&D&&$({[t]:{message:(0,n.__)("Please enter a valid mobile phone number.","woocommerce-payments"),hidden:null===f}})):(a(t),void(null!==f&&y(null)))),[a,d,f,s,O,$,D]);const R=(0,e.useCallback)((()=>{S.current||p(x())}),[p,x,S]);return(0,e.useEffect)((()=>{R()}),[R]),(0,e.useEffect)((()=>{if(d){if(R(),N)return document.querySelector("#billing-phone")?.removeEventListener("blur",R),void document.querySelector("#shipping-phone")?.addEventListener("blur",R);document.querySelector("#shipping-phone")?.removeEventListener("blur",R),document.querySelector("#billing-phone")?.addEventListener("blur",R)}else document.querySelector("#billing_phone")?.addEventListener("blur",R)}),[N,R,S,x,d]),(0,e.useEffect)((()=>{h("forceNetworkSavedCards")&&D&&!T||(d&&C&&O(!0),a(t))}),[a,t,d,T,D,O,C]),h("forceNetworkSavedCards")&&D&&!T?(0,m.jsx)(w,{isBlocksCheckout:d,children:(0,m.jsxs)("div",{className:"save-details",children:[(0,m.jsx)("div",{className:"save-details-header",children:(0,m.jsx)("div",{className:d?"wc-block-components-checkbox":"",children:(0,m.jsxs)("label",{htmlFor:"save_user_in_woopay",children:[(0,m.jsx)("input",{type:"checkbox",checked:s,onChange:e=>{const t=e.target.checked;t?p(x()):(p(""),d&&O(!0)),l(t),_("checkout_save_my_info_click",{status:t?"checked":"unchecked"})},name:"save_user_in_woopay",id:"save_user_in_woopay",value:"true",className:"save-details-checkbox "+(d?"wc-block-components-checkbox__input":""),"aria-checked":s}),d&&(0,m.jsx)("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20",children:(0,m.jsx)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})}),(0,m.jsx)("span",{className:"wc-block-components-checkbox__label",children:(0,n.__)("Securely save my information for 1-click checkout","woocommerce-payments")})]})})}),s&&(0,m.jsxs)("div",{className:"save-details-form form-row","data-testid":"save-user-form",children:[(0,m.jsx)("input",{type:"hidden",name:"woopay_source_url",value:wcSettings?.storePages?.checkout?.permalink}),(0,m.jsx)("input",{type:"hidden",name:"woopay_viewport",value:`${P}x${B}`}),(0,m.jsxs)("div",{className:f?"":"has-error",children:[(0,m.jsx)(c,{value:u,onValueChange:p,onValidationChange:y,onCountryDropdownClick:G,onClick:()=>S.current=!0,inputProps:{name:"woopay_user_phone_field[no-country-code]"},isBlocksCheckout:d}),d&&(0,m.jsx)(o.ValidationInputError,{elementId:t,propertyName:t}),!d&&!f&&(0,m.jsx)("p",{id:"validate-error-invalid-woopay-phone-number",hidden:!1!==f,children:(0,n.__)("Please enter a valid mobile phone number.","woocommerce-payments")})]}),(0,m.jsx)(g,{}),(0,m.jsx)(b,{})]})]})}):null},N=()=>{const e=document.getElementsByClassName("woopay-save-new-user-container")?.[0];if(!e)if(document.getElementsByClassName("wc-block-checkout").length){let e=document.querySelector("#remember-me");if(!e){const d=document.getElementsByClassName("wp-block-woocommerce-checkout-payment-block")?.[0];e=document.createElement("fieldset"),e.className="wc-block-checkout__payment-method wp-block-woocommerce-checkout-remember-block wc-block-components-checkout-step ",e.id="remember-me",d&&d.parentNode.insertBefore(e,d.nextSibling)}(0,d.H)(e).render((0,m.jsx)(L,{isBlocksCheckout:!0}))}else{const e=document.createElement("div");e.className="woopay-save-new-user-container";const t=document.getElementsByClassName("form-row place-order")?.[0],$=t?.parentNode;t&&$&&($.insertBefore(e,t),(0,d.H)(e).render((0,m.jsx)(L,{isBlocksCheckout:!1})))}};window.addEventListener("load",(()=>{N()})),jQuery((function(d){d(document).ajaxComplete((function(){N()}))}))})()})();