@ikas/storefront 4.4.0-beta.3 → 4.4.0-beta.5

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.
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import r from"lodash/sortBy";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"@ikas/storefront-models";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/country-settings-model.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/address/ikas-localized-customer-address.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{IkasOrderAddressCity as o}from"../../../../models/data/order/address/city/index.js";import{IkasOrderAddressCountry as n}from"../../../../models/data/order/address/country/index.js";import{IkasOrderAddressDistrict as d}from"../../../../models/data/order/address/district/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/transaction/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/stock-location/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/ikas-address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../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{stringSorter as a,capitalize as l}from"../../../../utils/helper.js";import{FREE_TEXT_CITY_COUNTRY_LIST as u,DISTRICT_HIDDEN_COUNTRY_LIST as m}from"../../../../utils/constants.js";import c from"../../../../store/location/index.js";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";var h=function(){function h(i){var r=this;this.isCorporate=!1,this.isErrorsVisible=!1,this.allowedCountryIds=null,this.allowCorporateInfo=!1,this.allowTitleChange=!1,this.firstNameChangeCallback=null,this.lastNameChangeCallback=null,this.countries=[],this.states=[],this.cities=[],this.districts=[],this.myCountryCode=null,this.fillDropdownOptions=function(){return t(r,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.listCountries()];case 1:return t.sent(),[4,this.listStates()];case 2:return t.sent(),[4,this.listCities()];case 3:return t.sent(),[4,this.listDistricts()];case 4:return t.sent(),[2]}}))}))},this.listCountries=function(){return t(r,void 0,void 0,(function(){var t,i,s,r,o,n,d,a,l=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),this.myCountryCode?[3,2]:[4,c.getMyCountry()];case 1:t=e.sent(),this.myCountryCode=t.data,e.label=2;case 2:return[4,c.listCountry({id:(null===(d=this.allowedCountryIds)||void 0===d?void 0:d.length)?{in:this.allowedCountryIds}:void 0,locale:p.getCurrentLocale()})];case 3:return i=e.sent(),s=i.data||[],r=p.getCurrentRouting(),(null===(a=null==r?void 0:r.countryCodes)||void 0===a?void 0:a.length)?s=s.filter((function(t){var e;return t.iso2&&(null===(e=r.countryCodes)||void 0===e?void 0:e.includes(t.iso2))})):(o=p.getRoutings().filter((function(t){return t.id!==p.getStorefrontRoutingId()})),s=s.filter((function(t){return t.iso2&&!o.some((function(e){var i;return null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2)}))}))),this.countries=s,1!==this.countries.length||this.country?this.countries.length&&this.myCountryCode&&!this.country&&((n=this.countries.find((function(t){return t.iso2===l.myCountryCode})))?this.onCountryChange(n.id):this.onCountryChange(this.countries[0].id)):this.onCountryChange(this.countries[0].id),[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},this.listStates=function(){return t(r,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.country)||void 0===i?void 0:i.id))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.listState({countryId:{eq:this.country.id}})];case 2:return t=e.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.listCities=function(){return t(r,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.state)||void 0===i?void 0:i.id)||!(null===(s=this.country)||void 0===s?void 0:s.id))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.listCity({stateId:{eq:this.state.id},countryId:{eq:this.country.id}})];case 2:return t=e.sent(),this.cities=t.data||[],[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.listDistricts=function(){return t(r,void 0,void 0,(function(){var t,i,s,r;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.city)||void 0===i?void 0:i.id)||this.isDistrictHidden)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.listDistrict({cityId:{eq:this.city.id},stateId:(null===(s=this.state)||void 0===s?void 0:s.id)?{eq:null===(r=this.state)||void 0===r?void 0:r.id}:void 0})];case 2:return t=e.sent(),this.districts=t.data||[],this.districts.length?this.address.isDistrictRequired=!0:this.address.isDistrictRequired=!1,[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.modelToOption=function(t){return{label:t.name,value:t.id+""}},this.onFirstNameChange=function(t){r.firstNameChangeCallback&&r.firstNameChangeCallback(t),r.address.firstName=t},this.onLastNameChange=function(t){r.lastNameChangeCallback&&r.lastNameChangeCallback(t),r.address.lastName=t},this.onPhoneChange=function(t){r.address.phone=t},this.onIdentityNumberChange=function(t){t?t.length<=11&&(r.address.identityNumber=t):r.address.identityNumber=""},this.onAddressTitleChange=function(t){r.address.title=t},this.onAddressLine1Change=function(t){r.address.addressLine1=t},this.onAddressLine2Change=function(t){r.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){r.address.postalCode=t},this.onCountryChange=function(t){var e;if((null===(e=r.country)||void 0===e?void 0:e.id)!==t){var i=r.countries.find((function(e){return e.id===t}));r.address.country=new n({id:(null==i?void 0:i.id)||null,name:(null==i?void 0:i.name)||"",code:(null==i?void 0:i.iso3)||null,iso2:(null==i?void 0:i.iso2)||null,iso3:(null==i?void 0:i.iso3)||null}),r.address.state=null,r.address.city=null,r.address.district=null,r.address.phone=null,r.states=[],r.cities=[],r.districts=[],r.listStates()}},this.onStateChange=function(t){var e;if((null===(e=r.state)||void 0===e?void 0:e.id)!==t){var i=r.states.find((function(e){return e.id===t}));r.address.state={id:i.id,name:null==i?void 0:i.name,code:null==i?void 0:i.stateCode},r.address.isFreeTextCity||(r.address.city=null,r.cities=[],r.listCities()),r.address.isFreeTextDistrict||(r.address.district=null,r.districts=[])}},this.onCityChange=function(t){var e;if((null===(e=r.city)||void 0===e?void 0:e.id)!==t){var i=r.cities.find((function(e){return e.id===t}));r.address.city=new o({id:i.id,name:i.name}),r.address.isFreeTextDistrict||(r.address.district=null,r.districts=[],r.listDistricts())}},this.onCityInputChange=function(t){r.districts=[],r.address.city=new o({id:void 0,name:t})},this.onDistrictChange=function(t){var e;if((null===(e=r.district)||void 0===e?void 0:e.id)!==t){var i=r.districts.find((function(e){return e.id===t}));r.address.district=new d({id:i.id,name:i.name})}},this.onDistrictInputChange=function(t){r.address.district=new d({id:void 0,name:t})},this.onCorporateChange=function(t){r.isCorporate=t,t||(r.address.company=null,r.address.taxNumber=null,r.address.taxOffice=null)},this.onCompanyChange=function(t){r.address.company=t},this.onTaxNumberChange=function(t){r.address.taxNumber=t},this.onTaxOfficeChange=function(t){r.address.taxOffice=t},this.address=i.address,this.isCorporate=i.isCorporate||!1,this.isErrorsVisible=i.isErrorsVisible||!1,this.isCustomerAddress=i.isCustomerAddress||!1,this.allowedCountryIds=i.allowedCountryIds,this.allowCorporateInfo=i.allowCorporateInfo||!1,this.allowTitleChange=i.allowTitleChange||!1,this.firstNameChangeCallback=i.firstNameChangeCallback||null,this.lastNameChangeCallback=i.lastNameChangeCallback||null,s(this,{firstNameChangeCallback:!1,lastNameChangeCallback:!1}),this.fillDropdownOptions()}return Object.defineProperty(h.prototype,"firstName",{get:function(){return this.address.firstName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"lastName",{get:function(){return this.address.lastName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"phone",{get:function(){return this.address.phone},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"identityNumber",{get:function(){return this.address.identityNumber},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"country",{get:function(){return this.address.country},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"state",{get:function(){return this.address.state},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"city",{get:function(){return this.address.city},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"district",{get:function(){return this.address.district},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"countryOptions",{get:function(){var t=this.countries.map(this.modelToOption);return t.sort((function(t,e){return a(t.label,e.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"stateOptions",{get:function(){var t=this.states.map(this.modelToOption);return t.sort((function(t,e){return a(t.label,e.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"cityOptions",{get:function(){return r(this.cities,"order").map(this.modelToOption)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"districtOptions",{get:function(){var t=this.districts.map((function(t){return i(i({},t),{name:l(t.name)})})).map(this.modelToOption);return t.sort((function(t,e){return a(t.label,e.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isFreeTextCity",{get:function(){var t=this;return u.some((function(e){var i,s;return(null===(s=null===(i=t.address.country)||void 0===i?void 0:i.iso2)||void 0===s?void 0:s.toLowerCase())===e.toLowerCase()}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isDistrictHidden",{get:function(){var t=this;return m.some((function(e){var i,s;return(null===(s=null===(i=t.address.country)||void 0===i?void 0:i.iso2)||void 0===s?void 0:s.toLowerCase())===e.toLowerCase()}))},enumerable:!1,configurable:!0}),h}();export{h as default};
1
+ import{__awaiter as t,__generator as e,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import r from"lodash/sortBy";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"@ikas/storefront-models";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/country-settings-model.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/address/ikas-localized-customer-address.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{IkasOrderAddressCity as o}from"../../../../models/data/order/address/city/index.js";import{IkasOrderAddressCountry as n}from"../../../../models/data/order/address/country/index.js";import{IkasOrderAddressDistrict as d}from"../../../../models/data/order/address/district/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/transaction/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/stock-location/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/ikas-address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../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{stringSorter as a,capitalize as l}from"../../../../utils/helper.js";import{FREE_TEXT_CITY_COUNTRY_LIST as u,DISTRICT_HIDDEN_COUNTRY_LIST as m}from"../../../../utils/constants.js";import c from"../../../../store/location/index.js";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";var h=function(){function h(i){var r=this;this.isCorporate=!1,this.isErrorsVisible=!1,this.allowedCountryIds=null,this.allowCorporateInfo=!1,this.allowTitleChange=!1,this.firstNameChangeCallback=null,this.lastNameChangeCallback=null,this.countries=[],this.states=[],this.cities=[],this.districts=[],this.myCountryCode=null,this.fillDropdownOptions=function(){return t(r,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.listCountries()];case 1:return t.sent(),[4,this.listStates()];case 2:return t.sent(),[4,this.listCities()];case 3:return t.sent(),[4,this.listDistricts()];case 4:return t.sent(),[2]}}))}))},this.listCountries=function(){return t(r,void 0,void 0,(function(){var t,i,s,r,o,n,d,a,l=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),this.myCountryCode?[3,2]:[4,c.getMyCountry()];case 1:t=e.sent(),this.myCountryCode=t.data,e.label=2;case 2:return[4,c.listCountry({id:(null===(d=this.allowedCountryIds)||void 0===d?void 0:d.length)?{in:this.allowedCountryIds}:void 0,locale:p.getCurrentLocale()})];case 3:return i=e.sent(),s=i.data||[],r=p.getCurrentRouting(),(null===(a=null==r?void 0:r.countryCodes)||void 0===a?void 0:a.length)?s=s.filter((function(t){var e;return t.iso2&&(null===(e=r.countryCodes)||void 0===e?void 0:e.includes(t.iso2))})):(o=p.getRoutings().filter((function(t){return t.id!==p.getStorefrontRoutingId()})),s=s.filter((function(t){return t.iso2&&!o.some((function(e){var i;return null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2)}))}))),this.countries=s,1!==this.countries.length||this.country?this.countries.length&&this.myCountryCode&&!this.country&&((n=this.countries.find((function(t){return t.iso2===l.myCountryCode})))?this.onCountryChange(n.id):this.onCountryChange(this.countries[0].id)):this.onCountryChange(this.countries[0].id),[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},this.listStates=function(){return t(r,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.country)||void 0===i?void 0:i.id))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.listState({countryId:{eq:this.country.id},locale:p.getCurrentLocale()})];case 2:return t=e.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.listCities=function(){return t(r,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.state)||void 0===i?void 0:i.id)||!(null===(s=this.country)||void 0===s?void 0:s.id))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.listCity({stateId:{eq:this.state.id},countryId:{eq:this.country.id}})];case 2:return t=e.sent(),this.cities=t.data||[],[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.listDistricts=function(){return t(r,void 0,void 0,(function(){var t,i,s,r;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.city)||void 0===i?void 0:i.id)||this.isDistrictHidden)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.listDistrict({cityId:{eq:this.city.id},stateId:(null===(s=this.state)||void 0===s?void 0:s.id)?{eq:null===(r=this.state)||void 0===r?void 0:r.id}:void 0})];case 2:return t=e.sent(),this.districts=t.data||[],this.districts.length?this.address.isDistrictRequired=!0:this.address.isDistrictRequired=!1,[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.modelToOption=function(t){return{label:t.name,value:t.id+""}},this.onFirstNameChange=function(t){r.firstNameChangeCallback&&r.firstNameChangeCallback(t),r.address.firstName=t},this.onLastNameChange=function(t){r.lastNameChangeCallback&&r.lastNameChangeCallback(t),r.address.lastName=t},this.onPhoneChange=function(t){r.address.phone=t},this.onIdentityNumberChange=function(t){t?t.length<=11&&(r.address.identityNumber=t):r.address.identityNumber=""},this.onAddressTitleChange=function(t){r.address.title=t},this.onAddressLine1Change=function(t){r.address.addressLine1=t},this.onAddressLine2Change=function(t){r.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){r.address.postalCode=t},this.onCountryChange=function(t){var e;if((null===(e=r.country)||void 0===e?void 0:e.id)!==t){var i=r.countries.find((function(e){return e.id===t}));r.address.country=new n({id:(null==i?void 0:i.id)||null,name:(null==i?void 0:i.name)||"",code:(null==i?void 0:i.iso3)||null,iso2:(null==i?void 0:i.iso2)||null,iso3:(null==i?void 0:i.iso3)||null}),r.address.state=null,r.address.city=null,r.address.district=null,r.address.phone=null,r.states=[],r.cities=[],r.districts=[],r.listStates()}},this.onStateChange=function(t){var e;if((null===(e=r.state)||void 0===e?void 0:e.id)!==t){var i=r.states.find((function(e){return e.id===t}));r.address.state={id:i.id,name:null==i?void 0:i.name,code:null==i?void 0:i.stateCode},r.address.isFreeTextCity||(r.address.city=null,r.cities=[],r.listCities()),r.address.isFreeTextDistrict||(r.address.district=null,r.districts=[])}},this.onCityChange=function(t){var e;if((null===(e=r.city)||void 0===e?void 0:e.id)!==t){var i=r.cities.find((function(e){return e.id===t}));r.address.city=new o({id:i.id,name:i.name}),r.address.isFreeTextDistrict||(r.address.district=null,r.districts=[],r.listDistricts())}},this.onCityInputChange=function(t){r.districts=[],r.address.city=new o({id:void 0,name:t})},this.onDistrictChange=function(t){var e;if((null===(e=r.district)||void 0===e?void 0:e.id)!==t){var i=r.districts.find((function(e){return e.id===t}));r.address.district=new d({id:i.id,name:i.name})}},this.onDistrictInputChange=function(t){r.address.district=new d({id:void 0,name:t})},this.onCorporateChange=function(t){r.isCorporate=t,t||(r.address.company=null,r.address.taxNumber=null,r.address.taxOffice=null)},this.onCompanyChange=function(t){r.address.company=t},this.onTaxNumberChange=function(t){r.address.taxNumber=t},this.onTaxOfficeChange=function(t){r.address.taxOffice=t},this.address=i.address,this.isCorporate=i.isCorporate||!1,this.isErrorsVisible=i.isErrorsVisible||!1,this.isCustomerAddress=i.isCustomerAddress||!1,this.allowedCountryIds=i.allowedCountryIds,this.allowCorporateInfo=i.allowCorporateInfo||!1,this.allowTitleChange=i.allowTitleChange||!1,this.firstNameChangeCallback=i.firstNameChangeCallback||null,this.lastNameChangeCallback=i.lastNameChangeCallback||null,s(this,{firstNameChangeCallback:!1,lastNameChangeCallback:!1}),this.fillDropdownOptions()}return Object.defineProperty(h.prototype,"firstName",{get:function(){return this.address.firstName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"lastName",{get:function(){return this.address.lastName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"phone",{get:function(){return this.address.phone},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"identityNumber",{get:function(){return this.address.identityNumber},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"country",{get:function(){return this.address.country},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"state",{get:function(){return this.address.state},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"city",{get:function(){return this.address.city},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"district",{get:function(){return this.address.district},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"countryOptions",{get:function(){var t=this.countries.map(this.modelToOption);return t.sort((function(t,e){return a(t.label,e.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"stateOptions",{get:function(){var t=this.states.map(this.modelToOption);return t.sort((function(t,e){return a(t.label,e.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"cityOptions",{get:function(){return r(this.cities,"order").map(this.modelToOption)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"districtOptions",{get:function(){var t=this.districts.map((function(t){return i(i({},t),{name:l(t.name)})})).map(this.modelToOption);return t.sort((function(t,e){return a(t.label,e.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isFreeTextCity",{get:function(){var t=this;return u.some((function(e){var i,s;return(null===(s=null===(i=t.address.country)||void 0===i?void 0:i.iso2)||void 0===s?void 0:s.toLowerCase())===e.toLowerCase()}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isDistrictHidden",{get:function(){var t=this;return m.some((function(e){var i,s;return(null===(s=null===(i=t.address.country)||void 0===i?void 0:i.iso2)||void 0===s?void 0:s.toLowerCase())===e.toLowerCase()}))},enumerable:!1,configurable:!0}),h}();export{h as default};
@@ -10,6 +10,7 @@ export declare class IkasCustomerAttribute extends IkasBaseModel implements ICus
10
10
  options: IkasCustomerAttributeOption[] | null;
11
11
  salesChannels: IkasCustomerAttributeSalesChannel[] | null;
12
12
  translations?: IkasCustomerAttributeTranslation[] | null;
13
+ order: number | null;
13
14
  constructor(data: ICustomerAttribute);
14
15
  get accountPagePermission(): import("@ikas/storefront-models").IkasCustomerAttributePermission | undefined;
15
16
  get registerPageRequirement(): import("@ikas/storefront-models").IkasCustomerAttributeRegisterPageRequirement | undefined;
@@ -1 +1 @@
1
- import{__extends as e}from'./../../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as n}from"../../base/index.js";import{IkasCustomerAttributeOption as t}from"./option/index.js";import{IkasCustomerAttributeSalesChannel as o}from"./sales-channel/index.js";import{IkasCustomerAttributeTranslation as i}from"./translation/index.js";export{IkasCustomerAttributeType}from"@ikas/storefront-models";import{makeObservable as r,observable as s,computed as l}from"mobx";import{IkasCustomerAttributeFunctions as a}from"@ikas/storefront-model-functions";var u=function(n){function u(e){var a,u,m,p=this;return(p=n.call(this,e)||this).description=null,p.options=null,p.salesChannels=null,p.translations=null,p.description=e.description,p.name=e.name,p.type=e.type,p.options=(null===(a=e.options)||void 0===a?void 0:a.map((function(e){return new t(e)})))||null,p.salesChannels=(null===(u=e.salesChannels)||void 0===u?void 0:u.map((function(e){return new o(e)})))||null,p.translations=(null===(m=e.translations)||void 0===m?void 0:m.map((function(e){return new i(e)})))||null,r(p,{description:s,name:s,type:s,options:s,salesChannels:s,translations:s,accountPagePermission:l,registerPageRequirement:l}),p}return e(u,n),Object.defineProperty(u.prototype,"accountPagePermission",{get:function(){return a.getAccountPagePermission(this)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"registerPageRequirement",{get:function(){return a.getRegisterPageRequirement(this)},enumerable:!1,configurable:!0}),u}(n);export{u as IkasCustomerAttribute};
1
+ import{__extends as e}from'./../../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as n}from"../../base/index.js";import{IkasCustomerAttributeOption as t}from"./option/index.js";import{IkasCustomerAttributeSalesChannel as o}from"./sales-channel/index.js";import{IkasCustomerAttributeTranslation as r}from"./translation/index.js";export{IkasCustomerAttributeType}from"@ikas/storefront-models";import{makeObservable as i,observable as s,computed as l}from"mobx";import{IkasCustomerAttributeFunctions as a}from"@ikas/storefront-model-functions";var u=function(n){function u(e){var a,u,m,p,c=this;return(c=n.call(this,e)||this).description=null,c.options=null,c.salesChannels=null,c.translations=null,c.description=e.description,c.name=e.name,c.type=e.type,c.options=(null===(a=e.options)||void 0===a?void 0:a.map((function(e){return new t(e)})))||null,c.salesChannels=(null===(u=e.salesChannels)||void 0===u?void 0:u.map((function(e){return new o(e)})))||null,c.translations=(null===(m=e.translations)||void 0===m?void 0:m.map((function(e){return new r(e)})))||null,c.order=null!==(p=e.order)&&void 0!==p?p:null,i(c,{description:s,name:s,type:s,options:s,salesChannels:s,translations:s,accountPagePermission:l,registerPageRequirement:l}),c}return e(u,n),Object.defineProperty(u.prototype,"accountPagePermission",{get:function(){return a.getAccountPagePermission(this)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"registerPageRequirement",{get:function(){return a.getRegisterPageRequirement(this)},enumerable:!1,configurable:!0}),u}(n);export{u as IkasCustomerAttribute};
@@ -1,8 +1,11 @@
1
1
  import { IkasBaseModel } from "../base";
2
2
  import { IkasState as IState } from "@ikas/storefront-models";
3
+ import { IkasLocationTranslations } from "./location-translations";
3
4
  export declare class IkasState extends IkasBaseModel implements IState {
4
5
  countryId: string;
5
6
  name: string;
6
7
  stateCode: string | null;
8
+ locationTranslations?: IkasLocationTranslations | null;
9
+ native: string | null;
7
10
  constructor(data: IState);
8
11
  }
@@ -1 +1 @@
1
- import{__extends as t}from'./../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as o}from"../base/index.js";import{makeObservable as e,observable as r}from"mobx";var n=function(o){function n(t){var n=o.call(this,t)||this;return n.countryId=t.countryId,n.name=t.name,n.stateCode=t.stateCode,e(n,{countryId:r,name:r,stateCode:r}),n}return t(n,o),n}(o);export{n as IkasState};
1
+ import{__extends as n}from'./../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as t}from"../base/index.js";import{makeObservable as o,observable as a}from"mobx";var i=function(t){function i(n){var i=t.call(this,n)||this;return i.locationTranslations=null,i.native=null,i.countryId=n.countryId,i.name=n.name,i.stateCode=n.stateCode,i.locationTranslations=n.locationTranslations||null,i.native=n.native||null,o(i,{countryId:a,name:a,stateCode:a,native:a,locationTranslations:a}),i}return n(i,t),i}(t);export{i as IkasState};
@@ -0,0 +1,7 @@
1
+ import { IkasLocationTranslations as ILocationTranslations } from "@ikas/storefront-models";
2
+ export declare class IkasLocationTranslations implements ILocationTranslations {
3
+ de: string | null;
4
+ en: string;
5
+ tr: string;
6
+ constructor(data: ILocationTranslations);
7
+ }
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{login as i,socialLogin as o,register as a,refreshToken as s,forgotPassword as d,recoverPassword as u,checkEmail as c,getCustomer as l,saveCustomer as m,getOrders as f,getOrderByEmail as p,listOrderTransactions as v,createOrderRefundRequest as h,subscribeToMarketingNotifications as w,getLastViewedProducts as j,saveLastViewedProducts as x,listOrderRefundSettings as g,sendContactFormToMerchant as b,listFavoriteProducts as L,saveFavoriteProduct as E,isFavoriteProduct as k,createCustomerReview as Q,listCustomerReviews as y,listCustomerReviewSummary as _,listCustomerAttribute as P}from"@ikas/storefront-api";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"@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/country-settings-model.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/address/ikas-localized-customer-address.js";import{IkasCustomerAttribute as C}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as R}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as T}from"../../models/data/customer/review/index.js";import{IkasCustomer as O}from"../../models/data/customer/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as F}from"../../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{IkasLastViewedProduct as I}from"../../models/data/last-viewed-product/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{IkasOrderRefundSettings as S}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as A}from"../../models/data/order/transaction/index.js";import{IkasOrder as M}from"../../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/stock-location/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";var V=function(){function V(){}return V.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new O(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},V.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new O(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},V.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new O(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},V.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,s(r)];case 1:return[2,t.sent()]}}))}))},V.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},V.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},V.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},V.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,l()];case 1:return t=e.sent(),[2,new n(t.data?new O(t.data):null,t.graphQLErrors)]}}))}))},V.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,m(r)];case 1:return t=e.sent(),[2,new n(t.data?new O(t.data):null,t.graphQLErrors)]}}))}))},V.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new M(t)})),t.graphQLErrors)]}}))}))},V.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(t.data?new M(t.data):null,t.graphQLErrors)]}}))}))},V.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new A(t)})),t.graphQLErrors)]}}))}))},V.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new M(t.data):null,t.graphQLErrors)]}}))}))},V.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,w(r)];case 1:return[2,t.sent()]}}))}))},V.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new I(t)})),t.graphQLErrors)]}}))}))},V.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,x(r)];case 1:return[2,t.sent()]}}))}))},V.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,g(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new S(t)})),t.graphQLErrors)]}}))}))},V.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,b(r)];case 1:return[2,t.sent()]}}))}))},V.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,L()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new F(t)})),t.graphQLErrors)]}}))}))},V.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,E(r)];case 1:return[2,t.sent()]}}))}))},V.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,k({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},V.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,Q(r)];case 1:return t=e.sent(),[2,new n(t.data?new T(t.data):null,t.graphQLErrors)]}}))}))},V.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,y(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new T(t)}))}):null,t.graphQLErrors)]}}))}))},V.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,_(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new R(t)}))}),t.graphQLErrors)]}}))}))},V.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,P()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new C(t)}),t.graphQLErrors))]}}))}))},V}();export{V as default};
1
+ import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{login as i,socialLogin as o,register as a,refreshToken as s,forgotPassword as d,recoverPassword as u,checkEmail as c,getCustomer as l,saveCustomer as m,getOrders as f,getOrderByEmail as p,listOrderTransactions as v,createOrderRefundRequest as h,subscribeToMarketingNotifications as w,getLastViewedProducts as j,saveLastViewedProducts as x,listOrderRefundSettings as g,sendContactFormToMerchant as b,listFavoriteProducts as L,saveFavoriteProduct as E,isFavoriteProduct as k,createCustomerReview as Q,listCustomerReviews as y,listCustomerReviewSummary as _,listCustomerAttribute as P}from"@ikas/storefront-api";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"@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/country-settings-model.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/address/ikas-localized-customer-address.js";import{IkasCustomerAttribute as C}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as R}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as T}from"../../models/data/customer/review/index.js";import{IkasCustomer as O}from"../../models/data/customer/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as F}from"../../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{IkasLastViewedProduct as I}from"../../models/data/last-viewed-product/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{IkasOrderRefundSettings as S}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as A}from"../../models/data/order/transaction/index.js";import{IkasOrder as M}from"../../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/stock-location/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";var V=function(){function V(){}return V.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new O(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},V.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new O(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},V.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new O(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},V.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,s(r)];case 1:return[2,t.sent()]}}))}))},V.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},V.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},V.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},V.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,l()];case 1:return t=e.sent(),[2,new n(t.data?new O(t.data):null,t.graphQLErrors)]}}))}))},V.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,m(r)];case 1:return t=e.sent(),[2,new n(t.data?new O(t.data):null,t.graphQLErrors)]}}))}))},V.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new M(t)})),t.graphQLErrors)]}}))}))},V.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(t.data?new M(t.data):null,t.graphQLErrors)]}}))}))},V.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new A(t)})),t.graphQLErrors)]}}))}))},V.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new M(t.data):null,t.graphQLErrors)]}}))}))},V.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,w(r)];case 1:return[2,t.sent()]}}))}))},V.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new I(t)})),t.graphQLErrors)]}}))}))},V.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,x(r)];case 1:return[2,t.sent()]}}))}))},V.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,g(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new S(t)})),t.graphQLErrors)]}}))}))},V.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,b(r)];case 1:return[2,t.sent()]}}))}))},V.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,L()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new F(t)})),t.graphQLErrors)]}}))}))},V.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,E(r)];case 1:return[2,t.sent()]}}))}))},V.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,k({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},V.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,Q(r)];case 1:return t=e.sent(),[2,new n(t.data?new T(t.data):null,t.graphQLErrors)]}}))}))},V.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,y(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new T(t)}))}):null,t.graphQLErrors)]}}))}))},V.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,_(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new R(t)}))}),t.graphQLErrors)]}}))}))},V.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,P()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.sort((function(t,e){return t.order&&e.order?t.order-e.order:-1})).map((function(t){return new C(t)}),t.graphQLErrors))]}}))}))},V}();export{V as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.4.0-beta.3",
3
+ "version": "4.4.0-beta.5",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -17,11 +17,11 @@
17
17
  "build": "rm -rf build && rollup -c"
18
18
  },
19
19
  "devDependencies": {
20
- "@ikas/storefront-api": "^4.4.0-beta.3",
21
- "@ikas/storefront-config": "^4.4.0-beta.3",
22
- "@ikas/storefront-model-functions": "^4.4.0-beta.3",
23
- "@ikas/storefront-models": "^4.4.0-beta.3",
24
- "@ikas/storefront-providers": "^4.4.0-beta.3",
20
+ "@ikas/storefront-api": "^4.4.0-beta.5",
21
+ "@ikas/storefront-config": "^4.4.0-beta.5",
22
+ "@ikas/storefront-model-functions": "^4.4.0-beta.5",
23
+ "@ikas/storefront-models": "^4.4.0-beta.5",
24
+ "@ikas/storefront-providers": "^4.4.0-beta.5",
25
25
  "@adyen/adyen-web": "^5.28.2",
26
26
  "@rollup/plugin-commonjs": "^22.0.0",
27
27
  "@rollup/plugin-json": "^4.1.0",
@@ -52,11 +52,11 @@
52
52
  "libphonenumber-js": "^1.10.6"
53
53
  },
54
54
  "peerDependencies": {
55
- "@ikas/storefront-api": "^4.4.0-beta.3",
56
- "@ikas/storefront-config": "^4.4.0-beta.3",
57
- "@ikas/storefront-model-functions": "^4.4.0-beta.3",
58
- "@ikas/storefront-models": "^4.4.0-beta.3",
59
- "@ikas/storefront-providers": "^4.4.0-beta.3",
55
+ "@ikas/storefront-api": "^4.4.0-beta.5",
56
+ "@ikas/storefront-config": "^4.4.0-beta.5",
57
+ "@ikas/storefront-model-functions": "^4.4.0-beta.5",
58
+ "@ikas/storefront-models": "^4.4.0-beta.5",
59
+ "@ikas/storefront-providers": "^4.4.0-beta.5",
60
60
  "mobx": "^6.1.3",
61
61
  "mobx-react-lite": "^3.1.5",
62
62
  "next": "12.2.0",