stripe-pwa-elements 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/cjs/{factory-tenFFIul.js → factory-Cm6zUD7R.js} +7 -1
  2. package/dist/cjs/{i18n-FhEOc8vz.js → i18n-lBbOeQt4.js} +6 -0
  3. package/dist/cjs/ion-icon_2.cjs.entry.js +5 -3
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/stripe-address-element.cjs.entry.js +2 -2
  6. package/dist/cjs/stripe-card-element.cjs.entry.js +2 -2
  7. package/dist/cjs/stripe-currency-selector.cjs.entry.js +2 -2
  8. package/dist/cjs/stripe-elements.cjs.js +1 -1
  9. package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +2 -2
  10. package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +2 -2
  11. package/dist/cjs/stripe-payment-element.cjs.entry.js +3 -3
  12. package/dist/cjs/{stripe-payment-element.helpers-DukP33RI.js → stripe-payment-element.helpers-CvAhIqLt.js} +4 -7
  13. package/dist/cjs/stripe-payment-sheet.cjs.entry.js +516 -35
  14. package/dist/collection/components/stripe-address-element/stripe-address-element.js +2 -2
  15. package/dist/collection/components/stripe-modal/stripe-modal.css +4 -0
  16. package/dist/collection/components/stripe-modal/stripe-modal.js +3 -1
  17. package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +4 -7
  18. package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +4 -4
  19. package/dist/collection/components/stripe-payment-sheet/payment-sheet-state.js +21 -7
  20. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.checkout.js +94 -0
  21. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.helpers.js +193 -9
  22. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +240 -21
  23. package/dist/collection/services/link-authentication-element-manager.js +5 -0
  24. package/dist/collection/utils/i18n.js +6 -0
  25. package/dist/components/factory.js +1 -1
  26. package/dist/components/i18n.js +1 -1
  27. package/dist/components/stripe-modal2.js +1 -1
  28. package/dist/components/stripe-payment-element.helpers.js +1 -1
  29. package/dist/components/stripe-payment-sheet.js +1 -1
  30. package/dist/esm/{factory-Cd6OGTWN.js → factory-BaGv8K_i.js} +7 -2
  31. package/dist/esm/{i18n-B6JoQetF.js → i18n-CL5n3bOb.js} +6 -0
  32. package/dist/esm/ion-icon_2.entry.js +5 -3
  33. package/dist/esm/loader.js +1 -1
  34. package/dist/esm/stripe-address-element.entry.js +2 -2
  35. package/dist/esm/stripe-card-element.entry.js +2 -2
  36. package/dist/esm/stripe-currency-selector.entry.js +2 -2
  37. package/dist/esm/stripe-elements.js +1 -1
  38. package/dist/esm/stripe-express-checkout-element.entry.js +2 -2
  39. package/dist/esm/stripe-link-authentication-element.entry.js +2 -2
  40. package/dist/esm/stripe-payment-element.entry.js +3 -3
  41. package/dist/esm/{stripe-payment-element.helpers-CipV87b8.js → stripe-payment-element.helpers-Bu9RfxS4.js} +4 -7
  42. package/dist/esm/stripe-payment-sheet.entry.js +516 -35
  43. package/dist/stripe-elements/{p-f892e375.entry.js → p-2e41699e.entry.js} +1 -1
  44. package/dist/stripe-elements/{p-6a9c8b7a.entry.js → p-3fc4583a.entry.js} +1 -1
  45. package/dist/stripe-elements/{p-915b86ed.entry.js → p-7e826964.entry.js} +1 -1
  46. package/dist/stripe-elements/p-BhKXGROE.js +1 -0
  47. package/dist/stripe-elements/p-CL5n3bOb.js +1 -0
  48. package/dist/stripe-elements/{p-C7MQk9FK.js → p-DlMEZwSe.js} +1 -1
  49. package/dist/stripe-elements/{p-b06a254f.entry.js → p-a395a5d1.entry.js} +1 -1
  50. package/dist/stripe-elements/{p-5338bc5e.entry.js → p-b62c9dae.entry.js} +1 -1
  51. package/dist/stripe-elements/p-b7c20e8e.entry.js +1 -0
  52. package/dist/stripe-elements/{p-b91c4fa7.entry.js → p-bec62526.entry.js} +1 -1
  53. package/dist/stripe-elements/{p-7fe4a287.entry.js → p-f5552c81.entry.js} +1 -1
  54. package/dist/stripe-elements/stripe-elements.esm.js +1 -1
  55. package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +7 -2
  56. package/dist/types/components/stripe-payment-sheet/payment-sheet-state.d.ts +21 -4
  57. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.checkout.d.ts +39 -0
  58. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.d.ts +50 -5
  59. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.helpers.d.ts +66 -8
  60. package/dist/types/components.d.ts +22 -9
  61. package/dist/types/services/interfaces.d.ts +2 -0
  62. package/package.json +4 -2
  63. package/readme.md +17 -0
  64. package/dist/stripe-elements/p-B6JoQetF.js +0 -1
  65. package/dist/stripe-elements/p-DFAhQS0n.js +0 -1
  66. package/dist/stripe-elements/p-e7372ca7.entry.js +0 -1
