@bikdotai/bik-component-library 0.0.639--beta--0.2 → 0.0.639--bik-comp-lib--beta

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.
Files changed (121) hide show
  1. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
  2. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  3. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  4. package/dist/cjs/components/carousel-preview/CarouselPreview.js +1 -1
  5. package/dist/cjs/components/carousel-preview/CarouselPreviewCard.js +1 -1
  6. package/dist/cjs/components/dropdown/MenuItem/MenuItem.d.ts +0 -1
  7. package/dist/cjs/components/dropdown/MenuItem/MenuItem.js +2 -17
  8. package/dist/cjs/components/shimmer-image/ShimmerImage.d.ts +1 -0
  9. package/dist/cjs/components/shimmer-image/ShimmerImage.js +1 -1
  10. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +2 -2
  11. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  12. package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +2 -0
  13. package/dist/cjs/components/template-context-mapper/context/templateModalContext.js +1 -1
  14. package/dist/cjs/components/template-context-mapper/index.d.ts +0 -2
  15. package/dist/cjs/components/template-context-mapper/modalElements/Body.js +5 -5
  16. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  17. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +2 -2
  18. package/dist/cjs/components/template-context-mapper/modalElements/Footer.js +4 -4
  19. package/dist/cjs/components/template-context-mapper/modalElements/QualityWarningModal.js +1 -0
  20. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +2 -1
  21. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +1 -1
  22. package/dist/cjs/components/template-context-mapper/utils/getPreviewDimension.js +1 -1
  23. package/dist/cjs/components/template-preview/RCS/RCSButtons.d.ts +9 -0
  24. package/dist/cjs/components/template-preview/RCS/RCSButtons.js +1 -0
  25. package/dist/cjs/components/template-preview/RCS/RCSChatPreview.d.ts +2 -0
  26. package/dist/cjs/components/template-preview/RCS/RCSChatPreview.js +1 -0
  27. package/dist/cjs/components/template-preview/RCS/RCSMediaCard.d.ts +14 -0
  28. package/dist/cjs/components/template-preview/RCS/RCSMediaCard.js +1 -0
  29. package/dist/cjs/components/template-preview/RCS/RCSPreview.styled.d.ts +21 -0
  30. package/dist/cjs/components/template-preview/RCS/RCSPreview.styled.js +59 -0
  31. package/dist/cjs/components/template-preview/RCS/RCSTemplateLikePreview.d.ts +3 -0
  32. package/dist/cjs/components/template-preview/RCS/RCSTemplateLikePreview.js +8 -0
  33. package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
  34. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.d.ts +2 -0
  35. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  36. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.d.ts +1 -0
  37. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  38. package/dist/cjs/components/template-preview/helpers/templateMiscHelper.d.ts +6 -0
  39. package/dist/cjs/components/template-preview/helpers/templateMiscHelper.js +1 -0
  40. package/dist/cjs/components/template-preview/models/Channels.d.ts +2 -1
  41. package/dist/cjs/components/template-preview/models/Channels.js +1 -1
  42. package/dist/cjs/components/template-preview/models/EmailTemplate.d.ts +2 -1
  43. package/dist/cjs/components/template-preview/models/RCSTemplate.d.ts +130 -0
  44. package/dist/cjs/components/template-preview/models/SmsTemplate.d.ts +2 -1
  45. package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +3 -32
  46. package/dist/cjs/components/template-preview/models/WhatsappCarouselTemplate.d.ts +23 -1
  47. package/dist/cjs/components/template-preview/models/types.d.ts +2 -1
  48. package/dist/cjs/index.js +1 -1
  49. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
  50. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  51. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  52. package/dist/esm/components/carousel-preview/CarouselPreview.js +1 -1
  53. package/dist/esm/components/carousel-preview/CarouselPreviewCard.js +1 -1
  54. package/dist/esm/components/dropdown/MenuItem/MenuItem.d.ts +0 -1
  55. package/dist/esm/components/dropdown/MenuItem/MenuItem.js +3 -18
  56. package/dist/esm/components/shimmer-image/ShimmerImage.d.ts +1 -0
  57. package/dist/esm/components/shimmer-image/ShimmerImage.js +1 -1
  58. package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +2 -2
  59. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  60. package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +2 -0
  61. package/dist/esm/components/template-context-mapper/context/templateModalContext.js +1 -1
  62. package/dist/esm/components/template-context-mapper/index.d.ts +0 -2
  63. package/dist/esm/components/template-context-mapper/modalElements/Body.js +3 -3
  64. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  65. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +2 -2
  66. package/dist/esm/components/template-context-mapper/modalElements/Footer.js +4 -4
  67. package/dist/esm/components/template-context-mapper/modalElements/QualityWarningModal.js +1 -0
  68. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +2 -1
  69. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +2 -2
  70. package/dist/esm/components/template-context-mapper/utils/getPreviewDimension.js +1 -1
  71. package/dist/esm/components/template-preview/RCS/RCSButtons.d.ts +9 -0
  72. package/dist/esm/components/template-preview/RCS/RCSButtons.js +1 -0
  73. package/dist/esm/components/template-preview/RCS/RCSChatPreview.d.ts +2 -0
  74. package/dist/esm/components/template-preview/RCS/RCSChatPreview.js +1 -0
  75. package/dist/esm/components/template-preview/RCS/RCSMediaCard.d.ts +14 -0
  76. package/dist/esm/components/template-preview/RCS/RCSMediaCard.js +1 -0
  77. package/dist/esm/components/template-preview/RCS/RCSPreview.styled.d.ts +21 -0
  78. package/dist/esm/components/template-preview/RCS/RCSPreview.styled.js +59 -0
  79. package/dist/esm/components/template-preview/RCS/RCSTemplateLikePreview.d.ts +3 -0
  80. package/dist/esm/components/template-preview/RCS/RCSTemplateLikePreview.js +8 -0
  81. package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
  82. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.d.ts +2 -0
  83. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  84. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.d.ts +1 -0
  85. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  86. package/dist/esm/components/template-preview/helpers/templateMiscHelper.d.ts +6 -0
  87. package/dist/esm/components/template-preview/helpers/templateMiscHelper.js +1 -0
  88. package/dist/esm/components/template-preview/models/Channels.d.ts +2 -1
  89. package/dist/esm/components/template-preview/models/Channels.js +1 -1
  90. package/dist/esm/components/template-preview/models/EmailTemplate.d.ts +2 -1
  91. package/dist/esm/components/template-preview/models/RCSTemplate.d.ts +130 -0
  92. package/dist/esm/components/template-preview/models/SmsTemplate.d.ts +2 -1
  93. package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +3 -32
  94. package/dist/esm/components/template-preview/models/WhatsappCarouselTemplate.d.ts +23 -1
  95. package/dist/esm/components/template-preview/models/types.d.ts +2 -1
  96. package/dist/esm/index.js +1 -1
  97. package/package.json +1 -1
  98. package/dist/cjs/assets/icons/click.svg.js +0 -1
  99. package/dist/cjs/assets/icons/send_template.svg.js +0 -1
  100. package/dist/cjs/assets/icons/tick.svg.js +0 -1
  101. package/dist/cjs/assets/icons/tick_double.svg.js +0 -1
  102. package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.d.ts +0 -12
  103. package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js +0 -1
  104. package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.d.ts +0 -3
  105. package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js +0 -1
  106. package/dist/cjs/components/template-context-mapper/styles/TemplateAnalyticsStyles.d.ts +0 -7
  107. package/dist/cjs/components/template-context-mapper/styles/TemplateAnalyticsStyles.js +0 -63
  108. package/dist/cjs/components/template-context-mapper/utils/TemplateConstants.d.ts +0 -44
  109. package/dist/cjs/components/template-context-mapper/utils/TemplateConstants.js +0 -1
  110. package/dist/esm/assets/icons/click.svg.js +0 -1
  111. package/dist/esm/assets/icons/send_template.svg.js +0 -1
  112. package/dist/esm/assets/icons/tick.svg.js +0 -1
  113. package/dist/esm/assets/icons/tick_double.svg.js +0 -1
  114. package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.d.ts +0 -12
  115. package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js +0 -1
  116. package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.d.ts +0 -3
  117. package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js +0 -1
  118. package/dist/esm/components/template-context-mapper/styles/TemplateAnalyticsStyles.d.ts +0 -7
  119. package/dist/esm/components/template-context-mapper/styles/TemplateAnalyticsStyles.js +0 -63
  120. package/dist/esm/components/template-context-mapper/utils/TemplateConstants.d.ts +0 -44
  121. package/dist/esm/components/template-context-mapper/utils/TemplateConstants.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/arrow_down.svg.js"),a=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),o=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),d=require("../TypographyStyle.js"),g=require("./chart/utils/calcPercentage.js"),u=require("./CommonStyles.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=h(t);const m=n=>{let{percent:l,direction:o,timeline:c,customRange:u,trendRaw:h,prefixSymbol:y,trendIconStyle:m,isInternationalStore:p}=n;const j="negative"===o?s.default:a.default,x="negative"===o?r.COLORS.background.negative.vibrant:"positive"===o?r.COLORS.background.positive.vibrant:r.COLORS.content.placeholder,[b,f]=t.useState("");t.useEffect((()=>{f("today"===c?"vs yesterday":"yesterday"===c?"vs 1 day before":"7 days"===c?"vs last 7 days":"30 days"===c?"vs last 30 days":"custom"===c&&u?i.default.getAnalyticsCustomDateTimelineText(u):"")}),[c,u]);const S=e=>{let t;return t=p?g.truncateValueForInternationalStore(Math.abs(e)):g.truncateValueForIndianStore(Math.abs(e)),e<0?"-"+t:t},O=t.useRef((()=>{const e=((null!=h?h:0)>0?"+":"")+(null!=y?y:"");return void 0===h?"--":`${null!=e?e:""}${S(h)}`})());return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof l&&e.jsx(j,{color:x,height:16,width:16,style:Object.assign({marginRight:2},null!=m?m:{})}),"number"==typeof l&&o&&e.jsxs(d.Caption,Object.assign({style:{color:x}},{children:["neutral"===o?0:l<1e3?l:">999","%"]})),!!h&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:`(${O.current})`})),c&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:b}))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:s,trendPercent:a,type:h="horizontal",timeline:p,customRange:j,tooltip:x,card:b=!0,rightSeparator:f=!1,size:S="big",share:O=!1,formatVal:v,prefixSymbol:C,trailingIcon:T,onTrailIconClick:R,iconTooltipBody:w,funnelPercent:I,isLoading:$,trendRaw:L,suffixText:q,trendStyle:D,trendContainerStyle:F,trendIconStyle:M,containerStyle:k,prevTrendDiff:P,relativePercentageDiff:V,isInternationalStore:z}=t;const _="big"===S?d.TitleLarge:d.TitleMedium,A=void 0!==a?a<0?"negative":0===a?"neutral":"positive":void 0,N=void 0!==a?O?Math.round(a):Math.abs(Math.round(a)):void 0;return e.jsx(u.AnalyticsTrendContainer,Object.assign({card:b,style:Object.assign({},k)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:4,borderRightWidth:f?1:0,borderRightColor:r.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:b?0:24,paddingRight:b?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"},null!=F?F:{})},{children:[e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=D?D:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(d.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:i})),x&&e.jsx(c.Tooltip,Object.assign({body:x,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(l.default,{color:r.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},O?{justifyContent:"space-between"}:{})},{children:[$&&e.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!$&&e.jsx(_,Object.assign({style:{color:r.COLORS.content.primary}},{children:void 0===s?"--":"number"==typeof s&&v?s>999?z?`${null!=C?C:""}${g.truncateValueForInternationalStore(s)} ${null!=q?q:""}`:`${null!=C?C:""}${g.truncateValueForIndianStore(s)} ${null!=q?q:""}`:`${null!=C?C:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(s)} ${null!=q?q:""}`:`${null!=C?C:""}${s} ${null!=q?q:""}`})),"number"==typeof V&&e.jsx(o.Tag,{tagText:`${V}%`,theme:"light",type:"neutral"}),"horizontal"===h&&!$&&!O&&e.jsx(m,{timeline:p,customRange:j,percent:N,direction:A,trendRaw:L,prefixSymbol:C,trendIconStyle:M,isInternationalStore:z}),$&&!O&&"horizontal"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===h&&!$&&void 0!==I&&e.jsx(o.Tag,{tagText:`${I} %`,theme:"light",type:"neutral"}),O&&!$&&void 0!==N&&e.jsx(o.Tag,{tagText:`${N} %`,theme:"light",type:"neutral"}),O||$||!P||0==P?e.jsx(e.Fragment,{}):e.jsx(o.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(P),theme:"light",type:"neutral"})]})),"vertical"===h&&!$&&!O&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(m,{timeline:p,customRange:j,percent:N,direction:A,trendRaw:L,prefixSymbol:C,trendIconStyle:M,isInternationalStore:z})})),$&&"vertical"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),w&&!$&&e.jsx(c.Tooltip,Object.assign({body:w,placement:"right"},{children:T&&e.jsx("div",Object.assign({className:"icon--holder",onClick:R},{children:y.default.createElement(T,{height:20,width:20,color:r.COLORS.content.secondary})}))}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/arrow_down.svg.js"),a=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),o=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),d=require("../TypographyStyle.js"),g=require("./chart/utils/calcPercentage.js"),u=require("./CommonStyles.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=h(t);const m=n=>{let{percent:l,direction:o,timeline:c,customRange:u,trendRaw:h,prefixSymbol:y,trendIconStyle:m,isInternationalStore:p}=n;const j="negative"===o?s.default:a.default,x="negative"===o?r.COLORS.background.negative.vibrant:"positive"===o?r.COLORS.background.positive.vibrant:r.COLORS.content.placeholder,[b,f]=t.useState("");t.useEffect((()=>{f("today"===c?"vs yesterday":"yesterday"===c?"vs 1 day before":"7 days"===c?"vs last 7 days":"30 days"===c?"vs last 30 days":"custom"===c&&u?i.default.getAnalyticsCustomDateTimelineText(u):"")}),[c,u]);const S=e=>{let t;return t=p?g.truncateValueForInternationalStore(Math.abs(e)):g.truncateValueForIndianStore(Math.abs(e)),console.log("trendRawAbs",t),console.log("trendRaw",e),e<0?"-"+t:t},O=t.useRef((()=>{const e=((null!=h?h:0)>0?"+":"")+(null!=y?y:"");return void 0===h?"--":`${null!=e?e:""}${S(h)}`})());return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof l&&e.jsx(j,{color:x,height:16,width:16,style:Object.assign({marginRight:2},null!=m?m:{})}),"number"==typeof l&&o&&e.jsxs(d.Caption,Object.assign({style:{color:x}},{children:["neutral"===o?0:l<1e3?l:">999","%"]})),!!h&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:`(${O.current})`})),c&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:b}))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:s,trendPercent:a,type:h="horizontal",timeline:p,customRange:j,tooltip:x,card:b=!0,rightSeparator:f=!1,size:S="big",share:O=!1,formatVal:v,prefixSymbol:C,trailingIcon:T,onTrailIconClick:R,iconTooltipBody:w,funnelPercent:I,isLoading:$,trendRaw:L,suffixText:q,trendStyle:D,trendContainerStyle:F,trendIconStyle:M,containerStyle:k,prevTrendDiff:P,relativePercentageDiff:V,isInternationalStore:z}=t;const A="big"===S?d.TitleLarge:d.TitleMedium,_=void 0!==a?a<0?"negative":0===a?"neutral":"positive":void 0,N=void 0!==a?O?Math.round(a):Math.abs(Math.round(a)):void 0;return e.jsx(u.AnalyticsTrendContainer,Object.assign({card:b,style:Object.assign({},k)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:4,borderRightWidth:f?1:0,borderRightColor:r.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:b?0:24,paddingRight:b?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"},null!=F?F:{})},{children:[e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=D?D:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(d.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:i})),x&&e.jsx(c.Tooltip,Object.assign({body:x,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(l.default,{color:r.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},O?{justifyContent:"space-between"}:{})},{children:[$&&e.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!$&&e.jsx(A,Object.assign({style:{color:r.COLORS.content.primary}},{children:void 0===s?"--":"number"==typeof s&&v?s>999?z?`${null!=C?C:""}${g.truncateValueForInternationalStore(s)} ${null!=q?q:""}`:`${null!=C?C:""}${g.truncateValueForIndianStore(s)} ${null!=q?q:""}`:`${null!=C?C:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(s)} ${null!=q?q:""}`:`${null!=C?C:""}${s} ${null!=q?q:""}`})),"number"==typeof V&&e.jsx(o.Tag,{tagText:`${V}%`,theme:"light",type:"neutral"}),"horizontal"===h&&!$&&!O&&e.jsx(m,{timeline:p,customRange:j,percent:N,direction:_,trendRaw:L,prefixSymbol:C,trendIconStyle:M,isInternationalStore:z}),$&&!O&&"horizontal"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===h&&!$&&void 0!==I&&e.jsx(o.Tag,{tagText:`${I} %`,theme:"light",type:"neutral"}),O&&!$&&void 0!==N&&e.jsx(o.Tag,{tagText:`${N} %`,theme:"light",type:"neutral"}),O||$||!P||0==P?e.jsx(e.Fragment,{}):e.jsx(o.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(P),theme:"light",type:"neutral"})]})),"vertical"===h&&!$&&!O&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(m,{timeline:p,customRange:j,percent:N,direction:_,trendRaw:L,prefixSymbol:C,trendIconStyle:M,isInternationalStore:z})})),$&&"vertical"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),w&&!$&&e.jsx(c.Tooltip,Object.assign({body:w,placement:"right"},{children:T&&e.jsx("div",Object.assign({className:"icon--holder",onClick:R},{children:y.default.createElement(T,{height:20,width:20,color:r.COLORS.content.secondary})}))}))]}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),g=require("react/jsx-runtime"),I=require("../../../../assets/icons/ChartBar.svg.js"),C=require("../../../../assets/icons/maximize.svg.js");require("@amplitude/analytics-browser"),require("../../../../amplitude/model.js");var A=require("../../../../utils/StringUtils.js"),r=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var i=require("react");require("../../../checkBox/CheckBox.styled.js");var l=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../button/Button.js"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js");var s=require("../../../icon-button/IconButton.js");require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../curtain/CurtainHelper.js"),require("../../../variable-picker-v3/model.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../template-preview/models/Channels.js"),require("lodash");var t=require("../../../modals/styledModal.js");require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/styles/TemplateAnalyticsStyles.js"),require("../../../template-context-mapper/utils/TemplateConstants.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../../_virtual/_tslib.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.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("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../progress-bar-v2/ProgressBarV2.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("../../../datePicker/DatePickerWrapper.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("react-calendar"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../../../../utils/DateUtils.js"),require("../utils/calcPercentage.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var c=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../StackedBarChart/StackedBarDistributionChart.js"),require("../StackedBarChart/StackedBarDistributionChart.model.js");var a=require("../VerticalBarGraph/VerticalGraph.js");require("../VerticalBarGraph/FunnelVerticalBarGraph.js"),require("../heatmap/HeatMap.js"),require("../heatmap/HeatMapVertical.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/modal.js"),require("../../../modals/modal.styled.js"),require("../../../variable-picker-v3/NoResult.js"),require("../../../variable-picker-v3/styles.js"),require("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js"),require("react-slick"),require("../../../carousel-preview/CarouselPreview.style.js"),require("../../../card-selector/CardSelector.styled.js"),require("../../../action-button/ActionButton.styled.js"),require("../../../floating-input-dropdown/FloatingInputDropdown.js"),require("../../../dropdown/MultilevelDropdownPopover/index.js"),require("../../../multi-level-dropdown/MultiLevelDropdown.styled.js");var o=require("chart.js"),d=require("react-chartjs-2");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e);o.Chart.register(o.ArcElement,o.Legend);const p={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const g=e.dataset.data.reduce(((e,g)=>e+g),0),I=parseFloat((e.raw/g*100).toFixed(1));return[` ${e.label}`,` ${e.raw} (${I}% of ${g})`]}}}}},b=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],G=u.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>r.COLORS.surface.standard),";border:1px solid ",(e=>r.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnRThCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ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ICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGAgJHt0b29sdGlwSXRlbS5sYWJlbH1gLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBgICR7dG9vbHRpcEl0ZW0ucmF3fSAoJHtwZXJjZW50YWdlfSUgb2YgJHt0b3RhbH0pYCxcclxuICAgICAgICAgICAgICAgICAgICBdO1xyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgfSxcclxufTtcclxuY29uc3QgR1JBUEhfQ09MT1JTID0gW1xyXG4gICAgJyM1RTA3QkInLFxyXG4gICAgJyM5RTc3RUQnLFxyXG4gICAgJyNEMkFFRkYnLFxyXG4gICAgJyNDREUxRkYnLFxyXG4gICAgJyM5MkFGRkEnLFxyXG4gICAgJyMzOTM1RTEnLFxyXG5dO1xyXG5jb25zdCBDYXJ0U3R5bGVkID0gc3R5bGVkLmRpdiBgXG5cdGJhY2tncm91bmQ6ICR7KHByb3BzKSA9PiBDT0xPUlMuc3VyZmF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dGUoW10pO1xyXG4gICAgY29uc3QgW2JhckNoYXJ0RGF0YSwgc2V0QmFyQ2hhcnREYXRhXSA9IHVzZVN0YXRlKG51bGwpO1xyXG4gICAgdXNlRWZmZWN0KCgpID0+IHtcclxuICAgICAgICBjb25zdCB0b3RhbFN1bSA9IHNsaWNlcy5yZWR1Y2UoKHN1bSwgc2xpY2UpID0+IHN1bSArIHNsaWNlLmNvdW50LCAwKTtcclxuICAgICAgICBsZXQgdXBkYXRlZFNsaWNlc1dpdGhDb2xvciA9IFtdO1xyXG4gICAgICAgIHVwZGF0ZWRTbGljZXNXaXRoQ29sb3IgPSBPYmplY3Qua2V5cyhzbGljZXMpLm1hcCgoa2V5LCBpbmRleCkgPT4gKE9iamVjdC5hc3NpZ24oeyBjb2xvcjogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF0gfSwgc2xpY2VzW2tleV0pKSk7XHJcbiAgICAgICAgc2V0U2xpY2VzV2l0aENvbG9yKFsuLi51cGRhdGVkU2xpY2VzV2l0aENvbG9yXSk7XHJcbiAgICAgICAgaWYgKHRvdGFsU3VtID09PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0cnVuY2F0ZVNsaWNlcyAmJiBzbGljZXMubGVuZ3RoID4gdHJ1bmNhdGVTbGljZXMpIHtcclxuICAgICAgICAgICAgY29uc3QgdHJ1bmNhdGVkU2xpY2VzID0gc2xpY2VzLnNsaWNlKDAsIHRydW5jYXRlU2xpY2VzKTtcclxuICAgICAgICAgICAgY29uc3Qgb3RoZXJTbGljZXMgPSBzbGljZXMuc2xpY2UodHJ1bmNhdGVTbGljZXMpO1xyXG4gICAgICAgICAgICBjb25zdCBvdGhlckNvdW50ID0gb3RoZXJTbGljZXMucmVkdWNlKChzdW0sIHNsaWNlKSA9PiBzdW0gKyBzbGljZS5jb3VudCwgMCk7XHJcbiAgICAgICAgICAgIHRydW5jYXRlZFNsaWNlcy5wdXNoKHsgbmFtZTogJ090aGVyJywgY291bnQ6IG90aGVyQ291bnQgfSk7XHJcbiAgICAgICAgICAgIGNvbnN0IHRydW5jYXRlZERhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbHM6IHRydW5jYXRlZFNsaWNlcy5tYXAoKHNsaWNlKSA9PiBTdHJpbmdVdGlscy5jYXBpdGFsaXplKHNsaWNlLm5hbWUpKSxcclxuICAgICAgICAgICAgICAgIGRhdGFzZXRzOiBbXHJcbiAgICAgICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiB0cnVuY2F0ZWRTbGljZXMubWFwKChzbGljZSkgPT4gc2xpY2UuY291bnQpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRydW5jYXRlZFNsaWNlcy5tYXAoKHNsaWNlLCBpbmRleCkgPT4geyB2YXIgX2E7IHJldHVybiAoX2EgPSBzbGljZS5jb2xvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF07IH0pLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJDb2xvcjogWyd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZSddLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJXaWR0aDogNCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgY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B0aXRsZSA9PT0gdm9pZCAwID8gdm9pZCAwIDogdGl0bGUubGVuZ3RoKSA9PT0gMCA/ICdmbGV4LWVuZCcgOiAnc3BhY2UtYmV0d2VlbicsXHJcbiAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IFshaGlkZVRpdGxlICYmIHRpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbkJvdHRvbTogMTYsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogdGl0bGUgfSkpKSwgX2pzeHMoXCJkaXZcIiwgeyBjaGlsZHJlbjogW3Nob3dDb252ZXJ0VG9CYXJDaGFydCAmJiAoX2pzeChJY29uQnV0dG9uLCB7IEljb246IEJhckNoYXJ0SWNvbiwgb25DbGljazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTaG93QmFyQ2hhcnQodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9KSksIGFsbG93Q2hhcnRQb3B1cCAmJiAoX2pzeChJY29uQnV0dG9uLCB7IEljb246IE1heGltaXplSWNvbiwgb25DbGljazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTaG93UG9wdXAodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9KSldIH0pXSB9KSksIF9qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdyb3cnIH0sIHsgY2hpbGRyZW46IFtfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicgfSwgeyBjaGlsZHJlbjogX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogc2l6ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IF9qc3goRG91Z2hudXQsIHsgZGF0YTogKHRydW5jYXRlU2xpY2VzID8gdHJ1bmNhdGVkRGF0YSA6IGRhdGEpLCBvcHRpb25zOiBPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sIG9wdGlvbnMpLCB7IG1haW50YWluQXNwZWN0UmF0aW86IHNpemUgPyBmYWxzZSA6IHRydWUgfSkgfSkgfSkpIH0pKSwgX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnLCBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZ0xlZnQ6IDQ4LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ2NvbHVtbicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ2NlbnRlcicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogX2pzeChQaWVDaGFydCwgeyBzbGljZXM6IHRydW5jYXRlU2xpY2VzID8gdHJ1bmNhdGVkU2xpY2VzV2l0aENvbG9yIDogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpLCBzaG93UG9wdXAgJiYgKF9qc3goU3R5bGVkTW9kYWwsIE9iamVjdC5hc3NpZ24oeyBvcGVuOiBzaG93UG9wdXAsIG9uQ2xvc2U6ICgpID0+IHNldFNob3dQb3B1cChmYWxzZSksIGNsb3NlT25PdXRzaWRlQ2xpY2s6IHRydWUsIGhlYWRpbmdUaXRsZTogdGl0bGUsIHdpZHRoOiBcIjc1JVwiIH0sIHsgY2hpbGRyZW46IF9qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAyNCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ3NwYWNlLWJldHdlZW4nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6ICc4MHZoJyxcclxuICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IFtfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZTogeyB3aWR0aDogJzU1JScsIG1hcmdpbkxlZnQ6ICc0JScgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogJzEwMCUnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6ICcxMDAlJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnbkl0ZW1zOiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganVzdGlmeUNvbnRlbnQ6ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogX2pzeChEb3VnaG51dCwgeyBkYXRhOiBkYXRhLCBvcHRpb25zOiBPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sIG9wdGlvbnMpLCB7IG1ha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EuYmFyQ29sb3JSR0JBIH0pIH0pKSB9KSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>g.jsx(G,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:r,slices:o,size:n,allowChartPopup:u,showConvertToBarChart:G,truncateSlices:X,barChartXAxisTitle:y,barChartYAxisTitle:h,hideTitle:B=!1}=e;const[m,j]=i.useState(!1),[x,Z]=i.useState(!1),[R,H]=i.useState([]),[Y,J]=i.useState(),[N,S]=i.useState(),[W,F]=i.useState([]),[V,w]=i.useState(null);return i.useEffect((()=>{const e=o.reduce(((e,g)=>e+g.count),0);let g=[];if(g=Object.keys(o).map(((e,g)=>Object.assign({color:b[g%b.length]},o[e]))),H([...g]),0===e){J({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:o.map((e=>A.default.capitalize(e.name))),datasets:[{data:o.map((e=>e.count)),backgroundColor:o.map(((e,g)=>{var I;return null!==(I=e.color)&&void 0!==I?I:b[g%b.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};J(e)}if(X&&o.length>X){const e=o.slice(0,X),g=o.slice(X).reduce(((e,g)=>e+g.count),0);e.push({name:"Other",count:g});const I={labels:e.map((e=>A.default.capitalize(e.name))),datasets:[{data:e.map((e=>e.count)),backgroundColor:e.map(((e,g)=>{var I;return null!==(I=e.color)&&void 0!==I?I:b[g%b.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};S(I);const C=e.map(((e,g)=>Object.assign({color:b[g%b.length]},e)));F(C)}G&&w(((e,g,I)=>({xAxis:{data:e.map((e=>e.name)),title:null!=g?g:""},yAxis:{data:e.map((e=>e.count)),title:null!=I?I:""},barColorRGBA:{r:210,g:174,b:255,a:1}}))(o,y,h))}),[o,X]),Y?g.jsxs(g.Fragment,{children:[g.jsxs("div",Object.assign({style:{display:"flex",justifyContent:B||0===(null==r?void 0:r.length)?"flex-end":"space-between"}},{children:[!B&&r&&g.jsx(l.TitleMedium,Object.assign({style:{marginBottom:16}},{children:r})),g.jsxs("div",{children:[G&&g.jsx(s.IconButton,{Icon:I.default,onClick:()=>{Z(!0)}}),u&&g.jsx(s.IconButton,{Icon:C.default,onClick:()=>{j(!0)}})]})]})),g.jsxs("div",Object.assign({className:"row"},{children:[g.jsx("div",Object.assign({className:"col-6"},{children:g.jsx("div",Object.assign({style:{width:n,height:n}},{children:g.jsx(d.Doughnut,{data:X?N:Y,options:Object.assign(Object.assign({},p),{maintainAspectRatio:!n})})}))})),g.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:g.jsx(c.PieChart,{slices:X?W:R})}))]})),m&&g.jsx(t.StyledModal,Object.assign({open:m,onClose:()=>j(!1),closeOnOutsideClick:!0,headingTitle:r,width:"75%"},{children:g.jsxs("div",Object.assign({style:{padding:24,display:"flex",justifyContent:"space-between",height:"80vh"}},{children:[g.jsx("div",Object.assign({style:{width:"55%",marginLeft:"4%"}},{children:g.jsx("div",Object.assign({style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},{children:g.jsx(d.Doughnut,{data:Y,options:Object.assign(Object.assign({},p),{maintainAspectRatio:!n})})}))})),g.jsx("div",Object.assign({style:{width:"30%",height:"100%",overflowY:"auto"}},{children:g.jsx(c.PieChart,{slices:R})}))]}))})),x&&V&&g.jsx(t.StyledModal,Object.assign({open:x,onClose:()=>Z(!1),closeOnOutsideClick:!0,headingTitle:r,width:"85%"},{children:g.jsx("div",Object.assign({style:{padding:"24px 0"}},{children:g.jsx(a.VerticalGraph,{xAxis:V.xAxis,yAxis:V.yAxis,barColorRGBA:null==V?void 0:V.barColorRGBA})}))}))]}):g.jsx(g.Fragment,{})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),g=require("react/jsx-runtime"),I=require("../../../../assets/icons/ChartBar.svg.js"),C=require("../../../../assets/icons/maximize.svg.js");require("@amplitude/analytics-browser"),require("../../../../amplitude/model.js");var A=require("../../../../utils/StringUtils.js"),r=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var i=require("react");require("../../../checkBox/CheckBox.styled.js");var l=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../button/Button.js"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js");var s=require("../../../icon-button/IconButton.js");require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../curtain/CurtainHelper.js"),require("../../../variable-picker-v3/model.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../template-preview/models/Channels.js"),require("lodash");var t=require("../../../modals/styledModal.js");require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../../_virtual/_tslib.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.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("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../progress-bar-v2/ProgressBarV2.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("../../../datePicker/DatePickerWrapper.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("react-calendar"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../../../../utils/DateUtils.js"),require("../utils/calcPercentage.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var c=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../StackedBarChart/StackedBarDistributionChart.js"),require("../StackedBarChart/StackedBarDistributionChart.model.js");var a=require("../VerticalBarGraph/VerticalGraph.js");require("../VerticalBarGraph/FunnelVerticalBarGraph.js"),require("../heatmap/HeatMap.js"),require("../heatmap/HeatMapVertical.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/modal.js"),require("../../../modals/modal.styled.js"),require("../../../variable-picker-v3/NoResult.js"),require("../../../variable-picker-v3/styles.js"),require("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js"),require("react-slick"),require("../../../carousel-preview/CarouselPreview.style.js"),require("../../../template-preview/RCS/RCSPreview.styled.js"),require("../../../card-selector/CardSelector.styled.js"),require("../../../action-button/ActionButton.styled.js"),require("../../../floating-input-dropdown/FloatingInputDropdown.js"),require("../../../dropdown/MultilevelDropdownPopover/index.js"),require("../../../multi-level-dropdown/MultiLevelDropdown.styled.js");var o=require("chart.js"),d=require("react-chartjs-2");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e);o.Chart.register(o.ArcElement,o.Legend);const p={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const g=e.dataset.data.reduce(((e,g)=>e+g),0),I=parseFloat((e.raw/g*100).toFixed(1));return[` ${e.label}`,` ${e.raw} (${I}% of ${g})`]}}}}},b=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],G=u.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>r.COLORS.surface.standard),";border:1px solid ",(e=>r.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnRThCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgQmFyQ2hhcnRJY29uIGZyb20gJ0BzcmMvYXNzZXRzL2ljb25zL0NoYXJ0QmFyLnN2Zyc7XHJcbmltcG9ydCBNYXhpbWl6ZUljb24gZnJvbSAnQHNyYy9hc3NldHMvaWNvbnMvbWF4aW1pemUuc3ZnJztcclxuaW1wb3J0IHsgU3RyaW5nVXRpbHMgfSBmcm9tIFwiLi4vLi4vLi4vLi4vaW5kZXhcIjtcclxuaW1wb3J0IHsgQXJjRWxlbWVudCwgQ2hhcnQgYXMgQ2hhcnRKUywgTGVnZW5kIH0gZnJvbSAnY2hhcnQuanMnO1xyXG5pbXBvcnQgeyB1c2VFZmZlY3QsIHVzZVN0YXRlIH0gZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyBEb3VnaG51dCB9IGZyb20gJ3JlYWN0LWNoYXJ0anMtMic7XHJcbmltcG9ydCB7IEljb25CdXR0b24gfSBmcm9tIFwiLi4vLi4vLi4vaWNvbi1idXR0b25cIjtcclxuaW1wb3J0IHsgU3R5bGVkTW9kYWwgfSBmcm9tIFwiLi4vLi4vLi4vbW9kYWx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UF4aXMsXHJcbiAgICAgICAgYmFyQ29sb3JSR0JBOiB7IHI6IDIxMCwgZzogMTc0LCBiOiAyNTUsIGE6IDEgfSxcclxuICAgIH07XHJcbiAgICByZXR1cm4gYmFyQ2hhcnREYXRhO1xyXG59O1xyXG5jb25zdCBvcHRpb25zID0ge1xyXG4gICAgcGx1Z2luczoge1xyXG4gICAgICAgIGxlZ2VuZDoge1xyXG4gICAgICAgICAgICBkaXNwbGF5OiBmYWxzZSxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHRvb2x0aXA6IHtcclxuICAgICAgICAgICAgZW5hYmxlZDogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGAgJHt0b29sdGlwSXRlbS5sYWJlbH1gLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBgICR7dG9vbHRpcEl0ZW0ucmF3fSAoJHtwZXJjZW50YWdlfSUgb2YgJHt0b3RhbH0pYCxcclxuICAgICAgICAgICAgICAgICAgICBdO1xyXG4gICAgICAgICAgICAgICA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AgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0cnVuY2F0ZVNsaWNlcyAmJiBzbGljZXMubGVuZ3RoID4gdHJ1bmNhdGVTbGljZXMpIHtcclxuICAgICAgICAgICAgY29uc3QgdHJ1bmNhdGVkU2xpY2VzID0gc2xpY2VzLnNsaWNlKDAsIHRydW5jYXRlU2xpY2VzKTtcclxuICAgICAgICAgICAgY29uc3Qgb3RoZXJTbGljZXMgPSBzbGljZXMuc2xpY2UodHJ1bmNhdGVTbGljZXMpO1xyXG4gICAgICAgICAgICBjb25zdCBvdGhlckNvdW50ID0gb3RoZXJTbGljZXMucmVkdWNlKChzdW0sIHNsaWNlKSA9PiBzdW0gKyBzbGljZS5jb3VudCwgMCk7XHJcbiAgICAgICAgICAgIHRydW5jYXRlZFNsaWNlcy5wdXNoKHsgbmFtZTogJ090aGVyJywgY291bnQ6IG90aGVyQ291bnQgfSk7XHJcbiAgICAgICAgICAgIGNvbnN0IHRydW5jYXRlZERhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbHM6IHRydW5jYXRlZFNsaWNlcy5tYXAoKHNsaWNlKSA9PiBTdHJpbmdVdGlscy5jYXBpdGFsaXplKHNsaWNlLm5hbWUpKSxcclxuICAgICAgICAgICAgICAgIGRhdGFzZXRzOiBbXHJcbiAgICAgICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiB0cnVuY2F0ZWRTbGljZXMubWFwKChzbGljZSkgPT4gc2xpY2UuY291bnQpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRydW5jYXRlZFNsaWNlcy5tYXAoKHNsaWNlLCBpbmRleCkgPT4geyB2YXIgX2E7IHJldHVybiAoX2EgPSBzbGljZS5jb2xvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF07IH0pLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJDb2xvcjogWyd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZSddLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJXaWR0aDogNCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyUmFkaXVzOiA4LFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXRUcnVuY2F0ZWREYXRhKHRydW5jYXRlZERhdGFTZXQpO1xyXG4gICAgICAgICAgICBjb25zdCB0cnVuY2F0ZWRTbGljZXNXaXRoQ29sb3IgPSB0cnVuY2F0ZWRTbGljZXMubWFwKChzbGljZSwgaW5kZXgpID0+IChPYmplY3QuYXNzaWduKHsgY29sb3I6IEdSQVBIX0NPTE9SU1tpbmRleCAlIEdSQVBIX0NPTE9SUy5sZW5ndGhdIH0sIHNsaWNlKSkpO1xyXG4gICAgICAgICAgICBzZXRUcnVuY2F0ZWRTbGljZXNXaXRoQ29sb3IodHJ1bmNhdGVkU2xpY2VzV2l0aENvbG9yKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHNob3dDb252ZXJ0VG9CYXJDaGFydCkge1xyXG4gICAgICAgICAgICBzZXRCYXJDaGFydERhdGEoY29udmVydFRvQmFyQ2hhcnREYXRhKHNsaWNlcywgYmFyQ2hhcnRYQXhpc1RpdGxlLCBiYXJDaGFydFlBeGlzVGl0bGUpKTtcclxuICAgICAgICB9XHJcbiAgICB9LCBbc2xpY2VzLCB0cnVuY2F0ZVNsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW19qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6ICdmbGV4JyxcclxuICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogaGlkZVRpdGxlIHx8ICh0aXRsZSA9PT0gbnVsbCB8fCB0aXRsZSA9PT0gdm9pZCAwID8gdm9pZCAwIDogdGl0bGUubGVuZ3RoKSA9PT0gMCA/ICdmbGV4LWVuZCcgOiAnc3BhY2UtYmV0d2VlbicsXHJcbiAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IFshaGlkZVRpdGxlICYmIHRpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbkJvdHRvbTogMTYsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogdGl0bGUgfSkpKSwgX2pzeHMoXCJkaXZcIiwgeyBjaGlsZHJlbjogW3Nob3dDb252ZXJ0VG9CYXJDaGFydCAmJiAoX2pzeChJY29uQnV0dG9uLCB7IEljb246IEJhckNoYXJ0SWNvbiwgb25DbGljazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTaG93QmFyQ2hhcnQodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9KSksIGFsbG93Q2hhcnRQb3B1cCAmJiAoX2pzeChJY29uQnV0dG9uLCB7IEljb246IE1heGltaXplSWNvbiwgb25DbGljazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTaG93UG9wdXAodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9KSldIH0pXSB9KSksIF9qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdyb3cnIH0sIHsgY2hpbGRyZW46IFtfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicgfSwgeyBjaGlsZHJlbjogX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogc2l6ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IF9qc3goRG91Z2hudXQsIHsgZGF0YTogKHRydW5jYXRlU2xpY2VzID8gdHJ1bmNhdGVkRGF0YSA6IGRhdGEpLCBvcHRpb25zOiBPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sIG9wdGlvbnMpLCB7IG1haW50YWluQXNwZWN0UmF0aW86IHNpemUgPyBmYWxzZSA6IHRydWUgfSkgfSkgfSkpIH0pKSwgX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnLCBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZ0xlZnQ6IDQ4LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ2NvbHVtbicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ2NlbnRlcicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogX2pzeChQaWVDaGFydCwgeyBzbGljZXM6IHRydW5jYXRlU2xpY2VzID8gdHJ1bmNhdGVkU2xpY2VzV2l0aENvbG9yIDogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpLCBzaG93UG9wdXAgJiYgKF9qc3goU3R5bGVkTW9kYWwsIE9iamVjdC5hc3NpZ24oeyBvcGVuOiBzaG93UG9wdXAsIG9uQ2xvc2U6ICgpID0+IHNldFNob3dQb3B1cChmYWxzZSksIGNsb3NlT25PdXRzaWRlQ2xpY2s6IHRydWUsIGhlYWRpbmdUaXRsZTogdGl0bGUsIHdpZHRoOiBcIjc1JVwiIH0sIHsgY2hpbGRyZW46IF9qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAyNCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ3NwYWNlLWJldHdlZW4nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6ICc4MHZoJyxcclxuICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IFtfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZTogeyB3aWR0aDogJzU1JScsIG1hcmdpbkxlZnQ6ICc0JScgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogJzEwMCUnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6ICcxMDAlJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnbkl0ZW1zOiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganVzdGlmeUNvbnRlbnQ6ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogX2pzeChEb3VnaG51dCwgeyBkYXRhOiBkYXRhLCBvcHRpb25zOiBPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sIG9wdGlvbnMpLCB7IG1haW50YWluQXNwZWN0UmF0aW86IHNpemUgPyBmYWxzZSA6IHRydWUgfSkgfSkgfSkpIH0pKSwgX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogJzMwJScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAnMTAwJScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3dZOiAnYXV0bycsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IF9qc3goUGllQ2hhcnQsIHsgc2xpY2VzOiBzbGljZXNXaXRoQ29sb3IgfSkgfSkpXSB9KSkgfSkpKSwgc2hvd0JhckNoYXJ0ICYmIGJhckNoYXJ0RGF0YSAmJiAoX2pzeChTdHlsZWRNb2RhbCwgT2JqZWN0LmFzc2lnbih7IG9wZW46IHNob3dCYXJDaGFydCwgb25DbG9zZTogKCkgPT4gc2V0U2hvd0JhckNoYXJ0KGZhbHNlKSwgY2xvc2VPbk91dHNpZGVDbGljazogdHJ1ZSwgaGVhZGluZ1RpdGxlOiB0aXRsZSwgd2lkdGg6IFwiODUlXCIgfSwgeyBjaGlsZHJlbjogX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogJzI0cHggMCcsXHJcbiAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFZlcnRpY2FsR3JhcGgsIHsgeEF4aXM6IGJhckNoYXJ0RGF0YS54QXhpcywgeUF4aXM6IGJhckNoYXJ0RGF0YS55QXhpcywgYmFyQ29sb3JSR0JBOiBiYXJDaGFydERhdGEgPT09IG51bGwgfHwgYmFyQ2hhcnREYXRhID09PSB2b2lkIDAgPyB2b2lkIDAgOiBiYXJDaGFydERhdGEuYmFyQ29sb3JSR0JBIH0pIH0pKSB9KSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>g.jsx(G,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:r,slices:o,size:n,allowChartPopup:u,showConvertToBarChart:G,truncateSlices:X,barChartXAxisTitle:y,barChartYAxisTitle:h,hideTitle:B=!1}=e;const[m,j]=i.useState(!1),[x,R]=i.useState(!1),[Z,H]=i.useState([]),[Y,J]=i.useState(),[N,S]=i.useState(),[W,F]=i.useState([]),[V,w]=i.useState(null);return i.useEffect((()=>{const e=o.reduce(((e,g)=>e+g.count),0);let g=[];if(g=Object.keys(o).map(((e,g)=>Object.assign({color:b[g%b.length]},o[e]))),H([...g]),0===e){J({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:o.map((e=>A.default.capitalize(e.name))),datasets:[{data:o.map((e=>e.count)),backgroundColor:o.map(((e,g)=>{var I;return null!==(I=e.color)&&void 0!==I?I:b[g%b.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};J(e)}if(X&&o.length>X){const e=o.slice(0,X),g=o.slice(X).reduce(((e,g)=>e+g.count),0);e.push({name:"Other",count:g});const I={labels:e.map((e=>A.default.capitalize(e.name))),datasets:[{data:e.map((e=>e.count)),backgroundColor:e.map(((e,g)=>{var I;return null!==(I=e.color)&&void 0!==I?I:b[g%b.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};S(I);const C=e.map(((e,g)=>Object.assign({color:b[g%b.length]},e)));F(C)}G&&w(((e,g,I)=>({xAxis:{data:e.map((e=>e.name)),title:null!=g?g:""},yAxis:{data:e.map((e=>e.count)),title:null!=I?I:""},barColorRGBA:{r:210,g:174,b:255,a:1}}))(o,y,h))}),[o,X]),Y?g.jsxs(g.Fragment,{children:[g.jsxs("div",Object.assign({style:{display:"flex",justifyContent:B||0===(null==r?void 0:r.length)?"flex-end":"space-between"}},{children:[!B&&r&&g.jsx(l.TitleMedium,Object.assign({style:{marginBottom:16}},{children:r})),g.jsxs("div",{children:[G&&g.jsx(s.IconButton,{Icon:I.default,onClick:()=>{R(!0)}}),u&&g.jsx(s.IconButton,{Icon:C.default,onClick:()=>{j(!0)}})]})]})),g.jsxs("div",Object.assign({className:"row"},{children:[g.jsx("div",Object.assign({className:"col-6"},{children:g.jsx("div",Object.assign({style:{width:n,height:n}},{children:g.jsx(d.Doughnut,{data:X?N:Y,options:Object.assign(Object.assign({},p),{maintainAspectRatio:!n})})}))})),g.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:g.jsx(c.PieChart,{slices:X?W:Z})}))]})),m&&g.jsx(t.StyledModal,Object.assign({open:m,onClose:()=>j(!1),closeOnOutsideClick:!0,headingTitle:r,width:"75%"},{children:g.jsxs("div",Object.assign({style:{padding:24,display:"flex",justifyContent:"space-between",height:"80vh"}},{children:[g.jsx("div",Object.assign({style:{width:"55%",marginLeft:"4%"}},{children:g.jsx("div",Object.assign({style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},{children:g.jsx(d.Doughnut,{data:Y,options:Object.assign(Object.assign({},p),{maintainAspectRatio:!n})})}))})),g.jsx("div",Object.assign({style:{width:"30%",height:"100%",overflowY:"auto"}},{children:g.jsx(c.PieChart,{slices:Z})}))]}))})),x&&V&&g.jsx(t.StyledModal,Object.assign({open:x,onClose:()=>R(!1),closeOnOutsideClick:!0,headingTitle:r,width:"85%"},{children:g.jsx("div",Object.assign({style:{padding:"24px 0"}},{children:g.jsx(a.VerticalGraph,{xAxis:V.xAxis,yAxis:V.yAxis,barColorRGBA:null==V?void 0:V.barColorRGBA})}))}))]}):g.jsx(g.Fragment,{})};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),o=require("react-slick"),t=require("./CarouselPreview.style.js"),l=require("./CarouselPreviewCard.js"),n=require("../template-context-mapper/context/templateModalContext.js"),s=require("./CustomCarouselArrows.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(r),d=i(o);const u=a.default.forwardRef((r=>{let{channel:o,template:i,isPreview:a,removeBottomBorder:u,borderRadius:c,showArrows:v,hideBorder:p}=r;var m,C,w;const x=null===(m=null==i?void 0:i.components)||void 0===m?void 0:m[1].cards,{sliderRef:j,selectedCarouselIndex:f,cardCount:h,setIsCarouselHovered:g}=n.useTemplateModalContext();return e.jsxs(t.Container,Object.assign({removeBottomBorder:u,borderRadius:c,hideBorder:p},{children:[e.jsx(l.default,{channel:o,currentTemplate:i,carouselCardIndex:-1,isPreview:a,width:"77%"}),!!(null==x?void 0:x.length)&&e.jsx(t.CarouselSlickContainer,Object.assign({cardCount:null!=h?h:0,selectedCarouselIndex:null!=f?f:-1,onMouseEnter:()=>null==g?void 0:g(!0),onMouseLeave:()=>null==g?void 0:g(!1)},{children:e.jsx(d.default,Object.assign({ref:j,swipeToSlide:!0,draggable:!0,swipe:!0,infinite:!1,focusOnSelect:!a,centerMode:!0,arrows:v,adaptiveHeight:!0,nextArrow:e.jsx(s.CustomCarouselRightArrow,{isPreview:null!=a&&a}),prevArrow:e.jsx(s.CustomCarouselLeftArrow,{isPreview:null!=a&&a})},{children:null===(w=null===(C=null==i?void 0:i.components)||void 0===C?void 0:C[1].cards)||void 0===w?void 0:w.map(((r,t)=>{var n,s;const d={components:r.components,mapping:null===(s=null===(n=null==i?void 0:i.mapping)||void 0===n?void 0:n.cards)||void 0===s?void 0:s[t]};return e.jsx(l.default,{channel:o,currentTemplate:d,carouselCardIndex:t,isPreview:a,width:"100%"},t)}))}))}))]}))}));exports.CarouselPreview=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),s=require("react-slick"),t=require("./CarouselPreview.style.js"),o=require("./CarouselPreviewCard.js"),l=require("../template-context-mapper/context/templateModalContext.js"),n=require("../template-preview/RCS/RCSPreview.styled.js"),a=require("./CustomCarouselArrows.js"),i=require("../template-preview/helpers/templateMiscHelper.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(r),c=d(s);const v=u.default.forwardRef((r=>{let{channel:s,template:a,isPreview:d,removeBottomBorder:u,borderRadius:c,showArrows:v,hideBorder:p}=r;var w;const{sliderRef:m,selectedCarouselIndex:x,cardCount:j,setIsCarouselHovered:h,cardIndex:f}=l.useTemplateModalContext(),P=-1==f?i.determineCardIndex(s):f,R=null===(w=null==a?void 0:a.components)||void 0===w?void 0:w[P].cards,g=(null==R?void 0:R.length)?e.jsx(C,{cards:R,cardCount:null!=j?j:0,selectedCarouselIndex:null!=x?x:-1,sliderRef:m,isPreview:d,showArrows:v,channel:s,template:a,setIsCarouselHovered:h}):null;return i.isRCSChannel(s)?e.jsx(n.RCSCarousalContainer,Object.assign({borderRadius:c},{children:g})):e.jsxs(t.Container,Object.assign({removeBottomBorder:u,borderRadius:c,hideBorder:p},{children:[e.jsx(o.default,{channel:s,currentTemplate:a,carouselCardIndex:-1,isPreview:d,width:"77%"}),g]}))})),C=r=>{let{cards:s,cardCount:l,selectedCarouselIndex:n,sliderRef:i,isPreview:d,showArrows:u,channel:v,template:C,setIsCarouselHovered:p}=r;return e.jsx(t.CarouselSlickContainer,Object.assign({cardCount:l,selectedCarouselIndex:n,onMouseEnter:()=>null==p?void 0:p(!0),onMouseLeave:()=>null==p?void 0:p(!1)},{children:e.jsx(c.default,Object.assign({ref:i,swipeToSlide:!0,draggable:!0,swipe:!0,infinite:!1,focusOnSelect:!d,centerMode:!0,arrows:u,adaptiveHeight:!0,nextArrow:e.jsx(a.CustomCarouselRightArrow,{isPreview:null!=d&&d}),prevArrow:e.jsx(a.CustomCarouselLeftArrow,{isPreview:null!=d&&d})},{children:null==s?void 0:s.map(((r,s)=>{var t,l;const n={components:r.components,mapping:null===(l=null===(t=null==C?void 0:C.mapping)||void 0===t?void 0:t.cards)||void 0===l?void 0:l[s]};return e.jsx(o.default,{channel:v,currentTemplate:n,carouselCardIndex:s,isPreview:d,width:"100%"},s)}))}))}))};exports.CarouselPreview=v;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../template-context-mapper/context/templateModalContext.js"),a=require("../template-preview/TemplatePreview.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../constants/Theme.js"),require("../curtain/CurtainHelper.js"),require("../variable-picker-v3/model.js"),require("../template-preview/models/TemplateMeta.js"),require("../template-preview/models/WhatsAppTemplate.js"),require("../template-preview/models/Channels.js");const l=i(t).default.forwardRef((t=>{let{channel:i,currentTemplate:l,showSampleValues:s,carouselCardIndex:p,isPreview:n,width:u}=t;var o,d,m;const{cardWidth:c,template:h}=r.useTemplateModalContext(),v=(null!==(m=null===(d=null===(o=null==h?void 0:h.components)||void 0===o?void 0:o[1].cards)||void 0===d?void 0:d.length)&&void 0!==m?m:0)-1===p?12:0;return e.jsx("div",Object.assign({style:{width:u||c,height:(null!=p?p:-1)>-1?"100%":"auto"}},{children:e.jsx(a.TemplatePreview,{showSampleValues:s,template:l,channel:i,size:"small",hideHeader:!0,carouselCardIndex:p,isWhatsappCarousel:!0,isPreview:n,whatsAppSpecificMeta:{templateContainerStyles:{marginRight:v,height:"100%"}}})}))}));exports.default=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../template-context-mapper/context/templateModalContext.js"),a=require("../template-preview/TemplatePreview.js");require("../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../constants/Theme.js"),require("../curtain/CurtainHelper.js"),require("../variable-picker-v3/model.js"),require("../template-preview/models/TemplateMeta.js"),require("../template-preview/models/WhatsAppTemplate.js"),require("../template-preview/models/Channels.js");var i=require("../template-preview/helpers/templateMiscHelper.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const s=l(t).default.forwardRef((t=>{let{channel:l,currentTemplate:s,showSampleValues:p,carouselCardIndex:n,isPreview:u,width:d}=t;var o,m,c;const{cardWidth:v,template:h,cardIndex:w}=r.useTemplateModalContext(),j=-1==w?i.determineCardIndex(l):w,q=(null!==(c=null===(m=null===(o=null==h?void 0:h.components)||void 0===o?void 0:o[j].cards)||void 0===m?void 0:m.length)&&void 0!==c?c:0)-1===n?12:0;return e.jsx("div",Object.assign({style:{width:d||v,height:(null!=n?n:-1)>-1?"100%":"auto"}},{children:e.jsx(a.TemplatePreview,{showSampleValues:p,template:s,channel:l,size:"small",hideHeader:!0,carouselCardIndex:n,isWhatsappCarousel:!0,isPreview:u,whatsAppSpecificMeta:{templateContainerStyles:{marginRight:q,height:"100%"}}})}))}));exports.default=s;
@@ -4,6 +4,5 @@ export type MenuItemDropdownProps = OpenDropdownProps & {
4
4
  isHorizontal: boolean;
5
5
  children?: React.ReactNode;
6
6
  hideBorder?: boolean;
7
- isNewTag?: boolean;
8
7
  };
9
8
  export declare const MenuItemDropdown: React.FC<MenuItemDropdownProps>;
@@ -1,20 +1,5 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../assets/icons/horizontal_dots.svg.js"),o=require("../../../assets/icons/vertical_dots.svg.js"),t=require("styled-components"),n=require("../DropdownPopover/index.js");require("../Dropdown.js"),require("../ChipDropdown.js"),require("react"),require("../../zeroState/ZeroState.js"),require("../../TypographyStyle.js");var s=require("../../../constants/Theme.js");require("../OpenedDropdown/components/description/Description.styled.js"),require("../../checkBox/CheckBox.styled.js"),require("../../list-item/ListItem.js"),require("../OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../OpenedDropdown/components/menu/MenuItem.js"),require("../OpenedDropdown/components/menu/MenuList.styled.js"),require("../../button/Button.js"),require("../OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../OpenedDropdown/components/OpennedDropdown.styled.js");var i=require("../../icon-button/IconButton.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../input/Input.js");const u=d(t).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../assets/icons/horizontal_dots.svg.js"),o=require("../../../assets/icons/vertical_dots.svg.js"),n=require("styled-components"),t=require("../DropdownPopover/index.js");require("../Dropdown.js"),require("../ChipDropdown.js"),require("react"),require("../../zeroState/ZeroState.js"),require("../../TypographyStyle.js");var s=require("../../../constants/Theme.js");require("../OpenedDropdown/components/description/Description.styled.js"),require("../../checkBox/CheckBox.styled.js"),require("../../list-item/ListItem.js"),require("../OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../OpenedDropdown/components/menu/MenuItem.js"),require("../OpenedDropdown/components/menu/MenuList.styled.js"),require("../../button/Button.js"),require("../OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../OpenedDropdown/components/OpennedDropdown.styled.js");var i=require("../../icon-button/IconButton.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../input/Input.js");const d=u(n).default.div`
2
2
  :hover {
3
3
  background: ${s.COLORS.surface.subdued};
4
4
  }
5
- position: ${e=>e.isNewTag?"relative":""};
6
- .new--tag {
7
- box-sizing: border-box;
8
- position: absolute;
9
- right: -8px;
10
- top: -5px;
11
- border-radius: 50%;
12
- width: 14px;
13
- height: 14px;
14
- background: ${s.COLORS.background.negative.vibrant};
15
- border: 1.25px solid ${s.COLORS.surface.standard};
16
- display: flex;
17
- justify-content: center;
18
- align-items: center;
19
- }
20
- `,p=t=>e.jsx(u,Object.assign({isNewTag:t.isNewTag},{children:e.jsxs(n.DropdownPopover,Object.assign({},t,{children:[e.jsx("div",{children:e.jsx(i.IconButton,{Icon:t.isHorizontal?r.default:o.default,bordered:!(null==t?void 0:t.hideBorder)})}),t.isNewTag?e.jsx("div",{className:"new--tag"}):null]}))}));p.displayName="MenuItemDropdown",exports.MenuItemDropdown=p;
5
+ `,p=n=>e.jsx(d,{children:e.jsx(t.DropdownPopover,Object.assign({},n,{children:e.jsx("div",{children:e.jsx(i.IconButton,{Icon:n.isHorizontal?r.default:o.default,bordered:!(null==n?void 0:n.hideBorder)})})}))});p.displayName="MenuItemDropdown",exports.MenuItemDropdown=p;
@@ -7,6 +7,7 @@ export type ShimmerImageProps = {
7
7
  borderRadius?: number;
8
8
  defaultImageUrl?: string;
9
9
  useDynamicInfoImageSize?: boolean;
10
+ imagePreviewStyles?: React.CSSProperties;
10
11
  };
11
12
  export declare const DEFAULT_IMAGE = "https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c";
12
13
  export declare const ShimmerImage: React.FC<ShimmerImageProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../shimmer/ShimmerComponent/BikShimmer.js");const r="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c";exports.DEFAULT_IMAGE=r,exports.ShimmerImage=s=>{let{imageUrl:a,width:o,height:l,borderRadius:n,alt:c,useDynamicInfoImageSize:d,defaultImageUrl:m=r}=s;const[u,h]=t.useState(!0),[g,b]=t.useState(!1);return t.useEffect((()=>{const e=new Image;return e.src=a,e.onload=()=>{b(!1),h(!1)},e.onerror=()=>{b(!0),h(!1)},()=>{e.onload=null,e.onerror=null}}),[a]),e.jsxs("div",Object.assign({style:Object.assign(Object.assign({position:"relative",width:d?`min(100%, ${o}px)`:o},d?{aspectRatio:1}:{height:l}),{borderRadius:n})},{children:[u&&e.jsx(i.BikShimmer,{boxes:[{height:`${l}px`,width:`${o}px`,marginTop:"0px"}]}),g?e.jsx("img",{src:m,alt:null!=c?c:"Image",style:{borderRadius:null!=n?n:0,display:"block",width:"100%",height:"100%",objectFit:"cover"}}):e.jsx("img",{src:a,alt:null!=c?c:"Image",style:{borderRadius:null!=n?n:0,display:u?"none":"block",width:"100%",height:"100%",objectFit:"cover"}})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../shimmer/ShimmerComponent/BikShimmer.js");const r="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c";exports.DEFAULT_IMAGE=r,exports.ShimmerImage=s=>{let{imageUrl:a,width:o,height:l,borderRadius:n,alt:c,useDynamicInfoImageSize:m,defaultImageUrl:d=r,imagePreviewStyles:u}=s;const[g,h]=t.useState(!0),[b,p]=t.useState(!1);return t.useEffect((()=>{const e=new Image;return e.src=a,e.onload=()=>{p(!1),h(!1)},e.onerror=()=>{p(!0),h(!1)},()=>{e.onload=null,e.onerror=null}}),[a]),e.jsxs("div",Object.assign({style:Object.assign(Object.assign({position:"relative",width:m?`min(100%, ${o}px)`:o},m?{aspectRatio:1}:{height:l}),{borderRadius:n})},{children:[g&&e.jsx(i.BikShimmer,{boxes:[{height:`${l}px`,width:`${o}px`,marginTop:"0px"}]}),b?e.jsx("img",{src:d,alt:null!=c?c:"Image",style:{borderRadius:null!=n?n:0,display:"block",width:"100%",height:"100%",objectFit:"cover"}}):e.jsx("img",{src:a,alt:null!=c?c:"Image",style:Object.assign({borderRadius:null!=n?n:0,display:g?"none":"block",width:"100%",height:"100%",objectFit:"cover"},u)})]}))};
@@ -5,7 +5,7 @@ import { CHANNEL_TYPE } from '../template-preview/models/Channels';
5
5
  import { CUSTOM_VARIABLE, GlobalPlaceholderType } from '../template-preview/models/TemplateMeta';
6
6
  import { AllTemplateTypes, AllTemplateVariables, NonNullTemplateTypes } from '../template-preview/models/types';
7
7
  import { WebpushTemplateVariables } from '../template-preview/models/WebpushTemplate';
8
- import { ExtrasWhatsapp, POD, TemplateAnalyticsI, WhatsAppPickerMeta, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
8
+ import { ExtrasWhatsapp, POD, TEMPLATE_QUALITY, WhatsAppPickerMeta, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
9
9
  import { VariableV3 } from '../variable-picker-v3/model';
10
10
  export interface TemplateContextMapperProps {
11
11
  selectedTemplate: NonNullTemplateTypes;
@@ -62,6 +62,6 @@ export interface TemplateContextMapperProps {
62
62
  showDiscountCodeExpiryInfo?: boolean;
63
63
  footerButtonText?: string;
64
64
  footerInfoText?: string;
65
- templateAnalytics?: TemplateAnalyticsI;
65
+ templateQuality?: TEMPLATE_QUALITY;
66
66
  }
67
67
  export declare const TemplateContextMapper: (props: TemplateContextMapperProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),o=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),i=require("../modals/styledModal.js"),r=require("../template-preview/models/Channels.js"),s=require("../template-preview/models/WhatsAppTemplate.js"),n=require("./context/templateModalContext.js"),d=require("./modalElements/Footer.js"),u=require("./modalElements/TemplateAnalyticsComponent.js"),c=require("./modalElements/TemplateSelectModalContent.js"),p=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=v=>{var m,C,h,b,S,E,f,x,P,T;const{selectedTemplate:g,closeDialog:y,showVariableMapping:I,channel:L,htmlContent:A,templateVariables:D,onTemplateSelect:j,globalPlaceholders:w,showOnlyContent:k,whatsappSpecificPickerMeta:H,zIndex:N,showVariableModal:V,variableList:M,discountCode:O,setDiscountCode:B,onBackPress:q,enabledCustomText:F,variableListForImage:_,showSampleValues:W,disableEditVariable:Y,pod:R,extras:$,pickerConf:z,selectedCarouselProducts:U,disableEditExpiry:G,cardWidth:J,onDeleteSelectedProducts:K,fileName:Q,setFileName:X,hideDeviceContainerInPreview:Z,maxCharLimit:ee,onDefaultVariableSelect:te,skipDefaultVariableContent:le,disableDatePicker:oe,disableCopyCode:ae,initialExpiryDateTime:ie,showDiscountCodeExpiryInfo:re,footerButtonText:se,footerInfoText:ne,templateAnalytics:de}=v;l.useEffect((()=>{be(A)}),[A]);const ue=L===r.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(C=null===(m=null==g?void 0:g.components)||void 0===m?void 0:m[1])||void 0===C?void 0:C.type),ce=null==g?void 0:g.isProductCarouselType,[pe,ve]=l.useState(L===r.CHANNEL_TYPE.EMAIL||L==r.CHANNEL_TYPE.WEBPUSH||ue?"desktop":"mobile"),[me,Ce]=l.useState(!1),[he,be]=l.useState(A),[Se,Ee]=l.useState(!1),[fe,xe]=l.useState([]),[Pe,Te]=l.useState({}),[ge,ye]=l.useState(g),[Ie,Le]=l.useState([]),[Ae,De]=l.useState(null),[je,we]=l.useState(!1),[ke,He]=l.useState(null!=D?D:[]),[Ne,Ve]=l.useState(!1),[Me,Oe]=l.useState(ue?(null===(b=null===(h=null==ge?void 0:ge.mapping)||void 0===h?void 0:h.body)||void 0===b?void 0:b.length)?-1:0:-1),[Be,qe]=l.useState([]),[Fe,_e]=l.useState(void 0),We=l.useRef(null),[Ye,Re]=l.useState(!1),[$e,ze]=l.useState(!1),[Ue,Ge]=l.useState(!1),[Je,Ke]=l.useState(!0),[Qe,Xe]=l.useState(!0),[Ze,et]=l.useState({});l.useEffect((()=>{U?qe(U):ce&&qe([])}),[U]),l.useEffect((()=>{var e;if(!je&&ce&&(!U||0===qe.length)){const t=null===(e=null==ge?void 0:ge.components)||void 0===e?void 0:e[1].cards,l=[];null==t||t.forEach((e=>{var t;null===(t=null==e?void 0:e.components)||void 0===t||t.forEach((e=>{var t,o,a;"HEADER"===e.type&&l.push(null!==(a=null===(o=null===(t=e.example)||void 0===t?void 0:t.header_handle)||void 0===o?void 0:o[0])&&void 0!==a?a:"")}))})),Le(l),we(!0)}}),[je]);const tt=l.useMemo((()=>p.convertPlaceholdersToBikDropdown(w)),[w]);return l.useEffect((()=>{_e(t.cloneDeep(M))}),[M]),(null==de?void 0:de.show)&&Je?e.jsx(u.TemplateAnalyticsComponent,{headingTitle:null==ge?void 0:ge.label,headingSubtitle:L===r.CHANNEL_TYPE.WHATSAPP?`${o.default.capitaliseFirstLetterOfString(null!==(S=null==ge?void 0:ge.category)&&void 0!==S?S:"")} • ${null!==(E=null==ge?void 0:ge.templateCategory)&&void 0!==E?E:""}`:"",templateAnalytics:de,onClose:()=>{null==y||y(),Ke(!1),Xe(!1)},onCancel:()=>{Ke(!1),Xe(!1)},onProceed:()=>{Ke(!1),Xe(!0)},templateId:(null==ge?void 0:ge.templateId)||""}):e.jsx(n.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:Ue,setHideFooterButton:Ge,hideCrossButton:$e,setHideCrossButton:ze,variableList:Fe,setVariableList:_e,variableCallback:Ae,setVariableCallback:De,showVariablePicker:me,setShowVariablePicker:Ce,template:ge,setTemplate:ye,device:pe,setDevice:ve,display_content:he,setDisplayContent:be,originalVariableList:ke,setOriginalVariableList:He,isError:Se,setIsError:Ee,channel:L,globalNormalizedPlaceholders:tt,templateSelectionTriggered:Ne,setTemplateSelectionTriggered:Ve,enabledCustomText:F,disableEditVariable:Y,pod:R,extras:$,isWhatsappCarousel:ue,selectedCarouselIndex:Me,setSelectedCarouselIndex:Oe,isProductCarouselType:ce,templateErrorIndexes:Pe,cardCount:ue?null===(x=null===(f=g.components)||void 0===f?void 0:f[1].cards)||void 0===x?void 0:x.length:void 0,errorIndexes:fe,setErrorIndexes:xe,pickerConf:z,carouselProducts:Be,setCarouselProducts:qe,disableEditExpiry:G,cardWidth:J,cardImages:Ie,onDeleteSelectedProducts:K,hideDeviceContainerInPreview:Z,sliderRef:We,isCarouselHovered:Ye,setIsCarouselHovered:Re,maxCharLimit:ee,ctaOptionsErrors:Ze,setCtaOptionsErrors:et,onDefaultVariableSelect:te,disableDatePicker:oe,disableCopyCode:ae,initialExpiryDateTime:ie,showDiscountCodeExpiryInfo:re}},{children:k?e.jsx(c.default,{variableListFromProps:M,channel:r.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(i.StyledModal,Object.assign({hideCrossButton:$e,zIndex:N,centralContainerStyles:{width:ue?900:L===r.CHANNEL_TYPE.EMAIL&&I?1e3:800},open:Qe,onClose:()=>{Xe(!1),null==y||y()},headingTitle:null==ge?void 0:ge.label,headingSubtitle:L===r.CHANNEL_TYPE.WHATSAPP?`${o.default.capitaliseFirstLetterOfString(null!==(P=null==ge?void 0:ge.category)&&void 0!==P?P:"")} • ${null!==(T=null==ge?void 0:ge.templateCategory)&&void 0!==T?T:""}`:"",onBackPress:()=>{if(null==de?void 0:de.show)return Ke(!0),void Xe(!1);null==q||q()},modalHeaderStyles:{borderBottom:`1px solid ${a.COLORS.stroke.primary}`}},{children:[e.jsx(c.default,{variableListFromProps:M,showSampleValues:W,showVariableMapping:I,channel:L,whatsappSpecificPickerMeta:H,showVariableModal:V,discountCode:O,setDiscountCode:B,variableListForImage:_&&(null==_?void 0:_.length)>0?_:Fe,fileName:Q,setFileName:e=>{null==X||X(e)},skipDefaultVariableContent:le}),j?e.jsx(d.default,{isWhatsappCarousel:null!=ue&&ue,onSelect:function(){var e;if((null==Be?void 0:Be.length)<1&&ce)return void Ee(!0);if(Object.keys(Ze).length>0&&R!==s.POD.CHATBOT)return void Ee(!0);const t=null==j?void 0:j(ge,ke,null!=he?he:"",Be);Te(null!==(e=null==t?void 0:t.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==t?void 0:t.errorIndexes)||(null==t?void 0:t.error)?((null==t?void 0:t.errorIndexes)&&xe(t.errorIndexes),(null==t?void 0:t.error)&&Ee(!!(null==t?void 0:t.error))):Ve(!0)},footerButtonText:se,footerInfoText:ne}):e.jsx(e.Fragment,{})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),a=require("../../utils/StringUtils.js"),o=require("../../constants/Theme.js"),i=require("../modals/styledModal.js"),r=require("../template-preview/helpers/templateMiscHelper.js"),s=require("../template-preview/models/Channels.js"),n=require("../template-preview/models/WhatsAppTemplate.js"),d=require("./context/templateModalContext.js"),u=require("./modalElements/Footer.js"),c=require("./modalElements/QualityWarningModal.js"),p=require("./modalElements/TemplateSelectModalContent.js"),v=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=m=>{var C,h,b,E,S,x,f,T;const{selectedTemplate:P,closeDialog:g,showVariableMapping:y,channel:I,htmlContent:L,templateVariables:D,onTemplateSelect:j,globalPlaceholders:w,showOnlyContent:M,whatsappSpecificPickerMeta:A,zIndex:k,showVariableModal:V,variableList:H,discountCode:N,setDiscountCode:q,onBackPress:O,enabledCustomText:B,variableListForImage:F,showSampleValues:_,disableEditVariable:W,pod:Y,extras:R,pickerConf:$,selectedCarouselProducts:Q,disableEditExpiry:U,cardWidth:z,onDeleteSelectedProducts:G,fileName:J,setFileName:K,hideDeviceContainerInPreview:X,maxCharLimit:Z,onDefaultVariableSelect:ee,skipDefaultVariableContent:te,disableDatePicker:le,disableCopyCode:ae,initialExpiryDateTime:oe,showDiscountCodeExpiryInfo:ie,footerButtonText:re,footerInfoText:se,templateQuality:ne}=m;l.useEffect((()=>{be(L)}),[L]);const de=r.determineCardIndex(I),ue=r.isItCarousal(I,P),ce=null==P?void 0:P.isProductCarouselType,[pe,ve]=l.useState(I===s.CHANNEL_TYPE.EMAIL||I==s.CHANNEL_TYPE.WEBPUSH||ue?"desktop":"mobile"),[me,Ce]=l.useState(!1),[he,be]=l.useState(L),[Ee,Se]=l.useState(!1),[xe,fe]=l.useState([]),[Te,Pe]=l.useState({}),[ge,ye]=l.useState(P),[Ie,Le]=l.useState([]),[De,je]=l.useState(null),[we,Me]=l.useState(!1),[Ae,ke]=l.useState(null!=D?D:[]),[Ve,He]=l.useState(!1),[Ne,qe]=l.useState(ue?(null===(h=null===(C=null==ge?void 0:ge.mapping)||void 0===C?void 0:C.body)||void 0===h?void 0:h.length)?-1:0:-1),[Oe,Be]=l.useState([]),[Fe,_e]=l.useState(void 0),We=l.useRef(null),[Ye,Re]=l.useState(!1),[$e,Qe]=l.useState(!1),[Ue,ze]=l.useState(!1),[Ge,Je]=l.useState(!0),[Ke,Xe]=l.useState(!0),[Ze,et]=l.useState({});l.useEffect((()=>{Q?Be(Q):ce&&Be([])}),[Q]),l.useEffect((()=>{var e;if(!we&&ce&&(!Q||0===Be.length)){const t=null===(e=null==ge?void 0:ge.components)||void 0===e?void 0:e[de].cards,l=[];null==t||t.forEach((e=>{var t;null===(t=null==e?void 0:e.components)||void 0===t||t.forEach((e=>{var t,a,o;"HEADER"===e.type&&l.push(null!==(o=null===(a=null===(t=e.example)||void 0===t?void 0:t.header_handle)||void 0===a?void 0:a[0])&&void 0!==o?o:"")}))})),Le(l),Me(!0)}}),[we]);const tt=l.useMemo((()=>v.convertPlaceholdersToBikDropdown(w)),[w]);return l.useEffect((()=>{_e(t.cloneDeep(H))}),[H]),ne!==n.TEMPLATE_QUALITY.RED&&ne!==n.TEMPLATE_QUALITY.YELLOW||!Ge?e.jsx(d.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:Ue,setHideFooterButton:ze,hideCrossButton:$e,setHideCrossButton:Qe,variableList:Fe,setVariableList:_e,variableCallback:De,setVariableCallback:je,showVariablePicker:me,setShowVariablePicker:Ce,template:ge,setTemplate:ye,device:pe,setDevice:ve,display_content:he,setDisplayContent:be,originalVariableList:Ae,setOriginalVariableList:ke,isError:Ee,setIsError:Se,channel:I,globalNormalizedPlaceholders:tt,templateSelectionTriggered:Ve,setTemplateSelectionTriggered:He,enabledCustomText:B,disableEditVariable:W,pod:Y,extras:R,isWhatsappCarousel:ue,selectedCarouselIndex:Ne,setSelectedCarouselIndex:qe,isProductCarouselType:ce,templateErrorIndexes:Te,cardCount:ue?null===(x=null===(S=P.components)||void 0===S?void 0:S[de].cards)||void 0===x?void 0:x.length:void 0,errorIndexes:xe,setErrorIndexes:fe,pickerConf:$,carouselProducts:Oe,setCarouselProducts:Be,disableEditExpiry:U,cardWidth:z,cardImages:Ie,onDeleteSelectedProducts:G,hideDeviceContainerInPreview:X,sliderRef:We,isCarouselHovered:Ye,setIsCarouselHovered:Re,maxCharLimit:Z,ctaOptionsErrors:Ze,setCtaOptionsErrors:et,onDefaultVariableSelect:ee,disableDatePicker:le,disableCopyCode:ae,initialExpiryDateTime:oe,showDiscountCodeExpiryInfo:ie,cardIndex:de}},{children:M?e.jsx(p.default,{variableListFromProps:H,channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(i.StyledModal,Object.assign({hideCrossButton:$e,zIndex:k,centralContainerStyles:{width:ue?900:I===s.CHANNEL_TYPE.EMAIL&&y?1e3:800},open:Ke,onClose:()=>{Xe(!1),null==g||g()},headingTitle:null==ge?void 0:ge.label,headingSubtitle:I===s.CHANNEL_TYPE.WHATSAPP||r.isRCSChannel(I)?`${a.default.capitaliseFirstLetterOfString(null!==(f=null==ge?void 0:ge.category)&&void 0!==f?f:"")} • ${null!==(T=null==ge?void 0:ge.templateCategory)&&void 0!==T?T:""}`:"",onBackPress:O,modalHeaderStyles:{borderBottom:`1px solid ${o.COLORS.stroke.primary}`}},{children:[e.jsx(p.default,{variableListFromProps:H,showSampleValues:_,showVariableMapping:y,channel:I,whatsappSpecificPickerMeta:A,showVariableModal:V,discountCode:N,setDiscountCode:q,variableListForImage:F&&(null==F?void 0:F.length)>0?F:Fe,fileName:J,setFileName:e=>{null==K||K(e)},skipDefaultVariableContent:te}),j?e.jsx(u.default,{isWhatsappCarousel:null!=ue&&ue,onSelect:function(){var e;if((null==Oe?void 0:Oe.length)<1&&ce)return void Se(!0);if(Object.keys(Ze).length>0&&Y!==n.POD.CHATBOT)return void Se(!0);const t=null==j?void 0:j(ge,Ae,null!=he?he:"",Oe);Pe(null!==(e=null==t?void 0:t.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==t?void 0:t.errorIndexes)||(null==t?void 0:t.error)?((null==t?void 0:t.errorIndexes)&&fe(t.errorIndexes),(null==t?void 0:t.error)&&Se(!!(null==t?void 0:t.error))):He(!0)},footerButtonText:re,footerInfoText:se}):e.jsx(e.Fragment,{})]}))})):e.jsx(c.default,{headingTitle:null==ge?void 0:ge.label,headingSubtitle:I===s.CHANNEL_TYPE.WHATSAPP?`${a.default.capitaliseFirstLetterOfString(null!==(b=null==ge?void 0:ge.category)&&void 0!==b?b:"")} • ${null!==(E=null==ge?void 0:ge.templateCategory)&&void 0!==E?E:""}`:"",quality:ne,onClose:()=>{null==g||g(),Je(!1),Xe(!1)},onCancel:()=>{Je(!1),Xe(!1)},onProceed:()=>{Je(!1),Xe(!0)}})};
@@ -78,6 +78,7 @@ export declare const TemplateModalContext: React.Context<{
78
78
  [key: string]: string;
79
79
  }>> | undefined;
80
80
  onDefaultVariableSelect?: ((variable: VariableV3) => void) | undefined;
81
+ cardIndex: number;
81
82
  }>;
82
83
  export declare const useTemplateModalContext: () => {
83
84
  showDiscountCodeExpiryInfo?: boolean | undefined;
@@ -149,4 +150,5 @@ export declare const useTemplateModalContext: () => {
149
150
  [key: string]: string;
150
151
  }>> | undefined;
151
152
  onDefaultVariableSelect?: ((variable: VariableV3) => void) | undefined;
153
+ cardIndex: number;
152
154
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../template-preview/models/Channels.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const l=a(e).default.createContext({hideFooterButton:!1,setHideFooterButton:()=>{},hideCrossButton:!1,setHideCrossButton:()=>{},variableList:[],setVariableList:()=>{},variableCallback:null,setVariableCallback:null,showVariablePicker:!1,setShowVariablePicker:()=>{},device:"desktop",templateSelectionTriggered:!1,display_content:null,originalVariableList:[],channel:t.CHANNEL_TYPE.EMAIL,template:null,isError:!1,enabledCustomText:!1,disableEditVariable:!1,disableEditExpiry:!1,disableDatePicker:!1,showDiscountCodeExpiryInfo:!1});exports.TemplateModalContext=l,exports.useTemplateModalContext=()=>e.useContext(l);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../template-preview/models/Channels.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const l=a(e).default.createContext({hideFooterButton:!1,setHideFooterButton:()=>{},hideCrossButton:!1,setHideCrossButton:()=>{},variableList:[],setVariableList:()=>{},variableCallback:null,setVariableCallback:null,showVariablePicker:!1,setShowVariablePicker:()=>{},device:"desktop",templateSelectionTriggered:!1,display_content:null,originalVariableList:[],channel:t.CHANNEL_TYPE.EMAIL,template:null,isError:!1,enabledCustomText:!1,disableEditVariable:!1,disableEditExpiry:!1,disableDatePicker:!1,showDiscountCodeExpiryInfo:!1,cardIndex:-1});exports.TemplateModalContext=l,exports.useTemplateModalContext=()=>e.useContext(l);
@@ -2,5 +2,3 @@ export * from './TemplateContextMapper';
2
2
  export * from './utils/getDataFromTemplateComponent';
3
3
  export * from './utils/validateIsUrl';
4
4
  export * from './helpers/WebpushTemplateHelper';
5
- export * from './modalElements/TemplateAnalyticsSkeleton';
6
- export * from './modalElements/TemplateAnalyticsComponent';
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../curtain/CurtainHelper.js");var a=require("../../variable-picker-v3/model.js"),t=require("lodash"),i=require("react"),l=require("styled-components"),r=require("../../carousel-preview/CarouselPreview.js"),s=require("./EditWhatsAppCarouselTemplateV2.js"),o=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var n=require("../../../constants/Theme.js");require("../../template-preview/models/TemplateMeta.js"),require("../../template-preview/models/WhatsAppTemplate.js");var p=require("../../template-preview/models/Channels.js"),d=require("../../TypographyStyle.js"),u=require("../../variable-picker-v3/VariablePicker.js"),c=require("../context/templateModalContext.js"),h=require("../utils/constants.js"),m=require("../utils/getVariableNameEmail.js"),v=require("../utils/highlightFor.js"),w=require("./DesktopPreview.js"),C=require("./EditWebpushTemplate.js"),P=require("./EditWhatsAppTemplateV2.js"),b=require("./MobilePreview.js"),E=require("./VariableConnectorsPanel.js");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=f(l);const j=x.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../curtain/CurtainHelper.js");var a=require("../../variable-picker-v3/model.js"),t=require("lodash"),i=require("react"),l=require("styled-components"),r=require("../../carousel-preview/CarouselPreview.js"),s=require("./EditWhatsAppCarouselTemplateV2.js"),o=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var n=require("../../../constants/Theme.js");require("../../template-preview/models/TemplateMeta.js"),require("../../template-preview/models/WhatsAppTemplate.js");var p=require("../../template-preview/models/Channels.js"),d=require("../../TypographyStyle.js"),u=require("../../variable-picker-v3/VariablePicker.js"),c=require("../context/templateModalContext.js"),h=require("../utils/constants.js"),m=require("../utils/getVariableNameEmail.js"),C=require("../utils/highlightFor.js"),v=require("./DesktopPreview.js"),P=require("./EditWebpushTemplate.js"),w=require("./EditWhatsAppTemplateV2.js"),E=require("./MobilePreview.js"),b=require("./VariableConnectorsPanel.js");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=f(l);const A=x.default.div`
2
2
  display: flex;
3
3
  // height: 100%;
4
- `,g=x.default.div`
4
+ `,j=x.default.div`
5
5
  max-width: 450px;
6
6
  max-width: ${e=>e.channel===p.CHANNEL_TYPE.EMAIL?"400px":"450px"};
7
7
 
@@ -11,12 +11,12 @@
11
11
  border-left: ${n.COLORS.stroke.primary} 1px solid;
12
12
  border-top: ${e=>e.isWhatsappCarousel?`${n.COLORS.stroke.primary} 1px solid`:void 0};
13
13
  ${e=>!e.showVariableMapping&&"width: 340px; height: 500px"};
14
- `,A=x.default.div`
14
+ `,N=x.default.div`
15
15
  padding: ${e=>e.isWhatsappCarousel?void 0:e.showOnlyContent?"16px 14px":"16px 32px"};
16
16
  flex: 1;
17
17
  height: ${e=>e.isWhatsappCarousel||e.hideDeviceContainerInPreview?"500px":"475px"};
18
18
  overflow-y: auto;
19
19
  background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.CHANNEL_TYPE.WHATSAPP?`url(${h.BACKGROUND_PREVIEW_IMAGE});`:"none"};
20
- display: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.CHANNEL_TYPE.WHATSAPP?"flex":"initial"};
20
+ display: ${e=>!e.hideDeviceContainerInPreview||e.channel!==p.CHANNEL_TYPE.WHATSAPP&&e.channel!==p.CHANNEL_TYPE.RCS?"initial":"flex"};
21
21
  align-items: flex-start;
22
- `;exports.default=l=>{const{showVariableMapping:h,showOnlyContent:f,whatsappSpecificPickerMeta:x,showVariableModal:T,discountCode:N,setDiscountCode:S,variableListForImage:y,showSampleValues:k,variableListFromProps:L,fileName:V,setFileName:H,skipDefaultVariableContent:W}=l,q=i.useRef(),M=i.useRef(),{variableList:_,setVariableList:D,variableCallback:O,showVariablePicker:I,setShowVariablePicker:Y,device:B,display_content:F,channel:$,template:R,setTemplate:G,isWhatsappCarousel:U,isProductCarouselType:K,hideDeviceContainerInPreview:z,onDefaultVariableSelect:J}=c.useTemplateModalContext();const Q=e=>{let a=0;for(;e;)a+=e.offsetTop,e=e.offsetParent;return a};return e.jsxs(j,{children:[e.jsx(A,Object.assign({showOnlyContent:f,showVariableMapping:h,isWhatsappCarousel:U,hideDeviceContainerInPreview:z,channel:$,skipDefaultVariableContent:W},{children:"mobile"===B?e.jsx(b.default,{ref:M,display_content:null!=F?F:"",channel:$,template:R,showSampleValues:k}):$===p.CHANNEL_TYPE.WHATSAPP&&U?e.jsx(r.CarouselPreview,{ref:q,channel:$,template:R,showSampleValues:k,isPreview:!1,showArrows:!0}):$===p.CHANNEL_TYPE.WEBPUSH?e.jsx(o.TemplatePreview,{showSampleValues:k,channel:$,hideHeader:!0,template:R}):$!==p.CHANNEL_TYPE.MESSAGE?e.jsx(w.default,{ref:q,channel:$,display_content:null!=F?F:"",showSampleValues:k}):e.jsx(e.Fragment,{})})),(K||h)&&e.jsxs(g,Object.assign({channel:$,isWhatsappCarousel:U,showVariableMapping:!0},{children:[e.jsx("div",Object.assign({style:{height:"100%",width:"whatsapp"===$?428:400,display:I?"block":"none"}},{children:e.jsx(u.VariablePicker,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{D(t.cloneDeep(L)),Y(!1)},onSelect:e=>{O(e),D(t.cloneDeep(L)),Y(!1)},type:a.PickerType.EMBEDDED,data:null!=_?_:[],onDefaultVariableSelect:J,skipDefaultVariableContent:W},Math.random())})),e.jsx("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===$||"webpush"==$?428:400,display:I?"none":"block"}},{children:$!==p.CHANNEL_TYPE.WHATSAPP?$==p.CHANNEL_TYPE.WEBPUSH?e.jsx(C.default,{whatsappSpecificPickerMeta:x,template:R,onTemplateChange:e=>{null==G||G(e)},showVariableModal:T}):e.jsx(E.default,{onFocus:$===p.CHANNEL_TYPE.EMAIL?function(e){var a,t,i;const l=null===document||void 0===document?void 0:document.getElementById("mobile"===B?"template_html_mobile":"template_html_desktop"),r=m.getVariableNameForEmailByIndex(e+1),s=$===p.CHANNEL_TYPE.EMAIL?null===(a=null==l?void 0:l.contentWindow)||void 0===a?void 0:a.document.getElementById(r):document.getElementById(r),o=Q(s),d=null==s?void 0:s.offsetLeft;"desktop"===B?o&&q.current&&(null===(t=null==l?void 0:l.contentWindow)||void 0===t||t.scrollTo(null!=d?d:0,o),v.highlightFor(r,n.COLORS.background.warning.light,2,$,B)):o&&M.current&&(null===(i=null==l?void 0:l.contentWindow)||void 0===i||i.scrollTo(null!=d?d:0,o),v.highlightFor(r,n.COLORS.background.warning.light,2,$,B))}:void 0,showVariableModal:T,discountCode:N,setDiscountCode:S}):$===p.CHANNEL_TYPE.WHATSAPP&&U?e.jsx(s.default,{whatsappSpecificPickerMeta:x,template:R,showVariableModal:T,variableListForImage:y,discountCode:N,setDiscountCode:S}):e.jsx(P.default,{whatsappSpecificPickerMeta:x,template:R,onTemplateChange:e=>{null==G||G(e)},showVariableModal:T,variableListForImage:y,discountCode:N,setDiscountCode:S,fileName:V,setFileName:H})}))]})),[p.CHANNEL_TYPE.WHATSAPP,p.CHANNEL_TYPE.SMS].includes($)&&!h&&!K&&e.jsx(g,{children:e.jsx(d.BodySecondary,Object.assign({color:n.COLORS.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};
22
+ `;exports.default=l=>{const{showVariableMapping:h,showOnlyContent:f,whatsappSpecificPickerMeta:x,showVariableModal:T,discountCode:g,setDiscountCode:S,variableListForImage:L,showSampleValues:y,variableListFromProps:H,fileName:k,setFileName:V,skipDefaultVariableContent:_}=l,W=i.useRef(),q=i.useRef(),{variableList:M,setVariableList:D,variableCallback:O,showVariablePicker:Y,setShowVariablePicker:I,device:B,display_content:R,channel:F,template:$,setTemplate:G,isWhatsappCarousel:U,isProductCarouselType:K,hideDeviceContainerInPreview:z,onDefaultVariableSelect:J}=c.useTemplateModalContext();const Q=e=>{let a=0;for(;e;)a+=e.offsetTop,e=e.offsetParent;return a};return e.jsxs(A,{children:[e.jsx(N,Object.assign({showOnlyContent:f,showVariableMapping:h,isWhatsappCarousel:U,hideDeviceContainerInPreview:z,channel:F,skipDefaultVariableContent:_},{children:"mobile"===B?e.jsx(E.default,{ref:q,display_content:null!=R?R:"",channel:F,template:$,showSampleValues:y}):F!==p.CHANNEL_TYPE.WHATSAPP&&F!==p.CHANNEL_TYPE.RCS||!U?F===p.CHANNEL_TYPE.WEBPUSH?e.jsx(o.TemplatePreview,{showSampleValues:y,channel:F,hideHeader:!0,template:$}):F!==p.CHANNEL_TYPE.MESSAGE?e.jsx(v.default,{ref:W,channel:F,display_content:null!=R?R:"",showSampleValues:y}):e.jsx(e.Fragment,{}):e.jsx(r.CarouselPreview,{ref:W,channel:F,template:$,showSampleValues:y,isPreview:!1,showArrows:!0})})),(K||h)&&e.jsxs(j,Object.assign({channel:F,isWhatsappCarousel:U,showVariableMapping:!0},{children:[e.jsx("div",Object.assign({style:{height:"100%",width:"whatsapp"===F?428:400,display:Y?"block":"none"}},{children:e.jsx(u.VariablePicker,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{D(t.cloneDeep(H)),I(!1)},onSelect:e=>{O(e),D(t.cloneDeep(H)),I(!1)},type:a.PickerType.EMBEDDED,data:null!=M?M:[],onDefaultVariableSelect:J,skipDefaultVariableContent:_},Math.random())})),e.jsx("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===F||"webpush"==F||"rcs"==F?428:400,display:Y?"none":"block"}},{children:F!==p.CHANNEL_TYPE.WHATSAPP&&F!==(null===p.CHANNEL_TYPE||void 0===p.CHANNEL_TYPE?void 0:p.CHANNEL_TYPE.RCS)?F==p.CHANNEL_TYPE.WEBPUSH?e.jsx(P.default,{whatsappSpecificPickerMeta:x,template:$,onTemplateChange:e=>{null==G||G(e)},showVariableModal:T}):e.jsx(b.default,{onFocus:F===p.CHANNEL_TYPE.EMAIL?function(e){var a,t,i;const l=null===document||void 0===document?void 0:document.getElementById("mobile"===B?"template_html_mobile":"template_html_desktop"),r=m.getVariableNameForEmailByIndex(e+1),s=F===p.CHANNEL_TYPE.EMAIL?null===(a=null==l?void 0:l.contentWindow)||void 0===a?void 0:a.document.getElementById(r):document.getElementById(r),o=Q(s),d=null==s?void 0:s.offsetLeft;"desktop"===B?o&&W.current&&(null===(t=null==l?void 0:l.contentWindow)||void 0===t||t.scrollTo(null!=d?d:0,o),C.highlightFor(r,n.COLORS.background.warning.light,2,F,B)):o&&q.current&&(null===(i=null==l?void 0:l.contentWindow)||void 0===i||i.scrollTo(null!=d?d:0,o),C.highlightFor(r,n.COLORS.background.warning.light,2,F,B))}:void 0,showVariableModal:T,discountCode:g,setDiscountCode:S}):F!==p.CHANNEL_TYPE.WHATSAPP&&F!==p.CHANNEL_TYPE.RCS||!U?e.jsx(w.default,{whatsappSpecificPickerMeta:x,template:$,onTemplateChange:e=>{null==G||G(e)},showVariableModal:T,variableListForImage:L,discountCode:g,setDiscountCode:S,fileName:k,setFileName:V}):e.jsx(s.default,{whatsappSpecificPickerMeta:x,template:$,showVariableModal:T,variableListForImage:L,discountCode:g,setDiscountCode:S})}))]})),[p.CHANNEL_TYPE.WHATSAPP,p.CHANNEL_TYPE.SMS].includes(F)&&!h&&!K&&e.jsx(j,{children:e.jsx(d.BodySecondary,Object.assign({color:n.COLORS.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/arrow_back.svg.js"),l=require("../../../assets/icons/chevronLeft.svg.js"),n=require("../../../assets/icons/chevronRight.svg.js"),i=require("../../../assets/icons/PlusIcon.js"),o=require("lodash"),r=require("react"),a=require("../../button/Button.js"),s=require("../../icon-button/IconButton.js"),d=require("../../product-picker-v2/modal.js"),c=require("../Badge/index.js"),u=require("../context/templateModalContext.js"),p=require("./EditWhatsAppTemplateV2.js"),v=require("./ProductBox.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var m=require("../../../constants/Theme.js");require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js"),require("../../template-preview/models/TemplateMeta.js");var h=require("../../template-preview/models/WhatsAppTemplate.js");require("../../template-preview/models/Channels.js");var g=require("../../TypographyStyle.js");exports.default=x=>{let{template:y,whatsappSpecificPickerMeta:j,showVariableModal:f,variableListForImage:b,discountCode:C,setDiscountCode:O}=x;var I,S,P,q,w,k,T,B;const{selectedCarouselIndex:L,setTemplate:R,pickerConf:E,isProductCarouselType:M,pod:D,cardCount:A,carouselProducts:F,setCarouselProducts:V,isError:W,cardImages:N,disableEditVariable:$,onDeleteSelectedProducts:_,setSelectedCarouselIndex:z,setVariableCallback:G,setShowVariablePicker:H,sliderRef:J}=u.useTemplateModalContext(),[K,Q]=r.useState(-1==L?"First Message (Step 1/2)":M?"Product Carousel "+((null===(S=null===(I=null==y?void 0:y.mapping)||void 0===I?void 0:I.body)||void 0===S?void 0:S.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(q=null===(P=null==y?void 0:y.mapping)||void 0===P?void 0:P.body)||void 0===q?void 0:q.length)?"(Step 2/2)":"")),[U,X]=r.useState(!1),[Y,Z]=r.useState(!1),ee=L===(null!=A?A:-1)-1,te=(null!=L?L:-1)<1;r.useEffect((()=>{var e,t,l,n;Q(-1==L?"First Message (Step 1/2)":M?"Product Carousel "+((null===(t=null===(e=null==y?void 0:y.mapping)||void 0===e?void 0:e.body)||void 0===t?void 0:t.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(n=null===(l=null==y?void 0:y.mapping)||void 0===l?void 0:l.body)||void 0===n?void 0:n.length)?"(Step 2/2)":""))}),[L]);const le=e=>{null==V||V([{name:"variable",productName:e.actualValue}])};return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",alignItems:"center"}},{children:[null!=L&&L>=0&&!!(null===(k=null===(w=null==y?void 0:y.mapping)||void 0===w?void 0:w.body)||void 0===k?void 0:k.length)&&e.jsx(s.IconButton,{Icon:t.default,onClick:()=>{null==z||z(-1)}}),e.jsx(g.TitleMedium,Object.assign({style:{marginLeft:10}},{children:K}))]})),M&&(null!==(T=null==F?void 0:F.length)&&void 0!==T?T:0)>0&&null!=L&&L>=0&&e.jsxs("div",Object.assign({style:{display:"flex",rowGap:8,marginBottom:16,marginLeft:10,marginRight:10,flexDirection:"column"}},{children:[e.jsx(v.ProductBox,{editItem:()=>{1===(null==F?void 0:F.length)&&"variable"===F[0].name?(G((()=>le)),H(!0)):X(!U)},cardBody:1===(null==F?void 0:F.length)&&"variable"===F[0].name?`${F[0].productName}`:`${null==F?void 0:F.length} Products Selected`,hideIcon:1===(null==F?void 0:F.length)&&"variable"===F[0].name,deleteItem:()=>{var e;if(1===(null==F?void 0:F.length)&&"variable"===F[0].name)return void(null==V||V([]));const t=o.cloneDeep(Object.assign({},y));t&&(N&&N.length>0?null==N||N.forEach(((e,l)=>{var n;t.components[1].cards[l].components[0].example.header_handle=[null!==(n=N[l])&&void 0!==n?n:"https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})):null===(e=null==t?void 0:t.components[1].cards)||void 0===e||e.forEach(((e,l)=>{t.components[1].cards[l].components[0].example.header_handle=["https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})),null==R||R(t)),null==V||V([]),null==_||_()}}),F&&(null==F?void 0:F.length)>0&&"variable"!=F[0].name&&e.jsx(a.Button,{disabled:(null!==(B=null==F?void 0:F.length)&&void 0!==B?B:0)<=1,style:{alignSelf:"flex-end"},onClick:()=>{Z(!0),X(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),!$&&M&&0===(null==F?void 0:F.length)&&null!=L&&L>=0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{marginLeft:12}},{children:[e.jsx(g.TitleRegular,{children:"Product(s)"}),e.jsx(g.BodySecondary,{children:`Select ${null!=A?A:1} products`})]})),e.jsxs("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:W?16:12,marginRight:W?16:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[e.jsx(a.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:W?`2px dashed ${m.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:W?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex",width:18,height:18}},{children:e.jsx(i.default,{width:18,height:18,color:m.COLORS.content.secondary})})),onClick:e=>{X(!0)}}),D===h.POD.CHATBOT&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),e.jsx(g.BodyCaption,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),e.jsx(a.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%",border:W?`2px dashed ${m.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s) Variable",buttonType:W?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(i.default,{width:18,height:18,color:m.COLORS.content.secondary})})),onClick:e=>{G((()=>le)),H(!0)}})]})]})),W&&e.jsx("div",Object.assign({style:{marginLeft:10,marginBottom:16}},{children:e.jsx(c.Badge,{padding:"8px",errorText:"Please add products"})}))]}),!M&&(null!=L?L:-1)>-1&&e.jsxs("div",Object.assign({style:{display:"flex",background:m.COLORS.surface.hovered,alignItems:"center"}},{children:[e.jsx(s.IconButton,{Icon:l.default,disabled:te,width:8,height:14,svgStyle:te?{}:{color:m.COLORS.content.secondary},onClick:()=>{var e;null===(e=null==J?void 0:J.current)||void 0===e||e.slickPrev(),(null!=L?L:-1)<1||null==z||z((e=>e-1))}}),e.jsx(g.TitleRegular,Object.assign({style:{flex:1,display:"flex",justifyContent:"center"},color:m.COLORS.content.secondary},{children:`Card ${(null!=L?L:0)+1}/${A}`})),e.jsx(s.IconButton,{Icon:n.default,width:8,height:14,disabled:ee,svgStyle:ee?{}:{color:m.COLORS.content.secondary},onClick:()=>{var e;null===(e=null==J?void 0:J.current)||void 0===e||e.slickNext(),(null!=L?L:-1)>=(null!=A?A:-1)-1||null==z||z((e=>e+1))}})]})),e.jsx(p.default,{whatsappSpecificPickerMeta:j,template:y,onTemplateChange:e=>{null==R||R(e)},showVariableModal:f,variableListForImage:b,discountCode:C,setDiscountCode:O}),U&&E&&e.jsx(d.ProductPickerModal,{zIndex:200,startupScreen:Y?d.ScreenName.RearrangeProducts:d.ScreenName.Collections,rearrangeEnabled:!0,storeId:E.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const l of e){const e=null==l?void 0:l.collectionId,n=l.productId,i=l.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),n in t[e].products||(t[e].products[n]={variants:{},name:(null==l?void 0:l.productName)||"",image:(null==l?void 0:l.productImage)||""}),t[e].products[n].variants[i]={name:(null==l?void 0:l.name)||"",price:"",image:(null==l?void 0:l.image)||"",quantity:l.quantity||0,displayOrder:l.displayOrder}}return t}return{}})(null!=F?F:[]),collectionFetcher:E.fetchCollections,productFetcher:E.fetchProducts,onAdd:(e,t)=>{var l,n,i,r,a,s;Z(!1);const d=[];delete e.isCustom;for(const t of Object.keys(e)){const o=e[t].products;if(void 0!==o&&Object.keys(o).length)for(const e of Object.keys(o)){const c=o[e].variants;if(void 0!==c&&Object.keys(c).length)for(const u of Object.keys(c)){const{name:p,image:v,quantity:m,displayOrder:h}=c[u],g={name:p,image:null!==(n=null!=v?v:null===(l=o[e])||void 0===l?void 0:l.image)&&void 0!==n?n:"",quantity:m,variantId:u,productId:e,displayOrder:h,collectionId:t,productName:null!==(r=null===(i=o[e])||void 0===i?void 0:i.name)&&void 0!==r?r:"",productImage:null!==(s=null===(a=o[e])||void 0===a?void 0:a.image)&&void 0!==s?s:""};d.push(g)}}}const c=d.sort(((e,t)=>e.displayOrder-t.displayOrder)),u=d.map((e=>e.image)),p=o.cloneDeep(Object.assign({},y));p&&(u.forEach(((e,t)=>{var l;p.components[1].cards[t].components[0].example.header_handle=e?[e]:[null!==(l=null==N?void 0:N[t])&&void 0!==l?l:""]})),null==R||R(p)),null==V||V(c),X(!1)},searchInCollectionFetcher:E.searchInCollection,searchFetcher:E.searchProducts,visible:U,onClose:()=>{X(!1)},exactLimit:null!=A?A:1})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("../../../assets/icons/arrow_back.svg.js"),t=require("../../../assets/icons/chevronLeft.svg.js"),n=require("../../../assets/icons/chevronRight.svg.js"),i=require("../../../assets/icons/PlusIcon.js"),o=require("lodash"),r=require("react"),a=require("../../button/Button.js"),s=require("../../icon-button/IconButton.js"),d=require("../../product-picker-v2/modal.js"),c=require("../Badge/index.js"),u=require("../context/templateModalContext.js"),p=require("./EditWhatsAppTemplateV2.js"),v=require("./ProductBox.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var h=require("../../../constants/Theme.js");require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js"),require("../../template-preview/models/TemplateMeta.js");var m=require("../../template-preview/models/WhatsAppTemplate.js");require("../../template-preview/models/Channels.js");var g=require("../../template-preview/helpers/templateMiscHelper.js"),j=require("../../TypographyStyle.js");exports.default=x=>{let{template:y,whatsappSpecificPickerMeta:f,showVariableModal:b,variableListForImage:C,discountCode:O,setDiscountCode:S}=x;var I,q,w,P,k,T,B,L;const{selectedCarouselIndex:R,setTemplate:E,pickerConf:M,isProductCarouselType:D,pod:A,cardCount:F,carouselProducts:V,setCarouselProducts:W,isError:N,cardImages:$,disableEditVariable:_,onDeleteSelectedProducts:z,setSelectedCarouselIndex:G,setVariableCallback:H,setShowVariablePicker:J,sliderRef:K}=u.useTemplateModalContext(),[Q,U]=r.useState(g.isRCSChannel(null==y?void 0:y.channel)?"Carousel Cards":-1==R?"First Message (Step 1/2)":D?"Product Carousel "+((null===(q=null===(I=null==y?void 0:y.mapping)||void 0===I?void 0:I.body)||void 0===q?void 0:q.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(P=null===(w=null==y?void 0:y.mapping)||void 0===w?void 0:w.body)||void 0===P?void 0:P.length)?"(Step 2/2)":"")),[X,Y]=r.useState(!1),[Z,ee]=r.useState(!1),le=R===(null!=F?F:-1)-1,te=(null!=R?R:-1)<1;r.useEffect((()=>{var e,l,t,n;U(g.isRCSChannel(null==y?void 0:y.channel)?"Carousel Cards":-1==R?"First Message (Step 1/2)":D?"Product Carousel "+((null===(l=null===(e=null==y?void 0:y.mapping)||void 0===e?void 0:e.body)||void 0===l?void 0:l.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(n=null===(t=null==y?void 0:y.mapping)||void 0===t?void 0:t.body)||void 0===n?void 0:n.length)?"(Step 2/2)":""))}),[R]);const ne=e=>{null==W||W([{name:"variable",productName:e.actualValue}])};return r.useEffect((()=>{-1===R&&g.isRCSChannel(null==y?void 0:y.channel)&&(null==G||G(0))}),[R,null==y?void 0:y.channel]),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",alignItems:"center"}},{children:[!g.isRCSChannel(null==y?void 0:y.channel)&&null!=R&&R>=0&&!!(null===(T=null===(k=null==y?void 0:y.mapping)||void 0===k?void 0:k.body)||void 0===T?void 0:T.length)&&e.jsx(s.IconButton,{Icon:l.default,onClick:()=>{null==G||G(-1)}}),e.jsx(j.TitleMedium,Object.assign({style:{marginLeft:10}},{children:Q}))]})),D&&(null!==(B=null==V?void 0:V.length)&&void 0!==B?B:0)>0&&null!=R&&R>=0&&e.jsxs("div",Object.assign({style:{display:"flex",rowGap:8,marginBottom:16,marginLeft:10,marginRight:10,flexDirection:"column"}},{children:[e.jsx(v.ProductBox,{editItem:()=>{1===(null==V?void 0:V.length)&&"variable"===V[0].name?(H((()=>ne)),J(!0)):Y(!X)},cardBody:1===(null==V?void 0:V.length)&&"variable"===V[0].name?`${V[0].productName}`:`${null==V?void 0:V.length} Products Selected`,hideIcon:1===(null==V?void 0:V.length)&&"variable"===V[0].name,deleteItem:()=>{var e;if(1===(null==V?void 0:V.length)&&"variable"===V[0].name)return void(null==W||W([]));const l=o.cloneDeep(Object.assign({},y));l&&($&&$.length>0?null==$||$.forEach(((e,t)=>{var n;l.components[1].cards[t].components[0].example.header_handle=[null!==(n=$[t])&&void 0!==n?n:"https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})):null===(e=null==l?void 0:l.components[1].cards)||void 0===e||e.forEach(((e,t)=>{l.components[1].cards[t].components[0].example.header_handle=["https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})),null==E||E(l)),null==W||W([]),null==z||z()}}),V&&(null==V?void 0:V.length)>0&&"variable"!=V[0].name&&e.jsx(a.Button,{disabled:(null!==(L=null==V?void 0:V.length)&&void 0!==L?L:0)<=1,style:{alignSelf:"flex-end"},onClick:()=>{ee(!0),Y(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),!_&&D&&0===(null==V?void 0:V.length)&&null!=R&&R>=0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{marginLeft:12}},{children:[e.jsx(j.TitleRegular,{children:"Product(s)"}),e.jsx(j.BodySecondary,{children:`Select ${null!=F?F:1} products`})]})),e.jsxs("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:N?16:12,marginRight:N?16:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[e.jsx(a.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:N?`2px dashed ${h.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:N?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex",width:18,height:18}},{children:e.jsx(i.default,{width:18,height:18,color:h.COLORS.content.secondary})})),onClick:e=>{Y(!0)}}),A===m.POD.CHATBOT&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),e.jsx(j.BodyCaption,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),e.jsx(a.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%",border:N?`2px dashed ${h.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s) Variable",buttonType:N?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(i.default,{width:18,height:18,color:h.COLORS.content.secondary})})),onClick:e=>{H((()=>ne)),J(!0)}})]})]})),N&&e.jsx("div",Object.assign({style:{marginLeft:10,marginBottom:16}},{children:e.jsx(c.Badge,{padding:"8px",errorText:"Please add products"})}))]}),!D&&(null!=R?R:-1)>-1&&e.jsxs("div",Object.assign({style:{display:"flex",background:h.COLORS.surface.hovered,alignItems:"center"}},{children:[e.jsx(s.IconButton,{Icon:t.default,disabled:te,width:8,height:14,svgStyle:te?{}:{color:h.COLORS.content.secondary},onClick:()=>{var e;null===(e=null==K?void 0:K.current)||void 0===e||e.slickPrev(),(null!=R?R:-1)<1||null==G||G((e=>e-1))}}),e.jsx(j.TitleRegular,Object.assign({style:{flex:1,display:"flex",justifyContent:"center"},color:h.COLORS.content.secondary},{children:`Card ${(null!=R?R:0)+1}/${F}`})),e.jsx(s.IconButton,{Icon:n.default,width:8,height:14,disabled:le,svgStyle:le?{}:{color:h.COLORS.content.secondary},onClick:()=>{var e;null===(e=null==K?void 0:K.current)||void 0===e||e.slickNext(),(null!=R?R:-1)>=(null!=F?F:-1)-1||null==G||G((e=>e+1))}})]})),e.jsx(p.default,{whatsappSpecificPickerMeta:f,template:y,onTemplateChange:e=>{null==E||E(e)},showVariableModal:b,variableListForImage:C,discountCode:O,setDiscountCode:S}),X&&M&&e.jsx(d.ProductPickerModal,{zIndex:200,startupScreen:Z?d.ScreenName.RearrangeProducts:d.ScreenName.Collections,rearrangeEnabled:!0,storeId:M.storeId,selectedItems:(e=>{if(e.length>0){const l={};for(const t of e){const e=null==t?void 0:t.collectionId,n=t.productId,i=t.variantId;e in l||(l[e]={products:{},name:"",image:"",isSmartCollection:!1}),n in l[e].products||(l[e].products[n]={variants:{},name:(null==t?void 0:t.productName)||"",image:(null==t?void 0:t.productImage)||""}),l[e].products[n].variants[i]={name:(null==t?void 0:t.name)||"",price:"",image:(null==t?void 0:t.image)||"",quantity:t.quantity||0,displayOrder:t.displayOrder}}return l}return{}})(null!=V?V:[]),collectionFetcher:M.fetchCollections,productFetcher:M.fetchProducts,onAdd:(e,l)=>{var t,n,i,r,a,s;ee(!1);const d=[];delete e.isCustom;for(const l of Object.keys(e)){const o=e[l].products;if(void 0!==o&&Object.keys(o).length)for(const e of Object.keys(o)){const c=o[e].variants;if(void 0!==c&&Object.keys(c).length)for(const u of Object.keys(c)){const{name:p,image:v,quantity:h,displayOrder:m}=c[u],g={name:p,image:null!==(n=null!=v?v:null===(t=o[e])||void 0===t?void 0:t.image)&&void 0!==n?n:"",quantity:h,variantId:u,productId:e,displayOrder:m,collectionId:l,productName:null!==(r=null===(i=o[e])||void 0===i?void 0:i.name)&&void 0!==r?r:"",productImage:null!==(s=null===(a=o[e])||void 0===a?void 0:a.image)&&void 0!==s?s:""};d.push(g)}}}const c=d.sort(((e,l)=>e.displayOrder-l.displayOrder)),u=d.map((e=>e.image)),p=o.cloneDeep(Object.assign({},y));p&&(u.forEach(((e,l)=>{var t;p.components[1].cards[l].components[0].example.header_handle=e?[e]:[null!==(t=null==$?void 0:$[l])&&void 0!==t?t:""]})),null==E||E(p)),null==W||W(c),Y(!1)},searchInCollectionFetcher:M.searchInCollection,searchFetcher:M.searchProducts,visible:X,onClose:()=>{Y(!1)},exactLimit:null!=F?F:1})]}))};