@bikdotai/bik-component-library 0.0.685-beta.14 → 0.0.685-beta.16

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
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),o=require("../spinner/Spinner.js"),s=require("./Button.styled.js"),i=require("./themes.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(n);const c=n.forwardRef(((n,r)=>{var{version:c,id:l,buttonType:d="primary",size:u="small",buttonText:b,disabled:m,IconComponent:j,LeadingIcon:x,TrailingIcon:h,isLoading:p,inverse:v,onClick:g,matchParentWidth:C,subtitle:y,darkMode:f,activated:I,error:N,buttonTextColor:T,buttonFontSize:z,customIconColor:O,buttonColor:B}=n,k=e.__rest(n,["version","id","buttonType","size","buttonText","disabled","IconComponent","LeadingIcon","TrailingIcon","isLoading","inverse","onClick","matchParentWidth","subtitle","darkMode","activated","error","buttonTextColor","buttonFontSize","customIconColor","buttonColor"]);const q=i.GetButtonTextComponent(u,d,m),S=i.getButtonIconColor(u,d,v,m,p,f),_="chip"===u?16:20,L={height:_,width:_,color:O||S,style:{display:"block"},className:"icon"};return t.jsx(s.Button,Object.assign({"data-test":k["data-test"],version:c,onClick:p?()=>{}:g,ref:r,id:l,disabled:m,size:u,buttonType:d,isLoading:p,inverse:v,matchParentWidth:C,darkMode:f,activated:I,error:N,buttonColor:B},k,{children:t.jsxs("div",Object.assign({className:"button-container"},{children:[d.startsWith("dash")&&t.jsx(s.ButtonCustomDashedBorder,{}),t.jsx("div",Object.assign({className:"overlay-container"},{children:p&&t.jsx(o.Spinner,{className:"spinner",size:"small",color:i.SpinnerColorMap(d,v)})})),j&&t.jsx("div",Object.assign({className:"icon-component"},{children:a.default.createElement(j,L)})),x&&t.jsx("div",Object.assign({className:"icon-leading",style:{zIndex:1}},{children:a.default.createElement(x,L)})),b?t.jsxs(q,Object.assign({className:"text",style:{color:T,fontSize:z}},{children:[b,t.jsx("div",Object.assign({className:"text-subtitle"},{children:y}))]})):t.jsx(t.Fragment,{}),h&&t.jsx("div",Object.assign({className:"icon-trailing",style:{zIndex:1}},{children:a.default.createElement(h,L)}))]}))}))}));c.displayName="Button",exports.Button=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),s=require("../spinner/Spinner.js"),o=require("./Button.styled.js"),i=require("./themes.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(n);const c=n.forwardRef(((n,r)=>{var{version:c,id:l,buttonType:d="primary",size:u="small",buttonText:b,disabled:m,IconComponent:j,LeadingIcon:g,TrailingIcon:x,isLoading:h,inverse:p,onClick:v,matchParentWidth:y,subtitle:C,darkMode:I,activated:f,error:N,buttonTextColor:O,buttonFontSize:T,customIconColor:z,buttonColor:B,LeadingIconStyles:S}=n,k=e.__rest(n,["version","id","buttonType","size","buttonText","disabled","IconComponent","LeadingIcon","TrailingIcon","isLoading","inverse","onClick","matchParentWidth","subtitle","darkMode","activated","error","buttonTextColor","buttonFontSize","customIconColor","buttonColor","LeadingIconStyles"]);const L=i.GetButtonTextComponent(u,d,m),q=i.getButtonIconColor(u,d,p,m,h,I),_="chip"===u?16:20,M={height:_,width:_,color:z||q,style:{display:"block"},className:"icon"};return t.jsx(o.Button,Object.assign({"data-test":k["data-test"],version:c,onClick:h?()=>{}:v,ref:r,id:l,disabled:m,size:u,buttonType:d,isLoading:h,inverse:p,matchParentWidth:y,darkMode:I,activated:f,error:N,buttonColor:B},k,{children:t.jsxs("div",Object.assign({className:"button-container"},{children:[d.startsWith("dash")&&t.jsx(o.ButtonCustomDashedBorder,{}),t.jsx("div",Object.assign({className:"overlay-container"},{children:h&&t.jsx(s.Spinner,{className:"spinner",size:"small",color:i.SpinnerColorMap(d,p)})})),j&&t.jsx("div",Object.assign({className:"icon-component"},{children:a.default.createElement(j,M)})),g&&t.jsx("div",Object.assign({className:"icon-leading",style:Object.assign({zIndex:1},S)},{children:a.default.createElement(g,M)})),b?t.jsxs(L,Object.assign({className:"text",style:{color:O,fontSize:T}},{children:[b,t.jsx("div",Object.assign({className:"text-subtitle"},{children:C}))]})):t.jsx(t.Fragment,{}),x&&t.jsx("div",Object.assign({className:"icon-trailing",style:{zIndex:1}},{children:a.default.createElement(x,M)}))]}))}))}));c.displayName="Button",exports.Button=c;
@@ -35,6 +35,11 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
35
35
  * @default undefined
36
36
  */
37
37
  LeadingIcon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
38
+ /**
39
+ * Custom styles to be applied to the LeadingIcon
40
+ * @default undefined
41
+ */
42
+ LeadingIconStyles?: React.CSSProperties;
38
43
  /**
39
44
  * The icon component that is the left of the buttonText
40
45
  * Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react
@@ -9,7 +9,7 @@
9
9
  background-position: center;
10
10
  background-size: cover;
11
11
  position: relative;
12
- height: 500px;
12
+ height: 100%;
13
13
  overflow-y: auto;
14
14
  border-radius: ${e=>{var r;return null!==(r=e.borderRadius)&&void 0!==r?r:"0px"}};
15
15
  `,d=o.default.div`
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../node_modules/@bikdotai/bik-models/growth/models/bik-store.js");var t=require("react"),i=require("./type.js");require("../dropdown/DropdownPopover/index.js");var o=require("../dropdown/Dropdown.js");require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js"),l=require("../../constants/Theme.js");require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../icon-button/IconButton.js"),require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");var r=require("../modals/styledModal.js"),a=require("../product-picker/ProductPickerModal.js"),d=require("../tag/Tag.js"),s=require("../tooltips/Tooltip.js"),c=require("../../assets/icons/gift_icon.svg.js"),u=require("../../assets/icons/percentage_icon.svg.js"),p=require("../../assets/icons/shipping_icon.svg.js"),C=require("../../assets/icons/triangle_error.svg.js"),T=require("../../assets/icons/warning.svg.js"),S=require("../product-picker-v2/modal.js"),P=require("../variable-picker-v3/model.js"),E=require("../variable-picker-v3/VariablePicker.js"),I=require("./DiscountModal.styled.js"),O=require("./DiscountUtils.js"),v=require("./DynamicCoupon/DynamicCoupon.js"),_=require("./StaticCoupon/StaticCoupon.js"),b=require("../../_virtual/bik-store.js");exports.DiscountModal=y=>{var D,N,h,m,f,U,A,g,j,R,x;const V=[{id:"0",label:"Amount",value:"amount",icon:t=>e.jsx("span",Object.assign({style:{fontSize:20,color:t,lineHeight:.9}},{children:y.currency||""}))},{id:"1",label:"Percentage",value:"percentage",icon:t=>e.jsx(u.default,{width:24,height:24,color:t})},{id:"2",label:"Buy X get Y",value:i.DISCOUNT_TYPES.BUY_X_GET_Y,icon:t=>e.jsx(c.default,{width:24,height:24,color:t})},{id:"3",label:"Free Shipping",value:i.DISCOUNT_TYPES.FREE_SHIPPING,icon:t=>e.jsx(p.default,{width:24,height:24,color:t})}],[F,k]=t.useState(),[q,L]=t.useState(),[M,Y]=t.useState(),[w,G]=t.useState(null!==(D=y.data)&&void 0!==D?D:"string"==typeof y.hideOption?{isStaticCoupon:"dynamic"===y.hideOption}:{isStaticCoupon:!0}),[B,X]=t.useState(!0),[Q,H]=t.useState(),[z,K]=t.useState((null===(N=y.data)||void 0===N?void 0:N.minAmount)?i.MIN_PURCHASE_REQUIREMENT.AMOUNT:(null===(h=y.data)||void 0===h?void 0:h.minQuantity)?i.MIN_PURCHASE_REQUIREMENT.QUANTITY:i.MIN_PURCHASE_REQUIREMENT.NA),[$,Z]=t.useState(i.DISCOUNT_APPLIES_TO.ENTIRE_ORDER),[J,W]=t.useState(i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS),[ee,te]=t.useState(i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS),[ie,oe]=t.useState(void 0),[ne,le]=t.useState(void 0),[re,ae]=t.useState(void 0),[de,se]=t.useState(void 0),[ce,ue]=t.useState(void 0),[pe,Ce]=t.useState(void 0),[Te,Se]=t.useState(0),[Pe,Ee]=t.useState(""),[Ie,Oe]=t.useState(V[0]),[ve,_e]=t.useState(!1),[be,ye]=t.useState(i.initialStaticCouponErrorState),[De,Ne]=t.useState(i.initialDynamicCouponErrorState),[he,me]=t.useState(i.COUPON_EXPIRATION.DYNAMIC_EXPIRATION),fe=[{value:i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:Q===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER},{value:i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:Q===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS},{value:i.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:Q===i.DISCOUNT_TYPES.BUY_X_GET_Y},{value:i.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:Q===i.DISCOUNT_TYPES.FREE_SHIPPING}];t.useEffect((()=>{y.makeExpiryMandatory&&_e(!0)}),[y.makeExpiryMandatory]),t.useEffect((()=>{var e,t,o,n,l,r,a,d;let s;const{tempCouponData:c,discountType:u}=Ue();H(u);const p=(e,t)=>{Oe(c.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?V[e]:V[t])},C=(e,t)=>{Object.keys(e||{}).length&&t(e)};switch(((null==c?void 0:c.expireAfter)||(null==c?void 0:c.expireAt))&&(_e(!0),(null==c?void 0:c.expireAt)&&me(i.COUPON_EXPIRATION.FIXED_EXPIRATION),(null==c?void 0:c.expireAfter)&&me(i.COUPON_EXPIRATION.DYNAMIC_EXPIRATION)),u){case i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER:p(0,1),Z(i.DISCOUNT_APPLIES_TO.ENTIRE_ORDER);break;case i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS:p(0,1),(null===(e=c.entitledCollectionIds)||void 0===e?void 0:e.length)?Z(i.DISCOUNT_APPLIES_TO.SPECIFIC_COLLECTIONS):(null===(t=c.entitledProductIds)||void 0===t?void 0:t.length)||(null===(o=c.productVariableConf)||void 0===o?void 0:o.entitledProductVariable)?(Z(i.DISCOUNT_APPLIES_TO.SPECIFIC_PRODUCTS),C(null===(n=c.productVariableConf)||void 0===n?void 0:n.entitledProductVariable,se)):Z(i.DISCOUNT_APPLIES_TO.ENTIRE_ORDER);break;case i.DISCOUNT_TYPES.BUY_X_GET_Y:Oe(V[2]),(null===(l=c.entitledCollectionIds)||void 0===l?void 0:l.length)?te(i.OFFER_APPLIES_TO.SPECIFIC_COLLECTIONS):(te(i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS),C(null===(r=c.productVariableConf)||void 0===r?void 0:r.entitledProductVariable,se)),(null===(a=c.prerequisiteCollectionIds)||void 0===a?void 0:a.length)?W(i.OFFER_APPLIES_TO.SPECIFIC_COLLECTIONS):(W(i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS),C(null===(d=c.productVariableConf)||void 0===d?void 0:d.prerequisiteProductVariable,ue));break;case i.DISCOUNT_TYPES.FREE_SHIPPING:Oe(V[3])}G(Object.assign({},c)),y.hideProbability||(s=je()),X(O.validateDiscountData(c,z,u,y.hideProbability||!1,s,!!c.isStaticCoupon)),y.hideProbability||je()}),[]),t.useEffect((()=>{let e;y.hideProbability||(e=je()),X(O.validateDiscountData(w,z,Q,y.hideProbability||!1,e,!!w.isStaticCoupon))}),[w,Te,Q,z]),t.useEffect((()=>{var e,t,i,o,n,l,r;if(!y.newPickerConf&&((null===(e=y.products)||void 0===e?void 0:e.length)||(null===(t=y.collection)||void 0===t?void 0:t.length))){if(y.products&&(null===(i=y.products)||void 0===i?void 0:i.length)){if(null===(o=y.data)||void 0===o?void 0:o.entitledProductIds){const e=y.products.filter((e=>{var t,i;return null===(i=null===(t=y.data)||void 0===t?void 0:t.entitledProductIds)||void 0===i?void 0:i.includes(parseInt(e.id))}));le(e)}if(null===(n=y.data)||void 0===n?void 0:n.prerequisiteProductIds){const e=y.products.filter((e=>{var t,i;return null===(i=null===(t=y.data)||void 0===t?void 0:t.prerequisiteProductIds)||void 0===i?void 0:i.includes(parseInt(e.id))}));oe(e)}}if(y.collection&&y.collection.length){if(null===(l=y.data)||void 0===l?void 0:l.entitledCollectionIds){const e=y.collection.filter((e=>{var t,i;return null===(i=null===(t=y.data)||void 0===t?void 0:t.entitledCollectionIds)||void 0===i?void 0:i.includes(parseInt(e.id))}));Ce(e)}if(null===(r=y.data)||void 0===r?void 0:r.prerequisiteCollectionIds){const e=y.collection.filter((e=>{var t,i;return null===(i=null===(t=y.data)||void 0===t?void 0:t.prerequisiteCollectionIds)||void 0===i?void 0:i.includes(parseInt(e.id))}));ae(e)}}}}),[y.products,y.collection]),t.useEffect((()=>{var e,t,i,o,n,l,r,a;(null===(t=null===(e=y.data)||void 0===e?void 0:e.productsConf)||void 0===t?void 0:t.entitledProducts)&&le(y.data.productsConf.entitledProducts),(null===(o=null===(i=y.data)||void 0===i?void 0:i.productsConf)||void 0===o?void 0:o.prerequisiteProducts)&&oe(y.data.productsConf.prerequisiteProducts),(null===(l=null===(n=y.data)||void 0===n?void 0:n.collectionsConf)||void 0===l?void 0:l.entitledCollections)&&Ce(y.data.collectionsConf.entitledCollections),(null===(a=null===(r=y.data)||void 0===r?void 0:r.collectionsConf)||void 0===a?void 0:a.prerequisiteCollections)&&ae(y.data.collectionsConf.prerequisiteCollections)}),[null===(m=y.data)||void 0===m?void 0:m.productsConf,null===(f=y.data)||void 0===f?void 0:f.collectionsConf]),t.useEffect((()=>{if(!ne)return;if(y.newPickerConf){const e=[];return Object.values(ne).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void G(Object.assign(Object.assign({},w),{entitledProductIds:e}))}const e=ne.map((e=>parseInt(e.id)));G(Object.assign(Object.assign({},w),{entitledProductIds:e}))}),[ne]),t.useEffect((()=>{if(!ie)return;if(y.newPickerConf){const e=[];return Object.values(ie).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void G(Object.assign(Object.assign({},w),{prerequisiteProductIds:e}))}const e=ie.map((e=>parseInt(e.id)));G(Object.assign(Object.assign({},w),{prerequisiteProductIds:e}))}),[ie]),t.useEffect((()=>{if(!pe)return;if(y.newPickerConf){(null==pe?void 0:pe.isCustom)&&delete pe.isCustom;const e=Object.keys(pe).map((e=>parseInt(e)));return void G(Object.assign(Object.assign({},w),{entitledCollectionIds:e}))}const e=pe.map((e=>parseInt(e.id)));G(Object.assign(Object.assign({},w),{entitledCollectionIds:e}))}),[pe]),t.useEffect((()=>{if(!re)return;if(y.newPickerConf){(null==re?void 0:re.isCustom)&&delete re.isCustom;const e=Object.keys(re).map((e=>parseInt(e)));return void G(Object.assign(Object.assign({},w),{prerequisiteCollectionIds:e}))}const e=re.map((e=>parseInt(e.id)));G(Object.assign(Object.assign({},w),{prerequisiteCollectionIds:e}))}),[re]);const Ue=()=>{var e,t;let o,n=w;return w.isStaticCoupon||(w.targetType===i.DISCOUNT_TARGET_TYPES.SHIPPING_LINE?o=i.DISCOUNT_TYPES.FREE_SHIPPING:w.targetType===i.DISCOUNT_TARGET_TYPES.LINE_ITEM?o=w.targetSelection===i.DISCOUNT_TARGET_SELECTION.ENTITLED?(null===(e=w.prerequisiteProductIds)||void 0===e?void 0:e.length)||(null===(t=w.prerequisiteCollectionIds)||void 0===t?void 0:t.length)||w.prerequisiteQuantity||w.entitledQuantity?i.DISCOUNT_TYPES.BUY_X_GET_Y:i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS:i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER:(n=Object.assign(Object.assign({},n),{targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,targetSelection:i.DISCOUNT_TARGET_SELECTION.ALL,valueType:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT}),o=i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER)),{discountType:o,tempCouponData:n}},Ae=()=>{ye(i.initialStaticCouponErrorState),Ne(i.initialDynamicCouponErrorState)},ge=e=>{var t;const i={invalidDiscountCode:"Please add Discount Code",invalidCouponTitle:"Please add Discount Coupon Title",invalidCouponDescription:"Please add Coupon Description",inValidProbability:e.inValidProbability&&(null!==(t=w.probability)&&void 0!==t?t:-1)>1?"Probability should not exceed 1":w.isStaticCoupon?"Please add Probability":"Probability should be greater than 0",inValidDiscountAmount:"Please add Discount Amount",inValidMinimumAmount:"Specify minimum amount required",inValidMinimumQuantity:"Specify minimum items required",inValidCouponExpiry:"Please add Coupon Expiry",inValidProductSelection:"Please specify the products",inValidProductVariableSelection:"Please specify the product variables",inValidCollectionSelection:"Please specify the collections",inValidBuyXValue:"Please specify buy product quantity",inValidGetYValue:"Please specify get product quantity",inValidBuyXProductSelection:"Please specify the products",inValidBuyXCollectionSelection:"Please specify the collections",inValidGetYProductSelection:"Please specify the products",inValidGetYCollectionSelection:"Please specify the collections",inValidBuyXProductVariableSelection:"Please specify the product variables",inValidGetYProductVariableSelection:"Please specify the product variables"};let o="";Object.keys(e).forEach((t=>{e[t]&&(o=i[t])}));const n=Object.values(e).filter(Boolean).length;return n>0&&(Ee(n>1?"Please add discount details":o),!0)},je=()=>{if(!y.quadrant||!y.probability)return;const e=[...y.probability];let t=[];e.length>=y.quadrant&&e.splice(y.quadrant-1,1),t=e;const i=t.reduce(((e,t)=>e+t),0)+(w.probability||0);return Se(parseFloat(i.toFixed(4))),parseFloat(i.toFixed(4))},Re=e=>{var t,o,n,l,r,a,d,s,c,u,p,C,T,S,P,E;const I=e.value;H(I),oe([]),le([]),ae([]),Ce([]),I===i.DISCOUNT_TYPES.FREE_SHIPPING?G({value:100,targetSelection:i.DISCOUNT_TARGET_SELECTION.ALL,targetType:i.DISCOUNT_TARGET_TYPES.SHIPPING_LINE,valueType:i.DISCOUNT_VALUE_TYPES.PERCENTAGE,quadrant:w.quadrant,isStaticCoupon:!1,title:w.title,expireAt:null!==(t=w.expireAt)&&void 0!==t?t:void 0,expireAfter:null!==(o=w.expireAfter)&&void 0!==o?o:void 0,probability:w.probability,minQuantity:null!==(n=w.minQuantity)&&void 0!==n?n:void 0,minAmount:null!==(l=w.minAmount)&&void 0!==l?l:void 0}):I===i.DISCOUNT_TYPES.BUY_X_GET_Y?G({value:100,targetSelection:i.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:i.DISCOUNT_VALUE_TYPES.PERCENTAGE,quadrant:w.quadrant,isStaticCoupon:!1,title:w.title,expireAt:null!==(r=w.expireAt)&&void 0!==r?r:void 0,expireAfter:null!==(a=w.expireAfter)&&void 0!==a?a:void 0,probability:w.probability,minQuantity:void 0,minAmount:void 0}):I===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER?G({targetSelection:i.DISCOUNT_TARGET_SELECTION.ALL,targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:null!==(d=w.valueType)&&void 0!==d?d:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,quadrant:w.quadrant,isStaticCoupon:!1,title:w.title,expireAt:null!==(s=w.expireAt)&&void 0!==s?s:void 0,expireAfter:null!==(c=w.expireAfter)&&void 0!==c?c:void 0,probability:w.probability,value:w.value,minQuantity:null!==(u=w.minQuantity)&&void 0!==u?u:void 0,minAmount:null!==(p=w.minAmount)&&void 0!==p?p:void 0}):I===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS&&G({targetSelection:i.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:null!==(C=w.valueType)&&void 0!==C?C:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,quadrant:w.quadrant,isStaticCoupon:!1,title:w.title,expireAt:null!==(T=w.expireAt)&&void 0!==T?T:void 0,expireAfter:null!==(S=w.expireAfter)&&void 0!==S?S:void 0,probability:w.probability,value:w.value,minQuantity:null!==(P=w.minQuantity)&&void 0!==P?P:void 0,minAmount:null!==(E=w.minAmount)&&void 0!==E?E:void 0})},xe=t=>t&&e.jsx(d.Tag,{theme:"light",tagText:t,type:"negative",LeadingIcon:T.default});return e.jsxs(r.StyledModal,Object.assign({width:(M||F)&&y.newPickerConf?"25px":"640px",open:y.isOpen,hideCrossButton:!!q,headingTitle:F?"Select Products":y.title,headingSubtitle:F?void 0:y.subTitle,footerLeftCustomElement:Pe?xe(Pe):y.errorMsg?xe(y.errorMsg):!y.quadrant||y.hideProbability?e.jsx(e.Fragment,{}):Te<=1?e.jsx(d.Tag,{theme:"light",tagText:`Current probability sum: ${Te}`,type:"white"}):e.jsx(s.Tooltip,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e.jsx("div",{children:e.jsx(d.Tag,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${Te}`,type:"negative",LeadingIcon:C.default})})})),headerRightCustomElement:y.allowStaticCoupon||F?void 0:e.jsx(o.Dropdown,{options:fe,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{Re(e)}}),onClose:y.onClose,footerContainerStyle:{borderTop:`1px solid ${l.DEFAULT_THEME.colorsV2.stroke.primary}`},primaryButton:F?{buttonType:"primary",onClick:()=>{k(void 0)},buttonText:"Add"}:M?{buttonType:"primary",onClick:()=>{Y(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Create discount code",isLoading:null!==(U=y.loading)&&void 0!==U&&U,onClick:()=>{var e,t,o,n,l;if(Ae(),w.isStaticCoupon){const{isStaticCoupon:e,couponCode:t,title:i,description:o,quadrant:n,probability:l}=w,r={invalidDiscountCode:!t,invalidCouponTitle:!i,invalidCouponDescription:!o,inValidProbability:!y.hideProbability&&(null!=l?l:-1)<0||(null!=l?l:0)>1||Number.isNaN(null!=l?l:0)};if(ge(r))return void ye(r);if(B||Te>1)return void Ee(!y.hideProbability&&Te>1?"Probability sum should not exceed 1":"Invalid coupon details");y.onSaveClicked({quadrant:n,couponCode:t,description:o,isStaticCoupon:e,probability:l,title:w.title})}else{const r={invalidCouponTitle:!w.title,inValidProbability:!y.hideProbability&&(null!==(e=w.probability)&&void 0!==e?e:-1)<=0||(null!==(t=w.probability)&&void 0!==t?t:-1)>1||Number.isNaN(null!==(o=w.probability)&&void 0!==o?o:-1),inValidDiscountAmount:!w.value,inValidMinimumQuantity:!1,inValidMinimumAmount:!1,inValidCouponExpiry:!1,inValidProductSelection:!1,inValidProductVariableSelection:!1,inValidCollectionSelection:!1,inValidBuyXValue:!1,inValidGetYValue:!1,inValidBuyXProductSelection:!1,inValidGetYProductSelection:!1,inValidBuyXCollectionSelection:!1,inValidGetYCollectionSelection:!1,inValidBuyXProductVariableSelection:!1,inValidGetYProductVariableSelection:!1};if(Q!==i.DISCOUNT_TYPES.BUY_X_GET_Y&&z!==i.MIN_PURCHASE_REQUIREMENT.NA){const{minAmount:e,minQuantity:t}=w;r.inValidMinimumAmount=z===i.MIN_PURCHASE_REQUIREMENT.AMOUNT&&!e,r.inValidMinimumQuantity=z===i.MIN_PURCHASE_REQUIREMENT.QUANTITY&&!t}if(ve&&(r.inValidCouponExpiry=!w.expireAt&&!w.expireAfter),Q!==i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER&&Q!==i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS||($!==i.DISCOUNT_APPLIES_TO.SPECIFIC_PRODUCTS||!ne||Object.keys(ne).length||de||(r.inValidProductSelection=!0,r.inValidProductVariableSelection=!0),$===i.DISCOUNT_APPLIES_TO.SPECIFIC_COLLECTIONS&&pe&&!Object.keys(pe).length&&(r.inValidCollectionSelection=!0)),Q===i.DISCOUNT_TYPES.BUY_X_GET_Y&&(w.prerequisiteQuantity||(r.inValidBuyXValue=!0),w.entitledQuantity||(r.inValidGetYValue=!0),J!==i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS||!ie||Object.keys(ie).length||ce||(r.inValidBuyXProductSelection=!0,r.inValidBuyXProductVariableSelection=!0),J===i.OFFER_APPLIES_TO.SPECIFIC_COLLECTIONS&&re&&!Object.keys(re).length&&(r.inValidBuyXCollectionSelection=!0),ee!==i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS||!ne||Object.keys(ne).length||de||(r.inValidGetYProductSelection=!0,r.inValidGetYProductVariableSelection=!0),ee===i.OFFER_APPLIES_TO.SPECIFIC_COLLECTIONS&&pe&&!Object.keys(pe).length&&(r.inValidGetYCollectionSelection=!0)),ge(r))return void Ne(r);if(B||Te>1)return void Ee(!y.hideProbability&&Te>1?"Probability sum should not exceed 1":"Invalid coupon details");y.onSaveClicked(Object.assign(Object.assign({},w),{description:O.descriptionBuilder(w,y.currency,null!==(n=y.products)&&void 0!==n?n:[],null!==(l=y.collection)&&void 0!==l?l:[]),productsConf:{entitledProducts:null!=ne?ne:[],prerequisiteProducts:null!=ie?ie:[]},collectionsConf:{entitledCollections:null!=pe?pe:[],prerequisiteCollections:null!=re?re:[]},productVariableConf:{entitledProductVariable:null!=de?de:{},prerequisiteProductVariable:null!=ce?ce:{}}}))}}},secondaryButton:F?{buttonType:"tertiaryGray",onClick:()=>{k(void 0)},buttonText:"Back"}:M?{buttonType:"tertiaryGray",onClick:()=>{Y(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:y.onClose,buttonText:"Cancel"}},{children:[!F&&!M&&e.jsxs(I.StyledDiscountDialogueContainer,{children:[y.allowStaticCoupon&&!F&&e.jsxs(I.CouponTypeContainerStyled,Object.assign({selectedDiv:w.isStaticCoupon?1:2},{children:["static"===y.hideOption?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{w.isStaticCoupon||(G({isStaticCoupon:!0,quadrant:w.quadrant}),Ee(""),Ae())}},{children:[e.jsx(n.TitleSmall,Object.assign({style:{marginBottom:"4px",color:w.isStaticCoupon?l.DEFAULT_THEME.colorsV2.content.brand:void 0}},{children:"Static Code"})),e.jsx(n.BodyCaption,Object.assign({style:w.isStaticCoupon?{color:l.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"A uniform code provided manually, used for providing the same discount to all customers."}))]})),"dynamic"===y.hideOption?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{var t;w.isStaticCoupon&&(H(i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER),G({isStaticCoupon:!1,quadrant:w.quadrant,targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,targetSelection:i.DISCOUNT_TARGET_SELECTION.ALL,valueType:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT}),Ee(""),Ae(),Oe({id:"0",label:"Amount",value:"amount",icon:t=>e.jsx("span",Object.assign({style:{fontSize:20,color:t}},{children:y.currency||""}))}),_e(null!==(t=y.makeExpiryMandatory)&&void 0!==t&&t),K(i.MIN_PURCHASE_REQUIREMENT.NA))}},{children:[e.jsx(n.TitleSmall,Object.assign({style:{marginBottom:"4px",color:w.isStaticCoupon?void 0:l.DEFAULT_THEME.colorsV2.content.brand}},{children:"Dynamic Code"})),e.jsx(n.BodyCaption,Object.assign({style:w.isStaticCoupon?{}:{color:l.DEFAULT_THEME.colorsV2.content.brand}},{children:"Code will be unique for all customers, with the first 5 letters of the customer's name, followed by 10 random characters."}))]}))]})),e.jsx(n.TitleRegular,Object.assign({style:{marginTop:"24px"}},{children:"Coupon Details"})),w.isStaticCoupon&&!F&&e.jsx(_.default,{discountData:w,setDiscountData:G,hideProbability:y.hideProbability||!1,discountAdminUrl:y.discountAdminUrl,staticDiscountValidationError:be,currency:y.currency}),!w.isStaticCoupon&&!F&&!M&&e.jsx(v.default,{currency:y.currency,entitledProducts:null!=ne?ne:[],prerequisiteProducts:null!=ie?ie:[],setEntitledProducts:le,setPrerequisiteProducts:oe,discountData:w,productPickerOpen:F,productVariablePickerOpen:q,setIsProductPickerOpen:k,setIsProductVariablePickerOpen:L,setDiscountData:G,selectedCouponType:Q,setSelectedCouponType:H,selectedMinimumRequirement:z,setSelectedMinimumRequirement:K,discountCouponAppliesTo:$,offerAppliesToBuy:J,offerAppliesToGet:ee,setDiscountCouponAppliesTo:Z,setOfferAppliesToBuy:W,setOfferAppliesToGet:te,hideProbability:y.hideProbability||!1,hideExpiration:y.hideExpiration||!1,allowStaticCoupon:y.allowStaticCoupon,onChangeCouponType:Re,collectionPickerOpen:M,entitledCollections:null!=pe?pe:[],prerequisiteCollections:null!=re?re:[],setIsCollectionPickerOpen:Y,setEntitledCollections:Ce,setPrerequisiteCollections:ae,useNewPicker:!!y.newPickerConf,setSelectedDiscountDetails:Oe,selectedDiscountDetails:Ie,isProductVariableSupported:y.isProductVariableSupported,entitledProductVariable:de,setEntitledProductVariable:se,preRequisiteProductVariable:ce,setPreRequisiteProductVariable:ue,productVariableList:y.productVariableList,isAddExpirationChecked:ve,setIsAddExpirationChecked:_e,dynamicDiscountValidationError:De,setDynamicDiscountValidationError:Ne,setValidationErrorMessage:Ee,resetValidationErrors:Ae,discountDetailsOptions:V,selectedExpiration:he,setSelectedExpiration:me,makeExpiryMandatory:!!y.makeExpiryMandatory})]}),!!F&&e.jsxs(e.Fragment,{children:[!y.newPickerConf&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsx(a.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(A=y.products)&&void 0!==A?A:[],title:"Select Products",onClose:()=>{k(void 0)},selectedProducts:null!==(g=F===v.DISCOUNT_PRODUCTS.ENTITLED?ne:ie)&&void 0!==g?g:[],setSelectedProducts:F===v.DISCOUNT_PRODUCTS.ENTITLED?le:oe,onSearchKeyChange:y.onProductSearch})})),y.newPickerConf&&e.jsx(S.ProductPickerModal,{visible:!0,onClose:()=>k(void 0),collectionFetcher:(e,t,i)=>{var o;return(null===(o=y.newPickerConf)||void 0===o?void 0:o.fetchCollections)?y.newPickerConf.fetchCollections(e,t,!1,i):null},productFetcher:(e,t,i,o,n)=>{var l;return(null===(l=y.newPickerConf)||void 0===l?void 0:l.fetchProducts)?y.newPickerConf.fetchProducts(e,t,o,n,!1,i):null},selectedItems:F===v.DISCOUNT_PRODUCTS.ENTITLED?ne:ie,onAdd:e=>{F===v.DISCOUNT_PRODUCTS.ENTITLED?le(e):oe(e),k(void 0)},zIndex:200,storeId:y.newPickerConf.storeId,appType:y.newPickerConf.appType||b.__exports.ApplicationType.BIK,searchInCollectionFetcher:(e,t,i,o)=>{var n;return(null===(n=y.newPickerConf)||void 0===n?void 0:n.searchInCollection)?y.newPickerConf.searchInCollection(e,t,i,!1,o):null},customCollectionRestriction:!1,searchFetcher:(e,t,i)=>{var o;return(null===(o=y.newPickerConf)||void 0===o?void 0:o.searchProducts)?y.newPickerConf.searchProducts(e,t,!1,i):null},hideCollectionCheckbox:!0,hideVariantCheckbox:!0,selectProductsFromCustomCollection:!0,hideSelectionCount:!0})]}),!!M&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsxs(e.Fragment,{children:[y.newPickerConf&&e.jsx(S.ProductPickerModal,{visible:!0,onClose:()=>Y(void 0),collectionFetcher:y.newPickerConf.fetchCollections,productFetcher:y.newPickerConf.fetchProducts,selectedItems:M===v.DISCOUNT_PRODUCTS.ENTITLED?pe:re,onAdd:e=>{Object.values(e).forEach((e=>{e.products&&delete e.products})),M===v.DISCOUNT_PRODUCTS.ENTITLED?Ce(e):ae(e),Y(void 0)},customCollectionRestriction:!1,zIndex:200,storeId:y.newPickerConf.storeId,appType:y.newPickerConf.appType||b.__exports.ApplicationType.BIK,searchInCollectionFetcher:y.newPickerConf.searchInCollection,searchFetcher:y.newPickerConf.searchProducts,hideProductCheckbox:!0,hideVariantCheckbox:!0,title:"Select Collections",hideGlobalSearch:!0,hideSelectionCount:!0}),!y.newPickerConf&&e.jsx(a.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(j=y.collection)&&void 0!==j?j:[],title:"Select Products",onClose:()=>{Y(void 0)},selectedProducts:null!==(R=M===v.DISCOUNT_PRODUCTS.ENTITLED?pe:re)&&void 0!==R?R:[],setSelectedProducts:M===v.DISCOUNT_PRODUCTS.ENTITLED?Ce:ae,onSearchKeyChange:y.onCollectionSearch,searchPlaceholder:"Search collections..."})]})})),q&&e.jsx(I.VariablePickerContainer,{children:e.jsx("div",Object.assign({style:{width:"50%",height:"100%",marginLeft:"50%"}},{children:e.jsx(E.VariablePicker,{type:P.PickerType.EMBEDDED,data:null!==(x=y.productVariableList)&&void 0!==x?x:[],showHeader:!0,onSelect:e=>{if(q===v.DISCOUNT_PRODUCTS.ENTITLED){const{displayName:t,actualValue:i,isAvailable:o}=e;se({displayName:t,actualValue:i,isAvailable:o}),L(void 0)}if(q===v.DISCOUNT_PRODUCTS.PREREQUISITE){const{displayName:t,actualValue:i,isAvailable:o}=e;ue({displayName:t,actualValue:i,isAvailable:o}),L(void 0)}},onClose:()=>{L(void 0)}})}))})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../node_modules/@bikdotai/bik-models/growth/models/bik-store.js");var t=require("react"),i=require("./type.js");require("../dropdown/DropdownPopover/index.js");var o=require("../dropdown/Dropdown.js");require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js"),l=require("../../constants/Theme.js");require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../icon-button/IconButton.js"),require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");var r=require("../modals/styledModal.js"),a=require("../product-picker/ProductPickerModal.js"),d=require("../tag/Tag.js"),s=require("../tooltips/Tooltip.js"),c=require("../../assets/icons/gift_icon.svg.js"),u=require("../../assets/icons/percentage_icon.svg.js"),p=require("../../assets/icons/shipping_icon.svg.js"),C=require("../../assets/icons/triangle_error.svg.js"),T=require("../../assets/icons/warning.svg.js"),S=require("../product-picker-v2/modal.js");require("../product-picker-v2/type.js");var P=require("../variable-picker-v3/model.js"),E=require("../variable-picker-v3/VariablePicker.js"),I=require("./DiscountModal.styled.js"),O=require("./DiscountUtils.js"),v=require("./DynamicCoupon/DynamicCoupon.js"),_=require("./StaticCoupon/StaticCoupon.js"),b=require("../../_virtual/bik-store.js");exports.DiscountModal=y=>{var D,N,h,m,f,U,A,g,j,R,x;const V=[{id:"0",label:"Amount",value:"amount",icon:t=>e.jsx("span",Object.assign({style:{fontSize:20,color:t,lineHeight:.9}},{children:y.currency||""}))},{id:"1",label:"Percentage",value:"percentage",icon:t=>e.jsx(u.default,{width:24,height:24,color:t})},{id:"2",label:"Buy X get Y",value:i.DISCOUNT_TYPES.BUY_X_GET_Y,icon:t=>e.jsx(c.default,{width:24,height:24,color:t})},{id:"3",label:"Free Shipping",value:i.DISCOUNT_TYPES.FREE_SHIPPING,icon:t=>e.jsx(p.default,{width:24,height:24,color:t})}],[F,k]=t.useState(),[q,L]=t.useState(),[M,Y]=t.useState(),[w,G]=t.useState(null!==(D=y.data)&&void 0!==D?D:"string"==typeof y.hideOption?{isStaticCoupon:"dynamic"===y.hideOption}:{isStaticCoupon:!0}),[B,X]=t.useState(!0),[Q,H]=t.useState(),[z,K]=t.useState((null===(N=y.data)||void 0===N?void 0:N.minAmount)?i.MIN_PURCHASE_REQUIREMENT.AMOUNT:(null===(h=y.data)||void 0===h?void 0:h.minQuantity)?i.MIN_PURCHASE_REQUIREMENT.QUANTITY:i.MIN_PURCHASE_REQUIREMENT.NA),[$,Z]=t.useState(i.DISCOUNT_APPLIES_TO.ENTIRE_ORDER),[J,W]=t.useState(i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS),[ee,te]=t.useState(i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS),[ie,oe]=t.useState(void 0),[ne,le]=t.useState(void 0),[re,ae]=t.useState(void 0),[de,se]=t.useState(void 0),[ce,ue]=t.useState(void 0),[pe,Ce]=t.useState(void 0),[Te,Se]=t.useState(0),[Pe,Ee]=t.useState(""),[Ie,Oe]=t.useState(V[0]),[ve,_e]=t.useState(!1),[be,ye]=t.useState(i.initialStaticCouponErrorState),[De,Ne]=t.useState(i.initialDynamicCouponErrorState),[he,me]=t.useState(i.COUPON_EXPIRATION.DYNAMIC_EXPIRATION),fe=[{value:i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:Q===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER},{value:i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:Q===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS},{value:i.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:Q===i.DISCOUNT_TYPES.BUY_X_GET_Y},{value:i.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:Q===i.DISCOUNT_TYPES.FREE_SHIPPING}];t.useEffect((()=>{y.makeExpiryMandatory&&_e(!0)}),[y.makeExpiryMandatory]),t.useEffect((()=>{var e,t,o,n,l,r,a,d;let s;const{tempCouponData:c,discountType:u}=Ue();H(u);const p=(e,t)=>{Oe(c.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?V[e]:V[t])},C=(e,t)=>{Object.keys(e||{}).length&&t(e)};switch(((null==c?void 0:c.expireAfter)||(null==c?void 0:c.expireAt))&&(_e(!0),(null==c?void 0:c.expireAt)&&me(i.COUPON_EXPIRATION.FIXED_EXPIRATION),(null==c?void 0:c.expireAfter)&&me(i.COUPON_EXPIRATION.DYNAMIC_EXPIRATION)),u){case i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER:p(0,1),Z(i.DISCOUNT_APPLIES_TO.ENTIRE_ORDER);break;case i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS:p(0,1),(null===(e=c.entitledCollectionIds)||void 0===e?void 0:e.length)?Z(i.DISCOUNT_APPLIES_TO.SPECIFIC_COLLECTIONS):(null===(t=c.entitledProductIds)||void 0===t?void 0:t.length)||(null===(o=c.productVariableConf)||void 0===o?void 0:o.entitledProductVariable)?(Z(i.DISCOUNT_APPLIES_TO.SPECIFIC_PRODUCTS),C(null===(n=c.productVariableConf)||void 0===n?void 0:n.entitledProductVariable,se)):Z(i.DISCOUNT_APPLIES_TO.ENTIRE_ORDER);break;case i.DISCOUNT_TYPES.BUY_X_GET_Y:Oe(V[2]),(null===(l=c.entitledCollectionIds)||void 0===l?void 0:l.length)?te(i.OFFER_APPLIES_TO.SPECIFIC_COLLECTIONS):(te(i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS),C(null===(r=c.productVariableConf)||void 0===r?void 0:r.entitledProductVariable,se)),(null===(a=c.prerequisiteCollectionIds)||void 0===a?void 0:a.length)?W(i.OFFER_APPLIES_TO.SPECIFIC_COLLECTIONS):(W(i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS),C(null===(d=c.productVariableConf)||void 0===d?void 0:d.prerequisiteProductVariable,ue));break;case i.DISCOUNT_TYPES.FREE_SHIPPING:Oe(V[3])}G(Object.assign({},c)),y.hideProbability||(s=je()),X(O.validateDiscountData(c,z,u,y.hideProbability||!1,s,!!c.isStaticCoupon)),y.hideProbability||je()}),[]),t.useEffect((()=>{let e;y.hideProbability||(e=je()),X(O.validateDiscountData(w,z,Q,y.hideProbability||!1,e,!!w.isStaticCoupon))}),[w,Te,Q,z]),t.useEffect((()=>{var e,t,i,o,n,l,r;if(!y.newPickerConf&&((null===(e=y.products)||void 0===e?void 0:e.length)||(null===(t=y.collection)||void 0===t?void 0:t.length))){if(y.products&&(null===(i=y.products)||void 0===i?void 0:i.length)){if(null===(o=y.data)||void 0===o?void 0:o.entitledProductIds){const e=y.products.filter((e=>{var t,i;return null===(i=null===(t=y.data)||void 0===t?void 0:t.entitledProductIds)||void 0===i?void 0:i.includes(parseInt(e.id))}));le(e)}if(null===(n=y.data)||void 0===n?void 0:n.prerequisiteProductIds){const e=y.products.filter((e=>{var t,i;return null===(i=null===(t=y.data)||void 0===t?void 0:t.prerequisiteProductIds)||void 0===i?void 0:i.includes(parseInt(e.id))}));oe(e)}}if(y.collection&&y.collection.length){if(null===(l=y.data)||void 0===l?void 0:l.entitledCollectionIds){const e=y.collection.filter((e=>{var t,i;return null===(i=null===(t=y.data)||void 0===t?void 0:t.entitledCollectionIds)||void 0===i?void 0:i.includes(parseInt(e.id))}));Ce(e)}if(null===(r=y.data)||void 0===r?void 0:r.prerequisiteCollectionIds){const e=y.collection.filter((e=>{var t,i;return null===(i=null===(t=y.data)||void 0===t?void 0:t.prerequisiteCollectionIds)||void 0===i?void 0:i.includes(parseInt(e.id))}));ae(e)}}}}),[y.products,y.collection]),t.useEffect((()=>{var e,t,i,o,n,l,r,a;(null===(t=null===(e=y.data)||void 0===e?void 0:e.productsConf)||void 0===t?void 0:t.entitledProducts)&&le(y.data.productsConf.entitledProducts),(null===(o=null===(i=y.data)||void 0===i?void 0:i.productsConf)||void 0===o?void 0:o.prerequisiteProducts)&&oe(y.data.productsConf.prerequisiteProducts),(null===(l=null===(n=y.data)||void 0===n?void 0:n.collectionsConf)||void 0===l?void 0:l.entitledCollections)&&Ce(y.data.collectionsConf.entitledCollections),(null===(a=null===(r=y.data)||void 0===r?void 0:r.collectionsConf)||void 0===a?void 0:a.prerequisiteCollections)&&ae(y.data.collectionsConf.prerequisiteCollections)}),[null===(m=y.data)||void 0===m?void 0:m.productsConf,null===(f=y.data)||void 0===f?void 0:f.collectionsConf]),t.useEffect((()=>{if(!ne)return;if(y.newPickerConf){const e=[];return Object.values(ne).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void G(Object.assign(Object.assign({},w),{entitledProductIds:e}))}const e=ne.map((e=>parseInt(e.id)));G(Object.assign(Object.assign({},w),{entitledProductIds:e}))}),[ne]),t.useEffect((()=>{if(!ie)return;if(y.newPickerConf){const e=[];return Object.values(ie).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void G(Object.assign(Object.assign({},w),{prerequisiteProductIds:e}))}const e=ie.map((e=>parseInt(e.id)));G(Object.assign(Object.assign({},w),{prerequisiteProductIds:e}))}),[ie]),t.useEffect((()=>{if(!pe)return;if(y.newPickerConf){(null==pe?void 0:pe.isCustom)&&delete pe.isCustom;const e=Object.keys(pe).map((e=>parseInt(e)));return void G(Object.assign(Object.assign({},w),{entitledCollectionIds:e}))}const e=pe.map((e=>parseInt(e.id)));G(Object.assign(Object.assign({},w),{entitledCollectionIds:e}))}),[pe]),t.useEffect((()=>{if(!re)return;if(y.newPickerConf){(null==re?void 0:re.isCustom)&&delete re.isCustom;const e=Object.keys(re).map((e=>parseInt(e)));return void G(Object.assign(Object.assign({},w),{prerequisiteCollectionIds:e}))}const e=re.map((e=>parseInt(e.id)));G(Object.assign(Object.assign({},w),{prerequisiteCollectionIds:e}))}),[re]);const Ue=()=>{var e,t;let o,n=w;return w.isStaticCoupon||(w.targetType===i.DISCOUNT_TARGET_TYPES.SHIPPING_LINE?o=i.DISCOUNT_TYPES.FREE_SHIPPING:w.targetType===i.DISCOUNT_TARGET_TYPES.LINE_ITEM?o=w.targetSelection===i.DISCOUNT_TARGET_SELECTION.ENTITLED?(null===(e=w.prerequisiteProductIds)||void 0===e?void 0:e.length)||(null===(t=w.prerequisiteCollectionIds)||void 0===t?void 0:t.length)||w.prerequisiteQuantity||w.entitledQuantity?i.DISCOUNT_TYPES.BUY_X_GET_Y:i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS:i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER:(n=Object.assign(Object.assign({},n),{targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,targetSelection:i.DISCOUNT_TARGET_SELECTION.ALL,valueType:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT}),o=i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER)),{discountType:o,tempCouponData:n}},Ae=()=>{ye(i.initialStaticCouponErrorState),Ne(i.initialDynamicCouponErrorState)},ge=e=>{var t;const i={invalidDiscountCode:"Please add Discount Code",invalidCouponTitle:"Please add Discount Coupon Title",invalidCouponDescription:"Please add Coupon Description",inValidProbability:e.inValidProbability&&(null!==(t=w.probability)&&void 0!==t?t:-1)>1?"Probability should not exceed 1":w.isStaticCoupon?"Please add Probability":"Probability should be greater than 0",inValidDiscountAmount:"Please add Discount Amount",inValidMinimumAmount:"Specify minimum amount required",inValidMinimumQuantity:"Specify minimum items required",inValidCouponExpiry:"Please add Coupon Expiry",inValidProductSelection:"Please specify the products",inValidProductVariableSelection:"Please specify the product variables",inValidCollectionSelection:"Please specify the collections",inValidBuyXValue:"Please specify buy product quantity",inValidGetYValue:"Please specify get product quantity",inValidBuyXProductSelection:"Please specify the products",inValidBuyXCollectionSelection:"Please specify the collections",inValidGetYProductSelection:"Please specify the products",inValidGetYCollectionSelection:"Please specify the collections",inValidBuyXProductVariableSelection:"Please specify the product variables",inValidGetYProductVariableSelection:"Please specify the product variables"};let o="";Object.keys(e).forEach((t=>{e[t]&&(o=i[t])}));const n=Object.values(e).filter(Boolean).length;return n>0&&(Ee(n>1?"Please add discount details":o),!0)},je=()=>{if(!y.quadrant||!y.probability)return;const e=[...y.probability];let t=[];e.length>=y.quadrant&&e.splice(y.quadrant-1,1),t=e;const i=t.reduce(((e,t)=>e+t),0)+(w.probability||0);return Se(parseFloat(i.toFixed(4))),parseFloat(i.toFixed(4))},Re=e=>{var t,o,n,l,r,a,d,s,c,u,p,C,T,S,P,E;const I=e.value;H(I),oe([]),le([]),ae([]),Ce([]),I===i.DISCOUNT_TYPES.FREE_SHIPPING?G({value:100,targetSelection:i.DISCOUNT_TARGET_SELECTION.ALL,targetType:i.DISCOUNT_TARGET_TYPES.SHIPPING_LINE,valueType:i.DISCOUNT_VALUE_TYPES.PERCENTAGE,quadrant:w.quadrant,isStaticCoupon:!1,title:w.title,expireAt:null!==(t=w.expireAt)&&void 0!==t?t:void 0,expireAfter:null!==(o=w.expireAfter)&&void 0!==o?o:void 0,probability:w.probability,minQuantity:null!==(n=w.minQuantity)&&void 0!==n?n:void 0,minAmount:null!==(l=w.minAmount)&&void 0!==l?l:void 0}):I===i.DISCOUNT_TYPES.BUY_X_GET_Y?G({value:100,targetSelection:i.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:i.DISCOUNT_VALUE_TYPES.PERCENTAGE,quadrant:w.quadrant,isStaticCoupon:!1,title:w.title,expireAt:null!==(r=w.expireAt)&&void 0!==r?r:void 0,expireAfter:null!==(a=w.expireAfter)&&void 0!==a?a:void 0,probability:w.probability,minQuantity:void 0,minAmount:void 0}):I===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER?G({targetSelection:i.DISCOUNT_TARGET_SELECTION.ALL,targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:null!==(d=w.valueType)&&void 0!==d?d:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,quadrant:w.quadrant,isStaticCoupon:!1,title:w.title,expireAt:null!==(s=w.expireAt)&&void 0!==s?s:void 0,expireAfter:null!==(c=w.expireAfter)&&void 0!==c?c:void 0,probability:w.probability,value:w.value,minQuantity:null!==(u=w.minQuantity)&&void 0!==u?u:void 0,minAmount:null!==(p=w.minAmount)&&void 0!==p?p:void 0}):I===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS&&G({targetSelection:i.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:null!==(C=w.valueType)&&void 0!==C?C:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,quadrant:w.quadrant,isStaticCoupon:!1,title:w.title,expireAt:null!==(T=w.expireAt)&&void 0!==T?T:void 0,expireAfter:null!==(S=w.expireAfter)&&void 0!==S?S:void 0,probability:w.probability,value:w.value,minQuantity:null!==(P=w.minQuantity)&&void 0!==P?P:void 0,minAmount:null!==(E=w.minAmount)&&void 0!==E?E:void 0})},xe=t=>t&&e.jsx(d.Tag,{theme:"light",tagText:t,type:"negative",LeadingIcon:T.default});return e.jsxs(r.StyledModal,Object.assign({width:(M||F)&&y.newPickerConf?"25px":"640px",open:y.isOpen,hideCrossButton:!!q,headingTitle:F?"Select Products":y.title,headingSubtitle:F?void 0:y.subTitle,footerLeftCustomElement:Pe?xe(Pe):y.errorMsg?xe(y.errorMsg):!y.quadrant||y.hideProbability?e.jsx(e.Fragment,{}):Te<=1?e.jsx(d.Tag,{theme:"light",tagText:`Current probability sum: ${Te}`,type:"white"}):e.jsx(s.Tooltip,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e.jsx("div",{children:e.jsx(d.Tag,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${Te}`,type:"negative",LeadingIcon:C.default})})})),headerRightCustomElement:y.allowStaticCoupon||F?void 0:e.jsx(o.Dropdown,{options:fe,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{Re(e)}}),onClose:y.onClose,footerContainerStyle:{borderTop:`1px solid ${l.DEFAULT_THEME.colorsV2.stroke.primary}`},primaryButton:F?{buttonType:"primary",onClick:()=>{k(void 0)},buttonText:"Add"}:M?{buttonType:"primary",onClick:()=>{Y(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Create discount code",isLoading:null!==(U=y.loading)&&void 0!==U&&U,onClick:()=>{var e,t,o,n,l;if(Ae(),w.isStaticCoupon){const{isStaticCoupon:e,couponCode:t,title:i,description:o,quadrant:n,probability:l}=w,r={invalidDiscountCode:!t,invalidCouponTitle:!i,invalidCouponDescription:!o,inValidProbability:!y.hideProbability&&(null!=l?l:-1)<0||(null!=l?l:0)>1||Number.isNaN(null!=l?l:0)};if(ge(r))return void ye(r);if(B||Te>1)return void Ee(!y.hideProbability&&Te>1?"Probability sum should not exceed 1":"Invalid coupon details");y.onSaveClicked({quadrant:n,couponCode:t,description:o,isStaticCoupon:e,probability:l,title:w.title})}else{const r={invalidCouponTitle:!w.title,inValidProbability:!y.hideProbability&&(null!==(e=w.probability)&&void 0!==e?e:-1)<=0||(null!==(t=w.probability)&&void 0!==t?t:-1)>1||Number.isNaN(null!==(o=w.probability)&&void 0!==o?o:-1),inValidDiscountAmount:!w.value,inValidMinimumQuantity:!1,inValidMinimumAmount:!1,inValidCouponExpiry:!1,inValidProductSelection:!1,inValidProductVariableSelection:!1,inValidCollectionSelection:!1,inValidBuyXValue:!1,inValidGetYValue:!1,inValidBuyXProductSelection:!1,inValidGetYProductSelection:!1,inValidBuyXCollectionSelection:!1,inValidGetYCollectionSelection:!1,inValidBuyXProductVariableSelection:!1,inValidGetYProductVariableSelection:!1};if(Q!==i.DISCOUNT_TYPES.BUY_X_GET_Y&&z!==i.MIN_PURCHASE_REQUIREMENT.NA){const{minAmount:e,minQuantity:t}=w;r.inValidMinimumAmount=z===i.MIN_PURCHASE_REQUIREMENT.AMOUNT&&!e,r.inValidMinimumQuantity=z===i.MIN_PURCHASE_REQUIREMENT.QUANTITY&&!t}if(ve&&(r.inValidCouponExpiry=!w.expireAt&&!w.expireAfter),Q!==i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER&&Q!==i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS||($!==i.DISCOUNT_APPLIES_TO.SPECIFIC_PRODUCTS||!ne||Object.keys(ne).length||de||(r.inValidProductSelection=!0,r.inValidProductVariableSelection=!0),$===i.DISCOUNT_APPLIES_TO.SPECIFIC_COLLECTIONS&&pe&&!Object.keys(pe).length&&(r.inValidCollectionSelection=!0)),Q===i.DISCOUNT_TYPES.BUY_X_GET_Y&&(w.prerequisiteQuantity||(r.inValidBuyXValue=!0),w.entitledQuantity||(r.inValidGetYValue=!0),J!==i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS||!ie||Object.keys(ie).length||ce||(r.inValidBuyXProductSelection=!0,r.inValidBuyXProductVariableSelection=!0),J===i.OFFER_APPLIES_TO.SPECIFIC_COLLECTIONS&&re&&!Object.keys(re).length&&(r.inValidBuyXCollectionSelection=!0),ee!==i.OFFER_APPLIES_TO.SPECIFIC_PRODUCTS||!ne||Object.keys(ne).length||de||(r.inValidGetYProductSelection=!0,r.inValidGetYProductVariableSelection=!0),ee===i.OFFER_APPLIES_TO.SPECIFIC_COLLECTIONS&&pe&&!Object.keys(pe).length&&(r.inValidGetYCollectionSelection=!0)),ge(r))return void Ne(r);if(B||Te>1)return void Ee(!y.hideProbability&&Te>1?"Probability sum should not exceed 1":"Invalid coupon details");y.onSaveClicked(Object.assign(Object.assign({},w),{description:O.descriptionBuilder(w,y.currency,null!==(n=y.products)&&void 0!==n?n:[],null!==(l=y.collection)&&void 0!==l?l:[]),productsConf:{entitledProducts:null!=ne?ne:[],prerequisiteProducts:null!=ie?ie:[]},collectionsConf:{entitledCollections:null!=pe?pe:[],prerequisiteCollections:null!=re?re:[]},productVariableConf:{entitledProductVariable:null!=de?de:{},prerequisiteProductVariable:null!=ce?ce:{}}}))}}},secondaryButton:F?{buttonType:"tertiaryGray",onClick:()=>{k(void 0)},buttonText:"Back"}:M?{buttonType:"tertiaryGray",onClick:()=>{Y(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:y.onClose,buttonText:"Cancel"}},{children:[!F&&!M&&e.jsxs(I.StyledDiscountDialogueContainer,{children:[y.allowStaticCoupon&&!F&&e.jsxs(I.CouponTypeContainerStyled,Object.assign({selectedDiv:w.isStaticCoupon?1:2},{children:["static"===y.hideOption?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{w.isStaticCoupon||(G({isStaticCoupon:!0,quadrant:w.quadrant}),Ee(""),Ae())}},{children:[e.jsx(n.TitleSmall,Object.assign({style:{marginBottom:"4px",color:w.isStaticCoupon?l.DEFAULT_THEME.colorsV2.content.brand:void 0}},{children:"Static Code"})),e.jsx(n.BodyCaption,Object.assign({style:w.isStaticCoupon?{color:l.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"A uniform code provided manually, used for providing the same discount to all customers."}))]})),"dynamic"===y.hideOption?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{var t;w.isStaticCoupon&&(H(i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER),G({isStaticCoupon:!1,quadrant:w.quadrant,targetType:i.DISCOUNT_TARGET_TYPES.LINE_ITEM,targetSelection:i.DISCOUNT_TARGET_SELECTION.ALL,valueType:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT}),Ee(""),Ae(),Oe({id:"0",label:"Amount",value:"amount",icon:t=>e.jsx("span",Object.assign({style:{fontSize:20,color:t}},{children:y.currency||""}))}),_e(null!==(t=y.makeExpiryMandatory)&&void 0!==t&&t),K(i.MIN_PURCHASE_REQUIREMENT.NA))}},{children:[e.jsx(n.TitleSmall,Object.assign({style:{marginBottom:"4px",color:w.isStaticCoupon?void 0:l.DEFAULT_THEME.colorsV2.content.brand}},{children:"Dynamic Code"})),e.jsx(n.BodyCaption,Object.assign({style:w.isStaticCoupon?{}:{color:l.DEFAULT_THEME.colorsV2.content.brand}},{children:"Code will be unique for all customers, with the first 5 letters of the customer's name, followed by 10 random characters."}))]}))]})),e.jsx(n.TitleRegular,Object.assign({style:{marginTop:"24px"}},{children:"Coupon Details"})),w.isStaticCoupon&&!F&&e.jsx(_.default,{discountData:w,setDiscountData:G,hideProbability:y.hideProbability||!1,discountAdminUrl:y.discountAdminUrl,staticDiscountValidationError:be,currency:y.currency}),!w.isStaticCoupon&&!F&&!M&&e.jsx(v.default,{currency:y.currency,entitledProducts:null!=ne?ne:[],prerequisiteProducts:null!=ie?ie:[],setEntitledProducts:le,setPrerequisiteProducts:oe,discountData:w,productPickerOpen:F,productVariablePickerOpen:q,setIsProductPickerOpen:k,setIsProductVariablePickerOpen:L,setDiscountData:G,selectedCouponType:Q,setSelectedCouponType:H,selectedMinimumRequirement:z,setSelectedMinimumRequirement:K,discountCouponAppliesTo:$,offerAppliesToBuy:J,offerAppliesToGet:ee,setDiscountCouponAppliesTo:Z,setOfferAppliesToBuy:W,setOfferAppliesToGet:te,hideProbability:y.hideProbability||!1,hideExpiration:y.hideExpiration||!1,allowStaticCoupon:y.allowStaticCoupon,onChangeCouponType:Re,collectionPickerOpen:M,entitledCollections:null!=pe?pe:[],prerequisiteCollections:null!=re?re:[],setIsCollectionPickerOpen:Y,setEntitledCollections:Ce,setPrerequisiteCollections:ae,useNewPicker:!!y.newPickerConf,setSelectedDiscountDetails:Oe,selectedDiscountDetails:Ie,isProductVariableSupported:y.isProductVariableSupported,entitledProductVariable:de,setEntitledProductVariable:se,preRequisiteProductVariable:ce,setPreRequisiteProductVariable:ue,productVariableList:y.productVariableList,isAddExpirationChecked:ve,setIsAddExpirationChecked:_e,dynamicDiscountValidationError:De,setDynamicDiscountValidationError:Ne,setValidationErrorMessage:Ee,resetValidationErrors:Ae,discountDetailsOptions:V,selectedExpiration:he,setSelectedExpiration:me,makeExpiryMandatory:!!y.makeExpiryMandatory})]}),!!F&&e.jsxs(e.Fragment,{children:[!y.newPickerConf&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsx(a.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(A=y.products)&&void 0!==A?A:[],title:"Select Products",onClose:()=>{k(void 0)},selectedProducts:null!==(g=F===v.DISCOUNT_PRODUCTS.ENTITLED?ne:ie)&&void 0!==g?g:[],setSelectedProducts:F===v.DISCOUNT_PRODUCTS.ENTITLED?le:oe,onSearchKeyChange:y.onProductSearch})})),y.newPickerConf&&e.jsx(S.ProductPickerModal,{visible:!0,onClose:()=>k(void 0),collectionFetcher:(e,t,i)=>{var o;return(null===(o=y.newPickerConf)||void 0===o?void 0:o.fetchCollections)?y.newPickerConf.fetchCollections(e,t,!1,i):null},productFetcher:(e,t,i,o,n)=>{var l;return(null===(l=y.newPickerConf)||void 0===l?void 0:l.fetchProducts)?y.newPickerConf.fetchProducts(e,t,o,n,!1,i):null},selectedItems:F===v.DISCOUNT_PRODUCTS.ENTITLED?ne:ie,onAdd:e=>{F===v.DISCOUNT_PRODUCTS.ENTITLED?le(e):oe(e),k(void 0)},zIndex:200,storeId:y.newPickerConf.storeId,appType:y.newPickerConf.appType||b.__exports.ApplicationType.BIK,searchInCollectionFetcher:(e,t,i,o)=>{var n;return(null===(n=y.newPickerConf)||void 0===n?void 0:n.searchInCollection)?y.newPickerConf.searchInCollection(e,t,i,!1,o):null},customCollectionRestriction:!1,searchFetcher:(e,t,i)=>{var o;return(null===(o=y.newPickerConf)||void 0===o?void 0:o.searchProducts)?y.newPickerConf.searchProducts(e,t,!1,i):null},hideCollectionCheckbox:!0,hideVariantCheckbox:!0,selectProductsFromCustomCollection:!0,hideSelectionCount:!0})]}),!!M&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsxs(e.Fragment,{children:[y.newPickerConf&&e.jsx(S.ProductPickerModal,{visible:!0,onClose:()=>Y(void 0),collectionFetcher:y.newPickerConf.fetchCollections,productFetcher:y.newPickerConf.fetchProducts,selectedItems:M===v.DISCOUNT_PRODUCTS.ENTITLED?pe:re,onAdd:e=>{Object.values(e).forEach((e=>{e.products&&delete e.products})),M===v.DISCOUNT_PRODUCTS.ENTITLED?Ce(e):ae(e),Y(void 0)},customCollectionRestriction:!1,zIndex:200,storeId:y.newPickerConf.storeId,appType:y.newPickerConf.appType||b.__exports.ApplicationType.BIK,searchInCollectionFetcher:y.newPickerConf.searchInCollection,searchFetcher:y.newPickerConf.searchProducts,hideProductCheckbox:!0,hideVariantCheckbox:!0,title:"Select Collections",hideGlobalSearch:!0,hideSelectionCount:!0}),!y.newPickerConf&&e.jsx(a.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(j=y.collection)&&void 0!==j?j:[],title:"Select Products",onClose:()=>{Y(void 0)},selectedProducts:null!==(R=M===v.DISCOUNT_PRODUCTS.ENTITLED?pe:re)&&void 0!==R?R:[],setSelectedProducts:M===v.DISCOUNT_PRODUCTS.ENTITLED?Ce:ae,onSearchKeyChange:y.onCollectionSearch,searchPlaceholder:"Search collections..."})]})})),q&&e.jsx(I.VariablePickerContainer,{children:e.jsx("div",Object.assign({style:{width:"50%",height:"100%",marginLeft:"50%"}},{children:e.jsx(E.VariablePicker,{type:P.PickerType.EMBEDDED,data:null!==(x=y.productVariableList)&&void 0!==x?x:[],showHeader:!0,onSelect:e=>{if(q===v.DISCOUNT_PRODUCTS.ENTITLED){const{displayName:t,actualValue:i,isAvailable:o}=e;se({displayName:t,actualValue:i,isAvailable:o}),L(void 0)}if(q===v.DISCOUNT_PRODUCTS.PREREQUISITE){const{displayName:t,actualValue:i,isAvailable:o}=e;ue({displayName:t,actualValue:i,isAvailable:o}),L(void 0)}},onClose:()=>{L(void 0)}})}))})]}))};
@@ -1 +1,2 @@
1
1
  export * from './modal';
2
+ export { ScreenName } from './type';
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../TypographyStyle.js"),r=require("../../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(e);const d=i.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../TypographyStyle.js"),r=require("../../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(e);const a=i.default.div`
2
2
  background: ${r.COLORS.surface.standard};
3
3
  border-top-left-radius: ${e=>e.isCarouselCard?"12px":"0px"};
4
4
  border-top-right-radius: 12px;
@@ -9,7 +9,7 @@
9
9
  border: 2px solid
10
10
  ${e=>e.hasError?`${r.COLORS.content.negative}`:e.showBorder?`${r.COLORS.stroke.brand}`:`${r.COLORS.stroke.primary}`};
11
11
  border: ${e=>e.showDashedBorder&&`2px dashed ${r.COLORS.content.brand}`};
12
- height: 100%;
12
+ height: ${e=>e.isWhatsappCarousel?"100%":"auto"};
13
13
  display: flex;
14
14
  flex-direction: column;
15
15
  :hover {
@@ -18,16 +18,16 @@
18
18
  ${r.COLORS.stroke.brand};
19
19
  box-shadow: ${e=>!e.isPreview&&"4px 4px 12px rgba(0, 0, 0, 0.25)"};
20
20
  }
21
- `,a=i.default(t.Caption)`
21
+ `,d=i.default(t.Caption)`
22
22
  color: ${r.COLORS.content.secondary};
23
23
  max-width: 80px;
24
24
  text-overflow: ellipsis;
25
25
  white-space: nowrap;
26
26
  overflow: hidden;
27
27
  text-wrap: wrap;
28
- `,s=i.default(a)`
28
+ `,s=i.default(d)`
29
29
  max-width: 200px;
30
- `,n=i.default.div`
30
+ `,p=i.default.div`
31
31
  border-radius: 8px;
32
32
  display: flex;
33
33
  flex-direction: column;
@@ -36,14 +36,14 @@
36
36
  min-height: 152px;
37
37
  margin-bottom: 4px;
38
38
  margin: 0px 8px;
39
- `,p=i.default.div`
39
+ `,n=i.default.div`
40
40
  padding: 12px;
41
41
  display: flex;
42
42
  flex-direction: row;
43
43
  justify-content: center;
44
44
  align-items: center;
45
45
  border-top: 1px solid ${r.COLORS.stroke.primary};
46
- `,x=i.default.div`
46
+ `,l=i.default.div`
47
47
  display: flex;
48
48
  flex-direction: row;
49
49
  justify-content: space-between;
@@ -66,4 +66,4 @@
66
66
  position: absolute;
67
67
  top: 16px;
68
68
  right: 16px;
69
- `,exports.ChatBtnContainer=p,exports.Container=d,exports.FooterText=s,exports.FooterWrapper=x,exports.MediaContainer=n,exports.TimeStamp=a;
69
+ `,exports.ChatBtnContainer=n,exports.Container=a,exports.FooterText=s,exports.FooterWrapper=l,exports.MediaContainer=p,exports.TimeStamp=d;
@@ -8,4 +8,4 @@
8
8
  height: ${e=>e.isWhatsappCarousel?"100%":"auto"};
9
9
  `,c=u.default(a.TitleRegular)`
10
10
  color: ${i.COLORS.content.primary};
11
- `;exports.WhatsappLikePreviewV2=t=>{const{hideDeviceContainerInPreview:s}=r.useTemplateModalContext();return 3===o.getPreviewPropLen(t)?e.jsx(e.Fragment,{children:t.zeroStateComponent}):s?e.jsx(p.ChatUIV2,Object.assign({showHeader:t.showHeader},t)):e.jsx(e.Fragment,{children:e.jsxs(d,Object.assign({style:t.containerStyle,showHeader:t.showHeader,isWhatsappCarousel:t.isWhatsappCarousel},{children:[t.showHeader&&e.jsx(n.default,{}),e.jsxs("div",Object.assign({style:{padding:"small"===t.size?"12px 32px 12px 12px":`16px ${t.isWhatsappCarousel?"0px":"56px"} ${t.isWhatsappCarousel?"2px":"16px"} 16px`,height:t.isWhatsappCarousel?"100%":"auto"}},{children:[!t.hidePreviewText&&e.jsx("div",Object.assign({style:{marginBottom:16}},{children:e.jsx(c,{children:"Preview"})})),e.jsx(p.ChatUIV2,Object.assign({showHeader:t.showHeader},t))]}))]}))})};
11
+ `;exports.WhatsappLikePreviewV2=t=>{const{hideDeviceContainerInPreview:s}=r.useTemplateModalContext();return 3===o.getPreviewPropLen(t)?e.jsx(e.Fragment,{children:t.zeroStateComponent}):s?e.jsx(p.ChatUIV2,Object.assign({showHeader:t.showHeader},t)):e.jsx(e.Fragment,{children:e.jsxs(d,Object.assign({style:t.containerStyle,showHeader:t.showHeader,isWhatsappCarousel:t.isWhatsappCarousel},{children:[t.showHeader&&e.jsx(n.default,{}),e.jsxs("div",Object.assign({style:{padding:"small"===t.size?"12px 32px 12px 12px":`16px ${t.isWhatsappCarousel?"0px":"56px"} ${t.isWhatsappCarousel?"2px":"16px"} 16px`,height:"100%",overflowY:"auto"}},{children:[!t.hidePreviewText&&e.jsx("div",Object.assign({style:{marginBottom:16}},{children:e.jsx(c,{children:"Preview"})})),e.jsx(p.ChatUIV2,Object.assign({showHeader:t.showHeader},t))]}))]}))})};
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),a=require("./components/checkBox/CheckBox.js"),i=require("./components/list-item/ListItem.js"),s=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),T=require("./components/icon-button/IconButton.js"),x=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),S=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),A=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),b=require("./components/template-preview/models/WhatsAppTemplate.js"),j=require("./components/template-preview/models/Channels.js"),E=require("./components/template-context-mapper/TemplateContextMapper.js"),R=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),h=require("./components/template-context-mapper/utils/validateIsUrl.js");require("./_virtual/_tslib.js");var g=require("./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js"),I=require("./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js"),B=require("./components/fab-menu/FABMenu.js"),_=require("./components/floating-action-button/FloatingActionButton.js"),q=require("./components/floating-action-button/FloatingActionButton.styles.js"),f=require("./components/image-compress/ImageCompress.js"),D=require("./components/TypographyStyle.js"),N=require("./components/button/Button.js"),w=require("./components/progress-bar/ProgressBarComponent.js");require("react/jsx-runtime");var L=require("./components/progress-bar-v2/ProgressBarV2.js"),k=require("./components/QueryBuilder/QueryBuilder.js"),M=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),V=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),v=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),U=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),G=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),F=require("./components/modals/styledModal.js"),H=require("./components/dropdown/DropdownPopover/index.js"),W=require("./components/dropdown/Dropdown.js"),Y=require("./components/dropdown/ChipDropdown.js"),Q=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),K=require("./components/dropdown/MenuItem/MenuItem.js"),z=require("./components/analytics-card/AnalyticsCard.js"),Z=require("./components/analytics-card/AnalyticsCard.styled.js"),X=require("./components/input/Input.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),ee=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),re=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),te=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),se=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),le=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),Te=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),xe=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),Pe=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),Se=require("./components/avatar/Avatar.js"),Ae=require("./components/avatar/AvatarHelper.js"),Ce=require("./components/alerts/Alert.js"),ye=require("./components/alerts/AlertHelper.js"),Oe=require("./components/thumbnail/Thumbnail.js"),be=require("./components/curtain/Curtain.js"),je=require("./components/datePicker/DatePicker.js"),Ee=require("./components/datePicker/DatePickerWrapper.js"),Re=require("./components/switch/Switch.js"),he=require("./components/plans/SubscriptionPlan.js"),ge=require("./components/plans/SubscriptionPlanSelector.js"),Ie=require("./components/plans/NewSubscriptionPlan.js"),Be=require("./components/plans/SubscriptionPlansCollected.js"),_e=require("./components/tabs/Tabs.js"),qe=require("./components/dynamic-tabs/DynamicTabs.js"),fe=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),De=require("./components/TablePagination/TablePagination.js"),Ne=require("./components/TablePagination/TablePaginationCard.js"),we=require("./components/states-modal/StateModalComponent.js"),Le=require("./components/states-modal/DeleteConfirmationModal.js"),ke=require("./components/states/StateComponent.js"),Me=require("./components/states/ShopifyScopeWrapper.js"),Ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Ue=require("./helpers/BaseWhatsappContentLang.helper.js"),Ge=require("./components/curtain/CurtainHelper.js"),Fe=require("./utils/resizeImage.js"),He=require("./components/variable-picker-v3/model.js"),We=require("./components/card-selection-modal/CardSelectionModal.js"),Ye=require("./components/image-cropper/BikImageCropper.js"),Qe=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),Ke=require("./components/buttonGroup/ButtonGroup.js"),ze=require("./components/accordion/Accordion.js"),Ze=require("./components/file-uploader/FileUploader.js"),Xe=require("./components/colourInput/ColourInput.js"),Je=require("./components/bik-layout/BikHeader.js"),$e=require("./components/bik-layout/BikLayout.js"),er=require("./components/bik-layout/BikProfile.js"),rr=require("./components/bik-layout/SimpleSidebar.js"),tr=require("./components/bik-layout/BikSidebar.js"),or=require("./components/bik-layout/FeatureModal.js"),nr=require("./components/bik-layout/SidebarSkeleton.js"),ar=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),ir=require("./components/bik-layout/FeatureModalV2.js"),sr=require("./components/searchBar/searchBar.js"),pr=require("./components/custom-date-time/CustomDateTime.js"),ur=require("./components/product-picker/ProductPickerModal.js"),cr=require("./components/discount-modal/DiscountModal.js"),lr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),dr=require("./components/discount-modal/type.js"),mr=require("./components/country-code-picker/CountryCodePicker.js"),Tr=require("./components/country-code-picker/CountryCodePicker.modal.js"),xr=require("./components/shimmer-image/ShimmerImage.js"),Pr=require("./components/product-picker-v2/modal.js"),Sr=require("./components/carousel/carousel.js"),Ar=require("./components/carousel-secondary/CarouselSecondary.js"),Cr=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),yr=require("./components/radioList/RadioList.js"),Or=require("./components/checkList/CheckList.js"),br=require("./components/postPicker/postPicker.js"),jr=require("./components/dropdown-button/DropdownButton.js"),Er=require("./components/side-modal/SideModal.js"),Rr=require("./components/keywords-input/KeywordsInput.js"),hr=require("./components/add-variableV2/AddVariableV2SideModal.js"),gr=require("./components/add-variableV2/AddVariableV2.js"),Ir=require("./components/navigation-hyperlink/NavigationHyperlink.js"),Br=require("./components/SearchFilter/index.js"),_r=require("./components/input-with-vars/InputWithVariables.js"),qr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),fr=require("./components/star-rating/StarRating.js"),Dr=require("./components/testimonial-card/TestimonialCard.js"),Nr=require("./components/slider/slider.js"),wr=require("./components/resizeImage/index.js"),Lr=require("./utils/validator.js"),kr=require("./components/carousel-preview/CarouselPreview.js"),Mr=require("./components/floater/floater.js"),Vr=require("./components/card-selector/CardSelector.js"),vr=require("./components/card-selector/CardSelectorGroup.js"),Ur=require("./components/variable-picker-v3/VariablePicker.js"),Gr=require("./components/action-button/ActionButtons.js"),Fr=require("./components/ai-modals/ActivateBikAI.js"),Hr=require("./components/ai-modals/AiSyncProgress.js"),Wr=require("./components/ai-modals/AiCreditsExhausted.js"),Yr=require("./components/ai-modals/AiCreditsLow.js"),Qr=require("./components/input-with-vars/customPortal.js"),Kr=require("./components/floating-input-dropdown/FloatingInputDropdown.js"),zr=require("./components/dropdown/MultilevelDropdownPopover/index.js"),Zr=require("./components/dropShadow/DropShadow.js"),Xr=require("./components/multi-level-dropdown/MultiLevelDropdown.js"),Jr=require("./components/data-source-panel/DataSourcePanel.js"),$r=require("./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js"),et=require("./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js"),rt=require("./components/data-source-panel/model.js"),tt=require("./components/carousel-secondary/model.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=a.CheckBox,exports.ListItem=i.ListItem,exports.Pagination=s.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=T.IconButton,exports.TemplatePreview=x.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=S.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=A.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),exports.STATIC_URL_CTA_OPTION=O.STATIC_URL_CTA_OPTION,Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return b.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return b.POD}}),Object.defineProperty(exports,"TEMPLATE_QUALITY",{enumerable:!0,get:function(){return b.TEMPLATE_QUALITY}}),Object.defineProperty(exports,"CHANNEL_TYPE",{enumerable:!0,get:function(){return j.CHANNEL_TYPE}}),exports.TemplateContextMapper=E.TemplateContextMapper,exports.getAllDataFromTemplateComponent=R.getAllDataFromTemplateComponent,exports.getAllDataFromWebpushTemplateComponent=R.getAllDataFromWebpushTemplateComponent,exports.isVariable=h.isVariable,exports.validateIsUrl=h.validateIsUrl,exports.TemplateAnalyticsSkeleton=g.TemplateAnalyticsSkeleton,exports.AnalyticsItem=I.AnalyticsItem,exports.RightPanelTemplateAnalytics=I.RightPanelTemplateAnalytics,exports.TemplateAnalyticsComponent=I.TemplateAnalyticsComponent,exports.FABMenu=B.FABMenu,exports.FloatingActionButton=_.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return q.DROP_POSITION}}),exports.DropdownToggleContainer=q.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return q.FAB_POSITION}}),exports.FloatingActionButtonContainer=q.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=q.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return q.MENU_ALIGNMENT}}),exports.StyledDropdown=q.StyledDropdown,exports.TooltipStyled=q.TooltipStyled,exports.ImageService=f.ImageService,exports.AiBodyCaption=D.AiBodyCaption,exports.AiBodyTiny=D.AiBodyTiny,exports.BodyCaption=D.BodyCaption,exports.BodyLarge=D.BodyLarge,exports.BodyPrimary=D.BodyPrimary,exports.BodyPrimaryLink=D.BodyPrimaryLink,exports.BodyRegular=D.BodyRegular,exports.BodySecondary=D.BodySecondary,exports.BodySecondaryLink=D.BodySecondaryLink,exports.BodySmall=D.BodySmall,exports.BodyTiny=D.BodyTiny,exports.ButtonLarge=D.ButtonLarge,exports.ButtonLargeAI=D.ButtonLargeAI,exports.ButtonRegular=D.ButtonRegular,exports.ButtonRegularAI=D.ButtonRegularAI,exports.Caption=D.Caption,exports.CaptionBold=D.CaptionBold,exports.Display=D.Display,exports.SmallRegular=D.SmallRegular,exports.SubHeading=D.SubHeading,exports.TextPlaceholder=D.TextPlaceholder,exports.Tiny=D.Tiny,exports.TitleFour=D.TitleFour,exports.TitleLarge=D.TitleLarge,exports.TitleMedium=D.TitleMedium,exports.TitleRegular=D.TitleRegular,exports.TitleSmall=D.TitleSmall,exports.TitleXlarge=D.TitleXlarge,exports.Button=N.Button,exports.ProgressBarComponent=w.ProgressBarComponent,exports.ProgressCompletedBar=w.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return L.ProgressBarType}}),exports.ProgressBarV2=L.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return L.TextAlignment}}),exports.QueryBuilder=k.QueryBuilder,exports.BaseQueryBuilderNode=M.BaseQueryBuilderNode,exports.PropertyNode=V.PropertyNode,exports.PropertyNodeHeadless=V.PropertyNodeHeadless,exports.queryBuilderSlice=v.queryBuilderSlice,exports.queryBuilderCacheSlice=U.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return G.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return G.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return G.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return G.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return G.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return G.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return G.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return G.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return G.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return G.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return G.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return G.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return G.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return G.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return G.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=F.StyledModal,exports.DropdownPopover=H.DropdownPopover,exports.Dropdown=W.Dropdown,exports.ChipDropdown=Y.ChipDropdown,exports.ChipDropdownContainer=Y.ChipDropdownContainer,exports.OpenedDropdown=Q.OpenedDropdown,exports.MenuItemDropdown=K.MenuItemDropdown,exports.AnalyticsCard=z.AnalyticsCard,exports.AnalyticsContainer=Z.AnalyticsContainer,exports.CardDataContainer=Z.CardDataContainer,exports.Input=X.Input,exports.AnalyticsChip=J.AnalyticsChip,exports.AnalyticsDropdown=$.AnalyticsDropdown,exports.EachItem=$.EachItem,exports.formatDate=$.formatDate,exports.AnalyticsMultiChip=ee.AnalyticsMultiChip,exports.AnalyticsMetric=re.AnalyticsMetric,exports.AnalyticsTrend=te.AnalyticsTrend,exports.LineChart=oe.LineChart,exports.LinearChipGroupedChart=ne.LinearChipGroupedChart,exports.Card=ae.Card,exports.PieChartAnalytics=ae.PieChartAnalytics,exports.PieChart=ie.PieChart,exports.HorizontalGraph=se.HorizontalGraph,exports.StackedBarChart=pe.StackedBarChart,exports.StackedBarDistributionChart=ue.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return ce.GRAPH_ORIENTATION}}),exports.VerticalGraph=le.VerticalGraph,exports.FunnelVerticalBarGraph=de.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return me.HEAT}}),exports.HEAT_COLORS=me.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return me.HEAT_GRADING_TYPE}}),exports.HeatMap=me.HeatMap,exports.HeatBoxStyled=Te.HeatBoxStyled,exports.HeatMapVertical=Te.HeatMapVertical,exports.VerticalBarAndLinearGraph=xe.VerticalBarAndLinearGraph,Object.defineProperty(exports,"TruncateValue",{enumerable:!0,get:function(){return Pe.TruncateValue}}),exports.calculatePercentage=Pe.calculatePercentage,exports.roundNumber=Pe.roundNumber,exports.truncateValueForIndianStore=Pe.truncateValueForIndianStore,exports.truncateValueForInternationalStore=Pe.truncateValueForInternationalStore,exports.truncateValueTo10K=Pe.truncateValueTo10K,exports.truncateValueToA=Pe.truncateValueToA,exports.truncateValueToB=Pe.truncateValueToB,exports.truncateValueToC=Pe.truncateValueToC,exports.truncateValueToK=Pe.truncateValueToK,exports.truncateValueToL=Pe.truncateValueToL,exports.truncateValueToM=Pe.truncateValueToM,exports.truncateValueToT=Pe.truncateValueToT,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=Se.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=Se.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=Se.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"MESSAGE_CHANNELS",{enumerable:!0,get:function(){return Se.MESSAGE_CHANNELS}}),Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Ae.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Ae.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Ae.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Ae.SIZE}}),exports.Alert=Ce.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return ye.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=ye.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return ye.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Oe.RATIO}}),exports.Thumbnail=Oe.Thumbnail,exports.Curtain=be.Curtain,exports.DatePicker=je.DatePicker,exports.DatePickerWrapper=Ee.DatePickerWrapper,exports.Loader=Re.Loader,exports.Switch=Re.Switch,exports.SwitchContainer=Re.SwitchContainer,exports.Thumb=Re.Thumb,exports.SubscriptionPlan=he.SubscriptionPlan,exports.BottomWrapper=ge.BottomWrapper,exports.HeaderWrapper=ge.HeaderWrapper,exports.SubscriptionPlanSelector=ge.SubscriptionPlanSelector,exports.defaultTabs=ge.defaultTabs,exports.NewSubscriptionPlan=Ie.NewSubscriptionPlan,exports.SubscriptionPlansCollected=Be.SubscriptionPlansCollected,exports.TabItemComponent=_e.TabItemComponent,exports.Tabs=_e.Tabs,exports.DynamicTabs=qe.DynamicTabs,exports.BikShimmer=fe.BikShimmer,exports.TablePagination=De.TablePagination,exports.TablePaginationCard=Ne.TablePaginationCard,exports.TablePaginationCardStyled=Ne.TablePaginationCardStyled,exports.StateModalComponent=we.StateModalComponent,exports.DeleteConfirmationModal=Le.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return ke.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return ke.ButtonTypes}}),exports.StateComponent=ke.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return ke.StateInterface}}),exports.ShopifyScopeWrapper=Me.ShopifyScopeWrapper,exports.WhatsAppTextEditor=Ve.WhatsAppTextEditor,exports.CustomRightBorder=ve.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return ve.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=ve.WhatsAppTextEditorHeader,exports.BaseWhatsappContentLangHelper=Ue.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Ge.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Ge.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Ge.CURTAIN_TYPES}}),exports.resizeImage=Fe.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return He.PickerType}}),exports.CardSelectionModal=We.CardSelectionModal,exports.BikImageCropper=Ye.BikImageCropper,exports.BikImagePipeline=Qe.BikImagePipeline,exports.ButtonGroup=Ke.ButtonGroup,exports.BikAccordion=ze.BikAccordion,exports.FileUploader=Ze.FileUploader,exports.ColourInput=Xe.ColourInput,exports.BikHeader=Je.BikHeader,exports.BikLayout=$e.BikLayout,exports.BikProfile=er.BikProfile,exports.SimpleSidebar=rr.SimpleSidebar,exports.BikSidebar=tr.BikSidebar,exports.FeatureModal=or.FeatureModal,exports.SidebarSkeleton=nr.SidebarSkeleton,exports.ShowShopifyRestrictedModal=ar.ShowShopifyRestrictedModal,exports.FeatureModalV2=ir.FeatureModalV2,exports.SearchBar=sr.SearchBar,exports.CustomDateTime=pr.CustomDateTime,exports.PricePleaseProductPicker=ur.PricePleaseProductPicker,exports.ProductPickerContent=ur.ProductPickerContent,exports.DiscountModal=cr.DiscountModal,exports.CouponExpiration=lr.CouponExpiration,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return dr.COUPON_EXPIRATION}}),Object.defineProperty(exports,"DISCOUNT_APPLIES_TO",{enumerable:!0,get:function(){return dr.DISCOUNT_APPLIES_TO}}),Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return dr.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return dr.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return dr.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return dr.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return dr.MIN_PURCHASE_REQUIREMENT}}),Object.defineProperty(exports,"OFFER_APPLIES_TO",{enumerable:!0,get:function(){return dr.OFFER_APPLIES_TO}}),exports.initialDynamicCouponErrorState=dr.initialDynamicCouponErrorState,exports.initialStaticCouponErrorState=dr.initialStaticCouponErrorState,exports.CountryCodePicker=mr.CountryCodePicker,exports.CountriesData=Tr.CountriesData,exports.DEFAULT_IMAGE=xr.DEFAULT_IMAGE,exports.ShimmerImage=xr.ShimmerImage,exports.ProductPickerModal=Pr.ProductPickerModal,exports.Carousel=Sr.Carousel,exports.CarouselSecondary=Ar.CarouselSecondary,exports.AccessTokenTroubleshootDialog=Cr.AccessTokenTroubleshootDialog,exports.RadioList=yr.RadioList,exports.CheckList=Or.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return br.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return br.MEDIA_TYPES}}),exports.PostPicker=br.PostPicker,exports.dateOptions=br.dateOptions,exports.DropdownButton=jr.DropdownButton,exports.SideModal=Er.SideModal,exports.KeywordsInput=Rr.KeywordsInput,exports.AddVariableV2SideModal=hr.AddVariableV2SideModal,exports.AddVariableV2=gr.AddVariableV2,exports.NaLinkWrapper=Ir.NaLinkWrapper,exports.NavigationHyperlink=Ir.NavigationHyperlink,exports.SearchFilter=Br.SearchFilter,exports.InputWithVariables=_r.InputWithVariables,exports.DashboardReviewPopUp=qr.DashboardReviewPopUp,exports.StarRating=fr.StarRating,exports.TestimonialCard=Dr.TestimonialCard,exports.BikSlider=Nr.BikSlider,exports.ResizableImage=wr.ResizableImage,exports.validateURL=Lr.validateURL,exports.CarouselPreview=kr.CarouselPreview,exports.Floater=Mr.Floater,exports.CardSelector=Vr.CardSelector,exports.CardSelectorGroup=vr.CardSelectorGroup,exports.VariablePicker=Ur.VariablePicker,exports.ActionButtons=Gr.ActionButtons,exports.ActivateBikAi=Fr.ActivateBikAi,exports.AiSyncProgress=Hr.AiSyncProgress,exports.AiCreditsExhausted=Wr.AiCreditsExhausted,exports.AiCreditsLow=Yr.AiCreditsLow,exports.CustomPortal=Qr.CustomPortal,exports.FloatingInputDropdown=Kr.FloatingInputDropdown,exports.MultilevelDropdownPopover=zr.MultilevelDropdownPopover,exports.DropShadow=Zr.DropShadow,exports.MultiLevelDropdown=Xr.MultiLevelDropdown,exports.DataSourcePanel=Jr.DataSourcePanel,exports.UnsatisfactoryResponseList=$r.UnsatisfactoryResponseList,exports.UnsatisfactoryCountIntentWiseModal=et.UnsatisfactoryCountIntentWiseModal,Object.defineProperty(exports,"CustomDataCategories",{enumerable:!0,get:function(){return rt.CustomDataCategories}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return rt.CustomDataType}}),Object.defineProperty(exports,"CarouselVersion",{enumerable:!0,get:function(){return tt.CarouselVersion}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),a=require("./components/checkBox/CheckBox.js"),i=require("./components/list-item/ListItem.js"),s=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),T=require("./components/icon-button/IconButton.js"),x=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),S=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),A=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),b=require("./components/template-preview/models/WhatsAppTemplate.js"),j=require("./components/template-preview/models/Channels.js"),E=require("./components/template-context-mapper/TemplateContextMapper.js"),R=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),h=require("./components/template-context-mapper/utils/validateIsUrl.js");require("./_virtual/_tslib.js");var g=require("./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js"),I=require("./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js"),B=require("./components/fab-menu/FABMenu.js"),_=require("./components/floating-action-button/FloatingActionButton.js"),q=require("./components/floating-action-button/FloatingActionButton.styles.js"),f=require("./components/image-compress/ImageCompress.js"),D=require("./components/TypographyStyle.js"),N=require("./components/button/Button.js"),k=require("./components/progress-bar/ProgressBarComponent.js");require("react/jsx-runtime");var w=require("./components/progress-bar-v2/ProgressBarV2.js"),L=require("./components/QueryBuilder/QueryBuilder.js"),M=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),V=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),v=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),U=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),G=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),F=require("./components/modals/styledModal.js"),H=require("./components/dropdown/DropdownPopover/index.js"),W=require("./components/dropdown/Dropdown.js"),Y=require("./components/dropdown/ChipDropdown.js"),Q=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),K=require("./components/dropdown/MenuItem/MenuItem.js"),z=require("./components/analytics-card/AnalyticsCard.js"),Z=require("./components/analytics-card/AnalyticsCard.styled.js"),X=require("./components/input/Input.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),ee=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),re=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),te=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),se=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),le=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),Te=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),xe=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),Pe=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),Se=require("./components/avatar/Avatar.js"),Ae=require("./components/avatar/AvatarHelper.js"),Ce=require("./components/alerts/Alert.js"),ye=require("./components/alerts/AlertHelper.js"),Oe=require("./components/thumbnail/Thumbnail.js"),be=require("./components/curtain/Curtain.js"),je=require("./components/datePicker/DatePicker.js"),Ee=require("./components/datePicker/DatePickerWrapper.js"),Re=require("./components/switch/Switch.js"),he=require("./components/plans/SubscriptionPlan.js"),ge=require("./components/plans/SubscriptionPlanSelector.js"),Ie=require("./components/plans/NewSubscriptionPlan.js"),Be=require("./components/plans/SubscriptionPlansCollected.js"),_e=require("./components/tabs/Tabs.js"),qe=require("./components/dynamic-tabs/DynamicTabs.js"),fe=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),De=require("./components/TablePagination/TablePagination.js"),Ne=require("./components/TablePagination/TablePaginationCard.js"),ke=require("./components/states-modal/StateModalComponent.js"),we=require("./components/states-modal/DeleteConfirmationModal.js"),Le=require("./components/states/StateComponent.js"),Me=require("./components/states/ShopifyScopeWrapper.js"),Ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Ue=require("./helpers/BaseWhatsappContentLang.helper.js"),Ge=require("./components/curtain/CurtainHelper.js"),Fe=require("./utils/resizeImage.js"),He=require("./components/variable-picker-v3/model.js"),We=require("./components/card-selection-modal/CardSelectionModal.js"),Ye=require("./components/image-cropper/BikImageCropper.js"),Qe=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),Ke=require("./components/buttonGroup/ButtonGroup.js"),ze=require("./components/accordion/Accordion.js"),Ze=require("./components/file-uploader/FileUploader.js"),Xe=require("./components/colourInput/ColourInput.js"),Je=require("./components/bik-layout/BikHeader.js"),$e=require("./components/bik-layout/BikLayout.js"),er=require("./components/bik-layout/BikProfile.js"),rr=require("./components/bik-layout/SimpleSidebar.js"),tr=require("./components/bik-layout/BikSidebar.js"),or=require("./components/bik-layout/FeatureModal.js"),nr=require("./components/bik-layout/SidebarSkeleton.js"),ar=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),ir=require("./components/bik-layout/FeatureModalV2.js"),sr=require("./components/searchBar/searchBar.js"),pr=require("./components/custom-date-time/CustomDateTime.js"),ur=require("./components/product-picker/ProductPickerModal.js"),cr=require("./components/discount-modal/DiscountModal.js"),lr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),dr=require("./components/discount-modal/type.js"),mr=require("./components/country-code-picker/CountryCodePicker.js"),Tr=require("./components/country-code-picker/CountryCodePicker.modal.js"),xr=require("./components/shimmer-image/ShimmerImage.js"),Pr=require("./components/product-picker-v2/modal.js"),Sr=require("./components/product-picker-v2/type.js"),Ar=require("./components/carousel/carousel.js"),Cr=require("./components/carousel-secondary/CarouselSecondary.js"),yr=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),Or=require("./components/radioList/RadioList.js"),br=require("./components/checkList/CheckList.js"),jr=require("./components/postPicker/postPicker.js"),Er=require("./components/dropdown-button/DropdownButton.js"),Rr=require("./components/side-modal/SideModal.js"),hr=require("./components/keywords-input/KeywordsInput.js"),gr=require("./components/add-variableV2/AddVariableV2SideModal.js"),Ir=require("./components/add-variableV2/AddVariableV2.js"),Br=require("./components/navigation-hyperlink/NavigationHyperlink.js"),_r=require("./components/SearchFilter/index.js"),qr=require("./components/input-with-vars/InputWithVariables.js"),fr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),Dr=require("./components/star-rating/StarRating.js"),Nr=require("./components/testimonial-card/TestimonialCard.js"),kr=require("./components/slider/slider.js"),wr=require("./components/resizeImage/index.js"),Lr=require("./utils/validator.js"),Mr=require("./components/carousel-preview/CarouselPreview.js"),Vr=require("./components/floater/floater.js"),vr=require("./components/card-selector/CardSelector.js"),Ur=require("./components/card-selector/CardSelectorGroup.js"),Gr=require("./components/variable-picker-v3/VariablePicker.js"),Fr=require("./components/action-button/ActionButtons.js"),Hr=require("./components/ai-modals/ActivateBikAI.js"),Wr=require("./components/ai-modals/AiSyncProgress.js"),Yr=require("./components/ai-modals/AiCreditsExhausted.js"),Qr=require("./components/ai-modals/AiCreditsLow.js"),Kr=require("./components/input-with-vars/customPortal.js"),zr=require("./components/floating-input-dropdown/FloatingInputDropdown.js"),Zr=require("./components/dropdown/MultilevelDropdownPopover/index.js"),Xr=require("./components/dropShadow/DropShadow.js"),Jr=require("./components/multi-level-dropdown/MultiLevelDropdown.js"),$r=require("./components/data-source-panel/DataSourcePanel.js"),et=require("./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js"),rt=require("./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js"),tt=require("./components/data-source-panel/model.js"),ot=require("./components/carousel-secondary/model.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=a.CheckBox,exports.ListItem=i.ListItem,exports.Pagination=s.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=T.IconButton,exports.TemplatePreview=x.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=S.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=A.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),exports.STATIC_URL_CTA_OPTION=O.STATIC_URL_CTA_OPTION,Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return b.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return b.POD}}),Object.defineProperty(exports,"TEMPLATE_QUALITY",{enumerable:!0,get:function(){return b.TEMPLATE_QUALITY}}),Object.defineProperty(exports,"CHANNEL_TYPE",{enumerable:!0,get:function(){return j.CHANNEL_TYPE}}),exports.TemplateContextMapper=E.TemplateContextMapper,exports.getAllDataFromTemplateComponent=R.getAllDataFromTemplateComponent,exports.getAllDataFromWebpushTemplateComponent=R.getAllDataFromWebpushTemplateComponent,exports.isVariable=h.isVariable,exports.validateIsUrl=h.validateIsUrl,exports.TemplateAnalyticsSkeleton=g.TemplateAnalyticsSkeleton,exports.AnalyticsItem=I.AnalyticsItem,exports.RightPanelTemplateAnalytics=I.RightPanelTemplateAnalytics,exports.TemplateAnalyticsComponent=I.TemplateAnalyticsComponent,exports.FABMenu=B.FABMenu,exports.FloatingActionButton=_.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return q.DROP_POSITION}}),exports.DropdownToggleContainer=q.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return q.FAB_POSITION}}),exports.FloatingActionButtonContainer=q.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=q.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return q.MENU_ALIGNMENT}}),exports.StyledDropdown=q.StyledDropdown,exports.TooltipStyled=q.TooltipStyled,exports.ImageService=f.ImageService,exports.AiBodyCaption=D.AiBodyCaption,exports.AiBodyTiny=D.AiBodyTiny,exports.BodyCaption=D.BodyCaption,exports.BodyLarge=D.BodyLarge,exports.BodyPrimary=D.BodyPrimary,exports.BodyPrimaryLink=D.BodyPrimaryLink,exports.BodyRegular=D.BodyRegular,exports.BodySecondary=D.BodySecondary,exports.BodySecondaryLink=D.BodySecondaryLink,exports.BodySmall=D.BodySmall,exports.BodyTiny=D.BodyTiny,exports.ButtonLarge=D.ButtonLarge,exports.ButtonLargeAI=D.ButtonLargeAI,exports.ButtonRegular=D.ButtonRegular,exports.ButtonRegularAI=D.ButtonRegularAI,exports.Caption=D.Caption,exports.CaptionBold=D.CaptionBold,exports.Display=D.Display,exports.SmallRegular=D.SmallRegular,exports.SubHeading=D.SubHeading,exports.TextPlaceholder=D.TextPlaceholder,exports.Tiny=D.Tiny,exports.TitleFour=D.TitleFour,exports.TitleLarge=D.TitleLarge,exports.TitleMedium=D.TitleMedium,exports.TitleRegular=D.TitleRegular,exports.TitleSmall=D.TitleSmall,exports.TitleXlarge=D.TitleXlarge,exports.Button=N.Button,exports.ProgressBarComponent=k.ProgressBarComponent,exports.ProgressCompletedBar=k.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return w.ProgressBarType}}),exports.ProgressBarV2=w.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return w.TextAlignment}}),exports.QueryBuilder=L.QueryBuilder,exports.BaseQueryBuilderNode=M.BaseQueryBuilderNode,exports.PropertyNode=V.PropertyNode,exports.PropertyNodeHeadless=V.PropertyNodeHeadless,exports.queryBuilderSlice=v.queryBuilderSlice,exports.queryBuilderCacheSlice=U.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return G.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return G.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return G.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return G.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return G.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return G.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return G.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return G.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return G.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return G.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return G.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return G.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return G.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return G.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return G.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=F.StyledModal,exports.DropdownPopover=H.DropdownPopover,exports.Dropdown=W.Dropdown,exports.ChipDropdown=Y.ChipDropdown,exports.ChipDropdownContainer=Y.ChipDropdownContainer,exports.OpenedDropdown=Q.OpenedDropdown,exports.MenuItemDropdown=K.MenuItemDropdown,exports.AnalyticsCard=z.AnalyticsCard,exports.AnalyticsContainer=Z.AnalyticsContainer,exports.CardDataContainer=Z.CardDataContainer,exports.Input=X.Input,exports.AnalyticsChip=J.AnalyticsChip,exports.AnalyticsDropdown=$.AnalyticsDropdown,exports.EachItem=$.EachItem,exports.formatDate=$.formatDate,exports.AnalyticsMultiChip=ee.AnalyticsMultiChip,exports.AnalyticsMetric=re.AnalyticsMetric,exports.AnalyticsTrend=te.AnalyticsTrend,exports.LineChart=oe.LineChart,exports.LinearChipGroupedChart=ne.LinearChipGroupedChart,exports.Card=ae.Card,exports.PieChartAnalytics=ae.PieChartAnalytics,exports.PieChart=ie.PieChart,exports.HorizontalGraph=se.HorizontalGraph,exports.StackedBarChart=pe.StackedBarChart,exports.StackedBarDistributionChart=ue.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return ce.GRAPH_ORIENTATION}}),exports.VerticalGraph=le.VerticalGraph,exports.FunnelVerticalBarGraph=de.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return me.HEAT}}),exports.HEAT_COLORS=me.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return me.HEAT_GRADING_TYPE}}),exports.HeatMap=me.HeatMap,exports.HeatBoxStyled=Te.HeatBoxStyled,exports.HeatMapVertical=Te.HeatMapVertical,exports.VerticalBarAndLinearGraph=xe.VerticalBarAndLinearGraph,Object.defineProperty(exports,"TruncateValue",{enumerable:!0,get:function(){return Pe.TruncateValue}}),exports.calculatePercentage=Pe.calculatePercentage,exports.roundNumber=Pe.roundNumber,exports.truncateValueForIndianStore=Pe.truncateValueForIndianStore,exports.truncateValueForInternationalStore=Pe.truncateValueForInternationalStore,exports.truncateValueTo10K=Pe.truncateValueTo10K,exports.truncateValueToA=Pe.truncateValueToA,exports.truncateValueToB=Pe.truncateValueToB,exports.truncateValueToC=Pe.truncateValueToC,exports.truncateValueToK=Pe.truncateValueToK,exports.truncateValueToL=Pe.truncateValueToL,exports.truncateValueToM=Pe.truncateValueToM,exports.truncateValueToT=Pe.truncateValueToT,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=Se.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=Se.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=Se.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"MESSAGE_CHANNELS",{enumerable:!0,get:function(){return Se.MESSAGE_CHANNELS}}),Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Ae.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Ae.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Ae.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Ae.SIZE}}),exports.Alert=Ce.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return ye.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=ye.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return ye.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Oe.RATIO}}),exports.Thumbnail=Oe.Thumbnail,exports.Curtain=be.Curtain,exports.DatePicker=je.DatePicker,exports.DatePickerWrapper=Ee.DatePickerWrapper,exports.Loader=Re.Loader,exports.Switch=Re.Switch,exports.SwitchContainer=Re.SwitchContainer,exports.Thumb=Re.Thumb,exports.SubscriptionPlan=he.SubscriptionPlan,exports.BottomWrapper=ge.BottomWrapper,exports.HeaderWrapper=ge.HeaderWrapper,exports.SubscriptionPlanSelector=ge.SubscriptionPlanSelector,exports.defaultTabs=ge.defaultTabs,exports.NewSubscriptionPlan=Ie.NewSubscriptionPlan,exports.SubscriptionPlansCollected=Be.SubscriptionPlansCollected,exports.TabItemComponent=_e.TabItemComponent,exports.Tabs=_e.Tabs,exports.DynamicTabs=qe.DynamicTabs,exports.BikShimmer=fe.BikShimmer,exports.TablePagination=De.TablePagination,exports.TablePaginationCard=Ne.TablePaginationCard,exports.TablePaginationCardStyled=Ne.TablePaginationCardStyled,exports.StateModalComponent=ke.StateModalComponent,exports.DeleteConfirmationModal=we.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return Le.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return Le.ButtonTypes}}),exports.StateComponent=Le.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return Le.StateInterface}}),exports.ShopifyScopeWrapper=Me.ShopifyScopeWrapper,exports.WhatsAppTextEditor=Ve.WhatsAppTextEditor,exports.CustomRightBorder=ve.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return ve.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=ve.WhatsAppTextEditorHeader,exports.BaseWhatsappContentLangHelper=Ue.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Ge.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Ge.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Ge.CURTAIN_TYPES}}),exports.resizeImage=Fe.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return He.PickerType}}),exports.CardSelectionModal=We.CardSelectionModal,exports.BikImageCropper=Ye.BikImageCropper,exports.BikImagePipeline=Qe.BikImagePipeline,exports.ButtonGroup=Ke.ButtonGroup,exports.BikAccordion=ze.BikAccordion,exports.FileUploader=Ze.FileUploader,exports.ColourInput=Xe.ColourInput,exports.BikHeader=Je.BikHeader,exports.BikLayout=$e.BikLayout,exports.BikProfile=er.BikProfile,exports.SimpleSidebar=rr.SimpleSidebar,exports.BikSidebar=tr.BikSidebar,exports.FeatureModal=or.FeatureModal,exports.SidebarSkeleton=nr.SidebarSkeleton,exports.ShowShopifyRestrictedModal=ar.ShowShopifyRestrictedModal,exports.FeatureModalV2=ir.FeatureModalV2,exports.SearchBar=sr.SearchBar,exports.CustomDateTime=pr.CustomDateTime,exports.PricePleaseProductPicker=ur.PricePleaseProductPicker,exports.ProductPickerContent=ur.ProductPickerContent,exports.DiscountModal=cr.DiscountModal,exports.CouponExpiration=lr.CouponExpiration,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return dr.COUPON_EXPIRATION}}),Object.defineProperty(exports,"DISCOUNT_APPLIES_TO",{enumerable:!0,get:function(){return dr.DISCOUNT_APPLIES_TO}}),Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return dr.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return dr.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return dr.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return dr.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return dr.MIN_PURCHASE_REQUIREMENT}}),Object.defineProperty(exports,"OFFER_APPLIES_TO",{enumerable:!0,get:function(){return dr.OFFER_APPLIES_TO}}),exports.initialDynamicCouponErrorState=dr.initialDynamicCouponErrorState,exports.initialStaticCouponErrorState=dr.initialStaticCouponErrorState,exports.CountryCodePicker=mr.CountryCodePicker,exports.CountriesData=Tr.CountriesData,exports.DEFAULT_IMAGE=xr.DEFAULT_IMAGE,exports.ShimmerImage=xr.ShimmerImage,exports.ProductPickerModal=Pr.ProductPickerModal,Object.defineProperty(exports,"ScreenName",{enumerable:!0,get:function(){return Sr.ScreenName}}),exports.Carousel=Ar.Carousel,exports.CarouselSecondary=Cr.CarouselSecondary,exports.AccessTokenTroubleshootDialog=yr.AccessTokenTroubleshootDialog,exports.RadioList=Or.RadioList,exports.CheckList=br.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return jr.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return jr.MEDIA_TYPES}}),exports.PostPicker=jr.PostPicker,exports.dateOptions=jr.dateOptions,exports.DropdownButton=Er.DropdownButton,exports.SideModal=Rr.SideModal,exports.KeywordsInput=hr.KeywordsInput,exports.AddVariableV2SideModal=gr.AddVariableV2SideModal,exports.AddVariableV2=Ir.AddVariableV2,exports.NaLinkWrapper=Br.NaLinkWrapper,exports.NavigationHyperlink=Br.NavigationHyperlink,exports.SearchFilter=_r.SearchFilter,exports.InputWithVariables=qr.InputWithVariables,exports.DashboardReviewPopUp=fr.DashboardReviewPopUp,exports.StarRating=Dr.StarRating,exports.TestimonialCard=Nr.TestimonialCard,exports.BikSlider=kr.BikSlider,exports.ResizableImage=wr.ResizableImage,exports.validateURL=Lr.validateURL,exports.CarouselPreview=Mr.CarouselPreview,exports.Floater=Vr.Floater,exports.CardSelector=vr.CardSelector,exports.CardSelectorGroup=Ur.CardSelectorGroup,exports.VariablePicker=Gr.VariablePicker,exports.ActionButtons=Fr.ActionButtons,exports.ActivateBikAi=Hr.ActivateBikAi,exports.AiSyncProgress=Wr.AiSyncProgress,exports.AiCreditsExhausted=Yr.AiCreditsExhausted,exports.AiCreditsLow=Qr.AiCreditsLow,exports.CustomPortal=Kr.CustomPortal,exports.FloatingInputDropdown=zr.FloatingInputDropdown,exports.MultilevelDropdownPopover=Zr.MultilevelDropdownPopover,exports.DropShadow=Xr.DropShadow,exports.MultiLevelDropdown=Jr.MultiLevelDropdown,exports.DataSourcePanel=$r.DataSourcePanel,exports.UnsatisfactoryResponseList=et.UnsatisfactoryResponseList,exports.UnsatisfactoryCountIntentWiseModal=rt.UnsatisfactoryCountIntentWiseModal,Object.defineProperty(exports,"CustomDataCategories",{enumerable:!0,get:function(){return tt.CustomDataCategories}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return tt.CustomDataType}}),Object.defineProperty(exports,"CarouselVersion",{enumerable:!0,get:function(){return ot.CarouselVersion}});
@@ -1 +1 @@
1
- import{__rest as t}from"../../_virtual/_tslib.js";import{jsx as e,jsxs as i,Fragment as n}from"react/jsx-runtime";import o,{forwardRef as s}from"react";import{Spinner as a}from"../spinner/Spinner.js";import{Button as r,ButtonCustomDashedBorder as c}from"./Button.styled.js";import{getButtonIconColor as l,SpinnerColorMap as d,GetButtonTextComponent as m}from"./themes.js";const b=s(((s,b)=>{var{version:u,id:h,buttonType:p="primary",size:g="small",buttonText:v,disabled:j,IconComponent:y,LeadingIcon:C,TrailingIcon:x,isLoading:I,inverse:N,onClick:z,matchParentWidth:T,subtitle:f,darkMode:O,activated:k,error:L,buttonTextColor:S,buttonFontSize:W,customIconColor:B,buttonColor:E}=s,M=t(s,["version","id","buttonType","size","buttonText","disabled","IconComponent","LeadingIcon","TrailingIcon","isLoading","inverse","onClick","matchParentWidth","subtitle","darkMode","activated","error","buttonTextColor","buttonFontSize","customIconColor","buttonColor"]);const P=m(g,p,j),F=l(g,p,N,j,I,O),_="chip"===g?16:20,w={height:_,width:_,color:B||F,style:{display:"block"},className:"icon"};return e(r,Object.assign({"data-test":M["data-test"],version:u,onClick:I?()=>{}:z,ref:b,id:h,disabled:j,size:g,buttonType:p,isLoading:I,inverse:N,matchParentWidth:T,darkMode:O,activated:k,error:L,buttonColor:E},M,{children:i("div",Object.assign({className:"button-container"},{children:[p.startsWith("dash")&&e(c,{}),e("div",Object.assign({className:"overlay-container"},{children:I&&e(a,{className:"spinner",size:"small",color:d(p,N)})})),y&&e("div",Object.assign({className:"icon-component"},{children:o.createElement(y,w)})),C&&e("div",Object.assign({className:"icon-leading",style:{zIndex:1}},{children:o.createElement(C,w)})),v?i(P,Object.assign({className:"text",style:{color:S,fontSize:W}},{children:[v,e("div",Object.assign({className:"text-subtitle"},{children:f}))]})):e(n,{}),x&&e("div",Object.assign({className:"icon-trailing",style:{zIndex:1}},{children:o.createElement(x,w)}))]}))}))}));b.displayName="Button";export{b as Button};
1
+ import{__rest as t}from"../../_virtual/_tslib.js";import{jsx as e,jsxs as n,Fragment as i}from"react/jsx-runtime";import o,{forwardRef as s}from"react";import{Spinner as a}from"../spinner/Spinner.js";import{Button as r,ButtonCustomDashedBorder as c}from"./Button.styled.js";import{getButtonIconColor as l,SpinnerColorMap as d,GetButtonTextComponent as m}from"./themes.js";const b=s(((s,b)=>{var{version:u,id:g,buttonType:h="primary",size:p="small",buttonText:v,disabled:j,IconComponent:y,LeadingIcon:C,TrailingIcon:I,isLoading:x,inverse:N,onClick:z,matchParentWidth:O,subtitle:T,darkMode:f,activated:k,error:L,buttonTextColor:S,buttonFontSize:W,customIconColor:B,buttonColor:E,LeadingIconStyles:M}=s,P=t(s,["version","id","buttonType","size","buttonText","disabled","IconComponent","LeadingIcon","TrailingIcon","isLoading","inverse","onClick","matchParentWidth","subtitle","darkMode","activated","error","buttonTextColor","buttonFontSize","customIconColor","buttonColor","LeadingIconStyles"]);const F=m(p,h,j),_=l(p,h,N,j,x,f),w="chip"===p?16:20,q={height:w,width:w,color:B||_,style:{display:"block"},className:"icon"};return e(r,Object.assign({"data-test":P["data-test"],version:u,onClick:x?()=>{}:z,ref:b,id:g,disabled:j,size:p,buttonType:h,isLoading:x,inverse:N,matchParentWidth:O,darkMode:f,activated:k,error:L,buttonColor:E},P,{children:n("div",Object.assign({className:"button-container"},{children:[h.startsWith("dash")&&e(c,{}),e("div",Object.assign({className:"overlay-container"},{children:x&&e(a,{className:"spinner",size:"small",color:d(h,N)})})),y&&e("div",Object.assign({className:"icon-component"},{children:o.createElement(y,q)})),C&&e("div",Object.assign({className:"icon-leading",style:Object.assign({zIndex:1},M)},{children:o.createElement(C,q)})),v?n(F,Object.assign({className:"text",style:{color:S,fontSize:W}},{children:[v,e("div",Object.assign({className:"text-subtitle"},{children:T}))]})):e(i,{}),I&&e("div",Object.assign({className:"icon-trailing",style:{zIndex:1}},{children:o.createElement(I,q)}))]}))}))}));b.displayName="Button";export{b as Button};
@@ -35,6 +35,11 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
35
35
  * @default undefined
36
36
  */
37
37
  LeadingIcon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
38
+ /**
39
+ * Custom styles to be applied to the LeadingIcon
40
+ * @default undefined
41
+ */
42
+ LeadingIconStyles?: React.CSSProperties;
38
43
  /**
39
44
  * The icon component that is the left of the buttonText
40
45
  * Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react
@@ -9,7 +9,7 @@ import e from"styled-components";import{COLORS as o}from"../../constants/Theme.j
9
9
  background-position: center;
10
10
  background-size: cover;
11
11
  position: relative;
12
- height: 500px;
12
+ height: 100%;
13
13
  overflow-y: auto;
14
14
  border-radius: ${e=>{var o;return null!==(o=e.borderRadius)&&void 0!==o?o:"0px"}};
15
15
  `,t=e.div`
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i,Fragment as t}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/models/bik-store.js";import{useState as o,useEffect as n}from"react";import{DISCOUNT_TYPES as l,MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_APPLIES_TO as d,OFFER_APPLIES_TO as a,initialStaticCouponErrorState as c,initialDynamicCouponErrorState as s,COUPON_EXPIRATION as u,DISCOUNT_TARGET_TYPES as p,DISCOUNT_TARGET_SELECTION as v,DISCOUNT_VALUE_TYPES as C}from"./type.js";import"../dropdown/DropdownPopover/index.js";import{Dropdown as b}from"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{TitleSmall as m,BodyCaption as y,TitleRegular as P}from"../TypographyStyle.js";import{DEFAULT_THEME as h}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as I}from"../modals/styledModal.js";import{ProductPickerContent as f}from"../product-picker/ProductPickerModal.js";import{Tag as T}from"../tag/Tag.js";import{Tooltip as E}from"../tooltips/Tooltip.js";import O from"../../assets/icons/gift_icon.svg.js";import S from"../../assets/icons/percentage_icon.svg.js";import g from"../../assets/icons/shipping_icon.svg.js";import _ from"../../assets/icons/triangle_error.svg.js";import V from"../../assets/icons/warning.svg.js";import{ProductPickerModal as A}from"../product-picker-v2/modal.js";import{PickerType as D}from"../variable-picker-v3/model.js";import{VariablePicker as j}from"../variable-picker-v3/VariablePicker.js";import{StyledDiscountDialogueContainer as k,CouponTypeContainerStyled as N,VariablePickerContainer as x}from"./DiscountModal.styled.js";import{validateDiscountData as F,descriptionBuilder as w}from"./DiscountUtils.js";import R,{DISCOUNT_PRODUCTS as M}from"./DynamicCoupon/DynamicCoupon.js";import q from"./StaticCoupon/StaticCoupon.js";import{__exports as L}from"../../_virtual/bik-store.js";const U=U=>{var B,G,Y,X,Q,H,z,K,$,Z,J;const W=[{id:"0",label:"Amount",value:"amount",icon:i=>e("span",Object.assign({style:{fontSize:20,color:i,lineHeight:.9}},{children:U.currency||""}))},{id:"1",label:"Percentage",value:"percentage",icon:i=>e(S,{width:24,height:24,color:i})},{id:"2",label:"Buy X get Y",value:l.BUY_X_GET_Y,icon:i=>e(O,{width:24,height:24,color:i})},{id:"3",label:"Free Shipping",value:l.FREE_SHIPPING,icon:i=>e(g,{width:24,height:24,color:i})}],[ee,ie]=o(),[te,oe]=o(),[ne,le]=o(),[re,de]=o(null!==(B=U.data)&&void 0!==B?B:"string"==typeof U.hideOption?{isStaticCoupon:"dynamic"===U.hideOption}:{isStaticCoupon:!0}),[ae,ce]=o(!0),[se,ue]=o(),[pe,ve]=o((null===(G=U.data)||void 0===G?void 0:G.minAmount)?r.AMOUNT:(null===(Y=U.data)||void 0===Y?void 0:Y.minQuantity)?r.QUANTITY:r.NA),[Ce,be]=o(d.ENTIRE_ORDER),[me,ye]=o(a.SPECIFIC_PRODUCTS),[Pe,he]=o(a.SPECIFIC_PRODUCTS),[Ie,fe]=o(void 0),[Te,Ee]=o(void 0),[Oe,Se]=o(void 0),[ge,_e]=o(void 0),[Ve,Ae]=o(void 0),[De,je]=o(void 0),[ke,Ne]=o(0),[xe,Fe]=o(""),[we,Re]=o(W[0]),[Me,qe]=o(!1),[Le,Ue]=o(c),[Be,Ge]=o(s),[Ye,Xe]=o(u.DYNAMIC_EXPIRATION),Qe=[{value:l.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:se===l.AMOUNT_OFF_ORDER},{value:l.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:se===l.AMOUNT_OFF_PRODUCTS},{value:l.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:se===l.BUY_X_GET_Y},{value:l.FREE_SHIPPING,label:"Free shipping",selected:se===l.FREE_SHIPPING}];n((()=>{U.makeExpiryMandatory&&qe(!0)}),[U.makeExpiryMandatory]),n((()=>{var e,i,t,o,n,r,c,s;let p;const{tempCouponData:v,discountType:b}=He();ue(b);const m=(e,i)=>{Re(v.valueType===C.FIXED_AMOUNT?W[e]:W[i])},y=(e,i)=>{Object.keys(e||{}).length&&i(e)};switch(((null==v?void 0:v.expireAfter)||(null==v?void 0:v.expireAt))&&(qe(!0),(null==v?void 0:v.expireAt)&&Xe(u.FIXED_EXPIRATION),(null==v?void 0:v.expireAfter)&&Xe(u.DYNAMIC_EXPIRATION)),b){case l.AMOUNT_OFF_ORDER:m(0,1),be(d.ENTIRE_ORDER);break;case l.AMOUNT_OFF_PRODUCTS:m(0,1),(null===(e=v.entitledCollectionIds)||void 0===e?void 0:e.length)?be(d.SPECIFIC_COLLECTIONS):(null===(i=v.entitledProductIds)||void 0===i?void 0:i.length)||(null===(t=v.productVariableConf)||void 0===t?void 0:t.entitledProductVariable)?(be(d.SPECIFIC_PRODUCTS),y(null===(o=v.productVariableConf)||void 0===o?void 0:o.entitledProductVariable,_e)):be(d.ENTIRE_ORDER);break;case l.BUY_X_GET_Y:Re(W[2]),(null===(n=v.entitledCollectionIds)||void 0===n?void 0:n.length)?he(a.SPECIFIC_COLLECTIONS):(he(a.SPECIFIC_PRODUCTS),y(null===(r=v.productVariableConf)||void 0===r?void 0:r.entitledProductVariable,_e)),(null===(c=v.prerequisiteCollectionIds)||void 0===c?void 0:c.length)?ye(a.SPECIFIC_COLLECTIONS):(ye(a.SPECIFIC_PRODUCTS),y(null===(s=v.productVariableConf)||void 0===s?void 0:s.prerequisiteProductVariable,Ae));break;case l.FREE_SHIPPING:Re(W[3])}de(Object.assign({},v)),U.hideProbability||(p=$e()),ce(F(v,pe,b,U.hideProbability||!1,p,!!v.isStaticCoupon)),U.hideProbability||$e()}),[]),n((()=>{let e;U.hideProbability||(e=$e()),ce(F(re,pe,se,U.hideProbability||!1,e,!!re.isStaticCoupon))}),[re,ke,se,pe]),n((()=>{var e,i,t,o,n,l,r;if(!U.newPickerConf&&((null===(e=U.products)||void 0===e?void 0:e.length)||(null===(i=U.collection)||void 0===i?void 0:i.length))){if(U.products&&(null===(t=U.products)||void 0===t?void 0:t.length)){if(null===(o=U.data)||void 0===o?void 0:o.entitledProductIds){const e=U.products.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.entitledProductIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));Ee(e)}if(null===(n=U.data)||void 0===n?void 0:n.prerequisiteProductIds){const e=U.products.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.prerequisiteProductIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));fe(e)}}if(U.collection&&U.collection.length){if(null===(l=U.data)||void 0===l?void 0:l.entitledCollectionIds){const e=U.collection.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.entitledCollectionIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));je(e)}if(null===(r=U.data)||void 0===r?void 0:r.prerequisiteCollectionIds){const e=U.collection.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.prerequisiteCollectionIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));Se(e)}}}}),[U.products,U.collection]),n((()=>{var e,i,t,o,n,l,r,d;(null===(i=null===(e=U.data)||void 0===e?void 0:e.productsConf)||void 0===i?void 0:i.entitledProducts)&&Ee(U.data.productsConf.entitledProducts),(null===(o=null===(t=U.data)||void 0===t?void 0:t.productsConf)||void 0===o?void 0:o.prerequisiteProducts)&&fe(U.data.productsConf.prerequisiteProducts),(null===(l=null===(n=U.data)||void 0===n?void 0:n.collectionsConf)||void 0===l?void 0:l.entitledCollections)&&je(U.data.collectionsConf.entitledCollections),(null===(d=null===(r=U.data)||void 0===r?void 0:r.collectionsConf)||void 0===d?void 0:d.prerequisiteCollections)&&Se(U.data.collectionsConf.prerequisiteCollections)}),[null===(X=U.data)||void 0===X?void 0:X.productsConf,null===(Q=U.data)||void 0===Q?void 0:Q.collectionsConf]),n((()=>{if(!Te)return;if(U.newPickerConf){const e=[];return Object.values(Te).forEach((i=>{i.products&&Object.keys(i.products).forEach((i=>{e.push(parseInt(i))}))})),void de(Object.assign(Object.assign({},re),{entitledProductIds:e}))}const e=Te.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{entitledProductIds:e}))}),[Te]),n((()=>{if(!Ie)return;if(U.newPickerConf){const e=[];return Object.values(Ie).forEach((i=>{i.products&&Object.keys(i.products).forEach((i=>{e.push(parseInt(i))}))})),void de(Object.assign(Object.assign({},re),{prerequisiteProductIds:e}))}const e=Ie.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{prerequisiteProductIds:e}))}),[Ie]),n((()=>{if(!De)return;if(U.newPickerConf){(null==De?void 0:De.isCustom)&&delete De.isCustom;const e=Object.keys(De).map((e=>parseInt(e)));return void de(Object.assign(Object.assign({},re),{entitledCollectionIds:e}))}const e=De.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{entitledCollectionIds:e}))}),[De]),n((()=>{if(!Oe)return;if(U.newPickerConf){(null==Oe?void 0:Oe.isCustom)&&delete Oe.isCustom;const e=Object.keys(Oe).map((e=>parseInt(e)));return void de(Object.assign(Object.assign({},re),{prerequisiteCollectionIds:e}))}const e=Oe.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{prerequisiteCollectionIds:e}))}),[Oe]);const He=()=>{var e,i;let t,o=re;return re.isStaticCoupon||(re.targetType===p.SHIPPING_LINE?t=l.FREE_SHIPPING:re.targetType===p.LINE_ITEM?t=re.targetSelection===v.ENTITLED?(null===(e=re.prerequisiteProductIds)||void 0===e?void 0:e.length)||(null===(i=re.prerequisiteCollectionIds)||void 0===i?void 0:i.length)||re.prerequisiteQuantity||re.entitledQuantity?l.BUY_X_GET_Y:l.AMOUNT_OFF_PRODUCTS:l.AMOUNT_OFF_ORDER:(o=Object.assign(Object.assign({},o),{targetType:p.LINE_ITEM,targetSelection:v.ALL,valueType:C.FIXED_AMOUNT}),t=l.AMOUNT_OFF_ORDER)),{discountType:t,tempCouponData:o}},ze=()=>{Ue(c),Ge(s)},Ke=e=>{var i;const t={invalidDiscountCode:"Please add Discount Code",invalidCouponTitle:"Please add Discount Coupon Title",invalidCouponDescription:"Please add Coupon Description",inValidProbability:e.inValidProbability&&(null!==(i=re.probability)&&void 0!==i?i:-1)>1?"Probability should not exceed 1":re.isStaticCoupon?"Please add Probability":"Probability should be greater than 0",inValidDiscountAmount:"Please add Discount Amount",inValidMinimumAmount:"Specify minimum amount required",inValidMinimumQuantity:"Specify minimum items required",inValidCouponExpiry:"Please add Coupon Expiry",inValidProductSelection:"Please specify the products",inValidProductVariableSelection:"Please specify the product variables",inValidCollectionSelection:"Please specify the collections",inValidBuyXValue:"Please specify buy product quantity",inValidGetYValue:"Please specify get product quantity",inValidBuyXProductSelection:"Please specify the products",inValidBuyXCollectionSelection:"Please specify the collections",inValidGetYProductSelection:"Please specify the products",inValidGetYCollectionSelection:"Please specify the collections",inValidBuyXProductVariableSelection:"Please specify the product variables",inValidGetYProductVariableSelection:"Please specify the product variables"};let o="";Object.keys(e).forEach((i=>{e[i]&&(o=t[i])}));const n=Object.values(e).filter(Boolean).length;return n>0&&(Fe(n>1?"Please add discount details":o),!0)},$e=()=>{if(!U.quadrant||!U.probability)return;const e=[...U.probability];let i=[];e.length>=U.quadrant&&e.splice(U.quadrant-1,1),i=e;const t=i.reduce(((e,i)=>e+i),0)+(re.probability||0);return Ne(parseFloat(t.toFixed(4))),parseFloat(t.toFixed(4))},Ze=e=>{var i,t,o,n,r,d,a,c,s,u,b,m,y,P,h,I;const f=e.value;ue(f),fe([]),Ee([]),Se([]),je([]),f===l.FREE_SHIPPING?de({value:100,targetSelection:v.ALL,targetType:p.SHIPPING_LINE,valueType:C.PERCENTAGE,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(i=re.expireAt)&&void 0!==i?i:void 0,expireAfter:null!==(t=re.expireAfter)&&void 0!==t?t:void 0,probability:re.probability,minQuantity:null!==(o=re.minQuantity)&&void 0!==o?o:void 0,minAmount:null!==(n=re.minAmount)&&void 0!==n?n:void 0}):f===l.BUY_X_GET_Y?de({value:100,targetSelection:v.ENTITLED,targetType:p.LINE_ITEM,valueType:C.PERCENTAGE,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(r=re.expireAt)&&void 0!==r?r:void 0,expireAfter:null!==(d=re.expireAfter)&&void 0!==d?d:void 0,probability:re.probability,minQuantity:void 0,minAmount:void 0}):f===l.AMOUNT_OFF_ORDER?de({targetSelection:v.ALL,targetType:p.LINE_ITEM,valueType:null!==(a=re.valueType)&&void 0!==a?a:C.FIXED_AMOUNT,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(c=re.expireAt)&&void 0!==c?c:void 0,expireAfter:null!==(s=re.expireAfter)&&void 0!==s?s:void 0,probability:re.probability,value:re.value,minQuantity:null!==(u=re.minQuantity)&&void 0!==u?u:void 0,minAmount:null!==(b=re.minAmount)&&void 0!==b?b:void 0}):f===l.AMOUNT_OFF_PRODUCTS&&de({targetSelection:v.ENTITLED,targetType:p.LINE_ITEM,valueType:null!==(m=re.valueType)&&void 0!==m?m:C.FIXED_AMOUNT,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(y=re.expireAt)&&void 0!==y?y:void 0,expireAfter:null!==(P=re.expireAfter)&&void 0!==P?P:void 0,probability:re.probability,value:re.value,minQuantity:null!==(h=re.minQuantity)&&void 0!==h?h:void 0,minAmount:null!==(I=re.minAmount)&&void 0!==I?I:void 0})},Je=i=>i&&e(T,{theme:"light",tagText:i,type:"negative",LeadingIcon:V});return i(I,Object.assign({width:(ne||ee)&&U.newPickerConf?"25px":"640px",open:U.isOpen,hideCrossButton:!!te,headingTitle:ee?"Select Products":U.title,headingSubtitle:ee?void 0:U.subTitle,footerLeftCustomElement:xe?Je(xe):U.errorMsg?Je(U.errorMsg):!U.quadrant||U.hideProbability?e(t,{}):ke<=1?e(T,{theme:"light",tagText:`Current probability sum: ${ke}`,type:"white"}):e(E,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e("div",{children:e(T,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${ke}`,type:"negative",LeadingIcon:_})})})),headerRightCustomElement:U.allowStaticCoupon||ee?void 0:e(b,{options:Qe,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{Ze(e)}}),onClose:U.onClose,footerContainerStyle:{borderTop:`1px solid ${h.colorsV2.stroke.primary}`},primaryButton:ee?{buttonType:"primary",onClick:()=>{ie(void 0)},buttonText:"Add"}:ne?{buttonType:"primary",onClick:()=>{le(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Create discount code",isLoading:null!==(H=U.loading)&&void 0!==H&&H,onClick:()=>{var e,i,t,o,n;if(ze(),re.isStaticCoupon){const{isStaticCoupon:e,couponCode:i,title:t,description:o,quadrant:n,probability:l}=re,r={invalidDiscountCode:!i,invalidCouponTitle:!t,invalidCouponDescription:!o,inValidProbability:!U.hideProbability&&(null!=l?l:-1)<0||(null!=l?l:0)>1||Number.isNaN(null!=l?l:0)};if(Ke(r))return void Ue(r);if(ae||ke>1)return void Fe(!U.hideProbability&&ke>1?"Probability sum should not exceed 1":"Invalid coupon details");U.onSaveClicked({quadrant:n,couponCode:i,description:o,isStaticCoupon:e,probability:l,title:re.title})}else{const c={invalidCouponTitle:!re.title,inValidProbability:!U.hideProbability&&(null!==(e=re.probability)&&void 0!==e?e:-1)<=0||(null!==(i=re.probability)&&void 0!==i?i:-1)>1||Number.isNaN(null!==(t=re.probability)&&void 0!==t?t:-1),inValidDiscountAmount:!re.value,inValidMinimumQuantity:!1,inValidMinimumAmount:!1,inValidCouponExpiry:!1,inValidProductSelection:!1,inValidProductVariableSelection:!1,inValidCollectionSelection:!1,inValidBuyXValue:!1,inValidGetYValue:!1,inValidBuyXProductSelection:!1,inValidGetYProductSelection:!1,inValidBuyXCollectionSelection:!1,inValidGetYCollectionSelection:!1,inValidBuyXProductVariableSelection:!1,inValidGetYProductVariableSelection:!1};if(se!==l.BUY_X_GET_Y&&pe!==r.NA){const{minAmount:e,minQuantity:i}=re;c.inValidMinimumAmount=pe===r.AMOUNT&&!e,c.inValidMinimumQuantity=pe===r.QUANTITY&&!i}if(Me&&(c.inValidCouponExpiry=!re.expireAt&&!re.expireAfter),se!==l.AMOUNT_OFF_ORDER&&se!==l.AMOUNT_OFF_PRODUCTS||(Ce!==d.SPECIFIC_PRODUCTS||!Te||Object.keys(Te).length||ge||(c.inValidProductSelection=!0,c.inValidProductVariableSelection=!0),Ce===d.SPECIFIC_COLLECTIONS&&De&&!Object.keys(De).length&&(c.inValidCollectionSelection=!0)),se===l.BUY_X_GET_Y&&(re.prerequisiteQuantity||(c.inValidBuyXValue=!0),re.entitledQuantity||(c.inValidGetYValue=!0),me!==a.SPECIFIC_PRODUCTS||!Ie||Object.keys(Ie).length||Ve||(c.inValidBuyXProductSelection=!0,c.inValidBuyXProductVariableSelection=!0),me===a.SPECIFIC_COLLECTIONS&&Oe&&!Object.keys(Oe).length&&(c.inValidBuyXCollectionSelection=!0),Pe!==a.SPECIFIC_PRODUCTS||!Te||Object.keys(Te).length||ge||(c.inValidGetYProductSelection=!0,c.inValidGetYProductVariableSelection=!0),Pe===a.SPECIFIC_COLLECTIONS&&De&&!Object.keys(De).length&&(c.inValidGetYCollectionSelection=!0)),Ke(c))return void Ge(c);if(ae||ke>1)return void Fe(!U.hideProbability&&ke>1?"Probability sum should not exceed 1":"Invalid coupon details");U.onSaveClicked(Object.assign(Object.assign({},re),{description:w(re,U.currency,null!==(o=U.products)&&void 0!==o?o:[],null!==(n=U.collection)&&void 0!==n?n:[]),productsConf:{entitledProducts:null!=Te?Te:[],prerequisiteProducts:null!=Ie?Ie:[]},collectionsConf:{entitledCollections:null!=De?De:[],prerequisiteCollections:null!=Oe?Oe:[]},productVariableConf:{entitledProductVariable:null!=ge?ge:{},prerequisiteProductVariable:null!=Ve?Ve:{}}}))}}},secondaryButton:ee?{buttonType:"tertiaryGray",onClick:()=>{ie(void 0)},buttonText:"Back"}:ne?{buttonType:"tertiaryGray",onClick:()=>{le(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:U.onClose,buttonText:"Cancel"}},{children:[!ee&&!ne&&i(k,{children:[U.allowStaticCoupon&&!ee&&i(N,Object.assign({selectedDiv:re.isStaticCoupon?1:2},{children:["static"===U.hideOption?e(t,{}):i("div",Object.assign({className:"coupon-type__container",onClick:()=>{re.isStaticCoupon||(de({isStaticCoupon:!0,quadrant:re.quadrant}),Fe(""),ze())}},{children:[e(m,Object.assign({style:{marginBottom:"4px",color:re.isStaticCoupon?h.colorsV2.content.brand:void 0}},{children:"Static Code"})),e(y,Object.assign({style:re.isStaticCoupon?{color:h.colorsV2.content.brand}:{}},{children:"A uniform code provided manually, used for providing the same discount to all customers."}))]})),"dynamic"===U.hideOption?e(t,{}):i("div",Object.assign({className:"coupon-type__container",onClick:()=>{var i;re.isStaticCoupon&&(ue(l.AMOUNT_OFF_ORDER),de({isStaticCoupon:!1,quadrant:re.quadrant,targetType:p.LINE_ITEM,targetSelection:v.ALL,valueType:C.FIXED_AMOUNT}),Fe(""),ze(),Re({id:"0",label:"Amount",value:"amount",icon:i=>e("span",Object.assign({style:{fontSize:20,color:i}},{children:U.currency||""}))}),qe(null!==(i=U.makeExpiryMandatory)&&void 0!==i&&i),ve(r.NA))}},{children:[e(m,Object.assign({style:{marginBottom:"4px",color:re.isStaticCoupon?void 0:h.colorsV2.content.brand}},{children:"Dynamic Code"})),e(y,Object.assign({style:re.isStaticCoupon?{}:{color:h.colorsV2.content.brand}},{children:"Code will be unique for all customers, with the first 5 letters of the customer's name, followed by 10 random characters."}))]}))]})),e(P,Object.assign({style:{marginTop:"24px"}},{children:"Coupon Details"})),re.isStaticCoupon&&!ee&&e(q,{discountData:re,setDiscountData:de,hideProbability:U.hideProbability||!1,discountAdminUrl:U.discountAdminUrl,staticDiscountValidationError:Le,currency:U.currency}),!re.isStaticCoupon&&!ee&&!ne&&e(R,{currency:U.currency,entitledProducts:null!=Te?Te:[],prerequisiteProducts:null!=Ie?Ie:[],setEntitledProducts:Ee,setPrerequisiteProducts:fe,discountData:re,productPickerOpen:ee,productVariablePickerOpen:te,setIsProductPickerOpen:ie,setIsProductVariablePickerOpen:oe,setDiscountData:de,selectedCouponType:se,setSelectedCouponType:ue,selectedMinimumRequirement:pe,setSelectedMinimumRequirement:ve,discountCouponAppliesTo:Ce,offerAppliesToBuy:me,offerAppliesToGet:Pe,setDiscountCouponAppliesTo:be,setOfferAppliesToBuy:ye,setOfferAppliesToGet:he,hideProbability:U.hideProbability||!1,hideExpiration:U.hideExpiration||!1,allowStaticCoupon:U.allowStaticCoupon,onChangeCouponType:Ze,collectionPickerOpen:ne,entitledCollections:null!=De?De:[],prerequisiteCollections:null!=Oe?Oe:[],setIsCollectionPickerOpen:le,setEntitledCollections:je,setPrerequisiteCollections:Se,useNewPicker:!!U.newPickerConf,setSelectedDiscountDetails:Re,selectedDiscountDetails:we,isProductVariableSupported:U.isProductVariableSupported,entitledProductVariable:ge,setEntitledProductVariable:_e,preRequisiteProductVariable:Ve,setPreRequisiteProductVariable:Ae,productVariableList:U.productVariableList,isAddExpirationChecked:Me,setIsAddExpirationChecked:qe,dynamicDiscountValidationError:Be,setDynamicDiscountValidationError:Ge,setValidationErrorMessage:Fe,resetValidationErrors:ze,discountDetailsOptions:W,selectedExpiration:Ye,setSelectedExpiration:Xe,makeExpiryMandatory:!!U.makeExpiryMandatory})]}),!!ee&&i(t,{children:[!U.newPickerConf&&e("div",Object.assign({style:{padding:"12px 0"}},{children:e(f,{show:!0,onSave:()=>{},products:null!==(z=U.products)&&void 0!==z?z:[],title:"Select Products",onClose:()=>{ie(void 0)},selectedProducts:null!==(K=ee===M.ENTITLED?Te:Ie)&&void 0!==K?K:[],setSelectedProducts:ee===M.ENTITLED?Ee:fe,onSearchKeyChange:U.onProductSearch})})),U.newPickerConf&&e(A,{visible:!0,onClose:()=>ie(void 0),collectionFetcher:(e,i,t)=>{var o;return(null===(o=U.newPickerConf)||void 0===o?void 0:o.fetchCollections)?U.newPickerConf.fetchCollections(e,i,!1,t):null},productFetcher:(e,i,t,o,n)=>{var l;return(null===(l=U.newPickerConf)||void 0===l?void 0:l.fetchProducts)?U.newPickerConf.fetchProducts(e,i,o,n,!1,t):null},selectedItems:ee===M.ENTITLED?Te:Ie,onAdd:e=>{ee===M.ENTITLED?Ee(e):fe(e),ie(void 0)},zIndex:200,storeId:U.newPickerConf.storeId,appType:U.newPickerConf.appType||L.ApplicationType.BIK,searchInCollectionFetcher:(e,i,t,o)=>{var n;return(null===(n=U.newPickerConf)||void 0===n?void 0:n.searchInCollection)?U.newPickerConf.searchInCollection(e,i,t,!1,o):null},customCollectionRestriction:!1,searchFetcher:(e,i,t)=>{var o;return(null===(o=U.newPickerConf)||void 0===o?void 0:o.searchProducts)?U.newPickerConf.searchProducts(e,i,!1,t):null},hideCollectionCheckbox:!0,hideVariantCheckbox:!0,selectProductsFromCustomCollection:!0,hideSelectionCount:!0})]}),!!ne&&e("div",Object.assign({style:{padding:"12px 0"}},{children:i(t,{children:[U.newPickerConf&&e(A,{visible:!0,onClose:()=>le(void 0),collectionFetcher:U.newPickerConf.fetchCollections,productFetcher:U.newPickerConf.fetchProducts,selectedItems:ne===M.ENTITLED?De:Oe,onAdd:e=>{Object.values(e).forEach((e=>{e.products&&delete e.products})),ne===M.ENTITLED?je(e):Se(e),le(void 0)},customCollectionRestriction:!1,zIndex:200,storeId:U.newPickerConf.storeId,appType:U.newPickerConf.appType||L.ApplicationType.BIK,searchInCollectionFetcher:U.newPickerConf.searchInCollection,searchFetcher:U.newPickerConf.searchProducts,hideProductCheckbox:!0,hideVariantCheckbox:!0,title:"Select Collections",hideGlobalSearch:!0,hideSelectionCount:!0}),!U.newPickerConf&&e(f,{show:!0,onSave:()=>{},products:null!==($=U.collection)&&void 0!==$?$:[],title:"Select Products",onClose:()=>{le(void 0)},selectedProducts:null!==(Z=ne===M.ENTITLED?De:Oe)&&void 0!==Z?Z:[],setSelectedProducts:ne===M.ENTITLED?je:Se,onSearchKeyChange:U.onCollectionSearch,searchPlaceholder:"Search collections..."})]})})),te&&e(x,{children:e("div",Object.assign({style:{width:"50%",height:"100%",marginLeft:"50%"}},{children:e(j,{type:D.EMBEDDED,data:null!==(J=U.productVariableList)&&void 0!==J?J:[],showHeader:!0,onSelect:e=>{if(te===M.ENTITLED){const{displayName:i,actualValue:t,isAvailable:o}=e;_e({displayName:i,actualValue:t,isAvailable:o}),oe(void 0)}if(te===M.PREREQUISITE){const{displayName:i,actualValue:t,isAvailable:o}=e;Ae({displayName:i,actualValue:t,isAvailable:o}),oe(void 0)}},onClose:()=>{oe(void 0)}})}))})]}))};export{U as DiscountModal};
1
+ import{jsx as e,jsxs as i,Fragment as t}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/models/bik-store.js";import{useState as o,useEffect as n}from"react";import{DISCOUNT_TYPES as l,MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_APPLIES_TO as d,OFFER_APPLIES_TO as a,initialStaticCouponErrorState as c,initialDynamicCouponErrorState as s,COUPON_EXPIRATION as u,DISCOUNT_TARGET_TYPES as p,DISCOUNT_TARGET_SELECTION as v,DISCOUNT_VALUE_TYPES as C}from"./type.js";import"../dropdown/DropdownPopover/index.js";import{Dropdown as b}from"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{TitleSmall as m,BodyCaption as y,TitleRegular as P}from"../TypographyStyle.js";import{DEFAULT_THEME as h}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as I}from"../modals/styledModal.js";import{ProductPickerContent as f}from"../product-picker/ProductPickerModal.js";import{Tag as T}from"../tag/Tag.js";import{Tooltip as E}from"../tooltips/Tooltip.js";import O from"../../assets/icons/gift_icon.svg.js";import S from"../../assets/icons/percentage_icon.svg.js";import g from"../../assets/icons/shipping_icon.svg.js";import _ from"../../assets/icons/triangle_error.svg.js";import V from"../../assets/icons/warning.svg.js";import{ProductPickerModal as A}from"../product-picker-v2/modal.js";import"../product-picker-v2/type.js";import{PickerType as D}from"../variable-picker-v3/model.js";import{VariablePicker as j}from"../variable-picker-v3/VariablePicker.js";import{StyledDiscountDialogueContainer as k,CouponTypeContainerStyled as N,VariablePickerContainer as x}from"./DiscountModal.styled.js";import{validateDiscountData as F,descriptionBuilder as w}from"./DiscountUtils.js";import R,{DISCOUNT_PRODUCTS as M}from"./DynamicCoupon/DynamicCoupon.js";import q from"./StaticCoupon/StaticCoupon.js";import{__exports as L}from"../../_virtual/bik-store.js";const U=U=>{var B,G,Y,X,Q,H,z,K,$,Z,J;const W=[{id:"0",label:"Amount",value:"amount",icon:i=>e("span",Object.assign({style:{fontSize:20,color:i,lineHeight:.9}},{children:U.currency||""}))},{id:"1",label:"Percentage",value:"percentage",icon:i=>e(S,{width:24,height:24,color:i})},{id:"2",label:"Buy X get Y",value:l.BUY_X_GET_Y,icon:i=>e(O,{width:24,height:24,color:i})},{id:"3",label:"Free Shipping",value:l.FREE_SHIPPING,icon:i=>e(g,{width:24,height:24,color:i})}],[ee,ie]=o(),[te,oe]=o(),[ne,le]=o(),[re,de]=o(null!==(B=U.data)&&void 0!==B?B:"string"==typeof U.hideOption?{isStaticCoupon:"dynamic"===U.hideOption}:{isStaticCoupon:!0}),[ae,ce]=o(!0),[se,ue]=o(),[pe,ve]=o((null===(G=U.data)||void 0===G?void 0:G.minAmount)?r.AMOUNT:(null===(Y=U.data)||void 0===Y?void 0:Y.minQuantity)?r.QUANTITY:r.NA),[Ce,be]=o(d.ENTIRE_ORDER),[me,ye]=o(a.SPECIFIC_PRODUCTS),[Pe,he]=o(a.SPECIFIC_PRODUCTS),[Ie,fe]=o(void 0),[Te,Ee]=o(void 0),[Oe,Se]=o(void 0),[ge,_e]=o(void 0),[Ve,Ae]=o(void 0),[De,je]=o(void 0),[ke,Ne]=o(0),[xe,Fe]=o(""),[we,Re]=o(W[0]),[Me,qe]=o(!1),[Le,Ue]=o(c),[Be,Ge]=o(s),[Ye,Xe]=o(u.DYNAMIC_EXPIRATION),Qe=[{value:l.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:se===l.AMOUNT_OFF_ORDER},{value:l.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:se===l.AMOUNT_OFF_PRODUCTS},{value:l.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:se===l.BUY_X_GET_Y},{value:l.FREE_SHIPPING,label:"Free shipping",selected:se===l.FREE_SHIPPING}];n((()=>{U.makeExpiryMandatory&&qe(!0)}),[U.makeExpiryMandatory]),n((()=>{var e,i,t,o,n,r,c,s;let p;const{tempCouponData:v,discountType:b}=He();ue(b);const m=(e,i)=>{Re(v.valueType===C.FIXED_AMOUNT?W[e]:W[i])},y=(e,i)=>{Object.keys(e||{}).length&&i(e)};switch(((null==v?void 0:v.expireAfter)||(null==v?void 0:v.expireAt))&&(qe(!0),(null==v?void 0:v.expireAt)&&Xe(u.FIXED_EXPIRATION),(null==v?void 0:v.expireAfter)&&Xe(u.DYNAMIC_EXPIRATION)),b){case l.AMOUNT_OFF_ORDER:m(0,1),be(d.ENTIRE_ORDER);break;case l.AMOUNT_OFF_PRODUCTS:m(0,1),(null===(e=v.entitledCollectionIds)||void 0===e?void 0:e.length)?be(d.SPECIFIC_COLLECTIONS):(null===(i=v.entitledProductIds)||void 0===i?void 0:i.length)||(null===(t=v.productVariableConf)||void 0===t?void 0:t.entitledProductVariable)?(be(d.SPECIFIC_PRODUCTS),y(null===(o=v.productVariableConf)||void 0===o?void 0:o.entitledProductVariable,_e)):be(d.ENTIRE_ORDER);break;case l.BUY_X_GET_Y:Re(W[2]),(null===(n=v.entitledCollectionIds)||void 0===n?void 0:n.length)?he(a.SPECIFIC_COLLECTIONS):(he(a.SPECIFIC_PRODUCTS),y(null===(r=v.productVariableConf)||void 0===r?void 0:r.entitledProductVariable,_e)),(null===(c=v.prerequisiteCollectionIds)||void 0===c?void 0:c.length)?ye(a.SPECIFIC_COLLECTIONS):(ye(a.SPECIFIC_PRODUCTS),y(null===(s=v.productVariableConf)||void 0===s?void 0:s.prerequisiteProductVariable,Ae));break;case l.FREE_SHIPPING:Re(W[3])}de(Object.assign({},v)),U.hideProbability||(p=$e()),ce(F(v,pe,b,U.hideProbability||!1,p,!!v.isStaticCoupon)),U.hideProbability||$e()}),[]),n((()=>{let e;U.hideProbability||(e=$e()),ce(F(re,pe,se,U.hideProbability||!1,e,!!re.isStaticCoupon))}),[re,ke,se,pe]),n((()=>{var e,i,t,o,n,l,r;if(!U.newPickerConf&&((null===(e=U.products)||void 0===e?void 0:e.length)||(null===(i=U.collection)||void 0===i?void 0:i.length))){if(U.products&&(null===(t=U.products)||void 0===t?void 0:t.length)){if(null===(o=U.data)||void 0===o?void 0:o.entitledProductIds){const e=U.products.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.entitledProductIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));Ee(e)}if(null===(n=U.data)||void 0===n?void 0:n.prerequisiteProductIds){const e=U.products.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.prerequisiteProductIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));fe(e)}}if(U.collection&&U.collection.length){if(null===(l=U.data)||void 0===l?void 0:l.entitledCollectionIds){const e=U.collection.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.entitledCollectionIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));je(e)}if(null===(r=U.data)||void 0===r?void 0:r.prerequisiteCollectionIds){const e=U.collection.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.prerequisiteCollectionIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));Se(e)}}}}),[U.products,U.collection]),n((()=>{var e,i,t,o,n,l,r,d;(null===(i=null===(e=U.data)||void 0===e?void 0:e.productsConf)||void 0===i?void 0:i.entitledProducts)&&Ee(U.data.productsConf.entitledProducts),(null===(o=null===(t=U.data)||void 0===t?void 0:t.productsConf)||void 0===o?void 0:o.prerequisiteProducts)&&fe(U.data.productsConf.prerequisiteProducts),(null===(l=null===(n=U.data)||void 0===n?void 0:n.collectionsConf)||void 0===l?void 0:l.entitledCollections)&&je(U.data.collectionsConf.entitledCollections),(null===(d=null===(r=U.data)||void 0===r?void 0:r.collectionsConf)||void 0===d?void 0:d.prerequisiteCollections)&&Se(U.data.collectionsConf.prerequisiteCollections)}),[null===(X=U.data)||void 0===X?void 0:X.productsConf,null===(Q=U.data)||void 0===Q?void 0:Q.collectionsConf]),n((()=>{if(!Te)return;if(U.newPickerConf){const e=[];return Object.values(Te).forEach((i=>{i.products&&Object.keys(i.products).forEach((i=>{e.push(parseInt(i))}))})),void de(Object.assign(Object.assign({},re),{entitledProductIds:e}))}const e=Te.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{entitledProductIds:e}))}),[Te]),n((()=>{if(!Ie)return;if(U.newPickerConf){const e=[];return Object.values(Ie).forEach((i=>{i.products&&Object.keys(i.products).forEach((i=>{e.push(parseInt(i))}))})),void de(Object.assign(Object.assign({},re),{prerequisiteProductIds:e}))}const e=Ie.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{prerequisiteProductIds:e}))}),[Ie]),n((()=>{if(!De)return;if(U.newPickerConf){(null==De?void 0:De.isCustom)&&delete De.isCustom;const e=Object.keys(De).map((e=>parseInt(e)));return void de(Object.assign(Object.assign({},re),{entitledCollectionIds:e}))}const e=De.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{entitledCollectionIds:e}))}),[De]),n((()=>{if(!Oe)return;if(U.newPickerConf){(null==Oe?void 0:Oe.isCustom)&&delete Oe.isCustom;const e=Object.keys(Oe).map((e=>parseInt(e)));return void de(Object.assign(Object.assign({},re),{prerequisiteCollectionIds:e}))}const e=Oe.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{prerequisiteCollectionIds:e}))}),[Oe]);const He=()=>{var e,i;let t,o=re;return re.isStaticCoupon||(re.targetType===p.SHIPPING_LINE?t=l.FREE_SHIPPING:re.targetType===p.LINE_ITEM?t=re.targetSelection===v.ENTITLED?(null===(e=re.prerequisiteProductIds)||void 0===e?void 0:e.length)||(null===(i=re.prerequisiteCollectionIds)||void 0===i?void 0:i.length)||re.prerequisiteQuantity||re.entitledQuantity?l.BUY_X_GET_Y:l.AMOUNT_OFF_PRODUCTS:l.AMOUNT_OFF_ORDER:(o=Object.assign(Object.assign({},o),{targetType:p.LINE_ITEM,targetSelection:v.ALL,valueType:C.FIXED_AMOUNT}),t=l.AMOUNT_OFF_ORDER)),{discountType:t,tempCouponData:o}},ze=()=>{Ue(c),Ge(s)},Ke=e=>{var i;const t={invalidDiscountCode:"Please add Discount Code",invalidCouponTitle:"Please add Discount Coupon Title",invalidCouponDescription:"Please add Coupon Description",inValidProbability:e.inValidProbability&&(null!==(i=re.probability)&&void 0!==i?i:-1)>1?"Probability should not exceed 1":re.isStaticCoupon?"Please add Probability":"Probability should be greater than 0",inValidDiscountAmount:"Please add Discount Amount",inValidMinimumAmount:"Specify minimum amount required",inValidMinimumQuantity:"Specify minimum items required",inValidCouponExpiry:"Please add Coupon Expiry",inValidProductSelection:"Please specify the products",inValidProductVariableSelection:"Please specify the product variables",inValidCollectionSelection:"Please specify the collections",inValidBuyXValue:"Please specify buy product quantity",inValidGetYValue:"Please specify get product quantity",inValidBuyXProductSelection:"Please specify the products",inValidBuyXCollectionSelection:"Please specify the collections",inValidGetYProductSelection:"Please specify the products",inValidGetYCollectionSelection:"Please specify the collections",inValidBuyXProductVariableSelection:"Please specify the product variables",inValidGetYProductVariableSelection:"Please specify the product variables"};let o="";Object.keys(e).forEach((i=>{e[i]&&(o=t[i])}));const n=Object.values(e).filter(Boolean).length;return n>0&&(Fe(n>1?"Please add discount details":o),!0)},$e=()=>{if(!U.quadrant||!U.probability)return;const e=[...U.probability];let i=[];e.length>=U.quadrant&&e.splice(U.quadrant-1,1),i=e;const t=i.reduce(((e,i)=>e+i),0)+(re.probability||0);return Ne(parseFloat(t.toFixed(4))),parseFloat(t.toFixed(4))},Ze=e=>{var i,t,o,n,r,d,a,c,s,u,b,m,y,P,h,I;const f=e.value;ue(f),fe([]),Ee([]),Se([]),je([]),f===l.FREE_SHIPPING?de({value:100,targetSelection:v.ALL,targetType:p.SHIPPING_LINE,valueType:C.PERCENTAGE,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(i=re.expireAt)&&void 0!==i?i:void 0,expireAfter:null!==(t=re.expireAfter)&&void 0!==t?t:void 0,probability:re.probability,minQuantity:null!==(o=re.minQuantity)&&void 0!==o?o:void 0,minAmount:null!==(n=re.minAmount)&&void 0!==n?n:void 0}):f===l.BUY_X_GET_Y?de({value:100,targetSelection:v.ENTITLED,targetType:p.LINE_ITEM,valueType:C.PERCENTAGE,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(r=re.expireAt)&&void 0!==r?r:void 0,expireAfter:null!==(d=re.expireAfter)&&void 0!==d?d:void 0,probability:re.probability,minQuantity:void 0,minAmount:void 0}):f===l.AMOUNT_OFF_ORDER?de({targetSelection:v.ALL,targetType:p.LINE_ITEM,valueType:null!==(a=re.valueType)&&void 0!==a?a:C.FIXED_AMOUNT,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(c=re.expireAt)&&void 0!==c?c:void 0,expireAfter:null!==(s=re.expireAfter)&&void 0!==s?s:void 0,probability:re.probability,value:re.value,minQuantity:null!==(u=re.minQuantity)&&void 0!==u?u:void 0,minAmount:null!==(b=re.minAmount)&&void 0!==b?b:void 0}):f===l.AMOUNT_OFF_PRODUCTS&&de({targetSelection:v.ENTITLED,targetType:p.LINE_ITEM,valueType:null!==(m=re.valueType)&&void 0!==m?m:C.FIXED_AMOUNT,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(y=re.expireAt)&&void 0!==y?y:void 0,expireAfter:null!==(P=re.expireAfter)&&void 0!==P?P:void 0,probability:re.probability,value:re.value,minQuantity:null!==(h=re.minQuantity)&&void 0!==h?h:void 0,minAmount:null!==(I=re.minAmount)&&void 0!==I?I:void 0})},Je=i=>i&&e(T,{theme:"light",tagText:i,type:"negative",LeadingIcon:V});return i(I,Object.assign({width:(ne||ee)&&U.newPickerConf?"25px":"640px",open:U.isOpen,hideCrossButton:!!te,headingTitle:ee?"Select Products":U.title,headingSubtitle:ee?void 0:U.subTitle,footerLeftCustomElement:xe?Je(xe):U.errorMsg?Je(U.errorMsg):!U.quadrant||U.hideProbability?e(t,{}):ke<=1?e(T,{theme:"light",tagText:`Current probability sum: ${ke}`,type:"white"}):e(E,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e("div",{children:e(T,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${ke}`,type:"negative",LeadingIcon:_})})})),headerRightCustomElement:U.allowStaticCoupon||ee?void 0:e(b,{options:Qe,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{Ze(e)}}),onClose:U.onClose,footerContainerStyle:{borderTop:`1px solid ${h.colorsV2.stroke.primary}`},primaryButton:ee?{buttonType:"primary",onClick:()=>{ie(void 0)},buttonText:"Add"}:ne?{buttonType:"primary",onClick:()=>{le(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Create discount code",isLoading:null!==(H=U.loading)&&void 0!==H&&H,onClick:()=>{var e,i,t,o,n;if(ze(),re.isStaticCoupon){const{isStaticCoupon:e,couponCode:i,title:t,description:o,quadrant:n,probability:l}=re,r={invalidDiscountCode:!i,invalidCouponTitle:!t,invalidCouponDescription:!o,inValidProbability:!U.hideProbability&&(null!=l?l:-1)<0||(null!=l?l:0)>1||Number.isNaN(null!=l?l:0)};if(Ke(r))return void Ue(r);if(ae||ke>1)return void Fe(!U.hideProbability&&ke>1?"Probability sum should not exceed 1":"Invalid coupon details");U.onSaveClicked({quadrant:n,couponCode:i,description:o,isStaticCoupon:e,probability:l,title:re.title})}else{const c={invalidCouponTitle:!re.title,inValidProbability:!U.hideProbability&&(null!==(e=re.probability)&&void 0!==e?e:-1)<=0||(null!==(i=re.probability)&&void 0!==i?i:-1)>1||Number.isNaN(null!==(t=re.probability)&&void 0!==t?t:-1),inValidDiscountAmount:!re.value,inValidMinimumQuantity:!1,inValidMinimumAmount:!1,inValidCouponExpiry:!1,inValidProductSelection:!1,inValidProductVariableSelection:!1,inValidCollectionSelection:!1,inValidBuyXValue:!1,inValidGetYValue:!1,inValidBuyXProductSelection:!1,inValidGetYProductSelection:!1,inValidBuyXCollectionSelection:!1,inValidGetYCollectionSelection:!1,inValidBuyXProductVariableSelection:!1,inValidGetYProductVariableSelection:!1};if(se!==l.BUY_X_GET_Y&&pe!==r.NA){const{minAmount:e,minQuantity:i}=re;c.inValidMinimumAmount=pe===r.AMOUNT&&!e,c.inValidMinimumQuantity=pe===r.QUANTITY&&!i}if(Me&&(c.inValidCouponExpiry=!re.expireAt&&!re.expireAfter),se!==l.AMOUNT_OFF_ORDER&&se!==l.AMOUNT_OFF_PRODUCTS||(Ce!==d.SPECIFIC_PRODUCTS||!Te||Object.keys(Te).length||ge||(c.inValidProductSelection=!0,c.inValidProductVariableSelection=!0),Ce===d.SPECIFIC_COLLECTIONS&&De&&!Object.keys(De).length&&(c.inValidCollectionSelection=!0)),se===l.BUY_X_GET_Y&&(re.prerequisiteQuantity||(c.inValidBuyXValue=!0),re.entitledQuantity||(c.inValidGetYValue=!0),me!==a.SPECIFIC_PRODUCTS||!Ie||Object.keys(Ie).length||Ve||(c.inValidBuyXProductSelection=!0,c.inValidBuyXProductVariableSelection=!0),me===a.SPECIFIC_COLLECTIONS&&Oe&&!Object.keys(Oe).length&&(c.inValidBuyXCollectionSelection=!0),Pe!==a.SPECIFIC_PRODUCTS||!Te||Object.keys(Te).length||ge||(c.inValidGetYProductSelection=!0,c.inValidGetYProductVariableSelection=!0),Pe===a.SPECIFIC_COLLECTIONS&&De&&!Object.keys(De).length&&(c.inValidGetYCollectionSelection=!0)),Ke(c))return void Ge(c);if(ae||ke>1)return void Fe(!U.hideProbability&&ke>1?"Probability sum should not exceed 1":"Invalid coupon details");U.onSaveClicked(Object.assign(Object.assign({},re),{description:w(re,U.currency,null!==(o=U.products)&&void 0!==o?o:[],null!==(n=U.collection)&&void 0!==n?n:[]),productsConf:{entitledProducts:null!=Te?Te:[],prerequisiteProducts:null!=Ie?Ie:[]},collectionsConf:{entitledCollections:null!=De?De:[],prerequisiteCollections:null!=Oe?Oe:[]},productVariableConf:{entitledProductVariable:null!=ge?ge:{},prerequisiteProductVariable:null!=Ve?Ve:{}}}))}}},secondaryButton:ee?{buttonType:"tertiaryGray",onClick:()=>{ie(void 0)},buttonText:"Back"}:ne?{buttonType:"tertiaryGray",onClick:()=>{le(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:U.onClose,buttonText:"Cancel"}},{children:[!ee&&!ne&&i(k,{children:[U.allowStaticCoupon&&!ee&&i(N,Object.assign({selectedDiv:re.isStaticCoupon?1:2},{children:["static"===U.hideOption?e(t,{}):i("div",Object.assign({className:"coupon-type__container",onClick:()=>{re.isStaticCoupon||(de({isStaticCoupon:!0,quadrant:re.quadrant}),Fe(""),ze())}},{children:[e(m,Object.assign({style:{marginBottom:"4px",color:re.isStaticCoupon?h.colorsV2.content.brand:void 0}},{children:"Static Code"})),e(y,Object.assign({style:re.isStaticCoupon?{color:h.colorsV2.content.brand}:{}},{children:"A uniform code provided manually, used for providing the same discount to all customers."}))]})),"dynamic"===U.hideOption?e(t,{}):i("div",Object.assign({className:"coupon-type__container",onClick:()=>{var i;re.isStaticCoupon&&(ue(l.AMOUNT_OFF_ORDER),de({isStaticCoupon:!1,quadrant:re.quadrant,targetType:p.LINE_ITEM,targetSelection:v.ALL,valueType:C.FIXED_AMOUNT}),Fe(""),ze(),Re({id:"0",label:"Amount",value:"amount",icon:i=>e("span",Object.assign({style:{fontSize:20,color:i}},{children:U.currency||""}))}),qe(null!==(i=U.makeExpiryMandatory)&&void 0!==i&&i),ve(r.NA))}},{children:[e(m,Object.assign({style:{marginBottom:"4px",color:re.isStaticCoupon?void 0:h.colorsV2.content.brand}},{children:"Dynamic Code"})),e(y,Object.assign({style:re.isStaticCoupon?{}:{color:h.colorsV2.content.brand}},{children:"Code will be unique for all customers, with the first 5 letters of the customer's name, followed by 10 random characters."}))]}))]})),e(P,Object.assign({style:{marginTop:"24px"}},{children:"Coupon Details"})),re.isStaticCoupon&&!ee&&e(q,{discountData:re,setDiscountData:de,hideProbability:U.hideProbability||!1,discountAdminUrl:U.discountAdminUrl,staticDiscountValidationError:Le,currency:U.currency}),!re.isStaticCoupon&&!ee&&!ne&&e(R,{currency:U.currency,entitledProducts:null!=Te?Te:[],prerequisiteProducts:null!=Ie?Ie:[],setEntitledProducts:Ee,setPrerequisiteProducts:fe,discountData:re,productPickerOpen:ee,productVariablePickerOpen:te,setIsProductPickerOpen:ie,setIsProductVariablePickerOpen:oe,setDiscountData:de,selectedCouponType:se,setSelectedCouponType:ue,selectedMinimumRequirement:pe,setSelectedMinimumRequirement:ve,discountCouponAppliesTo:Ce,offerAppliesToBuy:me,offerAppliesToGet:Pe,setDiscountCouponAppliesTo:be,setOfferAppliesToBuy:ye,setOfferAppliesToGet:he,hideProbability:U.hideProbability||!1,hideExpiration:U.hideExpiration||!1,allowStaticCoupon:U.allowStaticCoupon,onChangeCouponType:Ze,collectionPickerOpen:ne,entitledCollections:null!=De?De:[],prerequisiteCollections:null!=Oe?Oe:[],setIsCollectionPickerOpen:le,setEntitledCollections:je,setPrerequisiteCollections:Se,useNewPicker:!!U.newPickerConf,setSelectedDiscountDetails:Re,selectedDiscountDetails:we,isProductVariableSupported:U.isProductVariableSupported,entitledProductVariable:ge,setEntitledProductVariable:_e,preRequisiteProductVariable:Ve,setPreRequisiteProductVariable:Ae,productVariableList:U.productVariableList,isAddExpirationChecked:Me,setIsAddExpirationChecked:qe,dynamicDiscountValidationError:Be,setDynamicDiscountValidationError:Ge,setValidationErrorMessage:Fe,resetValidationErrors:ze,discountDetailsOptions:W,selectedExpiration:Ye,setSelectedExpiration:Xe,makeExpiryMandatory:!!U.makeExpiryMandatory})]}),!!ee&&i(t,{children:[!U.newPickerConf&&e("div",Object.assign({style:{padding:"12px 0"}},{children:e(f,{show:!0,onSave:()=>{},products:null!==(z=U.products)&&void 0!==z?z:[],title:"Select Products",onClose:()=>{ie(void 0)},selectedProducts:null!==(K=ee===M.ENTITLED?Te:Ie)&&void 0!==K?K:[],setSelectedProducts:ee===M.ENTITLED?Ee:fe,onSearchKeyChange:U.onProductSearch})})),U.newPickerConf&&e(A,{visible:!0,onClose:()=>ie(void 0),collectionFetcher:(e,i,t)=>{var o;return(null===(o=U.newPickerConf)||void 0===o?void 0:o.fetchCollections)?U.newPickerConf.fetchCollections(e,i,!1,t):null},productFetcher:(e,i,t,o,n)=>{var l;return(null===(l=U.newPickerConf)||void 0===l?void 0:l.fetchProducts)?U.newPickerConf.fetchProducts(e,i,o,n,!1,t):null},selectedItems:ee===M.ENTITLED?Te:Ie,onAdd:e=>{ee===M.ENTITLED?Ee(e):fe(e),ie(void 0)},zIndex:200,storeId:U.newPickerConf.storeId,appType:U.newPickerConf.appType||L.ApplicationType.BIK,searchInCollectionFetcher:(e,i,t,o)=>{var n;return(null===(n=U.newPickerConf)||void 0===n?void 0:n.searchInCollection)?U.newPickerConf.searchInCollection(e,i,t,!1,o):null},customCollectionRestriction:!1,searchFetcher:(e,i,t)=>{var o;return(null===(o=U.newPickerConf)||void 0===o?void 0:o.searchProducts)?U.newPickerConf.searchProducts(e,i,!1,t):null},hideCollectionCheckbox:!0,hideVariantCheckbox:!0,selectProductsFromCustomCollection:!0,hideSelectionCount:!0})]}),!!ne&&e("div",Object.assign({style:{padding:"12px 0"}},{children:i(t,{children:[U.newPickerConf&&e(A,{visible:!0,onClose:()=>le(void 0),collectionFetcher:U.newPickerConf.fetchCollections,productFetcher:U.newPickerConf.fetchProducts,selectedItems:ne===M.ENTITLED?De:Oe,onAdd:e=>{Object.values(e).forEach((e=>{e.products&&delete e.products})),ne===M.ENTITLED?je(e):Se(e),le(void 0)},customCollectionRestriction:!1,zIndex:200,storeId:U.newPickerConf.storeId,appType:U.newPickerConf.appType||L.ApplicationType.BIK,searchInCollectionFetcher:U.newPickerConf.searchInCollection,searchFetcher:U.newPickerConf.searchProducts,hideProductCheckbox:!0,hideVariantCheckbox:!0,title:"Select Collections",hideGlobalSearch:!0,hideSelectionCount:!0}),!U.newPickerConf&&e(f,{show:!0,onSave:()=>{},products:null!==($=U.collection)&&void 0!==$?$:[],title:"Select Products",onClose:()=>{le(void 0)},selectedProducts:null!==(Z=ne===M.ENTITLED?De:Oe)&&void 0!==Z?Z:[],setSelectedProducts:ne===M.ENTITLED?je:Se,onSearchKeyChange:U.onCollectionSearch,searchPlaceholder:"Search collections..."})]})})),te&&e(x,{children:e("div",Object.assign({style:{width:"50%",height:"100%",marginLeft:"50%"}},{children:e(j,{type:D.EMBEDDED,data:null!==(J=U.productVariableList)&&void 0!==J?J:[],showHeader:!0,onSelect:e=>{if(te===M.ENTITLED){const{displayName:i,actualValue:t,isAvailable:o}=e;_e({displayName:i,actualValue:t,isAvailable:o}),oe(void 0)}if(te===M.PREREQUISITE){const{displayName:i,actualValue:t,isAvailable:o}=e;Ae({displayName:i,actualValue:t,isAvailable:o}),oe(void 0)}},onClose:()=>{oe(void 0)}})}))})]}))};export{U as DiscountModal};
@@ -1 +1,2 @@
1
1
  export * from './modal';
2
+ export { ScreenName } from './type';
@@ -9,7 +9,7 @@ import e from"styled-components";import{Caption as r}from"../../TypographyStyle.
9
9
  border: 2px solid
10
10
  ${e=>e.hasError?`${o.content.negative}`:e.showBorder?`${o.stroke.brand}`:`${o.stroke.primary}`};
11
11
  border: ${e=>e.showDashedBorder&&`2px dashed ${o.content.brand}`};
12
- height: 100%;
12
+ height: ${e=>e.isWhatsappCarousel?"100%":"auto"};
13
13
  display: flex;
14
14
  flex-direction: column;
15
15
  :hover {
@@ -36,14 +36,14 @@ import e from"styled-components";import{Caption as r}from"../../TypographyStyle.
36
36
  min-height: 152px;
37
37
  margin-bottom: 4px;
38
38
  margin: 0px 8px;
39
- `,p=e.div`
39
+ `,a=e.div`
40
40
  padding: 12px;
41
41
  display: flex;
42
42
  flex-direction: row;
43
43
  justify-content: center;
44
44
  align-items: center;
45
45
  border-top: 1px solid ${o.stroke.primary};
46
- `,a=e.div`
46
+ `,p=e.div`
47
47
  display: flex;
48
48
  flex-direction: row;
49
49
  justify-content: space-between;
@@ -66,4 +66,4 @@ import e from"styled-components";import{Caption as r}from"../../TypographyStyle.
66
66
  position: absolute;
67
67
  top: 16px;
68
68
  right: 16px;
69
- `;export{p as ChatBtnContainer,t as Container,d as FooterText,a as FooterWrapper,s as MediaContainer,i as TimeStamp};
69
+ `;export{a as ChatBtnContainer,t as Container,d as FooterText,p as FooterWrapper,s as MediaContainer,i as TimeStamp};
@@ -1,4 +1,4 @@
1
- import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"styled-components";import{useTemplateModalContext as s}from"../../template-context-mapper/context/templateModalContext.js";import{BACKGROUND_PREVIEW_IMAGE as a}from"../../template-context-mapper/utils/constants.js";import{TitleRegular as i}from"../../TypographyStyle.js";import{COLORS as p}from"../../../constants/Theme.js";import{getPreviewPropLen as n}from"../utils/getPreviewPropLen.js";import m from"./ChatHeader.js";import{ChatUIV2 as c}from"./ChatUiV2.js";const h=o.div`
1
+ import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"styled-components";import{useTemplateModalContext as s}from"../../template-context-mapper/context/templateModalContext.js";import{BACKGROUND_PREVIEW_IMAGE as a}from"../../template-context-mapper/utils/constants.js";import{TitleRegular as i}from"../../TypographyStyle.js";import{COLORS as p}from"../../../constants/Theme.js";import{getPreviewPropLen as n}from"../utils/getPreviewPropLen.js";import m from"./ChatHeader.js";import{ChatUIV2 as c}from"./ChatUiV2.js";const l=o.div`
2
2
  background-image: ${e=>e.isWhatsappCarousel?"none":`url(${a})`};
3
3
  border-radius: 4px;
4
4
  background-repeat: no-repeat;
@@ -6,6 +6,6 @@ import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"st
6
6
  background-size: cover;
7
7
  position: relative;
8
8
  height: ${e=>e.isWhatsappCarousel?"100%":"auto"};
9
- `,l=o(i)`
9
+ `,d=o(i)`
10
10
  color: ${p.content.primary};
11
- `,d=o=>{const{hideDeviceContainerInPreview:a}=s();return 3===n(o)?e(t,{children:o.zeroStateComponent}):a?e(c,Object.assign({showHeader:o.showHeader},o)):e(t,{children:r(h,Object.assign({style:o.containerStyle,showHeader:o.showHeader,isWhatsappCarousel:o.isWhatsappCarousel},{children:[o.showHeader&&e(m,{}),r("div",Object.assign({style:{padding:"small"===o.size?"12px 32px 12px 12px":`16px ${o.isWhatsappCarousel?"0px":"56px"} ${o.isWhatsappCarousel?"2px":"16px"} 16px`,height:o.isWhatsappCarousel?"100%":"auto"}},{children:[!o.hidePreviewText&&e("div",Object.assign({style:{marginBottom:16}},{children:e(l,{children:"Preview"})})),e(c,Object.assign({showHeader:o.showHeader},o))]}))]}))})};export{d as WhatsappLikePreviewV2};
11
+ `,h=o=>{const{hideDeviceContainerInPreview:a}=s();return 3===n(o)?e(t,{children:o.zeroStateComponent}):a?e(c,Object.assign({showHeader:o.showHeader},o)):e(t,{children:r(l,Object.assign({style:o.containerStyle,showHeader:o.showHeader,isWhatsappCarousel:o.isWhatsappCarousel},{children:[o.showHeader&&e(m,{}),r("div",Object.assign({style:{padding:"small"===o.size?"12px 32px 12px 12px":`16px ${o.isWhatsappCarousel?"0px":"56px"} ${o.isWhatsappCarousel?"2px":"16px"} 16px`,height:"100%",overflowY:"auto"}},{children:[!o.hidePreviewText&&e("div",Object.assign({style:{marginBottom:16}},{children:e(d,{children:"Preview"})})),e(c,Object.assign({showHeader:o.showHeader},o))]}))]}))})};export{h as WhatsappLikePreviewV2};
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- export{AmplitudeEvent}from"./amplitude/index.js";import*as o from"./components/template-preview/constants/regexPatterns.js";export{o as regexPatterns};export{default as StringUtils}from"./utils/StringUtils.js";export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{ComponentZindex}from"./constants/zindex.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{PureSpinner,Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";export{TemplatePreview}from"./components/template-preview/TemplatePreview.js";export{WhatsappLikePreview}from"./components/template-preview/WhatsApp/WhatsAppLikePreview.js";export{WhatsappLikePreviewV2}from"./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js";export{renderVariableUIForPreview}from"./components/template-preview/helpers/SmsTemplateHelper.js";export{WhatsAppFormatToHTML}from"./components/template-preview/helpers/WhatsAppFormatToHTML.js";export{VariableEditorHelper}from"./components/template-preview/helpers/VariableEditorHelper.js";export{ACTIONS_TYPES,CUSTOM_URL_NAME,HEADER_TYPES,STATIC_URL_CTA_OPTION,TEMPLATE_EDITOR,TEMPLATE_STATUS}from"./components/template-preview/models/TemplateMeta.js";export{BUTTON_TYPE,POD,TEMPLATE_QUALITY}from"./components/template-preview/models/WhatsAppTemplate.js";export{CHANNEL_TYPE}from"./components/template-preview/models/Channels.js";export{TemplateContextMapper}from"./components/template-context-mapper/TemplateContextMapper.js";export{getAllDataFromTemplateComponent,getAllDataFromWebpushTemplateComponent}from"./components/template-context-mapper/utils/getDataFromTemplateComponent.js";export{isVariable,validateIsUrl}from"./components/template-context-mapper/utils/validateIsUrl.js";import"./_virtual/_tslib.js";export{TemplateAnalyticsSkeleton}from"./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js";export{AnalyticsItem,RightPanelTemplateAnalytics,TemplateAnalyticsComponent}from"./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown,TooltipStyled}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{AiBodyCaption,AiBodyTiny,BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodyRegular,BodySecondary,BodySecondaryLink,BodySmall,BodyTiny,ButtonLarge,ButtonLargeAI,ButtonRegular,ButtonRegularAI,Caption,CaptionBold,Display,SmallRegular,SubHeading,TextPlaceholder,Tiny,TitleFour,TitleLarge,TitleMedium,TitleRegular,TitleSmall,TitleXlarge}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";import"react/jsx-runtime";export{ProgressBarType,ProgressBarV2,TextAlignment}from"./components/progress-bar-v2/ProgressBarV2.js";export{QueryBuilder}from"./components/QueryBuilder/QueryBuilder.js";export{BaseQueryBuilderNode}from"./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";export{PropertyNode,PropertyNodeHeadless}from"./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js";export{queryBuilderSlice}from"./components/QueryBuilder/redux/queryBuilder.reducer.js";export{queryBuilderCacheSlice}from"./components/QueryBuilder/redux/queryBuilderCache.reducer.js";export{AD_STRING_OPERATORS,ANY_AD_OPERATORS,ANY_IG_OPERATORS,BOOLEAN_OPERATORS,DATE_OPERATORS,EVENT_VALUES,EXACTLY_OPERATORS,FREQUENCY_OPERATORS,ICE_BREAKER_OPERATORS,IG_STRING_OPERATORS,INTEGER_OPERATORS,MAIL_SUBJECT_OPERATORS,REACTION_OPERATORS,SPECIFIC_IG_OPERATORS,STRING_OPERATORS,STRING_RESTRICTED_OPERATORS,STRING_RESTRICTED_OPERATORS_2,STRING_RESTRICTED_OPERATORS_3}from"./components/QueryBuilder/types/QueryBuilderOperator.type.js";export{StyledModal}from"./components/modals/styledModal.js";export{DropdownPopover}from"./components/dropdown/DropdownPopover/index.js";export{Dropdown}from"./components/dropdown/Dropdown.js";export{ChipDropdown,ChipDropdownContainer}from"./components/dropdown/ChipDropdown.js";export{OpenedDropdown}from"./components/dropdown/OpenedDropdown/components/OpennedDropdown.js";export{MenuItemDropdown}from"./components/dropdown/MenuItem/MenuItem.js";export{AnalyticsCard}from"./components/analytics-card/AnalyticsCard.js";export{AnalyticsContainer,CardDataContainer}from"./components/analytics-card/AnalyticsCard.styled.js";export{Input}from"./components/input/Input.js";export{AnalyticsChip}from"./components/analytics-chips-and-dropdowns/AnalyticsChip.js";export{AnalyticsDropdown,EachItem,formatDate}from"./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js";export{AnalyticsMultiChip}from"./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js";export{AnalyticsMetric}from"./components/analytics-chips-and-dropdowns/AnalyticsMetric.js";export{AnalyticsTrend}from"./components/analytics-chips-and-dropdowns/AnalyticsTrend.js";export{LineChart}from"./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";export{LinearChipGroupedChart}from"./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js";export{Card,PieChartAnalytics}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";export{PieChart}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js";export{HorizontalGraph}from"./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";export{StackedBarChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";export{StackedBarDistributionChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js";export{GRAPH_ORIENTATION}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js";export{VerticalGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";export{FunnelVerticalBarGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js";export{HEAT,HEAT_COLORS,HEAT_GRADING_TYPE,HeatMap}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";export{HeatBoxStyled,HeatMapVertical}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js";export{VerticalBarAndLinearGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";export{TruncateValue,calculatePercentage,roundNumber,truncateValueForIndianStore,truncateValueForInternationalStore,truncateValueTo10K,truncateValueToA,truncateValueToB,truncateValueToC,truncateValueToK,truncateValueToL,truncateValueToM,truncateValueToT}from"./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js";export{AVATAR_SIZE_VS_ICON_SIZE_MAP,Avatar,BACKGROUND_VS_TEXT_COLOR_MAP,MESSAGE_CHANNELS}from"./components/avatar/Avatar.js";export{AVATAR_BACKGROUND,AVATAR_SIZE_MAP,AVATAR_TYPES,SIZE}from"./components/avatar/AvatarHelper.js";export{Alert}from"./components/alerts/Alert.js";export{ALERT_TYPES,COLOR_CONFIG_MAP,CONTENT_POSITION}from"./components/alerts/AlertHelper.js";export{RATIO,Thumbnail}from"./components/thumbnail/Thumbnail.js";export{Curtain}from"./components/curtain/Curtain.js";export{DatePicker}from"./components/datePicker/DatePicker.js";export{DatePickerWrapper}from"./components/datePicker/DatePickerWrapper.js";export{Loader,Switch,SwitchContainer,Thumb}from"./components/switch/Switch.js";export{SubscriptionPlan}from"./components/plans/SubscriptionPlan.js";export{BottomWrapper,HeaderWrapper,SubscriptionPlanSelector,defaultTabs}from"./components/plans/SubscriptionPlanSelector.js";export{NewSubscriptionPlan}from"./components/plans/NewSubscriptionPlan.js";export{SubscriptionPlansCollected}from"./components/plans/SubscriptionPlansCollected.js";export{TabItemComponent,Tabs}from"./components/tabs/Tabs.js";export{DynamicTabs}from"./components/dynamic-tabs/DynamicTabs.js";export{BikShimmer}from"./components/shimmer/ShimmerComponent/BikShimmer.js";export{TablePagination}from"./components/TablePagination/TablePagination.js";export{TablePaginationCard,TablePaginationCardStyled}from"./components/TablePagination/TablePaginationCard.js";export{StateModalComponent}from"./components/states-modal/StateModalComponent.js";export{DeleteConfirmationModal}from"./components/states-modal/DeleteConfirmationModal.js";export{ButtonActions,ButtonTypes,StateComponent,StateInterface}from"./components/states/StateComponent.js";export{ShopifyScopeWrapper}from"./components/states/ShopifyScopeWrapper.js";export{WhatsAppTextEditor}from"./components/WhatsAppTextEditor/WhatsAppTextEditor.js";export{CustomRightBorder,EditorActionTypes,WhatsAppTextEditorHeader}from"./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js";export{BaseWhatsappContentLangHelper}from"./helpers/BaseWhatsappContentLang.helper.js";export{CURTAIN_COLOR_CONFIG_MAP,CURTAIN_MODE,CURTAIN_TYPES}from"./components/curtain/CurtainHelper.js";export{resizeImage}from"./utils/resizeImage.js";export{PickerType}from"./components/variable-picker-v3/model.js";export{CardSelectionModal}from"./components/card-selection-modal/CardSelectionModal.js";export{BikImageCropper}from"./components/image-cropper/BikImageCropper.js";export{BikImagePipeline}from"./components/image-cropper/BikImagePipeline/BikImagePipeline.js";export{ButtonGroup}from"./components/buttonGroup/ButtonGroup.js";export{BikAccordion}from"./components/accordion/Accordion.js";export{FileUploader}from"./components/file-uploader/FileUploader.js";export{ColourInput}from"./components/colourInput/ColourInput.js";export{BikHeader}from"./components/bik-layout/BikHeader.js";export{BikLayout}from"./components/bik-layout/BikLayout.js";export{BikProfile}from"./components/bik-layout/BikProfile.js";export{SimpleSidebar}from"./components/bik-layout/SimpleSidebar.js";export{BikSidebar}from"./components/bik-layout/BikSidebar.js";export{FeatureModal}from"./components/bik-layout/FeatureModal.js";export{SidebarSkeleton}from"./components/bik-layout/SidebarSkeleton.js";export{ShowShopifyRestrictedModal}from"./components/bik-layout/ShowShopifyRestrictedModal.js";export{FeatureModalV2}from"./components/bik-layout/FeatureModalV2.js";export{SearchBar}from"./components/searchBar/searchBar.js";export{CustomDateTime}from"./components/custom-date-time/CustomDateTime.js";export{PricePleaseProductPicker,ProductPickerContent}from"./components/product-picker/ProductPickerModal.js";export{DiscountModal}from"./components/discount-modal/DiscountModal.js";export{CouponExpiration}from"./components/discount-modal/CouponExpiration/CouponExpiration.js";export{COUPON_EXPIRATION,DISCOUNT_APPLIES_TO,DISCOUNT_TARGET_SELECTION,DISCOUNT_TARGET_TYPES,DISCOUNT_TYPES,DISCOUNT_VALUE_TYPES,MIN_PURCHASE_REQUIREMENT,OFFER_APPLIES_TO,initialDynamicCouponErrorState,initialStaticCouponErrorState}from"./components/discount-modal/type.js";export{CountryCodePicker}from"./components/country-code-picker/CountryCodePicker.js";export{CountriesData}from"./components/country-code-picker/CountryCodePicker.modal.js";export{DEFAULT_IMAGE,ShimmerImage}from"./components/shimmer-image/ShimmerImage.js";export{ProductPickerModal}from"./components/product-picker-v2/modal.js";export{Carousel}from"./components/carousel/carousel.js";export{CarouselSecondary}from"./components/carousel-secondary/CarouselSecondary.js";export{AccessTokenTroubleshootDialog}from"./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js";export{RadioList}from"./components/radioList/RadioList.js";export{CheckList}from"./components/checkList/CheckList.js";export{DateKeys,MEDIA_TYPES,PostPicker,dateOptions}from"./components/postPicker/postPicker.js";export{DropdownButton}from"./components/dropdown-button/DropdownButton.js";export{SideModal}from"./components/side-modal/SideModal.js";export{KeywordsInput}from"./components/keywords-input/KeywordsInput.js";export{AddVariableV2SideModal}from"./components/add-variableV2/AddVariableV2SideModal.js";export{AddVariableV2}from"./components/add-variableV2/AddVariableV2.js";export{NaLinkWrapper,NavigationHyperlink}from"./components/navigation-hyperlink/NavigationHyperlink.js";export{SearchFilter}from"./components/SearchFilter/index.js";export{InputWithVariables}from"./components/input-with-vars/InputWithVariables.js";export{DashboardReviewPopUp}from"./components/dashboard-review-popup/DashboardReviewPopUp.js";export{StarRating}from"./components/star-rating/StarRating.js";export{TestimonialCard}from"./components/testimonial-card/TestimonialCard.js";export{BikSlider}from"./components/slider/slider.js";export{ResizableImage}from"./components/resizeImage/index.js";export{validateURL}from"./utils/validator.js";export{CarouselPreview}from"./components/carousel-preview/CarouselPreview.js";export{Floater}from"./components/floater/floater.js";export{CardSelector}from"./components/card-selector/CardSelector.js";export{CardSelectorGroup}from"./components/card-selector/CardSelectorGroup.js";export{VariablePicker}from"./components/variable-picker-v3/VariablePicker.js";export{ActionButtons}from"./components/action-button/ActionButtons.js";export{ActivateBikAi}from"./components/ai-modals/ActivateBikAI.js";export{AiSyncProgress}from"./components/ai-modals/AiSyncProgress.js";export{AiCreditsExhausted}from"./components/ai-modals/AiCreditsExhausted.js";export{AiCreditsLow}from"./components/ai-modals/AiCreditsLow.js";export{CustomPortal}from"./components/input-with-vars/customPortal.js";export{FloatingInputDropdown}from"./components/floating-input-dropdown/FloatingInputDropdown.js";export{MultilevelDropdownPopover}from"./components/dropdown/MultilevelDropdownPopover/index.js";export{DropShadow}from"./components/dropShadow/DropShadow.js";export{MultiLevelDropdown}from"./components/multi-level-dropdown/MultiLevelDropdown.js";export{DataSourcePanel}from"./components/data-source-panel/DataSourcePanel.js";export{UnsatisfactoryResponseList}from"./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js";export{UnsatisfactoryCountIntentWiseModal}from"./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js";export{CustomDataCategories,CustomDataType}from"./components/data-source-panel/model.js";export{CarouselVersion}from"./components/carousel-secondary/model.js";
1
+ export{AmplitudeEvent}from"./amplitude/index.js";import*as o from"./components/template-preview/constants/regexPatterns.js";export{o as regexPatterns};export{default as StringUtils}from"./utils/StringUtils.js";export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{ComponentZindex}from"./constants/zindex.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{PureSpinner,Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";export{TemplatePreview}from"./components/template-preview/TemplatePreview.js";export{WhatsappLikePreview}from"./components/template-preview/WhatsApp/WhatsAppLikePreview.js";export{WhatsappLikePreviewV2}from"./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js";export{renderVariableUIForPreview}from"./components/template-preview/helpers/SmsTemplateHelper.js";export{WhatsAppFormatToHTML}from"./components/template-preview/helpers/WhatsAppFormatToHTML.js";export{VariableEditorHelper}from"./components/template-preview/helpers/VariableEditorHelper.js";export{ACTIONS_TYPES,CUSTOM_URL_NAME,HEADER_TYPES,STATIC_URL_CTA_OPTION,TEMPLATE_EDITOR,TEMPLATE_STATUS}from"./components/template-preview/models/TemplateMeta.js";export{BUTTON_TYPE,POD,TEMPLATE_QUALITY}from"./components/template-preview/models/WhatsAppTemplate.js";export{CHANNEL_TYPE}from"./components/template-preview/models/Channels.js";export{TemplateContextMapper}from"./components/template-context-mapper/TemplateContextMapper.js";export{getAllDataFromTemplateComponent,getAllDataFromWebpushTemplateComponent}from"./components/template-context-mapper/utils/getDataFromTemplateComponent.js";export{isVariable,validateIsUrl}from"./components/template-context-mapper/utils/validateIsUrl.js";import"./_virtual/_tslib.js";export{TemplateAnalyticsSkeleton}from"./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js";export{AnalyticsItem,RightPanelTemplateAnalytics,TemplateAnalyticsComponent}from"./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown,TooltipStyled}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{AiBodyCaption,AiBodyTiny,BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodyRegular,BodySecondary,BodySecondaryLink,BodySmall,BodyTiny,ButtonLarge,ButtonLargeAI,ButtonRegular,ButtonRegularAI,Caption,CaptionBold,Display,SmallRegular,SubHeading,TextPlaceholder,Tiny,TitleFour,TitleLarge,TitleMedium,TitleRegular,TitleSmall,TitleXlarge}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";import"react/jsx-runtime";export{ProgressBarType,ProgressBarV2,TextAlignment}from"./components/progress-bar-v2/ProgressBarV2.js";export{QueryBuilder}from"./components/QueryBuilder/QueryBuilder.js";export{BaseQueryBuilderNode}from"./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";export{PropertyNode,PropertyNodeHeadless}from"./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js";export{queryBuilderSlice}from"./components/QueryBuilder/redux/queryBuilder.reducer.js";export{queryBuilderCacheSlice}from"./components/QueryBuilder/redux/queryBuilderCache.reducer.js";export{AD_STRING_OPERATORS,ANY_AD_OPERATORS,ANY_IG_OPERATORS,BOOLEAN_OPERATORS,DATE_OPERATORS,EVENT_VALUES,EXACTLY_OPERATORS,FREQUENCY_OPERATORS,ICE_BREAKER_OPERATORS,IG_STRING_OPERATORS,INTEGER_OPERATORS,MAIL_SUBJECT_OPERATORS,REACTION_OPERATORS,SPECIFIC_IG_OPERATORS,STRING_OPERATORS,STRING_RESTRICTED_OPERATORS,STRING_RESTRICTED_OPERATORS_2,STRING_RESTRICTED_OPERATORS_3}from"./components/QueryBuilder/types/QueryBuilderOperator.type.js";export{StyledModal}from"./components/modals/styledModal.js";export{DropdownPopover}from"./components/dropdown/DropdownPopover/index.js";export{Dropdown}from"./components/dropdown/Dropdown.js";export{ChipDropdown,ChipDropdownContainer}from"./components/dropdown/ChipDropdown.js";export{OpenedDropdown}from"./components/dropdown/OpenedDropdown/components/OpennedDropdown.js";export{MenuItemDropdown}from"./components/dropdown/MenuItem/MenuItem.js";export{AnalyticsCard}from"./components/analytics-card/AnalyticsCard.js";export{AnalyticsContainer,CardDataContainer}from"./components/analytics-card/AnalyticsCard.styled.js";export{Input}from"./components/input/Input.js";export{AnalyticsChip}from"./components/analytics-chips-and-dropdowns/AnalyticsChip.js";export{AnalyticsDropdown,EachItem,formatDate}from"./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js";export{AnalyticsMultiChip}from"./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js";export{AnalyticsMetric}from"./components/analytics-chips-and-dropdowns/AnalyticsMetric.js";export{AnalyticsTrend}from"./components/analytics-chips-and-dropdowns/AnalyticsTrend.js";export{LineChart}from"./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";export{LinearChipGroupedChart}from"./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js";export{Card,PieChartAnalytics}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";export{PieChart}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js";export{HorizontalGraph}from"./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";export{StackedBarChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";export{StackedBarDistributionChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js";export{GRAPH_ORIENTATION}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js";export{VerticalGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";export{FunnelVerticalBarGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js";export{HEAT,HEAT_COLORS,HEAT_GRADING_TYPE,HeatMap}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";export{HeatBoxStyled,HeatMapVertical}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js";export{VerticalBarAndLinearGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";export{TruncateValue,calculatePercentage,roundNumber,truncateValueForIndianStore,truncateValueForInternationalStore,truncateValueTo10K,truncateValueToA,truncateValueToB,truncateValueToC,truncateValueToK,truncateValueToL,truncateValueToM,truncateValueToT}from"./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js";export{AVATAR_SIZE_VS_ICON_SIZE_MAP,Avatar,BACKGROUND_VS_TEXT_COLOR_MAP,MESSAGE_CHANNELS}from"./components/avatar/Avatar.js";export{AVATAR_BACKGROUND,AVATAR_SIZE_MAP,AVATAR_TYPES,SIZE}from"./components/avatar/AvatarHelper.js";export{Alert}from"./components/alerts/Alert.js";export{ALERT_TYPES,COLOR_CONFIG_MAP,CONTENT_POSITION}from"./components/alerts/AlertHelper.js";export{RATIO,Thumbnail}from"./components/thumbnail/Thumbnail.js";export{Curtain}from"./components/curtain/Curtain.js";export{DatePicker}from"./components/datePicker/DatePicker.js";export{DatePickerWrapper}from"./components/datePicker/DatePickerWrapper.js";export{Loader,Switch,SwitchContainer,Thumb}from"./components/switch/Switch.js";export{SubscriptionPlan}from"./components/plans/SubscriptionPlan.js";export{BottomWrapper,HeaderWrapper,SubscriptionPlanSelector,defaultTabs}from"./components/plans/SubscriptionPlanSelector.js";export{NewSubscriptionPlan}from"./components/plans/NewSubscriptionPlan.js";export{SubscriptionPlansCollected}from"./components/plans/SubscriptionPlansCollected.js";export{TabItemComponent,Tabs}from"./components/tabs/Tabs.js";export{DynamicTabs}from"./components/dynamic-tabs/DynamicTabs.js";export{BikShimmer}from"./components/shimmer/ShimmerComponent/BikShimmer.js";export{TablePagination}from"./components/TablePagination/TablePagination.js";export{TablePaginationCard,TablePaginationCardStyled}from"./components/TablePagination/TablePaginationCard.js";export{StateModalComponent}from"./components/states-modal/StateModalComponent.js";export{DeleteConfirmationModal}from"./components/states-modal/DeleteConfirmationModal.js";export{ButtonActions,ButtonTypes,StateComponent,StateInterface}from"./components/states/StateComponent.js";export{ShopifyScopeWrapper}from"./components/states/ShopifyScopeWrapper.js";export{WhatsAppTextEditor}from"./components/WhatsAppTextEditor/WhatsAppTextEditor.js";export{CustomRightBorder,EditorActionTypes,WhatsAppTextEditorHeader}from"./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js";export{BaseWhatsappContentLangHelper}from"./helpers/BaseWhatsappContentLang.helper.js";export{CURTAIN_COLOR_CONFIG_MAP,CURTAIN_MODE,CURTAIN_TYPES}from"./components/curtain/CurtainHelper.js";export{resizeImage}from"./utils/resizeImage.js";export{PickerType}from"./components/variable-picker-v3/model.js";export{CardSelectionModal}from"./components/card-selection-modal/CardSelectionModal.js";export{BikImageCropper}from"./components/image-cropper/BikImageCropper.js";export{BikImagePipeline}from"./components/image-cropper/BikImagePipeline/BikImagePipeline.js";export{ButtonGroup}from"./components/buttonGroup/ButtonGroup.js";export{BikAccordion}from"./components/accordion/Accordion.js";export{FileUploader}from"./components/file-uploader/FileUploader.js";export{ColourInput}from"./components/colourInput/ColourInput.js";export{BikHeader}from"./components/bik-layout/BikHeader.js";export{BikLayout}from"./components/bik-layout/BikLayout.js";export{BikProfile}from"./components/bik-layout/BikProfile.js";export{SimpleSidebar}from"./components/bik-layout/SimpleSidebar.js";export{BikSidebar}from"./components/bik-layout/BikSidebar.js";export{FeatureModal}from"./components/bik-layout/FeatureModal.js";export{SidebarSkeleton}from"./components/bik-layout/SidebarSkeleton.js";export{ShowShopifyRestrictedModal}from"./components/bik-layout/ShowShopifyRestrictedModal.js";export{FeatureModalV2}from"./components/bik-layout/FeatureModalV2.js";export{SearchBar}from"./components/searchBar/searchBar.js";export{CustomDateTime}from"./components/custom-date-time/CustomDateTime.js";export{PricePleaseProductPicker,ProductPickerContent}from"./components/product-picker/ProductPickerModal.js";export{DiscountModal}from"./components/discount-modal/DiscountModal.js";export{CouponExpiration}from"./components/discount-modal/CouponExpiration/CouponExpiration.js";export{COUPON_EXPIRATION,DISCOUNT_APPLIES_TO,DISCOUNT_TARGET_SELECTION,DISCOUNT_TARGET_TYPES,DISCOUNT_TYPES,DISCOUNT_VALUE_TYPES,MIN_PURCHASE_REQUIREMENT,OFFER_APPLIES_TO,initialDynamicCouponErrorState,initialStaticCouponErrorState}from"./components/discount-modal/type.js";export{CountryCodePicker}from"./components/country-code-picker/CountryCodePicker.js";export{CountriesData}from"./components/country-code-picker/CountryCodePicker.modal.js";export{DEFAULT_IMAGE,ShimmerImage}from"./components/shimmer-image/ShimmerImage.js";export{ProductPickerModal}from"./components/product-picker-v2/modal.js";export{ScreenName}from"./components/product-picker-v2/type.js";export{Carousel}from"./components/carousel/carousel.js";export{CarouselSecondary}from"./components/carousel-secondary/CarouselSecondary.js";export{AccessTokenTroubleshootDialog}from"./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js";export{RadioList}from"./components/radioList/RadioList.js";export{CheckList}from"./components/checkList/CheckList.js";export{DateKeys,MEDIA_TYPES,PostPicker,dateOptions}from"./components/postPicker/postPicker.js";export{DropdownButton}from"./components/dropdown-button/DropdownButton.js";export{SideModal}from"./components/side-modal/SideModal.js";export{KeywordsInput}from"./components/keywords-input/KeywordsInput.js";export{AddVariableV2SideModal}from"./components/add-variableV2/AddVariableV2SideModal.js";export{AddVariableV2}from"./components/add-variableV2/AddVariableV2.js";export{NaLinkWrapper,NavigationHyperlink}from"./components/navigation-hyperlink/NavigationHyperlink.js";export{SearchFilter}from"./components/SearchFilter/index.js";export{InputWithVariables}from"./components/input-with-vars/InputWithVariables.js";export{DashboardReviewPopUp}from"./components/dashboard-review-popup/DashboardReviewPopUp.js";export{StarRating}from"./components/star-rating/StarRating.js";export{TestimonialCard}from"./components/testimonial-card/TestimonialCard.js";export{BikSlider}from"./components/slider/slider.js";export{ResizableImage}from"./components/resizeImage/index.js";export{validateURL}from"./utils/validator.js";export{CarouselPreview}from"./components/carousel-preview/CarouselPreview.js";export{Floater}from"./components/floater/floater.js";export{CardSelector}from"./components/card-selector/CardSelector.js";export{CardSelectorGroup}from"./components/card-selector/CardSelectorGroup.js";export{VariablePicker}from"./components/variable-picker-v3/VariablePicker.js";export{ActionButtons}from"./components/action-button/ActionButtons.js";export{ActivateBikAi}from"./components/ai-modals/ActivateBikAI.js";export{AiSyncProgress}from"./components/ai-modals/AiSyncProgress.js";export{AiCreditsExhausted}from"./components/ai-modals/AiCreditsExhausted.js";export{AiCreditsLow}from"./components/ai-modals/AiCreditsLow.js";export{CustomPortal}from"./components/input-with-vars/customPortal.js";export{FloatingInputDropdown}from"./components/floating-input-dropdown/FloatingInputDropdown.js";export{MultilevelDropdownPopover}from"./components/dropdown/MultilevelDropdownPopover/index.js";export{DropShadow}from"./components/dropShadow/DropShadow.js";export{MultiLevelDropdown}from"./components/multi-level-dropdown/MultiLevelDropdown.js";export{DataSourcePanel}from"./components/data-source-panel/DataSourcePanel.js";export{UnsatisfactoryResponseList}from"./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js";export{UnsatisfactoryCountIntentWiseModal}from"./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js";export{CustomDataCategories,CustomDataType}from"./components/data-source-panel/model.js";export{CarouselVersion}from"./components/carousel-secondary/model.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.685-beta.14",
3
+ "version": "0.0.685-beta.16",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",