1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[26],{4628:function(e,t,r){"use strict";var a,l=r(7294);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}t.Z=function(e){return l.createElement("svg",s({width:"1em",height:"1em",viewBox:"0 0 20 22",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 2h-1V0h-2v2H5V0H3v2H2C.9 2 0 2.9 0 4v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Zm0 18H2V9h16v11ZM2 7h16V4H2v3Z"})))}},9709:function(e,t,r){"use strict";var a,l=r(7294);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}t.Z=function(e){return l.createElement("svg",s({width:"1em",height:"1em",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=l.createElement("path",{d:"M7.705 1.41 6.295 0l-6 6 6 6 1.41-1.41L3.125 6l4.58-4.59Z"})))}},4921:function(e,t,r){"use strict";var a,l=r(7294);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}t.Z=function(e){return l.createElement("svg",s({width:"1em",height:"1em",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=l.createElement("path",{d:"M1.705 0 .295 1.41 4.875 6l-4.58 4.59L1.705 12l6-6-6-6Z"})))}},8887:function(e,t,r){"use strict";var a,l,s=r(7294);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}t.Z=function(e){return s.createElement("svg",n({width:"1em",height:"1em",viewBox:"0 0 30 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=s.createElement("g",{filter:"url(#quote_svg__a)"},s.createElement("path",{d:"M1 6.152c0 2.856 2.184 4.872 5.208 4.872h.84v.672c0 1.736-1.008 2.912-2.856 2.912H1.84v3.808h2.072c5.208 0 7.504-3.192 7.504-7.504V6.376C11.416 3.072 9.232 1 6.208 1S1 3.072 1 6.152Zm15.76 0c0 2.856 2.184 4.872 5.208 4.872h.84v.672c0 1.736-1.008 2.912-2.856 2.912H17.6v3.8
108h2.072c5.208 0 7.504-3.192 7.504-7.504V6.376C27.176 3.072 24.992 1 21.968 1S16.76 3.072 16.76 6.152Z",fill:"#fff",fillOpacity:.01}),s.createElement("path",{d:"M6.208 11.524h.34v.172c0 .773-.223 1.367-.598 1.764-.371.392-.944.648-1.758.648H1.34v4.808h2.572c2.71 0 4.733-.834 6.074-2.297 1.333-1.456 1.93-3.467 1.93-5.707V6.376c0-1.765-.586-3.242-1.615-4.28C9.27 1.06 7.837.5 6.208.5c-1.628 0-3.06.56-4.087 1.563C1.09 3.07.5 4.49.5 6.152c0 3.165 2.442 5.372 5.708 5.372Zm15.76 0h.34v.172c0 .773-.223 1.367-.598 1.764-.371.392-.944.648-1.758.648H17.1v4.808h2.572c2.71 0 4.733-.834 6.074-2.297 1.334-1.456 1.93-3.467 1.93-5.707V6.376c0-1.765-.586-3.242-1.615-4.28C25.03 1.06 23.597.5 21.968.5c-1.628 0-3.06.56-4.087 1.563C16.85 3.07 16.26 4.49 16.26 6.152c0 3.165 2.442 5.372 5.708 5.372Z",stroke:"#000"}))),l||(l=s.createElement("defs",null,s.createElement("filter",{id:"quote_svg__a",x:0,y:0,width:29.176,height:20.416,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},s.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),s.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),s.createElement("feOffset",{dx:1,dy:1}),s.createElement("feColorMatrix",{values:"0 0 0 0 0.882353 0 0 0 0 0.760784 0 0 0 0 0.901961 0 0 0 1 0"}),s.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_431_1567"}),s.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_431_1567",result:"shape"})))))}},7375:function(e,t,r){"use strict";var a,l=r(7294);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}t.Z=function(e){return l.createElement("svg",s({width:"1em",height:"1em",viewBox:"0 0 16 12",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=l.createElement("path",{d:"M5.33 9.23 1.853 5.753.671 6.93l4.658 4.659 10-10L14.154.413 5.33 9.229Z",fill:"inherit"})))}},528:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard",function(){return r(4823)}])},8079:function(e,t,r){"use strict";var a=r(5893);t.Z=e=>{let{label:t,Svg:r,placeholder:l,name:s,options:n,value:o,onChange:c}=e;return(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("label",{className:"mb-2.5 text-sm",htmlFor:s,children:t}),(0,a.jsxs)("div",{className:"flex items-center relative",children:[(0,a.jsx)(r,{className:"absolute ml-4",width:20,height:20}),(0,a.jsxs)("select",{className:"border border-black pl-11 pr-4 w-full text-sm bg-no-repeat appearance-none",style:{height:50,backgroundImage:"url(/chevron-down.svg)",backgroundPosition:"right 22px center"},id:s,name:s,value:o,onChange:c,children:[(0,a.jsxs)("option",{disabled:!0,value:"",className:"text-myGray",children:["--- ",l," ---"]}),n.map(e=>"string"==typeof e?(0,a.jsx)("option",{value:e,children:e},e):(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]})}},9515:function(e,t,r){"use strict";var a=r(5893),l=r(8887);t.Z=e=>{let{children:t,extraClasses:r}=e;return(0,a.jsx)("div",{className:"flex justify-center ".concat(r),children:(0,a.jsxs)("div",{className:"relative py-6 px-8 bg-white border border-black rounded-3xl inline-block",style:{maxWidth:1e3},children:[(0,a.jsx)("div",{className:"absolute -top-2 left-2/4 -translate-x-1/2",children:(0,a.jsx)(l.Z,{})}),(0,a.jsx)("p",{className:"text-center",children:t})]})})}},9950:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a,l,s=r(5893),n=r(7294);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}var c=function(e){return n.createElement("svg",o({width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=n.createElement("g",{filter:"url(#soft-star_svg__a)"},n.createElement("path",{d:"M11.68.284c.045-.379.595-.379.64 0l.378 3.182a8.953 8.953 0 0 0 7.835 7.836l3.182.378c.38.045.38.595 0 .64l-3.181.378a8.953 8.953 0 0 0-7.836 7.835l-.378 3.182c-.045.38-.595.38-.64 0l-.378-3.181a8.953 8.953 0 0 0-7.836-7.836L.284 12.32c-.379-.045-.379-.595 0-.64l3.182-.378a8.953 8.953 0 0 0 7.836-7.836L11.68.284Z",fill:"#fff",fillOpacity:.01}),n.createElement("path",{d:"M11.799 3.525 12 1.83l.201 1.696a9.453 9.453 0 0 0 8.274 8.274L22.17 12l-1.696.201a9.453 9.453 0 0 0-8.274 8.274L12 22.17l-.201-1.696A9.453 9.453 0 0 0 3.525 12.2L1.83 12l1.696-.201A9.453 9.453 0 0 0 11.8 3.525Z",stroke:"#000"}))),l||(l=n.createElement("defs",null,n.createElement("filter",{id:"soft-star_svg__a",x:0,y:0,width:25,height:25,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"}
1,n.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),n.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),n.createElement("feOffset",{dx:1,dy:1}),n.createElement("feColorMatrix",{values:"0 0 0 0 0.882353 0 0 0 0 0.756863 0 0 0 0 0.901961 0 0 0 1 0"}),n.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_364_72762"}),n.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_364_72762",result:"shape"})))))},i=e=>{let{badgeText:t,text:r,extraTextClasses:a}=e;return(0,s.jsxs)("div",{className:"relative max-w-4xl mx-auto p-6 bg-white border border-black rounded-3xl mt-9 lg:mt-11 z-10",children:[(0,s.jsx)("div",{className:'absolute z-10 top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white outline outline-1 outline-black px-4 py-2 rounded-lg text-[13px] tracking-[0.2em] before:content-[""] before:bg-myPaleBlue before:-z-10 before:absolute before:top-0.5 before:left-0.5 before:-right-1 before:-bottom-1 before:rounded-lg',children:t}),(0,s.jsx)(c,{className:"absolute -top-1 -right-2",width:24,height:24}),(0,s.jsx)("p",{className:"p-small text-center mt-1 ".concat(a),children:r})]})}},6884:function(e,t,r){"use strict";var a=r(5893),l=r(5187);t.Z=e=>{let{errorMsg:t}=e;return(0,a.jsx)("div",{className:"grow flex items-center justify-center",children:t||(0,a.jsx)(l.Z,{height:90,width:90})})}},2298:function(e,t,r){"use strict";var a=r(5893);t.Z=e=>{let{children:t}=e;return(0,a.jsx)("span",{className:"underline font-underline underline-offset-2 decoration-2 decoration-myPaleBlue",children:t})}},3655:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var a=r(5893),l=r(7294),s=r(1911),n=r(719);let o=e=>{let{children:t,myClasses:r}=e,l=(0,n.oc)();return(0,a.jsx)("button",{className:r,onClick:()=>l.slideNext(),children:t})},c=e=>{let{children:t,myClasses:r}=e,l=(0,n.oc)();return(0,a.jsx)("button",{className:r,onClick:()=>l.slidePrev(),children:t})};var i=e=>{let{index:t,currentSlide:r}=e,l=(0,n.oc)();return(0,a.jsx)("button",{onClick:()=>l.slideTo(t),className:"relative w-2 h-2 rounded-full mt-1 ".concat(0!==t&&"ml-2"," ").concat(r===t&&"bg-myAqua"),children:(0,a.jsx)("div",{className:"absolute -top-0.5 -left-0.5 w-full h-full border border-black rounded-full"})})},d=r(9709),u=r(4921),h=e=>{let{currentSlide:t,numberOfSlides:r}=e,l="#CCCCCC",s="#FEB094",n=r-1;return(0,a.jsxs)("div",{className:"flex justify-center mt-5",children:[(0,a.jsx)(c,{myClasses:"mr-4",children:(0,a.jsx)(d.Z,{fill:0===t?l:s,width:7,height:12})}),[...Array(r)].map((e,r)=>(0,a.jsx)(i,{index:r,currentSlide:t},r)),(0,a.jsx)(o,{myClasses:"ml-4",children:(0,a.jsx)(u.Z,{fill:t===n?l:s,width:7,height:12})})]})},m=e=>{let{children:t,autoplay:r}=e,[o,c]=(0,l.useState)(0),i=l.Children.count(t);return(0,a.jsx)("div",{className:"relative z-0",children:(0,a.jsxs)(n.tq,{modules:[s.W_,s.tl,s.s5,s.pt],spaceBetween:50,slidesPerView:1,onSlideChange:e=>{console.log("slide changed to "+e.activeIndex),c(e.activeIndex)},onSwiper:e=>console.log(e),autoplay:r,className:"relative",children:[l.Children.map(t,(e,t)=>(0,a.jsx)(n.o5,{className:"relative cursor-pointer",children:l.cloneElement(e)},t)),(0,a.jsx)(h,{currentSlide:o,numberOfSlides:i})]})})}},9539:function(e,t,r){"use strict";var a=r(5893);t.Z=e=>{let{dateRangeOptions:t,selectedDateRange:r,handleSelectDateRange:l}=e;return(0,a.jsx)("ul",{className:"h-full flex flex-col justify-between py-4 gap-2",children:t.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)("button",{className:"".concat(r===e&&"bg-[#a9bed8] border-y border-y-black"," w-full px-6 py-3"),value:e,onClick:l,children:e})},e))})}},8878:function(e,t,r){"use strict";var a=r(5893),l=r(9198),s=r.n(l);t.Z=e=>{let{selected:t,onChange:r,minDate:l,maxDate:n,highlightDates:o,title:c}=e;return(0,a.jsxs)("div",{children:[""!==c&&(0,a.jsx)("h3",{className:"mb-3 text-center",children:c}),(0,a.jsx)(s(),{selected:t,onChange:r,minDate:l,maxDate:n,highlightDates:o,inline:!0,disabledKeyboardNavigation:!0,showMonthDropdown:!0,useShortMonthInDropdown:!0,showYearDropdown:!0,dropdownMode:"select",showDisabledMonthNavigation:!0,fixedHeight:!0})]})}},4338:function(e,t,r){"use strict";var a=r(5893),l=r(7294);r(3794);var s=r(5582),n=r.n(s),o=r(9026),c=r(8205),i=r(8079),d=r(4628),u=r(8878),h=r(9539);let m=new Date,p=(0,o.w)(2010,m.getFullYear(),1),x="Yesterday",f="Last Week",g="Last Month",v="Last Quarter",b="Last Year",y=[x,f,g,v,b,"Custom Range"];t.Z=e=>{let t,{startDate:r,endDate:s,updateStartDate:o,updateEndDate:w}=e,[j,_]=(0,l.useState)("");r&&s&&(t=[{"bg-[#D9E4B7] text-black rounded-full":(0,c.YG)(r,s)}]);let N=e=>{let t=e.currentTarget.value;_(t),t===x?C():t===f?E():t===g?M():t===v?k():t===b&&S()},C=()=>{o(n()().subtract(1,"days").startOf("day").toDate()),w(n()().subtract(1,"days").endOf("day").toDate())},E=()=>{o(n()().subtract(1,"weeks").startOf("week").toDate()),w(n()().subtract(1,"weeks").endOf("week").toDate())},M=()=>{o(n()().subtract(1,"months").startOf("month").toDate()),w(n()().subtract(1,"months").endOf("month").toDate())},k=()=>{o(n()().subtract(1,"quarter").startOf("quarter").toDate()),w(n()().subtract(1,"quarter").endOf("quarter").toDate())},S=()=>{o(n()().subtract(1,"years").startOf("year").toDate()),w(n()().subtract(1,"years").endOf("year").toDate())};return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col items-center lg:flex-row justify-center mx-auto w-[300px] lg:w-auto",children:[(0,a.jsx)("div",{className:"lg:hidden w-full mb-4",children:(0,a.jsx)(i.Z,{label:"TIMEFRAME",Svg:
1d.Z,options:y,placeholder:"Select a Timeframe",name:"Timeframe",value:j,onChange:N})}),(0,a.jsxs)("div",{className:"flex justify-center bg-white border border-black w-full lg:w-auto",children:[(0,a.jsx)("div",{className:"hidden lg:block border-r border-r-black",children:(0,a.jsx)(h.Z,{dateRangeOptions:y,selectedDateRange:j,handleSelectDateRange:N})}),(0,a.jsxs)("div",{className:"flex flex-col lg:flex-row items-center gap-8 p-4 lg:py-0 lg:px-8",children:[(0,a.jsx)(u.Z,{title:"Start Date",selected:r,onChange:e=>{console.log("Custom start date selected"),e&&(e&&o(e),_("Custom Range"))},minDate:new Date(p[0],0,1),maxDate:s||m,highlightDates:t}),(0,a.jsx)(u.Z,{title:"End Date",selected:s,onChange:e=>{console.log("Custom end date selected"),e&&(w(e),_("Custom Range"))},minDate:r,maxDate:m,highlightDates:t})]})]})]})})}},4823:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return ti}});var a,l,s,n,o,c,i,d,u,h,m,p,x,f,g,v,b,y=r(5893),w=r(7294);let j=(0,w.createContext)(null);var _=()=>{let[e,t]=(0,w.useState)(0);return{cohortTotalAudience:e,updateCohortTotalAudience:e=>{t(e)}}},N=r(1163);function C(){return(C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}var E=function(e){return w.createElement("svg",C({width:"1em",height:"1em",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=w.createElement("g",{filter:"url(#circle-avocado_svg__a)"},w.createElement("circle",{cx:16,cy:16,r:16,fill:"#fff",fillOpacity:.01}),w.createElement("circle",{cx:16,cy:16,r:15.5,stroke:"#000"}))),l||(l=w.createElement("defs",null,w.createElement("filter",{id:"circle-avocado_svg__a",x:0,y:0,width:34,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},w.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),w.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),w.createElement("feOffset",{dx:2,dy:2}),w.createElement("feColorMatrix",{values:"0 0 0 0 0.741176 0 0 0 0 0.823529 0 0 0 0 0.498039 0 0 0 1 0"}),w.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_364_72697"}),w.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_364_72697",result:"shape"})))))};function M(){return(M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}var k=function(e){return w.createElement("svg",M({width:"1em",height:"1em",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=w.createElement("g",{filter:"url(#circle-aqua_svg__a)"},w.createElement("circle",{cx:16,cy:16,r:16,fill:"#fff",fillOpacity:.01}),w.createElement("circle",{cx:16,cy:16,r:15.5,stroke:"#000"}))),n||(n=w.createElement("defs",null,w.createElement("filter",{id:"circle-aqua_svg__a",x:0,y:0,width:34,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},w.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),w.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),w.createElement("feOffset",{dx:2,dy:2}),w.createElement("feColorMatrix",{values:"0 0 0 0 0.584314 0 0 0 0 0.784314 0 0 0 0 0.772549 0 0 0 1 0"}),w.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_364_72700"}),w.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_364_72700",result:"shape"})))))},S=r(4871),O=r(2484);function Z(){return(Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}var A=function(e){return w.createElement("svg",Z({width:"1em",height:"1em",viewBox:"0 0 1262 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),o||(o=w.createElement("path",{d:"M1 15 15 1l14 14M29 15 43 1l14 14M57 15 71 1l14 14M85 15 99 1l14 14M113 15l14-14 14 14M141 15l14-14 14 14M169 15l14-14 14 14M197 15l14-14 14 14M225 15l14-14 14 14M253 15l14-14 14 14M281 15l14-14 14 14M309 15l14-14 14 14M337 15l14-14 14 14M365 15l14-14 14 14M393 15l14-14 14 14M421 15l14-14 14 14M449 15l14-14 14 14M477 15l14-14 14 14M505 15l14-14 14 14M533 15l14-14 14 14M561 15l14-14 14 14M589 15l14-14 14 14M617 15l14-14 14 14M645 15l14-14 14 14M673 15l14-14 14 14M701 15l14-14 14 14M729 15l14-14 14 14M757 15l14-14 14 14M785 15l14-14 14 14M813 15l14-14 14 14M841 15l14-14 14 14M869 15l14-14 14 14M897 15l14-14 14 14M925 15l14-14 14 14M953 15l14-14 14 14M981 15l14-14 14 14M1009 15l14-14 14 14M1037 15l14-14 14 14M1065 15l14-14 14 14M1093 15l14-14 14 14M1121 15l14-14 14 14M1149 15l14-14 14 14M1177 15l14-14 14 14M1205 15l14-14 14 14M1233 15l14-14 14 14",stroke:"#000"})))},F=e=>{let{myClasses:t}=e;return(0,y.jsx)("div",{className:"relative w-full h-4 mx-auto overflow-hidden ".concat(t),children:(0,y.jsx)(A,{className:"absolute left-1/2 -translate-x-1/2",width:1260,height:14})})};function T(e){if(!Array.isArray(e)||0===e.length)return!1;for(let t of e)if("string"!=typeof t)return!1;return!0}
1var D=r(8205);let B=["timeframe","aov","product","newsletter","discount_code","total_customer_orders"];var P=()=>{let e=(0,N.useRouter)(),[t,r]=(0,w.useState)(""),[a,l]=(0,w.useState)(""),[s,n]=(0,w.useState)(null);function o(e){return!!e&&"string"==typeof e&&(0,D.LE)(e)}function c(e){let t=Number(e);return!(!e||isNaN(t))}return(0,w.useEffect)(()=>{if(!e.isReady)return;let{selection_type:a,date_min:s,date_max:i,min:d,max:u,product_selection_type:h,value:m,codes:p,dash_date_min:x,dash_date_max:f,order_number:g,customer_date_min:v,customer_date_max:b,values_arr:y,names_arr:w}=e.query;if(!(a?!("string"==typeof a&&B.includes(a))&&(l("Invalid selection type: "+a),!0):(l("No selection type specified."),!0))){var j,_,N;let e="";"timeframe"===a||"newsletter"===a?e=o(s)&&o(i)?(n({selectionType:a,dateMin:s,dateMax:i}),"selection_type=".concat(a,"&date_min=").concat(encodeURIComponent(s),"&date_max=").concat(encodeURIComponent(i))):(l("date_min and date_max are not valid."),""):"aov"===a?e=function(e){if(!d||!u)return l("min and max values need to be defined."),"";if("string"!=typeof d||"string"!=typeof u)return l("Url params min and max must be strings."),"";let t=parseFloat(d),r=parseFloat(u);return t>r?(l("Max must be greater than or equal to min"),""):(n({selectionType:e,min:t,max:r}),"selection_type=".concat(a,"&min=").concat(encodeURIComponent(d),"&max=").concat(encodeURIComponent(u)))}(a):"product"===a?e=function(){if(!h||!y)return l("product_selection_type & values_arr must be defined."),"";if("string"!=typeof h||"string"!=typeof y||w&&"string"!=typeof w)return l("Url params product_selection_type and value must be strings. If names_arr is provided, it must be a string."),"";let e=JSON.parse(y),t=void 0!==w?JSON.parse(w):null;return Array.isArray(e)&&(!t||Array.isArray(t))?"product"!==h&&"product_category"!==h||T(t)?"product"===h||"product_type"===h||"product_category"===h?(n(()=>{let r={selectionType:"product",productSelectionType:h,valuesArr:e};return t&&T(t)&&(r.namesArr=t),r}),"selection_type=".concat(a,"&product_selection_type=").concat(encodeURIComponent(h),"&values_arr=").concat(encodeURIComponent(y)).concat(t&&T(t)?"&names_arr=".concat(encodeURIComponent(w)):"")):(l("Invalid product_selection_type."),""):(l("`names` of the products or categories must be defined and be a string value that can be parsed into an array."),""):(l("values_arr and names_arr must be strings that parse into arrays."),"")}():"discount_code"===a?e=p&&"string"==typeof p?(n({selectionType:"discount_code",codes:p}),"selection_type=".concat(a,"&codes=").concat(encodeURIComponent(p))):(l("Invalid discount codes."),""):"total_customer_orders"===a&&(e=c(m)?(n({selectionType:"total_customer_orders",value:Number(m)}),"selection_type=".concat(a,"&value=").concat(encodeURIComponent(m))):(l('Total customer orders "value" must be provided and numeric.'),"")),t&&(x&&f&&(j=e,e=o(x)&&o(f)?(n(e=>e?{...e,dashDateMin:x,dashDateMax:f}:null),"".concat(j,"&dash_date_min=").concat(encodeURIComponent(x),"&dash_date_max=").concat(encodeURIComponent(f))):(l("dash_date_min and dash_date_max are not valid."),"")),g&&(_=e,e=c(g)?(n(e=>e?{...e,orderNumber:Number(g)}:null),"".concat(_,"&order_number=").concat(g)):(l("order_number must be a valid number greater than 0."),"")),v&&b&&(N=e,e=o(v)&&o(b)?(n(e=>e?{...e,customerDateMin:v,customerDateMax:b}:null),"".concat(N,"&customer_date_min=").concat(encodeURIComponent(v),"&customer_date_max=").concat(encodeURIComponent(b))):(l("customer_date_min and customer_date_max are not valid."),""))),r(e)}},[e.isReady,e.query,t]),{apiQueryString:t,errorMsg:a,cohortSettings:s}},I=r(4338),R=r(1901);let L=e=>1===e?"1st":2===e?"2nd":3===e?"3rd":"".concat(e,"th");function V(e,t){if(!e||!t.isReady)return"";let{selectionType:r}=e,a="";if("timeframe"===r&&Object.hasOwn(e,"dateMin")&&Object.hasOwn(e,"dateMax"))a+="customers that made an order between ".concat((0,D.ie)(e.dateMin)," & ").concat((0,D.ie)(e.dateMax));else if("aov"===r&&Object.hasOwn(e,"min")&&Object.hasOwn(e,"max"))a+="customers that have an average order value between $".concat(e.min," & $").concat(e.max);else if("product"===r&&Object.hasOwn(e,"productSelectionType")&&Object.hasOwn(e,"valuesArr")){if("product_category"===e.productSelectionType){let e=JSON.parse(t.query.names_arr);a+="customers that purchased a product of category ".concat(U(e))}else if("product_type"===e.productSelectionType)a+="customers that purchased a product of type ".concat(U(e.valuesArr));else if("product"===e.productSelectionType){let e=JSON.parse(t.query.names_arr);a+="customers that purchased the product ".concat(U(e))}}else if("newsletter"===r&&Object.hasOwn(e,"dateMin")&&Object.hasOwn(e,"dateMax"))a+="current newsletter subscribers that subscribed between ".concat((0,D.ie)(e.dateMin)," & ").concat((0,D.ie)(e.dateMax));else if("discount_code"===r&&Object.hasOwn(e,"codes")){let t=e.codes.split(",");a+="customers that used the discount code".concat(t.length>
11?"s":"",' "').concat(t.join(", "),'"')}else"total_customer_orders"===r&&(a+="customers that made a total of ".concat(e.value," order").concat(1===e.value?"":"s"));return e.orderNumber&&(a+=". Only including Customers who meet this criteria with their ".concat(L(e.orderNumber)," Purchase")),e.customerDateMin&&e.customerDateMax&&(a+=". Only including Customers who meet this criteria between ".concat((0,D.ie)(e.customerDateMin)," and ").concat((0,D.ie)(e.customerDateMax),".")),a}function U(e){let t="";return e.forEach((r,a)=>{r=r.trim(),console.log(a,e.length-1),0===a?t+='"'.concat(r,'"'):t+=' or "'.concat(r,'"')}),t}var z=e=>{let{openSaveAudienceModal:t,apiQueryString:r,incrementDashboardVisits:a}=e,[l,s]=(0,w.useState)(),[n,o]=(0,w.useState)(),c=(0,N.useRouter)(),{cohortSettings:i}=P();console.log("Cohort settings: "),console.log(i),(0,w.useEffect)(()=>{if(!i)return;let{dashDateMin:e,dashDateMax:t}=i;e&&t&&(new Date(e).toUTCString(),s(new Date(e+"T00:00:00")),o(new Date(t+"T11:59:59")))},[i]);let d=()=>!!l&&!!n&&l<=n,u=!d(),h="/dashboard?"+(()=>{if(r&&l&&n&&d()){let e=r.split("&"),t=e.findIndex(e=>e.includes("dash_date_min")),a=e.findIndex(e=>e.includes("dash_date_max")),s=(0,D.bm)(l),o=(0,D.bm)(n);return -1===t?e.push("dash_date_min=".concat(s)):e[t]="dash_date_min=".concat(s),-1===a?e.push("dash_date_max=".concat(o)):e[a]="dash_date_max=".concat(o),e.join("&")}return"#"})();return(0,y.jsxs)("header",{className:"pt-20 container",children:[(0,y.jsxs)("div",{className:"max-w-5xl mx-auto",children:[(0,y.jsx)("h1",{className:"text-center mb-3 lg:mb-5",children:"Start learning about your audience"}),(0,y.jsx)("p",{className:"lg:p-large text-center mb-4",children:"Learn about the impact this customer group has on your business. Get important insights about their order volume, revenue impact and purchase patterns."}),(0,y.jsx)("p",{className:"text-center",children:"Throughout the dashboard youâll see comparisons to a Benchmark audience. The Benchmark audience represents your average customerâs behavior. With this comparison youâll quickly see if your created audience is better or worse than the average."})]}),(0,y.jsxs)("div",{className:"flex flex-col lg:flex-row lg:justify-center items-center mt-9 lg:mt-12 gap-3 lg:gap-4",children:[(0,y.jsxs)("div",{className:"bg-white border border-black rounded-full px-8 py-3 flex items-center gap-2",children:[(0,y.jsx)(E,{className:"w-6 lg:w-8"}),(0,y.jsx)("p",{className:"text-center",children:"The Audience You Just Built"})]}),(0,y.jsx)("span",{className:"p-large",children:"vs"}),(0,y.jsxs)("div",{className:"bg-white border border-black rounded-full px-8 py-3 flex items-center gap-2",children:[(0,y.jsx)(k,{className:"w-6 lg:w-8"}),(0,y.jsx)("p",{className:"text-center",children:"Benchmark"})]})]}),(0,y.jsxs)("div",{className:"text-center max-w-5xl mx-auto",children:[(0,y.jsxs)("h2",{className:"break-words mt-10",children:["Audience: ",V(i,c)]}),(0,y.jsxs)("div",{className:"mt-12 mb-12",children:[(0,y.jsx)("h4",{className:"text-center mb-3",children:"The date range below allows you to view how this audience behaved during a specific timeframe (it does NOT create a new audience). For example, if you selected last yearâs purchasers as your original audience, and then selected last week in the date selector below, you would see how last yearâs purchasers behaved last week. Make sense? Time for Lift Off!"}),(0,y.jsx)(I.Z,{startDate:l,endDate:n,updateStartDate:e=>{s(e)},updateEndDate:e=>{o(e)}}),(0,y.jsx)(R.Z,{href:h,disabled:u,size:"sm",myClasses:"mt-4",onClick:a,children:"Filter"})]}),(0,y.jsx)("div",{className:"hidden lg:block",children:(0,y.jsx)(S.Z,{size:"sm",Svg:O.Z,bg:"secondary",onClick:t,children:"Save This Audience"})}),(0,y.jsxs)("button",{className:"lg:hidden flex items-center mx-auto gap-2",onClick:t,children:["Save This Audience ",(0,y.jsx)(O.Z,{fill:"#FEB094",height:12,width:12})]})]}),(0,y.jsx)(F,{myClasses:"my-11 lg: mt-14"})]})};function Y(){return(Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}var q=function(e){return w.createElement("svg",Y({width:"1em",height:"1em",viewBox:"0 0 70 71",fill:"none",xmlns:"http://www.w3.org/2000/svg"}
1,e),c||(c=w.createElement("g",{filter:"url(#lift-prompt_svg__a)"},w.createElement("ellipse",{cx:34.961,cy:35.454,rx:29.307,ry:29.332,fill:"#fff",fillOpacity:.01}),w.createElement("path",{d:"M63.768 35.454c0 15.924-12.898 28.832-28.807 28.832-15.91 0-28.807-12.908-28.807-28.832 0-15.924 12.898-28.832 28.807-28.832 15.91 0 28.807 12.908 28.807 28.832Z",stroke:"#000"}))),i||(i=w.createElement("g",{filter:"url(#lift-prompt_svg__b)"},w.createElement("ellipse",{cx:34.961,cy:35.454,rx:18.756,ry:18.773,fill:"#fff",fillOpacity:.01}),w.createElement("path",{d:"M53.217 35.454c0 10.092-8.174 18.273-18.256 18.273-10.083 0-18.257-8.18-18.257-18.273 0-10.092 8.174-18.272 18.257-18.272 10.082 0 18.256 8.18 18.256 18.272Z",stroke:"#000"}))),d||(d=w.createElement("g",{clipPath:"url(#lift-prompt_svg__c)",fill:"#000"},w.createElement("path",{d:"m9.09 39.234 4.254-.497-.25-2.434.495-.058.305 2.979-4.75.553-.055-.545.001.002ZM8.957 33.836l4.762.243-.037.548-4.762-.244.037-.547ZM9.98 28.227l.483.108-.556 2.3 1.584.353.524-2.166.491.109-.524 2.166 2.083.465-.13.534-4.64-1.035.686-2.834ZM12.412 22.682l.446.213-.705 1.424 3.831 1.822-.245.496-3.831-1.823-.709 1.432-.445-.214 1.658-3.35ZM17.71 16.308c.213-.194.443-.327.687-.397.244-.071.488-.073.728-.003.24.069.457.205.65.414.196.21.314.438.361.681.045.245.024.486-.068.724a1.7 1.7 0 0 1-.449.643l-.936.857 1.296 1.4-.41.375-3.2-3.461 1.344-1.229-.002-.004Zm.633 2.552.89-.814c.234-.213.36-.438.384-.675.024-.237-.062-.461-.259-.672-.192-.208-.41-.31-.65-.308-.241.003-.479.11-.71.32l-.89.814 1.235 1.335ZM22.787 12.748a1.76 1.76 0 0 1 .76-.229 1.29 1.29 0 0 1 .7.157c.215.117.39.299.526.547.136.243.196.49.18.735a1.332 1.332 0 0 1-.24.685 1.7 1.7 0 0 1-.589.52l-1.227.684.945 1.71-.486.27-2.282-4.125 1.713-.954Zm-.13 2.668 1.174-.652c.276-.154.452-.342.533-.567.08-.225.052-.459-.082-.7-.136-.243-.318-.392-.551-.442-.232-.05-.486 0-.761.154l-1.174.652.86 1.557.002-.002Zm1.574-.513 2.06 1.288-.563.314-2.012-1.314.515-.288ZM27.057 12.76c-.157-.596-.115-1.098.12-1.505.238-.409.638-.688 1.201-.843.559-.153 1.041-.114 1.45.117.407.233.688.645.845 1.24l.273 1.045c.157.595.115 1.098-.125 1.506-.24.41-.64.688-1.198.842-.564.155-1.046.115-1.452-.115-.405-.231-.686-.646-.843-1.241l-.273-1.045.002-.001Zm.815.925c.11.42.309.723.598.9.286.177.63.21 1.031.103.396-.108.675-.314.837-.614.163-.3.187-.663.077-1.084l-.287-1.097c-.11-.42-.309-.723-.597-.9-.287-.178-.629-.212-1.025-.104-.4.11-.681.315-.844.615-.162.3-.186.663-.077 1.084l.287 1.097ZM34.244 9.541l1.336 4.195h.068l1.58-4.159.966.012-.139 4.74-.545-.006.12-4.156h-.067l-1.573 4.138-.79-.01-1.33-4.175h-.068l-.12 4.156-.546-.006.137-4.738.967.012.004-.003ZM43.075 10.709c.274.08.502.207.684.379.183.171.305.379.362.62.059.242.045.5-.04.773a1.435 1.435 0 0 1-.415.665c-.19.166-.41.273-.662.319-.252.046-.513.03-.78-.05l-1.203-.355-.58 1.837-.525-.156 1.43-4.544 1.731.51-.002.002Zm-1.905 1.87 1.144.338c.3.088.556.08.775-.022.218-.104.37-.292.458-.57.085-.273.068-.511-.052-.717-.12-.205-.329-.353-.629-.44l-1.144-.34-.552 1.751ZM49.843 13.872l-.254.43-1.367-.782-2.178 3.687-.475-.272 2.179-3.687-1.372-.785.254-.43 3.213 1.839ZM54.68 22.063a.816.816 0 0 1 .396-.126.777.777 0 0 1 .823.756.813.813 0 0 1-.771.827.797.797 0 0 1-.705-.36.758.758 0 0 1-.12-.392.814.814 0 0 1 .378-.706ZM60.893 32.192l-4.26.412.198 2.438-.495.048-.244-2.985 4.756-.46.045.547ZM60.917 37.592l-4.754-.339.049-.547 4.754.339-.049.547ZM59.777 43.186l-.48-.117.604-2.288-1.575-.386-.567 2.157-.487-.12.568-2.156-2.07-.506.14-.534 4.616 1.13-.744 2.82h-.005ZM57.238 48.68l-.44-.222.734-1.411-3.79-1.9.253-.49 3.791 1.9.738-1.415.44.222-1.725 3.318-.001-.002ZM51.813 54.95a1.73 1.73 0 0 1-.695.384 1.294 1.294 0 0 1-.728-.01 1.387 1.387 0 0 1-.64-.428 1.372 1.372 0 0 1-.348-.69 1.317 1.317 0 0 1 .083-.722c.094-.237.25-.448.463-.634l.95-.837-1.265-1.426.417-.367 3.13 3.527-1.369 1.204.002-.001Zm-.582-2.565-.907.796c-.235.208-.37.43-.396.666-.027.237.052.463.244.68.188.21.402.32.643.322.241.002.48-.1.717-.306l.906-.795-1.206-1.361v-.002ZM46.667 58.407a1.728 1.728 0 0 1-.763.216 1.287 1.287 0 0 1-.697-.172 1.352 1.352 0 0 1-.515-.557 1.34 1.34 0 0 1-.166-.739 1.33 1.33 0 0 1 .254-.68 1.68 1.68 0 0 1 .601-.509l1.24-.66-.911-1.728.49-.259 2.198 4.172-1.732.92.001-.004Zm-1.398-2.185-2.033-1.33.568-.303 1.984 1.355-.52.276v.002Zm1.582-.482-1.186.628c-.28.149-.46.334-.545.556-.084.222-.062.457.068.704.13.247.31.397.542.453.23.054.485.008.764-.14l1.186-.629-.83-1.572ZM42.401 58.311c.145.598.095 1.1-.151 1.504-.246.403-.65.675-1.218.818-.561.142-1.044.093-1.447-.145-.402-.238-.675-.658-.82-1.258l-.253-1.05c-.144-.597-.092-1.1.155-1.502.246-.403.652-.676 1.213-.818.566-.143 1.048-.095 1.45.146.4.24.673.659.815 1.258l.252 1.05.004-.003Zm-.795-.94c-.103-.423-.296-.728-.578-.911-.284-.183-.626-.226-1.028-.124-.398.1-.681.299-.848.596-.167.298-.2.658-.098 1.084l.265 1.102c.103.423.297.728.578.912.284.183.624.227 1.022.126.403-.102.688-.301.855-.599.166-.298.2-.658.098-1.084l-.266-1.102ZM35.152 61.386 33.9 57.165l-.068-.002-1.664 4.127-.968-.032.234-4.736.544.017-.205 4.153.069.002 1.655-4.105.789.025 1.244 4.201.069.003.206-4.154.545.018-.235 4.737-.968-.032h.005ZM26.35 60.042a1.
1682 1.682 0 0 1-.677-.392 1.24 1.24 0 0 1-.35-.628c-.053-.245-.034-.5.057-.772.092-.275.235-.494.427-.657.192-.162.418-.264.67-.305.251-.04.512-.02.779.066l1.196.379.615-1.826.525.167-1.522 4.514-1.719-.547-.002.001Zm1.941-1.833-1.136-.36c-.296-.096-.556-.092-.775.005-.218.1-.376.286-.468.561-.092.272-.08.51.036.718.117.208.322.36.62.454l1.137.361.587-1.742v.003ZM19.643 56.74l.263-.425 1.35.81 2.252-3.642.469.28-2.253 3.643 1.356.812-.263.424-3.175-1.904v.002ZM14.98 48.456a.817.817 0 0 1-.398.119.777.777 0 0 1-.81-.77.772.772 0 0 1 .103-.4.82.82 0 0 1 .682-.414.802.802 0 0 1 .401.096.763.763 0 0 1 .297.28.757.757 0 0 1 .113.392c0 .138-.033.27-.103.396a.798.798 0 0 1-.291.301h.005Z"}))),u||(u=w.createElement("path",{d:"M29.521 31.183v1.056h1.267V31.23c0-2.581 2.04-3.778 4.43-3.778 2.345 0 4.338 1.197 4.338 3.45 0 2.018-1.031 2.886-2.837 3.637l-.797.328c-1.43.587-1.618 1.268-1.618 2.582v1.642h1.267v-1.69c0-.82.21-1.22.867-1.501l.797-.329c2.04-.844 3.587-2.135 3.587-4.575v-.188c0-2.534-2.274-4.482-5.603-4.482-3.376 0-5.698 1.713-5.698 4.857Zm4.127 10.935c0 .728.54 1.29 1.29 1.29s1.289-.562 1.289-1.29c0-.727-.54-1.29-1.29-1.29s-1.29.563-1.29 1.29Z",fill:"#000"})),h||(h=w.createElement("defs",null,w.createElement("filter",{id:"lift-prompt_svg__a",x:5.654,y:6.122,width:60.614,height:60.664,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},w.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),w.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),w.createElement("feOffset",{dx:2,dy:2}),w.createElement("feColorMatrix",{values:"0 0 0 0 0.882353 0 0 0 0 0.756863 0 0 0 0 0.901961 0 0 0 1 0"}),w.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_548_4238"}),w.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_548_4238",result:"shape"})),w.createElement("filter",{id:"lift-prompt_svg__b",x:16.204,y:16.682,width:39.513,height:39.545,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},w.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),w.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),w.createElement("feOffset",{dx:2,dy:2}),w.createElement("feColorMatrix",{values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"}),w.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_548_4238"}),w.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_548_4238",result:"shape"})),w.createElement("clipPath",{id:"lift-prompt_svg__c"},w.createElement("path",{fill:"#fff",transform:"rotate(-32.053 46.576 12.602) skewX(-.044)",d:"M0 0h49.248v51.612H0z"})))))},W=r(3109),G=r.n(W),Q=e=>{let{children:t,arrowOnLeft:r}=e;return(0,y.jsxs)("div",{className:G()["speech-bubble-ds"],children:[(0,y.jsx)("p",{children:t}),(0,y.jsx)("div",{className:r?G()["speech-bubble-ds__left-arrow"]:G()["speech-bubble-ds__arrow"]})]})},H=e=>{let{text:t,myClasses:r,arrowOnLeft:a}=e,[l,s]=(0,w.useState)(!1);return(0,y.jsx)("div",{className:r,children:(0,y.jsxs)("div",{className:"inline-block relative",children:[l&&(0,y.jsx)("div",{className:"absolute z-10 -translate-y-full\n top-4 ".concat(a?"left-3":" right-3"),children:(0,y.jsx)(Q,{arrowOnLeft:a,children:t})}),(0,y.jsx)(q,{className:"w-16 h-16 lg:w-20 lg:h-20 hover:cursor-pointer",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)})]})})},J=e=>{let{badgeText:t,subText:r,subText2:a,showLiftPromptMobile:l,showLiftPromptDesktop:s,liftPromptText:n}=e;return(0,y.jsxs)("header",{className:"container flex flex-col items-center lg:w-[840px]",children:[(0,y.jsxs)("div",{className:"relative bg-myPaleRed px-6 py-2 rounded-full",children:[(0,y.jsx)("div",{className:"px-6 py-2 rounded-full absolute w-full h-full border border-black -top-1 -left-1"}),(0,y.jsx)("h2",{className:"mb-1 mr-1 text-center",children:t}),l&&(0,y.jsx)(H,{text:n||"",myClasses:"absolute -top-0 -right-1 translate-x-1/2 -translate-y-1/2 lg:hidden z-10"})]}),(0,y.jsxs)("div",{className:"relative mt-4 lg:mt-6 text-center",children:[(0,y.jsx)("p",{children:r}),a&&(0,y.jsx)("p",{className:"mt-4",children:a}),s&&(0,y.jsx)(H,{text:n||"",myClasses:"absolute -left-11 -translate-x-full -top-9 h-20 w-20 hidden lg:block z-10",arrowOnLeft:!0})]})]})};let K=e=>{let{dashesToDisplay:t}=e;return(0,y.jsx)("div",{className:"flex items-center w-full justify-between h-full ml-4",children:[...Array(t)].map((e,t)=>(0,y.jsx)("div",{className:"text-xs font-thin h-3 overflow-y-hidden w-full grow",children:"|"},t))})};var $=e=>{let{score:t}=e;return(0,y.jsxs)("div",{children:[(0,y.jsxs)("h3",{className:"text-center mb-4 lg:mb-6",children:["Audience Strength Score: ",t>75?"Excellent":t>50?"Pretty Good":t>25?"OK":"Poor"]}),(0,y.jsx)("div",{className:"relative z-10 border border-black rounded-3xl h-12 bg-white max-w-sm lg:max-w-xl mx-auto",children:(0,y.jsx)("div",{className:"flex h-full",children:(0,y.jsxs)("div",{className:"h-full rounded-l-3xl flex items-center ".concat(t>97&&"rounded-r-3xl"),style:{backgroundColor:"#E9EB87",width:"".concat(t,"%")},children:[(0,y.jsx)(K,{dashesToDisplay:Math.floor(t/10)}),(0,y.jsx)("span",{className:"mr-2 text-lg ml-auto pl-1",children:t})]})})})]})},X=r(9580),ee=r(5187),et=r(2158),er=r(9709),ea=r(4921),el=e=>{let{dots:t,currentDot:r,incrementStep:a,decrementStep:l,goToSlide:s}=e,n=[];for(let e=0;e<t;e++)n.push(e);let o="#CCCCCC",c="#FEB094";return(0,y.jsxs)("div",{className:"flex items-center justify-center gap-5 mt-28",children:[(0,y.jsx)("button",{onClick:l,children:(0,y.jsx)(er.Z,{width:12,height:12,fill:1===r?o:c})}),n.map((e,t)=>(0,y.jsx)("button",{onClick:()=>{s(t+1)},className:"relative w-2 h-2 ".concat(r===t+1&&"bg-myPaleBlue"," rounded-full mt-1"),children:(0,y.jsx)("div",{className:"absolute -top-0.5 -left-0.5 w-full h-full rounded-full border border-black"})},t)),(0,y.jsx)("button",{onClick:a,children:(0,y.jsx)(ea.Z,{width:12,height:12,fill:r===t?o:c})})]})},es=r(5338),en=e=>{let{elements:t}=e,[r,a]=(0,w.useState)(1),l=t.length,s=(0,es.QS)({onSwipedLeft:()=>a(e=>e<l?e+1:e),onSwipedRight:()=>a(e=>e>1?e-1:e)}),n=()=>r===l?1:r+1,o=e=>{let t=e+1;return t===r?"left-2/4 -translate-x-2/4 duration-500 ease-in-out":t===n()?"right-4 translate-x-full":"left-0 -translate-x-full -translate-y-1/2"};return(0,y.jsxs)("div",{...s,children:[(0,y.jsx)("div",{className:"relative",children:t.map((e,t)=>(0,y.jsx)("div",{className:"absolute top-2/4 -translate-y-1/2 ".concat(o(t)),children:e},t))}),(0,y.jsx)("div",{className:"pt-9",children:(0,y.jsx)(el,{dots:l,currentDot:r,incrementStep:()=>{a(e=>e===l?e:e+1)},decrementStep:()=>{a(e=>1===e?e:e-1)},goToSlide:e=>{a(e)}})})]})},eo=r(5376);let ec={rotation:270,circumference:180,borderColor:"black",borderWidth:1,plugins:{legend:{dis
1play:!1},tooltip:{enabled:!1}},events:[],cutout:75};var ei=e=>{let{label:t,cohortTotal:r,storeTotal:a,percentage:l,prefixSymbol:s}=e;return(0,y.jsxs)("div",{className:"relative",children:[(0,y.jsx)("div",{className:"w-60 mx-auto",children:(0,y.jsx)(eo.$I,{data:{labels:["The Audience You Just Built","Benchmark Audience"],datasets:[{label:"# of Total Audience",data:[l,100-l],backgroundColor:["#BDD27F","white"]}]},options:ec,width:100,height:100})}),(0,y.jsxs)("div",{className:"absolute w-full -bottom-2 left-2/4 -translate-x-2/4 text-center",children:[(0,y.jsxs)("div",{className:"absolute -top-14 left-2/4 -translate-x-2/4 text-[32px] font-bold",children:[l,"%"]}),(0,y.jsx)("h3",{className:"mb-1",children:t}),(0,y.jsxs)("p",{children:[s,r," of ",s,a]})]})]},t)},ed=e=>{let{data:t}=e,r=t.map(e=>(0,y.jsx)(ei,{label:e.label,cohortTotal:e.cohortTotal,storeTotal:e.storeTotal,percentage:e.percentage,prefixSymbol:e.prefixSymbol},e.label));return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"hidden lg:flex justify-center gap-32 -mt-2",children:r.map((e,t)=>(0,y.jsx)("div",{children:e},t))}),(0,y.jsx)("div",{className:"block lg:hidden mt-24",children:(0,y.jsx)(en,{elements:r})})]})};function eu(){return(eu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}var eh=function(e){return w.createElement("svg",eu({width:"1em",height:"1em",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),m||(m=w.createElement("g",{filter:"url(#thumbs-up-circle_svg__a)"},w.createElement("circle",{cx:24,cy:24,r:24,fill:"#fff",fillOpacity:.01}),w.createElement("circle",{cx:24,cy:24,r:23.5,stroke:"#000"}))),p||(p=w.createElement("path",{d:"M18.291 21.668h-3.72a.583.583 0 0 0-.577.587V35.37c0 .323.26.587.577.587h3.72c.924 0 1.702-.587 2.02-1.409 1.067.411 2.509.822 3.605 1.115a8.1 8.1 0 0 0 2.221.294H31.3c1.154 0 2.106-.968 2.106-2.142a2.34 2.34 0 0 0-.289-1.086 1.997 1.997 0 0 0 1.356-1.907c0-.587-.26-1.115-.664-1.496.318-.353.49-.822.49-1.35 0-.411-.115-.822-.345-1.145.577-.352.952-.997.952-1.701 0-1.116-.895-1.996-1.962-1.996h-4.557c.375-.998.577-2.406.692-3.55.058-.676-.029-1.321-.317-1.879-.837-1.643-2.394-1.584-2.856-1.526a.896.896 0 0 0-.75.705c-1.067 4.988-3.75 6.015-4.845 6.22a2.102 2.102 0 0 0-2.02-1.437Zm1.01 12.089c0 .558-.461 1.027-1.01 1.027h-3.143V22.84h3.143c.549 0 1.01.47 1.01 1.027v9.889Zm6.923-16.432c.461 0 1.096.117 1.5.91.173.352.26.792.202 1.232-.173 1.702-.49 3.11-.808 3.668h-1.5a.584.584 0 0 0-.577.587c0 .322.26.586.577.586h7.298c.461 0 .807.382.807.822 0 .44-.375.822-.807.822h-1.298a.583.583 0 0 0-.577.586c0 .323.26.587.577.587h.692c.461 0 .836.382.836.851 0 .47-.375.85-.836.85l-.923.001a.584.584 0 0 0-.577.587c0 .323.26.587.577.587h1.153c.433 0 .808.352.808.822s-.346.821-.808.821h-1.327a.583.583 0 0 0-.576.587c0 .323.259.587.576.587h.087a.969.969 0 0 1 0 1.936h-5.163a7.147 7.147 0 0 1-1.932-.263c-.98-.264-2.654-.734-3.75-1.203v-9.009c1.327-.234 4.528-1.379 5.769-6.954ZM27.695 14.127v-2.054a.584.584 0 0 0-.577-.587.584.584 0 0 0-.577.587v2.054c0 .322.26.586.577.586a.583.583 0 0 0 .577-.586ZM30.896 15.799l1.212-1.232a.574.574 0 0 0 0-.822.551.551 0 0 0-.808 0l-1.211 1.232a.574.574 0 0 0 0 .822c.115.117.26.176.403.176a.563.563 0 0 0 .404-.176ZM23.714 15.975a.565.565 0 0 0 .404-.176.574.574 0 0 0 0-.822l-1.211-1.232a.551.551 0 0 0-.808 0 .574.574 0 0 0 0 .822l1.211 1.232c.116.117.26.176.404.176Z",fill:"#000"})),x||(x=w.createElement("defs",null,w.createElement("filter",{id:"thumbs-up-circle_svg__a",x:0,y:0,width:50,height:50,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},w.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),w.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),w.createElement("feOffset",{dx:2,dy:2}),w.createElement("feColorMatrix",{values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"}),w.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_548_4337"}),w.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_548_4337",result:"shape"})))))};function em(){return(em=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}var ep=function(e){return w.createElement("svg",em({width:"1em",height:"1em",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"}
1,e),f||(f=w.createElement("g",{filter:"url(#thumbs-down-circle_svg__a)"},w.createElement("circle",{cx:24,cy:24,r:24,fill:"#fff",fillOpacity:.01}),w.createElement("circle",{cx:24,cy:24,r:23.5,stroke:"#000"}))),g||(g=w.createElement("path",{d:"M19.291 31.463h-3.72a.583.583 0 0 1-.577-.587V17.76c0-.323.26-.587.577-.587h3.72c.924 0 1.702.587 2.02 1.409 1.067-.411 2.509-.822 3.605-1.115a8.1 8.1 0 0 1 2.221-.294H32.3c1.154 0 2.106.968 2.106 2.142 0 .381-.116.763-.289 1.086a1.997 1.997 0 0 1 1.356 1.907c0 .587-.26 1.115-.664 1.496.318.352.49.822.49 1.35 0 .41-.115.822-.345 1.145.577.352.952.997.952 1.701 0 1.116-.895 1.996-1.962 1.996h-4.557c.375.998.577 2.406.692 3.55.058.675-.029 1.321-.317 1.879-.837 1.643-2.394 1.584-2.856 1.525a.896.896 0 0 1-.75-.704c-1.067-4.988-3.75-6.015-4.845-6.22a2.102 2.102 0 0 1-2.02 1.437Zm1.01-12.09c0-.557-.461-1.026-1.01-1.026h-3.143v11.942h3.143c.549 0 1.01-.469 1.01-1.027v-9.888Zm6.923 16.433c.461 0 1.096-.117 1.5-.91.173-.352.26-.792.202-1.232-.173-1.702-.49-3.11-.808-3.668h-1.5a.583.583 0 0 1-.577-.587c0-.323.26-.587.577-.587h7.298a.813.813 0 0 0 .807-.821c0-.44-.375-.822-.807-.822h-1.298a.583.583 0 0 1-.577-.587c0-.322.26-.586.577-.586h.692a.844.844 0 0 0 .836-.851c0-.47-.375-.851-.836-.851h-.923a.583.583 0 0 1-.577-.587c0-.323.26-.587.577-.587h1.153a.813.813 0 0 0 .808-.822c0-.47-.346-.821-.808-.821h-1.327a.583.583 0 0 1-.576-.587c0-.323.259-.587.576-.587h.087a.969.969 0 0 0 0-1.936h-5.163c-.663 0-1.298.087-1.932.263-.98.264-2.654.734-3.75 1.203v9.009c1.327.234 4.528 1.379 5.769 6.954Z",fill:"#000"})),v||(v=w.createElement("defs",null,w.createElement("filter",{id:"thumbs-down-circle_svg__a",x:0,y:0,width:50,height:50,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},w.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),w.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),w.createElement("feOffset",{dx:2,dy:2}),w.createElement("feColorMatrix",{values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"}),w.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_756_4395"}),w.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_756_4395",result:"shape"})))))},ex=r(6951),ef=e=>{let{label:t,newAudienceVal:r,currentAudienceVal:a,preVal:l}=e;return(0,y.jsxs)("div",{className:"relative",style:{height:180,width:180},children:["number"==typeof r&&"number"==typeof a?r>=a?(0,y.jsx)(eh,{className:"absolute -top-1 -right-1 w-12 h-12"}):(0,y.jsx)(ep,{className:"absolute -top-1 -right-1 w-12 h-12"}):"",(0,y.jsxs)("div",{className:"ring-1 ring-black rounded-full w-full h-full",children:[(0,y.jsxs)("div",{className:"bg-myAvocado rounded-t-full border-b border-black flex justify-center items-center flex-col pt-2",style:{height:90,width:180},children:[(0,y.jsx)("div",{className:"text-[13px] mb-1",children:"YOUR AUDIENCE"}),(0,y.jsx)("div",{className:"font-bold text-3xl",children:"string"==typeof r?r:"".concat(null!=l?l:"").concat((0,ex.p)(r))})]}),(0,y.jsxs)("div",{className:"bg-myAqua rounded-b-full flex justify-center items-center flex-col pb-2",style:{height:90,width:180},children:[(0,y.jsx)("div",{className:"font-bold text-3xl mb-1",children:"string"==typeof a?a:"".concat(null!=l?l:"").concat((0,ex.p)(a))}),(0,y.jsx)("div",{className:"text-[13px]",children:"BENCHMARK"})]})]}),(0,y.jsx)("h3",{className:"text-center mt-4",children:t})]})},eg=e=>{let{data:t}=e,r=t.map(e=>(0,y.jsx)(ef,{label:e.label,newAudienceVal:e.cohortAv,currentAudienceVal:e.storeAv,preVal:e.prefixSymbol},e.label));return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"hidden lg:flex justify-center gap-48",children:r.map((e,t)=>(0,y.jsx)("div",{children:e},t))}),(0,y.jsx)("div",{className:"block lg:hidden mt-24",children:(0,y.jsx)(en,{elements:r})})]})},ev=e=>{var t,r,a,l,s;let{apiQueryString:n}=e,o=(0,w.useContext)(j),c="".concat(X.z0,"/api/dashboard/audience-impact?").concat(n),i=(0,et.Z)(c),d=(0,w.useMemo)(()=>{var e,t;return null!==(t=null===(e=i.data)||void 0===e?void 0:e.percentagesData)&&void 0!==t?t:[]},[null===(t=i.data)||void 0===t?void 0:t.percentagesData]),u=null!==(s=null===(r=i.data)||void 0===r?void 0:r.averagesData)&&void 0!==s?s:[],h=(null===(a=i.data)||void 0===a?void 0:a.audienceStrengthScore)?parseFloat(null===(l=i.data)||void 0===l?void 0:l.audienceStrengthScore):0,{isLoading:m,errorMsg:p,shouldDisplayErrorMsg:x}=i;if(console.log("Aud imp:"),console.log(c),console.log(d),console.log(u),(0,w.useEffect)(()=>
1{if(d.length>0){let e;null==o||o.updateCohortTotalAudience((e=0,d.forEach(t=>{"% of Total Audience"===t.label&&(e=parseInt(t.cohortTotal.replace(/,/g,"")))}),e))}},[o,d]),m)return(0,y.jsx)(ee.Z,{height:45,width:45});let f="Looking for an Audience Strength Score of 30+ and 2-3 Thumbs Ups is a good indicator to continue your analysis. We want to make sure analyzing this customer segment could help you see a meaningful revenue increase in your store. If you see an Audience Strength Score of less than 30, you may want to try creating a new segment thatâs strong enough to make an impact.";return(0,y.jsxs)("section",{className:"mt-12 lg:mt-16",children:[(0,y.jsx)(J,{badgeText:"Audience Impact",subText:"First, letâs check the size and revenue impact of your selected customer segment compared to your full store performance during this time period.",liftPromptText:"Across these metrics, is this audience performing better or worse than your average customer?",showLiftPromptDesktop:!0,showLiftPromptMobile:!0}),""!==p?(0,y.jsxs)("p",{className:"container text-center text-red-400 text-sm mt-10",children:["Error: ",p]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(ed,{data:d}),(0,y.jsxs)("div",{className:"container mt-12 lg:mt-14",children:[(0,y.jsx)($,{score:h}),(0,y.jsx)(H,{text:"The Audience Strength score helps you determine if the Audience You Just Built is currently making a big impact on your store's revenue. The score factors in the results of the Audience Impact metrics and gives bonus points where the Audience You Just Built exceeds a store average.",arrowOnLeft:!0,myClasses:"mt-6 sm:mt-0"})]}),(0,y.jsxs)("div",{className:"mt-12 lg:mt-24",children:[(0,y.jsxs)("div",{className:"container relative",children:[(0,y.jsx)("p",{className:"text-center pb-8 lg:pb-10",children:"Next, letâs compare the selected customer segment to your average customer during this time period."}),(0,y.jsx)("div",{className:"lg:hidden absolute -bottom-12 sm:left-12",children:(0,y.jsx)(H,{text:f,arrowOnLeft:!0})})]}),(0,y.jsx)(eg,{data:u}),(0,y.jsx)("div",{className:"hidden lg:flex justify-end mt-8 xl:pr-14",children:(0,y.jsx)(H,{text:f})})]}),(0,y.jsx)(F,{myClasses:"mt-12 lg:mt-16"})]})]})},eb=r(3655);let ey=e=>{let{rows:t,columnWidths:r}=e;return(0,y.jsx)("tbody",{className:"w-full",children:t.map((e,t)=>(0,y.jsx)("tr",{children:e.map((a,l)=>(0,y.jsx)("td",{className:"text-sm lg:text-base font-normal text-start px-2 sm:px-5 lg:px-6 py-5 ".concat(t!==e.length&&"border-b border-[#CCC]"," ").concat(r&&r[l]),children:a},l))},t))})},ew=e=>{let{headers:t,columnWidths:r}=e;return(0,y.jsx)("thead",{className:"border-b border-black",children:(0,y.jsx)("tr",{children:t.map((e,t)=>(0,y.jsx)("th",{className:"text-[13px] font-normal text-start px-2 sm:px-5 lg:px-6 py-1.5 ".concat(r&&r[t]),children:e},e))})})};var ej=e=>{let{title:t,headers:r,rows:a,myClasses:l,columnWidths:s}=e;return(0,y.jsxs)("div",{className:"border border-black self-start lg:max-w-2xl ".concat(l),children:[(0,y.jsx)("div",{className:"bg-myAqua px-2 sm:px-5 lg:px-6 py-5",children:(0,y.jsx)("h3",{className:"font-bold text-lg",children:t})}),(0,y.jsxs)("table",{className:"bg-white w-full table-fixed",children:[(0,y.jsx)(ew,{headers:r,columnWidths:s}),(0,y.jsx)(ey,{rows:a,columnWidths:s})]})]})};let e_=(0,w.createContext)(null);function eN(e){return e?e.storeCurrency.symbol:"$"}var eC=e=>{var t;let{apiQueryString:r,orderNumber:a,tableTitle:l,myClasses:s}=e,n=eN((0,w.useContext)(e_)),o="".concat(X.z0,"/api/dashboard/most-popular-nth-product2?").concat(r,"&product_order_number=").concat(a),c=(0,et.Z)(o),i=null!==(t=c.data)&&void 0!==t?t:[],{isLoading:d,errorMsg:u,shouldDisplayErrorMsg:h}=c;console.log("Most pop 1st prod:"),console.log(i,u);let m=0===i.length?[["No customers made a ".concat(L(a)," purchase.")]]:i.map((e,t)=>["".concat(t+1,". ").concat(e.product_title),n+(0,ex.p)(e.av_price),n+(0,ex.p)(e.av_cart_value),(0,ex.p)(e.quantity_sold,0)]);return d?(0,y.jsx)(ee.Z,{height:30,width:30}):(0,y.jsx)(y.Fragment,{children:h()?(0,y.jsxs)("p",{className:"text-center text-sm text-red-400",children:["Error: ",u]}):(0,y.jsx)(ej,{title:l,headers:["PRODUCT","CURRENT LIST PRICE","AVG. CART VALUE","QUANTITY SOLD"],rows:m,myClasses:s,columnWidths:["xl:w-5/12 w-4/12","w-auto","w-auto","w-auto"]})})},eE=e=>{var t;let{apiQueryString:r,tableClasses:a}=e,l=eN((0,w.useContext)(e_)),s="".concat(X.z0,"/api/dashboard/items-purchased-together?").concat(r),n=(0,et.Z)(s),o=null!==(t=n.data)&&void 0!==t?t:[],{isLoading:c,errorMsg:i,shouldDisplayErrorMsg:d}
1=n,u=0===o.length?[["No product combos found for this audience."]]:o.map((e,t)=>["".concat(t+1,". ").concat(e.product_title1," (").concat((0,ex.A)(parseFloat(e.product_min_price1),parseFloat(e.product_max_price1),l,2,!0),") & ").concat(e.product_title2," (").concat((0,ex.A)(parseFloat(e.product_min_price2),parseFloat(e.product_max_price2),l,2,!0),")")]);return c?(0,y.jsx)(ee.Z,{height:30,width:30}):(0,y.jsx)(y.Fragment,{children:d()?(0,y.jsxs)("p",{className:"text-center text-sm text-red-400",children:["Error: ",i]}):(0,y.jsx)(ej,{title:"Products Most Commonly Purchased Together",headers:["PRODUCT COMBO"],rows:u,myClasses:a})})},eM=e=>{var t;let{apiQueryString:r,tableClasses:a}=e,l=eN((0,w.useContext)(e_)),s="".concat(X.z0,"/api/dashboard/most-popular-product-type2?").concat(r),n=(0,et.Z)(s),o=null!==(t=n.data)&&void 0!==t?t:[],{isLoading:c,errorMsg:i,shouldDisplayErrorMsg:d}=n;console.log("Most pop product types:"),console.log(o);let u=0===o.length?[["No product types found for this audience."]]:o.map((e,t)=>["".concat(t+1,". ").concat(e.product_type),l+(0,ex.p)(e.av_product_price),l+(0,ex.p)(e.av_cart_value),(0,ex.p)(e.quantity_sold,0)]);return c?(0,y.jsx)(ee.Z,{height:30,width:30}):(0,y.jsx)(y.Fragment,{children:d()?(0,y.jsxs)("p",{className:"text-center text-sm text-red-400",children:["Error: ",i]}):(0,y.jsx)(ej,{title:"Most Popular Product Type",headers:["PRODUCT TYPE","AVG. PRICE","AVG. CART VALUE","QUANTITY SOLD"],rows:u,myClasses:a,columnWidths:["xl:w-5/12 w-4/12","w-auto","w-auto","w-auto"]})})},ek=r(9950),eS=e=>{let{apiQueryString:t}=e;return(0,y.jsxs)("section",{className:"mt-16 lg:mt-20",children:[(0,y.jsx)("div",{className:"container mb-12",children:(0,y.jsx)(J,{badgeText:"Purchase Patterns",subText:"Do you know what your customers typically buy with their first or second purchases? Or what they buy together? Knowing these details can help you market the right products at the right time to new and existing customers.",subText2:"Question to ask yourself: Do the products Iâm advertising to my prospective customers and marketing to my existing customers match the top products and product types shown below?",liftPromptText:"This is one of our favorite insight groups! Consider what your audience does naturally and help them do more of that. For example, what does this audience like to âbundleâ together? Is there opportunity for you to turn that into potentially a bundled product in your store? And what is the product you should be remarketing to your existing customers after their first purchase (the most likely second purchase)?",showLiftPromptMobile:!0,showLiftPromptDesktop:!0})}),(0,y.jsxs)("div",{className:"hidden lg:grid lg:container grid-cols-2 gap-10",children:[(0,y.jsx)(eC,{tableTitle:"Most Popular 1st Product Purchased",apiQueryString:t,orderNumber:1}),(0,y.jsx)(eC,{tableTitle:"Most Popular 2nd Product Purchased",apiQueryString:t,orderNumber:2}),(0,y.jsx)(eM,{apiQueryString:t}),(0,y.jsx)(eE,{apiQueryString:t})]}),(0,y.jsx)("div",{className:"lg:hidden",children:(0,y.jsxs)(eb.Z,{children:[(0,y.jsx)("div",{className:"mx-3",children:(0,y.jsx)(eC,{tableTitle:"Most Popular 1st Product Purchased",apiQueryString:t,orderNumber:1,myClasses:"max-w-xl mx-auto"})}),(0,y.jsx)("div",{className:"mx-3",children:(0,y.jsx)(eC,{tableTitle:"Most Popular 2nd Product Purchased",apiQueryString:t,orderNumber:2,myClasses:"max-w-xl mx-auto"})}),(0,y.jsx)("div",{className:"mx-3",children:(0,y.jsx)(eM,{apiQueryString:t,tableClasses:"max-w-xl mx-auto"})}),(0,y.jsx)("div",{className:"mx-3",children:(0,y.jsx)(eE,{apiQueryString:t,tableClasses:"max-w-xl mx-auto"})})]})}),(0,y.jsx)("div",{className:"mt-16",children:(0,y.jsx)(ek.Z,{badgeText:"LIFT TIP",text:"If there are products purchased in the 1st or 2nd Purchase by this audience that arenât the products you are actively marketing, consider launching new paid advertising featuring these products or building an email or SMS campaign that highlights these individual products or bundling products already often purchased together."})}),(0,y.jsx)(F,{myClasses:"mt-12 lg:mt-24"})]})};
1let eO={id:"canvasBackgroundColor",beforeDraw(e,t,r){let{ctx:a,chartArea:{top:l,bottom:s,left:n,right:o,width:c},scales:{x:i,y:d}}=e;a.save(),a.fillStyle="rgb(255, 255, 255)",a.fillRect(n,d._startPixel,c,d.height),a.restore()}},eZ=e=>({id:"chartAreaBorder",beforeDraw(t,r,a){let{ctx:l,chartArea:{left:s,top:n,width:o,height:c}}=t;l.save(),l.strokeStyle=a.borderColor,l.lineWidth=a.borderWidth,l.setLineDash(a.borderDash||[]),l.lineDashOffset=a.borderDashOffset,l.strokeRect(s,n+(null!=e?e:0),o,c),l.restore()}}),eA={responsive:!0,maintainAspectRatio:!1,scales:{y:{title:{display:!0,text:"Orders",font:{weight:"bold",size:13}},ticks:{font:{size:13}}},x:{title:{display:!0,text:"Weeks",font:{weight:"bold",size:13}},ticks:{font:{size:13}}}},plugins:{legend:{position:"bottom"},tooltip:{callbacks:{label:e=>"".concat(e.dataset.label,": ").concat(e.formattedValue," ").concat(1===parseFloat(e.formattedValue)?"order":"orders"),title:e=>(console.log(e[0]),"Week ".concat(e[0].label))}}}};[...Array(25).keys()];var eF=e=>{let{data1:t,data2:r,weekLabels:a}=e;return(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(eo.x1,{options:eA,data:{labels:a,datasets:[{label:"The Audience You Just Built",data:t,backgroundColor:"#BDD27F",borderColor:"#BDD27F",pointRadius:5,pointBorderColor:"black"},{label:"All Store Orders",data:r,backgroundColor:"#95C8C5",borderColor:"#95C8C5",pointRadius:5,pointBorderColor:"black"}]},plugins:[eZ(),eO],height:"100%",width:"100%"})})},eT=e=>{var t,r,a,l;let{apiQueryString:s}=e,n="".concat(X.z0,"/api/dashboard/orders-over-time?").concat(s),o=(0,et.Z)(n),c=null!==(a=null===(t=o.data)||void 0===t?void 0:t.cohort)&&void 0!==a?a:[],i=null!==(l=null===(r=o.data)||void 0===r?void 0:r.store)&&void 0!==l?l:[],{isLoading:d,errorMsg:u,shouldDisplayErrorMsg:h}=o;console.log("Orders over time:"),console.log(n),console.log(c,u),console.log(i);let m=c.map(e=>parseFloat(e.weekly_orders)),p=i.map(e=>parseFloat(e.weekly_orders)),x=[...Array(p.length).keys()];return d?(0,y.jsx)(ee.Z,{height:35,width:35}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h3",{className:"mb-1 text-center",children:"Number of Orders Over Time"}),h()?(0,y.jsx)("p",{className:"container text-center text-red-400 text-sm mt-10",children:u}):(0,y.jsx)("div",{className:"max-w-7xl mx-auto",style:{height:433},children:(0,y.jsx)(eF,{data1:m,data2:p,weekLabels:x})})]})},eD=e=>{let{apiQueryString:t}=e;return(0,y.jsxs)("section",{className:"mt-12 lg:mt-24",children:[(0,y.jsx)(J,{badgeText:"Purchase History",subText:"Compare the number of orders made each week in the Audience You Just Built to all the orders from your store during this time period."}),(0,y.jsx)("div",{className:"lg:container mt-12",children:(0,y.jsx)(eT,{apiQueryString:t})})]})},eB=r(1664),eP=r.n(eB),eI=e=>{let{openSaveAudienceModal:t}=e;return(0,y.jsxs)("footer",{className:"pt-16 lg:pt-20 pb-32 lg:pb-28",children:[(0,y.jsx)("div",{className:"text-center",children:(0,y.jsx)(S.Z,{size:"sm",Svg:O.Z,bg:"secondary",onClick:t,children:"Save This Audience"})}),(0,y.jsx)(F,{myClasses:"mt-12 lg:mt-16"}),(0,y.jsx)("p",{className:"p-large text-center mt-12 lg:mt-20 max-w-xs mx-auto lg:max-w-full",children:"Ready to create your next customer segment?"}),(0,y.jsx)("div",{className:"text-center",children:(0,y.jsx)(eP(),{href:"/select-audience",legacyBehavior:!0,children:(0,y.jsx)("span",{children:(0,y.jsx)(S.Z,{myClasses:"mt-6 lg:mt-10",children:"Let's Go!"})})})})]})},eR=r(5007),eL=r(9048),eV=r(4761),eU=r(7375);function ez(){return(ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}var eY=function(e){return w.createElement("svg",ez({width:"1em",height:"1em",viewBox:"0 0 20 14",xmlns:"http://www.w3.org/2000/svg"},e),b||(b=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 7c1.93 0 3.5-1.57 3.5-3.5S8.93 0 7 0 3.5 1.57 3.5 3.5 5.07 7 7 7Zm-7 5.25c0-2.33 4.66-3.5 7-3.5s7 1.17 7 3.5V14H0v-1.75Zm7-1.5c-1.79 0-3.82.67-4.66 1.25h9.32c-.84-.58-2.87-1.25-4.66-1.25ZM8.5 3.5C8.5 2.67 7.83 2 7 2s-1.5.67-1.5 1.5S6.17 5 7 5s1.5-.67 1.5-1.5Zm5.54 5.31c1.16.84 1.96 1.96 1.96 3.44V14h4v-1.75c0-2.02-3.5-3.17-5.96-3.44ZM16.5 3.5C16.5 5.43 14.93 7 13 7c-.54 0-1.04-.13-1.5-.35.63-.89 1-1.98 1-3.15s-.37-2.26-1-3.15C11.96.13 12.46 0 13 0c1.93 0 3.5 1.57 3.5 3.5Z",fill:"inherit"})))},eq=r(9669),eW=r.n(eq),eG=r(4202);let eQ=()=>{let[e,t]=(0,w.useState)(""),[r,a]=(0,w.useState)(""),[l,s]=(0,w.useState)(!1),[n,o]=(0,w.useState)(""),c=(0,w.useContext)(j),{cohortSettings:i}=P(),d=async t=>{if(t.preventDefault(),console.log("Submittitng!"),s(!0),a(""),o(""),console.log("Size: ",null==c?void 0:c.cohortTotalAudience),console.log("cohort settings: "),console.log(i),!c||void 0===(null==c?void 0:c.cohortTotalAudience)){a("No audience found."),s(!1);return}if(!i){a("Unable to find the cohort settings."),s(!1);return}if(!e){a("Please enter a name for your audience"),s(!1);return}if(e.length>250){a("Audience name must be less than 250 characters"),s(!1);return}let r={...i,audienceName:e,audienceSize:c.cohortTotalAudience};try{await (0,eG.z)();let e=await eW().post(X.z0+"/api/saved-audience",r,{withCredentials:!0});console.log(e.data),o("Saved successfully.")}catch(e){var l,n,d,u;console.log(e),eW().isAxiosError(e)&&(null===(n=e.response)||void 0===n?void 0:null===(l=n.data)||void 0===l?void 0:l.message)?a(null===(u=e.response)||void 0===u?void 0:null===(d=u.data)||void 0===d?void 0:d.message):a("Whoops, something went wrong.")}s(!1)};return(0,y.jsxs)("form",{onSubmit:d,className:"mt-6",children:[(0,y.jsx)(eV.Z,{inputType:"text",value:e,onCh
1ange:e=>{t(e.currentTarget.value)},label:"AUDIENCE NAME",placeholder:"i.e. June Newsletter Subscribers",errorMsg:r,Svg:eY}),(0,y.jsx)("p",{className:"text-green-600 ml-0.5 mt-1",children:n}),(0,y.jsx)("div",{className:"text-center",children:(0,y.jsx)(S.Z,{size:"sm",type:"submit",myClasses:"mt-6 mb-7",Svg:eU.Z,isLoading:l,children:"Save Audience"})})]})};var eH=e=>{let{isOpen:t,openModal:r,closeModal:a}=e;return(0,y.jsx)(eR.u,{appear:!0,show:t,as:w.Fragment,children:(0,y.jsxs)(eL.V,{as:"div",className:"relative z-50",onClose:a,children:[(0,y.jsx)(eR.u.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,y.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-60"})}),(0,y.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,y.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,y.jsx)(eR.u.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,y.jsxs)(eL.V.Panel,{className:"w-full max-w-md transform overflow-hidden bg-myBeige border border-white text-left align-middle transition-all",children:[(0,y.jsx)(eL.V.Title,{as:"h3",className:"border-b border-black py-8 px-10 p-large text-center",children:"What would you like to name this audience?"}),(0,y.jsxs)("div",{className:"px-10 pb-11",children:[(0,y.jsx)(eQ,{}),(0,y.jsx)("button",{onClick:a,className:"underline text-sm mx-auto block",children:"Cancel"})]})]})})})})]})})},eJ=r(6884),eK=r(3922),e$=r(9008),eX=r.n(e$);let e0=()=>(0,y.jsx)("div",{className:"relative",children:(0,y.jsx)("div",{className:"hidden lg:block absolute -bottom-0 translate-y-full -left-2 -translate-x-2/4 xl:-translate-x-full z-10",children:(0,y.jsx)(H,{text:"You can click on the audience below the graph to remove or isolate one group in the chart, making it a bit easier to track how they behave. Hovering over the bar will also show the average order size for that particular order.",arrowOnLeft:!0})})});var e1=()=>(0,y.jsxs)("div",{className:"container",children:[(0,y.jsx)(J,{badgeText:"Purchase Journey",subText:"Learning how often your customers buy can help you better understand their buying habits and if thereâs an opportunity to increase their purchase frequency."}),(0,y.jsx)(e0,{})]}),e2=()=>{let[e,t]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{let{innerWidth:e}=window;e<X.YC&&t(!0)},[]),(0,w.useEffect)(()=>{window.addEventListener("resize",()=>{let{innerWidth:r}=window;console.log("inner width: ",r),r<X.YC&&!e?t(!0):r>=X.YC&&e&&t(!1)})},[e]),e};let e4=e=>{let{dollarValue:t,timeframe:r}=e,a=eN((0,w.useContext)(e_));return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"font-bold text-xs lg:text-lg text-center",children:[a,(0,ex.p)(t)]}),(0,y.jsx)("div",{className:"text-center text-[10px] leading-3 lg:leading-4 lg:text-[13px]",children:r})]})};var e5=e=>{let{dollarValue:t,timeframe:r,circleIndex:a}=e,[l,s]=(0,w.useState)(),n=e=>{void 0===l&&s(e)},o=e=>{void 0!==l&&s(void 0)};return(0,y.jsxs)("div",{className:"relative text-center hover:cursor-pointer",onMouseEnter:()=>n(a),onMouseLeave:()=>o(a),onTouchStart:()=>console.log("Touch start"),onTouchEnd:()=>console.log("Touch end"),children:["?",l===a&&(0,y.jsx)("div",{className:"absolute bg-white border border-black p-1 py-2 lg:p-3 -top-1 lg:-top-3 -translate-y-full right-1/2 translate-x-1/2 lg:right-auto lg:translate-x-0 w-20",children:(0,y.jsx)(e4,{dollarValue:t,timeframe:r})})]})};let e3={small:270,large:320},e7={small:420,large:555};var e8=e=>{let{color:t,data:r,small:a}=e,l=(0,w.useRef)(null),[s,n]=(0,w.useState)(419),o=e2();(0,w.useEffect)(()=>{o?a?n(e3.small):n(e3.large):a?n(e7.small):n(e7.large)},[o,a]);let c=(e=>{let t=[];for(let r=0;r<e.length;r++){if(r>0&&e[r-1].avValuePerCustomer>e[r].avValuePerCustomer)continue;let a=(s-(s/e.length*r+1))/2-2;t.push(a)}return t})(r);console.log("Radii: "),console.log(c),(0,w.useEffect)(()=>
1{if(l.current){let e=l.current.getContext("2d");if(e){let r="aqua"===t?["#95C8C5","#A8D6D3","#BCE3E1","#E2F8F6","#FFFFFF"]:["#BDD27F","#CBDB9C","#D9E4B7","#EEF4D9","#FFFFFF"];c.forEach((t,a)=>{e.beginPath(),e.arc(t+2,s/2,t,0,2*Math.PI,!0),e.fillStyle=r[a],e.fill(),e.strokeStyle="black",e.stroke()})}}},[t,s,c]);let i=(e,t)=>t===c.length-1?2*e:2*e-2*c[t+1];return(0,y.jsxs)("div",{className:"relative",children:[c.map((e,t)=>(0,y.jsx)("div",{className:"absolute -translate-y-1/2 -translate-x-full",style:{top:s/2,left:2*e,width:i(e,t)},children:!o&&65>i(e,t)||o&&45>i(e,t)?(0,y.jsx)(e5,{dollarValue:r[r.length-1-t].avValuePerCustomer,timeframe:r[r.length-1-t].timeframe,circleIndex:t}):(0,y.jsx)(e4,{dollarValue:r[r.length-1-t].avValuePerCustomer,timeframe:r[r.length-1-t].timeframe})},t)),(0,y.jsx)("canvas",{ref:l,width:s,height:s})]})};let e6=["First-purchase AOV","60-DAY","90-DAY","6-MO","1-YR"];var e9=e=>{var t,r;let{apiQueryString:a}=e,l="".concat(X.z0,"/api/dashboard/lifetime-value2?").concat(a),s=(0,et.Z)(l),[n,o]=(0,w.useState)(!0),[c,i]=(0,w.useState)(!0),d=(0,w.useMemo)(()=>{var e,t;return null!==(t=null===(e=s.data)||void 0===e?void 0:e.cohort)&&void 0!==t?t:[]},[null===(t=s.data)||void 0===t?void 0:t.cohort]),u=(0,w.useMemo)(()=>{var e,t;return null!==(t=null===(e=s.data)||void 0===e?void 0:e.store)&&void 0!==t?t:[]},[null===(r=s.data)||void 0===r?void 0:r.store]),{isLoading:h,errorMsg:m,shouldDisplayErrorMsg:p}=s,x=e=>{if(0===e.length)return[];let t=[];for(let r=0;r<e6.length;r++)t.push({timeframe:e6[r],avValuePerCustomer:parseFloat(e[r].strata_ltv)});return t},f=e=>{let t=[];for(let r=0;r<e.length&&(!(r>0)||!(e[r-1].avValuePerCustomer>e[r].avValuePerCustomer));r++)t.push(e[r]);return t},g=x(d),v=x(u),b=f(g),j=f(v);return((0,w.useEffect)(()=>{(()=>{if(0===b.length||0===j.length)return;let e=b[b.length-1].avValuePerCustomer,t=j[j.length-1].avValuePerCustomer;e>t?(console.log("Cohort is larger!"),console.log(e,t),o(!1),i(!0)):e<t?(console.log("Cohort is smaller!"),console.log(e,t),o(!0),i(!1)):(console.log("Cohort and StoreAv have equal LTVs."),console.log(e,t),o(!0),i(!0))})()},[d,u,b,j]),h)?(0,y.jsx)(ee.Z,{height:35,width:35}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"relative container max-w-4xl mx-auto",children:[(0,y.jsx)("h3",{className:"text-center",children:"Lifetime Value"}),(0,y.jsx)("p",{className:"text-center mt-3",children:"Knowing the lifetime value of a customer segment is vital to growing your business. You canât wait 5-years for a customer to spend more so weâve analyzed more realistic timeframes to show their impact on your business within a 1-year period."}),(0,y.jsx)("p",{className:"text-center mt-3",children:"Question to ask yourself: What would you change about the marketing content or frequency with this customer group to more quickly increase LTV within a 60-day or 90-day window?"}),(0,y.jsx)("div",{className:"absolute -bottom-2 right-4 translate-y-full lg:right-4 xl:-right-8 lg:translate-x-full z-10",children:(0,y.jsx)(H,{text:"Each ring represents an additional purchase window from the day of your customerâs original purchase. You can see how this audience is behaving at each stop on their journey, and learn if there are stages you should be focused on nurturing."})})]}),p()?(0,y.jsx)("p",{className:"container text-center text-red-400 mt-10 text-sm",children:m}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"flex flex-col lg:flex-row justify-center items-center gap-4 xl:gap-9 mt-14 lg:mt-9 mb-2 overflow-x-auto",children:[(0,y.jsx)(e8,{data:b,color:"avocado",small:n}),(0,y.jsx)("span",{className:"p-large",children:"vs"}),(0,y.jsx)(e8,{color:"aqua",data:j,small:c})]}),(0,y.jsx)("div",{className:"mt-16",children:(0,y.jsx)(ek.Z,{badgeText:"LIFT TIP",text:"If you see a 10%+ increase in your 60-day or 90-day LTV, consider revisiting your Cost per Acquisition goal in paid advertising. Would you be willing to acquire customers at a higher cost and/or with a lower first purchase ROAS if you have confidence this segment will spend more within three months of their first purchase? "})})]})]})},te=r(6775),tt=r(6429);te.kL.register(te.f$,te.od,te.u,te.De);var tr=e=>{let{bubbleSet1:t,bubbleSet2:r}=e,a=eN((0,w.useContext)(e_));return(0,y.jsx)(eo.xj,{options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{beginAtZero:!0,title:{display:!0,text:"Weeks (since 1st order)",font:{weight:"bold",size:13}}},y:{beginAtZero:!0,title:{display:!0,text:"AOV ($)",font:{weight:"bold",size:13}}}},plugins:{legend:{position:"bottom"},chartAreaBorder:{borderColor:"black",borderWidth:1},datalabels:{labels:{index:{font:{size:13,weight:"bold"},color:"black",formatter:(e,t)=>L(t.dataIndex+1),anchor:()=>"center",align:()=>"center"}}},tooltip:{callbacks:{label:e=>{let{dataIndex:t}=e,r=e.raw,l=0;if(t>0){let r=e.dataset.data[t-1];l=parseFloat(e.dataset.data[t].x)-parseFloat(r.x)}return["# of Customers: ".concat(r.numberOfCustomers),"AOV: ".concat(a).concat(r.y),"Weeks since last purchase: ".concat(l.toFixed(1))]}}}}},data:{datasets:[{label:"The Audience You Just Built",data:t,backgroundColor:"rgba(189, 210, 127, 0.5)",borderColor:["black"],borderWidth:1,borderSkipped:!1,order:1},{label:"Benchmark Audience",data:r,backgroundColor:"rgba(149, 200, 197, 0.5)",borderColor:["black"],borderWidth:1,borderSkipped:!1,order:2}]},plugins:[tt.Z,eZ(0),eO],height:"100%",width:"100%"})},ta=r(9515),tl=r(2298),ts=e=>{var t,r,a,l;let{apiQueryString:s}=e,n="".concat(X.z0,"/api/dashboard/av-time-between-purchases?").concat(s),o=(0,et.Z)(n),c=null!==(a=null===(t=o.data)||void 0===t?void 0:t.cohortData)&&void 0!==a?a:[],i=null!==(l=null===(r=o.data)||void 0===r?void 0:r.storeAvData)&&void 0!==l?l:[],{isLoading:d,errorMsg:u,shouldDisplayErrorMsg:h}=o;if(d)return(0,y.jsx)(ee.Z,{height:35,width:35});console.log("av time between"),console.log(c),console.log(i);let m=e=>{if(0===e.length)return[];let t=0;
1e.forEach(e=>{t+=e.total_customers});let r=e[0].weeks_until_order;null===r&&(r="0");let a=parseFloat(r);return e.map(e=>{let r=e.total_customers/t*75;r<10&&(r=10);let l=null===e.weeks_until_order?0:parseFloat(e.weeks_until_order);return{x:(l-=a).toFixed(2),y:e.aov,r:r,numberOfCustomers:e.total_customers}})},p=m(c),x=m(i),f=e=>g(e)?e[1].total_customers/e[0].total_customers*100:(console.log("No customers made a 2nd purchase"),0);function g(e){return!!e&&!(e.length<2)}let v=f(c),b=f(i),w=((e,t)=>{var r,a,l,s;if(!g(e)||!g(t))return console.log("No customers made a 2nd purchase"),null;let n=parseFloat(null!==(r=e[1].weeks_until_order)&&void 0!==r?r:"0")-parseFloat(null!==(a=e[0].weeks_until_order)&&void 0!==a?a:"0"),o=parseFloat(null!==(l=t[1].weeks_until_order)&&void 0!==l?l:"0")-parseFloat(null!==(s=t[0].weeks_until_order)&&void 0!==s?s:"0");console.log("Weeks since:"),console.log(n,o);let c=0===o?0:(o-n)/o*100;return console.log("perc. change"),console.log(c),c})(c,i);return(0,y.jsxs)("div",{className:"",children:[(0,y.jsxs)("div",{className:"container max-w-4xl",children:[(0,y.jsx)("h3",{className:"mb-4 text-center",children:"Average Time Between Purchases"}),(0,y.jsx)("p",{className:"mb-4 text-center",children:"The chart below helps you uncover if your selected audience is buying more or less frequently and with a higher or lower Average Order Value than your average customer. As you review the chart, look at the time between purchases for The Audience You Just Built compared to the Benchmark. Inside each bar youâll see the Average Order Value of that purchase."}),(0,y.jsx)("p",{className:"mb-4 text-center",children:"Question to ask yourself: Is this audience purchasing more frequently with bigger carts? What does this mean for your revenue planning as a store?"})]}),h()?(0,y.jsx)("p",{className:"container text-center text-red-400 text-sm mt-10",children:u}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"overflow-x-auto",children:(0,y.jsx)("div",{className:"max-w-7xl mx-auto lg:pl-0 md:pl-3 pl-2 h-[433px] md:h-[550px]",style:{minWidth:600},children:(0,y.jsx)(tr,{bubbleSet1:p,bubbleSet2:x,cohortData:c,storeAvData:i})})}),null===w?"":(0,y.jsxs)("div",{className:"mt-9",children:[(0,y.jsxs)(ta.Z,{children:["The Audience You Just Built made a 2nd purchase"," ",(0,y.jsxs)(tl.Z,{children:[Math.abs(w).toFixed(2),"%"," ",null===w?"":w>=0?"faster":"slower"]})," ","than Benchmark."]}),(0,y.jsxs)(ta.Z,{extraClasses:"mt-5",children:[(0,y.jsxs)(tl.Z,{children:[v.toFixed(2),"%"]})," ","of The Audience You Just Built made 2nd purchase in this timeframe (",(0,y.jsxs)(tl.Z,{children:[b.toFixed(2),"%"]})," ","is Benchmark)."]})]})]}),(0,y.jsx)("div",{className:"mt-16",children:(0,y.jsx)(ek.Z,{badgeText:"LIFT TIP",text:"Increasing the frequency of purchases usually involves updating how you currently communicate with your customers - consider automated email or SMS flows with personalization based on the current buying behavior of this audience, or find ways to engage them organically through community engagement such as Instagram Live or TikTok challenges (if applicable)."})})]})},tn=e=>{let{apiQueryString:t}=e;return(0,y.jsxs)("section",{className:"mt-12 lg:mt-16",children:[(0,y.jsx)(e1,{}),(0,y.jsx)("div",{className:"lg:container mt-16",children:(0,y.jsx)(ts,{apiQueryString:t})}),(0,y.jsx)("div",{className:"mt-20",children:(0,y.jsx)(e9,{apiQueryString:t})}),(0,y.jsx)(F,{myClasses:"mt-16 lg:mt-24"})]})};function to(e){let{text:t}=e;return(0,y.jsx)("div",{className:"bg-white border-b border-b-black px-6 py-2.5 sm:px-3.5 sticky top-0 z-20",children:(0,y.jsx)("div",{className:"container",children:(0,y.jsx)("p",{className:"text-xs md:text-sm text-center leading-5 sm:leading-6 text-black",children:t})})})}var tc=function(){async function e(){try{await eW().post(X.z0+"/api/dashboard/analytics/visit-count",null,{withCredentials:!0})}catch(e){console.log("Dash analytics error:"),console.log(e)}}return(0,w.useEffect)(()=>{e()},[]),{incrementCount:e}},ti=e=>{let{}=e,{user:t,isLoading:r,errorMsg:a}=(0,eK.Z)(X._e),{cohortTotalAudience:l,updateCohortTotalAudience:s}=_(),{apiQueryString:n,errorMsg:o,cohortSettings:c}=P(),i=(0,N.useRouter)(),d=tc(),[u,h]=(0,w.useState)(!1),m=()=>{h(!0)};return!t||r?(0,y.jsx)(eJ.Z,{errorMsg:a}):o?(0,y.jsx)(eJ.Z,{errorMsg:o}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(eX(),{children:(0,y.jsx)("title",{children:"Dashboard | CustomerLift"})}),(0,y.jsx)(e_.Provider,{value:t,children:(0,y.jsxs)(j.Provider,{value:{cohortTotalAudience:l,updateCohortTotalAudience:s},children:[(0,y.jsx)(to,{text:[(0,y.jsx)("b",{children:"Audience: "},"1"),V(c,i)]}),(0,y.jsxs)("div",{className:"overflow-x-hidden",children:[(0,y.jsx)(z,{openSaveAudienceModal:m,apiQueryString:n,incrementDashboardVisits:d.incrementCount}),(0,y.jsx)(ev,{apiQueryString:n}),(0,y.jsx)(tn,{apiQueryString:n}),(0,y.jsx)(eS,{apiQueryString:n}),(0,y.jsx)(eD,{apiQueryString:n}),(0,y.jsx)(eI,{openSaveAudienceModal:m}),(0,y.jsx)(eH,{isOpen:u,closeModal:()=>{h(!1)},openModal:m})]})]})})]})}},8205:function(e,t,r){"use strict";r.d(t,{LE:function(){return u},YG:function(){return d},bm:function(){return c},ie:function(){return o},p6:function(){return n}});var a=r(5582),l=r.n(a),s=r(9580);let n=e=>{let t=i(e),r=e.getDate(),a=e.getFullYear();return"".concat(t," ").concat(r,", ").concat(a)},o=e=>l()(e).format("MMM DD, YYYY"),c=e=>l()(e).format("YYYY-MM-DD"),i=e=>s.gg[e.getMonth()],d=(e,t)=>{for(var r=[],a=new Date(e);a<=new Date(t);a.setDate(a.getDate()+1))r.push(new Date(a));return r},u=e=>l()(e,"YYYY-MM-DD",!0).isValid()},6951:function(e,t,r){"use strict";r.d(t,{A:function(){return a},p:function(){return l}});let a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return e===t?s?r+l(e,2):r+e.toFixed(a):s?"".concat(r).concat(l(e,2)," - ").concat(r).concat(l(t,2)):"".concat(r).concat(e.toFixed(a)," - ").concat(r).concat(t.toFixed(a))};function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;
1return"string"==typeof e&&(e=parseFloat(e)),e.toLocaleString(void 0,{minimumFractionDigits:t,maximumFractionDigits:t})}},9026:function(e,t,r){"use strict";function a(e,t,r){return Array.from({length:(t-e)/r+1},(t,a)=>e+a*r)}r.d(t,{w:function(){return a}})},3109:function(e){e.exports={"speech-bubble-ds":"speech-bubble_speech-bubble-ds__Ix5ns","speech-bubble-ds__arrow":"speech-bubble_speech-bubble-ds__arrow__KALIA","speech-bubble-ds__left-arrow":"speech-bubble_speech-bubble-ds__left-arrow__SdOK8"}}},function(e){e.O(0,[885,869,719,743,888,774,179],function(){return e(e.s=528)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.