@@ -1 +1 @@
1
- const t=t=>Object.keys(c).filter((i=>c[i](t))),i=t=>!!a(t,/iPad/i)||!(!a(t,/Macintosh/i)||!s(t)),e=t=>a(t,/android|sink/i),s=t=>h(t,"(any-pointer:coarse)"),n=t=>o(t)||r(t),o=t=>!!(t.cordova||t.phonegap||t.PhoneGap),r=t=>{const i=t.Capacitor;return!(!i||!i.isNative)},a=(t,i)=>i.test(t.navigator.userAgent),h=(t,i)=>t.matchMedia(i).matches,c={ipad:i,iphone:t=>a(t,/iPhone/i),ios:t=>a(t,/iPhone|iPod/i)||i(t),android:e,phablet:t=>{const i=t.innerWidth,e=t.innerHeight,s=Math.min(i,e),n=Math.max(i,e);return s>390&&s<520&&n>620&&n<800},tablet:t=>{const s=t.innerWidth,n=t.innerHeight,o=Math.min(s,n),r=Math.max(s,n);return i(t)||(t=>e(t)&&!a(t,/mobile/i))(t)||o>460&&o<820&&r>780&&r<1400},cordova:o,capacitor:r,electron:t=>a(t,/electron/i),pwa:t=>!(!t.matchMedia("(display-mode: standalone)").matches&&!t.navigator.standalone),mobile:s,mobileweb:t=>s(t)&&!n(t),desktop:t=>!s(t),hybrid:n},l=()=>{const i=((i=window)=>{if(void 0===i)return[];i.Ionic=i.Ionic||{};let e=i.Ionic.platforms;return null==e&&(e=i.Ionic.platforms=t(i),e.forEach((t=>i.document.documentElement.classList.add(`plt-${t}`)))),e})(undefined);return i.includes("ios")?"ios":i.includes("android")?"android":void 0},u=t=>"string"==typeof t,d=()=>{let t,i;const e=new Promise(((e,s)=>{t=e,i=s}));return e.resolve=t,e.reject=i,e},f=t=>null==t?"":""+t,p=/###/g,g=t=>t&&t.indexOf("###")>-1?t.replace(p,"."):t,y=t=>!t||u(t),m=(t,i,e)=>{const s=u(i)?i.split("."):i;let n=0;for(;n<s.length-1;){if(y(t))return{};const i=g(s[n]);!t[i]&&e&&(t[i]=new e),t=Object.prototype.hasOwnProperty.call(t,i)?t[i]:{},++n}return y(t)?{}:{obj:t,k:g(s[n])}},v=(t,i,e)=>{const{obj:s,k:n}=m(t,i,Object);if(void 0!==s||1===i.length)return void(s[n]=e);let o=i[i.length-1],r=i.slice(0,i.length-1),a=m(t,r,Object);for(;void 0===a.obj&&r.length;)o=`${r[r.length-1]}.${o}`,r=r.slice(0,r.length-1),a=m(t,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=e},w=(t,i)=>{const{obj:e,k:s}=m(t,i);if(e&&Object.prototype.hasOwnProperty.call(e,s))return e[s]},b=(t,i,e)=>{for(const s in i)"__proto__"!==s&&"constructor"!==s&&(s in t?u(t[s])||t[s]instanceof String||u(i[s])||i[s]instanceof String?e&&(t[s]=i[s]):b(t[s],i[s],e):t[s]=i[s]);return t},$=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const k=t=>u(t)?t.replace(/[&<>"'\/]/g,(t=>x[t])):t,S=[" ",",","?","!",";"],j=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const i=this.regExpMap.get(t);if(void 0!==i)return i;const e=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,e),this.regExpQueue.push(t),e}}(20),O=(t,i,e=".")=>{if(!t)return;if(t[i]){if(!Object.prototype.hasOwnProperty.call(t,i))return;return t[i]}const s=i.split(e);let n=t;for(let t=0;t<s.length;){if(!n||"object"!=typeof n)return;let i,o="";for(let r=t;r<s.length;++r)if(r!==t&&(o+=e),o+=s[r],i=n[o],void 0!==i){if(["string","number","boolean"].indexOf(typeof i)>-1&&r<s.length-1)continue;t+=r-t+1;break}n=i}return n},L=t=>t?.replace(/_/g,"-"),N={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,i){console?.[t]?.apply?.(console,i)}};class C{constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||N,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,e,s){return s&&!this.debug?null:(u(t[0])&&(t[0]=`${e}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new C(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new C(this.logger,t)}}var P=new C;class A{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const e=this.observers[t].get(i)||0;this.observers[t].set(i,e+1)})),this}off(t,i){this.observers[t]&&(i?this.observers[t].delete(i):delete this.observers[t])}emit(t,...i){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,e])=>{for(let s=0;s<e;s++)t(...i)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([e,s])=>{for(let n=0;n<s;n++)e.apply(e,[t,...i])}))}}class R extends A{constructor(t,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,e,s={}){const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,o=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;t.indexOf(".")>-1?r=t.split("."):(r=[t,i],e&&(Array.isArray(e)?r.push(...e):u(e)&&n?r.push(...e.split(n)):r.push(e)));const a=w(this.data,r);return!a&&!i&&!e&&t.indexOf(".")>-1&&(t=r[0],i=r[1],e=r.slice(2).join(".")),!a&&o&&u(e)?O(this.data?.[t]?.[i],e,n):a}addResource(t,i,e,s,n={silent:!1}){const o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let r=[t,i];e&&(r=r.concat(o?e.split(o):e)),t.indexOf(".")>-1&&(r=t.split("."),s=i,i=r[1]),this.addNamespaces(i),v(this.data,r,s),n.silent||this.emit("added",t,i,e,s)}addResources(t,i,e,s={silent:!1}){for(const s in e)(u(e[s])||Array.isArray(e[s]))&&this.addResource(t,i,s,e[s],{silent:!0});s.silent||this.emit("added",t,i,e)}addResourceBundle(t,i,e,s,n,o={silent:!1,skipCopy:!1}){let r=[t,i];t.indexOf(".")>-1&&(r=t.split("."),s=e,e=i,i=r[1]),this.addNamespaces(i);let a=w(this.data,r)||{};o.skipCopy||(e=JSON.parse(JSON.stringify(e))),s?b(a,e,n):a={...a,...e},v(this.data,r,a),o.silent||this.emit("added",t,i,e)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return void 0!==this.getResource(t,i)}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find((t=>i[t]&&Object.keys(i[t]).length>0))}toJSON(){return this.data}}var I={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,i,e,s,n){return t.forEach((t=>{i=this.processors[t]?.process(i,e,s,n)??i})),i}};const E=Symbol("i18next/PATH_KEY");function T(t,i){const{[E]:e}=t(function(){const t=[],i=Object.create(null);let e;return i.get=(s,n)=>(e?.revoke?.(),n===E?t:(t.push(n),e=Proxy.revocable(s,i),e.proxy)),Proxy.revocable(Object.create(null),i).proxy}()),s=i?.keySeparator??".",n=i?.nsSeparator??":";if(e.length>1&&n){const t=i?.ns,o=Array.isArray(t)?t:null;if(o&&o.length>1&&o.slice(1).includes(e[0]))return`${e[0]}${n}${e.slice(1).join(s)}`}return e.join(s)}const M={},z=t=>!u(t)&&"boolean"!=typeof t&&"number"!=typeof t;class F extends A{constructor(t,i={}){var e,s;super(),e=t,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{e[t]&&(s[t]=e[t])})),this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=P.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){const e={...i};if(null==t)return!1;const s=this.resolve(t,e);if(void 0===s?.res)return!1;const n=z(s.res);return!1!==e.returnObjects||!n}extractFromKey(t,i){let e=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===e&&(e=":");const s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let n=i.ns||this.options.defaultNS||[];const o=e&&t.indexOf(e)>-1,r=!(this.options.userDefinedKeySeparator||i.keySeparator||this.options.userDefinedNsSeparator||i.nsSeparator||((t,i,e)=>{i=i||"",e=e||"";const s=S.filter((t=>i.indexOf(t)<0&&e.indexOf(t)<0));if(0===s.length)return!0;const n=j.getRegExp(`(${s.map((t=>"?"===t?"\\?":t)).join("|")})`);let o=!n.test(t);if(!o){const i=t.indexOf(e);i>0&&!n.test(t.substring(0,i))&&(o=!0)}return o})(t,e,s));if(o&&!r){const i=t.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:t,namespaces:u(n)?[n]:n};const o=t.split(e);(e!==s||e===s&&this.options.ns.indexOf(o[0])>-1)&&(n=o.shift()),t=o.join(s)}return{key:t,namespaces:u(n)?[n]:n}}translate(t,i,e){let s="object"==typeof i?{...i}:i;if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==t)return"";"function"==typeof t&&(t=T(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]),t=t.map((t=>"function"==typeof t?T(t,{...this.options,...s}):String(t)));const n=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,o=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:r,namespaces:a}=this.extractFromKey(t[t.length-1],s),h=a[a.length-1];let c=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const l=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===l?.toLowerCase())return d?n?{res:`${h}${c}${r}`,usedKey:r,exactUsedKey:r,usedLng:l,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:`${h}${c}${r}`:n?{res:r,usedKey:r,exactUsedKey:r,usedLng:l,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:r;const f=this.resolve(t,s);let p=f?.res;const g=f?.usedKey||r,y=f?.exactUsedKey||r,m=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,w=void 0!==s.count&&!u(s.count),b=F.hasDefaultValue(s),$=w?this.pluralResolver.getSuffix(l,s.count,s):"",x=s.ordinal&&w?this.pluralResolver.getSuffix(l,s.count,{ordinal:!1}):"",k=w&&!s.ordinal&&0===s.count,S=k&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${$}`]||s[`defaultValue${x}`]||s.defaultValue;let j=p;v&&!p&&b&&(j=S);const O=z(j),L=Object.prototype.toString.apply(j);if(!(v&&j&&O&&["[object Number]","[object Function]","[object RegExp]"].indexOf(L)<0)||u(m)&&Array.isArray(j))if(v&&u(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,t,s,e));else{let i=!1,n=!1;!this.isValidLookup(p)&&b&&(i=!0,p=S),this.isValidLookup(p)||(n=!0,p=r);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:p,u=b&&S!==p&&this.options.updateMissing;if(n||i||u){if(this.logger.log(u?"updateKey":"missingKey",l,h,r,u?S:p),o){const t=this.resolve(r,{...s,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let e=0;e<i.length;e++)t.push(i[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(s.lng||this.language):t.push(s.lng||this.language);const e=(t,i,e)=>{const n=b&&e!==p?e:a;this.options.missingKeyHandler?this.options.missingKeyHandler(t,h,i,n,u,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,h,i,n,u,s),this.emit("missingKey",t,h,i,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?t.forEach((t=>{const i=this.pluralResolver.getSuffixes(t,s);k&&s[`defaultValue${this.options.pluralSeparator}zero`]&&i.indexOf(`${this.options.pluralSeparator}zero`)<0&&i.push(`${this.options.pluralSeparator}zero`),i.forEach((i=>{e([t],r+i,s[`defaultValue${i}`]||S)}))})):e(t,r,S))}p=this.extendTranslation(p,t,s,f,e),n&&p===r&&this.options.appendNamespaceToMissingKey&&(p=`${h}${c}${r}`),(n||i)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${c}${r}`:r,i?p:void 0,s))}else{if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,j,{...s,ns:a}):`key '${r} (${this.language})' returned an object instead of string.`;return n?(f.res=t,f.usedParams=this.getUsedParamsDetails(s),f):t}if(o){const t=Array.isArray(j),i=t?[]:{},e=t?y:g;for(const t in j)if(Object.prototype.hasOwnProperty.call(j,t)){const n=`${e}${o}${t}`;i[t]=this.translate(n,b&&!p?{...s,defaultValue:z(S)?S[t]:void 0,joinArrays:!1,ns:a}:{...s,joinArrays:!1,ns:a}),i[t]===n&&(i[t]=j[t])}p=i}}return n?(f.res=p,f.usedParams=this.getUsedParamsDetails(s),f):p}extendTranslation(t,i,e,s,n){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...e},e.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!e.skipInterpolation){e.interpolation&&this.interpolator.init({...e,interpolation:{...this.options.interpolation,...e.interpolation}});const o=u(t)&&(void 0!==e?.interpolation?.skipOnVariables?e.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(o){const i=t.match(this.interpolator.nestingRegexp);r=i&&i.length}let a=e.replace&&!u(e.replace)?e.replace:e;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,e.lng||this.language||s.usedLng,e),o){const i=t.match(this.interpolator.nestingRegexp);r<(i&&i.length)&&(e.nest=!1)}!e.lng&&s&&s.res&&(e.lng=this.language||s.usedLng),!1!==e.nest&&(t=this.interpolator.nest(t,((...t)=>n?.[0]!==t[0]||e.context?this.translate(...t,i):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${i[0]}`),null)),e)),e.interpolation&&this.interpolator.reset()}const o=e.postProcess||this.options.postProcess,r=u(o)?[o]:o;return null!=t&&r?.length&&!1!==e.applyPostProcessor&&(t=I.handle(r,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(e)},...e}:e,this)),t}resolve(t,i={}){let e,s,n,o,r;return u(t)&&(t=[t]),Array.isArray(t)&&(t=t.map((t=>"function"==typeof t?T(t,{...this.options,...i}):t))),t.forEach((t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,i),h=a.key;s=h;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const l=void 0!==i.count&&!u(i.count),d=l&&!i.ordinal&&0===i.count,f=void 0!==i.context&&(u(i.context)||"number"==typeof i.context)&&""!==i.context,p=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);c.forEach((t=>{this.isValidLookup(e)||(r=t,M[`${p[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(r)||(M[`${p[0]}-${t}`]=!0,this.logger.warn(`key "${s}" for languages "${p.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((s=>{if(this.isValidLookup(e))return;o=s;const r=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(r,h,s,t,i);else{let t;l&&(t=this.pluralResolver.getSuffix(s,i.count,i));const e=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(l&&(i.ordinal&&0===t.indexOf(n)&&r.push(h+t.replace(n,this.options.pluralSeparator)),r.push(h+t),d&&r.push(h+e)),f){const s=`${h}${this.options.contextSeparator||"_"}${i.context}`;r.push(s),l&&(i.ordinal&&0===t.indexOf(n)&&r.push(s+t.replace(n,this.options.pluralSeparator)),r.push(s+t),d&&r.push(s+e))}}let a;for(;a=r.pop();)this.isValidLookup(e)||(n=a,e=this.getResource(s,t,a,i))})))}))})),{res:e,usedKey:s,exactUsedKey:n,usedLng:o,usedNS:r}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,i,e,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,e,s):this.resourceStore.getResource(t,i,e,s)}getUsedParamsDetails(t={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],e=t.replace&&!u(t.replace);let s=e?t.replace:t;if(e&&void 0!==t.count&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!e){s={...s};for(const t of i)delete s[t]}return s}static hasDefaultValue(t){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&"defaultValue"===i.substring(0,12)&&void 0!==t[i])return!0;return!1}}class V{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P.create("languageUtils")}getScriptPartFromCode(t){if(!(t=L(t))||t.indexOf("-")<0)return null;const i=t.split("-");return 2===i.length?null:(i.pop(),"x"===i[i.length-1].toLowerCase()?null:this.formatLanguageCode(i.join("-")))}getLanguagePartFromCode(t){if(!(t=L(t))||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(u(t)&&t.indexOf("-")>-1){let i;try{i=Intl.getCanonicalLocales(t)[0]}catch(t){}return i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach((t=>{if(i)return;const e=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(e)||(i=e)})),!i&&this.options.supportedLngs&&t.forEach((t=>{if(i)return;const e=this.getScriptPartFromCode(t);if(this.isSupportedCode(e))return i=e;const s=this.getLanguagePartFromCode(t);if(this.isSupportedCode(s))return i=s;i=this.options.supportedLngs.find((t=>t===s?t:t.indexOf("-")<0&&s.indexOf("-")<0?void 0:t.indexOf("-")>0&&s.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===s||0===t.indexOf(s)&&s.length>1?t:void 0))})),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if("function"==typeof t&&(t=t(i)),u(t)&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let e=t[i];return e||(e=t[this.getScriptPartFromCode(i)]),e||(e=t[this.formatLanguageCode(i)]),e||(e=t[this.getLanguagePartFromCode(i)]),e||(e=t.default),e||[]}toResolveHierarchy(t,i){const e=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],t),s=[],n=t=>{t&&(this.isSupportedCode(t)?s.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return u(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&n(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&n(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&n(this.getLanguagePartFromCode(t))):u(t)&&n(this.formatLanguageCode(t)),e.forEach((t=>{s.indexOf(t)<0&&n(this.formatLanguageCode(t))})),s}}const D={zero:0,one:1,two:2,few:3,many:4,other:5},B={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class K{constructor(t,i={}){this.languageUtils=t,this.options=i,this.logger=P.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,i={}){const e=L("dev"===t?"en":t),s=i.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:e,type:s});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let o;try{o=new Intl.PluralRules(e,{type:s})}catch(e){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),B;if(!t.match(/-|_/))return B;const s=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(s,i)}return this.pluralRulesCache[n]=o,o}needsPlural(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,i,e={}){return this.getSuffixes(t,e).map((t=>`${i}${t}`))}getSuffixes(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?e.resolvedOptions().pluralCategories.sort(((t,i)=>D[t]-D[i])).map((t=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,i,e={}){const s=this.getRule(t,e);return s?`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${s.select(i)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",i,e))}}const _=(t,i,e,s=".",n=!0)=>{let o=((t,i,e)=>{const s=w(t,e);return void 0!==s?s:w(i,e)})(t,i,e);return!o&&n&&u(e)&&(o=O(t,e,s),void 0===o&&(o=O(i,e,s))),o},U=t=>t.replace(/\$/g,"$$$$");class H{constructor(t={}){this.logger=P.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:i,escapeValue:e,useRawValueToEscape:s,prefix:n,prefixEscaped:o,suffix:r,suffixEscaped:a,formatSeparator:h,unescapeSuffix:c,unescapePrefix:l,nestingPrefix:u,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:m}=t.interpolation;this.escape=void 0!==i?i:k,this.escapeValue=void 0===e||e,this.useRawValueToEscape=void 0!==s&&s,this.prefix=n?$(n):o||"{{",this.suffix=r?$(r):a||"}}",this.formatSeparator=h||",",this.unescapePrefix=c?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?$(u):d||$("$t("),this.nestingSuffix=f?$(f):p||$(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,e,s){let n,o,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=t=>{if(t.indexOf(this.formatSeparator)<0){const n=_(i,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,e,{...s,...i,interpolationkey:t}):n}const n=t.split(this.formatSeparator),o=n.shift().trim(),r=n.join(this.formatSeparator).trim();return this.format(_(i,a,o,this.options.keySeparator,this.options.ignoreJSONStructure),r,e,{...s,...i,interpolationkey:o})};this.resetRegExp();const c=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,l=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>U(t)},{regex:this.regexp,safeValue:t=>U(this.escapeValue?this.escape(t):t)}].forEach((i=>{for(r=0;n=i.regex.exec(t);){const e=n[1].trim();if(o=h(e),void 0===o)if("function"==typeof c){const i=c(t,n,s);o=u(i)?i:""}else if(s&&Object.prototype.hasOwnProperty.call(s,e))o="";else{if(l){o=n[0];continue}this.logger.warn(`missed to pass in variable ${e} for interpolating ${t}`),o=""}else u(o)||this.useRawValueToEscape||(o=f(o));const a=i.safeValue(o);if(t=t.replace(n[0],a),l?(i.regex.lastIndex+=o.length,i.regex.lastIndex-=n[0].length):i.regex.lastIndex=0,r++,r>=this.maxReplaces)break}})),t}nest(t,i,e={}){let s,n,o;const r=(t,i)=>{const e=this.nestingOptionsSeparator;if(t.indexOf(e)<0)return t;const s=t.split(new RegExp(`${$(e)}[ ]*{`));let n=`{${s[1]}`;t=s[0],n=this.interpolate(n,o);const r=n.match(/'/g),a=n.match(/"/g);((r?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(n=n.replace(/'/g,'"'));try{o=JSON.parse(n),i&&(o={...i,...o})}catch(i){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,i),`${t}${e}${n}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,t};for(;s=this.nestingRegexp.exec(t);){let a=[];o={...e},o=o.replace&&!u(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const h=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(-1!==h&&(a=s[1].slice(h).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),s[1]=s[1].slice(0,h)),n=i(r.call(this,s[1].trim(),o),o),n&&s[0]===t&&!u(n))return n;u(n)||(n=f(n)),n||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),n=""),a.length&&(n=a.reduce(((t,i)=>this.format(t,i,e.lng,{...e,interpolationkey:s[1].trim()})),n.trim())),t=t.replace(s[0],n),this.regexp.lastIndex=0}return t}}const Y=t=>{const i={};return(e,s,n)=>{let o=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(o={...o,[n.interpolationkey]:void 0});const r=s+JSON.stringify(o);let a=i[r];return a||(a=t(L(s),n),i[r]=a),a(e)}},J=t=>(i,e,s)=>t(L(e),s)(i);class q{constructor(t={}){this.logger=P.create("formatter"),this.options=t,this.init(t)}init(t,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";const e=i.cacheInBuiltFormats?Y:J;this.formats={number:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i});return t=>e.format(t)})),currency:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i,style:"currency"});return t=>e.format(t)})),datetime:e(((t,i)=>{const e=new Intl.DateTimeFormat(t,{...i});return t=>e.format(t)})),relativetime:e(((t,i)=>{const e=new Intl.RelativeTimeFormat(t,{...i});return t=>e.format(t,i.range||"day")})),list:e(((t,i)=>{const e=new Intl.ListFormat(t,{...i});return t=>e.format(t)}))}}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=Y(i)}format(t,i,e,s={}){const n=i.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find((t=>t.indexOf(")")>-1))){const t=n.findIndex((t=>t.indexOf(")")>-1));n[0]=[n[0],...n.splice(1,t)].join(this.formatSeparator)}return n.reduce(((t,i)=>{const{formatName:n,formatOptions:o}=(t=>{let i=t.toLowerCase().trim();const e={};if(t.indexOf("(")>-1){const s=t.split("(");i=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);"currency"===i&&n.indexOf(":")<0?e.currency||(e.currency=n.trim()):"relativetime"===i&&n.indexOf(":")<0?e.range||(e.range=n.trim()):n.split(";").forEach((t=>{if(t){const[i,...s]=t.split(":"),n=s.join(":").trim().replace(/^'+|'+$/g,""),o=i.trim();e[o]||(e[o]=n),"false"===n&&(e[o]=!1),"true"===n&&(e[o]=!0),isNaN(n)||(e[o]=parseInt(n,10))}}))}return{formatName:i,formatOptions:e}})(i);if(this.formats[n]){let i=t;try{const r=s?.formatParams?.[s.interpolationkey]||{};i=this.formats[n](t,r.locale||r.lng||s.locale||s.lng||e,{...o,...s,...r})}catch(t){this.logger.warn(t)}return i}return this.logger.warn(`there was no format function for ${n}`),t}),t)}}class W extends A{constructor(t,i,e,s={}){super(),this.backend=t,this.store=i,this.services=e,this.languageUtils=e.languageUtils,this.options=s,this.logger=P.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(e,s.backend,s)}queueLoad(t,i,e,s){const n={},o={},r={},a={};return t.forEach((t=>{let s=!0;i.forEach((i=>{const r=`${t}|${i}`;!e.reload&&this.store.hasResourceBundle(t,i)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,s=!1,void 0===o[r]&&(o[r]=!0),void 0===n[r]&&(n[r]=!0),void 0===a[i]&&(a[i]=!0)))})),s||(r[t]=!0)})),(Object.keys(n).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(n),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(t,i,e){const s=t.split("|"),n=s[0],o=s[1];i&&this.emit("failedLoading",n,o,i),!i&&e&&this.store.addResourceBundle(n,o,e,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2,i&&e&&(this.state[t]=0);const r={};this.queue.forEach((e=>{((t,i,e)=>{const{obj:s,k:n}=m(t,i,Object);s[n]=s[n]||[],s[n].push(e)})(e.loaded,[n],o),((t,i)=>{void 0!==t.pending[i]&&(delete t.pending[i],t.pendingCount--)})(e,t),i&&e.errors.push(i),0!==e.pendingCount||e.done||(Object.keys(e.loaded).forEach((t=>{r[t]||(r[t]={});const i=e.loaded[t];i.length&&i.forEach((i=>{void 0===r[t][i]&&(r[t][i]=!0)}))})),e.done=!0,e.errors.length?e.callback(e.errors):e.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((t=>!t.done))}read(t,i,e,s=0,n=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:i,fcName:e,tried:s,wait:n,callback:o});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}r&&a&&s<this.maxRetries?setTimeout((()=>{this.read.call(this,t,i,e,s+1,2*n,o)}),n):o(r,a)},a=this.backend[e].bind(this.backend);if(2!==a.length)return a(t,i,r);try{const e=a(t,i);e&&"function"==typeof e.then?e.then((t=>r(null,t))).catch(r):r(null,e)}catch(t){r(t)}}prepareLoading(t,i,e={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();u(t)&&(t=this.languageUtils.toResolveHierarchy(t)),u(i)&&(i=[i]);const n=this.queueLoad(t,i,e,s);if(!n.toLoad.length)return n.pending.length||s(),null;n.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,i,e){this.prepareLoading(t,i,{},e)}reload(t,i,e){this.prepareLoading(t,i,{reload:!0},e)}loadOne(t,i=""){const e=t.split("|"),s=e[0],n=e[1];this.read(s,n,"read",void 0,void 0,((e,o)=>{e&&this.logger.warn(`${i}loading namespace ${n} for language ${s} failed`,e),!e&&o&&this.logger.log(`${i}loaded namespace ${n} for language ${s}`,o),this.loaded(t,e,o)}))}saveMissing(t,i,e,s,n,o={},r=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(i)){if(null!=e&&""!==e){if(this.backend?.create){const a={...o,isUpdate:n},h=this.backend.create.bind(this.backend);if(h.length<6)try{let n;n=5===h.length?h(t,i,e,s,a):h(t,i,e,s),n&&"function"==typeof n.then?n.then((t=>r(null,t))).catch(r):r(null,n)}catch(t){r(t)}else h(t,i,e,s,r,a)}t&&t[0]&&this.store.addResource(t[0],i,e,s)}}else this.logger.warn(`did not save key "${e}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const G=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let i={};if("object"==typeof t[1]&&(i=t[1]),u(t[1])&&(i.defaultValue=t[1]),u(t[2])&&(i.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const e=t[3]||t[2];Object.keys(e).forEach((t=>{i[t]=e[t]}))}return i},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Q=t=>(u(t.ns)&&(t.ns=[t.ns]),u(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),u(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),Z=()=>{},X="__i18next_supportNoticeShown";class tt extends A{constructor(t={},i){var e;if(super(),this.options=Q(t),this.services={},this.logger=P,this.modules={external:[]},e=this,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout((()=>{this.init(t,i)}),0)}}init(t={},i){this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),null==t.defaultNS&&t.ns&&(u(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const e=G();var s;this.options={...e,...this.options,...Q(t)},this.options.interpolation={...e.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=e.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(s=this,s?.modules?.backend?.name?.indexOf("Locize")>0||s?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||s?.options?.backend?.backends&&s.options.backend.backends.some((t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0))||s?.options?.backend?.projectId||s?.options?.backend?.backendOptions&&s.options.backend.backendOptions.some((t=>t?.projectId)))||"undefined"!=typeof globalThis&&globalThis[X]||"undefined"!=typeof process&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||"undefined"!=typeof process&&process.env||("undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"undefined"!=typeof globalThis&&(globalThis[X]=!0));const n=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;P.init(this.modules.logger?n(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:q;const i=new V(this.options);this.store=new R(this.options.resources,this.options);const s=this.services;s.logger=P,s.resourceStore=this.store,s.languageUtils=i,s.pluralResolver=new K(i,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format||(s.formatter=n(t),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new H(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new W(n(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.languageDetector&&(s.languageDetector=n(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=n(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new F(this.services,this.options),this.translator.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,i||(i=Z),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=(...i)=>this.store[t](...i)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...i)=>(this.store[t](...i),this)}));const o=d(),r=()=>{const t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(e),i(t,e)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),o}loadResources(t,i=Z){let e=i;const s=u(t)?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===s?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],i=i=>{i&&"cimode"!==i&&this.services.languageUtils.toResolveHierarchy(i).forEach((i=>{"cimode"!==i&&t.indexOf(i)<0&&t.push(i)}))};s?i(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>i(t))),this.options.preload?.forEach?.((t=>i(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,i,e){const s=d();return"function"==typeof t&&(e=t,t=void 0),"function"==typeof i&&(e=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),e||(e=Z),this.services.backendConnector.reload(t,i,(t=>{s.resolve(),e(t)})),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&I.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;const e=d();this.emit("languageChanging",t);const s=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},n=(n,o)=>{o?this.isLanguageChangingTo===t&&(s(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,e.resolve(((...t)=>this.t(...t))),i&&i(n,((...t)=>this.t(...t)))},o=i=>{t||i||!this.services.languageDetector||(i=[]);const e=u(i)?i:i&&i[0],o=this.store.hasLanguageSomeTranslations(e)?e:this.services.languageUtils.getBestMatchFromCodes(u(i)?[i]:i);o&&(this.language||s(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,(t=>{n(t,o)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t):o(this.services.languageDetector.detect()),e}getFixedT(t,i,e){const s=(t,i,...n)=>{let o;o="object"!=typeof i?this.options.overloadTranslationOptionHandler([t,i].concat(n)):{...i},o.lng=o.lng||s.lng,o.lngs=o.lngs||s.lngs,o.ns=o.ns||s.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||e||s.keyPrefix);const r={...this.options,...o};"function"==typeof o.keyPrefix&&(o.keyPrefix=T(o.keyPrefix,r));const a=this.options.keySeparator||".";let h;return o.keyPrefix&&Array.isArray(t)?h=t.map((t=>("function"==typeof t&&(t=T(t,r)),`${o.keyPrefix}${a}${t}`))):("function"==typeof t&&(t=T(t,r)),h=o.keyPrefix?`${o.keyPrefix}${a}${t}`:t),this.t(h,o)};return u(t)?s.lng=t:s.lngs=t,s.ns=i,s.keyPrefix=e,s}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const e=i.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===e.toLowerCase())return!0;const o=(t,i)=>{const e=this.services.backendConnector.state[`${t}|${i}`];return-1===e||0===e||2===e};if(i.precheck){const t=i.precheck(this,o);if(void 0!==t)return t}return!(!this.hasResourceBundle(e,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(e,t)||s&&!o(n,t)))}loadNamespaces(t,i){const e=d();return this.options.ns?(u(t)&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}loadLanguages(t,i){const e=d();u(t)&&(t=[t]);const s=this.options.preload||[],n=t.filter((t=>s.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return n.length?(this.options.preload=s.concat(n),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const t=i.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const i=this.services?.languageUtils||new V(G());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){const e=new tt(t,i);return e.createInstance=tt.createInstance,e}cloneInstance(t={},i=Z){const e=t.forkResourceStore;e&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},n=new tt(s);if(void 0===t.debug&&void 0===t.prefix||(n.logger=n.logger.clone(t)),["store","services","language"].forEach((t=>{n[t]=this[t]})),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},e){const t=Object.keys(this.store.data).reduce(((t,i)=>(t[i]={...this.store.data[i]},t[i]=Object.keys(t[i]).reduce(((e,s)=>(e[s]={...t[i][s]},e)),t[i]),t)),{});n.store=new R(t,s),n.services.resourceStore=n.store}if(t.interpolation){const i={...G().interpolation,...this.options.interpolation,...t.interpolation},e={...s,interpolation:i};n.services.interpolator=new H(e)}return n.translator=new F(n.services,s),n.translator.on("*",((t,...i)=>{n.emit(t,...i)})),n.init(s,i),n.translator.options=s,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const it=tt.createInstance(),{slice:et,forEach:st}=[],nt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ot={create(t,i,e,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};e&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+60*e*1e3)),s&&(n.domain=s),document.cookie=function(t,i){const e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${t}=${encodeURIComponent(i)}`;if(e.maxAge>0){const t=e.maxAge-0;if(Number.isNaN(t))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(t)}`}if(e.domain){if(!nt.test(e.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${e.domain}`}if(e.path){if(!nt.test(e.path))throw new TypeError("option path is invalid");s+=`; Path=${e.path}`}if(e.expires){if("function"!=typeof e.expires.toUTCString)throw new TypeError("option expires is invalid");s+=`; Expires=${e.expires.toUTCString()}`}if(e.httpOnly&&(s+="; HttpOnly"),e.secure&&(s+="; Secure"),e.sameSite)switch("string"==typeof e.sameSite?e.sameSite.toLowerCase():e.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return e.partitioned&&(s+="; Partitioned"),s}(t,i,n)},read(t){const i=`${t}=`,e=document.cookie.split(";");for(let t=0;t<e.length;t++){let s=e[t];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(i))return s.substring(i.length,s.length)}return null},remove(t,i){this.create(t,"",-1,i)}};var rt={name:"cookie",lookup(t){let{lookupCookie:i}=t;if(i&&"undefined"!=typeof document)return ot.read(i)||void 0},cacheUserLanguage(t,i){let{lookupCookie:e,cookieMinutes:s,cookieDomain:n,cookieOptions:o}=i;e&&"undefined"!=typeof document&&ot.create(e,t,s,n,o)}},at={name:"querystring",lookup(t){let i,{lookupQuerystring:e}=t;if("undefined"!=typeof window){let{search:t}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));const s=t.substring(1).split("&");for(let t=0;t<s.length;t++){const n=s[t].indexOf("=");n>0&&s[t].substring(0,n)===e&&(i=s[t].substring(n+1))}}return i}},ht={name:"hash",lookup(t){let i,{lookupHash:e,lookupFromHashIndex:s}=t;if("undefined"!=typeof window){const{hash:t}=window.location;if(t&&t.length>2){const n=t.substring(1);if(e){const t=n.split("&");for(let s=0;s<t.length;s++){const n=t[s].indexOf("=");n>0&&t[s].substring(0,n)===e&&(i=t[s].substring(n+1))}}if(i)return i;if(!i&&s>-1){const i=t.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(i))return;const e="number"==typeof s?s:0;return i[e]?.replace("/","")}}}return i}};let ct=null;const lt=()=>{if(null!==ct)return ct;try{if(ct="undefined"!=typeof window&&null!==window.localStorage,!ct)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){ct=!1}return ct};var ut={name:"localStorage",lookup(t){let{lookupLocalStorage:i}=t;if(i&&lt())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupLocalStorage:e}=i;e&&lt()&&window.localStorage.setItem(e,t)}};let dt=null;const ft=()=>{if(null!==dt)return dt;try{if(dt="undefined"!=typeof window&&null!==window.sessionStorage,!dt)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){dt=!1}return dt};var pt={name:"sessionStorage",lookup(t){let{lookupSessionStorage:i}=t;if(i&&ft())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupSessionStorage:e}=i;e&&ft()&&window.sessionStorage.setItem(e,t)}},gt={name:"navigator",lookup(t){const i=[];if("undefined"!=typeof navigator){const{languages:t,userLanguage:e,language:s}=navigator;if(t)for(let e=0;e<t.length;e++)i.push(t[e]);e&&i.push(e),s&&i.push(s)}return i.length>0?i:void 0}},yt={name:"htmlTag",lookup(t){let i,{htmlTag:e}=t;const s=e||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(i=s.getAttribute("lang")),i}},mt={name:"path",lookup(t){let{lookupFromPathIndex:i}=t;if("undefined"==typeof window)return;const e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(e))return;const s="number"==typeof i?i:0;return e[s]?.replace("/","")}},vt={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:i}=t;const e="number"==typeof i?i+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[e]}};let wt=!1;try{wt=!0}catch(t){}const bt=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];wt||bt.splice(1,1);class $t{constructor(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,i)}init(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},this.options=function(t){return st.call(et.call(arguments,1),(i=>{if(i)for(const e in i)void 0===t[e]&&(t[e]=i[e])})),t}(t,this.options||{},{order:bt,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=t=>t.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(rt),this.addDetector(at),this.addDetector(ut),this.addDetector(pt),this.addDetector(gt),this.addDetector(yt),this.addDetector(mt),this.addDetector(vt),this.addDetector(ht)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order).forEach((i=>{if(this.detectors[i]){let e=this.detectors[i].lookup(this.options);e&&"string"==typeof e&&(e=[e]),e&&(t=t.concat(e))}})),t=t.filter((t=>{return null!=t&&!("string"==typeof(i=t)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(i))));var i})).map((t=>this.options.convertDetectedLanguage(t))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||i.forEach((i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(t,this.options)})))}}$t.type="languageDetector",it.use($t).init({fallbackLng:"en",debug:!1,resources:{en:{translation:{}},ja:{translation:{Pay:"支払う","Failed to load Stripe":"ライブラリの読み込みに失敗しました。","Add your payment information":"支払情報を追加","Add card":"カードを追加","Add a card":"カードを追加",Add:"追加","Card information":"カード情報","Card Number":"カード番号","MM / YY":"月 / 年",CVC:"セキュリティコード(CVC)","Country or region":"地域","Postal Code":"郵便番号",Close:"閉じる",Loading:"読み込み中","Payment information":"支払情報","Billing address":"請求先住所",Save:"保存"}},"pt-BR":{translation:{Pay:"Pagar","Failed to load Stripe":"Falha ao ler Stripe","Add your payment information":"Informações do seu Pagamento","Add card":"Adicionar Cartão","Add a card":"Adicionar um Cartão",Add:"Adicionar","Card information":"Informações do Cartão","Card Number":"Número do Cartão","MM / YY":"MM / AA",CVC:"Número de Segurança(CVC)","Country or region":"País ou região","Postal Code":"Cep",Close:"Fechar"}}}});const xt=it;export{l as c,xt as i}
1
+ const t=t=>Object.keys(l).filter((e=>l[e](t))),e=t=>!!a(t,/iPad/i)||!(!a(t,/Macintosh/i)||!s(t)),i=t=>a(t,/android|sink/i),s=t=>h(t,"(any-pointer:coarse)"),n=t=>o(t)||r(t),o=t=>!!(t.cordova||t.phonegap||t.PhoneGap),r=t=>{const e=t.Capacitor;return!(!e||!e.isNative)},a=(t,e)=>e.test(t.navigator.userAgent),h=(t,e)=>t.matchMedia(e).matches,l={ipad:e,iphone:t=>a(t,/iPhone/i),ios:t=>a(t,/iPhone|iPod/i)||e(t),android:i,phablet:t=>{const e=t.innerWidth,i=t.innerHeight,s=Math.min(e,i),n=Math.max(e,i);return s>390&&s<520&&n>620&&n<800},tablet:t=>{const s=t.innerWidth,n=t.innerHeight,o=Math.min(s,n),r=Math.max(s,n);return e(t)||(t=>i(t)&&!a(t,/mobile/i))(t)||o>460&&o<820&&r>780&&r<1400},cordova:o,capacitor:r,electron:t=>a(t,/electron/i),pwa:t=>!(!t.matchMedia("(display-mode: standalone)").matches&&!t.navigator.standalone),mobile:s,mobileweb:t=>s(t)&&!n(t),desktop:t=>!s(t),hybrid:n},c=()=>{const e=((e=window)=>{if(void 0===e)return[];e.Ionic=e.Ionic||{};let i=e.Ionic.platforms;return null==i&&(i=e.Ionic.platforms=t(e),i.forEach((t=>e.document.documentElement.classList.add(`plt-${t}`)))),i})(undefined);return e.includes("ios")?"ios":e.includes("android")?"android":void 0},u=t=>"string"==typeof t,d=()=>{let t,e;const i=new Promise(((i,s)=>{t=i,e=s}));return i.resolve=t,i.reject=e,i},f=t=>null==t?"":""+t,p=/###/g,g=t=>t&&t.indexOf("###")>-1?t.replace(p,"."):t,y=t=>!t||u(t),m=(t,e,i)=>{const s=u(e)?e.split("."):e;let n=0;for(;n<s.length-1;){if(y(t))return{};const e=g(s[n]);!t[e]&&i&&(t[e]=new i),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++n}return y(t)?{}:{obj:t,k:g(s[n])}},v=(t,e,i)=>{const{obj:s,k:n}=m(t,e,Object);if(void 0!==s||1===e.length)return void(s[n]=i);let o=e[e.length-1],r=e.slice(0,e.length-1),a=m(t,r,Object);for(;void 0===a.obj&&r.length;)o=`${r[r.length-1]}.${o}`,r=r.slice(0,r.length-1),a=m(t,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=i},w=(t,e)=>{const{obj:i,k:s}=m(t,e);if(i&&Object.prototype.hasOwnProperty.call(i,s))return i[s]},b=(t,e,i)=>{for(const s in e)"__proto__"!==s&&"constructor"!==s&&(s in t?u(t[s])||t[s]instanceof String||u(e[s])||e[s]instanceof String?i&&(t[s]=e[s]):b(t[s],e[s],i):t[s]=e[s]);return t},$=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const k=t=>u(t)?t.replace(/[&<>"'\/]/g,(t=>x[t])):t,S=[" ",",","?","!",";"],j=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const e=this.regExpMap.get(t);if(void 0!==e)return e;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}(20),O=(t,e,i=".")=>{if(!t)return;if(t[e]){if(!Object.prototype.hasOwnProperty.call(t,e))return;return t[e]}const s=e.split(i);let n=t;for(let t=0;t<s.length;){if(!n||"object"!=typeof n)return;let e,o="";for(let r=t;r<s.length;++r)if(r!==t&&(o+=i),o+=s[r],e=n[o],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&r<s.length-1)continue;t+=r-t+1;break}n=e}return n},P=t=>t?.replace(/_/g,"-"),L={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class N{constructor(t,e={}){this.init(t,e)}init(t,e={}){this.prefix=e.prefix||"i18next:",this.logger=t||L,this.options=e,this.debug=e.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,e,i,s){return s&&!this.debug?null:(u(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[e](t))}create(t){return new N(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new N(this.logger,t)}}var C=new N;class A{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const i=this.observers[t].get(e)||0;this.observers[t].set(e,i+1)})),this}off(t,e){this.observers[t]&&(e?this.observers[t].delete(e):delete this.observers[t])}emit(t,...e){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,i])=>{for(let s=0;s<i;s++)t(...e)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([i,s])=>{for(let n=0;n<s;n++)i.apply(i,[t,...e])}))}}class R extends A{constructor(t,e={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,i,s={}){const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,o=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;t.indexOf(".")>-1?r=t.split("."):(r=[t,e],i&&(Array.isArray(i)?r.push(...i):u(i)&&n?r.push(...i.split(n)):r.push(i)));const a=w(this.data,r);return!a&&!e&&!i&&t.indexOf(".")>-1&&(t=r[0],e=r[1],i=r.slice(2).join(".")),!a&&o&&u(i)?O(this.data?.[t]?.[e],i,n):a}addResource(t,e,i,s,n={silent:!1}){const o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let r=[t,e];i&&(r=r.concat(o?i.split(o):i)),t.indexOf(".")>-1&&(r=t.split("."),s=e,e=r[1]),this.addNamespaces(e),v(this.data,r,s),n.silent||this.emit("added",t,e,i,s)}addResources(t,e,i,s={silent:!1}){for(const s in i)(u(i[s])||Array.isArray(i[s]))&&this.addResource(t,e,s,i[s],{silent:!0});s.silent||this.emit("added",t,e,i)}addResourceBundle(t,e,i,s,n,o={silent:!1,skipCopy:!1}){let r=[t,e];t.indexOf(".")>-1&&(r=t.split("."),s=i,i=e,e=r[1]),this.addNamespaces(e);let a=w(this.data,r)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?b(a,i,n):a={...a,...i},v(this.data,r,a),o.silent||this.emit("added",t,e,i)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((t=>e[t]&&Object.keys(e[t]).length>0))}toJSON(){return this.data}}var I={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,i,s,n){return t.forEach((t=>{e=this.processors[t]?.process(e,i,s,n)??e})),e}};const E=Symbol("i18next/PATH_KEY");function T(t,e){const{[E]:i}=t(function(){const t=[],e=Object.create(null);let i;return e.get=(s,n)=>(i?.revoke?.(),n===E?t:(t.push(n),i=Proxy.revocable(s,e),i.proxy)),Proxy.revocable(Object.create(null),e).proxy}()),s=e?.keySeparator??".",n=e?.nsSeparator??":";if(i.length>1&&n){const t=e?.ns,o=Array.isArray(t)?t:null;if(o&&o.length>1&&o.slice(1).includes(i[0]))return`${i[0]}${n}${i.slice(1).join(s)}`}return i.join(s)}const M={},z=t=>!u(t)&&"boolean"!=typeof t&&"number"!=typeof t;class F extends A{constructor(t,e={}){var i,s;super(),i=t,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{i[t]&&(s[t]=i[t])})),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=C.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,e={interpolation:{}}){const i={...e};if(null==t)return!1;const s=this.resolve(t,i);if(void 0===s?.res)return!1;const n=z(s.res);return!1!==i.returnObjects||!n}extractFromKey(t,e){let i=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");const s=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let n=e.ns||this.options.defaultNS||[];const o=i&&t.indexOf(i)>-1,r=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||((t,e,i)=>{e=e||"",i=i||"";const s=S.filter((t=>e.indexOf(t)<0&&i.indexOf(t)<0));if(0===s.length)return!0;const n=j.getRegExp(`(${s.map((t=>"?"===t?"\\?":t)).join("|")})`);let o=!n.test(t);if(!o){const e=t.indexOf(i);e>0&&!n.test(t.substring(0,e))&&(o=!0)}return o})(t,i,s));if(o&&!r){const e=t.match(this.interpolator.nestingRegexp);if(e&&e.length>0)return{key:t,namespaces:u(n)?[n]:n};const o=t.split(i);(i!==s||i===s&&this.options.ns.indexOf(o[0])>-1)&&(n=o.shift()),t=o.join(s)}return{key:t,namespaces:u(n)?[n]:n}}translate(t,e,i){let s="object"==typeof e?{...e}:e;if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==t)return"";"function"==typeof t&&(t=T(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]),t=t.map((t=>"function"==typeof t?T(t,{...this.options,...s}):String(t)));const n=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,o=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:r,namespaces:a}=this.extractFromKey(t[t.length-1],s),h=a[a.length-1];let l=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const c=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase())return d?n?{res:`${h}${l}${r}`,usedKey:r,exactUsedKey:r,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:`${h}${l}${r}`:n?{res:r,usedKey:r,exactUsedKey:r,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:r;const f=this.resolve(t,s);let p=f?.res;const g=f?.usedKey||r,y=f?.exactUsedKey||r,m=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,w=void 0!==s.count&&!u(s.count),b=F.hasDefaultValue(s),$=w?this.pluralResolver.getSuffix(c,s.count,s):"",x=s.ordinal&&w?this.pluralResolver.getSuffix(c,s.count,{ordinal:!1}):"",k=w&&!s.ordinal&&0===s.count,S=k&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${$}`]||s[`defaultValue${x}`]||s.defaultValue;let j=p;v&&!p&&b&&(j=S);const O=z(j),P=Object.prototype.toString.apply(j);if(!(v&&j&&O&&["[object Number]","[object Function]","[object RegExp]"].indexOf(P)<0)||u(m)&&Array.isArray(j))if(v&&u(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,t,s,i));else{let e=!1,n=!1;!this.isValidLookup(p)&&b&&(e=!0,p=S),this.isValidLookup(p)||(n=!0,p=r);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:p,u=b&&S!==p&&this.options.updateMissing;if(n||e||u){if(this.logger.log(u?"updateKey":"missingKey",c,h,r,u?S:p),o){const t=this.resolve(r,{...s,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&e&&e[0])for(let i=0;i<e.length;i++)t.push(e[i]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(s.lng||this.language):t.push(s.lng||this.language);const i=(t,e,i)=>{const n=b&&i!==p?i:a;this.options.missingKeyHandler?this.options.missingKeyHandler(t,h,e,n,u,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,h,e,n,u,s),this.emit("missingKey",t,h,e,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?t.forEach((t=>{const e=this.pluralResolver.getSuffixes(t,s);k&&s[`defaultValue${this.options.pluralSeparator}zero`]&&e.indexOf(`${this.options.pluralSeparator}zero`)<0&&e.push(`${this.options.pluralSeparator}zero`),e.forEach((e=>{i([t],r+e,s[`defaultValue${e}`]||S)}))})):i(t,r,S))}p=this.extendTranslation(p,t,s,f,i),n&&p===r&&this.options.appendNamespaceToMissingKey&&(p=`${h}${l}${r}`),(n||e)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${l}${r}`:r,e?p:void 0,s))}else{if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,j,{...s,ns:a}):`key '${r} (${this.language})' returned an object instead of string.`;return n?(f.res=t,f.usedParams=this.getUsedParamsDetails(s),f):t}if(o){const t=Array.isArray(j),e=t?[]:{},i=t?y:g;for(const t in j)if(Object.prototype.hasOwnProperty.call(j,t)){const n=`${i}${o}${t}`;e[t]=this.translate(n,b&&!p?{...s,defaultValue:z(S)?S[t]:void 0,joinArrays:!1,ns:a}:{...s,joinArrays:!1,ns:a}),e[t]===n&&(e[t]=j[t])}p=e}}return n?(f.res=p,f.usedParams=this.getUsedParamsDetails(s),f):p}extendTranslation(t,e,i,s,n){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const o=u(t)&&(void 0!==i?.interpolation?.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(o){const e=t.match(this.interpolator.nestingRegexp);r=e&&e.length}let a=i.replace&&!u(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,i.lng||this.language||s.usedLng,i),o){const e=t.match(this.interpolator.nestingRegexp);r<(e&&e.length)&&(i.nest=!1)}!i.lng&&s&&s.res&&(i.lng=this.language||s.usedLng),!1!==i.nest&&(t=this.interpolator.nest(t,((...t)=>n?.[0]!==t[0]||i.context?this.translate(...t,e):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${e[0]}`),null)),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,r=u(o)?[o]:o;return null!=t&&r?.length&&!1!==i.applyPostProcessor&&(t=I.handle(r,t,e,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,e={}){let i,s,n,o,r;return u(t)&&(t=[t]),Array.isArray(t)&&(t=t.map((t=>"function"==typeof t?T(t,{...this.options,...e}):t))),t.forEach((t=>{if(this.isValidLookup(i))return;const a=this.extractFromKey(t,e),h=a.key;s=h;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==e.count&&!u(e.count),d=c&&!e.ordinal&&0===e.count,f=void 0!==e.context&&(u(e.context)||"number"==typeof e.context)&&""!==e.context,p=e.lngs?e.lngs:this.languageUtils.toResolveHierarchy(e.lng||this.language,e.fallbackLng);l.forEach((t=>{this.isValidLookup(i)||(r=t,M[`${p[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(r)||(M[`${p[0]}-${t}`]=!0,this.logger.warn(`key "${s}" for languages "${p.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((s=>{if(this.isValidLookup(i))return;o=s;const r=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(r,h,s,t,e);else{let t;c&&(t=this.pluralResolver.getSuffix(s,e.count,e));const i=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(e.ordinal&&0===t.indexOf(n)&&r.push(h+t.replace(n,this.options.pluralSeparator)),r.push(h+t),d&&r.push(h+i)),f){const s=`${h}${this.options.contextSeparator||"_"}${e.context}`;r.push(s),c&&(e.ordinal&&0===t.indexOf(n)&&r.push(s+t.replace(n,this.options.pluralSeparator)),r.push(s+t),d&&r.push(s+i))}}let a;for(;a=r.pop();)this.isValidLookup(i)||(n=a,i=this.getResource(s,t,a,e))})))}))})),{res:i,usedKey:s,exactUsedKey:n,usedLng:o,usedNS:r}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,i,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,e,i,s):this.resourceStore.getResource(t,e,i,s)}getUsedParamsDetails(t={}){const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!u(t.replace);let s=i?t.replace:t;if(i&&void 0!==t.count&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const t of e)delete s[t]}return s}static hasDefaultValue(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,12)&&void 0!==t[e])return!0;return!1}}class V{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=C.create("languageUtils")}getScriptPartFromCode(t){if(!(t=P(t))||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=P(t))||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if(u(t)&&t.indexOf("-")>-1){let e;try{e=Intl.getCanonicalLocales(t)[0]}catch(t){}return e&&this.options.lowerCaseLng&&(e=e.toLowerCase()),e||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach((t=>{if(e)return;const i=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(i)||(e=i)})),!e&&this.options.supportedLngs&&t.forEach((t=>{if(e)return;const i=this.getScriptPartFromCode(t);if(this.isSupportedCode(i))return e=i;const s=this.getLanguagePartFromCode(t);if(this.isSupportedCode(s))return e=s;e=this.options.supportedLngs.find((t=>t===s?t:t.indexOf("-")<0&&s.indexOf("-")<0?void 0:t.indexOf("-")>0&&s.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===s||0===t.indexOf(s)&&s.length>1?t:void 0))})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),u(t)&&(t=[t]),Array.isArray(t))return t;if(!e)return t.default||[];let i=t[e];return i||(i=t[this.getScriptPartFromCode(e)]),i||(i=t[this.formatLanguageCode(e)]),i||(i=t[this.getLanguagePartFromCode(e)]),i||(i=t.default),i||[]}toResolveHierarchy(t,e){const i=this.getFallbackCodes((!1===e?[]:e)||this.options.fallbackLng||[],t),s=[],n=t=>{t&&(this.isSupportedCode(t)?s.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return u(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&n(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&n(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&n(this.getLanguagePartFromCode(t))):u(t)&&n(this.formatLanguageCode(t)),i.forEach((t=>{s.indexOf(t)<0&&n(this.formatLanguageCode(t))})),s}}const D={zero:0,one:1,two:2,few:3,many:4,other:5},B={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class K{constructor(t,e={}){this.languageUtils=t,this.options=e,this.logger=C.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,e={}){const i=P("dev"===t?"en":t),s=e.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:i,type:s});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let o;try{o=new Intl.PluralRules(i,{type:s})}catch(i){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),B;if(!t.match(/-|_/))return B;const s=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(s,e)}return this.pluralRulesCache[n]=o,o}needsPlural(t,e={}){let i=this.getRule(t,e);return i||(i=this.getRule("dev",e)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,e,i={}){return this.getSuffixes(t,i).map((t=>`${e}${t}`))}getSuffixes(t,e={}){let i=this.getRule(t,e);return i||(i=this.getRule("dev",e)),i?i.resolvedOptions().pluralCategories.sort(((t,e)=>D[t]-D[e])).map((t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,e,i={}){const s=this.getRule(t,i);return s?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(e)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",e,i))}}const _=(t,e,i,s=".",n=!0)=>{let o=((t,e,i)=>{const s=w(t,i);return void 0!==s?s:w(e,i)})(t,e,i);return!o&&n&&u(i)&&(o=O(t,i,s),void 0===o&&(o=O(e,i,s))),o},U=t=>t.replace(/\$/g,"$$$$");class H{constructor(t={}){this.logger=C.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:e,escapeValue:i,useRawValueToEscape:s,prefix:n,prefixEscaped:o,suffix:r,suffixEscaped:a,formatSeparator:h,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:u,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:m}=t.interpolation;this.escape=void 0!==e?e:k,this.escapeValue=void 0===i||i,this.useRawValueToEscape=void 0!==s&&s,this.prefix=n?$(n):o||"{{",this.suffix=r?$(r):a||"}}",this.formatSeparator=h||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=u?$(u):d||$("$t("),this.nestingSuffix=f?$(f):p||$(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,e)=>t?.source===e?(t.lastIndex=0,t):new RegExp(e,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,e,i,s){let n,o,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=t=>{if(t.indexOf(this.formatSeparator)<0){const n=_(e,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,i,{...s,...e,interpolationkey:t}):n}const n=t.split(this.formatSeparator),o=n.shift().trim(),r=n.join(this.formatSeparator).trim();return this.format(_(e,a,o,this.options.keySeparator,this.options.ignoreJSONStructure),r,i,{...s,...e,interpolationkey:o})};this.resetRegExp();const l=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>U(t)},{regex:this.regexp,safeValue:t=>U(this.escapeValue?this.escape(t):t)}].forEach((e=>{for(r=0;n=e.regex.exec(t);){const i=n[1].trim();if(o=h(i),void 0===o)if("function"==typeof l){const e=l(t,n,s);o=u(e)?e:""}else if(s&&Object.prototype.hasOwnProperty.call(s,i))o="";else{if(c){o=n[0];continue}this.logger.warn(`missed to pass in variable ${i} for interpolating ${t}`),o=""}else u(o)||this.useRawValueToEscape||(o=f(o));const a=e.safeValue(o);if(t=t.replace(n[0],a),c?(e.regex.lastIndex+=o.length,e.regex.lastIndex-=n[0].length):e.regex.lastIndex=0,r++,r>=this.maxReplaces)break}})),t}nest(t,e,i={}){let s,n,o;const r=(t,e)=>{const i=this.nestingOptionsSeparator;if(t.indexOf(i)<0)return t;const s=t.split(new RegExp(`${$(i)}[ ]*{`));let n=`{${s[1]}`;t=s[0],n=this.interpolate(n,o);const r=n.match(/'/g),a=n.match(/"/g);((r?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(n=n.replace(/'/g,'"'));try{o=JSON.parse(n),e&&(o={...e,...o})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${i}${n}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,t};for(;s=this.nestingRegexp.exec(t);){let a=[];o={...i},o=o.replace&&!u(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const h=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(-1!==h&&(a=s[1].slice(h).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),s[1]=s[1].slice(0,h)),n=e(r.call(this,s[1].trim(),o),o),n&&s[0]===t&&!u(n))return n;u(n)||(n=f(n)),n||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),n=""),a.length&&(n=a.reduce(((t,e)=>this.format(t,e,i.lng,{...i,interpolationkey:s[1].trim()})),n.trim())),t=t.replace(s[0],n),this.regexp.lastIndex=0}return t}}const Y=t=>{const e={};return(i,s,n)=>{let o=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(o={...o,[n.interpolationkey]:void 0});const r=s+JSON.stringify(o);let a=e[r];return a||(a=t(P(s),n),e[r]=a),a(i)}},J=t=>(e,i,s)=>t(P(i),s)(e);class q{constructor(t={}){this.logger=C.create("formatter"),this.options=t,this.init(t)}init(t,e={interpolation:{}}){this.formatSeparator=e.interpolation.formatSeparator||",";const i=e.cacheInBuiltFormats?Y:J;this.formats={number:i(((t,e)=>{const i=new Intl.NumberFormat(t,{...e});return t=>i.format(t)})),currency:i(((t,e)=>{const i=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>i.format(t)})),datetime:i(((t,e)=>{const i=new Intl.DateTimeFormat(t,{...e});return t=>i.format(t)})),relativetime:i(((t,e)=>{const i=new Intl.RelativeTimeFormat(t,{...e});return t=>i.format(t,e.range||"day")})),list:i(((t,e)=>{const i=new Intl.ListFormat(t,{...e});return t=>i.format(t)}))}}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=Y(e)}format(t,e,i,s={}){const n=e.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find((t=>t.indexOf(")")>-1))){const t=n.findIndex((t=>t.indexOf(")")>-1));n[0]=[n[0],...n.splice(1,t)].join(this.formatSeparator)}return n.reduce(((t,e)=>{const{formatName:n,formatOptions:o}=(t=>{let e=t.toLowerCase().trim();const i={};if(t.indexOf("(")>-1){const s=t.split("(");e=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);"currency"===e&&n.indexOf(":")<0?i.currency||(i.currency=n.trim()):"relativetime"===e&&n.indexOf(":")<0?i.range||(i.range=n.trim()):n.split(";").forEach((t=>{if(t){const[e,...s]=t.split(":"),n=s.join(":").trim().replace(/^'+|'+$/g,""),o=e.trim();i[o]||(i[o]=n),"false"===n&&(i[o]=!1),"true"===n&&(i[o]=!0),isNaN(n)||(i[o]=parseInt(n,10))}}))}return{formatName:e,formatOptions:i}})(e);if(this.formats[n]){let e=t;try{const r=s?.formatParams?.[s.interpolationkey]||{};e=this.formats[n](t,r.locale||r.lng||s.locale||s.lng||i,{...o,...s,...r})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${n}`),t}),t)}}class W extends A{constructor(t,e,i,s={}){super(),this.backend=t,this.store=e,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=C.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,s.backend,s)}queueLoad(t,e,i,s){const n={},o={},r={},a={};return t.forEach((t=>{let s=!0;e.forEach((e=>{const r=`${t}|${e}`;!i.reload&&this.store.hasResourceBundle(t,e)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,s=!1,void 0===o[r]&&(o[r]=!0),void 0===n[r]&&(n[r]=!0),void 0===a[e]&&(a[e]=!0)))})),s||(r[t]=!0)})),(Object.keys(n).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(n),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(t,e,i){const s=t.split("|"),n=s[0],o=s[1];e&&this.emit("failedLoading",n,o,e),!e&&i&&this.store.addResourceBundle(n,o,i,void 0,void 0,{skipCopy:!0}),this.state[t]=e?-1:2,e&&i&&(this.state[t]=0);const r={};this.queue.forEach((i=>{((t,e,i)=>{const{obj:s,k:n}=m(t,e,Object);s[n]=s[n]||[],s[n].push(i)})(i.loaded,[n],o),((t,e)=>{void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)})(i,t),e&&i.errors.push(e),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach((t=>{r[t]||(r[t]={});const e=i.loaded[t];e.length&&e.forEach((e=>{void 0===r[t][e]&&(r[t][e]=!0)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((t=>!t.done))}read(t,e,i,s=0,n=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:i,tried:s,wait:n,callback:o});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}r&&a&&s<this.maxRetries?setTimeout((()=>{this.read.call(this,t,e,i,s+1,2*n,o)}),n):o(r,a)},a=this.backend[i].bind(this.backend);if(2!==a.length)return a(t,e,r);try{const i=a(t,e);i&&"function"==typeof i.then?i.then((t=>r(null,t))).catch(r):r(null,i)}catch(t){r(t)}}prepareLoading(t,e,i={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();u(t)&&(t=this.languageUtils.toResolveHierarchy(t)),u(e)&&(e=[e]);const n=this.queueLoad(t,e,i,s);if(!n.toLoad.length)return n.pending.length||s(),null;n.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,e,i){this.prepareLoading(t,e,{},i)}reload(t,e,i){this.prepareLoading(t,e,{reload:!0},i)}loadOne(t,e=""){const i=t.split("|"),s=i[0],n=i[1];this.read(s,n,"read",void 0,void 0,((i,o)=>{i&&this.logger.warn(`${e}loading namespace ${n} for language ${s} failed`,i),!i&&o&&this.logger.log(`${e}loaded namespace ${n} for language ${s}`,o),this.loaded(t,i,o)}))}saveMissing(t,e,i,s,n,o={},r=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(e)){if(null!=i&&""!==i){if(this.backend?.create){const a={...o,isUpdate:n},h=this.backend.create.bind(this.backend);if(h.length<6)try{let n;n=5===h.length?h(t,e,i,s,a):h(t,e,i,s),n&&"function"==typeof n.then?n.then((t=>r(null,t))).catch(r):r(null,n)}catch(t){r(t)}else h(t,e,i,s,r,a)}t&&t[0]&&this.store.addResource(t[0],e,i,s)}}else this.logger.warn(`did not save key "${i}" as the namespace "${e}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const G=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if("object"==typeof t[1]&&(e=t[1]),u(t[1])&&(e.defaultValue=t[1]),u(t[2])&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const i=t[3]||t[2];Object.keys(i).forEach((t=>{e[t]=i[t]}))}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Q=t=>(u(t.ns)&&(t.ns=[t.ns]),u(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),u(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),Z=()=>{},X="__i18next_supportNoticeShown";class tt extends A{constructor(t={},e){var i;if(super(),this.options=Q(t),this.services={},this.logger=C,this.modules={external:[]},i=this,Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t=>{"function"==typeof i[t]&&(i[t]=i[t].bind(i))})),e&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,e),this;setTimeout((()=>{this.init(t,e)}),0)}}init(t={},e){this.isInitializing=!0,"function"==typeof t&&(e=t,t={}),null==t.defaultNS&&t.ns&&(u(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=G();var s;this.options={...i,...this.options,...Q(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(s=this,s?.modules?.backend?.name?.indexOf("Locize")>0||s?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||s?.options?.backend?.backends&&s.options.backend.backends.some((t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0))||s?.options?.backend?.projectId||s?.options?.backend?.backendOptions&&s.options.backend.backendOptions.some((t=>t?.projectId)))||"undefined"!=typeof globalThis&&globalThis[X]||"undefined"!=typeof process&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||"undefined"!=typeof process&&process.env||("undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"undefined"!=typeof globalThis&&(globalThis[X]=!0));const n=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;C.init(this.modules.logger?n(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:q;const e=new V(this.options);this.store=new R(this.options.resources,this.options);const s=this.services;s.logger=C,s.resourceStore=this.store,s.languageUtils=e,s.pluralResolver=new K(e,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format||(s.formatter=n(t),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new H(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new W(n(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",((t,...e)=>{this.emit(t,...e)})),this.modules.languageDetector&&(s.languageDetector=n(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=n(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new F(this.services,this.options),this.translator.on("*",((t,...e)=>{this.emit(t,...e)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,e||(e=Z),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=(...e)=>this.store[t](...e)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...e)=>(this.store[t](...e),this)}));const o=d(),r=()=>{const t=(t,i)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(i),e(t,i)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),o}loadResources(t,e=Z){let i=e;const s=u(t)?t:this.language;if("function"==typeof t&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===s?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return i();const t=[],e=e=>{e&&"cimode"!==e&&this.services.languageUtils.toResolveHierarchy(e).forEach((e=>{"cimode"!==e&&t.indexOf(e)<0&&t.push(e)}))};s?e(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>e(t))),this.options.preload?.forEach?.((t=>e(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),i(t)}))}else i(null)}reloadResources(t,e,i){const s=d();return"function"==typeof t&&(i=t,t=void 0),"function"==typeof e&&(i=e,e=void 0),t||(t=this.languages),e||(e=this.options.ns),i||(i=Z),this.services.backendConnector.reload(t,e,(t=>{s.resolve(),i(t)})),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&I.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,e){this.isLanguageChangingTo=t;const i=d();this.emit("languageChanging",t);const s=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},n=(n,o)=>{o?this.isLanguageChangingTo===t&&(s(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,i.resolve(((...t)=>this.t(...t))),e&&e(n,((...t)=>this.t(...t)))},o=e=>{t||e||!this.services.languageDetector||(e=[]);const i=u(e)?e:e&&e[0],o=this.store.hasLanguageSomeTranslations(i)?i:this.services.languageUtils.getBestMatchFromCodes(u(e)?[e]:e);o&&(this.language||s(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,(t=>{n(t,o)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t):o(this.services.languageDetector.detect()),i}getFixedT(t,e,i){const s=(t,e,...n)=>{let o;o="object"!=typeof e?this.options.overloadTranslationOptionHandler([t,e].concat(n)):{...e},o.lng=o.lng||s.lng,o.lngs=o.lngs||s.lngs,o.ns=o.ns||s.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||i||s.keyPrefix);const r={...this.options,...o};"function"==typeof o.keyPrefix&&(o.keyPrefix=T(o.keyPrefix,r));const a=this.options.keySeparator||".";let h;return o.keyPrefix&&Array.isArray(t)?h=t.map((t=>("function"==typeof t&&(t=T(t,r)),`${o.keyPrefix}${a}${t}`))):("function"==typeof t&&(t=T(t,r)),h=o.keyPrefix?`${o.keyPrefix}${a}${t}`:t),this.t(h,o)};return u(t)?s.lng=t:s.lngs=t,s.ns=e,s.keyPrefix=i,s}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,e={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=e.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;const o=(t,e)=>{const i=this.services.backendConnector.state[`${t}|${e}`];return-1===i||0===i||2===i};if(e.precheck){const t=e.precheck(this,o);if(void 0!==t)return t}return!(!this.hasResourceBundle(i,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(i,t)||s&&!o(n,t)))}loadNamespaces(t,e){const i=d();return this.options.ns?(u(t)&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{i.resolve(),e&&e(t)})),i):(e&&e(),Promise.resolve())}loadLanguages(t,e){const i=d();u(t)&&(t=[t]);const s=this.options.preload||[],n=t.filter((t=>s.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return n.length?(this.options.preload=s.concat(n),this.loadResources((t=>{i.resolve(),e&&e(t)})),i):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const e=new Intl.Locale(t);if(e&&e.getTextInfo){const t=e.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const e=this.services?.languageUtils||new V(G());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(e.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},e){const i=new tt(t,e);return i.createInstance=tt.createInstance,i}cloneInstance(t={},e=Z){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},n=new tt(s);if(void 0===t.debug&&void 0===t.prefix||(n.logger=n.logger.clone(t)),["store","services","language"].forEach((t=>{n[t]=this[t]})),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},i){const t=Object.keys(this.store.data).reduce(((t,e)=>(t[e]={...this.store.data[e]},t[e]=Object.keys(t[e]).reduce(((i,s)=>(i[s]={...t[e][s]},i)),t[e]),t)),{});n.store=new R(t,s),n.services.resourceStore=n.store}if(t.interpolation){const e={...G().interpolation,...this.options.interpolation,...t.interpolation},i={...s,interpolation:e};n.services.interpolator=new H(i)}return n.translator=new F(n.services,s),n.translator.on("*",((t,...e)=>{n.emit(t,...e)})),n.init(s,e),n.translator.options=s,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const et=tt.createInstance(),{slice:it,forEach:st}=[],nt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ot={create(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};i&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+60*i*1e3)),s&&(n.domain=s),document.cookie=function(t,e){const i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${t}=${encodeURIComponent(e)}`;if(i.maxAge>0){const t=i.maxAge-0;if(Number.isNaN(t))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(t)}`}if(i.domain){if(!nt.test(i.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${i.domain}`}if(i.path){if(!nt.test(i.path))throw new TypeError("option path is invalid");s+=`; Path=${i.path}`}if(i.expires){if("function"!=typeof i.expires.toUTCString)throw new TypeError("option expires is invalid");s+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(s+="; HttpOnly"),i.secure&&(s+="; Secure"),i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(s+="; Partitioned"),s}(t,e,n)},read(t){const e=`${t}=`,i=document.cookie.split(";");for(let t=0;t<i.length;t++){let s=i[t];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return s.substring(e.length,s.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var rt={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&"undefined"!=typeof document)return ot.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:i,cookieMinutes:s,cookieDomain:n,cookieOptions:o}=e;i&&"undefined"!=typeof document&&ot.create(i,t,s,n,o)}},at={name:"querystring",lookup(t){let e,{lookupQuerystring:i}=t;if("undefined"!=typeof window){let{search:t}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));const s=t.substring(1).split("&");for(let t=0;t<s.length;t++){const n=s[t].indexOf("=");n>0&&s[t].substring(0,n)===i&&(e=s[t].substring(n+1))}}return e}},ht={name:"hash",lookup(t){let e,{lookupHash:i,lookupFromHashIndex:s}=t;if("undefined"!=typeof window){const{hash:t}=window.location;if(t&&t.length>2){const n=t.substring(1);if(i){const t=n.split("&");for(let s=0;s<t.length;s++){const n=t[s].indexOf("=");n>0&&t[s].substring(0,n)===i&&(e=t[s].substring(n+1))}}if(e)return e;if(!e&&s>-1){const e=t.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(e))return;const i="number"==typeof s?s:0;return e[i]?.replace("/","")}}}return e}};let lt=null;const ct=()=>{if(null!==lt)return lt;try{if(lt="undefined"!=typeof window&&null!==window.localStorage,!lt)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){lt=!1}return lt};var ut={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&ct())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:i}=e;i&&ct()&&window.localStorage.setItem(i,t)}};let dt=null;const ft=()=>{if(null!==dt)return dt;try{if(dt="undefined"!=typeof window&&null!==window.sessionStorage,!dt)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){dt=!1}return dt};var pt={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&ft())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:i}=e;i&&ft()&&window.sessionStorage.setItem(i,t)}},gt={name:"navigator",lookup(t){const e=[];if("undefined"!=typeof navigator){const{languages:t,userLanguage:i,language:s}=navigator;if(t)for(let i=0;i<t.length;i++)e.push(t[i]);i&&e.push(i),s&&e.push(s)}return e.length>0?e:void 0}},yt={name:"htmlTag",lookup(t){let e,{htmlTag:i}=t;const s=i||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(e=s.getAttribute("lang")),e}},mt={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if("undefined"==typeof window)return;const i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(i))return;const s="number"==typeof e?e:0;return i[s]?.replace("/","")}},vt={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const i="number"==typeof e?e+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[i]}};let wt=!1;try{wt=!0}catch(t){}const bt=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];wt||bt.splice(1,1);class $t{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,e)}init(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},this.options=function(t){return st.call(it.call(arguments,1),(e=>{if(e)for(const i in e)void 0===t[i]&&(t[i]=e[i])})),t}(t,this.options||{},{order:bt,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=t=>t.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=e,this.addDetector(rt),this.addDetector(at),this.addDetector(ut),this.addDetector(pt),this.addDetector(gt),this.addDetector(yt),this.addDetector(mt),this.addDetector(vt),this.addDetector(ht)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order).forEach((e=>{if(this.detectors[e]){let i=this.detectors[e].lookup(this.options);i&&"string"==typeof i&&(i=[i]),i&&(t=t.concat(i))}})),t=t.filter((t=>{return null!=t&&!("string"==typeof(e=t)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(e))));var e})).map((t=>this.options.convertDetectedLanguage(t))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;e&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||e.forEach((e=>{this.detectors[e]&&this.detectors[e].cacheUserLanguage(t,this.options)})))}}$t.type="languageDetector",et.use($t).init({fallbackLng:"en",debug:!1,resources:{en:{translation:{}},ja:{translation:{Pay:"支払う","Failed to load Stripe":"ライブラリの読み込みに失敗しました。","Add your payment information":"支払情報を追加","Add card":"カードを追加","Add a card":"カードを追加",Add:"追加","Card information":"カード情報","Card Number":"カード番号","MM / YY":"月 / 年",CVC:"セキュリティコード(CVC)","Country or region":"地域","Postal Code":"郵便番号",Close:"閉じる",Loading:"読み込み中","Payment information":"支払情報","Billing address":"請求先住所",Save:"保存","Please complete your billing address.":"請求先住所を入力してください。","Please enter your email address.":"メールアドレスを入力してください。","Please enter a valid email address.":"有効なメールアドレスを入力してください。"}},"pt-BR":{translation:{Pay:"Pagar","Failed to load Stripe":"Falha ao ler Stripe","Add your payment information":"Informações do seu Pagamento","Add card":"Adicionar Cartão","Add a card":"Adicionar um Cartão",Add:"Adicionar","Card information":"Informações do Cartão","Card Number":"Número do Cartão","MM / YY":"MM / AA",CVC:"Número de Segurança(CVC)","Country or region":"País ou região","Postal Code":"Cep",Close:"Fechar","Please complete your billing address.":"Preencha seu endereço de cobrança.","Please enter your email address.":"Informe seu endereço de e-mail.","Please enter a valid email address.":"Informe um endereço de e-mail válido."}}}});const xt=et;export{c,xt as i}
@@ -1 +1 @@
1
- import{transformTag as e,proxyCustomElement as t,HTMLElement as o,createEvent as i,h as n,Host as a}from"@stencil/core/internal/client";import{c as s,i as l}from"./i18n.js";import{d}from"./icon.js";const c=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","audio[controls]","video[controls]","summary",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),r=e=>{if(!e.matches(c))return!1;const t=e.getAttribute("tabindex");if(null!==t&&Number(t)<0)return!1;if(e.hasAttribute("hidden")||null!==e.closest("[inert]"))return!1;const{checkVisibility:o}=e;return!("function"==typeof o&&!o.call(e,{visibilityProperty:!0}))},f=e=>{const t=[],o=e=>{for(const i of(e=>{if(e instanceof Element&&"SLOT"===e.tagName){const t=e,o="function"==typeof t.assignedElements?t.assignedElements({flatten:!0}):[];return o.length>0?o:Array.from(t.children)}return e instanceof Element&&null!=e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)})(e))r(i)&&t.push(i),o(i)};return o(e),t},h=(e=document)=>{var t,o;let i=null!==(t=e.activeElement)&&void 0!==t?t:null;for(;null!=(null===(o=null==i?void 0:i.shadowRoot)||void 0===o?void 0:o.activeElement);)i=i.shadowRoot.activeElement;return i},u=t(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.close=i(this,"close",7),this.showCloseButton=!0,this.open=!1,this.renderedOpen=!1,this.returnFocusElement=null,this.shouldFocusOnRender=!1,this.lastFocusedInside=null,this.handleKeyDown=e=>{this.open&&"Escape"===e.key&&(e.isComposing||229===e.keyCode||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),this.closeModal()))},this.handleFocusIn=e=>{var t,o;const i=null!==(o=null===(t=e.composedPath)||void 0===t?void 0:t.call(e)[0])&&void 0!==o?o:e.target;void 0===(null==i?void 0:i.classList)||i.classList.contains("focus-guard")||(this.lastFocusedInside=i)},this.handleStartGuardFocus=e=>{this.cameFromFocusableInside(e)?this.focusLastElement():this.focusFirstElement()},this.handleEndGuardFocus=e=>{this.isInsideModal(this.getFocusOrigin(e))?this.focusFirstElement():this.focusLastElement()}}onOpenChange(e){e?(this.rememberFocus(),this.openModalAnimation()):(this.renderedOpen=!1,this.shouldFocusOnRender=!1,this.lastFocusedInside=null,this.close.emit(),this.restoreFocus())}async toggleModal(){this.open?await this.closeModal():await this.openModal()}async openModal(){this.open=!0}async closeModal(){this.open=!1}componentDidLoad(){const e=s();e&&this.el.classList.add(e),this.open&&(this.rememberFocus(),this.openModalAnimation())}componentDidRender(){this.shouldFocusOnRender&&this.renderedOpen&&(this.shouldFocusOnRender=!1,this.focusFirstElement())}rememberFocus(){var e;if("undefined"==typeof document)return;const t=h(document);null===t||t===document.body||this.el.contains(t)||!0===(null===(e=this.el.shadowRoot)||void 0===e?void 0:e.contains(t))||(this.returnFocusElement=t)}restoreFocus(){const e=this.returnFocusElement;this.returnFocusElement=null,null!=e&&e.isConnected&&"function"==typeof e.focus&&e.focus()}getTabbableElements(){return void 0===this.dialogElement?[]:f(this.dialogElement).filter((e=>!e.classList.contains("focus-guard")))}isInsideModal(e){var t;return null!==e&&(this.el.contains(e)||!0===(null===(t=this.dialogElement)||void 0===t?void 0:t.contains(e)))}getFocusOrigin(e){var t;return null!==(t=e.relatedTarget)&&void 0!==t?t:this.lastFocusedInside}cameFromFocusableInside(e){const t=this.getFocusOrigin(e);return t!==this.dialogElement&&this.isInsideModal(t)}focusContentAfterLoading(){var e;if(!this.open||void 0===this.contentElement)return;const t=h(document);(null===t||t===document.body||t===this.dialogElement||t===this.closeButtonElement)&&(null===(e=f(this.contentElement)[0])||void 0===e||e.focus())}focusFirstElement(){var e;const[t]=this.getTabbableElements();null===(e=null!=t?t:this.dialogElement)||void 0===e||e.focus()}focusLastElement(){var e,t;const o=this.getTabbableElements();null===(t=null!==(e=o[o.length-1])&&void 0!==e?e:this.dialogElement)||void 0===t||t.focus()}openModalAnimation(){if(this.shouldFocusOnRender=!0,!this.el.shadowRoot)return void(this.renderedOpen=!0);const e=this.el.shadowRoot.querySelector(".modal-child");e.classList.add("loading"),e.style.willChange="transform",e.addEventListener("transitionend",(()=>{e.style.willChange="auto",e.classList.remove("loading"),this.focusContentAfterLoading()}),{once:!0}),requestAnimationFrame((()=>{this.renderedOpen=this.open}))}render(){const{renderedOpen:e,showCloseButton:t}=this,o=e?0:-1;return n(a,{key:"684539aa83388bec518e73bbd8aa19e73cfde07d",role:e?"dialog":void 0,"aria-modal":e?"true":void 0,onKeyDown:this.handleKeyDown,onFocusin:this.handleFocusIn},n("div",{key:"db6f1088c1ef7e35aefba06faaf3e9c2dcaa3419",class:"modal-row"+(e?" open":""),onClick:()=>this.closeModal()},n("div",{key:"89c783c793261566b77ba962da730a973e8cbd8d",class:"modal-child",tabindex:"-1",ref:e=>this.dialogElement=e,onClick:e=>e.stopPropagation()},n("div",{key:"0e329b32c25509134f5a25adb266b03dd0bd71d8",class:"focus-guard",tabindex:o,onFocus:this.handleStartGuardFocus}),t?n("div",{class:"modal-close-button-wrap"},n("button",{type:"button",class:"modal-close-button","aria-label":l.t("Close"),ref:e=>this.closeButtonElement=e,onClick:()=>this.closeModal()},n("ion-icon",{name:"close",size:"large","aria-hidden":"true"}))):null,n("div",{key:"f2b5dcbc72ba3178dd920ceecd4fd339f69598d7",class:"modal-loading"},n("svg",{key:"1f7afb6cc48be8fc84f9b69678f2c8ca1e2b145e",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2400 2400"},n("g",{key:"ed40edfeabe02bf198b194eb04777e1f4a6b203e","stroke-width":"200","stroke-linecap":"round",stroke:"currentColor",fill:"none",id:"spinner"},n("line",{key:"03c9170ee9e566227fddcc9037a92c48ed954b89",x1:"1200",y1:"600",x2:"1200",y2:"100"}),n("line",{key:"302aec0abf20ee8afe66245ecbc9d5e2adbade82",opacity:"0.5",x1:"1200",y1:"2300",x2:"1200",y2:"1800"}),n("line",{key:"d3bea8de4d689a5c5c423a72dd23a0fbc64c29dd",opacity:"0.917",x1:"900",y1:"680.4",x2:"650",y2:"247.4"}),n("line",{key:"543e33091e87bf85c3a0e4d4881babdffbe4b825",opacity:"0.417",x1:"1750",y1:"2152.6",x2:"1500",y2:"1719.6"}),n("line",{key:"5c2e0a3722955a8ee17b57f3061097f18681ba7e",opacity:"0.833",x1:"680.4",y1:"900",x2:"247.4",y2:"650"}),n("line",{key:"1100d48a500bfca6075243cf69be9e6f575bdae6",opacity:"0.333",x1:"2152.6",y1:"1750",x2:"1719.6",y2:"1500"}),n("line",{key:"6c3f7c309a5ed15c6ffce11925efe09dbc8e6f3b",opacity:"0.75",x1:"600",y1:"1200",x2:"100",y2:"1200"}),n("line",{key:"7708c31b141f3a151e8dc78c89b20442f34ce1e2",opacity:"0.25",x1:"2300",y1:"1200",x2:"1800",y2:"1200"}),n("line",{key:"d419fc4006e8063f9bbc35b4cb2a9a88010c623a",opacity:"0.667",x1:"680.4",y1:"1500",x2:"247.4",y2:"1750"}),n("line",{key:"78ccaf11a6e7c3183d210b787ce9374bd7c4aff4",opacity:"0.167",x1:"2152.6",y1:"650",x2:"1719.6",y2:"900"}),n("line",{key:"acb1444de9fcd9aa1a3182d759d3b8aeb0906284",opacity:"0.583",x1:"900",y1:"1719.6",x2:"650",y2:"2152.6"}),n("line",{key:"6adef9d6a54f302c8da7c84cae32851723ce25cc",opacity:"0.083",x1:"1750",y1:"247.4",x2:"1500",y2:"680.4"}),n("animateTransform",{key:"7acf982514091f6c3ec9bd4ddfc660f3286ddd4e",attributeName:"transform",attributeType:"XML",type:"rotate",keyTimes:"0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667",values:"0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199",dur:"0.83333s",begin:"0s",repeatCount:"indefinite",calcMode:"discrete"})))),n("div",{key:"120bebc59c0fc013cb2bfbaf8957ad3731e1ddf4",class:"modal-content",ref:e=>this.contentElement=e},n("slot",{key:"0f371823f8fddd61e2b0ce24a59477103d979875"})),n("div",{key:"fa8436f70871d59055dab2cf0fcfe5d4577328c1",class:"focus-guard",tabindex:o,onFocus:this.handleEndGuardFocus}))))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return':root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}:host{box-sizing:border-box}:host *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}:host button{cursor:pointer}:host{display:block}.modal-row{opacity:0;pointer-events:none;will-change:transform;visibility:hidden}.modal-row.open{opacity:1;pointer-events:auto;visibility:visible;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-row .modal-child{transform:translateY(100%);transition:transform 420ms ease;position:relative}.modal-row .modal-child .modal-loading{display:none;position:absolute;top:160px;left:50%;transform:translateX(-50%);width:24px;height:24px}.modal-row .modal-child.loading .modal-loading{display:flex;justify-content:center;align-items:center}.modal-row .modal-child.loading .modal-loading svg{width:24px;height:24px}.modal-row .modal-child.loading .modal-content{visibility:hidden}.modal-row.open .modal-child{transform:translateY(0%)}.modal-child{padding:16px 8px 24px;background-color:#fff;width:100%}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{display:block;width:32px;cursor:pointer;border-radius:4px}.modal-close-button-wrap .modal-close-button:focus-visible{outline:2px solid var(--color-label, #000);outline-offset:2px}.modal-close-button-wrap .modal-close-button ion-icon{width:32px;display:block;fill:var(--color-label)}.modal-child:focus{outline:none}.focus-guard{position:absolute;width:1px;height:1px;overflow:hidden}'}},[257,"stripe-modal",{showCloseButton:[4,"show-close-button"],open:[1028],renderedOpen:[32],toggleModal:[64],openModal:[64],closeModal:[64]},void 0,{open:[{onOpenChange:0}]}]);function b(){"undefined"!=typeof customElements&&["stripe-modal","ion-icon"].forEach((t=>{switch(t){case"stripe-modal":customElements.get(e(t))||customElements.define(e(t),u);break;case"ion-icon":customElements.get(e(t))||d()}}))}b();export{u as S,b as d}
1
+ import{transformTag as o,proxyCustomElement as t,HTMLElement as e,createEvent as i,h as n,Host as a}from"@stencil/core/internal/client";import{c as s,i as d}from"./i18n.js";import{d as l}from"./icon.js";const r=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","audio[controls]","video[controls]","summary",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=o=>{if(!o.matches(r))return!1;const t=o.getAttribute("tabindex");if(null!==t&&Number(t)<0)return!1;if(o.hasAttribute("hidden")||null!==o.closest("[inert]"))return!1;const{checkVisibility:e}=o;return!("function"==typeof e&&!e.call(o,{visibilityProperty:!0}))},h=o=>{const t=[],e=o=>{for(const i of(o=>{if(o instanceof Element&&"SLOT"===o.tagName){const t=o,e="function"==typeof t.assignedElements?t.assignedElements({flatten:!0}):[];return e.length>0?e:Array.from(t.children)}return o instanceof Element&&null!=o.shadowRoot?Array.from(o.shadowRoot.children):Array.from(o.children)})(o))c(i)&&t.push(i),e(i)};return e(o),t},u=(o=document)=>{var t,e;let i=null!==(t=o.activeElement)&&void 0!==t?t:null;for(;null!=(null===(e=null==i?void 0:i.shadowRoot)||void 0===e?void 0:e.activeElement);)i=i.shadowRoot.activeElement;return i},b=t(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.close=i(this,"close",7),this.showCloseButton=!0,this.open=!1,this.renderedOpen=!1,this.returnFocusElement=null,this.shouldFocusOnRender=!1,this.lastFocusedInside=null,this.handleKeyDown=o=>{this.open&&"Escape"===o.key&&(o.isComposing||229===o.keyCode||o.defaultPrevented||(o.preventDefault(),o.stopPropagation(),this.closeModal()))},this.handleFocusIn=o=>{var t,e;const i=null!==(e=null===(t=o.composedPath)||void 0===t?void 0:t.call(o)[0])&&void 0!==e?e:o.target;void 0===(null==i?void 0:i.classList)||i.classList.contains("focus-guard")||(this.lastFocusedInside=i)},this.handleStartGuardFocus=o=>{this.cameFromFocusableInside(o)?this.focusLastElement():this.focusFirstElement()},this.handleEndGuardFocus=o=>{this.isInsideModal(this.getFocusOrigin(o))?this.focusFirstElement():this.focusLastElement()}}onOpenChange(o){o?(this.rememberFocus(),this.openModalAnimation()):(this.renderedOpen=!1,this.shouldFocusOnRender=!1,this.lastFocusedInside=null,this.close.emit(),this.restoreFocus())}async toggleModal(){this.open?await this.closeModal():await this.openModal()}async openModal(){this.open=!0}async closeModal(){this.open=!1}componentDidLoad(){const o=s();o&&this.el.classList.add(o),this.open&&(this.rememberFocus(),this.openModalAnimation())}componentDidRender(){this.shouldFocusOnRender&&this.renderedOpen&&(this.shouldFocusOnRender=!1,this.focusFirstElement())}rememberFocus(){var o;if("undefined"==typeof document)return;const t=u(document);null===t||t===document.body||this.el.contains(t)||!0===(null===(o=this.el.shadowRoot)||void 0===o?void 0:o.contains(t))||(this.returnFocusElement=t)}restoreFocus(){const o=this.returnFocusElement;this.returnFocusElement=null,null!=o&&o.isConnected&&"function"==typeof o.focus&&o.focus()}getTabbableElements(){return void 0===this.dialogElement?[]:h(this.dialogElement).filter((o=>!o.classList.contains("focus-guard")))}isInsideModal(o){var t;return null!==o&&(this.el.contains(o)||!0===(null===(t=this.dialogElement)||void 0===t?void 0:t.contains(o)))}getFocusOrigin(o){var t;return null!==(t=o.relatedTarget)&&void 0!==t?t:this.lastFocusedInside}cameFromFocusableInside(o){const t=this.getFocusOrigin(o);return t!==this.dialogElement&&this.isInsideModal(t)}focusContentAfterLoading(){var o;if(!this.open||void 0===this.contentElement)return;const t=u(document);(null===t||t===document.body||t===this.dialogElement||t===this.closeButtonElement)&&(null===(o=h(this.contentElement)[0])||void 0===o||o.focus())}focusFirstElement(){var o;const[t]=this.getTabbableElements();null===(o=null!=t?t:this.dialogElement)||void 0===o||o.focus()}focusLastElement(){var o,t;const e=this.getTabbableElements();null===(t=null!==(o=e[e.length-1])&&void 0!==o?o:this.dialogElement)||void 0===t||t.focus()}openModalAnimation(){if(this.shouldFocusOnRender=!0,!this.el.shadowRoot)return void(this.renderedOpen=!0);const o=this.el.shadowRoot.querySelector(".modal-child");o.scrollTop=0,o.classList.add("loading"),o.style.willChange="transform",o.addEventListener("transitionend",(()=>{o.style.willChange="auto",o.classList.remove("loading"),this.focusContentAfterLoading()}),{once:!0}),requestAnimationFrame((()=>{this.renderedOpen=this.open}))}render(){const{renderedOpen:o,showCloseButton:t}=this,e=o?0:-1;return n(a,{key:"55e0d63b18df165313ea3dd8b8f17aa0e0d0a253",role:o?"dialog":void 0,"aria-modal":o?"true":void 0,onKeyDown:this.handleKeyDown,onFocusin:this.handleFocusIn},n("div",{key:"adb0b493c0ae525f275025c03e1b8f02b04de1af",class:"modal-row"+(o?" open":""),onClick:()=>this.closeModal()},n("div",{key:"478bdad2ad481bfc2d8ffcf552788292fa93daed",class:"modal-child",tabindex:"-1",ref:o=>this.dialogElement=o,onClick:o=>o.stopPropagation()},n("div",{key:"8cc68ecefa37ec1db65f6c910d1da40f9144e722",class:"focus-guard",tabindex:e,onFocus:this.handleStartGuardFocus}),t?n("div",{class:"modal-close-button-wrap"},n("button",{type:"button",class:"modal-close-button","aria-label":d.t("Close"),ref:o=>this.closeButtonElement=o,onClick:()=>this.closeModal()},n("ion-icon",{name:"close",size:"large","aria-hidden":"true"}))):null,n("div",{key:"26271a75906a72e9944599f98da007bfebc2e348",class:"modal-loading"},n("svg",{key:"bc6b1267e2f3b6b1dd7209db55be717fddf9acd4",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2400 2400"},n("g",{key:"00ed54798ac376ed71f87a088fad2519cb1262dc","stroke-width":"200","stroke-linecap":"round",stroke:"currentColor",fill:"none",id:"spinner"},n("line",{key:"98242d65eb9470430bd5cc656cbb479232782746",x1:"1200",y1:"600",x2:"1200",y2:"100"}),n("line",{key:"2e2f0538a6d048465ef5f8a3d5ed1932f6c59270",opacity:"0.5",x1:"1200",y1:"2300",x2:"1200",y2:"1800"}),n("line",{key:"11f850b0e7dc0d259f35f56aab17068d4d25ca95",opacity:"0.917",x1:"900",y1:"680.4",x2:"650",y2:"247.4"}),n("line",{key:"14c3226b5d2741902f428a208966adf016c1bb7e",opacity:"0.417",x1:"1750",y1:"2152.6",x2:"1500",y2:"1719.6"}),n("line",{key:"d41da322484b62c1db1df72b9bd1bcc0dbb85a2c",opacity:"0.833",x1:"680.4",y1:"900",x2:"247.4",y2:"650"}),n("line",{key:"246dcdd4a011775dc8fea8a05cfcfc429d5bd03c",opacity:"0.333",x1:"2152.6",y1:"1750",x2:"1719.6",y2:"1500"}),n("line",{key:"f0a2d217a33a8caa6995a30d840002cb8c076e8d",opacity:"0.75",x1:"600",y1:"1200",x2:"100",y2:"1200"}),n("line",{key:"7552fb2c04f85c54b8bcc2235a32690e4489177f",opacity:"0.25",x1:"2300",y1:"1200",x2:"1800",y2:"1200"}),n("line",{key:"7b5a62164a0ef759b057f9100c7c5af834c9f6b7",opacity:"0.667",x1:"680.4",y1:"1500",x2:"247.4",y2:"1750"}),n("line",{key:"d36af9d23059da4ca91147084e47ba94e19f5ada",opacity:"0.167",x1:"2152.6",y1:"650",x2:"1719.6",y2:"900"}),n("line",{key:"f8eed2a97d817b68e0b29f5b5037d34d46a79a46",opacity:"0.583",x1:"900",y1:"1719.6",x2:"650",y2:"2152.6"}),n("line",{key:"1641d577b703e213157bc553966e434a40ba7158",opacity:"0.083",x1:"1750",y1:"247.4",x2:"1500",y2:"680.4"}),n("animateTransform",{key:"60fb2d30c248db1b4195d6015dc96225a15e4010",attributeName:"transform",attributeType:"XML",type:"rotate",keyTimes:"0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667",values:"0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199",dur:"0.83333s",begin:"0s",repeatCount:"indefinite",calcMode:"discrete"})))),n("div",{key:"27d3b71da43e5935dff3eff2e1bc507a24261b70",class:"modal-content",ref:o=>this.contentElement=o},n("slot",{key:"641408238d3969b830d1f3e9398be6f05bc1f65b"})),n("div",{key:"c6178542b98a99d6a50b74270adc273671d5cc19",class:"focus-guard",tabindex:e,onFocus:this.handleEndGuardFocus}))))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return':root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}:host{box-sizing:border-box}:host *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}:host button{cursor:pointer}:host{display:block}.modal-row{opacity:0;pointer-events:none;will-change:transform;visibility:hidden}.modal-row.open{opacity:1;pointer-events:auto;visibility:visible;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-row .modal-child{transform:translateY(100%);transition:transform 420ms ease;position:relative}.modal-row .modal-child .modal-loading{display:none;position:absolute;top:160px;left:50%;transform:translateX(-50%);width:24px;height:24px}.modal-row .modal-child.loading .modal-loading{display:flex;justify-content:center;align-items:center}.modal-row .modal-child.loading .modal-loading svg{width:24px;height:24px}.modal-row .modal-child.loading .modal-content{visibility:hidden}.modal-row.open .modal-child{transform:translateY(0%)}.modal-child{padding:16px 8px 24px;background-color:#fff;width:100%;max-height:100vh;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{display:block;width:32px;cursor:pointer;border-radius:4px}.modal-close-button-wrap .modal-close-button:focus-visible{outline:2px solid var(--color-label, #000);outline-offset:2px}.modal-close-button-wrap .modal-close-button ion-icon{width:32px;display:block;fill:var(--color-label)}.modal-child:focus{outline:none}.focus-guard{position:absolute;width:1px;height:1px;overflow:hidden}'}},[257,"stripe-modal",{showCloseButton:[4,"show-close-button"],open:[1028],renderedOpen:[32],toggleModal:[64],openModal:[64],closeModal:[64]},void 0,{open:[{onOpenChange:0}]}]);function f(){"undefined"!=typeof customElements&&["stripe-modal","ion-icon"].forEach((t=>{switch(t){case"stripe-modal":customElements.get(o(t))||customElements.define(o(t),b);break;case"ion-icon":customElements.get(o(t))||l()}}))}f();export{b as S,f as d}
@@ -1 +1 @@
1
- import{S as e}from"./error.js";const r=e=>{const{progress:r,isCheckoutSession:t,loadStripeStatus:i,intentClientSecret:n}=e;return"loading"===r||!(t?"success"===i:null!=n&&""!==n)},t=async(r,t,i,n)=>{const o=await("payment"===i?r.confirmPayment({elements:t,confirmParams:{return_url:n},redirect:"if_required"}):r.confirmSetup({elements:t,confirmParams:{return_url:n},redirect:"if_required"}));if(o.error)throw new e(o.error);return o},i=async(r,t)=>{var i;const n=await r.loadActions();if("error"===n.type)throw new e({type:"api_error",code:n.error.code||"checkout_session_error",message:n.error.message});const{actions:o}=n,s=await o.confirm({returnUrl:t,redirect:"if_required"});if("error"===s.type){const r={type:"card_error",code:s.error.code||"payment_failed",message:s.error.message,decline_code:"paymentFailed"===s.error.code?null===(i=s.error.paymentFailed)||void 0===i?void 0:i.declineCode:void 0};throw new e(r)}return s},n=e=>{const{stripe:r,isCheckoutSession:t,checkout:i,checkoutSessionClientSecret:n,elements:o,intentClientSecret:s}=e,c={stripe:r};return t?null==i?{error:"Checkout not properly initialized"}:(c.checkout=i,c.checkoutSessionClientSecret=n,{props:c}):null==o?{error:"Elements not properly initialized"}:(c.elements=o,c.intentClientSecret=s,{props:c})};export{i as a,n as b,t as c,r as i}
1
+ import{S as e}from"./error.js";const r=e=>{const{progress:r,isCheckoutSession:t,loadStripeStatus:i,intentClientSecret:n}=e;return"loading"===r||!(t?"success"===i:null!=n&&""!==n)},t=async(r,t,i,n,o)=>{const s=await("payment"===i?r.confirmPayment({elements:t,confirmParams:Object.assign({return_url:n},o),redirect:"if_required"}):r.confirmSetup({elements:t,confirmParams:Object.assign({return_url:n},o),redirect:"if_required"}));if(s.error)throw new e(s.error);return s},i=async(r,t)=>{var i;const n=await r.loadActions();if("error"===n.type)throw new e({type:"api_error",code:n.error.code||"checkout_session_error",message:n.error.message});const{actions:o}=n,s=await o.confirm({returnUrl:t,redirect:"if_required"});if("error"===s.type){const r={type:"card_error",code:s.error.code||"payment_failed",message:s.error.message,decline_code:"paymentFailed"===s.error.code?null===(i=s.error.paymentFailed)||void 0===i?void 0:i.declineCode:void 0};throw new e(r)}return s},n=e=>{const{stripe:r,isCheckoutSession:t,checkout:i,checkoutSessionClientSecret:n,elements:o,intentClientSecret:s}=e,c={stripe:r};return t?null==i?{error:"Checkout not properly initialized"}:(c.checkout=i,c.checkoutSessionClientSecret=n,{props:c}):null==o?{error:"Elements not properly initialized"}:(c.elements=o,c.intentClientSecret=s,{props:c})};export{i as a,n as b,t as c,r as i}
@@ -1 +1 @@
1
- import{transformTag as e,proxyCustomElement as t,HTMLElement as s,createEvent as n,h as i,Host as a}from"@stencil/core/internal/client";import{c as r,i as o}from"./i18n.js";import{s as c}from"./factory.js";import{c as d}from"./stripe-payment-element.helpers.js";import{d as p}from"./icon.js";import{d as l}from"./stripe-modal2.js";const h={phase:"idle",generation:0,pendingPresent:!1,openRequested:!1},m=[[/^pi_[A-Za-z0-9]+_secret_[A-Za-z0-9]+$/,"payment"],[/^seti_[A-Za-z0-9]+_secret_[A-Za-z0-9]+$/,"setup"]],u=e=>({state:e,effects:[]}),b=(e,t)=>e.pendingPresent?{state:Object.assign(Object.assign({},e),{pendingPresent:!1}),effects:[{type:"resolvePresent",result:t}]}:u(e),f=e=>{const t=b(Object.assign(Object.assign({},e),{openRequested:!1}),"paymentSheetCanceled");return{state:t.state,effects:[..."presented"===e.phase||"confirming"===e.phase?[{type:"hide"}]:[],{type:"emit",event:"paymentSheetCanceled"},...t.effects]}},y=(e,t)=>{if(""===t)return u(e);if("confirming"===e.phase)return u(Object.assign(Object.assign({},e),{deferredClientSecret:t}));const s="presented"===e.phase?f(e):u(e),n=e.generation+1,i=(e=>{const t=m.find((([t])=>t.test(e)));return null==t?void 0:t[1]})(t);if(null==i){const e=b(Object.assign(Object.assign({},s.state),{phase:"loadFailed",generation:n,intentKind:void 0,openRequested:!1}),"paymentSheetFailed");return{state:e.state,effects:[...s.effects,{type:"emit",event:"paymentSheetFailedToLoad"},...e.effects]}}return{state:Object.assign(Object.assign({},s.state),{phase:"loading",generation:n,intentKind:i}),effects:[...s.effects,{type:"load",generation:n,clientSecret:t,intentKind:i}]}},g=e=>{const{deferredClientSecret:t}=e.state;if(null==t)return e;const s=y(Object.assign(Object.assign({},e.state),{deferredClientSecret:void 0}),t);return{state:s.state,effects:[...e.effects,...s.effects]}},v=(e,t)=>"confirming"===e.phase&&e.generation===t;var j=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(s[n[i]]=e[n[i]])}return s};const O=["merchantDisplayName","paymentMethodLayout","defaultBillingDetails","returnURL","style"],S={horizontal:"tabs",vertical:"accordion",automatic:"auto"},w={alwaysLight:"stripe",alwaysDark:"night"},C=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e))),k=["card_error","validation_error","api_connection_error","rate_limit_error","api_error"],x=t(class extends s{async present(){null==this.presentPromise&&(this.presentPromise=new Promise((e=>{this.resolvePresent=e})));const e=this.presentPromise;return this.dispatch({type:"presentRequested"}),e}handleSecretChange(){this.startLoading()}handleOpenChange(e){this.dispatch({type:e?"openRequested":"closeRequested"})}constructor(e){super(),!1!==e&&this.__registerHost(),this.paymentSheetLoaded=n(this,"paymentSheetLoaded",7),this.paymentSheetFailedToLoad=n(this,"paymentSheetFailedToLoad",7),this.paymentSheetCompleted=n(this,"paymentSheetCompleted",7),this.paymentSheetCanceled=n(this,"paymentSheetCanceled",7),this.paymentSheetFailed=n(this,"paymentSheetFailed",7),this.warnedUnsupportedOptions=!1,this.open=!1,this.sheetTitle="Add your payment information",this.buttonLabel="Pay",this.applicationName="stripe-pwa-elements",this.sheet=h,this.visible=!1,this.errorMessage="",this.handleSubmit=e=>{e.preventDefault(),this.errorMessage="",this.dispatch({type:"submitted"})},this.handleModalClose=()=>{var e;this.dispatch({type:"closeRequested"}),this.visible&&(null===(e=this.el.querySelector("stripe-modal"))||void 0===e||e.openModal())},this.stripeService=c.createStripeService(),this.paymentElementManager=c.createPaymentElementManager(this.stripeService)}componentWillLoad(){this.open&&this.dispatch({type:"openRequested"}),this.startLoading()}componentDidLoad(){this.el.classList.add(r())}disconnectedCallback(){this.paymentElementManager.unmount()}startLoading(){null!=this.publishableKey&&""!==this.publishableKey&&null!=this.intentClientSecret&&this.dispatch({type:"secretChanged",clientSecret:this.intentClientSecret})}dispatch(e){const{state:t,effects:s}=((e,t)=>{switch(t.type){case"secretChanged":return y(e,t.clientSecret);case"loadSucceeded":{if(t.generation!==e.generation||"loading"!==e.phase)return u(e);const s=e.openRequested;return{state:Object.assign(Object.assign({},e),{phase:s?"presented":"ready",openRequested:!1}),effects:[{type:"emit",event:"paymentSheetLoaded"},...s?[{type:"show"}]:[]]}}case"loadFailed":{if(t.generation!==e.generation||"loading"!==e.phase)return u(e);const s=b(Object.assign(Object.assign({},e),{phase:"loadFailed",openRequested:!1}),"paymentSheetFailed");return{state:s.state,effects:[{type:"emit",event:"paymentSheetFailedToLoad"},...s.effects]}}case"presentRequested":if(e.pendingPresent)return u(e);switch(e.phase){case"ready":return{state:Object.assign(Object.assign({},e),{phase:"presented",pendingPresent:!0}),effects:[{type:"show"}]};case"idle":case"loading":return u(Object.assign(Object.assign({},e),{pendingPresent:!0,openRequested:!0}));case"presented":case"confirming":return u(Object.assign(Object.assign({},e),{pendingPresent:!0}));default:return{state:e,effects:[{type:"resolvePresent",result:"paymentSheetFailed"}]}}case"openRequested":return"ready"===e.phase?{state:Object.assign(Object.assign({},e),{phase:"presented"}),effects:[{type:"show"}]}:u("idle"===e.phase||"loading"===e.phase?Object.assign(Object.assign({},e),{openRequested:!0}):e);case"closeRequested":if("presented"===e.phase){const t=f(e);return{state:Object.assign(Object.assign({},t.state),{phase:"ready"}),effects:t.effects}}return"idle"!==e.phase&&"loading"!==e.phase||!e.openRequested?u(e):f(e);case"submitted":return"presented"!==e.phase||null==e.intentKind?u(e):{state:Object.assign(Object.assign({},e),{phase:"confirming"}),effects:[{type:"confirm",generation:e.generation,intentKind:e.intentKind}]};case"confirmSucceeded":{if(!v(e,t.generation))return u(e);const s=b(Object.assign(Object.assign({},e),{phase:"completed"}),"paymentSheetCompleted");return g({state:s.state,effects:[{type:"hide"},{type:"emit",event:"paymentSheetCompleted"},...s.effects]})}case"confirmDeclined":return v(e,t.generation)?g({state:Object.assign(Object.assign({},e),{phase:"presented"}),effects:[{type:"showError",message:t.message}]}):u(e);case"confirmFailed":{if(!v(e,t.generation))return u(e);const s=b(Object.assign(Object.assign({},e),{phase:"errored"}),"paymentSheetFailed");return g({state:s.state,effects:[{type:"hide"},{type:"emit",event:"paymentSheetFailed"},...s.effects]})}}})(this.sheet,e);this.sheet=t,s.forEach((e=>this.perform(e)))}perform(e){var t;switch(e.type){case"load":this.load(e.generation,e.clientSecret);break;case"show":this.visible=!0,this.open=!0;break;case"hide":this.visible=!1,this.open=!1;break;case"confirm":this.confirm(e.generation,e.intentKind);break;case"showError":this.errorMessage=e.message;break;case"emit":this.emit(e.event);break;case"resolvePresent":null===(t=this.resolvePresent)||void 0===t||t.call(this,{paymentResult:e.result}),this.presentPromise=void 0,this.resolvePresent=void 0}}async load(e,t){var s;this.warnUnsupportedOptions();try{if(await this.stripeService.initialize(this.publishableKey,{stripeAccount:this.stripeAccount,applicationName:this.applicationName,clientSecret:t}),e!==this.sheet.generation)return;if("success"!==this.stripeService.state.loadStripeStatus)throw Error("Failed to load Stripe.js");const n=(e=>{if(null!=e)return{theme:w[e]}})(null===(s=this.options)||void 0===s?void 0:s.style);null!=n&&await this.stripeService.getElements().update({appearance:n}),await this.paymentElementManager.initialize(this.el,(e=>{if(null==e)return{};const{merchantDisplayName:t,paymentMethodLayout:s,defaultBillingDetails:n}=e,i={};if(null!=t&&(i.business={name:t}),null!=s&&(i.layout=S[s]),null!=n){const{address:e}=n,t=j(n,["address"]),s=C(t);if(null!=e){const{postalCode:t}=e,n=j(e,["postalCode"]);s.address=C(Object.assign(Object.assign({},n),{postal_code:t}))}i.defaultValues={billingDetails:s}}return i})(this.options)),this.dispatch({type:"loadSucceeded",generation:e})}catch(t){this.lastError=t,this.dispatch({type:"loadFailed",generation:e})}}async confirm(e,t){var s,n,i;try{const i=null!==(n=null===(s=this.options)||void 0===s?void 0:s.returnURL)&&void 0!==n?n:window.location.href;this.lastResult=await d(this.stripeService.getStripe(),this.stripeService.getElements(),t,i),this.dispatch({type:"confirmSucceeded",generation:e})}catch(t){const s=null!==(i=t.message)&&void 0!==i?i:t+"";if((e=>{const t=null==e?void 0:e.type;return"string"==typeof t&&k.includes(t)})(t))return void this.dispatch({type:"confirmDeclined",generation:e,message:s});this.lastError=t,this.dispatch({type:"confirmFailed",generation:e,message:s})}}emit(e){switch(e){case"paymentSheetLoaded":this.paymentSheetLoaded.emit({stripe:this.stripeService.getStripe()});break;case"paymentSheetFailedToLoad":this.paymentSheetFailedToLoad.emit(this.lastError);break;case"paymentSheetCompleted":this.paymentSheetCompleted.emit(this.lastResult);break;case"paymentSheetCanceled":this.paymentSheetCanceled.emit();break;case"paymentSheetFailed":this.paymentSheetFailed.emit(this.lastError)}}warnUnsupportedOptions(){const e=(e=>null==e?[]:Object.entries(e).filter((([e,t])=>void 0!==t&&!O.includes(e))).map((([e])=>e)).sort())(this.options);this.warnedUnsupportedOptions||0===e.length||(this.warnedUnsupportedOptions=!0,console.warn("<stripe-payment-sheet>: these options have no effect on the web yet: "+e.join(", ")))}render(){const{phase:e}=this.sheet,t="confirming"===e;return i(a,{key:"ecb6de4b0674af9f5ecf86acce93e092c3bee881"},i("stripe-modal",{key:"137473608d8cc3c0833c34529f1dafb9fc0cba34",open:this.visible,showCloseButton:!t,onClose:this.handleModalClose},i("div",{key:"0da153ef48ddc5464f050ea1921a69f975a7d8e1",class:"stripe-payment-sheet-wrap"},i("form",{key:"6f6653aee9d0ad54c8bf935ace2f6d4fdc648e1f",id:"stripe-payment-sheet",onSubmit:this.handleSubmit},i("div",{key:"85d3e28a20679051decdb02d590c2144e652f0bd",class:"stripe-heading"},o.t(this.sheetTitle)),i("div",{key:"f6b8d90a3731732c0b36af0512a5ace87a12f98d",class:"payment-info visible"},i("div",{key:"813a1ad3a0db2efa650aceff828412999f34ff2b",id:"payment-element"})),i("div",{key:"63bd6a8c20dd7b8b92aa2171553c13570ab17808",class:"stripe-element-errors",role:"alert"},this.errorMessage),i("div",{key:"f70e9b353ae9eecd1300bbbd40ebb731ef44c344",class:"stripe-submit"},i("button",{key:"6f32a7b94132091348680476b0e7292072800dbf",type:"submit",disabled:"presented"!==e},o.t(t?"Loading":this.buttonLabel)))))))}get el(){return this}static get watchers(){return{publishableKey:[{handleSecretChange:0}],intentClientSecret:[{handleSecretChange:0}],stripeAccount:[{handleSecretChange:0}],open:[{handleOpenChange:0}]}}static get style(){return':root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}stripe-payment-sheet{display:contents}.stripe-payment-sheet-wrap{box-sizing:border-box}.stripe-payment-sheet-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}.stripe-payment-sheet-wrap button{cursor:pointer}.stripe-payment-sheet-wrap{display:block;width:100%;background:#fff;padding:32px 16px}.stripe-payment-sheet-wrap .stripe-heading{font-size:24px;font-weight:bold;color:var(--color-heading-text);margin-bottom:24px}.stripe-payment-sheet-wrap .payment-info{margin-top:8px}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.stripe-payment-sheet-wrap .stripe-submit{margin-top:32px}.stripe-payment-sheet-wrap button{display:block;color:var(--color-button-text);background-color:var(--color-primary);width:100%;text-align:center;padding:16px 16px;font-size:18px;border-radius:6px;min-height:42px}.stripe-payment-sheet-wrap button:disabled{color:var(--color-button-text-disabled)}'}},[0,"stripe-payment-sheet",{publishableKey:[1,"publishable-key"],intentClientSecret:[1,"intent-client-secret"],stripeAccount:[1,"stripe-account"],open:[1540],sheetTitle:[1,"sheet-title"],buttonLabel:[1,"button-label"],applicationName:[1,"application-name"],options:[16],sheet:[32],visible:[32],errorMessage:[32],present:[64]},void 0,{publishableKey:[{handleSecretChange:0}],intentClientSecret:[{handleSecretChange:0}],stripeAccount:[{handleSecretChange:0}],open:[{handleOpenChange:0}]}]);function F(){"undefined"!=typeof customElements&&["stripe-payment-sheet","ion-icon","stripe-modal"].forEach((t=>{switch(t){case"stripe-payment-sheet":customElements.get(e(t))||customElements.define(e(t),x);break;case"ion-icon":customElements.get(e(t))||p();break;case"stripe-modal":customElements.get(e(t))||l()}}))}F();const R=x,L=F;export{R as StripePaymentSheet,L as defineCustomElement}
1
+ import{transformTag as e,proxyCustomElement as t,HTMLElement as i,createEvent as n,h as s,Host as a}from"@stencil/core/internal/client";import{c as r,i as o}from"./i18n.js";import{s as l,f as c}from"./factory.js";import{c as d}from"./stripe-payment-element.helpers.js";import{S as h}from"./error.js";import{d as p}from"./icon.js";import{d as u}from"./stripe-modal2.js";const m={phase:"idle",generation:0,pendingPresent:!1,openRequested:!1},f=[[/^pi_[A-Za-z0-9]+_secret_[A-Za-z0-9]+$/,"payment"],[/^seti_[A-Za-z0-9]+_secret_[A-Za-z0-9]+$/,"setup"]],y=e=>({state:e,effects:[]}),b=(e,t)=>e.pendingPresent?{state:Object.assign(Object.assign({},e),{pendingPresent:!1}),effects:[{type:"resolvePresent",result:t}]}:y(e),v=e=>{const t=b(Object.assign(Object.assign({},e),{openRequested:!1}),"paymentSheetCanceled");return{state:t.state,effects:[..."presented"===e.phase||"confirming"===e.phase?[{type:"hide"}]:[],{type:"emit",event:"paymentSheetCanceled"},...t.effects]}},g=(e,t,i)=>{if(""===t)return y(e);if("confirming"===e.phase)return y(Object.assign(Object.assign({},e),{deferredSecret:{clientSecret:t,source:i}}));const n="presented"===e.phase?v(e):y(e),s=e.generation+1,a=((e,t)=>"checkoutSession"===t?"checkoutSession":(e=>{const t=f.find((([t])=>t.test(e)));return null==t?void 0:t[1]})(e))(t,i);if(null==a){const e=b(Object.assign(Object.assign({},n.state),{phase:"loadFailed",generation:s,intentKind:void 0,openRequested:!1}),"paymentSheetFailed");return{state:e.state,effects:[...n.effects,{type:"emit",event:"paymentSheetFailedToLoad"},...e.effects]}}return{state:Object.assign(Object.assign({},n.state),{phase:"loading",generation:s,intentKind:a}),effects:[...n.effects,{type:"load",generation:s,clientSecret:t,intentKind:a}]}},w=e=>{const{deferredSecret:t}=e.state;if(null==t)return e;const i=g(Object.assign(Object.assign({},e.state),{deferredSecret:void 0}),t.clientSecret,t.source);return{state:i.state,effects:[...e.effects,...i.effects]}},S=(e,t)=>"confirming"===e.phase&&e.generation===t;var j=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i};const O=["merchantDisplayName","paymentMethodLayout","defaultBillingDetails","returnURL","style","billingDetailsCollectionConfiguration","shippingDetails","enableApplePay","enableGooglePay"],k={horizontal:"tabs",vertical:"accordion",automatic:"auto"},C={alwaysLight:"stripe",alwaysDark:"night"},x=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e))),_=e=>{const{postalCode:t}=e,i=j(e,["postalCode"]);return x(Object.assign(Object.assign({},i),{postal_code:t}))},D=e=>null==e?void 0:e?"auto":"never",P=e=>{if(null==e)return{};const{merchantDisplayName:t,paymentMethodLayout:i,defaultBillingDetails:n,billingDetailsCollectionConfiguration:s,enableApplePay:a,enableGooglePay:r}=e,o={},l=(e=>{if(null==e)return;const{email:t,name:i,phone:n,address:s}=e,a=x({email:"never"===t||"always"===t?"never":void 0,name:"never"===i?"never":void 0,phone:"never"===n||"always"===n&&"full"===s?"never":void 0,address:"never"===s||"full"===s?"never":void 0});return 0===Object.keys(a).length?void 0:a})(s),c=x({applePay:D(a),googlePay:D(r)});if(null!=l&&(o.fields={billingDetails:l}),Object.keys(c).length>0&&(o.wallets=c),null!=t&&(o.business={name:t}),null!=i&&(o.layout=k[i]),null!=n){const{address:e}=n,t=j(n,["address"]),i=x(t);null!=e&&(i.address=_(e)),o.defaultValues={billingDetails:i}}return o},F=e=>{if(null!=e)return{theme:C[e]}},q=e=>{const{name:t,phone:i,address:n}=e,s=null==n?void 0:n.country;return x({name:t,phone:i,address:null==s||""===s?void 0:Object.assign(Object.assign({},_(n)),{country:s})})},E=e=>null==e||""===e,R=(e,t)=>Error(`<stripe-payment-sheet>: billingDetailsCollectionConfiguration.${e} is 'never', so defaultBillingDetails.${t} is required`),A=e=>Object.assign(Error(e),{type:"validation_error",sheetValidation:!0}),L=["card_error","validation_error","api_connection_error","rate_limit_error","api_error"],z=e=>{const t=F(null==e?void 0:e.style);return null==t?void 0:{appearance:t}},N=(e,t)=>{if(null!=e&&"open"!==e.type)throw new h({type:"invalid_request_error",code:"checkout_session_"+e.type,message:null!=t?t:`The Checkout Session is ${e.type} and can no longer be paid.`})},B=e=>null==e||""===e?void 0:e,K=t(class extends i{async present(){null==this.presentPromise&&(this.presentPromise=new Promise((e=>{this.resolvePresent=e})));const e=this.presentPromise;return this.dispatch({type:"presentRequested"}),e}handleSecretChange(){this.startLoading()}handleOpenChange(e){this.dispatch({type:e?"openRequested":"closeRequested"})}constructor(e){super(),!1!==e&&this.__registerHost(),this.paymentSheetLoaded=n(this,"paymentSheetLoaded",7),this.paymentSheetFailedToLoad=n(this,"paymentSheetFailedToLoad",7),this.paymentSheetCompleted=n(this,"paymentSheetCompleted",7),this.paymentSheetCanceled=n(this,"paymentSheetCanceled",7),this.paymentSheetFailed=n(this,"paymentSheetFailed",7),this.warnedUnsupportedOptions=!1,this.warnedCheckoutIgnoredOptions=!1,this.open=!1,this.sheetTitle="Add your payment information",this.buttonLabel="Pay",this.applicationName="stripe-pwa-elements",this.sheet=m,this.visible=!1,this.errorMessage="",this.handleSubmit=e=>{e.preventDefault(),this.errorMessage="",this.dispatch({type:"submitted"})},this.handleModalClose=()=>{var e;this.dispatch({type:"closeRequested"}),this.visible&&(null===(e=this.el.querySelector("stripe-modal"))||void 0===e||e.openModal())},this.stripeService=l.createStripeService(),this.paymentElementManager=l.createPaymentElementManager(this.stripeService),this.billingAddressElementManager=l.createAddressElementManager(this.stripeService),this.shippingAddressElementManager=l.createAddressElementManager(this.stripeService),this.emailElementManager=l.createLinkAuthenticationElementManager(this.stripeService)}componentWillLoad(){this.open&&this.dispatch({type:"openRequested"}),this.startLoading()}componentDidLoad(){this.el.classList.add(r())}disconnectedCallback(){this.paymentElementManager.unmount(),this.unmountExtraElements()}unmountExtraElements(){this.billingAddressElementManager.unmount(),this.shippingAddressElementManager.unmount(),this.emailElementManager.unmount()}startLoading(){const e=this.loadTarget();null!=e&&e.key!==this.lastLoadKey&&(this.lastLoadKey=e.key,this.dispatch({type:"secretChanged",clientSecret:e.clientSecret,source:e.source}))}loadTarget(){var e;const t=B(this.publishableKey);if(null==t)return;const i=B(this.checkoutSessionClientSecret),n=B(this.intentClientSecret),[s,a]=null!=i?[i,"checkoutSession"]:[n,"intent"];return null!=s?{key:JSON.stringify([t,null!==(e=B(this.stripeAccount))&&void 0!==e?e:null,a,s]),clientSecret:s,source:a}:void 0}dispatch(e){const{state:t,effects:i}=((e,t)=>{switch(t.type){case"secretChanged":return g(e,t.clientSecret,t.source);case"loadSucceeded":{if(t.generation!==e.generation||"loading"!==e.phase)return y(e);const i=e.openRequested;return{state:Object.assign(Object.assign({},e),{phase:i?"presented":"ready",openRequested:!1}),effects:[{type:"emit",event:"paymentSheetLoaded"},...i?[{type:"show"}]:[]]}}case"loadFailed":{if(t.generation!==e.generation||"loading"!==e.phase)return y(e);const i=b(Object.assign(Object.assign({},e),{phase:"loadFailed",openRequested:!1}),"paymentSheetFailed");return{state:i.state,effects:[{type:"emit",event:"paymentSheetFailedToLoad"},...i.effects]}}case"presentRequested":if(e.pendingPresent)return y(e);switch(e.phase){case"ready":return{state:Object.assign(Object.assign({},e),{phase:"presented",pendingPresent:!0}),effects:[{type:"show"}]};case"idle":case"loading":return y(Object.assign(Object.assign({},e),{pendingPresent:!0,openRequested:!0}));case"presented":case"confirming":return y(Object.assign(Object.assign({},e),{pendingPresent:!0}));default:return{state:e,effects:[{type:"resolvePresent",result:"paymentSheetFailed"}]}}case"openRequested":return"ready"===e.phase?{state:Object.assign(Object.assign({},e),{phase:"presented"}),effects:[{type:"show"}]}:y("idle"===e.phase||"loading"===e.phase?Object.assign(Object.assign({},e),{openRequested:!0}):e);case"closeRequested":if("presented"===e.phase){const t=v(e);return{state:Object.assign(Object.assign({},t.state),{phase:"ready"}),effects:t.effects}}return"idle"!==e.phase&&"loading"!==e.phase||!e.openRequested?y(e):v(e);case"submitted":return"presented"!==e.phase||null==e.intentKind?y(e):{state:Object.assign(Object.assign({},e),{phase:"confirming"}),effects:[{type:"confirm",generation:e.generation,intentKind:e.intentKind}]};case"confirmSucceeded":{if(!S(e,t.generation))return y(e);const i=b(Object.assign(Object.assign({},e),{phase:"completed"}),"paymentSheetCompleted");return w({state:i.state,effects:[{type:"hide"},{type:"emit",event:"paymentSheetCompleted"},...i.effects]})}case"confirmDeclined":return S(e,t.generation)?w({state:Object.assign(Object.assign({},e),{phase:"presented"}),effects:[{type:"showError",message:t.message}]}):y(e);case"confirmFailed":{if(!S(e,t.generation))return y(e);const i=b(Object.assign(Object.assign({},e),{phase:"errored"}),"paymentSheetFailed");return w({state:i.state,effects:[{type:"hide"},{type:"emit",event:"paymentSheetFailed"},...i.effects]})}}})(this.sheet,e);this.sheet=t,i.forEach((e=>this.perform(e)))}perform(e){var t;switch(e.type){case"load":"checkoutSession"===e.intentKind?this.loadCheckoutSession(e.generation,e.clientSecret):this.load(e.generation,e.clientSecret,e.intentKind);break;case"show":this.visible=!0,this.open=!0;break;case"hide":this.visible=!1,this.open=!1;break;case"confirm":"checkoutSession"===e.intentKind?this.confirmCheckoutSession(e.generation):this.confirm(e.generation,e.intentKind);break;case"showError":this.errorMessage=e.message;break;case"emit":this.emit(e.event);break;case"resolvePresent":null===(t=this.resolvePresent)||void 0===t||t.call(this,{paymentResult:e.result}),this.presentPromise=void 0,this.resolvePresent=void 0}}async load(e,t,i){var n;this.warnUnsupportedOptions(i);const s=()=>e!==this.sheet.generation;try{const a=((e,t)=>{var i,n,s,a,r,o,l;const c=null!==(i=null==e?void 0:e.billingDetailsCollectionConfiguration)&&void 0!==i?i:{},d=null!==(n=null==e?void 0:e.defaultBillingDetails)&&void 0!==n?n:{},h={};if(["email","name","phone"].forEach((e=>{if("never"===c[e]){if(E(d[e]))throw R(e,e);h[e]=d[e]}})),"never"===c.address){const e=d.address;if(null==e||E(e.country))throw R("address","address.country");h.address={line1:null!==(s=e.line1)&&void 0!==s?s:"",line2:null!==(a=e.line2)&&void 0!==a?a:"",city:null!==(r=e.city)&&void 0!==r?r:"",state:null!==(o=e.state)&&void 0!==o?o:"",postal_code:null!==(l=e.postalCode)&&void 0!==l?l:"",country:e.country}}const p="full"===c.address&&"always"===c.phone,u={fixedBillingDetails:h,collectPhoneFromAddress:p};if("full"===c.address){const e={mode:"billing",defaultValues:q(d)};p?(e.fields={phone:"always"},e.validation={phone:{required:"always"}}):"never"===c.phone&&(e.fields={phone:"never"}),u.billingAddressElement=e}"always"===c.email&&(u.emailElement=E(d.email)?{}:{defaultValues:{email:d.email}});const m=null==e?void 0:e.shippingDetails;if(null!=m&&"payment"===t){const e={mode:"shipping",defaultValues:q(m)};E(m.phone)||(e.fields={phone:"always"}),u.shippingAddressElement=e}return u})(this.options,i);if(await this.stripeService.initialize(this.publishableKey,{stripeAccount:this.stripeAccount,applicationName:this.applicationName,clientSecret:t}),s())return;if("success"!==this.stripeService.state.loadStripeStatus)throw Error("Failed to load Stripe.js");const r=F(null===(n=this.options)||void 0===n?void 0:n.style);if(null!=r&&(await this.stripeService.getElements().update({appearance:r}),s()))return;if(!await this.mountExtraElements(a,s))return;await this.paymentElementManager.initialize(this.el,P(this.options)),this.dispatch({type:"loadSucceeded",generation:e})}catch(t){if(s())return;this.lastError=t,this.dispatch({type:"loadFailed",generation:e})}}async mountExtraElements(e,t){this.collection=e;const{emailElement:i,shippingAddressElement:n,billingAddressElement:s}=e,a=[{manager:this.emailElementManager,selector:".stripe-payment-sheet-email",mount:i&&(e=>this.emailElementManager.initialize(e,i))},{manager:this.shippingAddressElementManager,selector:".stripe-payment-sheet-shipping-address",mount:n&&(e=>this.shippingAddressElementManager.initialize(e,n))},{manager:this.billingAddressElementManager,selector:".stripe-payment-sheet-billing-address",mount:s&&(e=>this.billingAddressElementManager.initialize(e,s))}];for(const{manager:e,selector:i,mount:n}of a){if(null==n){e.unmount();continue}const s=await c(this.el,i);if(t())return!1;if(await n(s),t())return!1}return!0}async confirmParams(){var e;const t=this.collection;if(null==t)return;const i=null!=t.billingAddressElement?await(null===(e=this.billingAddressElementManager.getElement())||void 0===e?void 0:e.getValue()):void 0,n=null!=t.emailElement?this.emailElementManager.getState():void 0,s=((e,t)=>{var i,n;const s={};if(null!=e.billingAddressElement){const i=t.billingAddress;if(null==i||!i.complete)throw A("Please complete your billing address.");s.name=i.value.name,s.address=i.value.address,e.collectPhoneFromAddress&&(s.phone=i.value.phone)}if(null!=e.emailElement){const a=null!==(i=t.email)&&void 0!==i?i:null===(n=e.emailElement.defaultValues)||void 0===n?void 0:n.email;if(E(a))throw A("Please enter your email address.");if(!1===t.emailComplete||null==t.emailComplete&&!(e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))(a))throw A("Please enter a valid email address.");s.email=a}return Object.assign(s,e.fixedBillingDetails),0===Object.keys(s).length?void 0:s})(t,{billingAddress:i,email:null==n?void 0:n.email,emailComplete:null==n?void 0:n.complete});return null==s?void 0:{payment_method_data:{billing_details:s}}}confirm(e,t){return this.runConfirm(e,(async()=>{var e,i;const n=this.stripeService.getElements(),{error:s}=await n.submit();if(null!=s)throw s;const a=null!==(i=null===(e=this.options)||void 0===e?void 0:e.returnURL)&&void 0!==i?i:window.location.href,r=await this.confirmParams();return d(this.stripeService.getStripe(),n,t,a,r)}))}async runConfirm(e,t){var i;try{this.lastResult=await t(),this.dispatch({type:"confirmSucceeded",generation:e})}catch(t){const n=null!==(i=t.message)&&void 0!==i?i:t+"",s=(e=>!0===(null==e?void 0:e.sheetValidation))(t)?o.t(n):n;if((e=>{const t=null==e?void 0:e.type;return"string"==typeof t&&L.includes(t)})(t))return void this.dispatch({type:"confirmDeclined",generation:e,message:s});this.lastError=t,this.dispatch({type:"confirmFailed",generation:e,message:s})}}async loadCheckoutSession(e,t){this.warnUnsupportedOptions("checkoutSession"),this.warnCheckoutIgnoredOptions(),this.collection=void 0,this.unmountExtraElements();try{if(await this.stripeService.initializeWithCheckoutSession(this.publishableKey,t,{stripeAccount:this.stripeAccount,applicationName:this.applicationName,elementsOptions:z(this.options)}),e!==this.sheet.generation)return;if("success"!==this.stripeService.state.loadStripeStatus)throw Error("Failed to load Stripe.js");await this.paymentElementManager.initialize(this.el,(e=>{const{layout:t}=P(e);return null==t?{}:{layout:t}})(this.options)),this.dispatch({type:"loadSucceeded",generation:e})}catch(t){if(e!==this.sheet.generation)return;this.lastError=t,this.dispatch({type:"loadFailed",generation:e})}}confirmCheckoutSession(e){var t,i;const n=null!==(i=null===(t=this.options)||void 0===t?void 0:t.returnURL)&&void 0!==i?i:window.location.href;return this.runConfirm(e,(async()=>{var e,t;const i=this.stripeService.getCheckout();if(null==i)throw Error("Checkout Session is not initialized");return(async(e,t,i)=>{const n=await e.loadActions();if("error"===n.type)throw new h({type:"api_error",code:"checkout_session_error",message:n.error.message});const{actions:s}=n,a=()=>{var e,t;return null===(t=null===(e=s.getSession)||void 0===e?void 0:e.call(s))||void 0===t?void 0:t.status};N(a());const r=await s.confirm(Object.assign({returnUrl:t,redirect:"if_required"},null!=i&&""!==i?{email:i}:{}));if("error"===r.type){const{code:e,message:t}=r.error;if(N(a(),t),"paymentFailed"===e)throw new h({type:"card_error",code:e,message:t});throw new h({type:"api_error",code:"checkout_session_error",message:t})}return r})(i,n,null===(t=null===(e=this.options)||void 0===e?void 0:e.defaultBillingDetails)||void 0===t?void 0:t.email)}))}emit(e){switch(e){case"paymentSheetLoaded":this.paymentSheetLoaded.emit({stripe:this.stripeService.getStripe()});break;case"paymentSheetFailedToLoad":this.paymentSheetFailedToLoad.emit(this.lastError);break;case"paymentSheetCompleted":this.paymentSheetCompleted.emit(this.lastResult);break;case"paymentSheetCanceled":this.paymentSheetCanceled.emit();break;case"paymentSheetFailed":this.paymentSheetFailed.emit(this.lastError)}}warnUnsupportedOptions(e){const t=((e,t)=>{if(null==e)return[];const i=Object.entries(e).filter((([e,t])=>void 0!==t&&!O.includes(e))).map((([e])=>e)),n=e.billingDetailsCollectionConfiguration;return"always"===(null==n?void 0:n.name)&&i.push("billingDetailsCollectionConfiguration.name"),"always"===(null==n?void 0:n.phone)&&"full"!==n.address&&i.push("billingDetailsCollectionConfiguration.phone"),null!=e.shippingDetails&&"setup"===t&&i.push("shippingDetails"),i.sort()})(this.options,e);this.warnedUnsupportedOptions||0===t.length||(this.warnedUnsupportedOptions=!0,console.warn("<stripe-payment-sheet>: these options have no effect on the web yet: "+t.join(", ")))}warnCheckoutIgnoredOptions(){const e=(e=>{if(null==e)return[];const{merchantDisplayName:t,defaultBillingDetails:i}=e,n=["name","phone","address"].filter((e=>null!=(null==i?void 0:i[e]))).map((e=>"defaultBillingDetails."+e));return null!=t&&n.push("merchantDisplayName"),["billingDetailsCollectionConfiguration","shippingDetails","enableApplePay","enableGooglePay"].filter((t=>void 0!==e[t])).forEach((e=>n.push(e))),n.sort()})(this.options);this.warnedCheckoutIgnoredOptions||0===e.length||(this.warnedCheckoutIgnoredOptions=!0,console.warn("<stripe-payment-sheet>: these options have no effect with a Checkout Session: "+e.join(", ")))}render(){var e,t,i;const{phase:n}=this.sheet,r="confirming"===n;return s(a,{key:"e6b2c3cb168039eb428eaaee1dce598f534c18e7"},s("stripe-modal",{key:"ef1515b07cca402c4db8818e2e94ca80e4d954c2",open:this.visible,showCloseButton:!r,onClose:this.handleModalClose},s("div",{key:"9252fa1653b206d211756c94325c73a8ec482a37",class:"stripe-payment-sheet-wrap"},s("form",{key:"904a54f2439e0356c2cbf9227326efe446aa08ce",id:"stripe-payment-sheet",onSubmit:this.handleSubmit},s("div",{key:"103d81e3c56cfba1c421e1bf140a49e2b392c6b5",class:"stripe-heading"},o.t(this.sheetTitle)),s("div",{key:"cda58a48db7b04af1981407b7100def815404e35",class:"payment-info visible"},s("div",{key:"cbe248666aa4807c25d492df1ab1de017bc78e2c",class:"stripe-payment-sheet-email"},null!=(null===(e=this.collection)||void 0===e?void 0:e.emailElement)&&s("div",{key:"b0210c6cce85d1affaa83e3fa30785158c9bab98",id:"link-authentication-element"})),s("div",{key:"2420956298e5b36c63f3fbea6b4e32429b7ace27",class:"stripe-payment-sheet-shipping-address"},null!=(null===(t=this.collection)||void 0===t?void 0:t.shippingAddressElement)&&s("div",{key:"ae41335a42c59598e1addbfdea0a13342c026456",id:"address-element"})),s("div",{key:"3196844c9396c40548a3c632733565027df3cea7",class:"stripe-payment-sheet-billing-address"},null!=(null===(i=this.collection)||void 0===i?void 0:i.billingAddressElement)&&s("div",{key:"269a99368975db70722fc181a1c099859f23d3d6",id:"address-element"})),s("div",{key:"2a63173a607501ff08ac072956cdbe462a4400c1",id:"payment-element"})),s("div",{key:"7a72a86097aca2af6491c56b52258286ef820283",class:"stripe-element-errors",role:"alert"},this.errorMessage),s("div",{key:"10f05d5ecfa53cde350f00acffd86e232e370fe7",class:"stripe-submit"},s("button",{key:"a7ad3e538b94403bd8c71b31bd405c1b0c59543c",type:"submit",disabled:"presented"!==n},o.t(r?"Loading":this.buttonLabel)))))))}get el(){return this}static get watchers(){return{publishableKey:[{handleSecretChange:0}],intentClientSecret:[{handleSecretChange:0}],checkoutSessionClientSecret:[{handleSecretChange:0}],stripeAccount:[{handleSecretChange:0}],open:[{handleOpenChange:0}]}}static get style(){return':root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}stripe-payment-sheet{display:contents}.stripe-payment-sheet-wrap{box-sizing:border-box}.stripe-payment-sheet-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}.stripe-payment-sheet-wrap button{cursor:pointer}.stripe-payment-sheet-wrap{display:block;width:100%;background:#fff;padding:32px 16px}.stripe-payment-sheet-wrap .stripe-heading{font-size:24px;font-weight:bold;color:var(--color-heading-text);margin-bottom:24px}.stripe-payment-sheet-wrap .payment-info{margin-top:8px}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.stripe-payment-sheet-wrap .stripe-submit{margin-top:32px}.stripe-payment-sheet-wrap button{display:block;color:var(--color-button-text);background-color:var(--color-primary);width:100%;text-align:center;padding:16px 16px;font-size:18px;border-radius:6px;min-height:42px}.stripe-payment-sheet-wrap button:disabled{color:var(--color-button-text-disabled)}'}},[0,"stripe-payment-sheet",{publishableKey:[1,"publishable-key"],intentClientSecret:[1,"intent-client-secret"],checkoutSessionClientSecret:[1,"checkout-session-client-secret"],stripeAccount:[1,"stripe-account"],open:[1540],sheetTitle:[1,"sheet-title"],buttonLabel:[1,"button-label"],applicationName:[1,"application-name"],options:[16],sheet:[32],visible:[32],errorMessage:[32],collection:[32],present:[64]},void 0,{publishableKey:[{handleSecretChange:0}],intentClientSecret:[{handleSecretChange:0}],checkoutSessionClientSecret:[{handleSecretChange:0}],stripeAccount:[{handleSecretChange:0}],open:[{handleOpenChange:0}]}]);function T(){"undefined"!=typeof customElements&&["stripe-payment-sheet","ion-icon","stripe-modal"].forEach((t=>{switch(t){case"stripe-payment-sheet":customElements.get(e(t))||customElements.define(e(t),K);break;case"ion-icon":customElements.get(e(t))||p();break;case"stripe-modal":customElements.get(e(t))||u()}}))}T();const $=K,V=T;export{$ as StripePaymentSheet,V as defineCustomElement}
@@ -1,6 +1,6 @@
1
1
  import { S as StencilCore } from './index-C6bbmyga.js';
