@ikas/bp-storefront 1.4.0-beta.95 → 1.4.0-beta.97
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/dist/functions/stores/cart/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/utils/svg.d.ts +15 -0
- package/dist/utils/svg.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as r}from"../../../packages/storefront-config/src/index.js";import{CART_LS_KEY as e,cartStore as i}from"../../../stores/cart/index.js";import{customerStore as a}from"../../../stores/customer/index.js";import{getCookieValue as o}from"../../../utils/helper.js";import{getIkasOrderDistinctItemCount as s}from"../../models/order/index.js";import{getSelectedProductVariant as u,hasProductValidOptionValues as c}from"../../models/product/index.js";import{isProductOfferAccepted as d}from"../../models/product/campaign-offer/index.js";import{initProductOptionSetValues as l}from"../../models/product/option-set/index.js";import{hasProductVariantStock as f}from"../../models/product/variant/index.js";import{waitForCustomerStoreInit as v}from"../customer/index.js";function p(t){var n,e=null===(n=t.cart)||void 0===n?void 0:n.id;if(e){var i=r.getCurrentRouting();return"".concat((null==i?void 0:i.path)?"/".concat(i.path):"","/checkout?id=").concat(e,"&step=info")}return""}function m(a,s){return t(this,arguments,void 0,function(t,a,s,d){var v,p,m,h,g,y,b,C,S,_,j,w,P,T,q,A,F;return void 0===s&&(s=1),n(this,function(n){switch(n.label){case 0:v=null!==(w=null==d?void 0:d.isPayWithIkas)&&void 0!==w&&w,n.label=1;case 1:return n.trys.push([1,10,,11]),v||!a.productOptionSetId||a.productOptionSet?c(a)?f(t)||t.sellIfOutOfStock?(p=void 0,v?[3,3]:[4,k()]):[2,{success:!1,validationError:"INSUFFICIENT_STOCK"}]:[2,{success:!1,validationError:"INVALID_PRODUCT_OPTION_VALUES"}]:[2,{success:!1,validationError:"INVALID_PRODUCT_OPTION_VALUES"}];case 2:if(n.sent(),i.cart&&(p=L(i.cart,t,a))){if(a.productOptionSet&&l(a.productOptionSet),!t.bundleSettings)return[2,I(p,p.quantity+s,a.offers,a)];if(!O())return[2,I(p,p.quantity+s,a.offers,a)]}n.label=3;case 3:return m=U(a),h=s,(null==(g=null===(P=a.salesChannels)||void 0===P?void 0:P.find(function(t){return t.id===r.salesChannelId}))?void 0:g.minQuantityPerCart)&&s<g.minQuantityPerCart&&(h=g.minQuantityPerCart),(null==g?void 0:g.maxQuantityPerCart)&&s>g.maxQuantityPerCart&&(h=g.maxQuantityPerCart),y=v?null:(null===(T=i.cart)||void 0===T?void 0:T.id)||localStorage.getItem(e),[4,import("../../api/cart/index.js")];case 4:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:y,item:{id:null!==(q=null==p?void 0:p.id)&&void 0!==q?q:null,quantity:null!==(A=null==p?void 0:p.quantity)&&void 0!==A?A:h,variant:{id:t.id,name:a.name,bundleProducts:null===(F=t.bundleSettings)||void 0===F?void 0:F.products.map(function(t){var n;return{id:t.id,productId:(null===(n=t.product)||void 0===n?void 0:n.id)||"",variantId:t.product?u(t.product).id:"",quantity:t.quantity}})}},acceptedOffers:x(a.offers),options:m.length?m:null,priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc")}}})];case 5:return b=n.sent(),v?[3,7]:b.isSuccess&&b.data?[4,E(b.data)]:[3,7];case 6:n.sent(),n.label=7;case 7:return(C=v?b.data:i.cart)?(S="".concat(C.id,"-").concat(C.updatedAt),(_=C.orderLineItems.find(function(n){return n.variant.id===t.id}))?[4,import("../../../analytics/analytics-functions/addToCart.js")]:[3,9]):[3,9];case 8:(0,n.sent().anl_addToCart)(_,s,S,C,a),n.label=9;case 9:return a.productOptionSet&&l(a.productOptionSet),[2,{success:b.isSuccess,response:b}];case 10:return j=n.sent(),console.log(j),[2,{success:!1}];case 11:return[2]}})})}function h(r){return t(this,arguments,void 0,function(t,r){return void 0===r&&(r=1),n(this,function(n){switch(n.label){case 0:return[4,m(u(t),t,r)];case 1:return[2,n.sent()]}})})}function I(e,a,s,u){return t(this,void 0,void 0,function(){var t,c,d,l,f,v;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,10,,11]),[4,k()];case 1:return n.sent(),[4,import("../../api/cart/index.js")];case 2:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:(null===(f=i.cart)||void 0===f?void 0:f.id)||null,item:{id:e.id,quantity:a,variant:{id:e.variant.id,name:e.variant.name,bundleProducts:null===(v=e.variant.bundleProducts)||void 0===v?void 0:v.map(function(t){return{id:t.id,productId:t.variant.productId||"",variantId:t.variant.id||"",quantity:t.quantity}})}},acceptedOffers:s?x(s):void 0,options:F(e),priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc")}}})];case 3:return(t=n.sent()).isSuccess&&t.data?[4,E(t.data)]:[3,5];case 4:n.sent(),n.label=5;case 5:return i.cart?(c="".concat(i.cart.id,"-").concat(i.cart.updatedAt),(d=e.quantity)>a?[4,import("../../../analytics/analytics-functions/removeFromCart.js")]:[3,7]):[3,9];case 6:return(0,n.sent().anl_removeFromCart)(e,d-a,i.cart),[3,9];case 7:return[4,import("../../../analytics/analytics-functions/addToCart.js")];case 8:(0,n.sent().anl_addToCart)(e,a-d,c,i.cart,u),n.label=9;case 9:return T(i),[2,{success:t.isSuccess,response:t}];case 10:return l=n.sent(),console.log(l),[2,{success:!1}];case 11:return[2]}})})}function g(r,e,i,a,o){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,I(e,i,a,o)];case 1:return[2,t.sent()]}})})}function y(t,n){for(var r=0,e=(null==t?void 0:t.orderAdjustments)||[];r<e.length;r++)for(var i=0,a=e[r].appliedOrderLines||[];i<a.length;i++){var o=a[i];if(o.orderLineId===n.id)return o.isAutoCreated||!1}return!1}function b(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,I(r,0)];case 1:return[2,t.sent()]}})})}function C(t){localStorage.removeItem(e),t.cart=null}function S(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){var n=setInterval(function(){r.isCartInitialLoadFinished&&(clearInterval(n),t(null))},100)})];case 1:return[2,t.sent()]}})})}function O(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("editLineID")||""}function L(t,n,r){var e;if(!r.productOptionSetId&&!n.bundleSettings)return t.orderLineItems.find(function(t){return t.variant.id===n.id});if(n.bundleSettings){var i=O();if(i)if(h=t.orderLineItems.find(function(t){return t.id===i}))return h}var a=t.orderLineItems.filter(function(t){return t.variant.id===n.id})||[];if(r.productOptionSetId)for(var o=U(r),s=a.filter(function(t){var n;return(null===(n=t.options)||void 0===n?void 0:n.length)===o.length})||[],u=0,c=s;u<c.length;u++){if((h=c[u]).options){for(var d=!0,l=function(t){var n=t.values.map(function(t){return t.value}),r=null===(e=o.find(function(n){return n.productOptionId===t.productOptionId}))||void 0===e?void 0:e.values;if(!(d=d&&n.length===(null==r?void 0:r.length)&&n.every(function(t){return null==r?void 0:r.includes(t)})))return"break"},f=0,v=h.options;f<v.length;f++){if("break"===l(v[f]))break}if(d){if(!n.bundleSettings)return h;if(j(n,h))return h}}}else if(n.bundleSettings)for(var p=0,m=a;p<m.length;p++){var h=m[p];if(j(n,h))return h}}function _(t,n){return L(t,u(n),n)}function j(t,n){var r,e=null===(r=t.bundleSettings)||void 0===r?void 0:r.products,i=n.variant.bundleProducts;return!!e&&((null==e?void 0:e.length)===(null==i?void 0:i.length)&&(null==e?void 0:e.every(function(t){return!!(null==i?void 0:i.find(function(n){return n.id===t.id&&n.quantity===t.quantity&&t.product&&n.variant.id===u(t.product).id}))})))}function w(r,e){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,import("../../api/cart/index.js")];case 1:return[4,(0,n.sent().apiSaveCartCouponCode)({cartId:r.id,couponCode:e})];case 2:return(t=n.sent()).isSuccess&&t.data&&(i.cart=t.data),[2,{success:t.isSuccess,response:t}]}})})}function P(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,w(r,null)];case 1:return[2,t.sent()]}})})}function T(t){t.cart&&0===s(t.cart)&&C(t)}function q(){return t(this,void 0,void 0,function(){var t,r,o,s,u,c;return n(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof localStorage))return[2];n.label=1;case 1:return n.trys.push([1,8,9,10]),i.isCartLoading=!0,[4,v(a)];case 2:return n.sent(),t=null===(u=a.customer)||void 0===u?void 0:u.id,(r=(null===(c=i.cart)||void 0===c?void 0:c.id)||localStorage.getItem(e))||t?[4,import("../../api/cart/index.js")]:[2];case 3:return[4,(0,n.sent().apiGetCartById)({id:r})];case 4:return(o=n.sent()).isSuccess&&o.data?[4,E(o.data)]:[3,6];case 5:return n.sent(),[3,7];case 6:if(o.isCancelled||o.isNetworkError)return[2];C(i),n.label=7;case 7:return[3,10];case 8:return s=n.sent(),console.log(s),[3,10];case 9:return i.isCartLoading=!1,i.isCartInitialLoadFinished=!0,[7];case 10:return[2]}})})}function x(t){var n=t.filter(function(t){return t.isSelected&&!d(t)}).map(function(t){return{campaignOfferId:t.campaignOfferId,campaignOfferProductId:t.campaignOfferProductId,productId:t.product.id,quantity:t.quantity,variantId:u(t.product).id}})||[];return n.length?n:void 0}function A(e,i){return t(this,arguments,void 0,function(t,e,i){var a,o,s,c,d,l,f,v,p,h,I,g,y,b,C;return void 0===i&&(i=1),n(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),a=r.salesChannelId,o=r.storefrontThemeId,a&&o?(s=u(e))?[4,m(s,e,i,{isPayWithIkas:!0})]:[2,{success:!1,error:"No variant selected"}]:[2,{success:!1,error:"Missing storefront configuration"}];case 1:return(c=t.sent()).success&&(null===(p=null===(v=c.response)||void 0===v?void 0:v.data)||void 0===p?void 0:p.id)?(d=c.response.data.id,[4,import("../../api/cart/index.js")]):[2,{success:!1,error:(null===(g=null===(I=null===(h=c.response)||void 0===h?void 0:h.graphQLErrors)||void 0===I?void 0:I[0])||void 0===g?void 0:g.message)||"Failed to create cart"}];case 2:return[4,(0,t.sent().apiCreatePayWithIkasSessionUrl)({cartId:d})];case 3:return!(l=t.sent()).data||(null===(y=l.graphQLErrors)||void 0===y?void 0:y.length)?[2,{success:!1,error:(null===(C=null===(b=l.graphQLErrors)||void 0===b?void 0:b[0])||void 0===C?void 0:C.message)||"Failed to create Pay with ikas session"}]:[2,{success:!0,payUrl:l.data.payUrl,expiresAt:l.data.expiresAt}];case 4:return f=t.sent(),console.log("error",f),[2,{success:!1,error:f instanceof Error?f.message:"Unknown error occurred"}];case 5:return[2]}})})}function E(r){return t(this,void 0,void 0,function(){return n(this,function(t){return localStorage.setItem(e,r.id),i.cart=r,[2]})})}function k(){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return t=localStorage.getItem(e),!i.cart||t?[3,1]:(C(i),[3,3]);case 1:return i.cart||!t?[3,3]:[4,q()];case 2:n.sent(),n.label=3;case 3:return[2]}})})}function F(t){if(t&&t.options){for(var n=[],r=0,e=t.options;r<e.length;r++){var i=e[r],a={productOptionId:i.productOptionId,productOptionsSetId:i.productOptionsSetId,values:i.values.map(function(t){return t.value})};n.push(a)}return n}return null}function U(t){var n,r=[],e=new Set,i=function(t){var n;e.has(t.id)||(e.add(t.id),t.values.length&&r.push({productOptionId:t.id,productOptionsSetId:t.productOptionSetId,values:t.values}),null===(n=t.childOptions)||void 0===n||n.forEach(i))};return null===(n=t.productOptionSet)||void 0===n||n.options.filter(function(t){return!t.requiredOptionId}).forEach(i),r}function Q(e){return t(this,void 0,void 0,function(){var t,a,s,u,c,d,l,f,v,p,m;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,10,,11]),[4,k()];case 1:return n.sent(),t=e.itemId?null===(v=i.cart)||void 0===v?void 0:v.orderLineItems.find(function(t){return t.id===e.itemId}):null,[4,import("../../api/cart/index.js")];case 2:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:(null===(p=i.cart)||void 0===p?void 0:p.id)||null,item:{id:e.itemId||null,quantity:e.quantity,variant:{id:e.variantId}},priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc")}}})];case 3:return(a=n.sent()).isSuccess&&a.data?(e.itemId||(s=(null===(m=i.cart)||void 0===m?void 0:m.orderLineItems.map(function(t){return t.id}))||[],u=a.data.orderLineItems.map(function(t){return t.id}),(c=u.find(function(t){return!s.includes(t)}))&&(t=a.data.orderLineItems.find(function(t){return t.id===c}))),[4,E(a.data)]):[3,5];case 4:n.sent(),n.label=5;case 5:return i.cart&&t?(d="".concat(i.cart.id,"-").concat(i.cart.updatedAt),(l=e.quantity)>e.quantity?[4,import("../../../analytics/analytics-functions/removeFromCart.js")]:[3,7]):[3,9];case 6:return(0,n.sent().anl_removeFromCart)(t,l-e.quantity,i.cart),[3,9];case 7:return[4,import("../../../analytics/analytics-functions/addToCart.js")];case 8:(0,n.sent().anl_addToCart)(t,e.quantity-l,d,i.cart),n.label=9;case 9:return T(i),[2,{success:a.isSuccess,response:a}];case 10:return f=n.sent(),console.log(f),[2,{success:!1}];case 11:return[2]}})})}function N(t){var n;return!!t.cart&&(null===(n=t.cart.orderLineItems)||void 0===n?void 0:n.length)>0}export{m as addItemToCart,h as addSelectedtedVariantToCart,g as changeCartItemQuantity,I as changeItemQuantity,A as createPayWithIkasSession,L as findExistingCartItem,_ as findExistingCartItemWithProduct,x as getAcceptedOffers,q as getCart,p as getCheckoutUrlFromCartStore,N as hasCart,y as isOrderLineItemAutoCreated,C as removeCart,P as removeCouponCode,b as removeItem,w as saveCouponCode,E as setCart,S as waitForCartStoreInit,Q as windowAddToCart};
|
|
1
|
+
import{__awaiter as t,__generator as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as r}from"../../../packages/storefront-config/src/index.js";import{CART_LS_KEY as e,cartStore as i}from"../../../stores/cart/index.js";import{customerStore as a}from"../../../stores/customer/index.js";import{getCookieValue as o}from"../../../utils/helper.js";import{getIkasOrderDistinctItemCount as s}from"../../models/order/index.js";import{getSelectedProductVariant as u,hasProductValidOptionValues as c}from"../../models/product/index.js";import{isProductOfferAccepted as d}from"../../models/product/campaign-offer/index.js";import{initProductOptionSetValues as l}from"../../models/product/option-set/index.js";import{hasProductVariantStock as f}from"../../models/product/variant/index.js";import{waitForCustomerStoreInit as v}from"../customer/index.js";function p(t){var n,e=null===(n=t.cart)||void 0===n?void 0:n.id;if(e){var i=r.getCurrentRouting();return"".concat((null==i?void 0:i.path)?"/".concat(i.path):"","/checkout?id=").concat(e,"&step=info")}return""}function m(a,s){return t(this,arguments,void 0,function(t,a,s,d){var v,p,m,h,g,y,b,C,S,L,j,w,P,T,q,A,F;return void 0===s&&(s=1),n(this,function(n){switch(n.label){case 0:v=null!==(w=null==d?void 0:d.isPayWithIkas)&&void 0!==w&&w,n.label=1;case 1:return n.trys.push([1,10,,11]),v||!a.productOptionSetId||a.productOptionSet?c(a)?f(t)||t.sellIfOutOfStock?(p=void 0,v?[3,3]:[4,k()]):[2,{success:!1,validationError:"INSUFFICIENT_STOCK"}]:[2,{success:!1,validationError:"INVALID_PRODUCT_OPTION_VALUES"}]:[2,{success:!1,validationError:"INVALID_PRODUCT_OPTION_VALUES"}];case 2:if(n.sent(),i.cart&&(p=_(i.cart,t,a))){if(a.productOptionSet&&l(a.productOptionSet),!t.bundleSettings)return[2,I(p,p.quantity+s,a.offers,a)];if(!O())return[2,I(p,p.quantity+s,a.offers,a)]}n.label=3;case 3:return m=U(a),h=s,(null==(g=null===(P=a.salesChannels)||void 0===P?void 0:P.find(function(t){return t.id===r.salesChannelId}))?void 0:g.minQuantityPerCart)&&s<g.minQuantityPerCart&&(h=g.minQuantityPerCart),(null==g?void 0:g.maxQuantityPerCart)&&s>g.maxQuantityPerCart&&(h=g.maxQuantityPerCart),y=v?null:(null===(T=i.cart)||void 0===T?void 0:T.id)||localStorage.getItem(e),[4,import("../../api/cart/index.js")];case 4:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:y,item:{id:null!==(q=null==p?void 0:p.id)&&void 0!==q?q:null,quantity:null!==(A=null==p?void 0:p.quantity)&&void 0!==A?A:h,variant:{id:t.id,name:a.name,bundleProducts:null===(F=t.bundleSettings)||void 0===F?void 0:F.products.map(function(t){var n;return{id:t.id,productId:(null===(n=t.product)||void 0===n?void 0:n.id)||"",variantId:t.product?u(t.product).id:"",quantity:t.quantity}})}},acceptedOffers:x(a.offers),options:m.length?m:null,priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc"),_ga:o("_ga")}}})];case 5:return b=n.sent(),v?[3,7]:b.isSuccess&&b.data?[4,E(b.data)]:[3,7];case 6:n.sent(),n.label=7;case 7:return(C=v?b.data:i.cart)?(S="".concat(C.id,"-").concat(C.updatedAt),(L=C.orderLineItems.find(function(n){return n.variant.id===t.id}))?[4,import("../../../analytics/analytics-functions/addToCart.js")]:[3,9]):[3,9];case 8:(0,n.sent().anl_addToCart)(L,s,S,C,a),n.label=9;case 9:return a.productOptionSet&&l(a.productOptionSet),[2,{success:b.isSuccess,response:b}];case 10:return j=n.sent(),console.log(j),[2,{success:!1}];case 11:return[2]}})})}function h(r){return t(this,arguments,void 0,function(t,r){return void 0===r&&(r=1),n(this,function(n){switch(n.label){case 0:return[4,m(u(t),t,r)];case 1:return[2,n.sent()]}})})}function I(e,a,s,u){return t(this,void 0,void 0,function(){var t,c,d,l,f,v;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,10,,11]),[4,k()];case 1:return n.sent(),[4,import("../../api/cart/index.js")];case 2:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:(null===(f=i.cart)||void 0===f?void 0:f.id)||null,item:{id:e.id,quantity:a,variant:{id:e.variant.id,name:e.variant.name,bundleProducts:null===(v=e.variant.bundleProducts)||void 0===v?void 0:v.map(function(t){return{id:t.id,productId:t.variant.productId||"",variantId:t.variant.id||"",quantity:t.quantity}})}},acceptedOffers:s?x(s):void 0,options:F(e),priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc"),_ga:o("_ga")}}})];case 3:return(t=n.sent()).isSuccess&&t.data?[4,E(t.data)]:[3,5];case 4:n.sent(),n.label=5;case 5:return i.cart?(c="".concat(i.cart.id,"-").concat(i.cart.updatedAt),(d=e.quantity)>a?[4,import("../../../analytics/analytics-functions/removeFromCart.js")]:[3,7]):[3,9];case 6:return(0,n.sent().anl_removeFromCart)(e,d-a,i.cart),[3,9];case 7:return[4,import("../../../analytics/analytics-functions/addToCart.js")];case 8:(0,n.sent().anl_addToCart)(e,a-d,c,i.cart,u),n.label=9;case 9:return T(i),[2,{success:t.isSuccess,response:t}];case 10:return l=n.sent(),console.log(l),[2,{success:!1}];case 11:return[2]}})})}function g(r,e,i,a,o){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,I(e,i,a,o)];case 1:return[2,t.sent()]}})})}function y(t,n){for(var r=0,e=(null==t?void 0:t.orderAdjustments)||[];r<e.length;r++)for(var i=0,a=e[r].appliedOrderLines||[];i<a.length;i++){var o=a[i];if(o.orderLineId===n.id)return o.isAutoCreated||!1}return!1}function b(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,I(r,0)];case 1:return[2,t.sent()]}})})}function C(t){localStorage.removeItem(e),t.cart=null}function S(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){var n=setInterval(function(){r.isCartInitialLoadFinished&&(clearInterval(n),t(null))},100)})];case 1:return[2,t.sent()]}})})}function O(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("editLineID")||""}function _(t,n,r){var e;if(!r.productOptionSetId&&!n.bundleSettings)return t.orderLineItems.find(function(t){return t.variant.id===n.id});if(n.bundleSettings){var i=O();if(i)if(h=t.orderLineItems.find(function(t){return t.id===i}))return h}var a=t.orderLineItems.filter(function(t){return t.variant.id===n.id})||[];if(r.productOptionSetId)for(var o=U(r),s=a.filter(function(t){var n;return(null===(n=t.options)||void 0===n?void 0:n.length)===o.length})||[],u=0,c=s;u<c.length;u++){if((h=c[u]).options){for(var d=!0,l=function(t){var n=t.values.map(function(t){return t.value}),r=null===(e=o.find(function(n){return n.productOptionId===t.productOptionId}))||void 0===e?void 0:e.values;if(!(d=d&&n.length===(null==r?void 0:r.length)&&n.every(function(t){return null==r?void 0:r.includes(t)})))return"break"},f=0,v=h.options;f<v.length;f++){if("break"===l(v[f]))break}if(d){if(!n.bundleSettings)return h;if(j(n,h))return h}}}else if(n.bundleSettings)for(var p=0,m=a;p<m.length;p++){var h=m[p];if(j(n,h))return h}}function L(t,n){return _(t,u(n),n)}function j(t,n){var r,e=null===(r=t.bundleSettings)||void 0===r?void 0:r.products,i=n.variant.bundleProducts;return!!e&&((null==e?void 0:e.length)===(null==i?void 0:i.length)&&(null==e?void 0:e.every(function(t){return!!(null==i?void 0:i.find(function(n){return n.id===t.id&&n.quantity===t.quantity&&t.product&&n.variant.id===u(t.product).id}))})))}function w(r,e){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,import("../../api/cart/index.js")];case 1:return[4,(0,n.sent().apiSaveCartCouponCode)({cartId:r.id,couponCode:e})];case 2:return(t=n.sent()).isSuccess&&t.data&&(i.cart=t.data),[2,{success:t.isSuccess,response:t}]}})})}function P(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,w(r,null)];case 1:return[2,t.sent()]}})})}function T(t){t.cart&&0===s(t.cart)&&C(t)}function q(){return t(this,void 0,void 0,function(){var t,r,o,s,u,c;return n(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof localStorage))return[2];n.label=1;case 1:return n.trys.push([1,8,9,10]),i.isCartLoading=!0,[4,v(a)];case 2:return n.sent(),t=null===(u=a.customer)||void 0===u?void 0:u.id,(r=(null===(c=i.cart)||void 0===c?void 0:c.id)||localStorage.getItem(e))||t?[4,import("../../api/cart/index.js")]:[2];case 3:return[4,(0,n.sent().apiGetCartById)({id:r})];case 4:return(o=n.sent()).isSuccess&&o.data?[4,E(o.data)]:[3,6];case 5:return n.sent(),[3,7];case 6:if(o.isCancelled||o.isNetworkError)return[2];C(i),n.label=7;case 7:return[3,10];case 8:return s=n.sent(),console.log(s),[3,10];case 9:return i.isCartLoading=!1,i.isCartInitialLoadFinished=!0,[7];case 10:return[2]}})})}function x(t){var n=t.filter(function(t){return t.isSelected&&!d(t)}).map(function(t){return{campaignOfferId:t.campaignOfferId,campaignOfferProductId:t.campaignOfferProductId,productId:t.product.id,quantity:t.quantity,variantId:u(t.product).id}})||[];return n.length?n:void 0}function A(e,i){return t(this,arguments,void 0,function(t,e,i){var a,o,s,c,d,l,f,v,p,h,I,g,y,b,C;return void 0===i&&(i=1),n(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),a=r.salesChannelId,o=r.storefrontThemeId,a&&o?(s=u(e))?[4,m(s,e,i,{isPayWithIkas:!0})]:[2,{success:!1,error:"No variant selected"}]:[2,{success:!1,error:"Missing storefront configuration"}];case 1:return(c=t.sent()).success&&(null===(p=null===(v=c.response)||void 0===v?void 0:v.data)||void 0===p?void 0:p.id)?(d=c.response.data.id,[4,import("../../api/cart/index.js")]):[2,{success:!1,error:(null===(g=null===(I=null===(h=c.response)||void 0===h?void 0:h.graphQLErrors)||void 0===I?void 0:I[0])||void 0===g?void 0:g.message)||"Failed to create cart"}];case 2:return[4,(0,t.sent().apiCreatePayWithIkasSessionUrl)({cartId:d})];case 3:return!(l=t.sent()).data||(null===(y=l.graphQLErrors)||void 0===y?void 0:y.length)?[2,{success:!1,error:(null===(C=null===(b=l.graphQLErrors)||void 0===b?void 0:b[0])||void 0===C?void 0:C.message)||"Failed to create Pay with ikas session"}]:[2,{success:!0,payUrl:l.data.payUrl,expiresAt:l.data.expiresAt}];case 4:return f=t.sent(),console.log("error",f),[2,{success:!1,error:f instanceof Error?f.message:"Unknown error occurred"}];case 5:return[2]}})})}function E(r){return t(this,void 0,void 0,function(){return n(this,function(t){return localStorage.setItem(e,r.id),i.cart=r,[2]})})}function k(){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return t=localStorage.getItem(e),!i.cart||t?[3,1]:(C(i),[3,3]);case 1:return i.cart||!t?[3,3]:[4,q()];case 2:n.sent(),n.label=3;case 3:return[2]}})})}function F(t){if(t&&t.options){for(var n=[],r=0,e=t.options;r<e.length;r++){var i=e[r],a={productOptionId:i.productOptionId,productOptionsSetId:i.productOptionsSetId,values:i.values.map(function(t){return t.value})};n.push(a)}return n}return null}function U(t){var n,r=[],e=new Set,i=function(t){var n;e.has(t.id)||(e.add(t.id),t.values.length&&r.push({productOptionId:t.id,productOptionsSetId:t.productOptionSetId,values:t.values}),null===(n=t.childOptions)||void 0===n||n.forEach(i))};return null===(n=t.productOptionSet)||void 0===n||n.options.filter(function(t){return!t.requiredOptionId}).forEach(i),r}function Q(e){return t(this,void 0,void 0,function(){var t,a,s,u,c,d,l,f,v,p,m;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,10,,11]),[4,k()];case 1:return n.sent(),t=e.itemId?null===(v=i.cart)||void 0===v?void 0:v.orderLineItems.find(function(t){return t.id===e.itemId}):null,[4,import("../../api/cart/index.js")];case 2:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:(null===(p=i.cart)||void 0===p?void 0:p.id)||null,item:{id:e.itemId||null,quantity:e.quantity,variant:{id:e.variantId}},priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc"),_ga:o("_ga")}}})];case 3:return(a=n.sent()).isSuccess&&a.data?(e.itemId||(s=(null===(m=i.cart)||void 0===m?void 0:m.orderLineItems.map(function(t){return t.id}))||[],u=a.data.orderLineItems.map(function(t){return t.id}),(c=u.find(function(t){return!s.includes(t)}))&&(t=a.data.orderLineItems.find(function(t){return t.id===c}))),[4,E(a.data)]):[3,5];case 4:n.sent(),n.label=5;case 5:return i.cart&&t?(d="".concat(i.cart.id,"-").concat(i.cart.updatedAt),(l=e.quantity)>e.quantity?[4,import("../../../analytics/analytics-functions/removeFromCart.js")]:[3,7]):[3,9];case 6:return(0,n.sent().anl_removeFromCart)(t,l-e.quantity,i.cart),[3,9];case 7:return[4,import("../../../analytics/analytics-functions/addToCart.js")];case 8:(0,n.sent().anl_addToCart)(t,e.quantity-l,d,i.cart),n.label=9;case 9:return T(i),[2,{success:a.isSuccess,response:a}];case 10:return f=n.sent(),console.log(f),[2,{success:!1}];case 11:return[2]}})})}function N(t){var n;return!!t.cart&&(null===(n=t.cart.orderLineItems)||void 0===n?void 0:n.length)>0}export{m as addItemToCart,h as addSelectedtedVariantToCart,g as changeCartItemQuantity,I as changeItemQuantity,A as createPayWithIkasSession,_ as findExistingCartItem,L as findExistingCartItemWithProduct,x as getAcceptedOffers,q as getCart,p as getCheckoutUrlFromCartStore,N as hasCart,y as isOrderLineItemAutoCreated,C as removeCart,P as removeCouponCode,b as removeItem,w as saveCouponCode,E as setCart,S as waitForCartStoreInit,Q as windowAddToCart};
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./utils/blueprint";
|
|
|
23
23
|
export * from "./utils/component-renderer";
|
|
24
24
|
export * from "./utils/fetch";
|
|
25
25
|
export * from "./utils/object-wrapper";
|
|
26
|
+
export * from "./utils/svg";
|
|
26
27
|
export type { APIErrorCode, APIResponse } from "./storefront-api/src";
|
|
27
28
|
export * from "./storefront-api/src";
|
|
28
29
|
export * from "./storefront-config/src";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Analytics}from"./analytics/analytics.js";export{initIkasEvents}from"./analytics/events.js";export{EMPTY_STRING,NULL,UNDEFINED}from"./externals/index.js";export{apiListProductBrand}from"./functions/api/brand/index.js";export{apiListCategory}from"./functions/api/category/index.js";export{apiGetLoyaltyCustomerInfo,apiGetStorefrontWidgetSettings,apiListEarningMethods,apiListLoyaltyProgramPointHistory,apiListLoyaltyProgramTiers,apiListSpendingMethodsByCartId,apiRemoveLoyaltyPointsFromCart,apiUseLoyaltyPoints}from"./functions/api/loyalty/index.js";export{apiListStorefrontPopup}from"./functions/api/popup/index.js";export{apiSearchProducts}from"./functions/api/product/index.js";export{getAttributeDetailValues}from"./functions/models/attribute-detail/index.js";export{getAttributeListValues}from"./functions/models/attribute-list/index.js";export{createIkasBaseModel}from"./functions/models/base/index.js";export{getIkasBlogFormattedDate,getIkasBlogHref}from"./functions/models/blog/index.js";export{createIkasBlogCategory,getIkasBlogCategoryHref}from"./functions/models/blog/category/index.js";export{initIkasBlogCategory}from"./functions/models/blog/category/init.js";export{initIkasBlog}from"./functions/models/blog/init.js";export{getBlogCategoryListInitialData,getBlogCategoryListNextPage,getBlogCategoryListPage,getBlogCategoryListPageCount,getBlogCategoryListPrevPage,hasBlogCategoryListNextPage,hasBlogCategoryListPrevPage,isBlogCategoryListStatic}from"./functions/models/blog-category-list/index.js";export{initBlogCategoryList}from"./functions/models/blog-category-list/init.js";export{getBlogListInitialData,getBlogListNextPage,getBlogListPage,getBlogListPageCount,getBlogListPrevPage,hasBlogListNextPage,hasBlogListPrevPage,isBlogListStatic}from"./functions/models/blog-list/index.js";export{initBlogList}from"./functions/models/blog-list/init.js";export{getIkasBrandHref}from"./functions/models/brand/index.js";export{initIkasBrand}from"./functions/models/brand/init.js";export{getBrandListInitialData,getBrandListNextPage,getBrandListPage,getBrandListPageCount,getBrandListPrevPage,hasBrandListNextPage,hasBrandListPrevPage,isBrandListStatic}from"./functions/models/brand-list/index.js";export{initBrandList}from"./functions/models/brand-list/init.js";export{acceptProductOffer,isAcceptedProductOffer,rejectProductOffer}from"./functions/models/campaign-offer/index.js";export{getCategoryPath,getIkasCategoryHref}from"./functions/models/category/index.js";export{initIkasCategory}from"./functions/models/category/init.js";export{getCategoryListInitialData,getCategoryListNextPage,getCategoryListPage,getCategoryListPageCount,getCategoryListPrevPage,hasCategoryListNextPage,hasCategoryListPrevPage,isCategoryListStatic}from"./functions/models/category-list/index.js";export{initCategoryList}from"./functions/models/category-list/init.js";export{getIkasCategoryPathItemHref,getIkasCategoryPathItemSlug}from"./functions/models/category/path-item/index.js";export{initIkasCategoryPathItem}from"./functions/models/category/path-item/init.js";export{getCheckoutTotalFinalPrice,isCheckoutComplete}from"./functions/models/checkout/index.js";export{initIkasCountry}from"./functions/models/country/init.js";export{getCustomerBasicInfo,isCustomerSubscribed}from"./functions/models/customer/index.js";export{clearIkasCustomerAddressForm,getCustomerAddressText,getCustomerAddressValidationResult,getIkasCustomerAddressForm,isValidCustomerAddress}from"./functions/models/customer/address/index.js";export{getCustomerAttributeAccountPagePermission,getCustomerAttributeRegisterPageRequirement}from"./functions/models/customer/attribute/index.js";export{initIkasCustomerAttribute}from"./functions/models/customer/attribute/init.js";export{getIkasCustomerReviewFormattedDate}from"./functions/models/customer/review/index.js";export{initIkasCustomerReview}from"./functions/models/customer/review/init.js";export{getCustomerReviewListInitialData,getCustomerReviewListNextPage,getCustomerReviewListPage,getCustomerReviewListPageCount,getCustomerReviewListPrev,getProductCustomerReviews,hasCustomerReviewListNextPage,hasCustomerReviewListPrevPage}from"./functions/models/customer-review-list/index.js";export{initCustomerReviewList}from"./functions/models/customer-review-list/init.js";export{getCustomerReviewSummaryListInitialData,getCustomerReviewSummaryListNextPage,getCustomerReviewSummaryListPage,getCustomerReviewSummaryListPrev,hasCustomerReviewSummaryListNextPage,hasCustomerReviewSummaryListPrevPage}from"./functions/models/customer-review-summary-list/index.js";export{initCustomerReviewSummaryList}from"./functions/models/customer-review-summary-list/init.js";export{getIkasFilterCategoryHref,getIkasFilterCategorySlug}from"./functions/models/filter-category/index.js";export{initIkasHTMLMetaData,setHTMLMetaDataTranslations}from"./functions/models/html-meta-data/init.js";export{initThemeDatePicker,themeDatePickerGetDate,themeDatePickerGetDaysOfMonth,themeDatePickerGetDaysOfWeekShort,themeDatePickerGetFullYear,themeDatePickerGetHours,themeDatePickerGetMinutes,themeDatePickerGetMonth,themeDatePickerGetMonthList,themeDatePickerGetMonthName,themeDatePickerGetViewFullYear,themeDatePickerGetViewMonth,themeDatePickerGetWeekFirstDay,themeDatePickerOnChange,themeDatePickerOnDayChange,themeDatePickerOnHoursChange,themeDatePickerOnMinutesChange,themeDatePickerOnViewFullYearChange,themeDatePickerOnViewMonthChange,themeDatePickerSetViewNextMonth,themeDatePickerSetViewPrevMonth}from"./functions/models/ikas-theme/date-picker.js";export{createMediaSrcset,getDefaultSrc,getSrc,getThumbnailSrc}from"./functions/models/image/index.js";export{initIkasMerchantSettings}from"./functions/models/merchant-settings/init.js";export{getIkasOrderCouponAdjustment,getIkasOrderCustomerFullName,getIkasOrderDisplayedAdjustments,getIkasOrderDisplayedPackages,getIkasOrderDistinctItemCount,getIkasOrderFormattedDate,getIkasOrderFormattedOrderedAt,getIkasOrderFormattedShippingTotal,getIkasOrderFormattedTotalFinalPrice,getIkasOrderFormattedTotalPrice,getIkasOrderFormattedTotalTax,getIkasOrderHref,getIkasOrderNonCouponAdjustments,getIkasOrderPackageStatusTranslation,getIkasOrderProductFiles,getIkasOrderRefundableItems,getIkasOrderRefundedItems,getIkasOrderShippingTotal,getIkasOrderTotalItemCount,getIkasOrderTotalTax,getIkasOrderUnfullfilledItems,getIkasOrderVariantNames,hasIkasOrderCustomer,hasValidIkasOrderCustomerEmail,initIkasOrder,isIkasOrderRefundable}from"./functions/models/order/index.js";export{createOrderAddress,getOrderAddressText,getOrderAddressValidationResult,isValidOrderAddress}from"./functions/models/order/address/index.js";export{getOrderAdjustmentDisplayName,getOrderAdjustmentFormattedAmount,getOrderAdjustmentIsDecrement}from"./functions/models/order/adjustment/index.js";export{getOrderGiftPackageLineFormattedPrice}from"./functions/models/order/gift-package/index.js";export{editOrderLineItem,getOrderLineItemFinalPriceWithQuantity,getOrderLineItemFormattedDiscountPrice,getOrderLineItemFormattedFinalPrice,getOrderLineItemFormattedFinalPriceWithQuantity,getOrderLineItemFormattedFinalUnitPrice,getOrderLineItemFormattedOverridenPriceWithQuantity,getOrderLineItemFormattedPrice,getOrderLineItemFormattedPriceWithQuantity,getOrderLineItemFormattedTax,getOrderLineItemFormattedUnitPrice,getOrderLineItemOverridenPriceWithQuantity,getOrderLineItemPriceWithQuantity,getOrderLineItemRefundQuantity,getOrderLineItemTax,getOrderLineItemUnitPriceText,hasOrderLineItemDiscount,setOrderLineItemRefundQuantity}from"./functions/models/order/line-item/index.js";export{downloadFile,getOrderLineItemOptionValueFormattedPrice,getOrderLineOptionFileName}from"./functions/models/order/line-item/option/value/index.js";export{getIkasOrderLineVariantHref,getIkasOrderLineVariantMainImage}from"./functions/models/order/line-item/variant/index.js";export{getIkasOrderLineBundleVariantMainImage}from"./functions/models/order/line-item/variant/bundle-product/bundle-variant/index.js";export{getIkasOrderLineVariantNameSlug,getIkasOrderLineVariantTypeSlug}from"./functions/models/order/line-item/variant/value/index.js";export{getOrderTransactionFormattedAmount,getOrderTransactionPaymentMethodTranslation}from"./functions/models/order/transaction/index.js";export{getPaymentGatewayCalculatedAdditionalPrices}from"./functions/models/payment-gateway/index.js";export{initIkasPaymentGateway}from"./functions/models/payment-gateway/init.js";export{addIkasProductToFavorites,clearIkasProductCustomerReviewForm,getBundleProductFinalPrice,getBundleProductFinalPriceWithQuantity,getBundleProductFormattedFinalPrice,getBundleProductFormattedFinalPriceWithQuantity,getBundleProductFormattedSellPrice,getBundleProductFormattedSellPriceWithQuantity,getBundleProductSellPrice,getBundleProductSellPriceWithQuantity,getBundleProductsOfVariant,getDisplayedProductGroups,getDisplayedProductVariantTypes,getGroupedAttributeValues,getIkasProductCustomerReviewForm,getMainProductVariantType,getMainProductVariantValue,getProductAvailableStockLocations,getProductCampaigns,getProductCategoryPath,getProductFirstCategory,getProductHref,getProductOptionSet,getSelectedProductVariant,getSelectedProductVariantHref,hasProductStock,hasProductValidOptionValues,hasProductVariant,initBundleProducts,initProductOnBrowser,initProductOptionSet,isAddToCartEnabled,isBundleProductQuantityEditable,isCustomerReviewEnabled,isCustomerReviewLoginRequired,isFavoriteIkasProduct,removeIkasProductFromFavorites,selectVariantValue,setBundleProductQuantity,setOptionRealPrices,setProductOfBundleProduct,shouldDisplayBundleProductPrice}from"./functions/models/product/index.js";export{getProductFromStore,initIkasProduct,initIkasProductExtraFields,productVariantStore}from"./functions/models/product/init.js";export{clearProductListFilter,clearProductListFilters,enableProductListSuggestions,getProductListCurrencyCode,getProductListCurrencySymbol,getProductListFilterCategories,getProductListInitialData,getProductListNextPage,getProductListPage,getProductListPrevPage,getProductListSortOptions,getProductListSortTypeTranslation,getProductListSuggestionHref,getSelectedFilterValues,handleFilterValueClick,handleNumberRangeOptionClick,hasProductListAppliedFilters,hasProductListFeaturedSortEnabled,hasProductListNextPage,hasProductListPrevPage,initProductList,initProductListFilterCategories,initProductListOnBrowser,isProductListDiscounted,isProductListFilterable,isProductListFiltered,isProductListLastViewed,isProductListPurchasedTogether,isProductListRecommended,isProductListRelatedProducts,isProductListSearch,isProductListStatic,isProductListViewedTogether,onFilterCategoryClick,productListToggleFilterCollapsed,searchProductList,setProductListIsFilteredForProducts,setProductListIsStaticForProducts,setProductListVisiblePage,setSortType,translateProductListSortType}from"./functions/models/product-list/index.js";export{getIkasProductAttributeProducts,getIkasProductAttributeTableValue,getIkasProductAttrributeProductIds}from"./functions/models/product/attribute-value/index.js";export{initIkasProductAttributeValue}from"./functions/models/product/attribute-value/init.js";export{applyQueryParamForFilter,clearFilter,filterParseRangeStr,filterRangeToId,filterToInput,getFilterDisplayedValues,getFilterKeyList,getFilterValueList,getIkasFilterHref,getIkasFilterThumbnailImage,initIkasProductFilter,isBoxFilter,isCustomValueFilter,isListFilter,isStockFilter,isSwatchFilter,onNumberRangeFilterChange,onNumberRangeFilterOptionClick,selectFilterValue}from"./functions/models/product/filter/index.js";export{getDisplayedOptions,hasDisplayedOptions,hasValidProductOptionSetValues,initOptionValues,initProductOptionSetValues,setChildOptions}from"./functions/models/product/option-set/index.js";export{initIkasProductOptionSet}from"./functions/models/product/option-set/init.js";export{clearValues,getDisplayedChildOptions,getProductOptionFormattedLabel,getProductOptionFormattedPrice,getTextValue,hasError,hasValidProductOptionValues,initIkasProductOptionValues,isCheckboxOption,isChecked,isChoiceOption,isChoiceOptionBoxType,isChoiceOptionSelectType,isChoiceOptionSwatchType,isColorPickerOption,isDatePickerOption,isFileOption,isImageOption,isProductOptionSelectValueSelected,isTextAreaOption,isTextOption,productOptionFileUpload,selectValue,setCheckboxValue,setTextValue,setValues}from"./functions/models/product/option-set/option/index.js";export{initIkasProductOption}from"./functions/models/product/option-set/option/init.js";export{clearProductVariantBackInStockForm,getGroupedAttributeValuesForVariant,getProductVariantAppliedCampaignAmount,getProductVariantB2bPriceRule,getProductVariantBackInStockForm,getProductVariantBundlePrice,getProductVariantCampaignOffersDiscountPercentage,getProductVariantCampaignPrice,getProductVariantDiscountAmount,getProductVariantDiscountPercentage,getProductVariantDiscountPrice,getProductVariantFinalPrice,getProductVariantFinalPriceWithCampaignOffers,getProductVariantFormattedBuyPrice,getProductVariantFormattedCampaignPrice,getProductVariantFormattedDiscountAmount,getProductVariantFormattedDiscountPrice,getProductVariantFormattedFinalPrice,getProductVariantFormattedFinalPriceWithCampaignOffers,getProductVariantFormattedSellPrice,getProductVariantFormattedSellPriceWithCampaignOffers,getProductVariantIsBackInStockCustomerLoginRequired,getProductVariantIsBackInStockEnabled,getProductVariantMainImage,getProductVariantPrice,getProductVariantSellPrice,getProductVariantSellPriceWithCampaignOffers,getProductVariantUnitPriceText,hasBundleSettings,hasProductVariantDiscount,hasProductVariantStock,saveProductVariantBackInStockReminder}from"./functions/models/product/variant/index.js";export{initIkasProductVariant}from"./functions/models/product/variant/init.js";export{getIkasProductDiscountPercentage,getIkasProductPriceDiscountAmount,getIkasProductPriceFinalPrice,hasIkasProductPriceDiscount}from"./functions/models/product/variant/price/index.js";export{isRaffleAvailable}from"./functions/models/raffle/index.js";export{initIkasRaffle}from"./functions/models/raffle/init.js";export{initIkasState}from"./functions/models/state/init.js";export{getIkasVariantTypeSlug,isIkasVariantTypeColorSelection}from"./functions/models/variant-type/index.js";export{initIkasVariantType}from"./functions/models/variant-type/init.js";export{getIkasVariantValueSlug,getIkasVariantValueThumbnailImage,isColorVariantValue,isImageVariantValue,isTextVariantValue}from"./functions/models/variant-type/variant-value/index.js";export{FORM_ITEM_DEFAULT_VALUE,validateValue}from"./functions/models/validator/index.js";export{initAccountInfoForm,setAccountInfoFormFirstName,setAccountInfoFormIsMarketingAccepted,setAccountInfoFormLastName,setAccountInfoFormPhone,submitAccountInfoForm}from"./functions/models/validator/account-info/index.js";export{initAddressForm,setAddressFormAddressLine1,setAddressFormAddressLine2,setAddressFormCity,setAddressFormCompany,setAddressFormCountry,setAddressFormDistrict,setAddressFormFirstName,setAddressFormIdentityNumber,setAddressFormLastName,setAddressFormPhone,setAddressFormPostalCode,setAddressFormRegion,setAddressFormState,setAddressFormTaxNumber,setAddressFormTaxOffice,setAddressFormTitle,submitAddressForm}from"./functions/models/validator/address/index.js";export{initBackInStockNotificationForm,setBackInStockNotificationFormEmail,submitBackInStockNotificationForm}from"./functions/models/validator/back-in-stock-notification/index.js";export{initContactForm,setContactFormEmail,setContactFormFirstName,setContactFormLastName,setContactFormMessage,setContactFormPhone,submitContactForm}from"./functions/models/validator/contact-form/index.js";export{initCouponCodeForm,removeCouponCodeForm,setCouponCodeFormCouponCode,submitCouponCodeForm}from"./functions/models/validator/coupon-code-form/index.js";export{initCustomerReviewForm,setCustomerReviewFormComment,setCustomerReviewFormStar,setCustomerReviewFormTitle,submitCustomerReviewForm}from"./functions/models/validator/customer-review/index.js";export{initForgotPasswordForm,setForgotPasswordFormEmail,submitForgotPasswordForm}from"./functions/models/validator/forgot-password/index.js";export{initLoginForm,setLoginFormEmail,setLoginFormPassword,submitLoginForm}from"./functions/models/validator/login/index.js";export{initNewsletterSubscriptionForm,setNewsletterSubscriptionFormEmail,setNewsletterSubscriptionFormIsMarketingAccepted,submitNewsletterSubscriptionForm}from"./functions/models/validator/newsletter-subscription/index.js";export{initOrderTrackingForm,setOrderTrackingFormEmail,setOrderTrackingFormOrderNumber,submitOrderTrackingForm}from"./functions/models/validator/order-tracking/index.js";export{initRecoverPasswordForm,setRecoverPasswordFormPassword,setRecoverPasswordFormPasswordAgain,submitRecoverPasswordForm}from"./functions/models/validator/recover-password/index.js";export{initRegisterForm,setRegisterFormBooleanAttribute,setRegisterFormChoiceAttribute,setRegisterFormDateAttribute,setRegisterFormDateTimeAttribute,setRegisterFormEmail,setRegisterFormFirstName,setRegisterFormIsMarketingAccepted,setRegisterFormIsMembershipAgreementAccepted,setRegisterFormLastName,setRegisterFormMultipleChoiceAttribute,setRegisterFormNumericAttribute,setRegisterFormPassword,setRegisterFormPhone,setRegisterFormTextAttribute,submitRegisterForm}from"./functions/models/validator/register/index.js";export{initSmsLoginForm,resendSmsLoginFormCode,setSmsLoginFormCode,setSmsLoginFormEmail,setSmsLoginFormFirstName,setSmsLoginFormIsMarketingAccepted,setSmsLoginFormIsMembershipAgreementAccepted,setSmsLoginFormLastName,setSmsLoginFormPhone,submitSmsLoginForm}from"./functions/models/validator/sms-login/index.js";export{initVerifyPhoneNumberForm,resendVerifyPhoneNumberFormCode,setVerifyPhoneNumberFormCode,submitVerifyPhoneNumberForm}from"./functions/models/validator/verify-phone-number/index.js";export{collectionToArray}from"./functions/others/index.js";export{bs_searchProductById,bs_searchProductsById,initBaseStore,setLanguage,setLocalization}from"./functions/stores/base/index.js";export{addItemToCart,addSelectedtedVariantToCart,changeCartItemQuantity,changeItemQuantity,createPayWithIkasSession,findExistingCartItem,findExistingCartItemWithProduct,getAcceptedOffers,getCart,getCheckoutUrlFromCartStore,hasCart,isOrderLineItemAutoCreated,removeCart,removeCouponCode,removeItem,saveCouponCode,setCart,waitForCartStoreInit,windowAddToCart}from"./functions/stores/cart/index.js";export{activateCustomer,addProductToFavorites,canCustomerCreateEmailSubscription,checkEmail,clearAccountInfoForm,clearContactForm,clearCouponCodeForm,clearForgotPasswordForm,clearLoginForm,clearNewsletterSubscriptionForm,clearOrderTrackingForm,clearRecoverPasswordForm,clearRegisterForm,closeIkasStorefrontWidget,createEmailSubscription,cs_getLoyaltyCustomerInfo,cs_listEarningMethods,cs_listLoyaltyProgramPointHistory,cs_listLoyaltyProgramTiers,cs_listSpendingMethodsByCartId,cs_removeLoyaltyPointsFromCart,cs_useLoyaltyPoints,customerLogin,customerStore_onProductView,customerToAnalyticsCustomer,deactivateCustomer,deleteCustomerAddress,exportCustomerPersonalData,forgotPassword,getAccountInfoForm,getContactForm,getCouponCodeForm,getCustomerAttributes,getCustomerConsentGranted,getDigitalProductFileDownloadUrl,getEmptyAddressForm,getFavoriteProducts,getFavoriteProductsIds,getForgotPasswordForm,getLastViewedProducts,getLoginForm,getNewsletterSubscriptionForm,getOrder,getOrderByEmail,getOrderDetailsOfPage,getOrderProductFiles,getOrderRefundSettings,getOrderTrackingForm,getOrderTransactions,getOrders,getRecoverPasswordForm,getRegisterForm,getSmsLoginForm,getVerifyPhoneNumberForm,handleCustomerConsentGrant,handleSocialLogin,hasCustomer,initCustomerStore,isFavoriteProduct,logout,openIkasStorefrontWidget,recoverPassword,refundOrder,register,removeCustomerConsent,removeProductFromFavorites,resendCustomerActivationMail,resendCustomerPhoneVerificationCode,saveContactForm,saveCustomer,saveCustomerFormData,sendReview,setCaptchaToken,setSavedLastViewedProductsResponse,socialLogin,socialLoginToken,validateCustomerPhoneVerificationCode,validateOTPCode,waitForCaptchaTokenInit,waitForCustomerStoreInit}from"./functions/stores/customer/index.js";export{I18n,i18n}from"./i18n/index.js";export{Router,router,withRoutePrefix}from"./router/index.js";export{baseStore}from"./stores/base/index.js";export{CART_LS_KEY,cartStore}from"./stores/cart/index.js";export{customerStore}from"./stores/customer/index.js";export{getThemeBreakpoints,getThemeColorSchemes,getThemeColors,getThemeKeyframes,getThemeSetting,getThemeSettingValue,getThemeSettings,getThemeTypography,registerThemeSettingValues}from"./theme/settings/index.js";export{DYNAMIC_STYLE_PROPERTIES,SIZE_PROPERTIES,getFormattedBorder,getFormattedBorderRadiusBottomLeftSize,getFormattedBorderRadiusBottomRightSize,getFormattedBorderRadiusSize,getFormattedBorderRadiusTopLeftSize,getFormattedBorderRadiusTopRightSize,getFormattedBorderWidthSizeSize,getFormattedBottomSize,getFormattedFontSize,getFormattedGapSize,getFormattedGridTemplateColumns,getFormattedHeightSize,getFormattedLeftSize,getFormattedLetterSpacingSize,getFormattedLineHeightSize,getFormattedMarginBottomSize,getFormattedMarginLeftSize,getFormattedMarginRightSize,getFormattedMarginTopSize,getFormattedMaxHeightSize,getFormattedMaxWidthSize,getFormattedMinHeightSize,getFormattedMinWidthSize,getFormattedPaddingBottomSize,getFormattedPaddingLeftSize,getFormattedPaddingMarginSize,getFormattedPaddingRightSize,getFormattedPaddingSize,getFormattedPaddingTopSize,getFormattedRightSize,getFormattedShadow,getFormattedSize,getFormattedStyleVariable,getFormattedTopSize,getFormattedWidthSize}from"./theme/styles/index.js";export{isBrowser,isDefined,isEmpty,isNotEmpty}from"./utils/blueprint.js";export{IkasComponentRenderer}from"./utils/component-renderer.js";export{HttpMethod,get,httpRequest,post}from"./utils/fetch.js";export{JsObject}from"./utils/object-wrapper.js";export{setAPIClientConfig}from"./packages/storefront-api/src/index.js";export{IkasStorefrontConfig,escapeForJSON,unescapeFromJSON}from"./packages/storefront-config/src/index.js";import"./packages/storefront-models/src/models/merchant-settings/index.js";export{default as IkasAPIClientConfig}from"./packages/storefront-api-client/src/config/index.js";export{anl_addToCart}from"./analytics/analytics-functions/addToCart.js";export{anl_addToWishlist}from"./analytics/analytics-functions/addToWishlist.js";export{anl_completeRegistration}from"./analytics/analytics-functions/completeRegistration.js";export{anl_contactForm}from"./analytics/analytics-functions/contactForm.js";export{anl_createEmailSubscription}from"./analytics/analytics-functions/createEmailSubscription.js";export{anl_customerLogin}from"./analytics/analytics-functions/customerLogin.js";export{anl_customerLogout}from"./analytics/analytics-functions/customerLogout.js";export{anl_customerVisit}from"./analytics/analytics-functions/customerVisit.js";export{anl_pageView}from"./analytics/analytics-functions/pageView.js";export{anl_productView}from"./analytics/analytics-functions/productView.js";export{anl_removeFromCart}from"./analytics/analytics-functions/removeFromCart.js";export{anl_search}from"./analytics/analytics-functions/search.js";export{anl_viewBrand}from"./analytics/analytics-functions/viewBrand.js";export{anl_viewCart}from"./analytics/analytics-functions/viewCart.js";export{anl_viewCategory}from"./analytics/analytics-functions/viewCategory.js";export{anl_viewListing}from"./analytics/analytics-functions/viewListing.js";export{anl_viewSearchResults}from"./analytics/analytics-functions/viewSearchResults.js";export{anl_viewStorefrontPopup}from"./analytics/analytics-functions/viewStorefrontPopup.js";import*as e from'./ext/animejs/lib/anime.esm.js';export{e as AnimeJS};export{cloneDeep,reaction}from"./utils/helper.js";export{APIErrorCode,APIResponse}from"./packages/storefront-api-client/src/utils/api.js";export{EMPTY_THEME_GLOBALS,breakpointCssToken,cssVarCamelCase,cssVarRef,isReservedVariableId,rawClassRef,resolveBreakpointMediaTokens,serializeThemeGlobals,toResolverBreakpoints}from"./packages/storefront-config/src/theme-globals.js";
|
|
1
|
+
export{Analytics}from"./analytics/analytics.js";export{initIkasEvents}from"./analytics/events.js";export{EMPTY_STRING,NULL,UNDEFINED}from"./externals/index.js";export{apiListProductBrand}from"./functions/api/brand/index.js";export{apiListCategory}from"./functions/api/category/index.js";export{apiGetLoyaltyCustomerInfo,apiGetStorefrontWidgetSettings,apiListEarningMethods,apiListLoyaltyProgramPointHistory,apiListLoyaltyProgramTiers,apiListSpendingMethodsByCartId,apiRemoveLoyaltyPointsFromCart,apiUseLoyaltyPoints}from"./functions/api/loyalty/index.js";export{apiListStorefrontPopup}from"./functions/api/popup/index.js";export{apiSearchProducts}from"./functions/api/product/index.js";export{getAttributeDetailValues}from"./functions/models/attribute-detail/index.js";export{getAttributeListValues}from"./functions/models/attribute-list/index.js";export{createIkasBaseModel}from"./functions/models/base/index.js";export{getIkasBlogFormattedDate,getIkasBlogHref}from"./functions/models/blog/index.js";export{createIkasBlogCategory,getIkasBlogCategoryHref}from"./functions/models/blog/category/index.js";export{initIkasBlogCategory}from"./functions/models/blog/category/init.js";export{initIkasBlog}from"./functions/models/blog/init.js";export{getBlogCategoryListInitialData,getBlogCategoryListNextPage,getBlogCategoryListPage,getBlogCategoryListPageCount,getBlogCategoryListPrevPage,hasBlogCategoryListNextPage,hasBlogCategoryListPrevPage,isBlogCategoryListStatic}from"./functions/models/blog-category-list/index.js";export{initBlogCategoryList}from"./functions/models/blog-category-list/init.js";export{getBlogListInitialData,getBlogListNextPage,getBlogListPage,getBlogListPageCount,getBlogListPrevPage,hasBlogListNextPage,hasBlogListPrevPage,isBlogListStatic}from"./functions/models/blog-list/index.js";export{initBlogList}from"./functions/models/blog-list/init.js";export{getIkasBrandHref}from"./functions/models/brand/index.js";export{initIkasBrand}from"./functions/models/brand/init.js";export{getBrandListInitialData,getBrandListNextPage,getBrandListPage,getBrandListPageCount,getBrandListPrevPage,hasBrandListNextPage,hasBrandListPrevPage,isBrandListStatic}from"./functions/models/brand-list/index.js";export{initBrandList}from"./functions/models/brand-list/init.js";export{acceptProductOffer,isAcceptedProductOffer,rejectProductOffer}from"./functions/models/campaign-offer/index.js";export{getCategoryPath,getIkasCategoryHref}from"./functions/models/category/index.js";export{initIkasCategory}from"./functions/models/category/init.js";export{getCategoryListInitialData,getCategoryListNextPage,getCategoryListPage,getCategoryListPageCount,getCategoryListPrevPage,hasCategoryListNextPage,hasCategoryListPrevPage,isCategoryListStatic}from"./functions/models/category-list/index.js";export{initCategoryList}from"./functions/models/category-list/init.js";export{getIkasCategoryPathItemHref,getIkasCategoryPathItemSlug}from"./functions/models/category/path-item/index.js";export{initIkasCategoryPathItem}from"./functions/models/category/path-item/init.js";export{getCheckoutTotalFinalPrice,isCheckoutComplete}from"./functions/models/checkout/index.js";export{initIkasCountry}from"./functions/models/country/init.js";export{getCustomerBasicInfo,isCustomerSubscribed}from"./functions/models/customer/index.js";export{clearIkasCustomerAddressForm,getCustomerAddressText,getCustomerAddressValidationResult,getIkasCustomerAddressForm,isValidCustomerAddress}from"./functions/models/customer/address/index.js";export{getCustomerAttributeAccountPagePermission,getCustomerAttributeRegisterPageRequirement}from"./functions/models/customer/attribute/index.js";export{initIkasCustomerAttribute}from"./functions/models/customer/attribute/init.js";export{getIkasCustomerReviewFormattedDate}from"./functions/models/customer/review/index.js";export{initIkasCustomerReview}from"./functions/models/customer/review/init.js";export{getCustomerReviewListInitialData,getCustomerReviewListNextPage,getCustomerReviewListPage,getCustomerReviewListPageCount,getCustomerReviewListPrev,getProductCustomerReviews,hasCustomerReviewListNextPage,hasCustomerReviewListPrevPage}from"./functions/models/customer-review-list/index.js";export{initCustomerReviewList}from"./functions/models/customer-review-list/init.js";export{getCustomerReviewSummaryListInitialData,getCustomerReviewSummaryListNextPage,getCustomerReviewSummaryListPage,getCustomerReviewSummaryListPrev,hasCustomerReviewSummaryListNextPage,hasCustomerReviewSummaryListPrevPage}from"./functions/models/customer-review-summary-list/index.js";export{initCustomerReviewSummaryList}from"./functions/models/customer-review-summary-list/init.js";export{getIkasFilterCategoryHref,getIkasFilterCategorySlug}from"./functions/models/filter-category/index.js";export{initIkasHTMLMetaData,setHTMLMetaDataTranslations}from"./functions/models/html-meta-data/init.js";export{initThemeDatePicker,themeDatePickerGetDate,themeDatePickerGetDaysOfMonth,themeDatePickerGetDaysOfWeekShort,themeDatePickerGetFullYear,themeDatePickerGetHours,themeDatePickerGetMinutes,themeDatePickerGetMonth,themeDatePickerGetMonthList,themeDatePickerGetMonthName,themeDatePickerGetViewFullYear,themeDatePickerGetViewMonth,themeDatePickerGetWeekFirstDay,themeDatePickerOnChange,themeDatePickerOnDayChange,themeDatePickerOnHoursChange,themeDatePickerOnMinutesChange,themeDatePickerOnViewFullYearChange,themeDatePickerOnViewMonthChange,themeDatePickerSetViewNextMonth,themeDatePickerSetViewPrevMonth}from"./functions/models/ikas-theme/date-picker.js";export{createMediaSrcset,getDefaultSrc,getSrc,getThumbnailSrc}from"./functions/models/image/index.js";export{initIkasMerchantSettings}from"./functions/models/merchant-settings/init.js";export{getIkasOrderCouponAdjustment,getIkasOrderCustomerFullName,getIkasOrderDisplayedAdjustments,getIkasOrderDisplayedPackages,getIkasOrderDistinctItemCount,getIkasOrderFormattedDate,getIkasOrderFormattedOrderedAt,getIkasOrderFormattedShippingTotal,getIkasOrderFormattedTotalFinalPrice,getIkasOrderFormattedTotalPrice,getIkasOrderFormattedTotalTax,getIkasOrderHref,getIkasOrderNonCouponAdjustments,getIkasOrderPackageStatusTranslation,getIkasOrderProductFiles,getIkasOrderRefundableItems,getIkasOrderRefundedItems,getIkasOrderShippingTotal,getIkasOrderTotalItemCount,getIkasOrderTotalTax,getIkasOrderUnfullfilledItems,getIkasOrderVariantNames,hasIkasOrderCustomer,hasValidIkasOrderCustomerEmail,initIkasOrder,isIkasOrderRefundable}from"./functions/models/order/index.js";export{createOrderAddress,getOrderAddressText,getOrderAddressValidationResult,isValidOrderAddress}from"./functions/models/order/address/index.js";export{getOrderAdjustmentDisplayName,getOrderAdjustmentFormattedAmount,getOrderAdjustmentIsDecrement}from"./functions/models/order/adjustment/index.js";export{getOrderGiftPackageLineFormattedPrice}from"./functions/models/order/gift-package/index.js";export{editOrderLineItem,getOrderLineItemFinalPriceWithQuantity,getOrderLineItemFormattedDiscountPrice,getOrderLineItemFormattedFinalPrice,getOrderLineItemFormattedFinalPriceWithQuantity,getOrderLineItemFormattedFinalUnitPrice,getOrderLineItemFormattedOverridenPriceWithQuantity,getOrderLineItemFormattedPrice,getOrderLineItemFormattedPriceWithQuantity,getOrderLineItemFormattedTax,getOrderLineItemFormattedUnitPrice,getOrderLineItemOverridenPriceWithQuantity,getOrderLineItemPriceWithQuantity,getOrderLineItemRefundQuantity,getOrderLineItemTax,getOrderLineItemUnitPriceText,hasOrderLineItemDiscount,setOrderLineItemRefundQuantity}from"./functions/models/order/line-item/index.js";export{downloadFile,getOrderLineItemOptionValueFormattedPrice,getOrderLineOptionFileName}from"./functions/models/order/line-item/option/value/index.js";export{getIkasOrderLineVariantHref,getIkasOrderLineVariantMainImage}from"./functions/models/order/line-item/variant/index.js";export{getIkasOrderLineBundleVariantMainImage}from"./functions/models/order/line-item/variant/bundle-product/bundle-variant/index.js";export{getIkasOrderLineVariantNameSlug,getIkasOrderLineVariantTypeSlug}from"./functions/models/order/line-item/variant/value/index.js";export{getOrderTransactionFormattedAmount,getOrderTransactionPaymentMethodTranslation}from"./functions/models/order/transaction/index.js";export{getPaymentGatewayCalculatedAdditionalPrices}from"./functions/models/payment-gateway/index.js";export{initIkasPaymentGateway}from"./functions/models/payment-gateway/init.js";export{addIkasProductToFavorites,clearIkasProductCustomerReviewForm,getBundleProductFinalPrice,getBundleProductFinalPriceWithQuantity,getBundleProductFormattedFinalPrice,getBundleProductFormattedFinalPriceWithQuantity,getBundleProductFormattedSellPrice,getBundleProductFormattedSellPriceWithQuantity,getBundleProductSellPrice,getBundleProductSellPriceWithQuantity,getBundleProductsOfVariant,getDisplayedProductGroups,getDisplayedProductVariantTypes,getGroupedAttributeValues,getIkasProductCustomerReviewForm,getMainProductVariantType,getMainProductVariantValue,getProductAvailableStockLocations,getProductCampaigns,getProductCategoryPath,getProductFirstCategory,getProductHref,getProductOptionSet,getSelectedProductVariant,getSelectedProductVariantHref,hasProductStock,hasProductValidOptionValues,hasProductVariant,initBundleProducts,initProductOnBrowser,initProductOptionSet,isAddToCartEnabled,isBundleProductQuantityEditable,isCustomerReviewEnabled,isCustomerReviewLoginRequired,isFavoriteIkasProduct,removeIkasProductFromFavorites,selectVariantValue,setBundleProductQuantity,setOptionRealPrices,setProductOfBundleProduct,shouldDisplayBundleProductPrice}from"./functions/models/product/index.js";export{getProductFromStore,initIkasProduct,initIkasProductExtraFields,productVariantStore}from"./functions/models/product/init.js";export{clearProductListFilter,clearProductListFilters,enableProductListSuggestions,getProductListCurrencyCode,getProductListCurrencySymbol,getProductListFilterCategories,getProductListInitialData,getProductListNextPage,getProductListPage,getProductListPrevPage,getProductListSortOptions,getProductListSortTypeTranslation,getProductListSuggestionHref,getSelectedFilterValues,handleFilterValueClick,handleNumberRangeOptionClick,hasProductListAppliedFilters,hasProductListFeaturedSortEnabled,hasProductListNextPage,hasProductListPrevPage,initProductList,initProductListFilterCategories,initProductListOnBrowser,isProductListDiscounted,isProductListFilterable,isProductListFiltered,isProductListLastViewed,isProductListPurchasedTogether,isProductListRecommended,isProductListRelatedProducts,isProductListSearch,isProductListStatic,isProductListViewedTogether,onFilterCategoryClick,productListToggleFilterCollapsed,searchProductList,setProductListIsFilteredForProducts,setProductListIsStaticForProducts,setProductListVisiblePage,setSortType,translateProductListSortType}from"./functions/models/product-list/index.js";export{getIkasProductAttributeProducts,getIkasProductAttributeTableValue,getIkasProductAttrributeProductIds}from"./functions/models/product/attribute-value/index.js";export{initIkasProductAttributeValue}from"./functions/models/product/attribute-value/init.js";export{applyQueryParamForFilter,clearFilter,filterParseRangeStr,filterRangeToId,filterToInput,getFilterDisplayedValues,getFilterKeyList,getFilterValueList,getIkasFilterHref,getIkasFilterThumbnailImage,initIkasProductFilter,isBoxFilter,isCustomValueFilter,isListFilter,isStockFilter,isSwatchFilter,onNumberRangeFilterChange,onNumberRangeFilterOptionClick,selectFilterValue}from"./functions/models/product/filter/index.js";export{getDisplayedOptions,hasDisplayedOptions,hasValidProductOptionSetValues,initOptionValues,initProductOptionSetValues,setChildOptions}from"./functions/models/product/option-set/index.js";export{initIkasProductOptionSet}from"./functions/models/product/option-set/init.js";export{clearValues,getDisplayedChildOptions,getProductOptionFormattedLabel,getProductOptionFormattedPrice,getTextValue,hasError,hasValidProductOptionValues,initIkasProductOptionValues,isCheckboxOption,isChecked,isChoiceOption,isChoiceOptionBoxType,isChoiceOptionSelectType,isChoiceOptionSwatchType,isColorPickerOption,isDatePickerOption,isFileOption,isImageOption,isProductOptionSelectValueSelected,isTextAreaOption,isTextOption,productOptionFileUpload,selectValue,setCheckboxValue,setTextValue,setValues}from"./functions/models/product/option-set/option/index.js";export{initIkasProductOption}from"./functions/models/product/option-set/option/init.js";export{clearProductVariantBackInStockForm,getGroupedAttributeValuesForVariant,getProductVariantAppliedCampaignAmount,getProductVariantB2bPriceRule,getProductVariantBackInStockForm,getProductVariantBundlePrice,getProductVariantCampaignOffersDiscountPercentage,getProductVariantCampaignPrice,getProductVariantDiscountAmount,getProductVariantDiscountPercentage,getProductVariantDiscountPrice,getProductVariantFinalPrice,getProductVariantFinalPriceWithCampaignOffers,getProductVariantFormattedBuyPrice,getProductVariantFormattedCampaignPrice,getProductVariantFormattedDiscountAmount,getProductVariantFormattedDiscountPrice,getProductVariantFormattedFinalPrice,getProductVariantFormattedFinalPriceWithCampaignOffers,getProductVariantFormattedSellPrice,getProductVariantFormattedSellPriceWithCampaignOffers,getProductVariantIsBackInStockCustomerLoginRequired,getProductVariantIsBackInStockEnabled,getProductVariantMainImage,getProductVariantPrice,getProductVariantSellPrice,getProductVariantSellPriceWithCampaignOffers,getProductVariantUnitPriceText,hasBundleSettings,hasProductVariantDiscount,hasProductVariantStock,saveProductVariantBackInStockReminder}from"./functions/models/product/variant/index.js";export{initIkasProductVariant}from"./functions/models/product/variant/init.js";export{getIkasProductDiscountPercentage,getIkasProductPriceDiscountAmount,getIkasProductPriceFinalPrice,hasIkasProductPriceDiscount}from"./functions/models/product/variant/price/index.js";export{isRaffleAvailable}from"./functions/models/raffle/index.js";export{initIkasRaffle}from"./functions/models/raffle/init.js";export{initIkasState}from"./functions/models/state/init.js";export{getIkasVariantTypeSlug,isIkasVariantTypeColorSelection}from"./functions/models/variant-type/index.js";export{initIkasVariantType}from"./functions/models/variant-type/init.js";export{getIkasVariantValueSlug,getIkasVariantValueThumbnailImage,isColorVariantValue,isImageVariantValue,isTextVariantValue}from"./functions/models/variant-type/variant-value/index.js";export{FORM_ITEM_DEFAULT_VALUE,validateValue}from"./functions/models/validator/index.js";export{initAccountInfoForm,setAccountInfoFormFirstName,setAccountInfoFormIsMarketingAccepted,setAccountInfoFormLastName,setAccountInfoFormPhone,submitAccountInfoForm}from"./functions/models/validator/account-info/index.js";export{initAddressForm,setAddressFormAddressLine1,setAddressFormAddressLine2,setAddressFormCity,setAddressFormCompany,setAddressFormCountry,setAddressFormDistrict,setAddressFormFirstName,setAddressFormIdentityNumber,setAddressFormLastName,setAddressFormPhone,setAddressFormPostalCode,setAddressFormRegion,setAddressFormState,setAddressFormTaxNumber,setAddressFormTaxOffice,setAddressFormTitle,submitAddressForm}from"./functions/models/validator/address/index.js";export{initBackInStockNotificationForm,setBackInStockNotificationFormEmail,submitBackInStockNotificationForm}from"./functions/models/validator/back-in-stock-notification/index.js";export{initContactForm,setContactFormEmail,setContactFormFirstName,setContactFormLastName,setContactFormMessage,setContactFormPhone,submitContactForm}from"./functions/models/validator/contact-form/index.js";export{initCouponCodeForm,removeCouponCodeForm,setCouponCodeFormCouponCode,submitCouponCodeForm}from"./functions/models/validator/coupon-code-form/index.js";export{initCustomerReviewForm,setCustomerReviewFormComment,setCustomerReviewFormStar,setCustomerReviewFormTitle,submitCustomerReviewForm}from"./functions/models/validator/customer-review/index.js";export{initForgotPasswordForm,setForgotPasswordFormEmail,submitForgotPasswordForm}from"./functions/models/validator/forgot-password/index.js";export{initLoginForm,setLoginFormEmail,setLoginFormPassword,submitLoginForm}from"./functions/models/validator/login/index.js";export{initNewsletterSubscriptionForm,setNewsletterSubscriptionFormEmail,setNewsletterSubscriptionFormIsMarketingAccepted,submitNewsletterSubscriptionForm}from"./functions/models/validator/newsletter-subscription/index.js";export{initOrderTrackingForm,setOrderTrackingFormEmail,setOrderTrackingFormOrderNumber,submitOrderTrackingForm}from"./functions/models/validator/order-tracking/index.js";export{initRecoverPasswordForm,setRecoverPasswordFormPassword,setRecoverPasswordFormPasswordAgain,submitRecoverPasswordForm}from"./functions/models/validator/recover-password/index.js";export{initRegisterForm,setRegisterFormBooleanAttribute,setRegisterFormChoiceAttribute,setRegisterFormDateAttribute,setRegisterFormDateTimeAttribute,setRegisterFormEmail,setRegisterFormFirstName,setRegisterFormIsMarketingAccepted,setRegisterFormIsMembershipAgreementAccepted,setRegisterFormLastName,setRegisterFormMultipleChoiceAttribute,setRegisterFormNumericAttribute,setRegisterFormPassword,setRegisterFormPhone,setRegisterFormTextAttribute,submitRegisterForm}from"./functions/models/validator/register/index.js";export{initSmsLoginForm,resendSmsLoginFormCode,setSmsLoginFormCode,setSmsLoginFormEmail,setSmsLoginFormFirstName,setSmsLoginFormIsMarketingAccepted,setSmsLoginFormIsMembershipAgreementAccepted,setSmsLoginFormLastName,setSmsLoginFormPhone,submitSmsLoginForm}from"./functions/models/validator/sms-login/index.js";export{initVerifyPhoneNumberForm,resendVerifyPhoneNumberFormCode,setVerifyPhoneNumberFormCode,submitVerifyPhoneNumberForm}from"./functions/models/validator/verify-phone-number/index.js";export{collectionToArray}from"./functions/others/index.js";export{bs_searchProductById,bs_searchProductsById,initBaseStore,setLanguage,setLocalization}from"./functions/stores/base/index.js";export{addItemToCart,addSelectedtedVariantToCart,changeCartItemQuantity,changeItemQuantity,createPayWithIkasSession,findExistingCartItem,findExistingCartItemWithProduct,getAcceptedOffers,getCart,getCheckoutUrlFromCartStore,hasCart,isOrderLineItemAutoCreated,removeCart,removeCouponCode,removeItem,saveCouponCode,setCart,waitForCartStoreInit,windowAddToCart}from"./functions/stores/cart/index.js";export{activateCustomer,addProductToFavorites,canCustomerCreateEmailSubscription,checkEmail,clearAccountInfoForm,clearContactForm,clearCouponCodeForm,clearForgotPasswordForm,clearLoginForm,clearNewsletterSubscriptionForm,clearOrderTrackingForm,clearRecoverPasswordForm,clearRegisterForm,closeIkasStorefrontWidget,createEmailSubscription,cs_getLoyaltyCustomerInfo,cs_listEarningMethods,cs_listLoyaltyProgramPointHistory,cs_listLoyaltyProgramTiers,cs_listSpendingMethodsByCartId,cs_removeLoyaltyPointsFromCart,cs_useLoyaltyPoints,customerLogin,customerStore_onProductView,customerToAnalyticsCustomer,deactivateCustomer,deleteCustomerAddress,exportCustomerPersonalData,forgotPassword,getAccountInfoForm,getContactForm,getCouponCodeForm,getCustomerAttributes,getCustomerConsentGranted,getDigitalProductFileDownloadUrl,getEmptyAddressForm,getFavoriteProducts,getFavoriteProductsIds,getForgotPasswordForm,getLastViewedProducts,getLoginForm,getNewsletterSubscriptionForm,getOrder,getOrderByEmail,getOrderDetailsOfPage,getOrderProductFiles,getOrderRefundSettings,getOrderTrackingForm,getOrderTransactions,getOrders,getRecoverPasswordForm,getRegisterForm,getSmsLoginForm,getVerifyPhoneNumberForm,handleCustomerConsentGrant,handleSocialLogin,hasCustomer,initCustomerStore,isFavoriteProduct,logout,openIkasStorefrontWidget,recoverPassword,refundOrder,register,removeCustomerConsent,removeProductFromFavorites,resendCustomerActivationMail,resendCustomerPhoneVerificationCode,saveContactForm,saveCustomer,saveCustomerFormData,sendReview,setCaptchaToken,setSavedLastViewedProductsResponse,socialLogin,socialLoginToken,validateCustomerPhoneVerificationCode,validateOTPCode,waitForCaptchaTokenInit,waitForCustomerStoreInit}from"./functions/stores/customer/index.js";export{I18n,i18n}from"./i18n/index.js";export{Router,router,withRoutePrefix}from"./router/index.js";export{baseStore}from"./stores/base/index.js";export{CART_LS_KEY,cartStore}from"./stores/cart/index.js";export{customerStore}from"./stores/customer/index.js";export{getThemeBreakpoints,getThemeColorSchemes,getThemeColors,getThemeKeyframes,getThemeSetting,getThemeSettingValue,getThemeSettings,getThemeTypography,registerThemeSettingValues}from"./theme/settings/index.js";export{DYNAMIC_STYLE_PROPERTIES,SIZE_PROPERTIES,getFormattedBorder,getFormattedBorderRadiusBottomLeftSize,getFormattedBorderRadiusBottomRightSize,getFormattedBorderRadiusSize,getFormattedBorderRadiusTopLeftSize,getFormattedBorderRadiusTopRightSize,getFormattedBorderWidthSizeSize,getFormattedBottomSize,getFormattedFontSize,getFormattedGapSize,getFormattedGridTemplateColumns,getFormattedHeightSize,getFormattedLeftSize,getFormattedLetterSpacingSize,getFormattedLineHeightSize,getFormattedMarginBottomSize,getFormattedMarginLeftSize,getFormattedMarginRightSize,getFormattedMarginTopSize,getFormattedMaxHeightSize,getFormattedMaxWidthSize,getFormattedMinHeightSize,getFormattedMinWidthSize,getFormattedPaddingBottomSize,getFormattedPaddingLeftSize,getFormattedPaddingMarginSize,getFormattedPaddingRightSize,getFormattedPaddingSize,getFormattedPaddingTopSize,getFormattedRightSize,getFormattedShadow,getFormattedSize,getFormattedStyleVariable,getFormattedTopSize,getFormattedWidthSize}from"./theme/styles/index.js";export{isBrowser,isDefined,isEmpty,isNotEmpty}from"./utils/blueprint.js";export{IkasComponentRenderer}from"./utils/component-renderer.js";export{HttpMethod,get,httpRequest,post}from"./utils/fetch.js";export{JsObject}from"./utils/object-wrapper.js";export{normalizeSvg}from"./utils/svg.js";export{setAPIClientConfig}from"./packages/storefront-api/src/index.js";export{IkasStorefrontConfig,escapeForJSON,unescapeFromJSON}from"./packages/storefront-config/src/index.js";import"./packages/storefront-models/src/models/merchant-settings/index.js";export{default as IkasAPIClientConfig}from"./packages/storefront-api-client/src/config/index.js";export{anl_addToCart}from"./analytics/analytics-functions/addToCart.js";export{anl_addToWishlist}from"./analytics/analytics-functions/addToWishlist.js";export{anl_completeRegistration}from"./analytics/analytics-functions/completeRegistration.js";export{anl_contactForm}from"./analytics/analytics-functions/contactForm.js";export{anl_createEmailSubscription}from"./analytics/analytics-functions/createEmailSubscription.js";export{anl_customerLogin}from"./analytics/analytics-functions/customerLogin.js";export{anl_customerLogout}from"./analytics/analytics-functions/customerLogout.js";export{anl_customerVisit}from"./analytics/analytics-functions/customerVisit.js";export{anl_pageView}from"./analytics/analytics-functions/pageView.js";export{anl_productView}from"./analytics/analytics-functions/productView.js";export{anl_removeFromCart}from"./analytics/analytics-functions/removeFromCart.js";export{anl_search}from"./analytics/analytics-functions/search.js";export{anl_viewBrand}from"./analytics/analytics-functions/viewBrand.js";export{anl_viewCart}from"./analytics/analytics-functions/viewCart.js";export{anl_viewCategory}from"./analytics/analytics-functions/viewCategory.js";export{anl_viewListing}from"./analytics/analytics-functions/viewListing.js";export{anl_viewSearchResults}from"./analytics/analytics-functions/viewSearchResults.js";export{anl_viewStorefrontPopup}from"./analytics/analytics-functions/viewStorefrontPopup.js";import*as e from'./ext/animejs/lib/anime.esm.js';export{e as AnimeJS};export{cloneDeep,reaction}from"./utils/helper.js";export{APIErrorCode,APIResponse}from"./packages/storefront-api-client/src/utils/api.js";export{EMPTY_THEME_GLOBALS,breakpointCssToken,cssVarCamelCase,cssVarRef,isReservedVariableId,rawClassRef,resolveBreakpointMediaTokens,serializeThemeGlobals,toResolverBreakpoints}from"./packages/storefront-config/src/theme-globals.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type NormalizeSvgOptions = {
|
|
2
|
+
/** Deterministic, instance-unique prefix (element id, or prop key + list index). */
|
|
3
|
+
idPrefix: string;
|
|
4
|
+
/** Rewrite ids and their references. Default: true. */
|
|
5
|
+
scopeIds?: boolean;
|
|
6
|
+
/** Normalize fill/stroke to this color. Opt-in. */
|
|
7
|
+
color?: "currentColor";
|
|
8
|
+
/** Strip fixed width/height and ensure a viewBox. Default: true. */
|
|
9
|
+
size?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Isomorphic, DOM-free normalization of a raw SVG markup string for render.
|
|
13
|
+
* Safe to call in SSR, browser, and node — pure string transforms only.
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizeSvg(svg: string, options: NormalizeSvgOptions): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=/\swidth\s*=\s*["']([^"']*)["']/i,n=/\sheight\s*=\s*["']([^"']*)["']/i,t=function(r,n){var t;return null===(t=r.match(n))||void 0===t?void 0:t[1]},c=function(r){var n=null==r?void 0:r.trim().match(/^(-?\d*\.?\d+)(px)?$/i);return n?parseFloat(n[1]):NaN},e=/(\sfill\s*=\s*["'])([^"']*)(["'])/gi,i=/(\sstroke\s*=\s*["'])([^"']*)(["'])/gi,s=/(fill\s*:\s*)([^;"']+)/gi,o=/(stroke\s*:\s*)([^;"']+)/gi;function a(a,u){var l=u.idPrefix,f=u.scopeIds,v=void 0===f||f,p=u.color,h=u.size,d=void 0===h||h,g=v?function(r,n){var t=new Set(Array.from(r.matchAll(/\sid\s*=\s*["']([^"']+)["']/g)).map(function(r){return r[1]}));if(0===t.size)return r;var c=function(r){return"".concat(n,"-").concat(r)};return r.replace(/(\sid\s*=\s*["'])([^"']+)(["'])/g,function(r,n,e,i){return t.has(e)?"".concat(n).concat(c(e)).concat(i):r}).replace(/url\(\s*["']?#([^"')\s]+)["']?\s*\)/g,function(r,n){return t.has(n)?"url(#".concat(c(n),")"):r}).replace(/((?:xlink:)?href\s*=\s*["'])#([^"']+)(["'])/g,function(r,n,e,i){return t.has(e)?"".concat(n,"#").concat(c(e)).concat(i):r})}(a,l):a,m="currentColor"===p?function(r){var n=function(r){var n=r.trim();return"none"===n||n.startsWith("url(")},t=function(r,t,c,e){return n(c)?r:"".concat(t,"currentColor").concat(e)},c=function(r,t,c){return n(c)?r:"".concat(t,"currentColor")};return r.replace(e,t).replace(i,t).replace(s,c).replace(o,c)}(g):g;return d?function(e){return e.replace(/<svg\b[^>]*>/i,function(e){var i=/\sviewBox\s*=/i.test(e),s=c(t(e,r)),o=c(t(e,n)),a=!i&&!Number.isNaN(s)&&!Number.isNaN(o);return i||a?(a?e.replace(/<svg\b/i,'<svg viewBox="0 0 '.concat(s," ").concat(o,'"')):e).replace(/\swidth\s*=\s*["'][^"']*["']/i,"").replace(/\sheight\s*=\s*["'][^"']*["']/i,""):e})}(m):m}export{a as normalizeSvg};
|