@ikas/storefront 2.0.0-alpha.22 → 2.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
1
+ import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
@@ -1 +1 @@
1
- import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
1
+ import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
@@ -1 +1 @@
1
- import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import{IkasProductOptionSet as i}from"../../models/data/product-option-set/index.js";import d from'../../ext/graphql-tag/src/index.js';import{apollo as o}from"../apollo.js";var a,l=function(){function l(){}return l.list=function(l,r,u){return void 0===u&&(u=!1),n(this,void 0,void 0,(function(){var n,s,p,c,m;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=d(a||(a=t(["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "],["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "]))),[4,o.getClient().query({query:n,variables:{includeDeleted:u,updatedAt:{gt:r},id:{in:l}}})];case 1:return s=e.sent(),p=s.data,(c=s.errors)&&c.length?(console.log(c),[2]):[2,p.listProductOptionSet.map((function(n){return new i(n)}))];case 2:return m=e.sent(),console.log(m),[3,3];case 3:return[2]}}))}))},l}();export{l as IkasProductOptionSetAPI};
1
+ import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import{IkasProductOptionSet as i}from"../../models/data/product-option-set/index.js";import d from'../../ext/graphql-tag/src/index.js';import{apollo as a}from"../apollo.js";var l,o=function(){function o(){}return o.list=function(o,r,u){return void 0===u&&(u=!1),n(this,void 0,void 0,(function(){var n,s,p,c,m;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=d(l||(l=t(["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n minRelativeNextDate\n maxRelativeNextDate\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "],["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n minRelativeNextDate\n maxRelativeNextDate\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "]))),[4,a.getClient().query({query:n,variables:{includeDeleted:u,updatedAt:{gt:r},id:{in:o}}})];case 1:return s=e.sent(),p=s.data,(c=s.errors)&&c.length?(console.log(c),[2]):[2,p.listProductOptionSet.map((function(n){return new i(n)}))];case 2:return m=e.sent(),console.log(m),[3,3];case 3:return[2]}}))}))},o}();export{o as IkasProductOptionSetAPI};
@@ -1 +1 @@
1
- import e from'../../../../ext/style-inject/dist/style-inject.es.js';var t={CartSummary:"style-module_CartSummary__30RcF",AllowExpand:"style-module_AllowExpand__3kDXF",ExpandHeader:"style-module_ExpandHeader__2ICjA",Left:"style-module_Left__A54sv",Price:"style-module_Price__sosrJ",PriceText:"style-module_PriceText__1ePGb",ArrowDown:"style-module_ArrowDown__2ET-d",Rotated:"style-module_Rotated__3sgbm",DetailsContainer:"style-module_DetailsContainer__FBBIP",Details:"style-module_Details__3-X_i",Divider:"style-module_Divider__2d0Zk",ActionTextBtn:"style-module_ActionTextBtn__FXJQX",NoUnderline:"style-module_NoUnderline__34-1r",Light:"style-module_Light__WFzH8",SubTotalInfo:"style-module_SubTotalInfo__1QMnr",InfoRow:"style-module_InfoRow__3eZdJ",Label:"style-module_Label__3E7LF",TotalContainer:"style-module_TotalContainer__36DNt",TitleContainer:"style-module_TitleContainer__3ptQE",Title:"style-module_Title__16M5E",TotalPrice:"style-module_TotalPrice__2s7DC",AppliedCoupon:"style-module_AppliedCoupon__37qv8",CouponCode:"style-module_CouponCode__3rgOu",ClearCoupon:"style-module_ClearCoupon__1Rx4A",NotificationContainer:"style-module_NotificationContainer__Zblek",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__zQQjd",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__kTFTx",Success:"style-module_Success__2vqWA",GiftLabel:"style-module_GiftLabel__2f-wC",PoweredBy:"style-module_PoweredBy__1hgWQ"};e("@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n}\n.style-module_CartSummary__30RcF.style-module_AllowExpand__3kDXF {\n border-top: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA {\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Left__A54sv {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Price__sosrJ {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Price__sosrJ .style-module_PriceText__1ePGb {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Price__sosrJ .style-module_ArrowDown__2ET-d {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Price__sosrJ .style-module_ArrowDown__2ET-d.style-module_Rotated__3sgbm {\n transform: rotate(-180deg);\n}\n.style-module_CartSummary__30RcF .style-module_DetailsContainer__FBBIP {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_DetailsContainer__FBBIP {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n.style-module_CartSummary__30RcF .style-module_Details__3-X_i {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_Details__3-X_i {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__30RcF .style-module_Divider__2d0Zk {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__30RcF .style-module_ActionTextBtn__FXJQX {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__30RcF .style-module_ActionTextBtn__FXJQX:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__30RcF .style-module_ActionTextBtn__FXJQX.style-module_NoUnderline__34-1r:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__30RcF .style-module_ActionTextBtn__FXJQX.style-module_Light__WFzH8 {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__30RcF .style-module_SubTotalInfo__1QMnr {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__30RcF .style-module_SubTotalInfo__1QMnr .style-module_InfoRow__3eZdJ {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__30RcF .style-module_SubTotalInfo__1QMnr .style-module_InfoRow__3eZdJ .style-module_Label__3E7LF {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__30RcF .style-module_SubTotalInfo__1QMnr .style-module_InfoRow__3eZdJ:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__30RcF .style-module_TotalContainer__36DNt {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 12px;\n}\n.style-module_CartSummary__30RcF .style-module_TotalContainer__36DNt .style-module_TitleContainer__3ptQE .style-module_Title__16M5E {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__30RcF .style-module_TotalContainer__36DNt .style-module_TotalPrice__2s7DC {\n font-size: 20px;\n font-weight: 600;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_TotalContainer__36DNt {\n height: 64px;\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__30RcF .style-module_AppliedCoupon__37qv8 {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__30RcF .style-module_AppliedCoupon__37qv8 .style-module_CouponCode__3rgOu {\n font-size: 14px;\n}\n.style-module_CartSummary__30RcF .style-module_AppliedCoupon__37qv8 .style-module_ClearCoupon__1Rx4A {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__30RcF .style-module_AppliedCoupon__37qv8 .style-module_ClearCoupon__1Rx4A svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__30RcF .style-module_NotificationContainer__Zblek {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd .style-module_Title__16M5E {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd .style-module_CheckoutNoteDisplay__kTFTx {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd.style-module_Success__2vqWA {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__30RcF .style-module_GiftLabel__2f-wC {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__30RcF .style-module_GiftLabel__2f-wC span {\n margin-left: 8px;\n}\n.style-module_CartSummary__30RcF .style-module_PoweredBy__1hgWQ {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_PoweredBy__1hgWQ {\n display: flex;\n }\n}\n.style-module_CartSummary__30RcF .style-module_PoweredBy__1hgWQ span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__30RcF .style-module_PoweredBy__1hgWQ a {\n display: flex;\n align-items: center;\n}");export{t as default};
1
+ import e from'../../../../ext/style-inject/dist/style-inject.es.js';var t={CartSummary:"style-module_CartSummary__30RcF",AllowExpand:"style-module_AllowExpand__3kDXF",ExpandHeader:"style-module_ExpandHeader__2ICjA",Left:"style-module_Left__A54sv",Price:"style-module_Price__sosrJ",PriceText:"style-module_PriceText__1ePGb",ArrowDown:"style-module_ArrowDown__2ET-d",Rotated:"style-module_Rotated__3sgbm",DetailsContainer:"style-module_DetailsContainer__FBBIP",Details:"style-module_Details__3-X_i",Divider:"style-module_Divider__2d0Zk",ActionTextBtn:"style-module_ActionTextBtn__FXJQX",NoUnderline:"style-module_NoUnderline__34-1r",Light:"style-module_Light__WFzH8",SubTotalInfo:"style-module_SubTotalInfo__1QMnr",InfoRow:"style-module_InfoRow__3eZdJ",Label:"style-module_Label__3E7LF",Value:"style-module_Value__3mBvk",TotalContainer:"style-module_TotalContainer__36DNt",TitleContainer:"style-module_TitleContainer__3ptQE",Title:"style-module_Title__16M5E",TotalPrice:"style-module_TotalPrice__2s7DC",AppliedCoupon:"style-module_AppliedCoupon__37qv8",CouponCode:"style-module_CouponCode__3rgOu",ClearCoupon:"style-module_ClearCoupon__1Rx4A",NotificationContainer:"style-module_NotificationContainer__Zblek",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__zQQjd",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__kTFTx",Success:"style-module_Success__2vqWA",GiftLabel:"style-module_GiftLabel__2f-wC",PoweredBy:"style-module_PoweredBy__1hgWQ"};e("@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n}\n.style-module_CartSummary__30RcF.style-module_AllowExpand__3kDXF {\n border-top: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA {\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Left__A54sv {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Price__sosrJ {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Price__sosrJ .style-module_PriceText__1ePGb {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Price__sosrJ .style-module_ArrowDown__2ET-d {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__30RcF .style-module_ExpandHeader__2ICjA .style-module_Price__sosrJ .style-module_ArrowDown__2ET-d.style-module_Rotated__3sgbm {\n transform: rotate(-180deg);\n}\n.style-module_CartSummary__30RcF .style-module_DetailsContainer__FBBIP {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_DetailsContainer__FBBIP {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n.style-module_CartSummary__30RcF .style-module_Details__3-X_i {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_Details__3-X_i {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__30RcF .style-module_Divider__2d0Zk {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__30RcF .style-module_ActionTextBtn__FXJQX {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__30RcF .style-module_ActionTextBtn__FXJQX:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__30RcF .style-module_ActionTextBtn__FXJQX.style-module_NoUnderline__34-1r:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__30RcF .style-module_ActionTextBtn__FXJQX.style-module_Light__WFzH8 {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__30RcF .style-module_SubTotalInfo__1QMnr {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__30RcF .style-module_SubTotalInfo__1QMnr .style-module_InfoRow__3eZdJ {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__30RcF .style-module_SubTotalInfo__1QMnr .style-module_InfoRow__3eZdJ .style-module_Label__3E7LF {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_CartSummary__30RcF .style-module_SubTotalInfo__1QMnr .style-module_InfoRow__3eZdJ .style-module_Value__3mBvk {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_CartSummary__30RcF .style-module_SubTotalInfo__1QMnr .style-module_InfoRow__3eZdJ:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__30RcF .style-module_TotalContainer__36DNt {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 12px;\n}\n.style-module_CartSummary__30RcF .style-module_TotalContainer__36DNt .style-module_TitleContainer__3ptQE .style-module_Title__16M5E {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__30RcF .style-module_TotalContainer__36DNt .style-module_TotalPrice__2s7DC {\n font-size: 20px;\n font-weight: 600;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_TotalContainer__36DNt {\n height: 64px;\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__30RcF .style-module_AppliedCoupon__37qv8 {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__30RcF .style-module_AppliedCoupon__37qv8 .style-module_CouponCode__3rgOu {\n font-size: 14px;\n}\n.style-module_CartSummary__30RcF .style-module_AppliedCoupon__37qv8 .style-module_ClearCoupon__1Rx4A {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__30RcF .style-module_AppliedCoupon__37qv8 .style-module_ClearCoupon__1Rx4A svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__30RcF .style-module_NotificationContainer__Zblek {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd .style-module_Title__16M5E {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd .style-module_CheckoutNoteDisplay__kTFTx {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd.style-module_Success__2vqWA {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_CheckoutNoteContainer__zQQjd {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__30RcF .style-module_GiftLabel__2f-wC {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__30RcF .style-module_GiftLabel__2f-wC span {\n margin-left: 8px;\n}\n.style-module_CartSummary__30RcF .style-module_PoweredBy__1hgWQ {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__30RcF .style-module_PoweredBy__1hgWQ {\n display: flex;\n }\n}\n.style-module_CartSummary__30RcF .style-module_PoweredBy__1hgWQ span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__30RcF .style-module_PoweredBy__1hgWQ a {\n display: flex;\n align-items: center;\n}");export{t as default};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'../../ext/tslib/tslib.es6.js';import{makeAutoObservable as n,runInAction as i}from"mobx";import{IkasBlogMetadataTargetType as o}from"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import{IkasHTMLMetaDataTargetType as a}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import{IkasTheme as r}from"../../models/theme/theme.js";import{IkasThemePageType as s}from"../../models/theme/page/index.js";import{IkasThemePageComponent as d}from"../../models/theme/page/component/index.js";import{IkasThemeComponent as p}from"../../models/theme/component/index.js";import{IkasThemeComponentPropType as u}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/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 l}from"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasPageDataProvider as c}from"../../providers/page-data-get.js";import{IkasPageDataInit as m}from"../../providers/page-data-init.js";import{IkasBlogAPI as h}from"../../api/blog/index.js";import"../../api/brand/index.js";import"../../api/cart/index.js";import"../../api/category/index.js";import"../../api/checkout/index.js";import"../../api/city/index.js";import"../../api/country/index.js";import"../../api/customer/index.js";import"../../api/customer-review/index.js";import"../../api/district/index.js";import{IkasHTMLMetaDataAPI as g}from"../../api/html-meta-data/index.js";import"../../api/merchant/index.js";import{IkasProductSearchAPI as f}from"../../api/product-search/index.js";import{apollo as E}from"../../api/apollo.js";import"../../api/favorite-product/index.js";import"../../api/contact-form/index.js";import"../../api/state/index.js";import"../../api/product-option-set/index.js";import{IkasRaffleAPI as P}from"../../api/raffle/index.js";import"../../api/back-in-stock-reminder/index.js";import{IkasStorefrontConfig as v}from"../../storefront/index.js";import{IkasStorefront as O}from"../../models/data/storefront/index.js";var T,C=function(){function C(f){var C=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.startMessaging=function(){window.addEventListener("message",C.onMessage,!1),C.sendMessage(T.FRAME_DID_LOAD,"2.0.0")},this.onMessage=function(n){return e(C,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:switch(e=n.data.type,i=n.data.data,e){case T.UPDATE_FRAME_DATA:return[3,1];case T.UPDATE_THEME_JSON:return[3,3];case T.UPDATE_PROP_VALUE:return[3,5];case T.UPDATE_PAGE_PARAMS:return[3,7];case T.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case T.ADD_COMPONENT:return[3,11];case T.DELETE_COMPONENT:return[3,12];case T.UPDATE_COMPONENT:return[3,13];case T.ADD_PAGE_COMPONENT:return[3,14];case T.DELETE_PAGE_COMPONENT:return[3,16];case T.SET_SELECTED_COMPONENT:return[3,17];case T.SET_HOVERED_COMPONENT:return[3,18];case T.SCROLL_TO_COMPONENT:return[3,19];case T.UPDATE_THEME_SETTINGS:return[3,20]}return[3,21];case 1:return[4,this.handleUpdateFrameData(i)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,22];case 3:return[4,this.handleUpdateThemeJson(i)];case 5:return[4,this.handleUpdatePropValue(i)];case 7:return[4,this.handleUpdatePageParams(i)];case 9:return[4,this.handleUpdatePageComponentOrder(i)];case 11:return this.handleAddNewComponent(i),[3,22];case 12:return this.handleDeleteComponent(i),[3,22];case 13:return this.handleUpdateComponent(i),[3,22];case 14:return[4,this.handleAddNewPageComponent(i)];case 16:return this.handleDeletePageComponent(i),[3,22];case 17:return this.handleSetSelectedComponent(i),[3,22];case 18:return this.handleSetHoveredComponent(i),[3,22];case 19:return this.handleScrollToComponent(i),[3,22];case 20:return this.updateThemeSettings(i),[3,22];case 21:return[3,22];case 22:return[2]}}))}))},this.onClick=function(e){C.sendMessage(T.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){C.sendMessage(T.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){C.sendMessage(T.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(n){return e(C,void 0,void 0,(function(){var e,r,d,p,u,l,c,m,f,E=this;return t(this,(function(t){switch(t.label){case 0:return e=n.slice(1),r=e.split("?"),e=r[0],d=r[1],this.pageParams={},n.startsWith("/account/orders/")?p=s.ORDER_DETAIL:n.startsWith("/account/orders")?p=s.ORDERS:n.startsWith("/account/addresses")?p=s.ADDRESSES:n.startsWith("/account/favorite-products")?p=s.FAVORITE_PRODUCTS:n.startsWith("/account/forgot-password")?p=s.FORGOT_PASSWORD:n.startsWith("/account/login")?p=s.LOGIN:n.startsWith("/account/raffles")?p=s.RAFFLE_ACCOUNT:n.startsWith("/account/recover-password")?p=s.RECOVER_PASSWORD:n.startsWith("/account/register")?p=s.REGISTER:n.startsWith("/account")?p=s.ACCOUNT:n.startsWith("/blog/")?p=s.BLOG:n.startsWith("/blog")?p=s.BLOG_INDEX:n.startsWith("/pages")?(p=s.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=n.startsWith("/raffle/")?s.RAFFLE_DETAIL:n.startsWith("/raffle")?s.RAFFLE:n.startsWith("/404")?s.NOT_FOUND:n.startsWith("/cart")?s.CART:n.startsWith("/checkout")?s.CHECKOUT:"/"===n?s.INDEX:n.startsWith("/search")?s.SEARCH:s.PRODUCT,console.log("page change",p),p!==s.PRODUCT?[3,6]:[4,g.listHTMLMetaData(e)];case 1:return(l=t.sent()).length?(c=l[0]).targetType!==a.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(c.targetId,d)]:[3,5];case 2:return u=t.sent(),this.pageParams={productId:c.targetId,variantId:u,slug:e},[3,4];case 3:if(c.targetType===a.CATEGORY)p=s.CATEGORY,this.pageParams={categoryId:c.targetId,slug:e};else{if(c.targetType!==a.BRAND)return[2];p=s.BRAND,this.pageParams={brandId:c.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==s.BLOG?[3,8]:[4,h.listBlogMetaData(e)];case 7:if(!(l=t.sent()).length)return[2];if((c=l[0]).targetType===o.BLOG)this.pageParams={blogId:c.targetId,slug:e};else{if(c.targetType!==o.BLOG_CATEGORY)return[2];p=s.BLOG_CATEGORY,this.pageParams={blogCategoryId:c.targetId,slug:e}}t.label=8;case 8:return p!==s.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData(e)];case 9:if(!(l=t.sent()).length)return[2];c=l[0],this.pageParams={raffleId:c.targetId,slug:e},t.label=10;case 10:return[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return m=t.sent(),i((function(){var e,t;v.store.currentPageType=p,E.pageDataProvider=m,p===s.CUSTOM?E.page=null===(e=E.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===E.pageParams.slug})):E.page=null===(t=E.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(T.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(f=this.pageDataProvider)||void 0===f?void 0:f.pageSpecificData)||null}),[2]}}))}))},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(n,i,o){return e(C,void 0,void 0,(function(){var e,a,r;return t(this,(function(t){switch(t.label){case 0:return e=new c(n,o,i),(o.blogId||o.blogCategoryId)&&(e.possiblePageTypes=[s.BLOG,s.BLOG_CATEGORY]),o.raffleId&&(e.possiblePageTypes=[s.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData&&(m.setPageSpecificData(JSON.stringify(e.pageSpecificData),i,!0),i===s.PRODUCT&&m.pageSpecificData&&(a=m.pageSpecificData,(r=a.product.variants.find((function(e){return e.id===o.variantId})))&&(a.selectedVariantValues=r.variantValues))),e.pageComponentPropValues=m.initPropValues(JSON.stringify(e.pageComponentPropValues),this.router,JSON.stringify(n.settings),!1),[2,e]}}))}))},this.setComponentRef=function(e,t){C.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),n=t.top,i=t.bottom;return n<window.innerHeight&&i>=0&&i<window.innerHeight&&n>0},this.handleUpdateFrameData=function(n){return e(C,void 0,void 0,(function(){var e,i,o,a,s=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new r(n.theme),this.page=this.theme.pages.find((function(e){return e.id===n.selectedPage.id})),this.pageParams=n.pageParams,this.apiKey=n.apiKey,this.locale=n.locale||"en",this.translations=n.translations||void 0,this.page?((e=n.storefront)&&(i=new O(e),o=i.routings.find((function(e){return e.locale===s.locale})),v.storefrontId=i.id,v.storefrontRoutingId=null==o?void 0:o.id,i.mainStorefrontThemeId&&(v.storefrontThemeId=i.mainStorefrontThemeId),i.salesChannelId&&(v.salesChannelId=i.salesChannelId),(null==o?void 0:o.priceListId)&&(v.priceListId=o.priceListId),v.routings=i.routings,v.stockPreference=this.theme.settings.stockPreference),this.translations&&(v.translations=this.translations),v.isEditor=!0,E.createApolloClient(this.apiKey||void 0),window.editorApiKey=n.apiKey,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return a=t.sent(),this.pageDataProvider=a,this.isLoading=!1,[2]}}))}))},this.handleUpdateThemeJson=function(n){return e(C,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new r(n.theme),[2]}))}))},this.handleUpdatePropValue=function(n){return e(C,void 0,void 0,(function(){var e,o,a,r,s,d,p,l,c=this;return t(this,(function(t){switch(t.label){case 0:return e=n.propName,o=n.value,(a=null===(p=null===(d=this.selectedComponent)||void 0===d?void 0:d.props)||void 0===p?void 0:p.find((function(t){return t.name===e})))&&this.selectedPageComponent?(r=null===(l=this.pageDataProvider)||void 0===l?void 0:l.pageComponentPropValues.find((function(e){return e.pageComponent.id===c.selectedPageComponentId})),this.selectedPageComponent.propValues[e]=o,this.pageDataProvider?[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,a)]:[2]):[2];case 1:return s=t.sent(),[4,this.pageDataProvider.setLinkSlugs()];case 2:return t.sent(),i((function(){r&&(r.propValues[e]=s,a.type===u.CUSTOM?m.initCustomDataPropValue(a,s,r,c.router,c.theme.settings,!0):a.type===u.COMPONENT?m.initComponentPropValue(a,s,r,c.router,c.theme.settings,!0):a.type===u.COMPONENT_LIST?m.initComponentListPropValue(a,s,r,c.router,c.theme.settings,!0):a.type===u.PRODUCT_DETAIL?m.initProductDetailPropValue(a,s,r,c.router):a.type===u.CATEGORY?m.initCategoryPropValue(a,s,r):a.type===u.BRAND?m.initBrandPropValue(a,s,r):a.type===u.BLOG?m.initBlogPropValue(a,s,r):a.type===u.BLOG_CATEGORY?m.initBlogCategoryPropValue(a,s,r):a.type===u.RAFFLE?m.initRafflePropValue(a,s,r):a.type!==u.LINK&&a.type!==u.LIST_OF_LINK||m.initLinkPropValue(a,s,r))})),[2]}}))}))},this.handleUpdatePageParams=function(n){return e(C,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=n.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(n){return e(C,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=n.pageComponents.map((function(e){return new d(e)})):this.page.components=n.pageComponents.map((function(e){return new d(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,n=new p(e.component);null===(t=C.theme)||void 0===t||t.components.push(n)},this.handleDeleteComponent=function(e){var t,n;(null===(t=C.theme)||void 0===t?void 0:t.components)&&(C.theme.components=C.theme.components.filter((function(t){return t.id!==e.componentId})));var i=C.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];C.specification&&C.specification.components&&(C.specification.components=i),!C.specification&&(null===(n=C.page)||void 0===n?void 0:n.components)&&(C.page.components=i)},this.handleUpdateComponent=function(e){var t=C.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(C.theme.components[t]=new p(e.component))},this.handleAddNewPageComponent=function(n){return e(C,void 0,void 0,(function(){var e,o,a=this;return t(this,(function(t){switch(t.label){case 0:return e=new d(n.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return o=t.sent(),i((function(){o.component.props.filter((function(e){return e.type===u.CUSTOM})).forEach((function(e){m.initCustomDataPropValue(e,o.propValues[e.name],o,a.router,a.theme.settings,!0)})),a.pageDataProvider.pageComponentPropValues.push(o),a.pageComponents.push(e)})),[2]}}))}))},this.handleDeletePageComponent=function(e){C.specification?C.specification.components=C.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):C.page.components=C.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){C.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){C.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,n=C.componentRefs[t];n&&(C.isScrolledIntoView(n)||window.scrollTo({top:n.offsetTop,behavior:"smooth"}))},this.updateThemeSettings=function(e){var t=e.settings;C.theme&&(C.theme.settings=new l(t))},this.router=f,n(this),this.startMessaging()}return Object.defineProperty(C.prototype,"specification",{get:function(){var e,t,n,i,o,a,r,d=this,p=this.page;return(null==p?void 0:p.type)===s.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===s.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===s.BRAND&&(r=null===(n=p.specifications)||void 0===n?void 0:n.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===s.BLOG&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===s.BLOG_CATEGORY&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===s.RAFFLE_DETAIL&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(C.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}),Object.defineProperty(C.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var n;return e.id===(null===(n=t.selectedPageComponent)||void 0===n?void 0:n.componentId)}))},enumerable:!1,configurable:!0}),C.prototype.getVariantIdFromParams=function(n,i){return e(this,void 0,void 0,(function(){var e,o,a,r,s,d,p;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+i),[4,f.searchProducts({productIdList:[n],priceListId:v.priceListId,salesChannelId:v.salesChannelId})];case 1:return(null==(o=t.sent())?void 0:o.data.length)?(a=o.data[0],r=a.variantTypes.map((function(e){return e.variantType.slug})),s=[],r.forEach((function(t,n){var i=a.variantTypes[n],o=e.get(t);if(o){var r=i.variantType.values.find((function(e){return e.slug===o}));r&&s.push(r)}})),(d=a.variants.find((function(e){return e.variantValues.every((function(e){return s.some((function(t){return t.id===e.id}))}))})))?[2,d.id]:[3,3]):[2];case 2:return p=t.sent(),console.error(p),[3,3];case 3:return[2]}}))}))},C}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE"}(T||(T={}));export{T as BridgeMessageType,C as default};
1
+ import{__awaiter as e,__generator as t}from'../../ext/tslib/tslib.es6.js';import{makeAutoObservable as n,runInAction as i}from"mobx";import{IkasBlogMetadataTargetType as o}from"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import{IkasHTMLMetaDataTargetType as a}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import{IkasTheme as r}from"../../models/theme/theme.js";import{IkasThemePageType as s}from"../../models/theme/page/index.js";import{IkasThemePageComponent as d}from"../../models/theme/page/component/index.js";import{IkasThemeComponent as p}from"../../models/theme/component/index.js";import{IkasThemeComponentPropType as u}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/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 l}from"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasPageDataProvider as c}from"../../providers/page-data-get.js";import{IkasPageDataInit as m}from"../../providers/page-data-init.js";import{IkasBlogAPI as h}from"../../api/blog/index.js";import"../../api/brand/index.js";import"../../api/cart/index.js";import"../../api/category/index.js";import"../../api/checkout/index.js";import"../../api/city/index.js";import"../../api/country/index.js";import"../../api/customer/index.js";import"../../api/customer-review/index.js";import"../../api/district/index.js";import{IkasHTMLMetaDataAPI as g}from"../../api/html-meta-data/index.js";import"../../api/merchant/index.js";import{IkasProductSearchAPI as f}from"../../api/product-search/index.js";import{apollo as E}from"../../api/apollo.js";import"../../api/favorite-product/index.js";import"../../api/contact-form/index.js";import"../../api/state/index.js";import"../../api/product-option-set/index.js";import{IkasRaffleAPI as P}from"../../api/raffle/index.js";import"../../api/back-in-stock-reminder/index.js";import{IkasStorefrontConfig as v}from"../../storefront/index.js";import{IkasStorefront as O}from"../../models/data/storefront/index.js";var T,C=function(){function C(f){var C=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.startMessaging=function(){window.addEventListener("message",C.onMessage,!1),C.sendMessage(T.FRAME_DID_LOAD,"2.0.0")},this.onMessage=function(n){return e(C,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:switch(e=n.data.type,i=n.data.data,e){case T.UPDATE_FRAME_DATA:return[3,1];case T.UPDATE_THEME_JSON:return[3,3];case T.UPDATE_PROP_VALUE:return[3,5];case T.UPDATE_PAGE_PARAMS:return[3,7];case T.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case T.ADD_COMPONENT:return[3,11];case T.DELETE_COMPONENT:return[3,12];case T.UPDATE_COMPONENT:return[3,13];case T.ADD_PAGE_COMPONENT:return[3,14];case T.DELETE_PAGE_COMPONENT:return[3,16];case T.SET_SELECTED_COMPONENT:return[3,17];case T.SET_HOVERED_COMPONENT:return[3,18];case T.SCROLL_TO_COMPONENT:return[3,19];case T.UPDATE_THEME_SETTINGS:return[3,20]}return[3,21];case 1:return[4,this.handleUpdateFrameData(i)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,22];case 3:return[4,this.handleUpdateThemeJson(i)];case 5:return[4,this.handleUpdatePropValue(i)];case 7:return[4,this.handleUpdatePageParams(i)];case 9:return[4,this.handleUpdatePageComponentOrder(i)];case 11:return this.handleAddNewComponent(i),[3,22];case 12:return this.handleDeleteComponent(i),[3,22];case 13:return this.handleUpdateComponent(i),[3,22];case 14:return[4,this.handleAddNewPageComponent(i)];case 16:return this.handleDeletePageComponent(i),[3,22];case 17:return this.handleSetSelectedComponent(i),[3,22];case 18:return this.handleSetHoveredComponent(i),[3,22];case 19:return this.handleScrollToComponent(i),[3,22];case 20:return this.updateThemeSettings(i),[3,22];case 21:return[3,22];case 22:return[2]}}))}))},this.onClick=function(e){C.sendMessage(T.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){C.sendMessage(T.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){C.sendMessage(T.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(n){return e(C,void 0,void 0,(function(){var e,r,d,p,u,l,c,m,f,E=this;return t(this,(function(t){switch(t.label){case 0:return e=n.slice(1),r=e.split("?"),e=r[0],d=r[1],this.pageParams={},n.startsWith("/account/orders/")?p=s.ORDER_DETAIL:n.startsWith("/account/orders")?p=s.ORDERS:n.startsWith("/account/addresses")?p=s.ADDRESSES:n.startsWith("/account/favorite-products")?p=s.FAVORITE_PRODUCTS:n.startsWith("/account/forgot-password")?p=s.FORGOT_PASSWORD:n.startsWith("/account/login")?p=s.LOGIN:n.startsWith("/account/raffles")?p=s.RAFFLE_ACCOUNT:n.startsWith("/account/recover-password")?p=s.RECOVER_PASSWORD:n.startsWith("/account/register")?p=s.REGISTER:n.startsWith("/account")?p=s.ACCOUNT:n.startsWith("/blog/")?p=s.BLOG:n.startsWith("/blog")?p=s.BLOG_INDEX:n.startsWith("/pages")?(p=s.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=n.startsWith("/raffle/")?s.RAFFLE_DETAIL:n.startsWith("/raffle")?s.RAFFLE:n.startsWith("/404")?s.NOT_FOUND:n.startsWith("/cart")?s.CART:n.startsWith("/checkout")?s.CHECKOUT:"/"===n?s.INDEX:n.startsWith("/search")?s.SEARCH:s.PRODUCT,console.log("page change",p),p!==s.PRODUCT?[3,6]:[4,g.listHTMLMetaData(e)];case 1:return(l=t.sent()).length?(c=l[0]).targetType!==a.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(c.targetId,d)]:[3,5];case 2:return u=t.sent(),this.pageParams={productId:c.targetId,variantId:u,slug:e},[3,4];case 3:if(c.targetType===a.CATEGORY)p=s.CATEGORY,this.pageParams={categoryId:c.targetId,slug:e};else{if(c.targetType!==a.BRAND)return[2];p=s.BRAND,this.pageParams={brandId:c.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==s.BLOG?[3,8]:[4,h.listBlogMetaData(e)];case 7:if(!(l=t.sent()).length)return[2];if((c=l[0]).targetType===o.BLOG)this.pageParams={blogId:c.targetId,slug:e};else{if(c.targetType!==o.BLOG_CATEGORY)return[2];p=s.BLOG_CATEGORY,this.pageParams={blogCategoryId:c.targetId,slug:e}}t.label=8;case 8:return p!==s.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData(e)];case 9:if(!(l=t.sent()).length)return[2];c=l[0],this.pageParams={raffleId:c.targetId,slug:e},t.label=10;case 10:return[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return m=t.sent(),i((function(){var e,t;v.store.currentPageType=p,E.pageDataProvider=m,p===s.CUSTOM?E.page=null===(e=E.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===E.pageParams.slug})):E.page=null===(t=E.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(T.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(f=this.pageDataProvider)||void 0===f?void 0:f.pageSpecificData)||null}),[2]}}))}))},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(n,i,o){return e(C,void 0,void 0,(function(){var e,a,r;return t(this,(function(t){switch(t.label){case 0:return e=new c(n,o,i),(o.blogId||o.blogCategoryId)&&(e.possiblePageTypes=[s.BLOG,s.BLOG_CATEGORY]),o.raffleId&&(e.possiblePageTypes=[s.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData&&(m.setPageSpecificData(JSON.stringify(e.pageSpecificData),i,!0),i===s.PRODUCT&&m.pageSpecificData&&(a=m.pageSpecificData,(r=a.product.variants.find((function(e){return e.id===o.variantId})))&&(a.selectedVariantValues=r.variantValues))),e.pageComponentPropValues=m.initPropValues(JSON.stringify(e.pageComponentPropValues),this.router,JSON.stringify(n.settings),!1),[2,e]}}))}))},this.setComponentRef=function(e,t){C.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),n=t.top,i=t.bottom;return n<window.innerHeight&&i>=0&&i<window.innerHeight&&n>0},this.handleUpdateFrameData=function(n){return e(C,void 0,void 0,(function(){var e,i,o,a,s=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new r(n.theme),this.page=this.theme.pages.find((function(e){return e.id===n.selectedPage.id})),this.pageParams=n.pageParams,this.apiKey=n.apiKey,this.locale=n.locale||"en",this.translations=n.translations||void 0,this.page?((e=n.storefront)&&(i=new O(e),o=i.routings.find((function(e){return e.locale===s.locale})),v.storefrontId=i.id,v.storefrontRoutingId=null==o?void 0:o.id,i.mainStorefrontThemeId&&(v.storefrontThemeId=i.mainStorefrontThemeId),i.salesChannelId&&(v.salesChannelId=i.salesChannelId),(null==o?void 0:o.priceListId)?v.priceListId=o.priceListId:v.priceListId=void 0,v.routings=i.routings,v.stockPreference=this.theme.settings.stockPreference),this.translations&&(v.translations=this.translations),v.isEditor=!0,E.createApolloClient(this.apiKey||void 0),window.editorApiKey=n.apiKey,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return a=t.sent(),this.pageDataProvider=a,this.isLoading=!1,[2]}}))}))},this.handleUpdateThemeJson=function(n){return e(C,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new r(n.theme),[2]}))}))},this.handleUpdatePropValue=function(n){return e(C,void 0,void 0,(function(){var e,o,a,r,s,d,p,l,c=this;return t(this,(function(t){switch(t.label){case 0:return e=n.propName,o=n.value,(a=null===(p=null===(d=this.selectedComponent)||void 0===d?void 0:d.props)||void 0===p?void 0:p.find((function(t){return t.name===e})))&&this.selectedPageComponent?(r=null===(l=this.pageDataProvider)||void 0===l?void 0:l.pageComponentPropValues.find((function(e){return e.pageComponent.id===c.selectedPageComponentId})),this.selectedPageComponent.propValues[e]=o,this.pageDataProvider?[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,a)]:[2]):[2];case 1:return s=t.sent(),[4,this.pageDataProvider.setLinkSlugs()];case 2:return t.sent(),i((function(){r&&(r.propValues[e]=s,a.type===u.CUSTOM?m.initCustomDataPropValue(a,s,r,c.router,c.theme.settings,!0):a.type===u.COMPONENT?m.initComponentPropValue(a,s,r,c.router,c.theme.settings,!0):a.type===u.COMPONENT_LIST?m.initComponentListPropValue(a,s,r,c.router,c.theme.settings,!0):a.type===u.PRODUCT_DETAIL?m.initProductDetailPropValue(a,s,r,c.router):a.type===u.CATEGORY?m.initCategoryPropValue(a,s,r):a.type===u.BRAND?m.initBrandPropValue(a,s,r):a.type===u.BLOG?m.initBlogPropValue(a,s,r):a.type===u.BLOG_CATEGORY?m.initBlogCategoryPropValue(a,s,r):a.type===u.RAFFLE?m.initRafflePropValue(a,s,r):a.type!==u.LINK&&a.type!==u.LIST_OF_LINK||m.initLinkPropValue(a,s,r))})),[2]}}))}))},this.handleUpdatePageParams=function(n){return e(C,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=n.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(n){return e(C,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=n.pageComponents.map((function(e){return new d(e)})):this.page.components=n.pageComponents.map((function(e){return new d(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,n=new p(e.component);null===(t=C.theme)||void 0===t||t.components.push(n)},this.handleDeleteComponent=function(e){var t,n;(null===(t=C.theme)||void 0===t?void 0:t.components)&&(C.theme.components=C.theme.components.filter((function(t){return t.id!==e.componentId})));var i=C.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];C.specification&&C.specification.components&&(C.specification.components=i),!C.specification&&(null===(n=C.page)||void 0===n?void 0:n.components)&&(C.page.components=i)},this.handleUpdateComponent=function(e){var t=C.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(C.theme.components[t]=new p(e.component))},this.handleAddNewPageComponent=function(n){return e(C,void 0,void 0,(function(){var e,o,a=this;return t(this,(function(t){switch(t.label){case 0:return e=new d(n.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return o=t.sent(),i((function(){o.component.props.filter((function(e){return e.type===u.CUSTOM})).forEach((function(e){m.initCustomDataPropValue(e,o.propValues[e.name],o,a.router,a.theme.settings,!0)})),a.pageDataProvider.pageComponentPropValues.push(o),a.pageComponents.push(e)})),[2]}}))}))},this.handleDeletePageComponent=function(e){C.specification?C.specification.components=C.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):C.page.components=C.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){C.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){C.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,n=C.componentRefs[t];n&&(C.isScrolledIntoView(n)||window.scrollTo({top:n.offsetTop,behavior:"smooth"}))},this.updateThemeSettings=function(e){var t=e.settings;C.theme&&(C.theme.settings=new l(t))},this.router=f,n(this),this.startMessaging()}return Object.defineProperty(C.prototype,"specification",{get:function(){var e,t,n,i,o,a,r,d=this,p=this.page;return(null==p?void 0:p.type)===s.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===s.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===s.BRAND&&(r=null===(n=p.specifications)||void 0===n?void 0:n.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===s.BLOG&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===s.BLOG_CATEGORY&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===s.RAFFLE_DETAIL&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(C.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}),Object.defineProperty(C.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var n;return e.id===(null===(n=t.selectedPageComponent)||void 0===n?void 0:n.componentId)}))},enumerable:!1,configurable:!0}),C.prototype.getVariantIdFromParams=function(n,i){return e(this,void 0,void 0,(function(){var e,o,a,r,s,d,p;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+i),[4,f.searchProducts({productIdList:[n],priceListId:v.priceListId,salesChannelId:v.salesChannelId})];case 1:return(null==(o=t.sent())?void 0:o.data.length)?(a=o.data[0],r=a.variantTypes.map((function(e){return e.variantType.slug})),s=[],r.forEach((function(t,n){var i=a.variantTypes[n],o=e.get(t);if(o){var r=i.variantType.values.find((function(e){return e.slug===o}));r&&s.push(r)}})),(d=a.variants.find((function(e){return e.variantValues.every((function(e){return s.some((function(t){return t.id===e.id}))}))})))?[2,d.id]:[3,3]):[2];case 2:return p=t.sent(),console.error(p),[3,3];case 3:return[2]}}))}))},C}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE"}(T||(T={}));export{T as BridgeMessageType,C as default};