@ikas/storefront 4.1.0-beta.3 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_virtual/index.js +1 -1
- package/build/components/checkout/components/expandable-section/index.js +1 -1
- package/build/components/checkout/components/expandable-section/style.module.scss.js +1 -1
- package/build/components/checkout/components/form-item/index.js +1 -1
- package/build/components/checkout/components/phone-number-input/get-countries.js +1 -1
- package/build/components/checkout/components/phone-number-input/index.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/ext/axios/index.js +1 -1
- package/package.json +18 -17
- package/build/_virtual/index2.js +0 -1
- package/build/_virtual/index3.js +0 -1
- package/build/_virtual/react-is.development.js +0 -1
- package/build/_virtual/react-is.production.min.js +0 -1
- package/build/ext/libphonenumber-js/es6/AsYouType.js +0 -1
- package/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +0 -1
- package/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +0 -1
- package/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.js +0 -1
- package/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.util.js +0 -1
- package/build/ext/libphonenumber-js/es6/AsYouTypeParser.js +0 -1
- package/build/ext/libphonenumber-js/es6/AsYouTypeState.js +0 -1
- package/build/ext/libphonenumber-js/es6/ParseError.js +0 -1
- package/build/ext/libphonenumber-js/es6/PhoneNumber.js +0 -1
- package/build/ext/libphonenumber-js/es6/PhoneNumberMatcher.js +0 -1
- package/build/ext/libphonenumber-js/es6/constants.js +0 -1
- package/build/ext/libphonenumber-js/es6/findNumbers/LRUCache.js +0 -1
- package/build/ext/libphonenumber-js/es6/findNumbers/Leniency.js +0 -1
- package/build/ext/libphonenumber-js/es6/findNumbers/RegExpCache.js +0 -1
- package/build/ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js +0 -1
- package/build/ext/libphonenumber-js/es6/findNumbers/isValidPreCandidate.js +0 -1
- package/build/ext/libphonenumber-js/es6/findNumbers/parsePreCandidate.js +0 -1
- package/build/ext/libphonenumber-js/es6/findNumbers/utf-8.js +0 -1
- package/build/ext/libphonenumber-js/es6/findNumbers/util.js +0 -1
- package/build/ext/libphonenumber-js/es6/findPhoneNumbers_.js +0 -1
- package/build/ext/libphonenumber-js/es6/formatIncompletePhoneNumber.js +0 -1
- package/build/ext/libphonenumber-js/es6/format_.js +0 -1
- package/build/ext/libphonenumber-js/es6/getCountries.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/RFC3966.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/getNumberType.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/mergeArrays.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/parseDigits.js +0 -1
- package/build/ext/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -1
- package/build/ext/libphonenumber-js/es6/isPossibleNumber_.js +0 -1
- package/build/ext/libphonenumber-js/es6/metadata.js +0 -1
- package/build/ext/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -1
- package/build/ext/libphonenumber-js/es6/parsePhoneNumber.js +0 -1
- package/build/ext/libphonenumber-js/es6/parsePhoneNumberFromString.js +0 -1
- package/build/ext/libphonenumber-js/es6/parsePhoneNumberFromString_.js +0 -1
- package/build/ext/libphonenumber-js/es6/parsePhoneNumber_.js +0 -1
- package/build/ext/libphonenumber-js/es6/parse_.js +0 -1
- package/build/ext/libphonenumber-js/es6/tools/semver-compare.js +0 -1
- package/build/ext/libphonenumber-js/es6/validate_.js +0 -1
- package/build/ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js +0 -1
- package/build/ext/libphonenumber-js/metadata.min.json.js +0 -1
- package/build/ext/libphonenumber-js/min/exports/AsYouType.js +0 -1
- package/build/ext/libphonenumber-js/min/exports/Metadata.js +0 -1
- package/build/ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js +0 -1
- package/build/ext/libphonenumber-js/min/exports/formatIncompletePhoneNumber.js +0 -1
- package/build/ext/libphonenumber-js/min/exports/getCountries.js +0 -1
- package/build/ext/libphonenumber-js/min/exports/getCountryCallingCode.js +0 -1
- package/build/ext/libphonenumber-js/min/exports/parsePhoneNumberFromString.js +0 -1
- package/build/ext/libphonenumber-js/min/exports/withMetadataArgument.js +0 -1
- package/build/ext/object-assign/index.js +0 -6
- package/build/ext/prop-types/checkPropTypes.js +0 -1
- package/build/ext/prop-types/factoryWithThrowingShims.js +0 -1
- package/build/ext/prop-types/factoryWithTypeCheckers.js +0 -1
- package/build/ext/prop-types/index.js +0 -1
- package/build/ext/prop-types/lib/ReactPropTypesSecret.js +0 -1
- package/build/ext/prop-types/lib/has.js +0 -1
- package/build/ext/react-is/cjs/react-is.development.js +0 -9
- package/build/ext/react-is/cjs/react-is.production.min.js +0 -9
- package/build/ext/react-is/index.js +0 -1
- package/build/ext/react-tooltip/dist/index.es.js +0 -1
- package/build/ext/uuid/dist/esm-browser/bytesToUuid.js +0 -1
- package/build/ext/uuid/dist/esm-browser/md5.js +0 -1
- package/build/ext/uuid/dist/esm-browser/rng.js +0 -1
- package/build/ext/uuid/dist/esm-browser/sha1.js +0 -1
- package/build/ext/uuid/dist/esm-browser/v3.js +0 -1
- package/build/ext/uuid/dist/esm-browser/v35.js +0 -1
- package/build/ext/uuid/dist/esm-browser/v4.js +0 -1
- package/build/ext/uuid/dist/esm-browser/v5.js +0 -1
package/build/_virtual/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a={exports:{}};export{a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import a from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../utils/i18n.js";var o=t((function(t){var o=t.title,r=t.children,c=i().t,s=e.useState(!1),n=s[0],m=s[1];return e.createElement("div",{className:a.ExpandableSection},e.createElement("div",{className:a.Top},e.createElement("div",{className:a.Title},o),e.createElement("div",{className:a.HideBtn
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import a from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../utils/i18n.js";var o=t((function(t){var o=t.title,r=t.children,c=i().t,s=e.useState(!1),n=s[0],m=s[1];return e.createElement("div",{className:a.ExpandableSection},e.createElement("div",{className:a.Top,onClick:function(){return m(!n)}},e.createElement("div",{className:a.Title},o),e.createElement("div",{className:a.HideBtn},c(n?"checkout-page:actions.hide":"checkout-page:actions.show"))),n&&!!r&&e.createElement("div",{className:a.Content},r))}));export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandableSection:"style-module_ExpandableSection__Q5p-E",Top:"style-module_Top__s93Gc",Title:"style-module_Title__8iUDa",HideBtn:"style-module_HideBtn__Q2c0N",Content:"style-module_Content__-qdRF"};e(".style-module_ExpandableSection__Q5p-E {\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc {\n padding: 24px 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n user-select: none;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc .style-module_Title__8iUDa {\n font-weight: 600;\n font-size: 20px;\n line-height: 32px;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc .style-module_HideBtn__Q2c0N {\n font-size: 14px;\n
|
|
1
|
+
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandableSection:"style-module_ExpandableSection__Q5p-E",Top:"style-module_Top__s93Gc",Title:"style-module_Title__8iUDa",HideBtn:"style-module_HideBtn__Q2c0N",Content:"style-module_Content__-qdRF"};e(".style-module_ExpandableSection__Q5p-E {\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc {\n padding: 24px 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n user-select: none;\n cursor: pointer;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc .style-module_Title__8iUDa {\n font-weight: 600;\n font-size: 20px;\n line-height: 32px;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc .style-module_HideBtn__Q2c0N {\n font-size: 14px;\n user-select: none;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Content__-qdRF {\n padding-bottom: 24px;\n}");export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import o,{FormItemType as r}from"./model.js";import a from"./caret-down.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as u}from"../../../../utils/i18n.js";import i from
|
|
1
|
+
import*as e from"react";import{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import o,{FormItemType as r}from"./model.js";import a from"./caret-down.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as u}from"../../../../utils/i18n.js";import i from"react-tooltip";import{PhoneNumberInput as c}from"../phone-number-input/index.js";var s=n((function(n){var a=u().t,s=e.useState((function(){return new o(n)})),d=s[0],E=s[1];return e.useEffect((function(){i.rebuild()}),[]),e.useEffect((function(){t((function(){d.type=n.type}))}),[n.type]),e.useEffect((function(){t((function(){d.inputType=n.inputType}))}),[n.inputType]),e.useEffect((function(){t((function(){d.value=n.value}))}),[n.value]),e.useEffect((function(){t((function(){d.options=n.options}))}),[n.options]),e.useEffect((function(){t((function(){d.label=n.label}))}),[n.label]),e.useEffect((function(){t((function(){d.hasError=n.hasError}))}),[n.hasError]),e.useEffect((function(){t((function(){d.errorText=n.errorText}))}),[n.errorText]),e.useEffect((function(){t((function(){d.errorText=n.errorText}))}),[n.errorText]),e.useEffect((function(){t((function(){d.textAreaPlaceholder=n.textAreaPlaceholder}))}),[n.textAreaPlaceholder]),e.useEffect((function(){t((function(){d.rightContent=n.rightContent}))}),[n.rightContent]),e.useEffect((function(){t((function(){d.disableResize=n.disableResize}))}),[n.disableResize]),e.useEffect((function(){t((function(){E(new o(n))}))}),[n.onChange]),e.useEffect((function(){!d.country&&n.currentCountryCode&&d.onCountryChange(n.currentCountryCode)}),[n.currentCountryCode]),e.createElement("div",{className:d.formItemStyle,style:n.style},e.createElement("div",{className:l.FormItemWrapper},e.createElement("div",{className:l.FormItemInputWrapper},e.createElement("label",{className:d.labelStyle},d.label),d.type===r.TEXT&&e.createElement(m,{vm:d,type:d.inputType,disabled:d.disabled,required:n.required,pattern:n.pattern,autocomplete:n.autocomplete,name:n.name}),d.type===r.TEL&&e.createElement(c,{key:n.currentCountryCode||"1",disabled:d.disabled,defaultCountry:n.currentCountryCode,placeholder:a("checkout-page:enterPhoneNumber"),value:d.value?d.value:"",onChange:d.onPhoneChange}),d.type===r.TEXT_AREA&&e.createElement(f,{vm:d}),d.type===r.SELECT&&e.createElement(p,{vm:d,autocomplete:n.autocomplete})),!!d.hasError&&e.createElement("div",{className:l.ErrorMsg},d.errorText||""),!!n.tooltipText&&e.createElement("div",{className:l.FormItemTooltipContainer,"data-tip":n.tooltipText,"data-event":"touchstart focus mouseover","data-event-off":"mouseout"},"?"),!!d.rightContent&&e.createElement("div",{className:l.RightContent},d.rightContent)))})),m=n((function(t){var n=t.vm,o=t.name,r=t.autocomplete,a=t.type,l=t.pattern,u=t.required,i=t.disabled;return e.createElement("input",{required:u,type:a||"text",name:o,pattern:l,disabled:i,autoComplete:r,inputMode:n.inputMode||"text",className:n.inputStyle,value:n.value,onChange:n.onValueChange})})),f=n((function(t){var n=t.vm;return e.createElement("textarea",{style:{resize:n.disableResize?"none":"initial"},value:n.value,disabled:n.disabled,onChange:n.onTextAreaValueChange,placeholder:n.textAreaPlaceholder||""})})),p=n((function(t){var n,o=t.vm,r=t.autocomplete;return e.createElement(e.Fragment,null,e.createElement("select",{className:o.inputStyle,disabled:o.disabled,autoComplete:r,onChange:o.onSelectChange},!o.value&&e.createElement("option",{selected:!0,disabled:!0,key:-1}),null===(n=o.options)||void 0===n?void 0:n.map((function(t,n){return e.createElement("option",{key:n+t.value,value:t.label,selected:o.value===t.value},t.label)}))),e.createElement("div",{className:l.ArrowContainer},e.createElement(a,null)))}));export{s as FormItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as
|
|
1
|
+
import{__awaiter as t,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as e}from"@ikas/storefront-config";import{getCountries as n}from"libphonenumber-js";import o from"./compare-strings.js";var s=function(){return t(void 0,void 0,void 0,(function(){var t,s;return r(this,(function(r){switch(r.label){case 0:return i=e.getCurrentLocale(),["de","el","en","es","fi","fr","it","nb","pl","pt-BR","pt","ru","sv","tr","ua","vi"].some((function(t){return t===i}))||(i="en"),t="https://cdn.myikas.com/sf/static/locale/country/".concat(i,".json"),[4,fetch(t)];case 1:return[4,r.sent().json()];case 2:return s=r.sent(),[2,n().map((function(t){return{value:t,label:s[t]}})).sort((function(t,r){return o(t.label,r.label)}))]}var i}))}))};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as a from"react";import{observer as r}from"mobx-react-lite";import l,{formatIncompletePhoneNumber as n,getCountryCallingCode as s,parseIncompletePhoneNumber as o}from"libphonenumber-js";import c from"./get-countries.js";import u from"./style.module.scss.js";var i=r((function(r){var i=r.defaultCountry,m=r.disabled,v=void 0!==m&&m,f=r.placeholder,d=r.value,g=r.onChange,p=a.useState([]),b=p[0],E=p[1],h=a.useState(i||"TR"),y=h[0],N=h[1],C=a.useState(""),F=C[0],S=C[1];a.useEffect((function(){j();var e=y;if(d){var t=l(d);t&&t.country&&(e=t.country),S(n(d,e))}else x(e);N(e)}),[]);var j=function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,c()];case 1:return e=t.sent(),E(e),[2]}}))}))},x=function(e){var t=s(e);S("+".concat(t))},k=function(e){return n(e,y)};return a.createElement(a.Fragment,null,a.createElement("div",{className:u.SelectFlag},a.createElement("div",{className:u.FlagContainer},a.createElement("div",{className:u.Flag},a.createElement("img",{className:u.FlagImage,alt:y,src:"https://cdn.myikas.com/sf/assets/flags/3x2/".concat(y,".svg")}),a.createElement("div",{className:u.Arrow})),a.createElement("select",{className:u.Select,value:y,onChange:function(e){if(e.target.value){var t=e.target.value;N(t),x(t)}},disabled:v},b.map((function(e){return a.createElement("option",{key:e.value,value:e.value},e.label)}))))),a.createElement("input",{type:"tel",autoComplete:"tel",className:u.Input,value:F,onChange:function(e){var t=k(e.target.value);S(t),g(t?o(t):e.target.value)},placeholder:f,disabled:v}))}));export{i as PhoneNumberInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import s from"next/link.js";import a from'./../../ext/react-tooltip/dist/index.es.js';import l,{CheckoutStep as n}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as g}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as E}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as f}from"./steps/step-success/index.js";import{Modal as y}from"./components/modal/index.js";import x from"./components/master-pass/modal-otp/index.js";import k from"./components/master-pass/modal-response/index.js";import j from"./components/master-pass/modal-success/index.js";import{Image as C}from"../image/index.js";import b,{Step as N}from"./components/step-container/index.js";import{StockError as F}from"./components/error/stock-error/index.js";import{FullscreenLoading as M}from"./components/fullscreen-loading/index.js";import T from"./components/notification-box/index.js";import{FormItem as P}from"./components/form-item/index.js";import{FormItemType as S}from"./components/form-item/model.js";import{Button as A}from"./components/button/index.js";import{IkasPageHead as w}from"../page/head.js";import I from"./components/offer-product/index.js";import V from"./components/svg/ikas.js";import O from"./style.module.scss.js";import{Analytics as B}from"../../analytics/analytics.js";import"../../analytics/head/index.js";var L=i((function(e){var t,i,s,m=e.checkout,p=e.checkoutSettings,u=e.customizationProps,v=e.returnPolicy,E=e.privacyPolicy,C=e.termsOfService,b=e.imprint,N=e.shippingPolicy,T=d().t,P=r(),S=o.useState((function(){return new l(m,p,P,v,E,C,b,N,T,u||{})}))[0];return S.step===n.PAYMENT&&B.disableHTML(),o.useEffect((function(){S.checkoutSettings.isAccountRequired&&!S.checkout.hasCustomer&&P.push("/account/login?redirect="+encodeURIComponent(S.checkoutUrl)),B.beginCheckout(S.checkout),B.pageView(g.CHECKOUT)}),[]),o.useEffect((function(){S.customizationProps=u,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(u)}),[u]),S.isCheckoutLoaded&&S.store.customerStore.initialized?S.checkout.hasCustomer&&(null===(t=S.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(i=S.checkout.customer)||void 0===i?void 0:i.id)?(P.push("/account/login?redirect="+encodeURIComponent(S.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(w,{pageType:g.CHECKOUT,pageTitle:((null===(s=S.merchantSettings)||void 0===s?void 0:s.merchantName)||"")+" - "+T("checkout-page:securePayment"),pageDescription:T("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:O.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:O.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:O.Left},o.createElement("div",{className:O.LeftContent},o.createElement("div",null,o.createElement(R,{vm:S}),S.hasStockError&&o.createElement("div",{className:O.ErrorContainer},o.createElement(F,{vm:S,error:S.error})),!S.hasStockError&&o.createElement(o.Fragment,null,o.createElement(h,{vm:S,allowExpand:!0}),S.step===n.SUCCESS?o.createElement(f,{vm:S}):o.createElement(o.Fragment,null,S.checkoutCampaignOffer&&o.createElement(I,{vm:S,campaignOffer:S.checkoutCampaignOffer}),o.createElement(D,{vm:S}))),o.createElement("div",{className:O.Space})),o.createElement(G,{vm:S}))),o.createElement("div",{className:O.Right},o.createElement("div",{className:O.RightContent},o.createElement(h,{vm:S}),o.createElement("div",{className:O.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(V,null))))),!!S.policyModalText&&o.createElement(y,{title:S.policyModalTitle,modalContent:S.policyModalText,onClose:function(){S.policyModalText=""}}),S.isContactModalVisible&&o.createElement(Y,{vm:S,setVisible:S.setContactModalVisible}),S.mpVM.isOtpModalVisible&&o.createElement(x,{vm:S,visible:S.mpVM.isOtpModalVisible,type:S.mpVM.otpModalType,onClose:S.mpVM.hideOtpModal}),S.mpVM.isResponseModalVisible&&o.createElement(k,{visible:S.mpVM.isResponseModalVisible,text:S.mpVM.mfsResponseModalText,onClose:S.mpVM.onResponseModalClose}),S.mpVM.isSuccessModalVisible&&o.createElement(j,{visible:S.mpVM.isSuccessModalVisible,type:S.mpVM.successModalType,onClose:S.mpVM.onSuccessModalClose}))):o.createElement(M,null)})),R=i((function(e){var t,i,r,a=e.vm,l=d().t;return o.createElement("div",{className:O.Header},o.createElement(s,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=a.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:O.Logo},o.createElement(C,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!a.checkout.hasCustomer&&o.createElement("div",{className:O.LoginText},o.createElement("span",{className:O.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(s,{href:"/account/login?redirect="+encodeURIComponent(a.checkoutUrl),passHref:!0},o.createElement("a",{className:O.LoginBtn},l("checkout-page:actions.login")))),a.checkout.hasCustomer&&o.createElement("div",{className:O.CustomerInfo},o.createElement("div",{className:O.Name},a.checkout.customerFullName),o.createElement("div",{className:O.Email},null===(r=a.checkout.customer)||void 0===r?void 0:r.email)))})),D=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case n.INFO:return o.createElement(p,{vm:t});case n.SHIPPING:return o.createElement(u,{vm:t});case n.PAYMENT:return o.createElement(v,{vm:t});case n.SUCCESS:return o.createElement(f,{vm:t})}}),[t,t.step]),s=[new N(i("checkout-page:address"),t.step===n.INFO,t.step!==n.INFO,t.step!==n.INFO?o.createElement("div",{className:O.AdressStepInfo},o.createElement(U,{vm:t}),o.createElement("div",{className:O.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==n.INFO?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(U,{vm:t})):void 0),new N(i("checkout-page:payment"),t.step===n.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||s.splice(1,0,new N(i("checkout-page:shipping"),t.step===n.SHIPPING,t.step===n.PAYMENT,t.step===n.PAYMENT?o.createElement("div",{className:O.AdressStepInfo},o.createElement(H,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:O.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===n.PAYMENT?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(H,{vm:t})):void 0)),o.createElement(b,{steps:s,stepContent:r})})),U=i((function(e){var t,i,r,s,a,l,n,c,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(s=p.checkout.shippingAddress)||void 0===s?void 0:s.lastName)||"");return o.createElement("div",{className:O.Address},o.createElement("div",{className:[O.Text,O.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:O.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:O.Text},u("checkout-page:receiver")),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},v)),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.phone:null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[O.Text,O.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),H=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:O.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Footer},o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),Y=i((function(i){var r,s,a,l=i.vm,n=i.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],f=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];f.email=(null===(r=l.checkout.customer)||void 0===r?void 0:r.email)||"",f.firstName=(null===(s=l.checkout.customer)||void 0===s?void 0:s.firstName)||"",f.lastName=(null===(a=l.checkout.customer)||void 0===a?void 0:a.lastName)||"";var x=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,n(!1)]:(u(!0),[4,f.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(y,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(T,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(P,{type:S.TEXT_AREA,label:"",value:f.message||"",onChange:f.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(A,{style:{width:"100%",marginTop:"24px"},text:c(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!f.message,onClick:x})),onClose:function(){return n(!1)}})}));export{L as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import s from"next/link.js";import a from"react-tooltip";import l,{CheckoutStep as n}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as g}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as E}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as f}from"./steps/step-success/index.js";import{Modal as y}from"./components/modal/index.js";import x from"./components/master-pass/modal-otp/index.js";import k from"./components/master-pass/modal-response/index.js";import j from"./components/master-pass/modal-success/index.js";import{Image as C}from"../image/index.js";import b,{Step as N}from"./components/step-container/index.js";import{StockError as F}from"./components/error/stock-error/index.js";import{FullscreenLoading as M}from"./components/fullscreen-loading/index.js";import T from"./components/notification-box/index.js";import{FormItem as P}from"./components/form-item/index.js";import{FormItemType as S}from"./components/form-item/model.js";import{Button as A}from"./components/button/index.js";import{IkasPageHead as w}from"../page/head.js";import I from"./components/offer-product/index.js";import V from"./components/svg/ikas.js";import O from"./style.module.scss.js";import{Analytics as B}from"../../analytics/analytics.js";import"../../analytics/head/index.js";var L=i((function(e){var t,i,s,m=e.checkout,p=e.checkoutSettings,u=e.customizationProps,v=e.returnPolicy,E=e.privacyPolicy,C=e.termsOfService,b=e.imprint,N=e.shippingPolicy,T=d().t,P=r(),S=o.useState((function(){return new l(m,p,P,v,E,C,b,N,T,u||{})}))[0];return S.step===n.PAYMENT&&B.disableHTML(),o.useEffect((function(){S.checkoutSettings.isAccountRequired&&!S.checkout.hasCustomer&&P.push("/account/login?redirect="+encodeURIComponent(S.checkoutUrl)),B.beginCheckout(S.checkout),B.pageView(g.CHECKOUT)}),[]),o.useEffect((function(){S.customizationProps=u,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(u)}),[u]),S.isCheckoutLoaded&&S.store.customerStore.initialized?S.checkout.hasCustomer&&(null===(t=S.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(i=S.checkout.customer)||void 0===i?void 0:i.id)?(P.push("/account/login?redirect="+encodeURIComponent(S.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(w,{pageType:g.CHECKOUT,pageTitle:((null===(s=S.merchantSettings)||void 0===s?void 0:s.merchantName)||"")+" - "+T("checkout-page:securePayment"),pageDescription:T("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:O.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:O.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:O.Left},o.createElement("div",{className:O.LeftContent},o.createElement("div",null,o.createElement(R,{vm:S}),S.hasStockError&&o.createElement("div",{className:O.ErrorContainer},o.createElement(F,{vm:S,error:S.error})),!S.hasStockError&&o.createElement(o.Fragment,null,o.createElement(h,{vm:S,allowExpand:!0}),S.step===n.SUCCESS?o.createElement(f,{vm:S}):o.createElement(o.Fragment,null,S.checkoutCampaignOffer&&o.createElement(I,{vm:S,campaignOffer:S.checkoutCampaignOffer}),o.createElement(D,{vm:S}))),o.createElement("div",{className:O.Space})),o.createElement(G,{vm:S}))),o.createElement("div",{className:O.Right},o.createElement("div",{className:O.RightContent},o.createElement(h,{vm:S}),o.createElement("div",{className:O.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(V,null))))),!!S.policyModalText&&o.createElement(y,{title:S.policyModalTitle,modalContent:S.policyModalText,onClose:function(){S.policyModalText=""}}),S.isContactModalVisible&&o.createElement(Y,{vm:S,setVisible:S.setContactModalVisible}),S.mpVM.isOtpModalVisible&&o.createElement(x,{vm:S,visible:S.mpVM.isOtpModalVisible,type:S.mpVM.otpModalType,onClose:S.mpVM.hideOtpModal}),S.mpVM.isResponseModalVisible&&o.createElement(k,{visible:S.mpVM.isResponseModalVisible,text:S.mpVM.mfsResponseModalText,onClose:S.mpVM.onResponseModalClose}),S.mpVM.isSuccessModalVisible&&o.createElement(j,{visible:S.mpVM.isSuccessModalVisible,type:S.mpVM.successModalType,onClose:S.mpVM.onSuccessModalClose}))):o.createElement(M,null)})),R=i((function(e){var t,i,r,a=e.vm,l=d().t;return o.createElement("div",{className:O.Header},o.createElement(s,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=a.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:O.Logo},o.createElement(C,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!a.checkout.hasCustomer&&o.createElement("div",{className:O.LoginText},o.createElement("span",{className:O.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(s,{href:"/account/login?redirect="+encodeURIComponent(a.checkoutUrl),passHref:!0},o.createElement("a",{className:O.LoginBtn},l("checkout-page:actions.login")))),a.checkout.hasCustomer&&o.createElement("div",{className:O.CustomerInfo},o.createElement("div",{className:O.Name},a.checkout.customerFullName),o.createElement("div",{className:O.Email},null===(r=a.checkout.customer)||void 0===r?void 0:r.email)))})),D=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case n.INFO:return o.createElement(p,{vm:t});case n.SHIPPING:return o.createElement(u,{vm:t});case n.PAYMENT:return o.createElement(v,{vm:t});case n.SUCCESS:return o.createElement(f,{vm:t})}}),[t,t.step]),s=[new N(i("checkout-page:address"),t.step===n.INFO,t.step!==n.INFO,t.step!==n.INFO?o.createElement("div",{className:O.AdressStepInfo},o.createElement(U,{vm:t}),o.createElement("div",{className:O.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==n.INFO?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(U,{vm:t})):void 0),new N(i("checkout-page:payment"),t.step===n.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||s.splice(1,0,new N(i("checkout-page:shipping"),t.step===n.SHIPPING,t.step===n.PAYMENT,t.step===n.PAYMENT?o.createElement("div",{className:O.AdressStepInfo},o.createElement(H,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:O.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===n.PAYMENT?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(H,{vm:t})):void 0)),o.createElement(b,{steps:s,stepContent:r})})),U=i((function(e){var t,i,r,s,a,l,n,c,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(s=p.checkout.shippingAddress)||void 0===s?void 0:s.lastName)||"");return o.createElement("div",{className:O.Address},o.createElement("div",{className:[O.Text,O.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:O.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:O.Text},u("checkout-page:receiver")),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},v)),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.phone:null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[O.Text,O.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),H=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:O.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Footer},o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),Y=i((function(i){var r,s,a,l=i.vm,n=i.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],f=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];f.email=(null===(r=l.checkout.customer)||void 0===r?void 0:r.email)||"",f.firstName=(null===(s=l.checkout.customer)||void 0===s?void 0:s.firstName)||"",f.lastName=(null===(a=l.checkout.customer)||void 0===a?void 0:a.lastName)||"";var x=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,n(!1)]:(u(!0),[4,f.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(y,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(T,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(P,{type:S.TEXT_AREA,label:"",value:f.message||"",onChange:f.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(A,{style:{width:"100%",marginTop:"24px"},text:c(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!f.message,onClick:x})),onClose:function(){return n(!1)}})}));export{L as default};
|
package/build/ext/axios/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"../../_virtual/
|
|
1
|
+
import{a as i}from"../../_virtual/index.js";import"./lib/axios.js";import{a as o}from"../../_virtual/axios.js";i.exports=o.exports;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -16,16 +16,13 @@
|
|
|
16
16
|
"release": "npm publish",
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"react-tooltip": "^4.2.21",
|
|
21
|
-
"libphonenumber-js": "^1.10.6"
|
|
22
|
-
},
|
|
19
|
+
"dependencies": {},
|
|
23
20
|
"devDependencies": {
|
|
24
|
-
"@ikas/storefront-api": "^4.1.
|
|
25
|
-
"@ikas/storefront-config": "^4.1.
|
|
26
|
-
"@ikas/storefront-model-functions": "^4.1.
|
|
27
|
-
"@ikas/storefront-models": "^4.1.
|
|
28
|
-
"@ikas/storefront-providers": "^4.1.
|
|
21
|
+
"@ikas/storefront-api": "^4.1.1",
|
|
22
|
+
"@ikas/storefront-config": "^4.1.1",
|
|
23
|
+
"@ikas/storefront-model-functions": "^4.1.1",
|
|
24
|
+
"@ikas/storefront-models": "^4.1.1",
|
|
25
|
+
"@ikas/storefront-providers": "^4.1.1",
|
|
29
26
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
30
27
|
"@rollup/plugin-json": "^4.1.0",
|
|
31
28
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
@@ -50,14 +47,16 @@
|
|
|
50
47
|
"html-react-parser": "^1.4.0",
|
|
51
48
|
"query-string": "^6.13.8",
|
|
52
49
|
"@stripe/react-stripe-js": "^1.10.0",
|
|
53
|
-
"@stripe/stripe-js": "^1.29.0"
|
|
50
|
+
"@stripe/stripe-js": "^1.29.0",
|
|
51
|
+
"react-tooltip": "^4.2.21",
|
|
52
|
+
"libphonenumber-js": "^1.10.6"
|
|
54
53
|
},
|
|
55
54
|
"peerDependencies": {
|
|
56
|
-
"@ikas/storefront-api": "^4.1.
|
|
57
|
-
"@ikas/storefront-config": "^4.1.
|
|
58
|
-
"@ikas/storefront-model-functions": "^4.1.
|
|
59
|
-
"@ikas/storefront-models": "^4.1.
|
|
60
|
-
"@ikas/storefront-providers": "^4.1.
|
|
55
|
+
"@ikas/storefront-api": "^4.1.1",
|
|
56
|
+
"@ikas/storefront-config": "^4.1.1",
|
|
57
|
+
"@ikas/storefront-model-functions": "^4.1.1",
|
|
58
|
+
"@ikas/storefront-models": "^4.1.1",
|
|
59
|
+
"@ikas/storefront-providers": "^4.1.1",
|
|
61
60
|
"mobx": "^6.1.3",
|
|
62
61
|
"mobx-react-lite": "^3.1.5",
|
|
63
62
|
"next": "12.2.0",
|
|
@@ -67,6 +66,8 @@
|
|
|
67
66
|
"html-react-parser": "^1.4.0",
|
|
68
67
|
"query-string": "^6.13.8",
|
|
69
68
|
"@stripe/react-stripe-js": "^1.10.0",
|
|
70
|
-
"@stripe/stripe-js": "^1.29.0"
|
|
69
|
+
"@stripe/stripe-js": "^1.29.0",
|
|
70
|
+
"react-tooltip": "^4.2.21",
|
|
71
|
+
"libphonenumber-js": "^1.10.6"
|
|
71
72
|
}
|
|
72
73
|
}
|
package/build/_virtual/index2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={exports:{}};export{r};
|
package/build/_virtual/index3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a={exports:{}};export{a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={};export{r as __exports};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={};export{r as __exports};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./metadata.js";import e from"./PhoneNumber.js";import n from"./AsYouTypeState.js";import a from"./AsYouTypeFormatter.js";import r from"./AsYouTypeParser.js";import i from"./helpers/getCountryByCallingCode.js";import{DIGIT_PLACEHOLDER as o}from"./AsYouTypeFormatter.util.js";function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var a,r,i=[],o=!0,u=!1;try{for(n=n.call(t);!(o=(a=n.next()).done)&&(i.push(a.value),!e||i.length!==e);o=!0);}catch(t){u=!0,r=t}finally{try{o||null==n.return||n.return()}finally{if(u)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function f(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}var m=function(){function l(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),this.metadata=new t(n);var a=s(this.getCountryAndCallingCode(e),2),r=a[0],i=a[1];this.defaultCountry=r,this.defaultCallingCode=i,this.reset()}var m,h,d;return m=l,(h=[{key:"getCountryAndCallingCode",value:function(t){var e,n;return t&&("object"===u(t)?(e=t.defaultCountry,n=t.defaultCallingCode):e=t),e&&!this.metadata.hasCountry(e)&&(e=void 0),[e,n]}},{key:"input",value:function(t){var e=this.parser.input(t,this.state),n=e.digits;if(e.justLeadingPlus)this.formattedOutput="+";else if(n){var a;if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(a=this.formatter.format(n,this.state)),void 0===a&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var r=this.state.getNationalDigits();r&&(a=this.formatter.format(r,this.state))}this.formattedOutput=a?this.getFullNumber(a):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var t=this;return this.state=new n({onCountryChange:function(e){t.country=e},onCallingCodeChange:function(e,n){t.metadata.selectNumberingPlan(e,n),t.formatter.reset(t.metadata.numberingPlan,t.state),t.parser.reset(t.metadata.numberingPlan)}}),this.formatter=new a({state:this.state,metadata:this.metadata}),this.parser=new r({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){t.determineTheCountryIfNeeded(),t.formatter.reset(t.metadata.numberingPlan,t.state)}}),this.state.reset(this.defaultCountry,this.defaultCallingCode),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){return this.state.country}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(t){var e=this;if(this.isInternational()){var n=function(t){return e.formatter.getInternationalPrefixBeforeCountryCallingCode(e.state,{spacing:!!t})+t},a=this.state.callingCode;return n(a?t?"".concat(a," ").concat(t):a:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return t}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var t=this.state,e=t.nationalSignificantNumber,n=t.complexPrefixBeforeNationalSignificantNumber,a=t.nationalPrefix,r=e,i=n||a;return i&&(r=i+r),r}},{key:"getNonFormattedNumber",value:function(){var t=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(t?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var t=this.getNonFormattedNumber();if(t)return t.replace(/[\+\d]/g,o)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var t=this.state.callingCode,e=this.metadata.getCountryCodesForCallingCode(t);return e&&e.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(i(this.isInternational()?this.state.callingCode:this.defaultCallingCode,this.state.nationalSignificantNumber,this.metadata))}},{key:"getNumberValue",value:function(){var t=this.state,e=t.digits,n=t.callingCode,a=t.country,r=t.nationalSignificantNumber;if(e)return this.isInternational()?n?"+"+n+r:"+"+e:a||n?"+"+(a?this.metadata.countryCallingCode():n)+r:void 0}},{key:"getNumber",value:function(){var t=this.state,n=t.nationalSignificantNumber,a=t.carrierCode,r=t.callingCode,i=this._getCountry();if(n&&(i||r)){var o=new e(i||r,n,this.metadata.metadata);return a&&(o.carrierCode=a),o}}},{key:"isPossible",value:function(){var t=this.getNumber();return!!t&&t.isPossible()}},{key:"isValid",value:function(){var t=this.getNumber();return!!t&&t.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])&&f(m.prototype,h),d&&f(m,d),Object.defineProperty(m,"prototype",{writable:!1}),l}();export{m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t,r){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,r){if(!t)return;if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var a=function(){function t(e){r(this,t),this.matchTree=(new c).parse(e)}return o(t,[{key:"match",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.allowOverflow;if(!t)throw new Error("String is required");var n=i(t.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||r)return n}}]),t}();function i(e,r,n){if("string"==typeof r){if(n&&e.length>r.length)return{overflow:!0};var o=e.join("");return 0===r.indexOf(o)?e.length===r.length?{match:!0,matchedChars:e}:{partialMatch:!0}:0===o.indexOf(r)?{match:!0,matchedChars:e.slice(0,r.length)}:void 0}if(Array.isArray(r)){for(var a=e.slice(),s=0;s<r.length;){var h=i(a,r[s],n&&s===r.length-1);if(!h)return;if(h.overflow)return h;if(!h.match){if(h.partialMatch)return{partialMatch:!0};throw new Error("Unsupported match result:\n".concat(JSON.stringify(h,null,2)))}if(0===(a=a.slice(h.matchedChars.length)).length)return s===r.length-1?{match:!0,matchedChars:e}:{partialMatch:!0};s++}return n?{overflow:!0}:{match:!0,matchedChars:e.slice(0,e.length-a.length)}}switch(r.op){case"|":for(var c,u,l=t(r.args);!(u=l()).done;){var f=i(e,u.value,n);if(f){if(f.overflow)return f;if(f.match)return{match:!0,matchedChars:f.matchedChars};if(!f.partialMatch)throw new Error("Unsupported match result:\n".concat(JSON.stringify(f,null,2)));c=!0}}return c?{partialMatch:!0}:void 0;case"[]":for(var p,g=t(r.args);!(p=g()).done;){var d=p.value;if(e[0]===d)return 1===e.length?{match:!0,matchedChars:e}:n?{overflow:!0}:{match:!0,matchedChars:[d]}}return;default:throw new Error("Unsupported instruction tree: ".concat(r))}}var s=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])"),h=/[\(\)\[\]\?\:\|]/,c=function(){function t(){r(this,t)}return o(t,[{key:"parse",value:function(t){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(t),1!==this.context.length)throw new Error("Non-finalized contexts left when pattern parse ended");var e=this.context[0],r=e.branches,n=e.instructions;if(r)return[{op:"|",args:r.concat([n])}];if(0===n.length)throw new Error("Pattern is required");return n}},{key:"startContext",value:function(t){this.context.push(t)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(t){if(!t)throw new Error("Pattern is required");var e=t.match(s);if(e){var r=e[1],n=t.slice(0,e.index),o=t.slice(e.index+r.length);switch(r){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw new Error('No instructions found after "|" operator in an "or" group');var a=this.getContext().branches;a.push(this.getContext().instructions),this.endContext(),this.getContext().instructions.push({op:"|",args:a});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches){if(1!==this.context.length)throw new Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(this.getContext().instructions),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:u(n)});break;default:throw new Error("Unknown operator: ".concat(r))}o&&this.parsePattern(o)}else{if(h.test(t))throw new Error("Illegal characters found in a pattern: ".concat(t));this.getContext().instructions=this.getContext().instructions.concat(t.split(""))}}}]),t}();function u(t){for(var e=[],r=0;r<t.length;){if("-"===t[r]){if(0===r||r===t.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(t));for(var n=t[r-1].charCodeAt(0)+1,o=t[r+1].charCodeAt(0)-1,a=n;a<=o;)e.push(String.fromCharCode(a)),a++}else e.push(t[r]);r++}return e}export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import a from"./helpers/checkNumberLength.js";import t from"./helpers/parseDigits.js";import e from"./helpers/formatNationalNumberUsingFormat.js";function r(a,t,e){var r=e.metadata,i=e.shouldTryNationalPrefixFormattingRule,o=e.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(a.nationalSignificantNumber))return function(a,t,e){var r=e.metadata,i=e.shouldTryNationalPrefixFormattingRule,o=e.getSeparatorAfterNationalPrefix;if(a.nationalSignificantNumber,a.international,a.nationalPrefix,a.carrierCode,i(t)){var f=n(a,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:o,metadata:r});if(f)return f}return n(a,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:o,metadata:r})}(a,t,{metadata:r,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:o})}function i(t,e){return"IS_POSSIBLE"===a(t,e)}function n(a,r,i){var n=i.metadata,o=i.useNationalPrefixFormattingRule,f=i.getSeparatorAfterNationalPrefix,l=e(a.nationalSignificantNumber,r,{carrierCode:a.carrierCode,useInternationalFormat:a.international,withNationalPrefix:o,metadata:n});if(o||(a.nationalPrefix?l=a.nationalPrefix+f(r)+l:a.complexPrefixBeforeNationalSignificantNumber&&(l=a.complexPrefixBeforeNationalSignificantNumber+" "+l)),function(a,e){return t(a)===e.getNationalDigits()}(l,a))return l}export{i as canFormatCompleteNumber,r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DIGIT_PLACEHOLDER as t,cutAndStripNonPairedParens as e,repeat as a,populateTemplateWithDigits as r}from"./AsYouTypeFormatter.util.js";export{DIGIT_PLACEHOLDER}from"./AsYouTypeFormatter.util.js";import i,{canFormatCompleteNumber as n}from"./AsYouTypeFormatter.complete.js";import o from"./AsYouTypeFormatter.PatternMatcher.js";import l from"./helpers/parseDigits.js";import{FIRST_GROUP_PATTERN as s}from"./helpers/formatNationalNumberUsingFormat.js";import{VALID_PUNCTUATION as m}from"./constants.js";import u from"./helpers/applyInternationalSeparatorStyle.js";function f(t,e){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return(a=a.call(t)).next.bind(a);if(Array.isArray(t)||(a=function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return h(t,e)}(t))||e&&t&&"number"==typeof t.length){a&&(t=a);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}function p(t,e){for(var a=0;a<e.length;a++){var r=e[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=a("9",15),g=/[- ]/,N=new RegExp("["+m+"]*\\$1["+m+"]*(\\$\\d["+m+"]*)*$"),v=function(){function m(t){t.state;var e=t.metadata;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,m),this.metadata=e,this.resetFormat()}var h,v,d;return h=m,(v=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(t,e){this.resetFormat(),t?(this.isNANP="1"===t.callingCode(),this.matchingFormats=t.formats(),e.nationalSignificantNumber&&this.narrowDownMatchingFormats(e)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(e,a){var r=this;if(n(a.nationalSignificantNumber,this.metadata))for(var o,l=f(this.matchingFormats);!(o=l()).done;){var s=o.value,m=i(a,s,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(t){return r.shouldTryNationalPrefixFormattingRule(t,{international:a.international,nationalPrefix:a.nationalPrefix})},getSeparatorAfterNationalPrefix:function(t){return r.getSeparatorAfterNationalPrefix(t)}});if(m)return this.resetFormat(),this.chosenFormat=s,this.setNationalNumberTemplate(m.replace(/\d/g,t),a),this.populatedNationalNumberTemplate=m,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(t),m}return this.formatNationalNumberWithNextDigits(e,a)}},{key:"formatNationalNumberWithNextDigits",value:function(t,e){var a=this.chosenFormat,r=this.chooseFormat(e);if(r)return r===a?this.formatNextNationalNumberDigits(t):this.formatNextNationalNumberDigits(e.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(t){var e=this,a=t.nationalSignificantNumber,r=t.nationalPrefix,i=t.international,n=a,o=n.length-3;o<0&&(o=0),this.matchingFormats=this.matchingFormats.filter((function(t){return e.formatSuits(t,i,r)&&e.formatMatches(t,n,o)})),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(t,e,a){return!(a&&!t.usesNationalPrefix()&&!t.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!e&&!a&&t.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(t,e,a){var r=t.leadingDigitsPatterns().length;if(0===r)return!0;a=Math.min(a,r-1);var i=t.leadingDigitsPatterns()[a];if(e.length<3)try{return void 0!==new o(i).match(e,{allowOverflow:!0})}catch(t){return console.error(t),!0}return new RegExp("^(".concat(i,")")).test(e)}},{key:"getFormatFormat",value:function(t,e){return e?t.internationalFormat():t.format()}},{key:"chooseFormat",value:function(t){for(var e,a=this,r=function(){var r=e.value;return a.chosenFormat===r?"break":N.test(a.getFormatFormat(r,t.international))?a.createTemplateForFormat(r,t)?(a.chosenFormat=r,"break"):(a.matchingFormats=a.matchingFormats.filter((function(t){return t!==r})),"continue"):"continue"},i=f(this.matchingFormats.slice());!(e=i()).done;){var n=r();if("break"===n)break}return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(t,e){if(!(t.pattern().indexOf("|")>=0)){var a=this.getTemplateForFormat(t,e);return a?(this.setNationalNumberTemplate(a,e),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(t){return this.isNANP||t&&t.nationalPrefixFormattingRule()&&g.test(t.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(t,e){var a=t.IDDPrefix,r=t.missingPlus;return a?e&&!1===e.spacing?a:a+" ":r?"":"+"}},{key:"getTemplate",value:function(a){if(this.template){for(var r=-1,i=0,n=a.international?this.getInternationalPrefixBeforeCountryCallingCode(a,{spacing:!1}):"";i<n.length+a.getDigitsWithoutInternationalPrefix().length;)r=this.template.indexOf(t,r+1),i++;return e(this.template,r+1)}}},{key:"setNationalNumberTemplate",value:function(e,r){this.nationalNumberTemplate=e,this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=-1,r.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(r).replace(/[\d\+]/g,t)+a(t,r.callingCode.length)+" "+e:this.template=e}},{key:"getTemplateForFormat",value:function(e,r){var i=r.nationalSignificantNumber,n=r.international,o=r.nationalPrefix,m=r.complexPrefixBeforeNationalSignificantNumber,f=e.pattern();f=f.replace(/\[([^\[\]])*\]/g,"\\d").replace(/\d(?=[^,}][^,}])/g,"\\d");var h=c.match(f)[0];if(!(i.length>h.length)){var p=new RegExp("^"+f+"$"),g=i.replace(/\d/g,"9");p.test(g)&&(h=g);var N,v=this.getFormatFormat(e,n);if(this.shouldTryNationalPrefixFormattingRule(e,{international:n,nationalPrefix:o})){var d=v.replace(s,e.nationalPrefixFormattingRule());if(l(e.nationalPrefixFormattingRule())===(o||"")+l("$1")&&(v=d,N=!0,o))for(var F=o.length;F>0;)v=v.replace(/\d/,t),F--}var y=h.replace(new RegExp(f),v).replace(new RegExp("9","g"),t);return N||(m?y=a(t,m.length)+" "+y:o&&(y=a(t,o.length)+this.getSeparatorAfterNationalPrefix(e)+y)),n&&(y=u(y)),y}}},{key:"formatNextNationalNumberDigits",value:function(t){var a=r(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,t);if(a)return this.populatedNationalNumberTemplate=a[0],this.populatedNationalNumberTemplatePosition=a[1],e(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(t,e){var a=e.international,r=e.nationalPrefix;if(t.nationalPrefixFormattingRule()){var i=t.usesNationalPrefix();if(i&&r||!i&&!a)return!0}}}])&&p(h.prototype,v),d&&p(h,d),Object.defineProperty(h,"prototype",{writable:!1}),m}();export{v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function r(r,t){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,t){if(!r)return;if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}(r))||t&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var t="x",n=new RegExp("x");function o(r,e){if(e<1)return"";for(var t="";e>1;)1&e&&(t+=r),e>>=1,r+=r;return t+r}function a(r,e){return")"===r[e]&&e++,i(r.slice(0,e))}function i(r){for(var e=[],t=0;t<r.length;)"("===r[t]?e.push(t):")"===r[t]&&e.pop(),t++;var n=0,o="";e.push(r.length);for(var a=0,i=e;a<i.length;a++){var u=i[a];o+=r.slice(n,u),n=u+1}return o}function u(e,t,o){for(var a,i=r(o.split(""));!(a=i()).done;){var u=a.value;if(e.slice(t+1).search(n)<0)return;t=e.search(n),e=e.replace(n,u)}return[e,t]}export{t as DIGIT_PLACEHOLDER,a as cutAndStripNonPairedParens,u as populateTemplateWithDigits,o as repeat,i as stripNonPairedParens};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./helpers/extractCountryCallingCode.js";import i from"./helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js";import n from"./helpers/extractNationalNumberFromPossiblyIncompleteNumber.js";import a from"./helpers/stripIddPrefix.js";import e from"./helpers/parseDigits.js";import{VALID_PUNCTUATION as r,VALID_DIGITS as o,PLUS_CHARS as l}from"./constants.js";function u(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,i){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var a,e,r=[],o=!0,l=!1;try{for(n=n.call(t);!(o=(a=n.next()).done)&&(r.push(a.value),!i||r.length!==i);o=!0);}catch(t){l=!0,e=t}finally{try{o||null==n.return||n.return()}finally{if(l)throw e}}return r}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return s(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,i){(null==i||i>t.length)&&(i=t.length);for(var n=0,a=new Array(i);n<i;n++)a[n]=t[n];return a}function c(t,i){for(var n=0;n<i.length;n++){var a=i[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}var f=new RegExp("^"+("["+r+o+"]+")+"$","i"),g="(?:["+l+"]["+r+o+"]*|["+r+o+"]+)",d=new RegExp("[^"+r+o+"]+.*$"),h=/[^\d\[\]]/,m=function(){function r(t){var i=t.defaultCountry,n=t.defaultCallingCode,a=t.metadata,e=t.onNationalSignificantNumberChange;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,r),this.defaultCountry=i,this.defaultCallingCode=n,this.metadata=a,this.onNationalSignificantNumberChange=e}var o,l,s;return o=r,(l=[{key:"input",value:function(t,i){var n,a=u(b(t),2),r=a[0],o=a[1],l=e(r);return o&&(i.digits||(i.startInternationalNumber(),l||(n=!0))),l&&this.inputDigits(l,i),{digits:l,justLeadingPlus:n}}},{key:"inputDigits",value:function(t,i){var n=i.digits,a=n.length<3&&n.length+t.length>=3;if(i.appendDigits(t),a&&this.extractIddPrefix(i),this.isWaitingForCountryCallingCode(i)){if(!this.extractCountryCallingCode(i))return}else i.appendNationalSignificantNumberDigits(t);i.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(i.getNationalDigits(),(function(t){return i.update(t)}))}},{key:"isWaitingForCountryCallingCode",value:function(t){var i=t.international,n=t.callingCode;return i&&!n}},{key:"extractCountryCallingCode",value:function(i){var n=t("+"+i.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),a=n.countryCallingCode,e=n.number;if(a)return i.setCallingCode(a),i.update({nationalSignificantNumber:e}),!0}},{key:"reset",value:function(t){if(t){this.hasSelectedNumberingPlan=!0;var i=t._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=i&&h.test(i)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(t,i){if(this.hasSelectedNumberingPlan){var a=n(t,this.metadata),e=a.nationalPrefix,r=a.nationalNumber,o=a.carrierCode;if(r!==t)return this.onExtractedNationalNumber(e,o,r,t,i),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(t,i,a){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(t,a);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var e=n(t,this.metadata),r=e.nationalPrefix,o=e.nationalNumber,l=e.carrierCode;if(o!==i)return this.onExtractedNationalNumber(r,l,o,t,a),!0}}},{key:"onExtractedNationalNumber",value:function(t,i,n,a,e){var r,o,l=a.lastIndexOf(n);if(l>=0&&l===a.length-n.length){o=!0;var u=a.slice(0,l);u!==t&&(r=u)}e({nationalPrefix:t,carrierCode:i,nationalSignificantNumber:n,nationalSignificantNumberMatchesInput:o,complexPrefixBeforeNationalSignificantNumber:r}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(t){return!!this.extractAnotherNationalSignificantNumber(t.getNationalDigits(),t.nationalSignificantNumber,(function(i){return t.update(i)}))||(this.extractIddPrefix(t)||this.fixMissingPlus(t)?(this.extractCallingCodeAndNationalSignificantNumber(t),!0):void 0)}},{key:"extractIddPrefix",value:function(t){var i=t.international,n=t.IDDPrefix,e=t.digits;if(t.nationalSignificantNumber,!i&&!n){var r=a(e,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==r&&r!==e?(t.update({IDDPrefix:e.slice(0,e.length-r.length)}),this.startInternationalNumber(t),!0):void 0}}},{key:"fixMissingPlus",value:function(t){if(!t.international){var n=i(t.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),a=n.countryCallingCode;if(n.number,a)return t.update({missingPlus:!0}),this.startInternationalNumber(t),!0}}},{key:"startInternationalNumber",value:function(t){t.startInternationalNumber(),t.nationalSignificantNumber&&(t.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(t){this.extractCountryCallingCode(t)&&this.extractNationalSignificantNumber(t.getNationalDigits(),(function(i){return t.update(i)}))}}])&&c(o.prototype,l),s&&c(o,s),Object.defineProperty(o,"prototype",{writable:!1}),r}();function N(t){var i=function(t){var i,n=t.search(g);if(!(n<0))return"+"===(t=t.slice(n))[0]&&(i=!0,t=t.slice("+".length)),t=t.replace(d,""),i&&(t="+"+t),t}(t)||"";return"+"===i[0]?[i.slice("+".length),!0]:[i]}function b(t){var i=u(N(t),2),n=i[0],a=i[1];return f.test(n)||(n=""),[n,a]}export{m as default,b as extractFormattedDigitsAndPlus};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function i(i,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}var t=function(){function t(i){var n=i.onCountryChange,e=i.onCallingCodeChange;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.onCountryChange=n,this.onCallingCodeChange=e}var n,e,a;return n=t,(e=[{key:"reset",value:function(i,t){this.international=!1,this.IDDPrefix=void 0,this.missingPlus=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(i,t)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=void 0}},{key:"update",value:function(i){for(var t=0,n=Object.keys(i);t<n.length;t++){var e=n[t];this[e]=i[e]}}},{key:"initCountryAndCallingCode",value:function(i,t){this.setCountry(i),this.setCallingCode(t)}},{key:"setCountry",value:function(i){this.country=i,this.onCountryChange(i)}},{key:"setCallingCode",value:function(i){return this.callingCode=i,this.onCallingCodeChange(this.country,i)}},{key:"startInternationalNumber",value:function(){this.international=!0,this.initCountryAndCallingCode()}},{key:"appendDigits",value:function(i){this.digits+=i}},{key:"appendNationalSignificantNumberDigits",value:function(i){this.nationalSignificantNumber+=i}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])&&i(n.prototype,e),a&&i(n,a),Object.defineProperty(n,"prototype",{writable:!1}),t}();export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return n(e)}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t){var e="function"==typeof Map?new Map:void 0;return o=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,f(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,t)},o(t)}function u(t,e,r){return u=c()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&i(o,r.prototype),o},u.apply(null,arguments)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}var p=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(b,o(Error));var u,p,a,l,y,s=(u=b,p=c(),function(){var t,e=f(u);if(p){var n=f(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return r(this,t)});function b(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,b),e=s.call(this,t),Object.setPrototypeOf(n(e),b.prototype),e.name=e.constructor.name,e}return a=b,l&&e(a.prototype,l),y&&e(a,y),Object.defineProperty(a,"prototype",{writable:!1}),a}();export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./metadata.js";import e from"./isPossibleNumber_.js";import r from"./validate_.js";import n from"./helpers/getNumberType.js";import o from"./format_.js";function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var c=function(){function a(e,r,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),!e)throw new TypeError("`country` or `countryCallingCode` not passed");if(!r)throw new TypeError("`nationalNumber` not passed");if(!n)throw new TypeError("`metadata` not passed");var o=new t(n);l(e)&&(this.country=e,o.country(e),e=o.countryCallingCode()),this.countryCallingCode=e,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.metadata=n}var u,c,f;return u=a,(c=[{key:"setExt",value:function(t){this.ext=t}},{key:"isPossible",value:function(){return e(this,{v2:!0},this.metadata)}},{key:"isValid",value:function(){return r(this,{v2:!0},this.metadata)}},{key:"isNonGeographic",value:function(){return new t(this.metadata).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return n(this,{v2:!0},this.metadata)}},{key:"format",value:function(t,e){return o(this,t,e?i(i({},e),{},{v2:!0}):{v2:!0},this.metadata)}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}])&&s(u.prototype,c),f&&s(u,f),Object.defineProperty(u,"prototype",{writable:!1}),a}(),l=function(t){return/^[A-Z]{2}$/.test(t)};export{c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./PhoneNumber.js";import{MAX_LENGTH_FOR_NSN as e,MAX_LENGTH_COUNTRY_CODE as r,VALID_PUNCTUATION as n}from"./constants.js";import i from"./helpers/extension/createExtensionPattern.js";import o from"./findNumbers/RegExpCache.js";import{limit as a,trimAfterFirstMatch as s}from"./findNumbers/util.js";import{pNd as c,_pN as u,_pL as l,pZ as f,PZ as h}from"./findNumbers/utf-8.js";import d from"./findNumbers/Leniency.js";import p from"./findNumbers/parsePreCandidate.js";import y from"./findNumbers/isValidPreCandidate.js";import m,{LEAD_CLASS as b}from"./findNumbers/isValidCandidate.js";import{isSupportedCountry as x}from"./metadata.js";import v from"./parse_.js";function g(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var T=i(),N=["\\/+(.*)/","(\\([^(]*)","(?:".concat(f,"-|-").concat(f,")").concat(f,"*(.+)"),"[‒-―-]".concat(f,"*(.+)"),"\\.+".concat(f,"*([^.]+)"),"".concat(f,"+(").concat(h,"+)")],P=a(0,2),R=a(0,4),D=e+r,S=a(0,D),I="[".concat(n,"]")+R,M=c+a(1,D),k="(?:"+b+I+")"+P+M+"(?:"+I+M+")"+S+"(?:"+T+")?",V=new RegExp("[^".concat(u).concat(l,"#]+$")),_=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,Y=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(E(this,e),!(r=C(C({},r),{},{defaultCallingCode:r.defaultCallingCode,defaultCountry:r.defaultCountry&&x(r.defaultCountry,n)?r.defaultCountry:void 0,leniency:r.leniency||r.extended?"POSSIBLE":"VALID",maxTries:r.maxTries||_})).leniency)throw new TypeError("`Leniency` not supplied");if(r.maxTries<0)throw new TypeError("`maxTries` not supplied");if(this.text=t,this.options=r,this.metadata=n,this.leniency=d[r.leniency],!this.leniency)throw new TypeError("Unknown leniency: ".concat(r.leniency,"."));this.maxTries=r.maxTries,this.PATTERN=new RegExp(k,"ig"),this.state="NOT_READY",this.searchIndex=0,this.regExpCache=new o(32)}var r,n,i;return r=e,(n=[{key:"find",value:function(){for(var e;this.maxTries>0&&null!==(e=this.PATTERN.exec(this.text));){var r=e[0],n=e.index;if(r=p(r),y(r,n,this.text)){var i=this.parseAndVerify(r,n,this.text)||this.extractInnerMatch(r,n,this.text);if(i){if(this.options.v2){var o=new t(i.country||i.countryCallingCode,i.phone,this.metadata);return i.ext&&(o.ext=i.ext),{startsAt:i.startsAt,endsAt:i.endsAt,number:o}}return i}}this.maxTries--}}},{key:"extractInnerMatch",value:function(t,e,r){for(var n,i=g(N);!(n=i()).done;)for(var o=n.value,a=!0,c=void 0,u=new RegExp(o,"g");this.maxTries>0&&null!==(c=u.exec(t));){if(a){var l=s(V,t.slice(0,c.index)),f=this.parseAndVerify(l,e,r);if(f)return f;this.maxTries--,a=!1}var h=s(V,c[1]),d=t.indexOf(h,c.index),p=this.parseAndVerify(h,e+d,r);if(p)return p;this.maxTries--}}},{key:"parseAndVerify",value:function(t,e,r){if(m(t,e,r,this.options.leniency)){var n=v(t,{extended:!0,defaultCountry:this.options.defaultCountry,defaultCallingCode:this.options.defaultCallingCode},this.metadata);if(n.possible&&this.leniency(n,t,this.metadata,this.regExpCache)){var i={startsAt:e,endsAt:e+t.length,phone:n.phone};return n.country&&"001"!==n.country?i.country=n.country:i.countryCallingCode=n.countryCallingCode,n.ext&&(i.ext=n.ext),i}}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.lastMatch=this.find(),this.lastMatch?this.state="READY":this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var t=this.lastMatch;return this.lastMatch=null,this.state="NOT_READY",t}}])&&A(r.prototype,n),i&&A(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}();export{Y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c=2,a=17,o=3,t="0-90-9٠-٩۰-۹",n=" ",r="".concat("-‐-―−ー-").concat("//").concat("..").concat(" ").concat("()()[]\\[\\]").concat("~⁓∼~"),e="++";export{o as MAX_LENGTH_COUNTRY_CODE,a as MAX_LENGTH_FOR_NSN,c as MIN_LENGTH_FOR_NSN,e as PLUS_CHARS,t as VALID_DIGITS,r as VALID_PUNCTUATION,n as WHITESPACE};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=t((function e(t,n){var h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;i(this,e),this.key=t,this.value=n,this.next=h,this.prev=a})),h=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;i(this,e),this.size=0,this.limit=t,this.head=null,this.tail=null,this.cache={}}return t(e,[{key:"put",value:function(e,t){if(this.ensureLimit(),this.head){var i=new n(e,t,this.head);this.head.prev=i,this.head=i}else this.head=this.tail=new n(e,t);this.cache[e]=this.head,this.size++}},{key:"get",value:function(e){if(this.cache[e]){var t=this.cache[e].value;return this.remove(e),this.put(e,t),t}console.log("Item not available in cache for key ".concat(e))}},{key:"ensureLimit",value:function(){this.size===this.limit&&this.remove(this.tail.key)}},{key:"remove",value:function(e){var t=this.cache[e];null!==t.prev?t.prev.next=t.next:this.head=t.next,null!==t.next?t.next.prev=t.prev:this.tail=t.prev,delete this.cache[e],this.size--}},{key:"clear",value:function(){this.head=null,this.tail=null,this.size=0,this.cache={}}}]),e}();export{h as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"../validate_.js";import r from"../helpers/parseDigits.js";import{endsWith as e,startsWith as n}from"./util.js";function i(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,r){if(!t)return;if("string"==typeof t)return o(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return o(t,r)}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var a={POSSIBLE:function(t,r,e){return!0},VALID:function(r,e,n){return!(!t(r,void 0,n)||!u(r,e.toString()))},STRICT_GROUPING:function(r,e,n,i){var o=e.toString();return!(!t(r,void 0,n)||!u(r,o)||g(r,o)||!l(r))&&f(r,e,n,d,i)},EXACT_GROUPING:function(r,e,n,i){var o=e.toString();return!(!t(r,void 0,n)||!u(r,o)||g(r,o)||!l(r))&&f(r,e,n,c,i)}};function u(t,e,n){for(var i=0;i<e.length-1;i++){var o=e.charAt(i);if("x"===o||"X"===o){var a=e.charAt(i+1);if("x"===a||"X"===a){if(i++,util.isNumberMatch(t,e.substring(i))!=MatchType.NSN_MATCH)return!1}else if(r(e.substring(i))!==t.ext)return!1}}return!0}function l(t,r){if("FROM_DEFAULT_COUNTRY"!=t.getCountryCodeSource())return!0;var e=util.getRegionCodeForCountryCode(t.getCountryCode()),n=util.getMetadataForRegion(e);if(null==n)return!0;var i=util.getNationalSignificantNumber(t),o=util.chooseFormattingPatternForNumber(n.numberFormats(),i);if(o&&o.getNationalPrefixFormattingRule().length>0){if(o.getNationalPrefixOptionalWhenFormatting())return!0;if(PhoneNumberUtil.formattingRuleHasFirstGroupOnly(o.getNationalPrefixFormattingRule()))return!0;var a=PhoneNumberUtil.normalizeDigitsOnly(t.getRawInput());return util.maybeStripNationalPrefixAndCarrierCode(a,n,null)}return!0}function g(t,r){var e=r.indexOf("/");if(e<0)return!1;var n=r.indexOf("/",e+1);return!(n<0)&&(!(t.getCountryCodeSource()===CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN||t.getCountryCodeSource()===CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN)||PhoneNumberUtil.normalizeDigitsOnly(r.substring(0,e))!==String(t.getCountryCode())||r.slice(n+1).indexOf("/")>=0)}function f(t,r,e,n,o){var a=normalizeDigits(r,!0),u=s(e,t,null);if(n(e,t,a,u))return!0;var l=MetadataManager.getAlternateFormatsForCountry(t.getCountryCode()),g=util.getNationalSignificantNumber(t);if(l)for(var f,c=i(l.numberFormats());!(f=c()).done;){var d=f.value;if(d.leadingDigitsPatterns().length>0)if(!o.getPatternForRegExp("^"+d.leadingDigitsPatterns()[0]).test(g))continue;if(n(e,t,a,u=s(e,t,d)))return!0}return!1}function s(t,r,e){if(e){var n=util.getNationalSignificantNumber(r);return util.formatNsnUsingPattern(n,e,"RFC3966",t).split("-")}var i=formatNumber(r,"RFC3966",t),o=i.indexOf(";");o<0&&(o=i.length);var a=i.indexOf("-")+1;return i.slice(a,o).split("-")}function c(t,r,n,i){var o=n.split(NON_DIGITS_PATTERN),a=r.hasExtension()?o.length-2:o.length-1;if(1==o.length||o[a].contains(util.getNationalSignificantNumber(r)))return!0;for(var u=i.length-1;u>0&&a>=0;){if(o[a]!==i[u])return!1;u--,a--}return a>=0&&e(o[a],i[0])}function d(t,r,e,i){var o=0;if(r.getCountryCodeSource()!==CountryCodeSource.FROM_DEFAULT_COUNTRY){var a=String(r.getCountryCode());o=e.indexOf(a)+a.length()}for(var u=0;u<i.length;u++){if((o=e.indexOf(i[u],o))<0)return!1;if(o+=i[u].length(),0==u&&o<e.length()){var l=util.getRegionCodeForCountryCode(r.getCountryCode());if(null!=util.getNddPrefixForRegion(l,!0)&&Character.isDigit(e.charAt(o))){var g=util.getNationalSignificantNumber(r);return n(e.slice(o-i[u].length),g)}}}return e.slice(o).contains(r.getExtension())}export{g as containsMoreThanOneSlashInNationalNumber,a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"./LRUCache.js";function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var r=function(){function r(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.cache=new e(t)}var n,a,o;return n=r,(a=[{key:"getPatternForRegExp",value:function(e){var t=this.cache.get(e);return t||(t=new RegExp("^"+e),this.cache.put(e,t)),t}}])&&t(n.prototype,a),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),r}();export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{PLUS_CHARS as t}from"../constants.js";import{limit as r}from"./util.js";import{isInvalidPunctuationSymbol as n,isLatinLetter as e}from"./utf-8.js";var o="[^".concat("(\\[([").concat(")\\])]","]"),f="[".concat("(\\[([").concat(t,"]"),a=new RegExp("^"+f),i=r(0,3),c=new RegExp("^(?:[(\\[([])?(?:"+o+"+[)\\])]])?"+o+"+(?:[(\\[([]"+o+"+[)\\])]])"+i+o+"*$"),s=/\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;function u(t,r,o,f){if(c.test(t)&&!s.test(t)){if("POSSIBLE"!==f){if(r>0&&!a.test(t)){var i=o[r-1];if(n(i)||e(i))return!1}var u=r+t.length;if(u<o.length){var m=o[u];if(n(m)||e(m))return!1}}return!0}}export{f as LEAD_CLASS,u as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=/(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/,d=/[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/,e=/^:[0-5]\d/;function r(r,n,f){if(t.test(r))return!1;if(d.test(r)){var i=f.slice(n+r.length);if(e.test(i))return!1}return!0}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{trimAfterFirstMatch as r}from"./util.js";var t=/[\\/] *x/;function o(o){return r(t,o)}export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=" - \u2028\u2029 ",n="[".concat(t,"]"),e="[^".concat(t,"]"),c="0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9",o="[".concat("0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9","]"),a="A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",r="[".concat(a,"]"),u=new RegExp(r),p="[".concat("$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩$¢£¥₩","]"),x=new RegExp(p),g="[".concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦","]"),s=new RegExp(g),w=new RegExp("[\0--ÿĀ-ſḀ-ỿƀ-ɏ̀-ͯ]");function E(t){return!(!u.test(t)&&!s.test(t))&&w.test(t)}function R(t){return"%"===t||x.test(t)}export{e as PZ,a as _pL,c as _pN,R as isInvalidPunctuationSymbol,E as isLatinLetter,o as pNd,n as pZ};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(n,t){if(n<0||t<=0||t<n)throw new TypeError;return"{".concat(n,",").concat(t,"}")}function t(n,t){var e=t.search(n);return e>=0?t.slice(0,e):t}function e(n,t){return 0===n.indexOf(t)}function r(n,t){return n.indexOf(t,n.length-t.length)===n.length-t.length}export{r as endsWith,n as limit,e as startsWith,t as trimAfterFirstMatch};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{WHITESPACE as t,VALID_PUNCTUATION as e}from"./constants.js";import i from"./parse_.js";import{VALID_PHONE_NUMBER_WITH_EXTENSION as a}from"./helpers/isViablePhoneNumber.js";import r from"./findNumbers/parsePreCandidate.js";import n from"./findNumbers/isValidPreCandidate.js";import s from"./findNumbers/isValidCandidate.js";function o(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}var h=new RegExp("^["+t+"]+"),f=new RegExp("["+e+"]+$"),l=function(){function t(e,i,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.text=e,this.options=i||{},this.metadata=r,this.state="NOT_READY",this.regexp=new RegExp(a,"ig")}var e,l,p;return e=t,(l=[{key:"find",value:function(){var t=this.regexp.exec(this.text);if(t){var e=t[0],i=t.index;e=e.replace(h,""),i+=t[0].length-e.length,e=e.replace(f,""),e=r(e);var a=this.parseCandidate(e,i);return a||this.find()}}},{key:"parseCandidate",value:function(t,e){if(n(t,e,this.text)&&s(t,e,this.text,this.options.extended?"POSSIBLE":"VALID")){var a=i(t,this.options,this.metadata);if(a.phone)return a.startsAt=e,a.endsAt=e+t.length,a}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.last_match=this.find(),this.last_match?this.state="READY":this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var t=this.last_match;return this.last_match=null,this.state="NOT_READY",t}}])&&o(e.prototype,l),p&&o(e,p),Object.defineProperty(e,"prototype",{writable:!1}),t}();export{l as PhoneNumberSearch};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import o from"./AsYouType.js";function t(t,e,n){return n||(n=e,e=void 0),new o(e,n).input(t)}export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./helpers/matchesEntirely.js";import r from"./helpers/formatNationalNumberUsingFormat.js";import e,{getCountryCallingCode as n}from"./metadata.js";import o from"./helpers/getIddPrefix.js";import{formatRFC3966 as a}from"./helpers/RFC3966.js";function i(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,r){if(!t)return;if("string"==typeof t)return c(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return c(t,r)}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function u(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function f(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?u(Object(e),!0).forEach((function(r){l(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function l(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var s={formatExtension:function(t,r,e){return"".concat(t).concat(e.ext()).concat(r)}};function m(t,r,i,c){if(i=i?f(f({},s),i):s,c=new e(c),t.country&&"001"!==t.country){if(!c.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));c.country(t.country)}else{if(!t.countryCallingCode)return t.phone||"";c.selectNumberingPlan(t.countryCallingCode)}var u,l=c.countryCallingCode(),m=i.v2?t.nationalNumber:t.phone;switch(r){case"NATIONAL":return m?y(u=p(m,t.carrierCode,"NATIONAL",c,i),t.ext,c,i.formatExtension):"";case"INTERNATIONAL":return m?(u=p(m,null,"INTERNATIONAL",c,i),y(u="+".concat(l," ").concat(u),t.ext,c,i.formatExtension)):"+".concat(l);case"E.164":return"+".concat(l).concat(m);case"RFC3966":return a({number:"+".concat(l).concat(m),ext:t.ext});case"IDD":if(!i.fromCountry)return;var b=function(t,r,e,a,i){if(n(a,i.metadata)===e){var c=p(t,r,"NATIONAL",i);return"1"===e?e+" "+c:c}var u=o(a,void 0,i.metadata);if(u)return"".concat(u," ").concat(e," ").concat(p(t,null,"INTERNATIONAL",i))}(m,t.carrierCode,l,i.fromCountry,c);return y(b,t.ext,c,i.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(r,'"'))}}function p(e,n,o,a,c){var u=function(r,e){for(var n,o=i(r);!(n=o()).done;){var a=n.value;if(a.leadingDigitsPatterns().length>0){var c=a.leadingDigitsPatterns()[a.leadingDigitsPatterns().length-1];if(0!==e.search(c))continue}if(t(e,a.pattern()))return a}}(a.formats(),e);return u?r(e,u,{useInternationalFormat:"INTERNATIONAL"===o,withNationalPrefix:!u.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!c||!1!==c.nationalPrefix,carrierCode:n,metadata:a}):e}function y(t,r,e,n){return r?n(t,r,e):t}export{m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"./metadata.js";function e(e){return new t(e).getCountries()}export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"./isViablePhoneNumber.js";function t(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==e)return;var n,o,a=[],i=!0,l=!1;try{for(e=e.call(r);!(i=(n=e.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(r){l=!0,o=r}finally{try{i||null==e.return||e.return()}finally{if(l)throw o}}return a}(r,t)||e(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(r,t){if(r){if("string"==typeof r)return n(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(r,t):void 0}}function n(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function o(n){for(var o,a,i,l=function(r,t){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=e(r))||t&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}((n=n.replace(/^tel:/,"tel=")).split(";"));!(i=l()).done;){var u=t(i.value.split("="),2),c=u[0],f=u[1];switch(c){case"tel":o=f;break;case"ext":a=f;break;case"phone-context":"+"===f[0]&&(o=f+o)}}if(!r(o))return{};var b={number:o};return a&&(b.ext=a),b}function a(r){var t=r.number,e=r.ext;if(!t)return"";if("+"!==t[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(e?";ext="+e:"")}export{a as formatRFC3966,o as parseRFC3966};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{VALID_PUNCTUATION as t}from"../constants.js";function e(e){return e.replace(new RegExp("[".concat(t,"]+"),"g")," ").trim()}export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"./mergeArrays.js";function r(e,r){return t(e,void 0,r)}function t(r,I,L){var n=L.type(I),O=n&&n.possibleLengths()||L.possibleLengths();if(!O)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===I){if(!L.type("FIXED_LINE"))return t(r,"MOBILE",L);var s=L.type("MOBILE");s&&(O=e(O,s.possibleLengths()))}else if(I&&!n)return"INVALID_LENGTH";var i=r.length,E=O[0];return E===i?"IS_POSSIBLE":E>i?"TOO_SHORT":O[O.length-1]<i?"TOO_LONG":O.indexOf(i,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}export{t as checkNumberLengthForType,r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{VALID_DIGITS as t}from"../../constants.js";var n=function(n){return"([".concat(t,"]{1,").concat(n,"})")};function o(t){var o="#?";return";ext="+n("20")+"|"+("[ \\t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)[:\\..]?[ \\t,-]*"+n("20")+o)+"|"+("[ \\t,]*(?:[xx##~~]|int|int)[:\\..]?[ \\t,-]*"+n("9")+o)+"|"+("[- ]+"+n("6")+"#")+"|"+("[ \\t]*(?:,{2}|;)[:\\..]?[ \\t,-]*"+n("15")+o)+"|"+("[ \\t]*(?:,)+[:\\..]?[ \\t,-]*"+n("9")+o)}export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"./createExtensionPattern.js";var r=new RegExp("(?:"+e()+")$","i");function t(e){var t=e.search(r);if(t<0)return{};for(var n=e.slice(0,t),a=e.match(r),i=1;i<a.length;){if(a[i])return{number:n,ext:a[i]};i++}}export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"./stripIddPrefix.js";import n from"./extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js";import t from"../metadata.js";import{MAX_LENGTH_COUNTRY_CODE as e}from"../constants.js";function i(i,o,a,u){if(!i)return{};if("+"!==i[0]){var l=r(i,o,a,u);if(!l||l===i){if(o||a){var m=n(i,o,a,u),f=m.countryCallingCode,s=m.number;if(f)return{countryCallingCode:f,number:s}}return{number:i}}i="+"+l}if("0"===i[1])return{};u=new t(u);for(var C=2;C-1<=e&&C<=i.length;){var c=i.slice(1,C);if(u.hasCallingCode(c))return u.selectNumberingPlan(c),{countryCallingCode:c,number:i.slice(C)};C++}return{}}export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r,{getCountryCallingCode as e}from"../metadata.js";import t from"./matchesEntirely.js";import n from"./extractNationalNumber.js";import a from"./checkNumberLength.js";function m(m,i,o,u){var l=i?e(i,u):o;if(0===m.indexOf(l)){(u=new r(u)).selectNumberingPlan(i,o);var b=m.slice(l.length),f=n(b,u).nationalNumber,N=n(m,u).nationalNumber;if(!t(N,u.nationalNumberPattern())&&t(f,u.nationalNumberPattern())||"TOO_LONG"===a(N,u))return{countryCallingCode:l,number:b}}return{number:m}}export{m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"./extractNationalNumberFromPossiblyIncompleteNumber.js";import e from"./matchesEntirely.js";import t from"./checkNumberLength.js";function n(n,a){var i=r(n,a),o=i.carrierCode,u=i.nationalNumber;if(u!==n){if(!function(r,t,n){if(e(r,n.nationalNumberPattern())&&!e(t,n.nationalNumberPattern()))return!1;return!0}(n,u,a))return{nationalNumber:n};if(a.possibleLengths()&&!function(r,e){switch(t(r,e)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(u,a))return{nationalNumber:n}}return{nationalNumber:u,carrierCode:o}}export{n as default};
|
package/build/ext/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(n,e){if(n&&e.numberingPlan.nationalPrefixForParsing()){var a=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=a.exec(n);if(r){var i,l,f,o=r.length-1,t=o>0&&r[o];if(e.nationalPrefixTransformRule()&&t)i=n.replace(a,e.nationalPrefixTransformRule()),o>1&&(l=r[1]);else{var P=r[0];i=n.slice(P.length),t&&(l=r[1])}if(t){var u=n.indexOf(r[1]);n.slice(0,u)===e.numberingPlan.nationalPrefix()&&(f=e.numberingPlan.nationalPrefix())}else f=r[0];return{nationalNumber:i,nationalPrefix:f,carrierCode:l}}}return{nationalNumber:n}}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import a from"./applyInternationalSeparatorStyle.js";var t=/(\$\d)/;function r(r,e,n){var o=n.useInternationalFormat,i=n.withNationalPrefix;n.carrierCode,n.metadata;var l=r.replace(new RegExp(e.pattern()),o?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(t,e.nationalPrefixFormattingRule()):e.format());return o?a(l):l}export{t as FIRST_GROUP_PATTERN,r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"../metadata.js";import t from"./getNumberType.js";function e(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(e)return(e=e.call(r)).next.bind(e);if(Array.isArray(r)||(e=function(r,t){if(!r)return;if("string"==typeof r)return n(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return n(r,t)}(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function o(n,o,a){var i=a.getCountryCodesForCallingCode(n);if(i)return 1===i.length?i[0]:function(n,o,a){a=new r(a);for(var i,u=e(n);!(i=u()).done;){var l=i.value;if(a.country(l),a.leadingDigits()){if(o&&0===o.search(a.leadingDigits()))return l}else if(t({phone:o,country:l},void 0,a.metadata))return l}}(i,o,a.metadata)}export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../metadata.js";var r=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function t(t,a,f){var u=new e(f);return u.selectNumberingPlan(t,a),u.defaultIDDPrefix()?u.defaultIDDPrefix():r.test(u.IDDPrefix())?u.IDDPrefix():void 0}export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"../metadata.js";import r from"./matchesEntirely.js";function e(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,r){if(!t)return;if("string"==typeof t)return n(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return n(t,r)}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var o=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function a(n,a,u){if(a=a||{},n.country){(u=new t(u)).selectNumberingPlan(n.country,n.countryCallingCode);var l=a.v2?n.nationalNumber:n.phone;if(r(l,u.nationalNumberPattern())){if(i(l,"FIXED_LINE",u))return u.type("MOBILE")&&""===u.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":u.type("MOBILE")?i(l,"MOBILE",u)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var E,f=e(o);!(E=f()).done;){var I=E.value;if(i(l,I,u))return I}}}}function i(t,e,n){return!(!(e=n.type(e))||!e.pattern())&&(!(e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0)&&r(t,e.pattern()))}export{a as default,i as isNumberTypeEqualTo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{MIN_LENGTH_FOR_NSN as t,PLUS_CHARS as e,VALID_PUNCTUATION as n,VALID_DIGITS as r}from"../constants.js";import o from"./extension/createExtensionPattern.js";var s="["+r+"]{"+t+"}",i="["+e+"]{0,1}(?:["+n+"]*["+r+"]){3,}["+n+r+"]*",a=new RegExp("^["+e+"]{0,1}(?:["+n+"]*["+r+"]){1,2}$","i"),f=i+"(?:"+o()+")?",p=new RegExp("^"+s+"$|^"+f+"$","i");function u(e){return e.length>=t&&p.test(e)}function x(t){return a.test(t)}export{i as VALID_PHONE_NUMBER,f as VALID_PHONE_NUMBER_WITH_EXTENSION,u as default,x as isViablePhoneNumberStart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function r(r,e){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,e){if(!r)return;if("string"==typeof r)return t(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(r,e)}(r))||e&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function t(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function e(t,e){for(var n,o=t.slice(),a=r(e);!(n=a()).done;){var i=n.value;t.indexOf(i)<0&&o.push(i)}return o.sort((function(r,t){return r-t}))}export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function r(r,e){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,e){if(!r)return;if("string"==typeof r)return t(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(r,e)}(r))||e&&r&&"number"==typeof r.length){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function t(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var e={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function n(r){return e[r]}function o(t){for(var e,o="",a=r(t.split(""));!(e=a()).done;){var i=n(e.value);i&&(o+=i)}return o}export{e as DIGITS,o as default,n as parseDigit};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../metadata.js";import{VALID_DIGITS as t}from"../constants.js";var a=new RegExp("(["+t+"])");function r(t,r,n,i){if(r){var f=new e(i);f.selectNumberingPlan(r,n);var l=new RegExp(f.IDDPrefix());if(0===t.search(l)){var m=(t=t.slice(t.match(l)[0].length)).match(a);if(!(m&&null!=m[1]&&m[1].length>0&&"0"===m[1]))return t}}}export{r as default};
|