2
2
  import { l as loadStripe } from './index-CBXaOfXU.js';
3
- import { i as i18n } from './i18n-B6JoQetF.js';
3
+ import { i as i18n } from './i18n-CL5n3bOb.js';
4
4
 
5
5
  const appendToMap = (map, propName, value) => {
6
6
  let refs = map.get(propName);
@@ -805,6 +805,7 @@ class LinkAuthenticationElementManager {
805
805
  this.store = createStore({
806
806
  errorMessage: '',
807
807
  email: undefined,
808
+ complete: undefined,
808
809
  });
809
810
  }
810
811
  /**
@@ -837,6 +838,9 @@ class LinkAuthenticationElementManager {
837
838
  if (this.linkAuthenticationElement != null) {
838
839
  this.unmount();
839
840
  }
841
+ // The values of a previous element do not apply to the new one
842
+ this.store.set('email', undefined);
843
+ this.store.set('complete', undefined);
840
844
  // Create link authentication element
841
845
  const linkAuthentication = elements.create('linkAuthentication', options);
842
846
  const linkAuthenticationElementDiv = await findElement(containerElement, '#link-authentication-element');
@@ -847,6 +851,7 @@ class LinkAuthenticationElementManager {
847
851
  // Unconditionally set email from event.value.email
848
852
  // This handles all cases: valid email, empty string, or undefined
849
853
  this.store.set('email', (_a = event.value) === null || _a === void 0 ? void 0 : _a.email);
854
+ this.store.set('complete', event.complete);
850
855
  });
851
856
  this.linkAuthenticationElement = linkAuthentication;
852
857
  return this.linkAuthenticationElement;
@@ -1195,4 +1200,4 @@ class ServiceFactory {
1195
1200
  */
1196
1201
  const serviceFactory = new ServiceFactory();
1197
1202
 
1198
- export { serviceFactory as s };
1203
+ export { findElement as f, serviceFactory as s };
@@ -2792,6 +2792,9 @@ instance.use(Browser).init({
2792
2792
  'Payment information': '支払情報',
2793
2793
  'Billing address': '請求先住所',
2794
2794
  'Save': '保存',
2795
+ 'Please complete your billing address.': '請求先住所を入力してください。',
2796
+ 'Please enter your email address.': 'メールアドレスを入力してください。',
2797
+ 'Please enter a valid email address.': '有効なメールアドレスを入力してください。',
2795
2798
  },
2796
2799
  },
2797
2800
  'pt-BR': {
@@ -2809,6 +2812,9 @@ instance.use(Browser).init({
2809
2812
  'Country or region': 'País ou região',
2810
2813
  'Postal Code': 'Cep',
2811
2814
  'Close': 'Fechar',
2815
+ 'Please complete your billing address.': 'Preencha seu endereço de cobrança.',
2816
+ 'Please enter your email address.': 'Informe seu endereço de e-mail.',
2817
+ 'Please enter a valid email address.': 'Informe um endereço de e-mail válido.',
2812
2818
  },
2813
2819
  },
2814
2820
  },
@@ -1,5 +1,5 @@
1
1
  import { e as getAssetPath, r as registerInstance, f as Build, h, d as Host, g as getElement, a as createEvent } from './index-C6bbmyga.js';
2
- import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
2
+ import { c as checkPlatform, i as i18n } from './i18n-CL5n3bOb.js';
3
3
 
4
4
  let CACHED_MAP;
5
5
  const getIconMap = () => {
@@ -504,7 +504,7 @@ const getDeepActiveElement = (doc = document) => {
504
504
  return active;
505
505
  };
506
506
 
507
- const stripeModalCss = () => `:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}:host{box-sizing:border-box}:host *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}:host button{cursor:pointer}:host{display:block}.modal-row{opacity:0;pointer-events:none;will-change:transform;visibility:hidden}.modal-row.open{opacity:1;pointer-events:auto;visibility:visible;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-row .modal-child{transform:translateY(100%);transition:transform 420ms ease;position:relative}.modal-row .modal-child .modal-loading{display:none;position:absolute;top:160px;left:50%;transform:translateX(-50%);width:24px;height:24px}.modal-row .modal-child.loading .modal-loading{display:flex;justify-content:center;align-items:center}.modal-row .modal-child.loading .modal-loading svg{width:24px;height:24px}.modal-row .modal-child.loading .modal-content{visibility:hidden}.modal-row.open .modal-child{transform:translateY(0%)}.modal-child{padding:16px 8px 24px;background-color:#fff;width:100%}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{display:block;width:32px;cursor:pointer;border-radius:4px}.modal-close-button-wrap .modal-close-button:focus-visible{outline:2px solid var(--color-label, #000);outline-offset:2px}.modal-close-button-wrap .modal-close-button ion-icon{width:32px;display:block;fill:var(--color-label)}.modal-child:focus{outline:none}.focus-guard{position:absolute;width:1px;height:1px;overflow:hidden}`;
507
+ const stripeModalCss = () => `:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}:host{box-sizing:border-box}:host *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}:host button{cursor:pointer}:host{display:block}.modal-row{opacity:0;pointer-events:none;will-change:transform;visibility:hidden}.modal-row.open{opacity:1;pointer-events:auto;visibility:visible;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-row .modal-child{transform:translateY(100%);transition:transform 420ms ease;position:relative}.modal-row .modal-child .modal-loading{display:none;position:absolute;top:160px;left:50%;transform:translateX(-50%);width:24px;height:24px}.modal-row .modal-child.loading .modal-loading{display:flex;justify-content:center;align-items:center}.modal-row .modal-child.loading .modal-loading svg{width:24px;height:24px}.modal-row .modal-child.loading .modal-content{visibility:hidden}.modal-row.open .modal-child{transform:translateY(0%)}.modal-child{padding:16px 8px 24px;background-color:#fff;width:100%;max-height:100vh;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{display:block;width:32px;cursor:pointer;border-radius:4px}.modal-close-button-wrap .modal-close-button:focus-visible{outline:2px solid var(--color-label, #000);outline-offset:2px}.modal-close-button-wrap .modal-close-button ion-icon{width:32px;display:block;fill:var(--color-label)}.modal-child:focus{outline:none}.focus-guard{position:absolute;width:1px;height:1px;overflow:hidden}`;
508
508
 
509
509
  const StripeModal = class {
510
510
  constructor(hostRef) {
@@ -692,6 +692,8 @@ const StripeModal = class {
692
692
  return;
693
693
  }
694
694
  const modalChild = this.el.shadowRoot.querySelector('.modal-child');
695
+ // The panel stays in the DOM while closed and keeps its scroll position; start each opening at the top (title, close button)
696
+ modalChild.scrollTop = 0;
695
697
  modalChild.classList.add('loading');
696
698
  modalChild.style.willChange = 'transform';
697
699
  modalChild.addEventListener('transitionend', () => {
@@ -706,7 +708,7 @@ const StripeModal = class {
706
708
  render() {
707
709
  const { renderedOpen, showCloseButton } = this;
708
710
  const guardTabIndex = renderedOpen ? 0 : -1;
709
- return (h(Host, { key: '684539aa83388bec518e73bbd8aa19e73cfde07d', role: renderedOpen ? 'dialog' : undefined, "aria-modal": renderedOpen ? 'true' : undefined, onKeyDown: this.handleKeyDown, onFocusin: this.handleFocusIn }, h("div", { key: 'db6f1088c1ef7e35aefba06faaf3e9c2dcaa3419', class: `modal-row${renderedOpen ? ' open' : ''}`, onClick: () => this.closeModal() }, h("div", { key: '89c783c793261566b77ba962da730a973e8cbd8d', class: "modal-child", tabindex: "-1", ref: el => (this.dialogElement = el), onClick: e => e.stopPropagation() }, h("div", { key: '0e329b32c25509134f5a25adb266b03dd0bd71d8', class: "focus-guard", tabindex: guardTabIndex, onFocus: this.handleStartGuardFocus }), showCloseButton ? (h("div", { class: "modal-close-button-wrap" }, h("button", { type: "button", class: "modal-close-button", "aria-label": i18n.t('Close'), ref: el => (this.closeButtonElement = el), onClick: () => this.closeModal() }, h("ion-icon", { name: "close", size: "large", "aria-hidden": "true" })))) : null, h("div", { key: 'f2b5dcbc72ba3178dd920ceecd4fd339f69598d7', class: "modal-loading" }, h("svg", { key: '1f7afb6cc48be8fc84f9b69678f2c8ca1e2b145e', version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2400 2400" }, h("g", { key: 'ed40edfeabe02bf198b194eb04777e1f4a6b203e', "stroke-width": "200", "stroke-linecap": "round", stroke: "currentColor", fill: "none", id: "spinner" }, h("line", { key: '03c9170ee9e566227fddcc9037a92c48ed954b89', x1: "1200", y1: "600", x2: "1200", y2: "100" }), h("line", { key: '302aec0abf20ee8afe66245ecbc9d5e2adbade82', opacity: "0.5", x1: "1200", y1: "2300", x2: "1200", y2: "1800" }), h("line", { key: 'd3bea8de4d689a5c5c423a72dd23a0fbc64c29dd', opacity: "0.917", x1: "900", y1: "680.4", x2: "650", y2: "247.4" }), h("line", { key: '543e33091e87bf85c3a0e4d4881babdffbe4b825', opacity: "0.417", x1: "1750", y1: "2152.6", x2: "1500", y2: "1719.6" }), h("line", { key: '5c2e0a3722955a8ee17b57f3061097f18681ba7e', opacity: "0.833", x1: "680.4", y1: "900", x2: "247.4", y2: "650" }), h("line", { key: '1100d48a500bfca6075243cf69be9e6f575bdae6', opacity: "0.333", x1: "2152.6", y1: "1750", x2: "1719.6", y2: "1500" }), h("line", { key: '6c3f7c309a5ed15c6ffce11925efe09dbc8e6f3b', opacity: "0.75", x1: "600", y1: "1200", x2: "100", y2: "1200" }), h("line", { key: '7708c31b141f3a151e8dc78c89b20442f34ce1e2', opacity: "0.25", x1: "2300", y1: "1200", x2: "1800", y2: "1200" }), h("line", { key: 'd419fc4006e8063f9bbc35b4cb2a9a88010c623a', opacity: "0.667", x1: "680.4", y1: "1500", x2: "247.4", y2: "1750" }), h("line", { key: '78ccaf11a6e7c3183d210b787ce9374bd7c4aff4', opacity: "0.167", x1: "2152.6", y1: "650", x2: "1719.6", y2: "900" }), h("line", { key: 'acb1444de9fcd9aa1a3182d759d3b8aeb0906284', opacity: "0.583", x1: "900", y1: "1719.6", x2: "650", y2: "2152.6" }), h("line", { key: '6adef9d6a54f302c8da7c84cae32851723ce25cc', opacity: "0.083", x1: "1750", y1: "247.4", x2: "1500", y2: "680.4" }), h("animateTransform", { key: '7acf982514091f6c3ec9bd4ddfc660f3286ddd4e', attributeName: "transform", attributeType: "XML", type: "rotate", keyTimes: "0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667", values: "0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199", dur: "0.83333s", begin: "0s", repeatCount: "indefinite", calcMode: "discrete" })))), h("div", { key: '120bebc59c0fc013cb2bfbaf8957ad3731e1ddf4', class: "modal-content", ref: el => (this.contentElement = el) }, h("slot", { key: '0f371823f8fddd61e2b0ce24a59477103d979875' })), h("div", { key: 'fa8436f70871d59055dab2cf0fcfe5d4577328c1', class: "focus-guard", tabindex: guardTabIndex, onFocus: this.handleEndGuardFocus })))));
711
+ return (h(Host, { key: '55e0d63b18df165313ea3dd8b8f17aa0e0d0a253', role: renderedOpen ? 'dialog' : undefined, "aria-modal": renderedOpen ? 'true' : undefined, onKeyDown: this.handleKeyDown, onFocusin: this.handleFocusIn }, h("div", { key: 'adb0b493c0ae525f275025c03e1b8f02b04de1af', class: `modal-row${renderedOpen ? ' open' : ''}`, onClick: () => this.closeModal() }, h("div", { key: '478bdad2ad481bfc2d8ffcf552788292fa93daed', class: "modal-child", tabindex: "-1", ref: el => (this.dialogElement = el), onClick: e => e.stopPropagation() }, h("div", { key: '8cc68ecefa37ec1db65f6c910d1da40f9144e722', class: "focus-guard", tabindex: guardTabIndex, onFocus: this.handleStartGuardFocus }), showCloseButton ? (h("div", { class: "modal-close-button-wrap" }, h("button", { type: "button", class: "modal-close-button", "aria-label": i18n.t('Close'), ref: el => (this.closeButtonElement = el), onClick: () => this.closeModal() }, h("ion-icon", { name: "close", size: "large", "aria-hidden": "true" })))) : null, h("div", { key: '26271a75906a72e9944599f98da007bfebc2e348', class: "modal-loading" }, h("svg", { key: 'bc6b1267e2f3b6b1dd7209db55be717fddf9acd4', version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2400 2400" }, h("g", { key: '00ed54798ac376ed71f87a088fad2519cb1262dc', "stroke-width": "200", "stroke-linecap": "round", stroke: "currentColor", fill: "none", id: "spinner" }, h("line", { key: '98242d65eb9470430bd5cc656cbb479232782746', x1: "1200", y1: "600", x2: "1200", y2: "100" }), h("line", { key: '2e2f0538a6d048465ef5f8a3d5ed1932f6c59270', opacity: "0.5", x1: "1200", y1: "2300", x2: "1200", y2: "1800" }), h("line", { key: '11f850b0e7dc0d259f35f56aab17068d4d25ca95', opacity: "0.917", x1: "900", y1: "680.4", x2: "650", y2: "247.4" }), h("line", { key: '14c3226b5d2741902f428a208966adf016c1bb7e', opacity: "0.417", x1: "1750", y1: "2152.6", x2: "1500", y2: "1719.6" }), h("line", { key: 'd41da322484b62c1db1df72b9bd1bcc0dbb85a2c', opacity: "0.833", x1: "680.4", y1: "900", x2: "247.4", y2: "650" }), h("line", { key: '246dcdd4a011775dc8fea8a05cfcfc429d5bd03c', opacity: "0.333", x1: "2152.6", y1: "1750", x2: "1719.6", y2: "1500" }), h("line", { key: 'f0a2d217a33a8caa6995a30d840002cb8c076e8d', opacity: "0.75", x1: "600", y1: "1200", x2: "100", y2: "1200" }), h("line", { key: '7552fb2c04f85c54b8bcc2235a32690e4489177f', opacity: "0.25", x1: "2300", y1: "1200", x2: "1800", y2: "1200" }), h("line", { key: '7b5a62164a0ef759b057f9100c7c5af834c9f6b7', opacity: "0.667", x1: "680.4", y1: "1500", x2: "247.4", y2: "1750" }), h("line", { key: 'd36af9d23059da4ca91147084e47ba94e19f5ada', opacity: "0.167", x1: "2152.6", y1: "650", x2: "1719.6", y2: "900" }), h("line", { key: 'f8eed2a97d817b68e0b29f5b5037d34d46a79a46', opacity: "0.583", x1: "900", y1: "1719.6", x2: "650", y2: "2152.6" }), h("line", { key: '1641d577b703e213157bc553966e434a40ba7158', opacity: "0.083", x1: "1750", y1: "247.4", x2: "1500", y2: "680.4" }), h("animateTransform", { key: '60fb2d30c248db1b4195d6015dc96225a15e4010', attributeName: "transform", attributeType: "XML", type: "rotate", keyTimes: "0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667", values: "0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199", dur: "0.83333s", begin: "0s", repeatCount: "indefinite", calcMode: "discrete" })))), h("div", { key: '27d3b71da43e5935dff3eff2e1bc507a24261b70', class: "modal-content", ref: el => (this.contentElement = el) }, h("slot", { key: '641408238d3969b830d1f3e9398be6f05bc1f65b' })), h("div", { key: 'c6178542b98a99d6a50b74270adc273671d5cc19', class: "focus-guard", tabindex: guardTabIndex, onFocus: this.handleEndGuardFocus })))));
710
712
  }
711
713
  get el() { return getElement(this); }
712
714
  static get watchers() { return {