@ikas/storefront 3.0.0-alpha.19 → 3.0.0-alpha.2
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/__api/models/AddItemToCartInput.d.ts +3 -0
- package/build/__api/models/CartV2.d.ts +1 -2
- package/build/__api/models/CreateCustomerEmailSubscriptionInput.d.ts +0 -2
- package/build/__api/models/CustomerAddressInput.d.ts +29 -0
- package/build/__api/models/CustomerInput.d.ts +23 -0
- package/build/__api/models/OrderAdjustmentAppliedOrderLine.d.ts +0 -1
- package/build/__api/models/OrderAdjustmentAppliedOrderLine.js +1 -1
- package/build/__api/models/OrderCustomer.d.ts +6 -0
- package/build/__api/models/OrderShippingLine.d.ts +0 -2
- package/build/__api/models/OrderShippingLine.js +1 -1
- package/build/__api/models/PaymentGateway.d.ts +1 -1
- package/build/__api/models/PaymentGateway.js +1 -1
- package/build/__api/models/SaveMyCustomerInput.d.ts +0 -2
- package/build/__api/models/SaveMyCustomerInput.js +1 -1
- package/build/__api/models/SearchProductAttributeValue.d.ts +0 -1
- package/build/__api/models/_base.js +1 -1
- package/build/__api/mutations/addCouponCodeToCheckout.d.ts +0 -2
- package/build/__api/mutations/addItemToCart.d.ts +6 -4
- package/build/__api/mutations/addItemToCart.js +1 -1
- package/build/__api/mutations/createCustomerEmailSubscription.d.ts +1 -1
- package/build/__api/mutations/createCustomerReview.d.ts +1 -1
- package/build/__api/mutations/createOrderRefundRequest.d.ts +6 -3
- package/build/__api/mutations/createOrderRefundRequest.js +1 -1
- package/build/__api/mutations/createSaleTransactionWithCart.d.ts +1 -1
- package/build/__api/mutations/customerLogin.d.ts +1 -1
- package/build/__api/mutations/customerRefreshToken.d.ts +1 -1
- package/build/__api/mutations/getOrderLineFile.d.ts +1 -1
- package/build/__api/mutations/registerCustomer.d.ts +1 -1
- package/build/__api/mutations/retrieveInstallmentInfo.d.ts +1 -1
- package/build/__api/mutations/saveCart.d.ts +6 -4
- package/build/__api/mutations/saveCart.js +1 -1
- package/build/__api/mutations/saveCartCouponCode.d.ts +6 -4
- package/build/__api/mutations/saveCartCouponCode.js +1 -1
- package/build/__api/mutations/saveCheckout.d.ts +0 -2
- package/build/__api/mutations/saveLastViewedProducts.d.ts +1 -1
- package/build/__api/mutations/saveMyCustomer.d.ts +1 -1
- package/build/__api/mutations/saveProductBackInStockRemind.d.ts +1 -1
- package/build/__api/mutations/saveRaffleParticipant.d.ts +1 -1
- package/build/__api/mutations/updateCustomer.d.ts +69 -0
- package/build/__api/queries/checkCustomerEmail.d.ts +1 -1
- package/build/__api/queries/checkStocks.d.ts +1 -1
- package/build/__api/queries/customerSocialLogin.d.ts +1 -1
- package/build/__api/queries/getAvailableShippingCountries.d.ts +1 -1
- package/build/__api/queries/getCartById.d.ts +8 -5
- package/build/__api/queries/getCartById.js +1 -1
- package/build/__api/queries/getCheckoutByCartId.d.ts +0 -2
- package/build/__api/queries/getCheckoutById.d.ts +0 -2
- package/build/__api/queries/getCustomerOrders.d.ts +6 -3
- package/build/__api/queries/getCustomerOrders.js +1 -1
- package/build/__api/queries/getLastViewedProducts.d.ts +1 -1
- package/build/__api/queries/getMyCountry.d.ts +1 -1
- package/build/__api/queries/getMyCustomer.d.ts +1 -1
- package/build/__api/queries/getOrder.d.ts +5 -2
- package/build/__api/queries/getOrderByEmail.d.ts +6 -3
- package/build/__api/queries/getOrderByEmail.js +1 -1
- package/build/__api/queries/getProductCampaigns.d.ts +1 -1
- package/build/__api/queries/getProductFilterData.d.ts +1 -1
- package/build/__api/queries/getRafflesByCustomerId.d.ts +1 -1
- package/build/__api/queries/getStorefront.d.ts +1 -1
- package/build/__api/queries/listBlog.d.ts +1 -1
- package/build/__api/queries/listBlogCategory.d.ts +1 -1
- package/build/__api/queries/listBlogMetadata.d.ts +1 -1
- package/build/__api/queries/listCategory.d.ts +1 -1
- package/build/__api/queries/listCheckoutSettings.d.ts +1 -1
- package/build/__api/queries/listCity.d.ts +1 -1
- package/build/__api/queries/listCountry.d.ts +1 -1
- package/build/__api/queries/listCustomerAttribute.d.ts +1 -1
- package/build/__api/queries/listCustomerReviewSummary.d.ts +1 -1
- package/build/__api/queries/listCustomerReviews.d.ts +1 -1
- package/build/__api/queries/listDistrict.d.ts +1 -1
- package/build/__api/queries/listFavoriteProducts.d.ts +1 -1
- package/build/__api/queries/listHTMLMetaData.d.ts +1 -1
- package/build/__api/queries/listMerchantSettings.d.ts +1 -1
- package/build/__api/queries/listOrderRefundSettings.d.ts +1 -1
- package/build/__api/queries/listOrderTransactions.d.ts +1 -1
- package/build/__api/queries/listPaymentGateway.d.ts +2 -2
- package/build/__api/queries/listPaymentGateway.js +1 -1
- package/build/__api/queries/listProductAttribute.d.ts +1 -1
- package/build/__api/queries/listProductBackInStockRemind.d.ts +1 -1
- package/build/__api/queries/listProductBrand.d.ts +1 -1
- package/build/__api/queries/listProductOptionSet.d.ts +1 -1
- package/build/__api/queries/listRaffle.d.ts +1 -1
- package/build/__api/queries/listRaffleMetadata.d.ts +1 -1
- package/build/__api/queries/listState.d.ts +1 -1
- package/build/__api/queries/searchProducts.d.ts +1 -3
- package/build/__api/queries/searchProducts.js +1 -1
- package/build/__api/types/index.d.ts +49 -10
- package/build/__api/types/index.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy13.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy14.js +1 -1
- package/build/analytics/analytics.d.ts +1 -1
- package/build/analytics/facebookPixel.d.ts +1 -1
- package/build/analytics/googleAnalytics.d.ts +1 -1
- package/build/analytics/googleTagManager.d.ts +1 -1
- package/build/analytics/googleUniversal.d.ts +1 -1
- package/build/analytics/ikas.d.ts +1 -1
- package/build/analytics/ikas.js +1 -1
- package/build/assets/translations/checkout/en.js +1 -1
- package/build/assets/translations/checkout/tr.js +1 -1
- package/build/components/checkout/components/address-form/index.js +1 -1
- package/build/components/checkout/components/address-form/model.d.ts +0 -1
- package/build/components/checkout/components/customer-addresses/index.d.ts +0 -4
- package/build/components/checkout/components/customer-addresses/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/style.module.scss.js +1 -1
- package/build/components/checkout/index.d.ts +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +3 -13
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/steps/step-info/index.js +1 -1
- package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/checkout/style.module.scss.js +1 -1
- package/build/components/index.d.ts +1 -0
- package/build/components/page-editor/model.js +1 -1
- package/build/ext/@ikas/fe-api-client/build/_virtual/_commonjsHelpers.js +1 -1
- package/build/ext/@ikas/fe-api-client/build/utils/api.js +1 -1
- package/build/ext/@ikas/fe-api-client/build/utils/fetch-query.js +1 -1
- package/build/ext/uuid/dist/{esm-node → esm-browser}/regex.js +0 -0
- package/build/ext/uuid/dist/esm-browser/rng.js +1 -0
- package/build/ext/uuid/dist/esm-browser/stringify.js +1 -0
- package/build/ext/uuid/dist/esm-browser/v4.js +1 -0
- package/build/ext/uuid/dist/{esm-node → esm-browser}/validate.js +0 -0
- package/build/ikas.js +98 -0
- package/build/index.js +1 -1
- package/build/models/data/blog/enums.d.ts +1 -1
- package/build/models/data/blog/index.d.ts +6 -6
- package/build/models/data/brand/enums.d.ts +1 -1
- package/build/models/data/brand/index.d.ts +2 -2
- package/build/models/data/cart/campaign-offer/enums.d.ts +1 -1
- package/build/models/data/cart/campaign-offer/index.d.ts +1 -1
- package/build/models/data/cart/enums.d.ts +1 -1
- package/build/models/data/cart/index.d.ts +3 -4
- package/build/models/data/cart/index.js +1 -1
- package/build/models/data/category/enums.d.ts +1 -1
- package/build/models/data/category/index.d.ts +3 -3
- package/build/models/data/checkout/index.d.ts +3 -3
- package/build/models/data/checkout/index.js +1 -1
- package/build/models/data/checkout-settings/enums.d.ts +1 -1
- package/build/models/data/checkout-settings/index.d.ts +2 -2
- package/build/models/data/city/index.d.ts +1 -1
- package/build/models/data/country/index.d.ts +1 -1
- package/build/models/data/customer/address/index.d.ts +6 -6
- package/build/models/data/customer/address/index.js +1 -1
- package/build/models/data/customer/attribute-value/index.d.ts +1 -1
- package/build/models/data/customer/enums.d.ts +1 -1
- package/build/models/data/customer/index.d.ts +2 -2
- package/build/models/data/customer-attribute/customer-attribute-option/index.d.ts +1 -1
- package/build/models/data/customer-attribute/customer-attribute-sales-channel/enums.d.ts +1 -1
- package/build/models/data/customer-attribute/customer-attribute-sales-channel/index.d.ts +1 -1
- package/build/models/data/customer-attribute/enums.d.ts +1 -1
- package/build/models/data/customer-attribute/index.d.ts +3 -3
- package/build/models/data/customer-review/enums.d.ts +1 -1
- package/build/models/data/customer-review/index.d.ts +1 -1
- package/build/models/data/customer-review-summary/index.d.ts +2 -2
- package/build/models/data/district/index.d.ts +1 -1
- package/build/models/data/favorite-product/index.d.ts +1 -1
- package/build/models/data/html-meta-data/enums.d.ts +1 -1
- package/build/models/data/html-meta-data/index.d.ts +2 -2
- package/build/models/data/index.d.ts +1 -0
- package/build/models/data/merchant-settings/index.d.ts +1 -1
- package/build/models/data/order/address/index.d.ts +5 -5
- package/build/models/data/order/address/index.js +1 -1
- package/build/models/data/order/adjustment/enums.d.ts +1 -1
- package/build/models/data/order/adjustment/index.d.ts +1 -1
- package/build/models/data/order/customer/index.d.ts +6 -0
- package/build/models/data/order/customer/index.js +1 -1
- package/build/models/data/order/enums.d.ts +1 -1
- package/build/models/data/order/gift-line/index.d.ts +1 -1
- package/build/models/data/order/index.d.ts +3 -3
- package/build/models/data/order/invoice/enums.d.ts +1 -1
- package/build/models/data/order/invoice/index.d.ts +1 -1
- package/build/models/data/order/line-item/discount/index.d.ts +1 -1
- package/build/models/data/order/line-item/enums.d.ts +1 -1
- package/build/models/data/order/line-item/index.d.ts +1 -1
- package/build/models/data/order/line-item/option/index.d.ts +1 -1
- package/build/models/data/order/line-item/option/value/index.d.ts +1 -1
- package/build/models/data/order/line-item/variant/index.d.ts +2 -2
- package/build/models/data/order/package/enums.d.ts +1 -1
- package/build/models/data/order/package/index.d.ts +1 -1
- package/build/models/data/order/package/tracking-info/index.d.ts +1 -1
- package/build/models/data/order/payment-method/enums.d.ts +1 -1
- package/build/models/data/order/payment-method/index.d.ts +1 -1
- package/build/models/data/order/refund/line-item/index.d.ts +1 -1
- package/build/models/data/order/shipping-line/index.d.ts +1 -1
- package/build/models/data/order/tax-line/index.d.ts +1 -1
- package/build/models/data/order/transaction/enums.d.ts +1 -1
- package/build/models/data/order/transaction/index.d.ts +3 -4
- package/build/models/data/order/transaction/index.js +1 -1
- package/build/models/data/payment-gateway/additional-price/index.d.ts +1 -1
- package/build/models/data/payment-gateway/enums.d.ts +1 -1
- package/build/models/data/payment-gateway/index.d.ts +1 -1
- package/build/models/data/payment-gateway/index.js +1 -1
- package/build/models/data/product/attribute-value/index.d.ts +1 -1
- package/build/models/data/product/variant/price/index.d.ts +1 -1
- package/build/models/data/product-filter/index.d.ts +1 -1
- package/build/models/data/product-option-set/enums.d.ts +1 -1
- package/build/models/data/simple-product/index.d.ts +137 -0
- package/build/models/data/state/index.d.ts +1 -1
- package/build/models/data/storefront/index.d.ts +0 -1
- package/build/models/data/storefront/index.js +1 -1
- package/build/models/theme/custom-data/index.js +1 -1
- package/build/models/theme/settings/color/index.js +1 -1
- package/build/models/ui/customer-review-summary-list/index.d.ts +1 -1
- package/build/models/ui/product-list/index.d.ts +2 -2
- package/build/models/ui/validator/form/register.d.ts +1 -1
- package/build/pages/404.js +1 -1
- package/build/pages/_slug_/index.js +1 -1
- package/build/pages/account/addresses.js +1 -1
- package/build/pages/account/favorite-products.js +1 -1
- package/build/pages/account/forgot-password.js +1 -1
- package/build/pages/account/index.js +1 -1
- package/build/pages/account/login.js +1 -1
- package/build/pages/account/orders/_id_.js +1 -1
- package/build/pages/account/orders/index.js +1 -1
- package/build/pages/account/raffles.js +1 -1
- package/build/pages/account/recover-password.js +1 -1
- package/build/pages/account/register.js +1 -1
- package/build/pages/blog/_slug_.js +1 -1
- package/build/pages/blog/index.js +1 -1
- package/build/pages/cart.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/build/pages/editor.d.ts +1 -1
- package/build/pages/home.js +1 -1
- package/build/pages/pages/_slug_.js +1 -1
- package/build/pages/raffle/_slug_.js +1 -1
- package/build/pages/raffle/index.js +1 -1
- package/build/pages/search.js +1 -1
- package/build/providers/page-data-get.d.ts +0 -1
- package/build/providers/page-data-get.js +1 -1
- package/build/providers/page-data-next.d.ts +0 -6
- package/build/providers/page-data-next.js +1 -1
- package/build/providers/prop-value/slider.d.ts +1 -1
- package/build/scripts/generators/types/index.d.ts +1 -2
- package/build/scripts/generators/types/index.js +1 -1
- package/build/store/base.d.ts +0 -1
- package/build/store/base.js +1 -1
- package/build/store/cart/index.js +1 -1
- package/build/store/checkout/index.d.ts +1 -4
- package/build/store/checkout/index.js +1 -1
- package/build/store/customer/api.d.ts +6 -13
- package/build/store/customer/api.js +1 -1
- package/build/store/customer/index.js +1 -1
- package/build/store/location/index.d.ts +1 -1
- package/build/store/product/index.d.ts +2 -7
- package/build/store/product/index.js +1 -1
- package/build/storefront/index.d.ts +0 -3
- package/build/storefront/index.js +1 -1
- package/build/utils/currency.js +1 -1
- package/build/utils/helper.d.ts +0 -1
- package/build/utils/helper.js +1 -1
- package/package.json +3 -3
- package/build/__api/models/StockLocation.js +0 -1
- package/build/__api/models/StockLocationAddress.js +0 -1
- package/build/__api/models/StockLocationAddressCity.js +0 -1
- package/build/__api/models/StockLocationAddressCountry.js +0 -1
- package/build/__api/models/StockLocationAddressDistrict.js +0 -1
- package/build/__api/models/StockLocationAddressState.js +0 -1
- package/build/__api/queries/listStockLocation.js +0 -1
- package/build/components/checkout/components/delivery-methods/icon-button/index.d.ts +0 -10
- package/build/components/checkout/components/delivery-methods/icon-button/index.js +0 -1
- package/build/components/checkout/components/delivery-methods/icon-button/style.module.scss.js +0 -1
- package/build/components/checkout/components/delivery-methods/icons/box.d.ts +0 -6
- package/build/components/checkout/components/delivery-methods/icons/box.js +0 -1
- package/build/components/checkout/components/delivery-methods/icons/store.d.ts +0 -6
- package/build/components/checkout/components/delivery-methods/icons/store.js +0 -1
- package/build/components/checkout/components/delivery-methods/index.d.ts +0 -7
- package/build/components/checkout/components/delivery-methods/index.js +0 -1
- package/build/components/checkout/components/delivery-methods/style.module.scss.js +0 -1
- package/build/ext/@ikas/fe-api-client/build/_virtual/axios-error-format.js_commonjs-exports.js +0 -1
- package/build/ext/@ikas/fe-api-client/build/_virtual/core.js_commonjs-exports.js +0 -1
- package/build/ext/@ikas/fe-api-client/build/_virtual/index.js_commonjs-exports.js +0 -1
- package/build/ext/@ikas/fe-api-client/build/ext/@redtea/format-axios-error/axios-error-format.js +0 -1
- package/build/ext/@ikas/fe-api-client/build/ext/@redtea/format-axios-error/core.js +0 -1
- package/build/ext/@ikas/fe-api-client/build/ext/@redtea/format-axios-error/index.js +0 -1
- package/build/ext/@ikas/fe-api-client/build/ext/@redtea/format-axios-error/index.mjs.js +0 -1
- package/build/ext/uuid/dist/esm-node/rng.js +0 -1
- package/build/ext/uuid/dist/esm-node/stringify.js +0 -1
- package/build/ext/uuid/dist/esm-node/v4.js +0 -1
- package/build/ikas.cjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as o}from'../../ext/tslib/tslib.es6.js';import*as i from"react";import{IkasPage as d}from"../../components/page/index.js";import"../../components/page/head.js";import"next/image.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/index.js";import"../../models/data/city/index.js";import"mobx";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute-value/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/customer-review-summary/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/adjustment/index.js";import"../../models/data/order/gift-line/index.js";import"../../models/data/order/invoice/index.js";import"../../models/data/order/line-item/discount/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/option/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/tracking-info/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/payment-method/index.js";import"../../models/data/order/refund/line-item/index.js";import"../../models/data/order/shipping-line/index.js";import"../../models/data/order/tax-line/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/product-campaign/campaign/index.js";import"../../models/data/product-campaign/filter/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as r}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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"../../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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasNextPageDataProvider as m}from"../../providers/page-data-next.js";import{observer as s}from"mobx-react-lite";var a=s((function(e){return i.createElement(d,t({},e))})),n=function(){return e(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{paths:[],fallback:"blocking"}]}))}))},l=function(t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,m.getStaticProps(t,r.RAFFLE_DETAIL)];case 1:return[2,e.sent()]}}))}))};export{a as default,n as getStaticPaths,l as getStaticProps};
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as o}from'../../ext/tslib/tslib.es6.js';import*as i from"react";import{IkasPage as d}from"../../components/page/index.js";import"../../components/page/head.js";import"../../components/page-editor/index.js";import"next/image.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/index.js";import"../../models/data/city/index.js";import"mobx";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute-value/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/customer-review-summary/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/adjustment/index.js";import"../../models/data/order/gift-line/index.js";import"../../models/data/order/invoice/index.js";import"../../models/data/order/line-item/discount/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/option/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/tracking-info/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/payment-method/index.js";import"../../models/data/order/refund/line-item/index.js";import"../../models/data/order/shipping-line/index.js";import"../../models/data/order/tax-line/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/product-campaign/campaign/index.js";import"../../models/data/product-campaign/filter/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as r}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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"../../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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasNextPageDataProvider as m}from"../../providers/page-data-next.js";import{observer as s}from"mobx-react-lite";var a=s((function(e){return i.createElement(d,t({},e))})),n=function(){return e(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{paths:[],fallback:"blocking"}]}))}))},l=function(t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,m.getStaticProps(t,r.RAFFLE_DETAIL)];case 1:return[2,e.sent()]}}))}))};export{a as default,n as getStaticPaths,l as getStaticProps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as o}from'../../ext/tslib/tslib.es6.js';import*as i from"react";import{IkasPage as d}from"../../components/page/index.js";import"../../components/page/head.js";import"next/image.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/index.js";import"../../models/data/city/index.js";import"mobx";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute-value/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/customer-review-summary/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/adjustment/index.js";import"../../models/data/order/gift-line/index.js";import"../../models/data/order/invoice/index.js";import"../../models/data/order/line-item/discount/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/option/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/tracking-info/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/payment-method/index.js";import"../../models/data/order/refund/line-item/index.js";import"../../models/data/order/shipping-line/index.js";import"../../models/data/order/tax-line/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/product-campaign/campaign/index.js";import"../../models/data/product-campaign/filter/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as r}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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"../../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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasNextPageDataProvider as m}from"../../providers/page-data-next.js";import{observer as s}from"mobx-react-lite";var a=s((function(e){return i.createElement(d,t({},e,{addOgpMetas:!0}))})),n=function(t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,m.getStaticProps(t,r.RAFFLE)];case 1:return[2,e.sent()]}}))}))};export{a as default,n as getStaticProps};
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as o}from'../../ext/tslib/tslib.es6.js';import*as i from"react";import{IkasPage as d}from"../../components/page/index.js";import"../../components/page/head.js";import"../../components/page-editor/index.js";import"next/image.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/index.js";import"../../models/data/city/index.js";import"mobx";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute-value/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/customer-review-summary/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/adjustment/index.js";import"../../models/data/order/gift-line/index.js";import"../../models/data/order/invoice/index.js";import"../../models/data/order/line-item/discount/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/option/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/tracking-info/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/payment-method/index.js";import"../../models/data/order/refund/line-item/index.js";import"../../models/data/order/shipping-line/index.js";import"../../models/data/order/tax-line/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/product-campaign/campaign/index.js";import"../../models/data/product-campaign/filter/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as r}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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"../../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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasNextPageDataProvider as m}from"../../providers/page-data-next.js";import{observer as s}from"mobx-react-lite";var a=s((function(e){return i.createElement(d,t({},e,{addOgpMetas:!0}))})),n=function(t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,m.getStaticProps(t,r.RAFFLE)];case 1:return[2,e.sent()]}}))}))};export{a as default,n as getStaticProps};
|
package/build/pages/search.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as o}from'../ext/tslib/tslib.es6.js';import*as i from"react";import{IkasPage as d}from"../components/page/index.js";import"../components/page/head.js";import"next/image.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/index.js";import"../models/data/city/index.js";import"mobx";import"../models/data/country/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/attribute-value/index.js";import"../models/data/customer/index.js";import"../models/data/customer-attribute/customer-attribute-option/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-review/index.js";import"../models/data/customer-review-summary/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/address/index.js";import"../models/data/order/adjustment/index.js";import"../models/data/order/gift-line/index.js";import"../models/data/order/invoice/index.js";import"../models/data/order/line-item/discount/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/option/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/tracking-info/index.js";import"../models/data/order/package/index.js";import"../models/data/order/payment-method/index.js";import"../models/data/order/refund/line-item/index.js";import"../models/data/order/shipping-line/index.js";import"../models/data/order/tax-line/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/product/attribute-value/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/product-attribute/index.js";import"../models/data/product-filter/index.js";import"../models/data/product-campaign/campaign/index.js";import"../models/data/product-campaign/filter/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/theme/theme.js";import{IkasThemePageType as r}from"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/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"../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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasNextPageDataProvider as m}from"../providers/page-data-next.js";import{observer as s}from"mobx-react-lite";var a=s((function(e){return i.createElement(d,t({},e,{addOgpMetas:!0,reInitOnBrowser:!0}))})),n=function(t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,m.getStaticProps(t,r.SEARCH)];case 1:return[2,e.sent()]}}))}))};export{a as default,n as getStaticProps};
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as o}from'../ext/tslib/tslib.es6.js';import*as i from"react";import{IkasPage as d}from"../components/page/index.js";import"../components/page/head.js";import"../components/page-editor/index.js";import"next/image.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/index.js";import"../models/data/city/index.js";import"mobx";import"../models/data/country/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/attribute-value/index.js";import"../models/data/customer/index.js";import"../models/data/customer-attribute/customer-attribute-option/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-review/index.js";import"../models/data/customer-review-summary/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/address/index.js";import"../models/data/order/adjustment/index.js";import"../models/data/order/gift-line/index.js";import"../models/data/order/invoice/index.js";import"../models/data/order/line-item/discount/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/option/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/tracking-info/index.js";import"../models/data/order/package/index.js";import"../models/data/order/payment-method/index.js";import"../models/data/order/refund/line-item/index.js";import"../models/data/order/shipping-line/index.js";import"../models/data/order/tax-line/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/product/attribute-value/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/product-attribute/index.js";import"../models/data/product-filter/index.js";import"../models/data/product-campaign/campaign/index.js";import"../models/data/product-campaign/filter/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/theme/theme.js";import{IkasThemePageType as r}from"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/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"../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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasNextPageDataProvider as m}from"../providers/page-data-next.js";import{observer as s}from"mobx-react-lite";var a=s((function(e){return i.createElement(d,t({},e,{addOgpMetas:!0,reInitOnBrowser:!0}))})),n=function(t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,m.getStaticProps(t,r.SEARCH)];case 1:return[2,e.sent()]}}))}))};export{a as default,n as getStaticProps};
|
|
@@ -36,7 +36,6 @@ export declare class IkasPageDataProvider {
|
|
|
36
36
|
fbpId: string | null;
|
|
37
37
|
analytics4Id: string | null;
|
|
38
38
|
universalAnalyticsId: string | null;
|
|
39
|
-
pickUpStockLocationIds: string[] | null;
|
|
40
39
|
favicon: any;
|
|
41
40
|
stockPreference: import("../models/theme/settings").IkasThemeStockPreference;
|
|
42
41
|
storefrontJSScripts: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import i from'../ext/lodash/uniq.js';import a from'../ext/lzutf8/build/production/lzutf8.js';import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/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-value/index.js";import"../models/data/customer/index.js";import"../models/data/customer-attribute/customer-attribute-option/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-review/index.js";import"../models/data/customer-review-summary/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/address/index.js";import"../models/data/order/adjustment/index.js";import"../models/data/order/gift-line/index.js";import"../models/data/order/invoice/index.js";import"../models/data/order/line-item/discount/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/option/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/tracking-info/index.js";import"../models/data/order/package/index.js";import"../models/data/order/payment-method/index.js";import"../models/data/order/refund/line-item/index.js";import"../models/data/order/shipping-line/index.js";import"../models/data/order/tax-line/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/product/attribute-value/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/product-attribute/index.js";import"../models/data/product-filter/index.js";import"../models/data/product-campaign/campaign/index.js";import"../models/data/product-campaign/filter/index.js";import"../models/data/product-option-set/index.js";import{IkasRaffleMetadataTargetType as s}from"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/variant-type/variant-value/index.js";import{IkasTheme as o}from"../models/theme/theme.js";import{IkasThemePageType as n}from"../models/theme/page/index.js";import{IkasThemePageComponent as d}from"../models/theme/page/component/index.js";import{IkasThemeComponent as u}from"../models/theme/component/index.js";import{IkasThemeComponentPropType as p}from"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as c}from"../models/ui/product-detail/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"../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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasProductListPropValueProvider as l}from"./prop-value/product-list.js";import{IkasProductDetailPropValueProvider as m}from"./prop-value/product-detail.js";import{IkasBrandListPropValueProvider as f}from"./prop-value/brand-list.js";import{IkasBrandPropValueProvider as g}from"./prop-value/brand.js";import{IkasLinkPropValueProvider as h}from"./prop-value/link.js";import{IkasImageListPropValueProvider as v}from"./prop-value/image-list.js";import{IkasTextPropValueProvider as j}from"./prop-value/text.js";import{IkasColorPropValueProvider as T}from"./prop-value/color.js";import{IkasBooleanPropValueProvider as x}from"./prop-value/boolean.js";import{IkasImagePropValueProvider as y}from"./prop-value/image.js";import{IkasCategoryPropValueProvider as S}from"./prop-value/category.js";import{IkasCategoryListPropValueProvider as b}from"./prop-value/category-list.js";import{IkasCustomPropValueProvider as D}from"./prop-value/custom.js";import{IkasStorefrontConfig as w}from"../storefront/index.js";import{IkasSliderPropValueProvider as O}from"./prop-value/slider.js";import{IkasRichTextPropValueProvider as L}from"./prop-value/rich-text.js";import{IkasBlogPropValueProvider as P}from"./prop-value/blog.js";import{IkasBlogListPropValueProvider as R}from"./prop-value/blog-list.js";import{IkasAttributePropValueProvider as C}from"./prop-value/attribute.js";import{IkasAttributeListPropValueProvider as I}from"./prop-value/attribute-list.js";import{IkasBlogCategoryPropValueProvider as E}from"./prop-value/blog-category.js";import{IkasBlogCategoryListPropValueProvider as A}from"./prop-value/blog-category-list.js";import{IkasRafflePropValueProvider as _}from"./prop-value/raffle.js";import{IkasRaffleListPropValueProvider as B}from"./prop-value/raffle-list.js";import{populateRaffleProducts as M}from"./helpers/raffles.js";import G from"../store/merchant/index.js";import V from"../store/customer/api.js";import F from"../store/blog/index.js";import k from"../store/raffle/index.js";import U from"../store/html-meta-data/index.js";import N from"../store/product/index.js";import q from"../store/brand/index.js";import Y from"../store/category/index.js";import{BlogMetadataTargetTypeEnum as J,HTMLMetaDataTargetTypeEnum as H}from"../__api/types/index.js";var z=function(){function d(e,t,i){this.pageType=null,this.pageParams={},this.pageComponentPropValues=[],this.pageSpecificData=null,this.merchantSettings=null,this.possiblePageTypes=[],this.linkMetaDataTargetIds=[],this.productReviewSummary=null,this.theme=new o(e),this.pageParams=t||{},this.pageType=i,r(this)}return Object.defineProperty(d.prototype,"page",{get:function(){var e=this;if(this.pageType===n.CUSTOM){var t=this.pageParams.slug;return this.theme.pages.find((function(e){return e.type===n.CUSTOM&&e.slug===t}))}return this.theme.pages.find((function(t){return t.type===e.pageType}))},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"nextPageData",{get:function(){var e,t,r;return{props:{propValuesStr:a.compress(JSON.stringify(this.pageComponentPropValues),{outputEncoding:"Base64"}),pageSpecificDataStr:this.pageSpecificData?JSON.stringify(this.pageSpecificData||{}):"",pageType:(null===(e=this.page)||void 0===e?void 0:e.type)||n.CUSTOM,pageTitle:(null===(t=this.page)||void 0===t?void 0:t.pageTitle)||null,pageDescription:(null===(r=this.page)||void 0===r?void 0:r.description)||null,settingsStr:JSON.stringify(this.theme.settings||{}),merchantSettingsStr:this.merchantSettings?JSON.stringify(this.merchantSettings):null,configJson:w.getJson(),productReviewSummary:JSON.stringify(this.productReviewSummary)}}},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"specification",{get:function(){var e,t,r=this,i=this.page;return(null==i?void 0:i.type)===n.PRODUCT?null===(e=i.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=r.pageSpecificData)||void 0===t?void 0:t.product.id)})):null===(t=null==i?void 0:i.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=r.pageSpecificData)||void 0===t?void 0:t.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),d.prototype.getMerchantSettings=function(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,G.listMerchantSettings({})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.merchantSettings=e.data),[2]}}))}))},d.prototype.getPageData=function(){return e(this,void 0,void 0,(function(){var e,r=this;return t(this,(function(t){switch(t.label){case 0:return this.pageSpecificData?[3,2]:[4,this.getPageSpecificData()];case 1:t.sent(),t.label=2;case 2:return this.page?[4,this.getMerchantSettings()]:[2];case 3:return t.sent(),e=this,[4,Promise.all(this.pageComponents.map((function(e){return r.getPageComponentPropValues(e)})))];case 4:return e.pageComponentPropValues=t.sent(),[4,this.setLinkSlugs()];case 5:return t.sent(),[4,this.getProductReviewSummary()];case 6:return t.sent(),[2]}}))}))},d.prototype.getProductReviewSummary=function(){var r,i,a;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageType!==n.PRODUCT?[3,2]:[4,V.listCustomerReviewSummary({productId:{eq:null===(r=this.pageSpecificData)||void 0===r?void 0:r.product.id}})];case 1:(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)&&(this.productReviewSummary=e.data.data[0]),t.label=2;case 2:return[2]}}))}))},d.prototype.getPageSpecificData=function(){var r,i,a,o;return e(this,void 0,void 0,(function(){var d,u,p,l,m,f,g,h,v,j,T=this;return t(this,(function(x){switch(x.label){case 0:return this.pageType&&![n.BRAND,n.PRODUCT,n.CATEGORY,n.BLOG,n.BLOG_CATEGORY,n.RAFFLE_DETAIL].includes(this.pageType)?[2]:(d=this.pageParams.slug)?(u=[],(null===(r=this.possiblePageTypes)||void 0===r?void 0:r.includes(n.BLOG))||(null===(i=this.possiblePageTypes)||void 0===i?void 0:i.includes(n.BLOG_CATEGORY))?[4,F.listBlogMetaData({slug:{eq:d}})]:[3,2]):[2];case 1:return p=x.sent(),(u=(null===(a=p.data)||void 0===a?void 0:a.data)||[]).length?[3,6]:[2];case 2:return(null===(o=this.possiblePageTypes)||void 0===o?void 0:o.includes(n.RAFFLE_DETAIL))?[4,k.listRaffleMetaData({slug:{eq:d}})]:[3,4];case 3:return p=x.sent(),(u=p.data||[]).length?[3,6]:[2];case 4:return[4,U.listHTMLMetaData({slug:{eq:d}})];case 5:if(p=x.sent(),!(u=p.data||[])||!u.length)return[2];x.label=6;case 6:if(!(l=u[0]).targetId)return[2];switch(m=function(){return e(T,void 0,void 0,(function(){var e,r,i,a,s,o,d,u,p;return t(this,(function(t){switch(t.label){case 0:return[4,N.searchProducts({input:{productIdList:[l.targetId],priceListId:w.priceListId,salesChannelId:w.salesChannelId}})];case 1:return e=t.sent(),(null===(u=null===(d=null==e?void 0:e.data)||void 0===d?void 0:d.data)||void 0===u?void 0:u.length)?(r=e.data.data[0]).productOptionSetId?[4,N.listProductOptionSet({id:{eq:r.productOptionSetId}})]:[3,3]:[2];case 2:(i=t.sent()).isSuccess&&(null===(p=null==i?void 0:i.data)||void 0===p?void 0:p.length)&&(r.productOptionSet=i.data[0]),t.label=3;case 3:return(a=r.variants.find((function(e){return e.isActive})))?(this.pageSpecificData=new c(r,a.variantValues),this.pageSpecificData.displayedVariantTypes.length&&(s=this.pageSpecificData.displayedVariantTypes[0]).displayedVariantValues.length&&(o=s.displayedVariantValues.find((function(e){return e.hasStock})))&&(this.pageSpecificData.selectedVariantValues=o.variant.variantValues),this.pageType=n.PRODUCT,this.setPageMetaData(l),[2]):[2]}}))}))},f=function(){return e(T,void 0,void 0,(function(){var e,r,i,a;return t(this,(function(t){switch(t.label){case 0:return[4,q.listBrand({id:{eq:l.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=n.BRAND,this.setPageMetaData(l),[2]):[2]}}))}))},g=function(){return e(T,void 0,void 0,(function(){var e,r,i,a;return t(this,(function(t){switch(t.label){case 0:return[4,Y.listCategory({id:{eq:l.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=n.CATEGORY,this.setPageMetaData(l),[2]):[2]}}))}))},h=function(){return e(T,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,F.listBlog({id:{eq:l.targetId}})];case 1:return(e=t.sent())?(this.pageSpecificData=e,this.pageType=n.BLOG,this.setPageMetaData(l),[2]):[2]}}))}))},v=function(){return e(T,void 0,void 0,(function(){var e,r,i,a;return t(this,(function(t){switch(t.label){case 0:return[4,F.listBlogCategory({id:{eq:l.targetId},pagination:{page:1,limit:1}})];case 1:return(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=n.BLOG_CATEGORY,this.setPageMetaData(l),[2]):[2]}}))}))},j=function(){return e(T,void 0,void 0,(function(){var e,r,i,a;return t(this,(function(t){switch(t.label){case 0:return[4,k.listRaffle({id:{eq:l.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?(r=e.data.data[0],[4,M([r])]):[2];case 2:return t.sent(),this.pageSpecificData=r,this.pageType=n.RAFFLE_DETAIL,this.setPageMetaData(l),[2]}}))}))},l.targetType){case H.BRAND:return[3,7];case H.CATEGORY:return[3,9];case H.PRODUCT:return[3,11];case J.BLOG:return[3,13];case J.BLOG_CATEGORY:return[3,15];case s.RAFFLE:return[3,17]}return[3,19];case 7:return[4,f()];case 8:return[2,x.sent()];case 9:return[4,g()];case 10:return[2,x.sent()];case 11:return[4,m()];case 12:return[2,x.sent()];case 13:return[4,h()];case 14:return[2,x.sent()];case 15:return[4,v()];case 16:return[2,x.sent()];case 17:return[4,j()];case 18:return[2,x.sent()];case 19:return[3,20];case 20:return[2]}}))}))},d.prototype.getPageComponentPropValues=function(r){return e(this,void 0,void 0,(function(){var i,a,s,o=this;return t(this,(function(n){switch(n.label){case 0:return i=this.theme.components.find((function(e){return e.id===r.componentId})),a={pageComponent:r,component:i,propValues:{}},s=function(i){return e(o,void 0,void 0,(function(){var e,s;return t(this,(function(t){switch(t.label){case 0:return e=a.propValues,s=i.name,[4,this.getPageComponentPropValue(r,i)];case 1:return e[s]=t.sent(),[2]}}))}))},[4,Promise.all(i.props.map(s))];case 1:return n.sent(),[2,a]}}))}))},d.prototype.getPageComponentPropValue=function(r,i){return e(this,void 0,void 0,(function(){var e,a,s,o,n,d=this;return t(this,(function(t){switch(t.label){case 0:if(a=r.propValues[i.name],s=[p.RAFFLE_LIST],null==a&&!s.includes(i.type))return[2,null];switch(i.type){case p.TEXT:return[3,1];case p.RICH_TEXT:return[3,2];case p.BOOLEAN:return[3,3];case p.IMAGE:return[3,4];case p.IMAGE_LIST:return[3,5];case p.BRAND:return[3,6];case p.BRAND_LIST:return[3,7];case p.PRODUCT_LIST:return[3,8];case p.PRODUCT_DETAIL:return[3,9];case p.PRODUCT_ATTRIBUTE:return[3,10];case p.PRODUCT_ATTRIBUTE_LIST:return[3,11];case p.CATEGORY:return[3,12];case p.CATEGORY_LIST:return[3,13];case p.LINK:case p.LIST_OF_LINK:return[3,14];case p.COLOR:return[3,15];case p.CUSTOM:return[3,16];case p.COMPONENT:case p.COMPONENT_LIST:return[3,17];case p.BLOG:return[3,19];case p.BLOG_LIST:return[3,20];case p.BLOG_CATEGORY:return[3,21];case p.BLOG_CATEGORY_LIST:return[3,22];case p.RAFFLE:return[3,23];case p.RAFFLE_LIST:return[3,24];case p.SLIDER:return[3,25]}return[3,26];case 1:return e=new j(a),[3,27];case 2:return e=new L(a),[3,27];case 3:return e=new x(a),[3,27];case 4:return e=new y(a),[3,27];case 5:return e=new v(a),[3,27];case 6:return e=new g(a),[3,27];case 7:return e=new f(a),[3,27];case 8:return e=new l(this.pageType,a,this.pageSpecificData),[3,27];case 9:return e=new m(a),[3,27];case 10:return e=new C(a),[3,27];case 11:return e=new I(a),[3,27];case 12:return e=new S(a),[3,27];case 13:return e=new b(a),[3,27];case 14:return e=new h(a,this.theme,this.linkMetaDataTargetIds),[3,27];case 15:return e=new T(a),[3,27];case 16:return(o=this.theme.customData.find((function(e){return e.id===i.customDataId})))?(e=new D(a,o,this.theme,this.pageType,this,this.pageSpecificData,this.pageParams),[3,27]):[2];case 17:return n=a,[4,Promise.all(n.map((function(e){return d.getPageComponentPropValues(e)})))];case 18:case 28:return[2,t.sent()];case 19:return e=new P(a),[3,27];case 20:return e=new R(this.pageType,a,this.pageSpecificData),[3,27];case 21:return e=new E(a),[3,27];case 22:return e=new A(a),[3,27];case 23:return e=new _(a),[3,27];case 24:return e=new B,[3,27];case 25:return e=new O(a),[3,27];case 26:return[3,27];case 27:return[4,null==e?void 0:e.getValue()]}}))}))},d.prototype.setPageMetaData=function(e){this.page&&(this.page.pageTitle=e.pageTitle,this.page.description=e.description)},d.prototype.setLinkSlugs=function(){return e(this,void 0,void 0,(function(){var e,r,i;return t(this,(function(t){switch(t.label){case 0:return e=[],r=[],i=[],this.linkMetaDataTargetIds.forEach((function(t){switch(t.type){case"DEFAULT":e.push(t);break;case"BLOG":r.push(t);break;case"RAFFLE":i.push(t)}})),[4,Promise.all([this.getLinkSlugs(e,"DEFAULT"),this.getLinkSlugs(r,"BLOG"),this.getLinkSlugs(i,"RAFFLE")])];case 1:return[2,t.sent()]}}))}))},d.prototype.getLinkSlugs=function(r,a){return e(this,void 0,void 0,(function(){var s,o,n=this;return t(this,(function(d){switch(d.label){case 0:return s=i(r.map((function(e){return e.id}))),o=[],[4,function(){return e(n,void 0,void 0,(function(){var e,r,i,n,d;return t(this,(function(t){switch(t.label){case 0:switch(e=[],a){case"DEFAULT":return[3,1];case"BLOG":return[3,3];case"RAFFLE":return[3,5]}return[3,7];case 1:return[4,U.listHTMLMetaData({id:{in:s}})];case 2:return r=t.sent(),e=r.data||[],[3,8];case 3:return[4,F.listBlogMetaData({id:{in:s}})];case 4:return i=t.sent(),e=(null===(d=i.data)||void 0===d?void 0:d.data)||[],[3,8];case 5:return[4,k.listRaffleMetaData({id:{in:s}})];case 6:return n=t.sent(),e=n.data||[],[3,8];case 7:return[3,8];case 8:return e.length&&(o=e),[2]}}))}))}()];case 1:return d.sent(),r.forEach((function(e){var t=o.find((function(t){return t.targetId===e.id}));t&&(e.navigationLink.href+=t.slug)})),[2]}}))}))},d}(),K=function(e){this.pageComponent=e.pageComponent?new d(e.pageComponent):new d({}),this.component=e.component?new u(e.component):new u({}),this.propValues=e.propValues||{}};export{K as IkasPageComponentPropValue,z as IkasPageDataProvider};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import i from'../ext/lodash/uniq.js';import a from'../ext/lzutf8/build/production/lzutf8.js';import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/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-value/index.js";import"../models/data/customer/index.js";import"../models/data/customer-attribute/customer-attribute-option/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-review/index.js";import"../models/data/customer-review-summary/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/address/index.js";import"../models/data/order/adjustment/index.js";import"../models/data/order/gift-line/index.js";import"../models/data/order/invoice/index.js";import"../models/data/order/line-item/discount/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/option/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/tracking-info/index.js";import"../models/data/order/package/index.js";import"../models/data/order/payment-method/index.js";import"../models/data/order/refund/line-item/index.js";import"../models/data/order/shipping-line/index.js";import"../models/data/order/tax-line/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/product/attribute-value/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/product-attribute/index.js";import"../models/data/product-filter/index.js";import"../models/data/product-campaign/campaign/index.js";import"../models/data/product-campaign/filter/index.js";import"../models/data/product-option-set/index.js";import{IkasRaffleMetadataTargetType as s}from"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/variant-type/variant-value/index.js";import{IkasTheme as o}from"../models/theme/theme.js";import{IkasThemePageType as n}from"../models/theme/page/index.js";import{IkasThemePageComponent as d}from"../models/theme/page/component/index.js";import{IkasThemeComponent as u}from"../models/theme/component/index.js";import{IkasThemeComponentPropType as p}from"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as c}from"../models/ui/product-detail/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"../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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasProductListPropValueProvider as l}from"./prop-value/product-list.js";import{IkasProductDetailPropValueProvider as m}from"./prop-value/product-detail.js";import{IkasBrandListPropValueProvider as f}from"./prop-value/brand-list.js";import{IkasBrandPropValueProvider as g}from"./prop-value/brand.js";import{IkasLinkPropValueProvider as h}from"./prop-value/link.js";import{IkasImageListPropValueProvider as v}from"./prop-value/image-list.js";import{IkasTextPropValueProvider as j}from"./prop-value/text.js";import{IkasColorPropValueProvider as T}from"./prop-value/color.js";import{IkasBooleanPropValueProvider as x}from"./prop-value/boolean.js";import{IkasImagePropValueProvider as y}from"./prop-value/image.js";import{IkasCategoryPropValueProvider as S}from"./prop-value/category.js";import{IkasCategoryListPropValueProvider as b}from"./prop-value/category-list.js";import{IkasCustomPropValueProvider as D}from"./prop-value/custom.js";import{IkasStorefrontConfig as w}from"../storefront/index.js";import{IkasSliderPropValueProvider as O}from"./prop-value/slider.js";import{IkasRichTextPropValueProvider as L}from"./prop-value/rich-text.js";import{IkasBlogPropValueProvider as P}from"./prop-value/blog.js";import{IkasBlogListPropValueProvider as R}from"./prop-value/blog-list.js";import{IkasAttributePropValueProvider as C}from"./prop-value/attribute.js";import{IkasAttributeListPropValueProvider as I}from"./prop-value/attribute-list.js";import{IkasBlogCategoryPropValueProvider as E}from"./prop-value/blog-category.js";import{IkasBlogCategoryListPropValueProvider as A}from"./prop-value/blog-category-list.js";import{IkasRafflePropValueProvider as _}from"./prop-value/raffle.js";import{IkasRaffleListPropValueProvider as B}from"./prop-value/raffle-list.js";import{populateRaffleProducts as M}from"./helpers/raffles.js";import G from"../store/merchant/index.js";import V from"../store/customer/api.js";import F from"../store/blog/index.js";import k from"../store/raffle/index.js";import U from"../store/html-meta-data/index.js";import N from"../store/product/index.js";import Y from"../store/brand/index.js";import q from"../store/category/index.js";import{BlogMetadataTargetTypeEnum as J,HTMLMetaDataTargetTypeEnum as H}from"../__api/types/index.js";var z=function(){function d(e,t,i){this.pageType=null,this.pageParams={},this.pageComponentPropValues=[],this.pageSpecificData=null,this.merchantSettings=null,this.possiblePageTypes=[],this.linkMetaDataTargetIds=[],this.productReviewSummary=null,this.theme=new o(e),this.pageParams=t||{},this.pageType=i,r(this)}return Object.defineProperty(d.prototype,"page",{get:function(){var e=this;if(this.pageType===n.CUSTOM){var t=this.pageParams.slug;return this.theme.pages.find((function(e){return e.type===n.CUSTOM&&e.slug===t}))}return this.theme.pages.find((function(t){return t.type===e.pageType}))},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"nextPageData",{get:function(){var e,t,r;return{props:{propValuesStr:a.compress(JSON.stringify(this.pageComponentPropValues),{outputEncoding:"Base64"}),pageSpecificDataStr:this.pageSpecificData?JSON.stringify(this.pageSpecificData||{}):"",pageType:(null===(e=this.page)||void 0===e?void 0:e.type)||n.CUSTOM,pageTitle:(null===(t=this.page)||void 0===t?void 0:t.pageTitle)||null,pageDescription:(null===(r=this.page)||void 0===r?void 0:r.description)||null,settingsStr:JSON.stringify(this.theme.settings||{}),merchantSettingsStr:this.merchantSettings?JSON.stringify(this.merchantSettings):null,configJson:w.getJson(),productReviewSummary:JSON.stringify(this.productReviewSummary)}}},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"specification",{get:function(){var e,t,r=this,i=this.page;return(null==i?void 0:i.type)===n.PRODUCT?null===(e=i.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=r.pageSpecificData)||void 0===t?void 0:t.product.id)})):null===(t=null==i?void 0:i.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=r.pageSpecificData)||void 0===t?void 0:t.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),d.prototype.getMerchantSettings=function(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,G.listMerchantSettings({})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.merchantSettings=e.data),[2]}}))}))},d.prototype.getPageData=function(){return e(this,void 0,void 0,(function(){var e,r=this;return t(this,(function(t){switch(t.label){case 0:return this.pageSpecificData?[3,2]:[4,this.getPageSpecificData()];case 1:t.sent(),t.label=2;case 2:return this.page?[4,this.getMerchantSettings()]:[2];case 3:return t.sent(),e=this,[4,Promise.all(this.pageComponents.map((function(e){return r.getPageComponentPropValues(e)})))];case 4:return e.pageComponentPropValues=t.sent(),[4,this.setLinkSlugs()];case 5:return t.sent(),[4,this.getProductReviewSummary()];case 6:return t.sent(),[2]}}))}))},d.prototype.getProductReviewSummary=function(){var r,i,a;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageType!==n.PRODUCT?[3,2]:[4,V.listCustomerReviewSummary({productId:{eq:null===(r=this.pageSpecificData)||void 0===r?void 0:r.product.id}})];case 1:(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)&&(this.productReviewSummary=e.data.data[0]),t.label=2;case 2:return[2]}}))}))},d.prototype.getPageSpecificData=function(){var r,i,a,o;return e(this,void 0,void 0,(function(){var d,u,p,l,m,f,g,h,v,j,T=this;return t(this,(function(x){switch(x.label){case 0:return this.pageType&&![n.BRAND,n.PRODUCT,n.CATEGORY,n.BLOG,n.BLOG_CATEGORY,n.RAFFLE_DETAIL].includes(this.pageType)?[2]:(d=this.pageParams.slug)?(u=[],(null===(r=this.possiblePageTypes)||void 0===r?void 0:r.includes(n.BLOG))||(null===(i=this.possiblePageTypes)||void 0===i?void 0:i.includes(n.BLOG_CATEGORY))?[4,F.listBlogMetaData({slug:{eq:d}})]:[3,2]):[2];case 1:return p=x.sent(),(u=(null===(a=p.data)||void 0===a?void 0:a.data)||[]).length?[3,6]:[2];case 2:return(null===(o=this.possiblePageTypes)||void 0===o?void 0:o.includes(n.RAFFLE_DETAIL))?[4,k.listRaffleMetaData({slug:{eq:d}})]:[3,4];case 3:return p=x.sent(),(u=p.data||[]).length?[3,6]:[2];case 4:return[4,U.listHTMLMetaData(d)];case 5:if(p=x.sent(),!(u=p.data||[])||!u.length)return[2];x.label=6;case 6:if(!(l=u[0]).targetId)return[2];switch(m=function(){return e(T,void 0,void 0,(function(){var e,r,i,a,s,o,d,u,p;return t(this,(function(t){switch(t.label){case 0:return[4,N.searchProducts({input:{productIdList:[l.targetId],priceListId:w.priceListId,salesChannelId:w.salesChannelId}})];case 1:return e=t.sent(),(null===(u=null===(d=null==e?void 0:e.data)||void 0===d?void 0:d.data)||void 0===u?void 0:u.length)?(r=e.data.data[0]).productOptionSetId?[4,N.listProductOptionSet({id:{eq:r.productOptionSetId}})]:[3,3]:[2];case 2:(i=t.sent()).isSuccess&&(null===(p=null==i?void 0:i.data)||void 0===p?void 0:p.length)&&(r.productOptionSet=i.data[0]),t.label=3;case 3:return(a=r.variants.find((function(e){return e.isActive})))?(this.pageSpecificData=new c(r,a.variantValues),this.pageSpecificData.displayedVariantTypes.length&&(s=this.pageSpecificData.displayedVariantTypes[0]).displayedVariantValues.length&&(o=s.displayedVariantValues.find((function(e){return e.hasStock})))&&(this.pageSpecificData.selectedVariantValues=o.variant.variantValues),this.pageType=n.PRODUCT,this.setPageMetaData(l),[2]):[2]}}))}))},f=function(){return e(T,void 0,void 0,(function(){var e,r,i,a;return t(this,(function(t){switch(t.label){case 0:return[4,Y.listBrand({id:{eq:l.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=n.BRAND,this.setPageMetaData(l),[2]):[2]}}))}))},g=function(){return e(T,void 0,void 0,(function(){var e,r,i,a;return t(this,(function(t){switch(t.label){case 0:return[4,q.listCategory({id:{eq:l.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=n.CATEGORY,this.setPageMetaData(l),[2]):[2]}}))}))},h=function(){return e(T,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,F.listBlog({id:{eq:l.targetId}})];case 1:return(e=t.sent())?(this.pageSpecificData=e,this.pageType=n.BLOG,this.setPageMetaData(l),[2]):[2]}}))}))},v=function(){return e(T,void 0,void 0,(function(){var e,r,i,a;return t(this,(function(t){switch(t.label){case 0:return[4,F.listBlogCategory({id:{eq:l.targetId},pagination:{page:1,limit:1}})];case 1:return(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?(r=e.data.data[0],this.pageSpecificData=r,this.pageType=n.BLOG_CATEGORY,this.setPageMetaData(l),[2]):[2]}}))}))},j=function(){return e(T,void 0,void 0,(function(){var e,r,i,a;return t(this,(function(t){switch(t.label){case 0:return[4,k.listRaffle({id:{eq:l.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(a=null===(i=e.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?(r=e.data.data[0],[4,M([r])]):[2];case 2:return t.sent(),this.pageSpecificData=r,this.pageType=n.RAFFLE_DETAIL,this.setPageMetaData(l),[2]}}))}))},l.targetType){case H.BRAND:return[3,7];case H.CATEGORY:return[3,9];case H.PRODUCT:return[3,11];case J.BLOG:return[3,13];case J.BLOG_CATEGORY:return[3,15];case s.RAFFLE:return[3,17]}return[3,19];case 7:return[4,f()];case 8:return[2,x.sent()];case 9:return[4,g()];case 10:return[2,x.sent()];case 11:return[4,m()];case 12:return[2,x.sent()];case 13:return[4,h()];case 14:return[2,x.sent()];case 15:return[4,v()];case 16:return[2,x.sent()];case 17:return[4,j()];case 18:return[2,x.sent()];case 19:return[3,20];case 20:return[2]}}))}))},d.prototype.getPageComponentPropValues=function(r){return e(this,void 0,void 0,(function(){var i,a,s,o=this;return t(this,(function(n){switch(n.label){case 0:return i=this.theme.components.find((function(e){return e.id===r.componentId})),a={pageComponent:r,component:i,propValues:{}},s=function(i){return e(o,void 0,void 0,(function(){var e,s;return t(this,(function(t){switch(t.label){case 0:return e=a.propValues,s=i.name,[4,this.getPageComponentPropValue(r,i)];case 1:return e[s]=t.sent(),[2]}}))}))},[4,Promise.all(i.props.map(s))];case 1:return n.sent(),[2,a]}}))}))},d.prototype.getPageComponentPropValue=function(r,i){return e(this,void 0,void 0,(function(){var e,a,s,o,n,d=this;return t(this,(function(t){switch(t.label){case 0:if(a=r.propValues[i.name],s=[p.RAFFLE_LIST],null==a&&!s.includes(i.type))return[2,null];switch(i.type){case p.TEXT:return[3,1];case p.RICH_TEXT:return[3,2];case p.BOOLEAN:return[3,3];case p.IMAGE:return[3,4];case p.IMAGE_LIST:return[3,5];case p.BRAND:return[3,6];case p.BRAND_LIST:return[3,7];case p.PRODUCT_LIST:return[3,8];case p.PRODUCT_DETAIL:return[3,9];case p.PRODUCT_ATTRIBUTE:return[3,10];case p.PRODUCT_ATTRIBUTE_LIST:return[3,11];case p.CATEGORY:return[3,12];case p.CATEGORY_LIST:return[3,13];case p.LINK:case p.LIST_OF_LINK:return[3,14];case p.COLOR:return[3,15];case p.CUSTOM:return[3,16];case p.COMPONENT:case p.COMPONENT_LIST:return[3,17];case p.BLOG:return[3,19];case p.BLOG_LIST:return[3,20];case p.BLOG_CATEGORY:return[3,21];case p.BLOG_CATEGORY_LIST:return[3,22];case p.RAFFLE:return[3,23];case p.RAFFLE_LIST:return[3,24];case p.SLIDER:return[3,25]}return[3,26];case 1:return e=new j(a),[3,27];case 2:return e=new L(a),[3,27];case 3:return e=new x(a),[3,27];case 4:return e=new y(a),[3,27];case 5:return e=new v(a),[3,27];case 6:return e=new g(a),[3,27];case 7:return e=new f(a),[3,27];case 8:return e=new l(this.pageType,a,this.pageSpecificData),[3,27];case 9:return e=new m(a),[3,27];case 10:return e=new C(a),[3,27];case 11:return e=new I(a),[3,27];case 12:return e=new S(a),[3,27];case 13:return e=new b(a),[3,27];case 14:return e=new h(a,this.theme,this.linkMetaDataTargetIds),[3,27];case 15:return e=new T(a),[3,27];case 16:return(o=this.theme.customData.find((function(e){return e.id===i.customDataId})))?(e=new D(a,o,this.theme,this.pageType,this,this.pageSpecificData,this.pageParams),[3,27]):[2];case 17:return n=a,[4,Promise.all(n.map((function(e){return d.getPageComponentPropValues(e)})))];case 18:case 28:return[2,t.sent()];case 19:return e=new P(a),[3,27];case 20:return e=new R(this.pageType,a,this.pageSpecificData),[3,27];case 21:return e=new E(a),[3,27];case 22:return e=new A(a),[3,27];case 23:return e=new _(a),[3,27];case 24:return e=new B,[3,27];case 25:return e=new O(a),[3,27];case 26:return[3,27];case 27:return[4,null==e?void 0:e.getValue()]}}))}))},d.prototype.setPageMetaData=function(e){this.page&&(this.page.pageTitle=e.pageTitle,this.page.description=e.description)},d.prototype.setLinkSlugs=function(){return e(this,void 0,void 0,(function(){var e,r,i;return t(this,(function(t){switch(t.label){case 0:return e=[],r=[],i=[],this.linkMetaDataTargetIds.forEach((function(t){switch(t.type){case"DEFAULT":e.push(t);break;case"BLOG":r.push(t);break;case"RAFFLE":i.push(t)}})),[4,Promise.all([this.getLinkSlugs(e,"DEFAULT"),this.getLinkSlugs(r,"BLOG"),this.getLinkSlugs(i,"RAFFLE")])];case 1:return[2,t.sent()]}}))}))},d.prototype.getLinkSlugs=function(r,a){return e(this,void 0,void 0,(function(){var s,o,n=this;return t(this,(function(d){switch(d.label){case 0:return s=i(r.map((function(e){return e.id}))),o=[],[4,function(){return e(n,void 0,void 0,(function(){var e,r,i,n,d;return t(this,(function(t){switch(t.label){case 0:switch(e=[],a){case"DEFAULT":return[3,1];case"BLOG":return[3,3];case"RAFFLE":return[3,5]}return[3,7];case 1:return[4,U.listHTMLMetaData({id:{in:s}})];case 2:return r=t.sent(),e=r.data||[],[3,8];case 3:return[4,F.listBlogMetaData({id:{in:s}})];case 4:return i=t.sent(),e=(null===(d=i.data)||void 0===d?void 0:d.data)||[],[3,8];case 5:return[4,k.listRaffleMetaData({id:{in:s}})];case 6:return n=t.sent(),e=n.data||[],[3,8];case 7:return[3,8];case 8:return e.length&&(o=e),[2]}}))}))}()];case 1:return d.sent(),r.forEach((function(e){var t=o.find((function(t){return t.targetId===e.id}));t&&(e.navigationLink.href+=t.slug)})),[2]}}))}))},d}(),K=function(e){this.pageComponent=e.pageComponent?new d(e.pageComponent):new d({}),this.component=e.component?new u(e.component):new u({}),this.propValues=e.propValues||{}};export{K as IkasPageComponentPropValue,z as IkasPageDataProvider};
|
|
@@ -42,7 +42,6 @@ export declare class IkasNextPageDataProvider {
|
|
|
42
42
|
fbpId: string | null;
|
|
43
43
|
analytics4Id: string | null;
|
|
44
44
|
universalAnalyticsId: string | null;
|
|
45
|
-
pickUpStockLocationIds: string[] | null;
|
|
46
45
|
favicon: any;
|
|
47
46
|
stockPreference: IkasThemeStockPreference;
|
|
48
47
|
storefrontJSScripts: string[];
|
|
@@ -77,7 +76,6 @@ export declare class IkasNextPageDataProvider {
|
|
|
77
76
|
fbpId: string | null;
|
|
78
77
|
analytics4Id: string | null;
|
|
79
78
|
universalAnalyticsId: string | null;
|
|
80
|
-
pickUpStockLocationIds: string[] | null;
|
|
81
79
|
favicon: any;
|
|
82
80
|
stockPreference: IkasThemeStockPreference;
|
|
83
81
|
storefrontJSScripts: string[];
|
|
@@ -121,7 +119,6 @@ export declare class IkasNextPageDataProvider {
|
|
|
121
119
|
fbpId: string | null;
|
|
122
120
|
analytics4Id: string | null;
|
|
123
121
|
universalAnalyticsId: string | null;
|
|
124
|
-
pickUpStockLocationIds: string[] | null;
|
|
125
122
|
favicon: any;
|
|
126
123
|
stockPreference: IkasThemeStockPreference;
|
|
127
124
|
storefrontJSScripts: string[];
|
|
@@ -156,7 +153,6 @@ export declare class IkasNextPageDataProvider {
|
|
|
156
153
|
fbpId: string | null;
|
|
157
154
|
analytics4Id: string | null;
|
|
158
155
|
universalAnalyticsId: string | null;
|
|
159
|
-
pickUpStockLocationIds: string[] | null;
|
|
160
156
|
favicon: any;
|
|
161
157
|
stockPreference: IkasThemeStockPreference;
|
|
162
158
|
storefrontJSScripts: string[];
|
|
@@ -200,7 +196,6 @@ export declare class IkasNextPageDataProvider {
|
|
|
200
196
|
fbpId: string | null;
|
|
201
197
|
analytics4Id: string | null;
|
|
202
198
|
universalAnalyticsId: string | null;
|
|
203
|
-
pickUpStockLocationIds: string[] | null;
|
|
204
199
|
favicon: any;
|
|
205
200
|
stockPreference: IkasThemeStockPreference;
|
|
206
201
|
storefrontJSScripts: string[];
|
|
@@ -235,7 +230,6 @@ export declare class IkasNextPageDataProvider {
|
|
|
235
230
|
fbpId: string | null;
|
|
236
231
|
analytics4Id: string | null;
|
|
237
232
|
universalAnalyticsId: string | null;
|
|
238
|
-
pickUpStockLocationIds: string[] | null;
|
|
239
233
|
favicon: any;
|
|
240
234
|
stockPreference: IkasThemeStockPreference;
|
|
241
235
|
storefrontJSScripts: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t,__assign as o,__spreadArray as r}from'../ext/tslib/tslib.es6.js';import i from"fs";import n from"next/config.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/index.js";import"../models/data/city/index.js";import"mobx";import"../models/data/country/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/attribute-value/index.js";import"../models/data/customer/index.js";import"../models/data/customer-attribute/customer-attribute-option/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-review/index.js";import"../models/data/customer-review-summary/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/address/index.js";import"../models/data/order/adjustment/index.js";import"../models/data/order/gift-line/index.js";import"../models/data/order/invoice/index.js";import"../models/data/order/line-item/discount/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/option/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/tracking-info/index.js";import"../models/data/order/package/index.js";import"../models/data/order/payment-method/index.js";import"../models/data/order/refund/line-item/index.js";import"../models/data/order/shipping-line/index.js";import"../models/data/order/tax-line/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/product/attribute-value/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/product-attribute/index.js";import"../models/data/product-filter/index.js";import"../models/data/product-campaign/campaign/index.js";import"../models/data/product-campaign/filter/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/variant-type/variant-value/index.js";import{IkasTheme as s}from"../models/theme/theme.js";import{IkasThemePageType as a}from"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/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"../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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasStorefront as d}from"../models/data/storefront/index.js";import{IkasSalesChannel as l}from"../models/data/sales-channel/index.js";import{IkasStorefrontRouting as m}from"../models/data/storefront/routing/index.js";import{IkasStorefrontConfig as c}from"../storefront/index.js";import{IkasPageDataProvider as u}from"./page-data-get.js";import{IkasStorefrontThemeLocalization as p}from"../models/data/storefront/theme-localization/index.js";import{I18NFileReader as f}from"../utils/i18n.js";import{getGoogleFontHref as g}from"../utils/google-fonts.js";import v from"../store/storefront/index.js";import j from"../store/checkout/index.js";var h=function(){function h(){}return h.readLocalTheme=function(){return new Promise((function(e,t){i.readFile("./src/theme.json",{flag:"a+"},(function(o,r){if(o)return t(o);var i=r.length?JSON.parse(r.toString()):{};e(new s(i))}))}))},h.readSettingsFile=function(){return new Promise((function(e){var t=n().serverRuntimeConfig.SETTINGS;i.readFile(t,{flag:"a+"},(function(t,o){if(t)return console.error("SETTINGS FILE READ ERROR!!!"),console.error(t),e(null);var r=o.length?JSON.parse(o.toString()):{};e(r)}))}))},h.getLocalSettings=function(o){return e(this,void 0,void 0,(function(){var e,r,i,n,s,a;return t(this,(function(t){switch(t.label){case 0:return c.storefrontId?[4,v.getStorefront({id:c.storefrontId})]:(console.error("Missing storefrontId in the config.json file!"),[2,null]);case 1:return(e=t.sent()).isSuccess&&e.data?(r=e.data,[4,h.readLocalTheme()]):[2,null];case 2:return i=t.sent(),n=h.createColorScript(i.settings),s=h.createFontScript(i.settings),a=[],n&&a.push(n),s&&a.push(s),[2,{storefront:r,themeLocalization:new p({themeJson:i}),salesChannel:new l({id:r.salesChannelId}),routing:r.routings.length?r.routings.find((function(e){return e.locale===o||e.id===o}))||r.routings[0]:new m({}),favicon:i.settings.favicon,stockPreference:i.settings.stockPreference,storefrontJSScripts:a,domain:"",productBackInStockSettings:{customerLoginRequired:!0},customerReviewSettings:{customerLoginRequired:!0,customerPurchaseRequired:!1}}]}}))}))},h.getProdSettings=function(o){return e(this,void 0,void 0,(function(){var r=this;return t(this,(function(n){return[2,new Promise((function(n){return e(r,void 0,void 0,(function(){var e,r,s,a,m,c,u,f,g,v;return t(this,(function(t){switch(t.label){case 0:return[4,h.readSettingsFile()];case 1:return(e=t.sent())&&e.localizationMap?(r=new d(e.storefront),s=new l(e.salesChannel),a=e.localizationMap,m=e.storefrontJSScripts||[],c=e.domain,u=e.productBackInStockSettings?{customerLoginRequired:e.productBackInStockSettings.customerLoginRequired}:null,f=e.customerReviewSettings?{customerLoginRequired:e.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:e.customerReviewSettings.customerPurchaseRequired||!1}:null,g=a[o],v=r.routings.find((function(e){return e.id===o||e.path===o})),g&&v?(i.readFile(g,{flag:"a+"},(function(e,t){if(e)return console.error("THEME LOCALZIATION FILE READ ERROR!!!"),console.error(e),n(null);var o=t.length?JSON.parse(t.toString()):{},i=new p(o),a=i.themeJson.settings.favicon,d=i.themeJson.settings.stockPreference;if(i.themeJson.settings){var l=h.createColorScript(i.themeJson.settings),g=h.createFontScript(i.themeJson.settings);l&&m.push(l),g&&m.push(g)}n({storefront:r,themeLocalization:i,salesChannel:s,routing:v,favicon:a,stockPreference:d,storefrontJSScripts:m,domain:c,productBackInStockSettings:u,customerReviewSettings:f})})),[2]):(console.error("THEME LOCALIZATION PATH OR ROUTING MISSING!!!"),[2,n(null)])):[2,n(null)]}}))}))}))]}))}))},h.getSettings=function(o){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return"local"===process.env.NEXT_PUBLIC_ENV?[4,this.getLocalSettings(o)]:[3,2];case 1:case 3:return[2,e.sent()];case 2:return[4,this.getProdSettings(o)]}}))}))},h.getPageData=function(i,s,d,l,m){var p,g,v;return e(this,void 0,void 0,(function(){var e,x,S,C,I,y,b,k,w,L,P,R,T,B,E,V,J,F,O,N,D,A,U,q,z,M;return t(this,(function(t){switch(t.label){case 0:return e="local"===process.env.NEXT_PUBLIC_ENV,x=!e&&m,S=n().serverRuntimeConfig,x?[3,7]:(C=i.locale)?[4,h.getSettings(C)]:[2,{props:{},notFound:!0}];case 1:return(I=t.sent())&&I.storefront.mainStorefrontThemeId&&I.storefront.salesChannelId?(y=I.storefront,b=I.themeLocalization,k=I.salesChannel,w=I.routing,L=I.favicon,P=I.stockPreference,R=I.storefrontJSScripts,T=I.domain,B=I.productBackInStockSettings,E=I.customerReviewSettings,c.storefrontId=y.id,c.storefrontRoutingId=w.id,c.storefrontThemeId=y.mainStorefrontThemeId,c.salesChannelId=y.salesChannelId,c.priceListId=w.priceListId||void 0,c.stockLocationIds=null===(p=k.stockLocations)||void 0===p?void 0:p.map((function(e){return e.id})),c.routings=y.routings,c.paymentGateways=k.paymentGateways||[],c.gtmId=y.gtmId||void 0,c.fbpId=y.fbpId||void 0,c.analytics4Id=y.analytics4Id||void 0,c.universalAnalyticsId=y.universalAnalyticsId||void 0,c.favicon=L||null,c.pickUpStockLocationIds=y.pickUpStockLocationIds&&y.pickUpStockLocationIds.length?y.pickUpStockLocationIds:null,c.stockPreference=P||null,c.storefrontJSScripts=R||[],c.domain=T,c.productBackInStockSettings=B,c.customerReviewSettings=E,(V=new u(b.themeJson,i.params,d)).possiblePageTypes=l||(d?[d]:[]),m?[3,3]:[4,V.getPageData()]):[2,{props:{},notFound:!0}];case 2:if(t.sent(),!V.page)return[2,{props:{},notFound:!0}];t.label=3;case 3:return J=m?V.theme.components.map((function(e){return e.id})):V.page.components.map((function(e){return e.componentId})),F=b.themeJson.components.filter((function(e){return m||J.includes(e.id)})),O=r(["common"],F.map((function(e){return e.dir})),!0),(d===a.CHECKOUT||m)&&O.push("checkout-page"),N=S.nextI18nConf,D=w.locale,[4,new f(D,O,e?void 0:N.localePath).read()];case 4:return A=t.sent(),c.translations=A,U={},d!==a.CHECKOUT?[3,6]:(q=null===(g=V.page)||void 0===g?void 0:g.components[0])?[4,j.listCheckoutSettings({})]:[3,6];case 5:z=t.sent(),M={buttonBgColor:q.propValues.buttonBgColor,buttonTextColor:q.propValues.buttonTextColor,buttonDisabledBgColor:q.propValues.buttonDisabledBgColor,buttonDisabledTextColor:q.propValues.buttonDisabledTextColor,primaryTextColor:q.propValues.primaryTextColor,secondaryTextColor:q.propValues.secondaryTextColor,primaryBgColor:q.propValues.primaryBgColor,secondaryBgColor:q.propValues.secondaryBgColor,borderColor:q.propValues.borderColor,cardBgColor:q.propValues.cardBgColor,errorColor:q.propValues.errorColor,errorLightColor:q.propValues.errorLightColor,warningColor:q.propValues.warningColor,warningLightColor:q.propValues.warningLightColor,successColor:q.propValues.successColor,successLightColor:q.propValues.successLightColor},U.customizationProps=M,U.returnPolicy=b.returnPolicy,U.privacyPolicy=b.privacyPolicy,U.termsOfService=b.termsOfService,U.checkoutSettingsStr=(null===(v=null==z?void 0:z.data)||void 0===v?void 0:v.length)?JSON.stringify(z.data[0]):null,t.label=6;case 6:return s?[2,{props:o(o({},V.nextPageData.props),U)}]:[2,{props:o(o({},V.nextPageData.props),U),revalidate:60}];case 7:return[2,{props:{}}];case 8:return[2]}}))}))},h.getStaticProps=function(o,r,i,n){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,h.getPageData(o,!1,r,i,n)];case 1:return[2,e.sent()]}}))}))},h.getServerSideProps=function(o,r){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,h.getPageData(o,!0,r)];case 1:return[2,e.sent()]}}))}))},h.createColorScript=function(e){if(e.colors)return"<script>".concat(e.colors.map((function(e){return'document.documentElement.style.setProperty("'.concat(e.key,'","').concat(e.color,'");')})).join("\r\n"),"<\/script> \n ")},h.createFontScript=function(e){var t=g(e.fontFamily);if(t)return'<link id="ikas-font" rel="stylesheet" href="'.concat(t,"\"> \n <style>\n body { \n font-family: '").concat(e.fontFamily.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;\n } \n </style>')},h}();export{h as IkasNextPageDataProvider};
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as o,__spreadArray as r}from'../ext/tslib/tslib.es6.js';import i from"fs";import n from"next/config.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/index.js";import"../models/data/city/index.js";import"mobx";import"../models/data/country/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/attribute-value/index.js";import"../models/data/customer/index.js";import"../models/data/customer-attribute/customer-attribute-option/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-review/index.js";import"../models/data/customer-review-summary/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/address/index.js";import"../models/data/order/adjustment/index.js";import"../models/data/order/gift-line/index.js";import"../models/data/order/invoice/index.js";import"../models/data/order/line-item/discount/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/option/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/tracking-info/index.js";import"../models/data/order/package/index.js";import"../models/data/order/payment-method/index.js";import"../models/data/order/refund/line-item/index.js";import"../models/data/order/shipping-line/index.js";import"../models/data/order/tax-line/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/product/attribute-value/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/product-attribute/index.js";import"../models/data/product-filter/index.js";import"../models/data/product-campaign/campaign/index.js";import"../models/data/product-campaign/filter/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/variant-type/variant-value/index.js";import{IkasTheme as s}from"../models/theme/theme.js";import{IkasThemePageType as a}from"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/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"../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"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasStorefront as d}from"../models/data/storefront/index.js";import{IkasSalesChannel as l}from"../models/data/sales-channel/index.js";import{IkasStorefrontRouting as m}from"../models/data/storefront/routing/index.js";import{IkasStorefrontConfig as c}from"../storefront/index.js";import{IkasPageDataProvider as u}from"./page-data-get.js";import{IkasStorefrontThemeLocalization as p}from"../models/data/storefront/theme-localization/index.js";import{I18NFileReader as f}from"../utils/i18n.js";import{getGoogleFontHref as g}from"../utils/google-fonts.js";import v from"../store/storefront/index.js";import j from"../store/checkout/index.js";var h=function(){function h(){}return h.readLocalTheme=function(){return new Promise((function(e,t){i.readFile("./src/theme.json",{flag:"a+"},(function(o,r){if(o)return t(o);var i=r.length?JSON.parse(r.toString()):{};e(new s(i))}))}))},h.readSettingsFile=function(){return new Promise((function(e){var t=n().serverRuntimeConfig.SETTINGS;i.readFile(t,{flag:"a+"},(function(t,o){if(t)return console.error("SETTINGS FILE READ ERROR!!!"),console.error(t),e(null);var r=o.length?JSON.parse(o.toString()):{};e(r)}))}))},h.getLocalSettings=function(o){return e(this,void 0,void 0,(function(){var e,r,i,n,s,a;return t(this,(function(t){switch(t.label){case 0:return c.storefrontId?[4,v.getStorefront({id:c.storefrontId})]:(console.error("Missing storefrontId in the config.json file!"),[2,null]);case 1:return(e=t.sent()).isSuccess&&e.data?(r=e.data,[4,h.readLocalTheme()]):[2,null];case 2:return i=t.sent(),n=h.createColorScript(i.settings),s=h.createFontScript(i.settings),a=[],n&&a.push(n),s&&a.push(s),[2,{storefront:r,themeLocalization:new p({themeJson:i}),salesChannel:new l({id:r.salesChannelId}),routing:r.routings.length?r.routings.find((function(e){return e.locale===o||e.id===o}))||r.routings[0]:new m({}),favicon:i.settings.favicon,stockPreference:i.settings.stockPreference,storefrontJSScripts:a,domain:"",productBackInStockSettings:{customerLoginRequired:!0},customerReviewSettings:{customerLoginRequired:!0,customerPurchaseRequired:!1}}]}}))}))},h.getProdSettings=function(o){return e(this,void 0,void 0,(function(){var r=this;return t(this,(function(n){return[2,new Promise((function(n){return e(r,void 0,void 0,(function(){var e,r,s,a,m,c,u,f,g,v;return t(this,(function(t){switch(t.label){case 0:return[4,h.readSettingsFile()];case 1:return(e=t.sent())&&e.localizationMap?(r=new d(e.storefront),s=new l(e.salesChannel),a=e.localizationMap,m=e.storefrontJSScripts||[],c=e.domain,u=e.productBackInStockSettings?{customerLoginRequired:e.productBackInStockSettings.customerLoginRequired}:null,f=e.customerReviewSettings?{customerLoginRequired:e.customerReviewSettings.customerLoginRequired||!1,customerPurchaseRequired:e.customerReviewSettings.customerPurchaseRequired||!1}:null,g=a[o],v=r.routings.find((function(e){return e.id===o||e.path===o})),g&&v?(i.readFile(g,{flag:"a+"},(function(e,t){if(e)return console.error("THEME LOCALZIATION FILE READ ERROR!!!"),console.error(e),n(null);var o=t.length?JSON.parse(t.toString()):{},i=new p(o),a=i.themeJson.settings.favicon,d=i.themeJson.settings.stockPreference;if(i.themeJson.settings){var l=h.createColorScript(i.themeJson.settings),g=h.createFontScript(i.themeJson.settings);l&&m.push(l),g&&m.push(g)}n({storefront:r,themeLocalization:i,salesChannel:s,routing:v,favicon:a,stockPreference:d,storefrontJSScripts:m,domain:c,productBackInStockSettings:u,customerReviewSettings:f})})),[2]):(console.error("THEME LOCALIZATION PATH OR ROUTING MISSING!!!"),[2,n(null)])):[2,n(null)]}}))}))}))]}))}))},h.getSettings=function(o){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return"local"===process.env.NEXT_PUBLIC_ENV?[4,this.getLocalSettings(o)]:[3,2];case 1:case 3:return[2,e.sent()];case 2:return[4,this.getProdSettings(o)]}}))}))},h.getPageData=function(i,s,d,l,m){var p,g,v;return e(this,void 0,void 0,(function(){var e,x,S,C,y,b,I,w,P,k,L,R,T,B,E,V,J,F,O,N,D,A,q,z,M,G;return t(this,(function(t){switch(t.label){case 0:return e="local"===process.env.NEXT_PUBLIC_ENV,x=!e&&m,S=n().serverRuntimeConfig,x?[3,7]:(C=i.locale)?[4,h.getSettings(C)]:[2,{props:{},notFound:!0}];case 1:return(y=t.sent())&&y.storefront.mainStorefrontThemeId&&y.storefront.salesChannelId?(b=y.storefront,I=y.themeLocalization,w=y.salesChannel,P=y.routing,k=y.favicon,L=y.stockPreference,R=y.storefrontJSScripts,T=y.domain,B=y.productBackInStockSettings,E=y.customerReviewSettings,c.storefrontId=b.id,c.storefrontRoutingId=P.id,c.storefrontThemeId=b.mainStorefrontThemeId,c.salesChannelId=b.salesChannelId,c.priceListId=P.priceListId||void 0,c.stockLocationIds=null===(p=w.stockLocations)||void 0===p?void 0:p.map((function(e){return e.id})),c.routings=b.routings,c.paymentGateways=w.paymentGateways||[],c.gtmId=b.gtmId||void 0,c.fbpId=b.fbpId||void 0,c.analytics4Id=b.analytics4Id||void 0,c.universalAnalyticsId=b.universalAnalyticsId||void 0,c.favicon=k||null,c.stockPreference=L||null,c.storefrontJSScripts=R||[],c.domain=T,c.productBackInStockSettings=B,c.customerReviewSettings=E,(V=new u(I.themeJson,i.params,d)).possiblePageTypes=l||(d?[d]:[]),m?[3,3]:[4,V.getPageData()]):[2,{props:{},notFound:!0}];case 2:if(t.sent(),!V.page)return[2,{props:{},notFound:!0}];t.label=3;case 3:return J=m?V.theme.components.map((function(e){return e.id})):V.page.components.map((function(e){return e.componentId})),F=I.themeJson.components.filter((function(e){return m||J.includes(e.id)})),O=r(["common"],F.map((function(e){return e.dir})),!0),(d===a.CHECKOUT||m)&&O.push("checkout-page"),N=S.nextI18nConf,D=P.locale,[4,new f(D,O,e?void 0:N.localePath).read()];case 4:return A=t.sent(),c.translations=A,q={},d!==a.CHECKOUT?[3,6]:(z=null===(g=V.page)||void 0===g?void 0:g.components[0])?[4,j.listCheckoutSettings({})]:[3,6];case 5:M=t.sent(),G={buttonBgColor:z.propValues.buttonBgColor,buttonTextColor:z.propValues.buttonTextColor,buttonDisabledBgColor:z.propValues.buttonDisabledBgColor,buttonDisabledTextColor:z.propValues.buttonDisabledTextColor,primaryTextColor:z.propValues.primaryTextColor,secondaryTextColor:z.propValues.secondaryTextColor,primaryBgColor:z.propValues.primaryBgColor,secondaryBgColor:z.propValues.secondaryBgColor,borderColor:z.propValues.borderColor,cardBgColor:z.propValues.cardBgColor,errorColor:z.propValues.errorColor,errorLightColor:z.propValues.errorLightColor,warningColor:z.propValues.warningColor,warningLightColor:z.propValues.warningLightColor,successColor:z.propValues.successColor,successLightColor:z.propValues.successLightColor},q.customizationProps=G,q.returnPolicy=I.returnPolicy,q.privacyPolicy=I.privacyPolicy,q.termsOfService=I.termsOfService,q.checkoutSettingsStr=(null===(v=null==M?void 0:M.data)||void 0===v?void 0:v.length)?JSON.stringify(M.data[0]):null,t.label=6;case 6:return s?[2,{props:o(o({},V.nextPageData.props),q)}]:[2,{props:o(o({},V.nextPageData.props),q),revalidate:60}];case 7:return[2,{props:{}}];case 8:return[2]}}))}))},h.getStaticProps=function(o,r,i,n){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,h.getPageData(o,!1,r,i,n)];case 1:return[2,e.sent()]}}))}))},h.getServerSideProps=function(o,r){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,h.getPageData(o,!0,r)];case 1:return[2,e.sent()]}}))}))},h.createColorScript=function(e){if(e.colors)return"<script>".concat(e.colors.map((function(e){return'document.documentElement.style.setProperty("'.concat(e.key,'","').concat(e.color,'");')})).join("\r\n"),"<\/script> \n ")},h.createFontScript=function(e){var t=g(e.fontFamily);if(t)return'<link id="ikas-font" rel="stylesheet" href="'.concat(t,"\"> \n <style>\n body { \n font-family: '").concat(e.fontFamily.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;\n } \n </style>')},h}();export{h as IkasNextPageDataProvider};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IkasTheme } from "../../../models/theme/theme";
|
|
2
|
-
import { IkasThemeComponent } from "../../../models
|
|
3
|
-
import { IkasThemeComponentProp } from "../../../models/theme/component/prop";
|
|
2
|
+
import { IkasThemeComponent, IkasThemeComponentProp } from "../../../models";
|
|
4
3
|
import { IkasThemeCustomData } from "../../../models/theme/custom-data";
|
|
5
4
|
declare type File = {
|
|
6
5
|
content: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'../../../ext/tslib/tslib.es6.js';import a from"path";import{createFile as s,deleteDirContent as r}from"../../../utils/fs.js";import{IkasThemeComponentPropType as n}from"../../../models/theme/component/prop/index.js";import o from'../../../ext/lodash/uniq.js';var c=function(){function c(){}return c.generate=function(n){return e(this,void 0,void 0,(function(){var e,i,u,m,I,k,T;return t(this,(function(t){switch(t.label){case 0:return[4,r(a.join(process.cwd(),"src","components","__generated__","types"))];case 1:t.sent(),e={content:"",imports:[],internalCustomDatas:[]},t.label=2;case 2:t.trys.push([2,5,,6]),n.customData.forEach((function(t){c.generateAllCustomDataTypes(t,e,n)})),i=0,u=0;do{i=e.internalCustomDatas.length,e.internalCustomDatas.forEach((function(t){c.generateAllCustomDataTypes(t,e,n)})),(u=e.internalCustomDatas.length)!==i&&(e.internalCustomDatas=e.internalCustomDatas.splice(i,u))}while(i!==u);return[4,p.generate(n,e)];case 3:return t.sent(),m=a.join(process.cwd(),"src","components","__generated__"),e.imports=o(e.imports),I="import {\r\n",e.imports.forEach((function(e){I+="\t".concat(e,",\r\n")})),k=(I+='} from "@ikas/storefront"\r\n\r\n')+e.content,[4,s(m,"types.ts",k)];case 4:return[2,t.sent()];case 5:return T=t.sent(),console.log(T),[2,!1];case 6:return[2]}}))}))},c.generateAllCustomDataTypes=function(e,t,a){var s=e.type===n.ENUM,r="export ".concat(s?"enum":"type"," ").concat(c.generateTypeName(e)).concat(s?"":" = ","{ \r\n"),o="};\r\n\r\n";e.type!==n.DYNAMIC_LIST&&e.type!==n.STATIC_LIST||!e.nestedData?e.type===n.ENUM&&e.enumOptions?(t.content+=r,e.enumOptions.forEach((function(e){var a=e.value;e.value&&!isNaN(parseInt(e.value))&&(a="_"+e.value),t.content+='\t"'.concat(a,'" = "').concat(null==e?void 0:e.value,'",'),t.content+="\r\n"})),t.content+=o):(t.content+=r,e.nestedData&&e.nestedData.forEach((function(e){c.genenateCustomDataType(e,t,a),t.content+="\r\n"})),t.content+=o):c.generateAllCustomDataTypes(e.nestedData[0],t,a)},c.genenateCustomDataType=function(e,t,a){var s=c.getType(e,t,a);e.key&&e.key[0].match(/^\d/)&&(e.key="_"+e.key),t.content+="\t".concat(e.key).concat(e.isRequired?"":"?",": ").concat(s).concat([n.DYNAMIC_LIST,n.STATIC_LIST].includes(e.type)?"[]":"").concat(e.type===n.ENUM?",":";")},c.getType=function(e,t,a){var s="";switch(e.type){case n.TEXT:case n.RICH_TEXT:case n.COLOR:s="string";break;case n.BOOLEAN:s="boolean";break;case n.IMAGE:s="IkasImage",t.imports.push(s);break;case n.IMAGE_LIST:s="IkasImage[]",t.imports.push("IkasImage");break;case n.LINK:s="IkasNavigationLink",t.imports.push(s);break;case n.LIST_OF_LINK:s="IkasNavigationLink[]",t.imports.push("IkasNavigationLink");break;case n.PRODUCT_DETAIL:s="IkasProductDetail",t.imports.push(s);break;case n.PRODUCT_LIST:s="IkasProductList",t.imports.push("IkasProductList");break;case n.PRODUCT_ATTRIBUTE:s="IkasProductAttribute",t.imports.push(s);break;case n.PRODUCT_ATTRIBUTE_LIST:s="IkasProductAttribute[]",t.imports.push("IkasProductAttribute");break;case n.BRAND:s="IkasBrand",t.imports.push(s);break;case n.BRAND_LIST:s="IkasBrandList",t.imports.push(s);break;case n.CATEGORY:s="IkasCategory",t.imports.push(s);break;case n.CATEGORY_LIST:s="IkasCategoryList",t.imports.push(s);break;case n.CUSTOM:var r=a.customData.find((function(t){return t.id===e.customDataId}));r&&(s=c.generateTypeName(r));break;case n.COMPONENT:s="IkasComponentRenderer",t.imports.push(s);break;case n.COMPONENT_LIST:s="IkasComponentRenderer[]",t.imports.push("IkasComponentRenderer");break;case n.BLOG:s="IkasBlog",t.imports.push(s);break;case n.BLOG_LIST:s="IkasBlogList",t.imports.push(s);break;case n.BLOG_CATEGORY:s="IkasBlogCategory",t.imports.push(s);break;case n.BLOG_CATEGORY_LIST:s="IkasBlogCategoryList",t.imports.push(s);break;case n.RAFFLE:s="IkasRaffle",t.imports.push(s);break;case n.RAFFLE_LIST:s="IkasRaffleList",t.imports.push(s);break;case n.SLIDER:s="IkasSlider",t.imports.push(s);break;case n.ENUM:s=c.generateTypeName(e),t.content.includes("export enum ".concat(s))||t.internalCustomDatas.push(e);break;case n.OBJECT:s=c.generateTypeName(e);break;case n.DYNAMIC_LIST:case n.STATIC_LIST:e.nestedData&&(e.nestedData[0].type===n.OBJECT||e.nestedData[0].type===n.ENUM?(s=c.generateTypeName(e.nestedData[0]),t.content.includes("export type ".concat(s))||t.internalCustomDatas.push(e.nestedData[0])):s=c.getType(e.nestedData[0],t,a))}return s},c.generateTypeName=function(e){if(e.typescriptName)return e.typescriptName;var t=e.name||"";return(t=(t=t.replace(/\s/g,"")).replace(/\W/g,""))[0].match(/^\d/)&&(t="_"+t),e.type===n.ENUM&&(t+="Enum"),t},c}(),p=function(){function a(){}return a.generate=function(s,r){return e(this,void 0,void 0,(function(){return t(this,(function(e){return s.components.forEach((function(e){e.props.length>0&&"checkout"!==e.id&&(r.content+="export type ".concat(a.generatePropTypeName(e),"Props = {\n"),e.props.forEach((function(e){r.content+="\t".concat(e.name,": ").concat(a.getType(e,s,r),";\n")})),r.content+="};\r\n\r\n")})),[2]}))}))},a.getType=function(e,t,a){var s="";switch(e.type){case n.TEXT:case n.RICH_TEXT:case n.COLOR:s="string";break;case n.BOOLEAN:s="boolean";break;case n.IMAGE:s="IkasImage",a.imports.push(s);break;case n.IMAGE_LIST:s="IkasImage[]",a.imports.push("IkasImage");break;case n.LINK:s="IkasNavigationLink",a.imports.push(s);break;case n.LIST_OF_LINK:s="IkasNavigationLink[]",a.imports.push("IkasNavigationLink");break;case n.PRODUCT_DETAIL:s="IkasProductDetail",a.imports.push(s);break;case n.PRODUCT_LIST:s="IkasProductList",a.imports.push("IkasProductList");break;case n.PRODUCT_ATTRIBUTE:s="IkasProductAttribute",a.imports.push(s);break;case n.PRODUCT_ATTRIBUTE_LIST:s="IkasProductAttribute[]",a.imports.push("IkasProductAttribute");break;case n.BRAND:s="IkasBrand",a.imports.push(s);break;case n.BRAND_LIST:s="IkasBrandList",a.imports.push(s);break;case n.CATEGORY:s="IkasCategory",a.imports.push(s);break;case n.CATEGORY_LIST:s="IkasCategoryList",a.imports.push(s);break;case n.CUSTOM:var r=t.customData.find((function(t){return t.id===e.customDataId}));r&&(s=c.getType(r,a,t),r.type!==n.DYNAMIC_LIST&&r.type!==n.STATIC_LIST||(s+="[]"));break;case n.COMPONENT:s="IkasComponentRenderer",a.imports.push(s);break;case n.COMPONENT_LIST:s="IkasComponentRenderer[]",a.imports.push("IkasComponentRenderer");break;case n.BLOG:s="IkasBlog",a.imports.push(s);break;case n.BLOG_LIST:s="IkasBlogList",a.imports.push(s);break;case n.BLOG_CATEGORY:s="IkasBlogCategory",a.imports.push(s);break;case n.BLOG_CATEGORY_LIST:s="IkasBlogCategoryList",a.imports.push(s);break;case n.RAFFLE:s="IkasRaffle",a.imports.push(s);break;case n.RAFFLE_LIST:s="IkasRaffleList",a.imports.push(s);break;case n.SLIDER:s="IkasSlider",a.imports.push(s)}return s},a.generatePropTypeName=function(e){if(""!==e.displayName){var t=(e.dir||"").split("-"),a="";return t.forEach((function(e,t){return a+=e.charAt(0).toUpperCase()+e.slice(1)})),a[0].match(/^\d/)&&(a="_"+a),a}},a}();export{c as CustomDataTypesGenerator,p as PropTypeGenarator};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'../../../ext/tslib/tslib.es6.js';import a from"path";import{createFile as s,deleteDirContent as r}from"../../../utils/fs.js";import"../../../models/data/blog/index.js";import"../../../models/data/brand/index.js";import"../../../models/data/cart/campaign-offer/index.js";import"../../../models/data/cart/index.js";import"../../../models/data/category/index.js";import"../../../models/data/city/index.js";import"mobx";import"../../../models/data/country/index.js";import"../../../models/data/customer/address/index.js";import"../../../models/data/customer/attribute-value/index.js";import"../../../models/data/customer/index.js";import"../../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../../models/data/customer-attribute/index.js";import"../../../models/data/customer-review/index.js";import"../../../models/data/customer-review-summary/index.js";import"../../../models/data/district/index.js";import"../../../models/data/favorite-product/index.js";import"../../../models/data/html-meta-data/index.js";import"../../../models/data/image/index.js";import"../../../models/data/merchant-settings/index.js";import"../../../models/data/order/address/index.js";import"../../../models/data/order/adjustment/index.js";import"../../../models/data/order/gift-line/index.js";import"../../../models/data/order/invoice/index.js";import"../../../models/data/order/line-item/discount/index.js";import"../../../models/data/order/line-item/option/value/index.js";import"../../../models/data/order/line-item/option/index.js";import"../../../models/data/order/line-item/variant/index.js";import"../../../models/data/order/line-item/index.js";import"../../../models/data/order/package/tracking-info/index.js";import"../../../models/data/order/package/index.js";import"../../../models/data/order/payment-method/index.js";import"../../../models/data/order/refund/line-item/index.js";import"../../../models/data/order/shipping-line/index.js";import"../../../models/data/order/tax-line/index.js";import"../../../models/data/order/transaction/index.js";import"../../../models/data/order/index.js";import"../../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../../models/data/product-filter/index.js";import"../../../models/data/product-campaign/campaign/index.js";import"../../../models/data/product-campaign/filter/index.js";import"../../../models/data/product-option-set/index.js";import"../../../models/data/raffle/index.js";import"../../../models/data/state/index.js";import"../../../models/data/variant-type/variant-value/index.js";import"../../../models/theme/theme.js";import"../../../models/theme/page/index.js";import{IkasThemeComponentPropType as o}from"../../../models/theme/component/prop/index.js";import"../../../models/theme/page/component/prop-value/link.js";import"../../../models/ui/brand-list/index.js";import"../../../models/ui/blog-list/index.js";import"../../../models/ui/blog-category-list/index.js";import"../../../models/ui/category-list/index.js";import"../../../models/ui/product-detail/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"../../../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"../../../models/theme/settings/index.js";import"../../../models/theme/custom-data/index.js";import i from'../../../ext/lodash/uniq.js';var n=function(){function n(){}return n.generate=function(o){return e(this,void 0,void 0,(function(){var e,d,p,c,u,l,k;return t(this,(function(t){switch(t.label){case 0:return[4,r(a.join(process.cwd(),"src","components","__generated__","types"))];case 1:t.sent(),e={content:"",imports:[],internalCustomDatas:[]},t.label=2;case 2:t.trys.push([2,5,,6]),o.customData.forEach((function(t){n.generateAllCustomDataTypes(t,e,o)})),d=0,p=0;do{d=e.internalCustomDatas.length,e.internalCustomDatas.forEach((function(t){n.generateAllCustomDataTypes(t,e,o)})),(p=e.internalCustomDatas.length)!==d&&(e.internalCustomDatas=e.internalCustomDatas.splice(d,p))}while(d!==p);return[4,m.generate(o,e)];case 3:return t.sent(),c=a.join(process.cwd(),"src","components","__generated__"),e.imports=i(e.imports),u="import {\r\n",e.imports.forEach((function(e){u+="\t".concat(e,",\r\n")})),l=(u+='} from "@ikas/storefront"\r\n\r\n')+e.content,[4,s(c,"types.ts",l)];case 4:return[2,t.sent()];case 5:return k=t.sent(),console.log(k),[2,!1];case 6:return[2]}}))}))},n.generateAllCustomDataTypes=function(e,t,a){var s=e.type===o.ENUM,r="export ".concat(s?"enum":"type"," ").concat(n.generateTypeName(e)).concat(s?"":" = ","{ \r\n"),i="};\r\n\r\n";e.type!==o.DYNAMIC_LIST&&e.type!==o.STATIC_LIST||!e.nestedData?e.type===o.ENUM&&e.enumOptions?(t.content+=r,e.enumOptions.forEach((function(e){var a=e.value;e.value&&!isNaN(parseInt(e.value))&&(a="_"+e.value),t.content+='\t"'.concat(a,'" = "').concat(null==e?void 0:e.value,'",'),t.content+="\r\n"})),t.content+=i):(t.content+=r,e.nestedData&&e.nestedData.forEach((function(e){n.genenateCustomDataType(e,t,a),t.content+="\r\n"})),t.content+=i):n.generateAllCustomDataTypes(e.nestedData[0],t,a)},n.genenateCustomDataType=function(e,t,a){var s=n.getType(e,t,a);e.key&&e.key[0].match(/^\d/)&&(e.key="_"+e.key),t.content+="\t".concat(e.key).concat(e.isRequired?"":"?",": ").concat(s).concat([o.DYNAMIC_LIST,o.STATIC_LIST].includes(e.type)?"[]":"").concat(e.type===o.ENUM?",":";")},n.getType=function(e,t,a){var s="";switch(e.type){case o.TEXT:case o.RICH_TEXT:case o.COLOR:s="string";break;case o.BOOLEAN:s="boolean";break;case o.IMAGE:s="IkasImage",t.imports.push(s);break;case o.IMAGE_LIST:s="IkasImage[]",t.imports.push("IkasImage");break;case o.LINK:s="IkasNavigationLink",t.imports.push(s);break;case o.LIST_OF_LINK:s="IkasNavigationLink[]",t.imports.push("IkasNavigationLink");break;case o.PRODUCT_DETAIL:s="IkasProductDetail",t.imports.push(s);break;case o.PRODUCT_LIST:s="IkasProductList",t.imports.push("IkasProductList");break;case o.PRODUCT_ATTRIBUTE:s="IkasProductAttribute",t.imports.push(s);break;case o.PRODUCT_ATTRIBUTE_LIST:s="IkasProductAttribute[]",t.imports.push("IkasProductAttribute");break;case o.BRAND:s="IkasBrand",t.imports.push(s);break;case o.BRAND_LIST:s="IkasBrandList",t.imports.push(s);break;case o.CATEGORY:s="IkasCategory",t.imports.push(s);break;case o.CATEGORY_LIST:s="IkasCategoryList",t.imports.push(s);break;case o.CUSTOM:var r=a.customData.find((function(t){return t.id===e.customDataId}));r&&(s=n.generateTypeName(r));break;case o.COMPONENT:s="IkasComponentRenderer",t.imports.push(s);break;case o.COMPONENT_LIST:s="IkasComponentRenderer[]",t.imports.push("IkasComponentRenderer");break;case o.BLOG:s="IkasBlog",t.imports.push(s);break;case o.BLOG_LIST:s="IkasBlogList",t.imports.push(s);break;case o.BLOG_CATEGORY:s="IkasBlogCategory",t.imports.push(s);break;case o.BLOG_CATEGORY_LIST:s="IkasBlogCategoryList",t.imports.push(s);break;case o.RAFFLE:s="IkasRaffle",t.imports.push(s);break;case o.RAFFLE_LIST:s="IkasRaffleList",t.imports.push(s);break;case o.SLIDER:s="IkasSlider",t.imports.push(s);break;case o.ENUM:s=n.generateTypeName(e),t.content.includes("export enum ".concat(s))||t.internalCustomDatas.push(e);break;case o.OBJECT:s=n.generateTypeName(e);break;case o.DYNAMIC_LIST:case o.STATIC_LIST:e.nestedData&&(e.nestedData[0].type===o.OBJECT||e.nestedData[0].type===o.ENUM?(s=n.generateTypeName(e.nestedData[0]),t.content.includes("export type ".concat(s))||t.internalCustomDatas.push(e.nestedData[0])):s=n.getType(e.nestedData[0],t,a))}return s},n.generateTypeName=function(e){if(e.typescriptName)return e.typescriptName;var t=e.name||"";return(t=(t=t.replace(/\s/g,"")).replace(/\W/g,""))[0].match(/^\d/)&&(t="_"+t),e.type===o.ENUM&&(t+="Enum"),t},n}(),m=function(){function a(){}return a.generate=function(s,r){return e(this,void 0,void 0,(function(){return t(this,(function(e){return s.components.forEach((function(e){e.props.length>0&&"checkout"!==e.id&&(r.content+="export type ".concat(a.generatePropTypeName(e),"Props = {\n"),e.props.forEach((function(e){r.content+="\t".concat(e.name,": ").concat(a.getType(e,s,r),";\n")})),r.content+="};\r\n\r\n")})),[2]}))}))},a.getType=function(e,t,a){var s="";switch(e.type){case o.TEXT:case o.RICH_TEXT:case o.COLOR:s="string";break;case o.BOOLEAN:s="boolean";break;case o.IMAGE:s="IkasImage",a.imports.push(s);break;case o.IMAGE_LIST:s="IkasImage[]",a.imports.push("IkasImage");break;case o.LINK:s="IkasNavigationLink",a.imports.push(s);break;case o.LIST_OF_LINK:s="IkasNavigationLink[]",a.imports.push("IkasNavigationLink");break;case o.PRODUCT_DETAIL:s="IkasProductDetail",a.imports.push(s);break;case o.PRODUCT_LIST:s="IkasProductList",a.imports.push("IkasProductList");break;case o.PRODUCT_ATTRIBUTE:s="IkasProductAttribute",a.imports.push(s);break;case o.PRODUCT_ATTRIBUTE_LIST:s="IkasProductAttribute[]",a.imports.push("IkasProductAttribute");break;case o.BRAND:s="IkasBrand",a.imports.push(s);break;case o.BRAND_LIST:s="IkasBrandList",a.imports.push(s);break;case o.CATEGORY:s="IkasCategory",a.imports.push(s);break;case o.CATEGORY_LIST:s="IkasCategoryList",a.imports.push(s);break;case o.CUSTOM:var r=t.customData.find((function(t){return t.id===e.customDataId}));r&&(s=n.getType(r,a,t),r.type!==o.DYNAMIC_LIST&&r.type!==o.STATIC_LIST||(s+="[]"));break;case o.COMPONENT:s="IkasComponentRenderer",a.imports.push(s);break;case o.COMPONENT_LIST:s="IkasComponentRenderer[]",a.imports.push("IkasComponentRenderer");break;case o.BLOG:s="IkasBlog",a.imports.push(s);break;case o.BLOG_LIST:s="IkasBlogList",a.imports.push(s);break;case o.BLOG_CATEGORY:s="IkasBlogCategory",a.imports.push(s);break;case o.BLOG_CATEGORY_LIST:s="IkasBlogCategoryList",a.imports.push(s);break;case o.RAFFLE:s="IkasRaffle",a.imports.push(s);break;case o.RAFFLE_LIST:s="IkasRaffleList",a.imports.push(s);break;case o.SLIDER:s="IkasSlider",a.imports.push(s)}return s},a.generatePropTypeName=function(e){if(""!==e.displayName){var t=(e.dir||"").split("-"),a="";return t.forEach((function(e,t){return a+=e.charAt(0).toUpperCase()+e.slice(1)})),a[0].match(/^\d/)&&(a="_"+a),a}},a}();export{n as CustomDataTypesGenerator,m as PropTypeGenarator};
|
package/build/store/base.d.ts
CHANGED
package/build/store/base.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as o,__generator as t}from'../ext/tslib/tslib.es6.js';import{configure as e,makeObservable as i,observable as r}from"mobx";import d from'../ext/lodash/sortBy.js';import s from'../ext/lodash/flatten.js';import{IkasCartStore as n}from"./cart/index.js";import{IkasCustomerStore as a}from"./customer/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/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-value/index.js";import"../models/data/customer/index.js";import"../models/data/customer-attribute/customer-attribute-option/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-review/index.js";import"../models/data/customer-review-summary/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/address/index.js";import"../models/data/order/adjustment/index.js";import"../models/data/order/gift-line/index.js";import"../models/data/order/invoice/index.js";import"../models/data/order/line-item/discount/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/option/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/tracking-info/index.js";import"../models/data/order/package/index.js";import"../models/data/order/payment-method/index.js";import"../models/data/order/refund/line-item/index.js";import"../models/data/order/shipping-line/index.js";import"../models/data/order/tax-line/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/product/attribute-value/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/product-attribute/index.js";import"../models/data/product-filter/index.js";import"../models/data/product-campaign/campaign/index.js";import"../models/data/product-campaign/filter/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/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"../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{IkasThemeSettings as m}from"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasStorefrontConfig as l}from"../storefront/index.js";import u from"./location/index.js";import p from'../ext/uuid/dist/esm-
|
|
1
|
+
import{__awaiter as o,__generator as t}from'../ext/tslib/tslib.es6.js';import{configure as e,makeObservable as i,observable as r}from"mobx";import d from'../ext/lodash/sortBy.js';import s from'../ext/lodash/flatten.js';import{IkasCartStore as n}from"./cart/index.js";import{IkasCustomerStore as a}from"./customer/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/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-value/index.js";import"../models/data/customer/index.js";import"../models/data/customer-attribute/customer-attribute-option/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-review/index.js";import"../models/data/customer-review-summary/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/address/index.js";import"../models/data/order/adjustment/index.js";import"../models/data/order/gift-line/index.js";import"../models/data/order/invoice/index.js";import"../models/data/order/line-item/discount/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/option/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/tracking-info/index.js";import"../models/data/order/package/index.js";import"../models/data/order/payment-method/index.js";import"../models/data/order/refund/line-item/index.js";import"../models/data/order/shipping-line/index.js";import"../models/data/order/tax-line/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/product/attribute-value/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/product-attribute/index.js";import"../models/data/product-filter/index.js";import"../models/data/product-campaign/campaign/index.js";import"../models/data/product-campaign/filter/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/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"../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{IkasThemeSettings as m}from"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasStorefrontConfig as l}from"../storefront/index.js";import u from"./location/index.js";import p from'../ext/uuid/dist/esm-browser/v4.js';e({enforceActions:"never"});var c=function(){function e(){this.currentPageType=null,this.localeOptions=[],this.showLocaleOptions=!1,this.currentCountryCode=null,this.localeChecked=!1,this.settingsSet=!1,this.customerStore=new a(this),this.cartStore=new n(this),i(this,{currentPageType:r,localeOptions:r,showLocaleOptions:r,currentCountryCode:r})}return e.prototype.checkLocalization=function(){return o(this,void 0,void 0,(function(){var o,e,i,r,n,a,m,c,j,x;return t(this,(function(t){switch(t.label){case 0:return this.localeChecked?[2]:void 0===typeof window?(console.warn("checkLocalization should be called on the client side!"),[2]):[4,u.getMyCountry()];case 1:return(o=t.sent()).isSuccess?(e=o.data,i=l.routings.find((function(o){return o.id===l.storefrontRoutingId})),this.currentCountryCode=e,i&&e?(r=!0,n=l.routings.find((function(o){var t;return null===(t=o.countryCodes)||void 0===t?void 0:t.includes(e)})),a=l.routings.find((function(o){var t;return!(null===(t=o.countryCodes)||void 0===t?void 0:t.length)})),n?i.id!==n.id&&(r=!1):a&&i.id!==a.id&&(r=!1),m=[],c=s(l.routings.map((function(o){return o.countryCodes||[]}))),[4,u.listCountry({iso2:{in:c}})]):[3,3]):[2];case 2:if(!(j=t.sent()).isSuccess)return[2];x=j.data||[],l.routings.map((function(o){var t;(null===(t=o.countryCodes)||void 0===t?void 0:t.length)?o.countryCodes.forEach((function(t){var i=x.find((function(o){return o.iso2===t}));m.push({id:p(),countryName:(null==i?void 0:i.native)||(null==i?void 0:i.name)||"",iso2:(null==i?void 0:i.iso2)||void 0,iso3:(null==i?void 0:i.iso3)||void 0,routing:o,isRecommended:t===e})})):m.push({id:p(),routing:o,isRecommended:!l.routings.some((function(o){var t;return null===(t=o.countryCodes)||void 0===t?void 0:t.includes(e)}))})})),this.localeOptions=d(m,"countryName"),r||(this.showLocaleOptions=!0),this.localeChecked=!0,t.label=3;case 3:return[2]}}))}))},e.prototype.setLocalization=function(o){o.routing.domain?window.location.replace("https://"+o.routing.domain):window.location.replace(window.location.origin+(o.routing.path?"/"+o.routing.path:""))},e.prototype.setSettings=function(o){this.settingsSet||new m(JSON.parse(o)).colors.map((function(o){return document.documentElement.style.setProperty(o.key,o.color)}))},e}();export{c as IkasBaseStore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e}from'../../ext/tslib/tslib.es6.js';import{makeAutoObservable as
|
|
1
|
+
import{__awaiter as t,__generator as e}from'../../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import{Analytics as i}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasStorefrontConfig as n}from"../../storefront/index.js";import o from"./api.js";var a="cartId",s=function(){function a(a){var s=this;this.cart=null,this._isLoadingCart=!1,this._isCartLoadFinished=!1,this.addItem=function(r,a,u){return void 0===u&&(u=1),t(s,void 0,void 0,(function(){var t,s,c,d,l,h,v,f,p,m,I,g;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),a.canAddToCart?[4,this.beforeCartOperationCheck()]:[2,!1];case 1:return e.sent(),this.cart&&(t=this.findExistingItem(r,a))?(null===(f=a.productOptionSet)||void 0===f||f.initOptionValues(),[2,this.changeItemQuantity(t,t.quantity+1)]):(s=this.getOptionValues(a),c=(null===(p=this.cart)||void 0===p?void 0:p.id)||localStorage.getItem("cartId"),[4,o.addItemToCart({input:{cartId:c,customerId:(null===(m=this.cart)||void 0===m?void 0:m.customerId)||(null===(I=this.baseStore.customerStore.customer)||void 0===I?void 0:I.id)||null,item:{id:null,quantity:u,variant:{id:r.id,name:a.name}},options:s.length?s:null,priceListId:n.priceListId||null,salesChannelId:n.salesChannelId,storefrontId:n.storefrontId,storefrontRoutingId:n.storefrontRoutingId,storefrontThemeId:n.storefrontThemeId}})]);case 2:return(d=e.sent()).isSuccess&&d.data?[4,this.setCart(d.data)]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.cart&&(l="".concat(this.cart.id,"-").concat(this.cart.updatedAt),(h=this.cart.orderLineItems.find((function(t){return t.variant.id})))&&i.addToCart(h,u,l,this.cart)),null===(g=a.productOptionSet)||void 0===g||g.initOptionValues(),[2,!0];case 5:return v=e.sent(),console.log(v),[2,!1];case 6:return[2]}}))}))},this.changeItemQuantity=function(r,a){return t(s,void 0,void 0,(function(){var t,s,u,c,d,l,h;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,this.beforeCartOperationCheck()];case 1:return e.sent(),[4,o.addItemToCart({input:{cartId:(null===(d=this.cart)||void 0===d?void 0:d.id)||null,customerId:(null===(l=this.cart)||void 0===l?void 0:l.customerId)||(null===(h=this.baseStore.customerStore.customer)||void 0===h?void 0:h.id)||null,item:{id:r.id,quantity:a,variant:{id:r.variant.id,name:r.variant.name}},options:this.createCartLineOptions(r),priceListId:n.priceListId||null,salesChannelId:n.salesChannelId,storefrontId:n.storefrontId,storefrontRoutingId:n.storefrontRoutingId,storefrontThemeId:n.storefrontThemeId}})];case 2:return(t=e.sent()).isSuccess&&t.data?[4,this.setCart(t.data)]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.removeCardIfEmpty(),this.cart&&(s="".concat(this.cart.id,"-").concat(this.cart.updatedAt),(u=r.quantity)>a?i.removeFromCart(r,u-a,this.cart):i.addToCart(r,a-u,s,this.cart)),[2,!0];case 5:return c=e.sent(),console.log(c),[2,!1];case 6:return[2]}}))}))},this.removeItem=function(r){return t(s,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.changeItemQuantity(r,0)];case 1:return t.sent(),[2]}}))}))},this.removeCart=function(){localStorage.removeItem("cartId"),s.cart=void 0},this.waitUntilInitialized=function(){return new Promise((function(t){var e=setInterval((function(){s.isCartLoadFinished&&(clearInterval(e),t(null))}),100)}))},this.findExistingItem=function(t,e){var r,i,n,o,a;if(!e.productOptionSetId)return null===(r=s.cart)||void 0===r?void 0:r.orderLineItems.find((function(e){return e.variant.id===t.id}));for(var u=s.getOptionValues(e),c=(null===(i=s.cart)||void 0===i?void 0:i.orderLineItems.filter((function(e){var r;return e.variant.id===t.id&&(null===(r=e.options)||void 0===r?void 0:r.length)===u.length})))||[],d=0,l=c;d<l.length;d++){var h=l[d];if(h.options){for(var v=!0,f=function(t){var r=t.values.map((function(t){return t.value})),i=null===(a=null===(o=null===(n=e.productOptionSet)||void 0===n?void 0:n.options)||void 0===o?void 0:o.find((function(e){return e.id===t.productOptionId})))||void 0===a?void 0:a.values;if(!(v=v&&r.length===(null==i?void 0:i.length)&&r.every((function(t){return null==i?void 0:i.includes(t)}))))return"break"},p=0,m=h.options;p<m.length;p++){if("break"===f(m[p]))break}if(v)return h}}},this.saveCouponCode=function(r){return t(s,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.cart?[4,o.saveCartCouponCode({cartId:this.cart.id,couponCode:r})]:[2,!1];case 1:return(t=e.sent()).isSuccess&&t.data&&(this.cart=t.data),[2,t.isSuccess]}}))}))},this.removeCardIfEmpty=function(){var t;0===(null===(t=s.cart)||void 0===t?void 0:t.itemCount)&&s.removeCart()},this.getCart=function(){return t(s,void 0,void 0,(function(){var t,r,i,n,a,s;return e(this,(function(e){switch(e.label){case 0:if(!("undefined"!=typeof localStorage))return[2];e.label=1;case 1:return e.trys.push([1,6,7,8]),this._isLoadingCart=!0,t=null===(a=this.baseStore.customerStore.customer)||void 0===a?void 0:a.id,(r=(null===(s=this.cart)||void 0===s?void 0:s.id)||localStorage.getItem("cartId"))||t?[4,o.getCartById({id:r})]:[2];case 2:return(i=e.sent()).isSuccess&&i.data?[4,this.setCart(i.data)]:[3,4];case 3:return e.sent(),[3,5];case 4:this.removeCart(),e.label=5;case 5:return[3,8];case 6:return n=e.sent(),console.log(n),[3,8];case 7:return this._isLoadingCart=!1,this._isCartLoadFinished=!0,[7];case 8:return[2]}}))}))},this.setCart=function(r){return t(s,void 0,void 0,(function(){return e(this,(function(t){return localStorage.setItem("cartId",r.id),this.cart=r,[2]}))}))},this.beforeCartOperationCheck=function(){return t(s,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t=localStorage.getItem("cartId"),!this.cart||t?[3,1]:(this.removeCart(),[3,3]);case 1:return this.cart||!t?[3,3]:[4,this.getCart()];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},this.createCartLineOptions=function(t){if(t&&t.options){for(var e=[],r=0,i=t.options;r<i.length;r++){var n=i[r],o={productOptionId:n.productOptionId,productOptionsSetId:n.productOptionsSetId,values:n.values.map((function(t){return t.value}))};e.push(o)}return e}return null},this.getOptionValues=function(t){var e,r=[];return null===(e=t.productOptionSet)||void 0===e||e.options.forEach((function(t){t.values.length&&r.push({productOptionId:t.id,productOptionsSetId:t.productOptionSetId,values:t.values})})),r},this.baseStore=a,r(this)}return Object.defineProperty(a.prototype,"isLoadingCart",{get:function(){return this._isLoadingCart},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isCartLoadFinished",{get:function(){return this._isCartLoadFinished},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkoutId",{get:function(){var t;return null===(t=this.cart)||void 0===t?void 0:t.id},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"checkoutUrl",{get:function(){if(this.checkoutId)return"/checkout?id=".concat(this.checkoutId,"&step=info")},enumerable:!1,configurable:!0}),a}();export{a as CART_LS_KEY,s as IkasCartStore};
|
|
@@ -4,17 +4,14 @@ import { QueryParams as RetrieveInstallmentInfoQueryParams } from "src/__api/mut
|
|
|
4
4
|
import { QueryParams as CheckStocksQueryParams } from "src/__api/queries/checkStocks";
|
|
5
5
|
import { QueryParams as ListCheckoutSettingsQueryParams } from "src/__api/queries/listCheckoutSettings";
|
|
6
6
|
import { QueryParams as GetAvailableShippingCountriesQueryParams } from "src/__api/queries/getAvailableShippingCountries";
|
|
7
|
-
import { QueryParams as ListStockLocationQueryParams } from "src/__api/queries/listStockLocation";
|
|
8
7
|
import { APIResponse } from "@ikas/fe-api-client";
|
|
9
8
|
import { IkasCheckoutSettings } from "src/models/data/checkout-settings";
|
|
10
9
|
import { IkasPaymentGateway } from "src/models/data/payment-gateway";
|
|
11
|
-
import { StockLocation } from "../../__api/models/StockLocation";
|
|
12
10
|
export default class CheckoutStore {
|
|
13
|
-
static createSaleTransactionWithCart(params: CreateSaleTransaction): Promise<APIResponse<
|
|
11
|
+
static createSaleTransactionWithCart(params: CreateSaleTransaction): Promise<APIResponse<import("../../__api/types").TransactionResponse> | APIResponse<undefined>>;
|
|
14
12
|
static listPaymentGateway(params: ListPaymentGatewayQueryParams): Promise<APIResponse<IkasPaymentGateway[]>>;
|
|
15
13
|
static retrieveInstallmentInfo(params: RetrieveInstallmentInfoQueryParams): Promise<APIResponse<undefined> | APIResponse<import("../../__api/types").RetrieveInstallmentInfoResponse>>;
|
|
16
14
|
static checkStocks(params: CheckStocksQueryParams): Promise<APIResponse<undefined> | APIResponse<import("../../__api/types").CheckStocksResponse>>;
|
|
17
15
|
static listCheckoutSettings(params: ListCheckoutSettingsQueryParams): Promise<APIResponse<IkasCheckoutSettings[]>>;
|
|
18
16
|
static getAvailableShippingCountries(params: GetAvailableShippingCountriesQueryParams): Promise<APIResponse<undefined> | APIResponse<string[]>>;
|
|
19
|
-
static listStockLocation(params: ListStockLocationQueryParams): Promise<APIResponse<StockLocation[]>>;
|
|
20
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as
|
|
1
|
+
import{__awaiter as t,__generator as e}from'../../ext/tslib/tslib.es6.js';import i from"../../__api/mutations/createSaleTransactionWithCart.js";import n from"../../__api/queries/listPaymentGateway.js";import r from"../../__api/mutations/retrieveInstallmentInfo.js";import s from"../../__api/queries/checkStocks.js";import o from"../../__api/queries/listCheckoutSettings.js";import a from"../../__api/queries/getAvailableShippingCountries.js";import{APIResponse as u}from'../../ext/@ikas/fe-api-client/build/utils/api.js';import'../../ext/axios/lib/axios.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{IkasCheckoutSettings as c}from"../../models/data/checkout-settings/index.js";import{IkasPaymentGateway as l}from"../../models/data/payment-gateway/index.js";var d=function(){function d(){}return d.createSaleTransactionWithCart=function(n){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,i(n)];case 1:return[2,t.sent()]}}))}))},d.listPaymentGateway=function(i){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n(i)];case 1:return t=e.sent(),[2,new u(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new l(t)})),t.graphQLErrors)]}}))}))},d.retrieveInstallmentInfo=function(i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,r(i)];case 1:return[2,t.sent()]}}))}))},d.checkStocks=function(i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,s(i)];case 1:return[2,t.sent()]}}))}))},d.listCheckoutSettings=function(i){var n;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 u(null===(n=t.data)||void 0===n?void 0:n.map((function(t){return new c(t)})),t.graphQLErrors)]}}))}))},d.getAvailableShippingCountries=function(i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,a(i)];case 1:return[2,t.sent()]}}))}))},d}();export{d as default};
|