"use strict";(globalThis.webpackChunkwpmvc=globalThis.webpackChunkwpmvc||[]).push([[727],{24893:(e,t,n)=>{n.d(t,{Q:()=>l});var s=n(51962),i=n(31890),a=n(38800),r=n(10790);function l(e){return t=>{const{bgUrl:n,...l}=t;return(0,a.n_)()?(0,r.jsx)(e,{...l}):(0,r.jsxs)(i.ComingSoon,{bgUrl:n,children:[(0,r.jsx)("h3",{children:"Upgrade to Pro"}),(0,r.jsx)("p",{children:"Get access to this premium feature with Vendtics PRO version!"}),(0,r.jsx)(i.Button,{variant:s.zB,sx:{background:"#F59E0B",border:"none"},children:"Upgrade to Pro!"})]})}}},59152:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Di});var s=n(47767),i=n(85011),a=n(72404),r=n(56427),l=n(86087),c=n(67601),o=n(47143),d=n(29491),x=n(16772),p=n(70885),h=n(60258),u=n(71479);const m=u.A.div`
	padding: 30px;
	border-radius: 6px;
	border: 1px solid ${h.A.neutral300};
	box-shadow: none;
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
	gap: 10px;

	& > div {
		h3 {
			font-size: 14px;
			font-weight: 600;
			margin-bottom: 10px;
			color: ${h.A.neutral700};
			text-transform: capitalize;
		}
		& > div {
			display: flex;
			align-items: baseline;
			gap: 5px;

			p {
				font-size: 30px;
				color: ${h.A.neutral900};
				font-weight: 600;
				line-height: 40px;
				margin-bottom: 8px;
			}
			span {
				font-size: 12px;
				color: ${h.A.neutral800};
				line-height: 14px;
			}
		}
	}
`,g=u.A.div`
	width: 100%;
	height: 142px;
	border-radius: 6px;
	border: 1px solid ${h.A.neutral300};
	background: ${h.A.light};

	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding-inline: 32px;
`;var j=n(89745),A=n(10790);const f=(0,d.createHigherOrderComponent)((e=>t=>{const{hasResolved:n}=t;return n?(0,A.jsx)(e,{...t}):(0,A.jsx)(r.Fill,{name:c.A.CAMPAIGNS_SECONDARY_HEADER_AFTER,children:(0,A.jsx)(r.__experimentalGrid,{columns,gap:4,children:Array.from({length:columns}).map(((e,t)=>(0,A.jsx)(g,{children:(0,A.jsx)(j.QE,{})},t)))})})}),"withLoading"),y=(0,o.withSelect)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{countsVisibility:t.getCountsVisibility(),counts:t.getCounts(),hasResolved:t.hasFinishedResolution("getCounts")}}));(0,d.compose)([y,f])((function(e){const t=(0,l.useRef)(null),{countsVisibility:n,counts:s}=e,i=(0,l.useCallback)((e=>{switch(e){case"total_campaigns":return{title:"Total Campaigns",icon:(0,A.jsx)(j.qc,{})};case"revenue":return{title:"Total Revenue",icon:(0,A.jsx)(j.Y1,{})};case"unsubscribed":return{title:"Total Unsubscribed",icon:(0,A.jsx)(j.E0,{})};default:return{title:"Total Subscriber",icon:(0,A.jsx)(j.tU,{})}}}),[]);return(0,A.jsx)(r.Fill,{name:c.A.CAMPAIGNS_SECONDARY_HEADER_AFTER,children:(0,A.jsx)(x.A,{in:n,timeout:280,classNames:"vendtics-fade-down",unmountOnExit:!0,nodeRef:t,children:(0,A.jsx)("div",{ref:t,children:(0,A.jsx)(r.__experimentalGrid,{columns:4,gap:4,children:Object.entries(s.counts).map((([e,t],n)=>(0,A.jsxs)(m,{children:[i(e).icon,(0,A.jsxs)("div",{children:[(0,A.jsx)("h3",{children:i(e).title}),(0,A.jsx)("div",{children:(0,A.jsx)("p",{children:t})})]})]},n)))})})})})}));var b=n(21361),v=n(71804),C=n(85777),S=n(11402),w=n(51962);const F=(0,u.A)(r.Flex)`
	h4 {
		color: ${h.A.neutral900};
		text-align: center;
		font-size: 24px;
		font-weight: 600;
		margin-bottom: 10px;

		span {
			color: ${h.A.brand500};
		}
	}

	p {
		color: ${h.A.neutral800};
		font-size: 14px;
	}
`,I=(0,o.withSelect)((e=>({searchQuery:e(p.A.ALL_CAMPAIGNS).getSearchQuery()}))),D=(0,o.withDispatch)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{clear(){t.setSearchQuery(""),t.invalidateResolution("getList")}}})),k=(0,d.compose)([I,D])((function(e){const{searchQuery:t,clear:n}=e;return(0,A.jsxs)(F,{justify:"center",align:"center",gap:5,direction:"column",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(v.r,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)("div",{children:[(0,A.jsxs)("h4",{children:["No Campaign Found ",(0,A.jsx)("span",{children:t})]}),(0,A.jsx)("p",{children:" Adjust your filters to see your campaign"})]})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(S.A,{onClick:n,icon:(0,A.jsx)(C.H,{}),variant:w.Rm,sx:{border:`1px solid ${h.A.brand500}`,color:h.A.brand500},children:"Clear Search"})})]})}));var R=n(27723);const N=(0,u.A)(r.Flex)`
	h4 {
		color: ${h.A.neutral900};
		text-align: center;
		font-size: 24px;
		font-weight: 600;
		margin-bottom: 10px;

		span {
			color: ${h.A.brand500};
		}
	}

	p {
		color: ${h.A.neutral800};
		font-size: 14px;
	}
`,E=(0,o.withDispatch)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{clear(){t.invalidateResolution("getList")}}})),T=(0,d.compose)([E])((function(e){const{clear:t}=e;return(0,A.jsxs)(N,{justify:"center",align:"center",gap:5,direction:"column",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(v.r,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)("div",{children:[(0,A.jsx)("h4",{children:"The Campaigns are currently empty"}),(0,A.jsx)("p",{children:" Adjust your filters to see your contacts"})]})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(S.A,{onClick:t,icon:(0,A.jsx)(C.H,{}),variant:w.Rm,sx:{border:`1px solid ${h.A.brand500}`,color:h.A.brand500},children:"Clear All Filters"})})]})}));var P=n(65752),M=n(71579);const L=(0,d.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,campaigns:s}=t;return!n&&_.isEmpty(s)?(0,A.jsx)(l.Fragment,{children:(0,A.jsx)(M.cU,{row:4})}):_.isEmpty(s)?null:(0,A.jsx)(e,{...t})}),"withLoading");var $=n(52619),G=n(20114),z=n(83509);const O=(0,d.createHigherOrderComponent)((e=>t=>{const{campaigns:n}=t;return!_.isEmpty(n.campaigns)&&n.total>0?(0,A.jsx)(e,{...t}):(0,A.jsxs)(G.A,{children:[(0,A.jsx)("h3",{children:(0,R.__)("No data is available","vendtics")}),(0,A.jsxs)("p",{children:["This section will be updated once data ",(0,A.jsx)("br",{})," has been collected."]}),(0,A.jsxs)(r.Flex,{align:"center",justify:"center",gap:3,children:[(0,A.jsx)(S.A,{icon:(0,A.jsx)(j.XM,{}),iconPosition:"end",variant:w.Rm,children:"Learn More"}),(0,A.jsx)(S.A,{variant:w.zB,onClick:()=>{(0,$.doAction)(z.k.SHOW_ADD_CAMPAIGN_MODAL,!0)},children:"Add Campaign"})]})]})}),"withEmpty"),B=(0,o.withSelect)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{campaigns:t.getList(),columns:t.getColumns(),rowKeys:t.getRowKeys(),searchQuery:t.getSearchQuery(),getOrderById:t.getOrderById,pagination:t.getPagination(),hasResolved:t.hasFinishedResolution("getList")}})),q=(0,o.withDispatch)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{setPagination:t.setPagination,setRowKeys:t.setRowKeys,setOrder:t.setOrder,refreshList:()=>{t.invalidateResolutionForStoreSelector("getList")}}})),Y=(0,d.compose)([q,B,L,O])((function(e){const{campaigns:t,pagination:n,rowKeys:s,setRowKeys:i,hasResolved:a}=e,{columnsCampaignsWithOrder:r,onPaginationChange:c,onTableChange:o,renderEmptyScreen:d}=(e=>{const{setPagination:t,refreshList:n,setOrder:s,columns:i,getOrderById:a,searchQuery:r}=e,c=(0,l.useMemo)((()=>{const e=Object.keys(i).filter((e=>i[e])).concat(["action"]);return b.A.filter((t=>e.includes(t.key)))}),[i]);return{columnsCampaignsWithOrder:(0,l.useMemo)((()=>c.map((e=>{const t=a(e.key);return _.isEmpty(t)||(e.defaultSortOrder=t.order),e}))),[c,a]),onPaginationChange:(0,l.useCallback)(((e,s)=>{t({current:e,pageSize:s}),n()}),[t,n]),onTableChange:(0,l.useCallback)(((e,t,i)=>{const a=_.pick(i,["order","columnKey"]);s(a),n()}),[s,n]),renderEmptyScreen:(0,l.useCallback)((()=>r?(0,A.jsx)(k,{}):(0,A.jsx)(T,{})),[])}})(e);return(0,A.jsx)(P.A,{loading:!a,pageSize:n.pageSize,currentPage:n.current,columns:r,uniqueKey:r.length,rowSelection:{selectedRowKeys:s,onChange:i},dataSource:t.campaigns,total:t.total,scroll:{x:1e3},emptyScreen:d(),onPaginationChange:c,onTableChange:o})})),H=u.A.div`
	background-color: ${h.A.light};
	padding: 24px 0px;
	border-radius: 16px;
	box-shadow: 0px 1px 2px 0px rgba( 0, 0, 0, 0.05 );

	&.contact-search-input {
		max-width: 240px;
		padding: 5px 10px !important;
		input.ant-input {
			min-height: auto;
		}
	}
`;var Q=n(32066);const V=(0,o.withSelect)((e=>({searchQuery:e(p.A.ALL_CAMPAIGNS).getSearchQuery()}))),U=(0,o.withDispatch)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{setSearchQuery:t.setSearchQuery,refreshList:()=>t.invalidateResolution("getList")}})),K=(0,d.compose)([V,U])((function(e){const{searchQuery:t,setSearchQuery:n,refreshList:s}=e,i=(0,d.useDebounce)(s,500);return(0,A.jsx)(Q.A,{className:"campaigns-search-input",prefix:(0,A.jsx)(j.WI,{}),value:t,placeholder:(0,R.__)("Search..."),onChange:e=>{return t=e.target.value,n(t),void i();var t}})})),W=(0,o.withDispatch)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{refreshList:()=>t.invalidateResolution("getList")}})),Z=(0,d.compose)([W])((function(e){const{refreshList:t}=e;return(0,A.jsx)(S.A,{onClick:()=>{t()},variant:w.E3,sx:{height:"40px",border:`1px solid ${h.l.neutral400}`},children:(0,A.jsx)(j.jf,{})})})),J=[{label:"Draft",value:"draft"},{label:"In Queue",value:"in_queue"},{label:"Processing",value:"processing"},{label:"Failed",value:"failed"},{label:"Paused",value:"paused"},{label:"Completed",value:"completed"}];var X=n(36492);const ee=(0,u.A)(X.A)`
	&.ant-select-lg {
		height: 44px !important;
	}

	.ant-select-selector {
		border: 1px solid ${h.l.neutral300} !important;
		padding-block: 5px !important;

		&:hover {
			border-color: ${h.l.brand500} !important;
			color: ${h.l.brand500} !important;
		}
	}
`,te=(0,u.A)(r.Flex)`
	.vendtics-selected-row {
		color: ${h.l.neutral800};
		font-size: 14px;
		font-weight: 600;
		white-space: nowrap;
		cursor: default;
	}
	p {
		display: flex;
		align-items: center;
		gap: 6px;
		font-size: 14px;
		font-weight: 600;
		cursor: pointer;
	}
	.vendtics-edit-selected-row {
		color: ${h.l.brand500};
	}

	.vendtics-delete-selected-row {
		color: ${h.l.error};
	}
`,ne=(0,o.withSelect)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{value:t.getStatus(),hasResolved:t.hasFinishedResolution("getList")}})),se=(0,o.withDispatch)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{setStatus:t.setStatus,refreshList:()=>t.invalidateResolution("getList")}})),ie=(0,d.compose)([ne,se])((function(e){const{setStatus:t,hasResolved:n,refreshList:s,value:i}=e;return(0,A.jsx)(ee,{size:"large",disabled:!n,onChange:e=>{t(e),s()},placeholder:(0,R.__)("Status","vendtics"),value:i,allowClear:!0,style:{width:120},options:J})})),ae=[{label:"Standard",value:"standard"}];function re(e){return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(ee,{size:"large",onChange:e=>{},placeholder:(0,R.__)("Type","vendtics"),allowClear:!0,style:{width:120},options:ae})})}function le(){return(0,A.jsxs)(r.Flex,{gap:3,children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(re,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(ie,{})})]})}var ce=n(19670),oe=n(90888);const de=(0,o.withSelect)((e=>({rowKeys:e(p.A.ALL_CAMPAIGNS).getRowKeys()}))),xe=(0,o.withDispatch)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{setRowsKey:t.setRowKeys,deleteBulkCampaigns:t.deleteBulkCampaigns}})),pe=(0,d.compose)([de,xe])((function(e){const{rowKeys:t,setRowsKey:n,deleteBulkCampaigns:s}=e;return(0,A.jsxs)(te,{gap:3,children:[(0,A.jsx)("p",{className:"vendtics-selected-row",children:!_.isEmpty(t)&&`${t.length} Selected`}),!_.isEmpty(t)&&(0,A.jsx)(ce.A,{title:(0,R.__)("Delete Campaigns","vendtics"),description:(0,R.__)("Are you sure you want to delete the selected campaigns?","vendtics"),okText:(0,R.__)("Confirm","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,R.__)("No","vendtics"),onConfirm:()=>{(async()=>{try{const e=await s(t);oe.Ay.success(e.message)}catch(e){oe.Ay.error(e.message)}})(),n([])},children:(0,A.jsx)(S.A,{type:"text",children:(0,A.jsxs)("p",{className:"vendtics-delete-selected-row",children:[(0,A.jsx)(j.d7,{}),(0,R.__)("Delete","vendtics")]})})})]})}));function he(){return(0,A.jsxs)(r.Flex,{justify:"space-between",style:{paddingInline:"12px",marginBottom:"24px"},children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(r.Flex,{gap:4,children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(le,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(pe,{})})]})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(r.Flex,{gap:2,children:[(0,A.jsx)(Z,{}),(0,A.jsx)(K,{})]})})]})}const ue=(0,o.withSelect)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{countsVisibility:t.getCountsVisibility(),hasCountsResolved:t.hasFinishedResolution("getCounts"),hasListResolved:t.hasFinishedResolution("getList")}})),me=(0,o.withDispatch)((e=>({setCountsVisibility:e(p.A.ALL_CAMPAIGNS).setCountsVisibility})));function ge(){return(0,A.jsxs)(l.Fragment,{children:[(0,A.jsx)(r.Fill,{name:c.A.PRIMARY_HEADER_NAME,children:"All Campaigns"}),(0,A.jsxs)(H,{children:[(0,A.jsx)(he,{}),(0,A.jsx)(Y,{})]})]})}(0,d.compose)([ue,me])((function(e){const{setCountsVisibility:t,countsVisibility:n,hasCountsResolved:s}=e,i=(0,l.useMemo)((()=>({...w.Qq,style:{...w.Qq.style,color:n?h.A.primary:"inherit","--small-circle-color":n?h.A.primary:"transparent"}})),[n]);return(0,A.jsx)(l.Fragment,{children:(0,A.jsx)(S.A,{disabled:!s,variant:i,onClick:()=>{t(!n)},children:(0,A.jsx)(j.Uy,{})})})}));const je=(0,u.A)(r.Flex)`
	h4 {
		color: ${h.A.neutral900};
		text-align: center;
		font-size: 24px;
		font-weight: 600;
		margin-bottom: 10px;

		span {
			color: ${h.A.brand500};
		}
	}

	p {
		color: ${h.A.neutral800};
		font-size: 14px;
	}
`,Ae=(0,o.withSelect)((e=>({searchQuery:e(p.A.ALL_CAMPAIGNS).getSearchQuery()}))),fe=(0,o.withDispatch)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{clear(){t.setSearchQuery(""),t.invalidateResolution("getList")}}})),_e=(0,d.compose)([Ae,fe])((function(e){const{searchQuery:t,clear:n}=e;return(0,A.jsxs)(je,{justify:"center",align:"center",gap:5,direction:"column",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(v.r,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)("div",{children:[(0,A.jsxs)("h4",{children:["No Campaign Found ",(0,A.jsx)("span",{children:t})]}),(0,A.jsx)("p",{children:" Adjust your filters to see your campaign"})]})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(S.A,{onClick:n,icon:(0,A.jsx)(C.H,{}),variant:w.Rm,sx:{border:`1px solid ${h.A.brand500}`,color:h.A.brand500},children:"Clear Search"})})]})})),ye=(0,u.A)(r.Flex)`
	h4 {
		color: ${h.A.neutral900};
		text-align: center;
		font-size: 24px;
		font-weight: 600;
		margin-bottom: 10px;

		span {
			color: ${h.A.brand500};
		}
	}

	p {
		color: ${h.A.neutral800};
		font-size: 14px;
	}
`,be=(0,o.withDispatch)((e=>{const t=e(p.A.ALL_CAMPAIGNS);return{clear(){t.invalidateResolution("getList")}}})),ve=(0,d.compose)([be])((function(e){const{clear:t}=e;return(0,A.jsxs)(ye,{justify:"center",align:"center",gap:5,direction:"column",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(v.r,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)("div",{children:[(0,A.jsx)("h4",{children:"The Campaigns are currently empty"}),(0,A.jsx)("p",{children:" Adjust your filters to see your contacts"})]})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(S.A,{onClick:t,icon:(0,A.jsx)(C.H,{}),variant:w.Rm,sx:{border:`1px solid ${h.A.brand500}`,color:h.A.brand500},children:"Clear All Filters"})})]})}));var Ce=n(74353),Se=n.n(Ce),we=n(84976);const Fe=(0,o.withDispatch)(((e,{record:t})=>{const n=e(p.A.ALL_CAMPAIGNS);return{deleteHandler:()=>n.deleteSingleCampaign(t.id)}})),Ie=(0,d.compose)([Fe])((function(e){const{deleteHandler:t,record:n}=e;return(0,A.jsxs)(r.Flex,{gap:2,justify:"flex-end",children:["draft"===n.status?(0,A.jsx)(we.N_,{to:n.id,children:(0,A.jsx)(S.A,{variant:w.E3,sx:{height:"40px"},children:(0,A.jsx)(j.qU,{})})}):(0,A.jsx)(we.N_,{to:`/campaigns/details/${n.id}`,children:(0,A.jsx)(S.A,{variant:w.E3,sx:{height:"40px"},children:(0,A.jsx)(j.pj,{})})}),(0,A.jsx)(ce.A,{title:(0,R.__)("Delete Campaign","vendtics"),description:(0,R.__)("Are you sure you want to delete this Campaign?","vendtics"),okText:(0,R.__)("Confirm","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,R.__)("No","vendtics"),onConfirm:()=>{t(),setOpenDropdown(!1)},placement:"topRight",onCancel:()=>setOpenDropdown(!1),children:(0,A.jsx)(S.A,{variant:w.E3,children:(0,A.jsx)(j.d7,{})})})]})}));var De=n(79834),ke=n(42219);function Re({status:e}){const{bg:t="#F3F4F8",color:n="#404252",text:s="Draft"}=ke.A[e]||{};return(0,A.jsx)(De.A,{bordered:!1,color:t,style:{fontWeight:600},children:(0,A.jsx)("span",{style:{color:n},children:s||"Unknown"})})}const Ne=[{title:(0,R.__)("Campaigns","vendtics"),dataIndex:"name",key:"name",sorter:!0,render:(e,{name:t})=>(0,A.jsx)("span",{children:t})},{title:(0,R.__)("Type","vendtics"),dataIndex:"type",key:"type",sorter:!0,render:(e,{type:t})=>(0,A.jsx)("span",{children:t})},{title:(0,R.__)("Recipients","vendtics"),dataIndex:"recipients",key:"recipients",sorter:!0,render:(e,{recipients:t})=>(0,A.jsx)("span",{children:t})},{title:(0,R.__)("Open","vendtics"),dataIndex:"open",key:"open",sorter:!0,render:(e,{open:t})=>(0,A.jsx)("span",{children:t})},{title:(0,R.__)("Opened Email","vendtics"),dataIndex:"opened_email",key:"opened_email",width:"250px",sorter:!0,render:(e,{opened_email:t})=>(0,A.jsx)("span",{children:t})},{title:(0,R.__)("Clicked Email","vendtics"),dataIndex:"clicked_email",key:"clicked_email",width:"250px",sorter:!0,render:(e,{clicked_email:t})=>(0,A.jsx)("span",{children:t})},{title:(0,R.__)("Date Created","vendtics"),dataIndex:"created_at",key:"created_at",width:"250px",sorter:!0,render:(e,{created_at:t})=>(0,A.jsx)("span",{children:Se()(new Date(t).toDateString()).format("MMM D, YYYY h:mm A")})},{title:(0,R.__)("Status","vendtics"),dataIndex:"status",key:"status",width:"150px",sorter:!0,render:(e,t)=>(0,A.jsx)(Re,{status:e,record:t})},{title:(0,R.__)("Action","vendtics"),dataIndex:"action",key:"action",fixed:"right",width:"120px",render:(e,t)=>(0,A.jsx)(Ie,{record:t})}],Ee=(0,d.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,campaigns:s}=t;return!n&&_.isEmpty(s)?(0,A.jsx)(l.Fragment,{children:(0,A.jsx)(M.cU,{row:4})}):_.isEmpty(s)?null:(0,A.jsx)(e,{...t})}),"withLoading"),Te=(0,d.createHigherOrderComponent)((e=>t=>{const{campaigns:n}=t;return!_.isEmpty(n.campaigns)&&n.total>0?(0,A.jsx)(e,{...t}):(0,A.jsxs)(G.A,{children:[(0,A.jsx)("h3",{children:(0,R.__)("No data is available","vendtics")}),(0,A.jsxs)("p",{children:["This section will be updated once data ",(0,A.jsx)("br",{})," has been collected."]}),(0,A.jsxs)(r.Flex,{align:"center",justify:"center",gap:3,children:[(0,A.jsx)(S.A,{icon:(0,A.jsx)(j.XM,{}),iconPosition:"end",variant:w.Rm,children:"Learn More"}),(0,A.jsx)(S.A,{variant:w.zB,onClick:()=>{(0,$.doAction)(z.k.SHOW_ADD_CAMPAIGN_MODAL,!0)},children:"Add Campaign"})]})]})}),"withEmpty"),Pe=(0,o.withSelect)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{campaigns:t.getStandardCampaigns(),columns:t.getColumns(),rowKeys:t.getRowKeys(),searchQuery:t.getSearchQuery(),getOrderById:t.getOrderById,pagination:t.getPagination(),hasResolved:t.hasFinishedResolution("getStandardCampaigns")}})),Me=(0,o.withDispatch)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{setPagination:t.setPagination,setRowKeys:t.setRowKeys,setOrder:t.setOrder,refreshList:()=>{t.invalidateResolution("getStandardCampaigns")}}})),Le=(0,d.compose)([Me,Pe,Ee,Te])((function(e){const{campaigns:t,pagination:n,rowKeys:s,setRowKeys:i,hasResolved:a}=e,{columnsCampaignsWithOrder:r,onPaginationChange:c,onTableChange:o,renderEmptyScreen:d}=(e=>{const{setPagination:t,getOrderById:n,refreshList:s,setOrder:i,columns:a,searchQuery:r}=e,c=(0,l.useMemo)((()=>{const e=Object.keys(a).filter((e=>a[e])).concat(["action"]);return Ne.filter((t=>e.includes(t.key)))}),[a]);return{columnsCampaignsWithOrder:(0,l.useMemo)((()=>c.map((e=>{const t=n(e.key);return _.isEmpty(t)||(e.defaultSortOrder=t.order),e}))),[c,n]),onPaginationChange:(0,l.useCallback)(((e,n)=>{t({current:e,pageSize:n}),s()}),[t,s]),onTableChange:(0,l.useCallback)(((e,t,n)=>{const a=_.pick(n,["order","columnKey"]);i(a),s()}),[i,s]),renderEmptyScreen:(0,l.useCallback)((()=>r?(0,A.jsx)(_e,{}):(0,A.jsx)(ve,{})),[])}})(e);return(0,A.jsx)(P.A,{loading:!a,pageSize:n.pageSize,currentPage:n.current,columns:r,uniqueKey:r.length,rowSelection:{selectedRowKeys:s,onChange:i},dataSource:t.campaigns,scroll:{x:1e3},emptyScreen:d(),onPaginationChange:c,onTableChange:o})})),$e=u.A.div`
	background-color: ${h.A.light};
	padding: 24px 0px;
	border-radius: 16px;
	box-shadow: 0px 1px 2px 0px rgba( 0, 0, 0, 0.05 );

	&.contact-search-input {
		max-width: 240px;
		padding: 5px 10px !important;
		input.ant-input {
			min-height: auto;
		}
	}
`,Ge=(0,o.withSelect)((e=>({searchQuery:e(p.A.STANDARD_CAMPAIGNS).getSearchQuery()}))),ze=(0,o.withDispatch)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{setSearchQuery:t.setSearchQuery,refreshList:()=>t.invalidateResolution("getStandardCampaigns")}})),Oe=(0,d.compose)([Ge,ze])((function(e){const{searchQuery:t,setSearchQuery:n,refreshList:s}=e,i=(0,d.useDebounce)(s,500);return(0,A.jsx)(Q.A,{className:"campaigns-search-input",prefix:(0,A.jsx)(j.WI,{}),value:t,placeholder:(0,R.__)("Search..."),onChange:e=>{return t=e.target.value,n(t),void i();var t}})})),Be=(0,o.withDispatch)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{refreshList:()=>t.invalidateResolution("getStandardCampaigns")}})),qe=(0,d.compose)([Be])((function(e){const{refreshList:t}=e;return(0,A.jsx)(S.A,{onClick:()=>{t()},variant:w.E3,sx:{height:"40px",border:`1px solid ${h.l.neutral400}`},children:(0,A.jsx)(j.jf,{})})})),Ye=(0,u.A)(X.A)`
	&.ant-select-lg {
		height: 44px !important;
	}

	.ant-select-selector {
		border: 1px solid ${h.l.neutral300} !important;
		padding-block: 5px !important;

		&:hover {
			border-color: ${h.l.brand500} !important;
			color: ${h.l.brand500} !important;
		}
	}
`,He=(0,u.A)(r.Flex)`
	.vendtics-selected-row {
		color: ${h.l.neutral800};
		font-size: 14px;
		font-weight: 600;
		white-space: nowrap;
		cursor: default;
	}
	p {
		display: flex;
		align-items: center;
		gap: 6px;
		font-size: 14px;
		font-weight: 600;
		cursor: pointer;
	}
	.vendtics-edit-selected-row {
		color: ${h.l.brand500};
	}

	.vendtics-delete-selected-row {
		color: ${h.l.error};
	}
`,Qe=(0,o.withSelect)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{value:t.getStatus(),hasResolved:t.hasFinishedResolution("getStandardCampaigns")}})),Ve=(0,o.withDispatch)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{setStatus:t.setStatus,refreshList:()=>t.invalidateResolution("getStandardCampaigns")}})),Ue=(0,d.compose)([Qe,Ve])((function(e){const{setStatus:t,hasResolved:n,refreshList:s,value:i}=e;return(0,A.jsx)(Ye,{size:"large",disabled:!n,onChange:e=>{t(e),s()},placeholder:(0,R.__)("Status","vendtics"),value:i,allowClear:!0,style:{width:120},options:J})}));function Ke(){return(0,A.jsx)(r.Flex,{gap:3,children:(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Ue,{})})})}const We=(0,o.withSelect)((e=>({rowKeys:e(p.A.STANDARD_CAMPAIGNS).getRowKeys()}))),Ze=(0,o.withDispatch)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{setRowsKey:t.setRowKeys,deleteBulkStandardCampaigns:t.deleteBulkStandardCampaigns}})),Je=(0,d.compose)([We,Ze])((function(e){const{rowKeys:t,setRowsKey:n,deleteBulkStandardCampaigns:s}=e;return(0,A.jsxs)(He,{gap:3,children:[(0,A.jsx)("p",{className:"vendtics-selected-row",children:!_.isEmpty(t)&&`${t.length} Selected`}),!_.isEmpty(t)&&(0,A.jsx)(ce.A,{title:(0,R.__)("Delete Standard Campaigns","vendtics"),description:(0,R.__)("Are you sure you want to delete the selected standard campaigns?","vendtics"),okText:(0,R.__)("Confirm","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,R.__)("No","vendtics"),onConfirm:()=>{(async()=>{try{const e=await s(t);oe.Ay.success(e.message)}catch(e){oe.Ay.error(e.message)}})(),n([])},children:(0,A.jsx)(S.A,{type:"text",children:(0,A.jsxs)("p",{className:"vendtics-delete-selected-row",children:[(0,A.jsx)(j.d7,{}),(0,R.__)("Delete","vendtics")]})})})]})}));function Xe(){return(0,A.jsxs)(r.Flex,{justify:"space-between",style:{paddingInline:"12px",marginBottom:"24px"},children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(r.Flex,{gap:4,children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Ke,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Je,{})})]})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(r.Flex,{gap:2,children:[(0,A.jsx)(qe,{}),(0,A.jsx)(Oe,{})]})})]})}function et(){return(0,A.jsxs)(l.Fragment,{children:[(0,A.jsx)(r.Fill,{name:c.A.PRIMARY_HEADER_NAME,children:"Standard Campaigns"}),(0,A.jsxs)($e,{children:[(0,A.jsx)(Xe,{}),(0,A.jsx)(Le,{})]})]})}var tt=n(51164);const nt=n.p+"chunks/images/split-testing.webp";var st=n(31890);function it(){return(0,A.jsxs)("div",{children:[(0,A.jsx)(r.Fill,{name:c.A.PRIMARY_HEADER_NAME,children:"A/B Campaigns"}),(0,A.jsxs)(tt.A,{bgUrl:nt,children:[(0,A.jsx)("h3",{children:"Coming soon"}),(0,A.jsxs)("p",{children:["Are you Ready to get something new from us. Then ",(0,A.jsx)("br",{})," ","subscribe the news latter to get latest updates?"]}),(0,A.jsx)(st.Button,{variant:w.zB,sx:{background:"#F59E0B",border:"none"},children:"Upgrade to Pro!"})]})]})}function at(){return(0,A.jsxs)("div",{children:[(0,A.jsx)(r.Fill,{name:c.A.PRIMARY_HEADER_NAME,children:"Sequence Campaigns"}),(0,A.jsxs)(tt.A,{bgUrl:nt,children:[(0,A.jsx)("h3",{children:"Coming soon"}),(0,A.jsxs)("p",{children:["Are you Ready to get something new from us. Then ",(0,A.jsx)("br",{})," ","subscribe the news latter to get latest updates?"]}),(0,A.jsx)(st.Button,{variant:w.zB,sx:{background:"#F59E0B",border:"none"},children:"Upgrade to Pro!"})]})]})}var rt=n(11575);u.A.div`
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 20px;
`,(0,u.A)(rt.A)`
	.ant-card-body {
		padding: 14px 40px;
	}
	.vendtics-device-traffic-content {
		.vendtics-device-open-text,
		.vendtics-device-click-text,
		.vendtics-device-unopened-text {
			position: relative;
			color: #00000073;
			&::before {
				content: '';
				top: 4px;
				left: -20px;
				position: absolute;
				width: 12px;
				height: 12px;
				background-color: ${h.l.brand500};
				border-radius: 100%;
			}
		}
		.vendtics-device-open-text {
			&::before {
				background-color: ${h.l.brand500};
			}
		}
		.vendtics-device-click-text {
			&::before {
				background-color: ${h.l.brand300};
			}
		}
		.vendtics-device-unopened-text {
			&::before {
				background-color: ${h.l.brand200};
			}
		}
		span {
			color: #1f2937;
		}
	}
`,(0,u.A)(rt.A)`
	.vendtics-device-number-desktop,
	.vendtics-device-number-smartphone,
	.vendtics-device-number-others {
		font-size: 14px;
		color: ${h.l.neutral700};
		font-weight: 600;
		position: relative;

		&::before {
			content: ' ';
			position: absolute;
			height: 20px;
			width: 20px;
			border-radius: 100%;
			left: -30px;
			top: 0;
		}
	}
	.vendtics-device-number-desktop {
		&::before {
			background: #1f66ff;
		}
	}
	.vendtics-device-number-smartphone {
		&::before {
			background: #0ea5e9;
		}
	}
	.vendtics-device-number-others {
		&::before {
			background: #f59e0b;
		}
	}
`;const lt=u.A.div`
	background: linear-gradient( 29deg, #fff 56.78%, #cdccff 248.38% );
	border: 1px solid #ebebeb;
	padding: 24px;
	border-radius: 6px;
	&:nth-child( 2 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #ccffef 248.38% );
	}
	&:nth-child( 3 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #fdc 248.38% );
	}
	&:nth-child( 4 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #ffccd0 248.38% );
	}
	&:nth-child( 5 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #ffcceb 248.38% );
	}
	&:nth-child( 6 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #e4ccff 248.38% );
	}
	p {
		color: ${h.l.neutral600};
		font-size: 16px;
		font-weight: 600;
		text-transform: capitalize;
	}

	h2 {
		color: ${h.l.neutral800};
		font-size: 30px;
		font-weight: 600;
		line-height: 40px;
	}
`;(0,u.A)(r.Flex)`
	h3 {
		font-weight: 500;
		font-size: 20px;
	}
`,(0,u.A)(rt.A)`
	position: relative;
	margin-top: 20px;
`,u.A.div`
	position: absolute;
	bottom: 0;
	left: 0;
	height: ${e=>e.height||"100%"};
	z-index: 9;
	width: 100%;
	border-radius: 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur( 4px );
`;var ct=n(17983);const ot=(0,u.A)(ct.A)`
	&.ant-progress > {
		&.ant-progress-inner > span {
			font-size: 30px;
			color: ${e=>"processing"===e.campaignStatus?h.l.brand500:"paused"===e.campaignStatus?"#F59E0B":"#EF4444"};
			font-weight: 600;
		}
	}
`;function dt(e){const{type:t="circle",percent:n=0,size:s=[258,260],trailColor:i="#FAFAFA",strokeWidth:a=12,status:r="active",strokeColor:c="#1C5DE8",campaignStatus:o="processing"}=e,d=(0,l.useMemo)((()=>e=>{switch(o){case"processing":default:return e+"%";case"paused":return"Pause";case"cancel":return"Cancel"}}),[o]);return(0,A.jsx)(ot,{type:t,percent:n,campaignStatus:o,format:d,size:s,trailColor:i,strokeWidth:a,status:r,strokeColor:c})}const xt=(0,o.withSelect)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{attributes:t.getAttributes(),hasResolved:t.hasFinishedResolution("getAttributes")}}));(0,d.compose)(xt)((function(e){const{attributes:t}=e,n=t?.totals,s=_.keys(n),i=(0,l.useCallback)((e=>{switch(e){case"recipients":return{title:"Total Recipients",icon:(0,A.jsx)(j.nd,{})};case"sent":return{title:"Sent Email",icon:(0,A.jsx)(j.Cr,{})};case"failed":return{title:"Failed Email",icon:(0,A.jsx)(j.ME,{})};case"bounced":return{title:"Bounced Email",icon:(0,A.jsx)(j.f$,{})};case"open":return{title:"Open Email",icon:(0,A.jsx)(j.IS,{})};default:return{title:"Click Email",icon:(0,A.jsx)(j.lG,{})}}}),[]);return(0,A.jsx)(r.__experimentalGrid,{columns:4,gap:5,children:s.map((e=>(0,A.jsxs)(lt,{children:[(0,A.jsxs)(r.Flex,{gap:"10px",justify:"flex-start",style:{marginBottom:"20px"},children:[i(e).icon,(0,A.jsx)("p",{children:i(e).title})]}),(0,A.jsx)("h2",{children:n[e]})]},e)))})}));var pt=n(19742);const{RangePicker:ht}=pt.A,ut=u.A.div`
	background-color: ${h.A.light};
	padding: 24px 0px;
	border-radius: 16px;
	box-shadow: 0px 1px 2px 0px rgba( 0, 0, 0, 0.05 );

	&.contact-search-input {
		max-width: 240px;
		padding: 5px 10px !important;
		input.ant-input {
			min-height: auto;
		}
	}
`,mt=(0,o.withDispatch)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{refresh:()=>t.invalidateResolution("getReciepentEmails")}})),gt=(0,d.compose)([mt])((function(e){const{refresh:t}=e;return(0,A.jsx)(S.A,{onClick:()=>{t()},variant:w.E3,sx:{height:"40px",border:`1px solid ${h.l.neutral400}`},children:(0,A.jsx)(j.jf,{})})}));function jt(){return(0,A.jsx)(r.Flex,{justify:"flex-end",style:{paddingInline:"12px",marginBottom:"24px"},children:(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(r.Flex,{gap:2,children:(0,A.jsx)(gt,{})})})})}const At={failed:{bg:"#FAEBEB",color:"#EF4444",text:"Failed"},bounced:{bg:"#FAF4EB",color:"#F59E0B",text:"Bounced"},sent:{bg:"#E9F0FF",color:"#1F66FF",text:"Sent"}};function ft({status:e}){const{bg:t="#F3F4F8",color:n="#404252",text:s="Sent"}=At[e]||{};return(0,A.jsx)(De.A,{bordered:!1,color:t,style:{fontWeight:600},children:(0,A.jsx)("span",{style:{color:n},children:s||"Unknown"})})}var _t=n(38800);const yt=[{title:(0,R.__)("Name","vendtics"),dataIndex:"name",key:"contact_name",width:"250px",fixed:"left",render:(e,t)=>(0,A.jsxs)(r.Flex,{gap:"10px",justify:"flex-start",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)("img",{alt:t?.contact?.first_name,src:t?.contact?.avatar_url,style:{width:"32px",height:"32px",borderRadius:"100%"}})}),(0,A.jsxs)(r.FlexItem,{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,A.jsxs)("span",{children:[t?.contact.first_name," ",t?.contact.last_name]})," "]})]})},{title:(0,R.__)("Email","vendtics"),dataIndex:"email",key:"email",width:"250px",render:(e,{contact:t})=>(0,A.jsx)("span",{children:t.email})},{title:(0,R.__)("Sent At","vendtics"),dataIndex:"created_at",key:"created_at",width:"200px",render:(e,{created_at:t})=>(0,A.jsx)("span",{children:(0,_t.Yq)(t)})},{title:(0,R.__)("Opened At","vendtics"),dataIndex:"opened_at",key:"opened_at",width:"150px",render:(e,{opened_at:t})=>(0,A.jsx)("span",{children:(0,_t.Yq)(t)})},{title:(0,R.__)("Clicked At","vendtics"),dataIndex:"clicked_at",key:"clicked_at",width:"130px",render:(e,{clicked_at:t})=>(0,A.jsx)("span",{children:(0,_t.Yq)(t)})},{title:(0,R.__)("Bounced At","vendtics"),dataIndex:"bounced_at",key:"bounced_at",width:"130px",render:(e,{bounced_at:t})=>(0,A.jsx)("span",{children:(0,_t.Yq)(t)})},{title:(0,R.__)("Unsubscribed At","vendtics"),dataIndex:"unsubscribed_at",key:"unsubscribed_at",width:"150px",render:(e,{unsubscribed_at:t})=>(0,A.jsx)("span",{children:(0,_t.Yq)(t)})},{title:(0,R.__)("Status","vendtics"),dataIndex:"status",key:"status",width:"100px",render:(e,t)=>(0,A.jsx)(ft,{status:e,record:t})}],bt=((0,d.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,reciepentEmails:s}=t;return!n&&_.isEmpty(s)?(0,A.jsx)(l.Fragment,{children:(0,A.jsx)(M.cU,{row:4})}):_.isEmpty(s)?null:(0,A.jsx)(e,{...t})}),"withLoading"),(0,d.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,reciepentEmails:s}=t;return n?_.isEmpty(s?.data)?(0,A.jsx)(e,{...t}):null:(0,A.jsx)("div",{style:{height:"auto"},children:(0,A.jsx)(M.cU,{row:1})})}),"withEmpty")),vt=(0,o.withSelect)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{reciepentEmails:t.getReciepentEmails(),pagination:t.getPagination(),hasResolved:t.hasFinishedResolution("getReciepentEmails")}})),Ct=(0,o.withDispatch)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{setPagination:t.setPagination,refreshList:()=>t.invalidateResolution("getReciepentEmails")}})),St=(0,d.compose)([Ct,vt,bt])((function(e){const{reciepentEmails:t,pagination:n,hasResolved:s}=e,{columnsWithOrder:i,onPaginationChange:a,onTableChange:r}=(e=>{const{setPagination:t,refreshList:n}=e;return{columnsWithOrder:(0,l.useMemo)((()=>yt.map((e=>e))),[]),onPaginationChange:(e,s)=>{t({current:e,pageSize:s}),n()},onTableChange:(e,t,s)=>{n()}}})(e);return(0,A.jsx)(P.A,{loading:!s,pageSize:n.pageSize,currentPage:n.current,columns:i,uniqueKey:i.length,dataSource:t.recipients,total:t.total,scroll:{x:1e3},onPaginationChange:a,onTableChange:r})}));function wt(){return(0,A.jsx)(l.Fragment,{children:(0,A.jsxs)(ut,{children:[(0,A.jsx)(jt,{}),(0,A.jsx)(St,{})]})})}var Ft=n(60742),It=n(93037),Dt=n(89671);const kt="vendtics-show-cancel-note-modal",Rt=(0,o.withDispatch)((e=>({cancelCampaign:e(p.A.CAMPAIGN_DETAILS).cancelCampaign}))),Nt=(0,d.compose)([Rt])((function(e){const{cancelCampaign:t}=e,[n,s]=(0,l.useState)(!1),[i,a]=(0,l.useState)(!1);return(0,l.useLayoutEffect)((()=>((0,$.addAction)(kt,"vendtics",(e=>{s(e)})),()=>{(0,$.removeAction)(kt,"vendtics")})),[]),(0,A.jsx)(Dt.A,{visible:n,width:"450px",onCloseRequest:()=>s(!1),children:(0,A.jsxs)(Ft.A,{onFinish:async e=>{a(!0);try{const n=await t(e);oe.Ay.success(n.message),a(!1)}catch(e){oe.Ay.error(e.message||"Something went wrong! Please try again"),a(!1)}finally{a(!1),(0,$.doAction)(kt,!1)}},children:[(0,A.jsx)(Dt.A.Header,{children:(0,R.__)("Campaign Cancel Note","vendtics")}),(0,A.jsx)(Dt.A.Body,{children:(0,A.jsx)(It.A,{label:"Note",type:"textarea",name:"notes",placeholder:"Write your note",help:"Why cancel your campaign"})}),(0,A.jsx)(Dt.A.Footer,{children:(0,A.jsx)(r.Flex,{gap:2,justify:"flex-end",children:(0,A.jsx)(S.A,{variant:w.zB,htmlType:"submit",loading:i,sx:{backgroundColor:`${h.l.error}`,borderColor:"transparent"},children:(0,R.__)("Submit","vendtics")})})})]})})})),Et=(0,u.A)(r.Flex)`
	.vendtics-campaign-details {
		border: 1px solid #ebebeb;
		padding: 24px;
		border-radius: 6px;

		h3 {
			color: ${h.l.neutral900};
			font-size: 20px;
			font-weight: 500;
			line-height: 28px;
			margin-bottom: 20px;
		}
		&-content {
			display: flex;
			align-items: center;
			justify-content: flex-start;
			p {
				color: ${h.l.neutral700};
				font-size: 16px;
				font-style: normal;
				font-weight: 400;
				line-height: 22px;
				width: 150px;
			}
			h5 {
				color: ${h.l.neutral900};
				font-size: 16px;
				font-weight: 600;
			}
		}
	}
`,Tt=u.A.div`
	display: grid;
	grid-template-columns: 1fr 460px;
	gap: 20px;
`,Pt=u.A.div`
	background: linear-gradient( 29deg, #fff 56.78%, #cdccff 248.38% );
	border: 1px solid #ebebeb;
	padding: 24px;
	border-radius: 6px;
	&:nth-child( 2 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #ccffef 248.38% );
	}
	&:nth-child( 3 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #fdc 248.38% );
	}
	&:nth-child( 4 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #ffccd0 248.38% );
	}
	&:nth-child( 5 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #ffcceb 248.38% );
	}
	&:nth-child( 6 ) {
		background: linear-gradient( 29deg, #fff 56.78%, #e4ccff 248.38% );
	}
	p {
		color: ${h.l.neutral600};
		font-size: 16px;
		font-weight: 600;
		text-transform: capitalize;
	}

	h2 {
		color: ${h.l.neutral800};
		font-size: 30px;
		font-weight: 600;
		line-height: 40px;
	}
`,Mt=u.A.div`
	width: 100%;
	height: 140px;
	border-radius: 6px;
	border: 1px solid ${h.l.neutral300};
	background: ${h.l.light};

	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding-inline: 32px;
`,Lt=u.A.div`
	width: 100%;
	border-radius: 6px;
	border: 1px solid ${h.l.neutral300};
	background: ${h.l.light};
	padding: 32px;
`,$t=u.A.div`
	width: 100%;
	height: 100%;
	border-radius: 6px;
	border: 1px solid ${h.l.neutral300};
	background: ${h.l.light};

	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding-inline: 32px;
`,Gt=(0,d.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,attributes:s}=t;return!n&&_.isEmpty(s)?(0,A.jsxs)(r.Flex,{direction:"column",gap:"20px",children:[(0,A.jsx)(r.__experimentalGrid,{columns:3,gap:4,children:Array.from({length:6}).map(((e,t)=>(0,A.jsx)(Mt,{children:(0,A.jsx)(j.QE,{})},t)))}),(0,A.jsx)(Lt,{children:(0,A.jsx)(j.CN,{})})]}):_.isEmpty(s)?null:(0,A.jsx)(e,{...t})}),"withAttributeLoading"),zt=(0,d.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,attributes:s}=t;return!n&&_.isEmpty(s)?(0,A.jsxs)(l.Fragment,{children:[(0,A.jsx)(r.Fill,{name:c.A.CAMPAIGN_DETAILS_SECONDARY_HEADER_RIGHT,children:(0,A.jsx)("h1",{children:"Loading..."})}),(0,A.jsx)($t,{children:(0,A.jsx)(j.n6,{})})]}):_.isEmpty(s)?null:(0,A.jsx)(e,{...t})}),"withStatusLoading"),Ot=(0,o.withSelect)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{attributes:t.getAttributes(),hasResolved:t.hasFinishedResolution("getAttributes")}})),Bt=(0,d.compose)(Ot,Gt)((function(e){const{attributes:t}=e,n=t?.totals,s=_.keys(n),i=(0,l.useCallback)((e=>{switch(e){case"recipients":return{title:"Total Recipients",icon:(0,A.jsx)(j.nd,{})};case"sent":return{title:"Sent Email",icon:(0,A.jsx)(j.Cr,{})};case"failed":return{title:"Failed Email",icon:(0,A.jsx)(j.ME,{})};case"bounced":return{title:"Bounced Email",icon:(0,A.jsx)(j.f$,{})};case"open":return{title:"Open Email",icon:(0,A.jsx)(j.IS,{})};default:return{title:"Click Email",icon:(0,A.jsx)(j.lG,{})}}}),[]);return(0,A.jsxs)(Et,{direction:"column",justify:"flex-start",gap:"20px",children:[(0,A.jsx)(r.__experimentalGrid,{columns:3,gap:5,children:s.map((e=>(0,A.jsxs)(Pt,{children:[(0,A.jsxs)(r.Flex,{gap:"10px",justify:"flex-start",style:{marginBottom:"20px"},children:[i(e).icon,(0,A.jsx)("p",{children:i(e).title})]}),(0,A.jsx)("h2",{children:n[e]})]},e)))}),(0,A.jsxs)("div",{className:"vendtics-campaign-details",children:[(0,A.jsx)("h3",{children:"Campaign Details"}),(0,A.jsxs)(r.Flex,{direction:"column",gap:"10px",justify:"flex-start",children:[(0,A.jsxs)("div",{className:"vendtics-campaign-details-content",children:[(0,A.jsx)("p",{children:"Type"}),(0,A.jsx)("h5",{style:{textTransform:"capitalize"},children:t?.type})]}),(0,A.jsxs)("div",{className:"vendtics-campaign-details-content",children:[(0,A.jsx)("p",{children:"Title"}),(0,A.jsx)("h5",{children:t?.name})]})]})]})]})}));var qt=n(48737);var Yt=n(51609);const Ht=(0,u.A)(r.Flex)`
	h2 {
		color: ${h.l.neutral900};
		font-size: 20px;
		font-weight: 600;
	}

	p {
		color: ${h.l.neutral700};
		text-align: center;
		font-size: 16px;
		font-style: normal;
		font-weight: 400;
		line-height: 22px;
	}
`,Qt=(0,u.A)(r.Flex)`
	margin-top: 40px;
	.vendtics-start-progress-content {
		span {
			width: 130px;
			color: ${h.l.neutral700};
			font-size: 16px;
			font-weight: 400;
			flex-basis: 30%;
		}
		p {
			color: ${h.l.neutral900};
			font-size: 16px;
			font-weight: 600;
			flex-basis: 70%;
		}
	}
`,Vt=u.A.p`
	color: ${h.l.neutral900};
	font-size: 20px;
	font-weight: 500;
	line-height: 28px;
`,Ut=({status:e})=>{const t=(0,Yt.useMemo)((()=>{switch(e){case"schedule":return"Campaign Scheduled";case"processing":return"Email Sending Process";case"paused":return"Email Sending Right Now...";case"cancel":return"Campaign Canceled";case"completed":return"Campaign Completed";default:return"In Queue"}}),[e]);return(0,A.jsx)(Vt,{children:t})};var Kt=n(63081);const Wt=(0,o.withDispatch)((e=>({pauseCampaign:e(p.A.CAMPAIGN_DETAILS).pauseCampaign}))),Zt=(0,d.compose)([Wt])((function(e){const{attributes:t,pauseCampaign:n,details:s}=e,{totals:i}=t||{},[a,o]=(0,l.useState)(!1),[d,x]=(0,l.useState)(i);(0,l.useEffect)((()=>{x(i)}),[i]);const p=(0,l.useMemo)((()=>d?.recipients>0?Math.round(d?.sent/d?.recipients*100):0),[d?.sent,d?.recipients]),h=[{key:"cancel",label:(0,A.jsx)("p",{children:(0,R.__)("Cancel","vendtics")})}];return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(r.Fill,{name:c.A.CAMPAIGN_DETAILS_SECONDARY_HEADER_RIGHT,children:(0,A.jsxs)(r.Flex,{gap:2,children:[(0,A.jsx)(S.A,{variant:w.zB,icon:(0,A.jsx)(j.mP,{}),sx:{backgroundColor:"#EF4444",color:"white",border:"1px solid #D2D4DA"},onClick:async()=>{o(!0);try{const e=await n();oe.Ay.success(e.message||"successfully campaign paused"),o(!1)}catch(e){oe.Ay.error(e.message||"Something went wrong! Please try again"),o(!1)}finally{o(!1)}},loading:a,children:"Pause Sending"}),(0,A.jsx)(Kt.A,{menu:{items:h,onClick(e){"cancel"===e.key&&(0,$.doAction)(kt,!0)}},placement:"bottomRight",trigger:"click",children:(0,A.jsx)(S.A,{variant:w.E3,sx:{height:"40px"},children:(0,A.jsx)(j.aR,{})})})]})}),(0,A.jsxs)(r.Flex,{direction:"column",align:"flex-start",justify:"center",gap:"15px",children:[(0,A.jsx)(r.FlexItem,{style:{alignSelf:"center"},children:(0,A.jsx)(dt,{percent:p,strokeColor:"#1C5DE8"})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Qt,{gap:"14px",direction:"column",children:s?.data.started_at&&(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"30px",className:"vendtics-start-progress-content",children:[(0,A.jsx)("span",{children:"Starting Time"}),(0,A.jsx)("p",{children:Se()(s?.data.started_at).format("MMM D, YYYY, h:mm A, [GTM]Z")})]})})})]})]})}));function Jt(e){const{attributes:t,details:n}=e,{totals:s}=t||{},i=(0,l.useMemo)((()=>s?.recipients>0?Math.round(s?.sent/s?.recipients*100):0),[s?.sent,s?.recipients]);return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(r.Flex,{direction:"column",align:"flex-start",justify:"center",gap:"15px",children:[(0,A.jsx)(r.FlexItem,{style:{alignSelf:"center"},children:(0,A.jsx)(dt,{percent:i,strokeColor:"#EF4444",campaignStatus:"cancel"})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(Qt,{gap:"14px",direction:"column",children:[(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"30px",className:"vendtics-start-progress-content",children:[(0,A.jsx)("span",{children:"Starting Time"}),(0,A.jsx)("p",{children:Se()(n?.data.started_at).format("MMM D, YYYY, h:mm A, [GTM]Z")})]}),n?.data.canceled_at&&(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"30px",className:"vendtics-start-progress-content",children:[(0,A.jsx)("span",{children:"Cancel Time "}),(0,A.jsx)("p",{children:Se()(n?.data.canceled_at).format("MMM D, YYYY, h:mm A, [GTM]Z")})]}),n?.data?.cancel_reason&&(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"30px",className:"vendtics-start-progress-content",children:[(0,A.jsx)("span",{children:"Cancel Note"}),(0,A.jsx)("p",{children:n?.data?.cancel_reason})]})]})})]})})}const Xt=(0,o.withDispatch)((e=>({resumeCampaign:e(p.A.CAMPAIGN_DETAILS).resumeCampaign}))),en=(0,d.compose)([Xt])((function(e){const{attributes:t,resumeCampaign:n,details:s,start:i}=e,{totals:a}=t||{},[o,d]=(0,l.useState)(!1),x=(0,l.useMemo)((()=>a?.recipients>0?Math.round(a?.sent/a?.recipients*100):0),[a?.sent,a?.recipients]),p=[{key:"cancel",label:(0,A.jsx)("p",{children:(0,R.__)("Cancel","vendtics")})}];return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(r.Fill,{name:c.A.CAMPAIGN_DETAILS_SECONDARY_HEADER_RIGHT,children:(0,A.jsxs)(r.Flex,{gap:2,children:[(0,A.jsx)(S.A,{variant:w.zB,icon:(0,A.jsx)(j.tr,{}),onClick:async()=>{d(!0);try{const e=await n();oe.Ay.success(e.message||"successfully campaign resume"),d(!1),e.message&&i()}catch(e){oe.Ay.error(e.message||"Something went wrong! Please try again"),d(!1)}finally{d(!1)}},loading:o,children:"Resume Sending"}),(0,A.jsx)(Kt.A,{menu:{items:p,onClick(e){"cancel"===e.key&&(0,$.doAction)(kt,!0)}},placement:"bottomRight",trigger:"click",children:(0,A.jsx)(S.A,{variant:w.E3,sx:{height:"40px"},children:(0,A.jsx)(j.aR,{})})})]})}),(0,A.jsxs)(r.Flex,{direction:"column",align:"flex-start",justify:"center",gap:"15px",children:[(0,A.jsx)(r.FlexItem,{style:{alignSelf:"center"},children:(0,A.jsx)(dt,{percent:x,strokeColor:"#F59E0B",campaignStatus:"paused"})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(Qt,{gap:"14px",direction:"column",children:[s?.data?.started_at&&(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"30px",className:"vendtics-start-progress-content",children:[(0,A.jsx)("span",{children:"Starting Time"}),(0,A.jsx)("p",{children:Se()(s?.data.started_at).format("MMM D, YYYY, h:mm A, [GTM]Z")})]}),s?.data?.paused_at&&(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"30px",className:"vendtics-start-progress-content",children:[(0,A.jsx)("span",{children:"Pause time"}),(0,A.jsxs)("p",{children:[" ",Se()(s?.data.paused_at).format("MMM D, YYYY, h:mm A, [GTM]Z")]})]})]})})]})]})})),tn=(0,o.withSelect)((e=>({id:e(p.A.CAMPAIGN_DETAILS).getId()}))),nn=(0,o.withDispatch)((e=>({markAsDraftCampaign:e(p.A.CAMPAIGN_DETAILS).markAsDraftCampaign}))),sn=(0,d.compose)([tn,nn])((e=>{const{id:t,markAsDraftCampaign:n}=e,i=(0,s.Zp)(),[a,r]=(0,l.useState)(!1);return(0,A.jsx)(ce.A,{title:(0,R.__)("Are you sure?","vendtics"),description:(0,R.__)("Are you sure you want to edit this campaign?","vendtics"),okText:(0,R.__)("Yes","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,R.__)("Cancel","vendtics"),onConfirm:async()=>{r(!0);try{const e=await n();r(!1),oe.Ay.success(e.message),i(`/campaigns/standard/${t}`)}catch(e){oe.Ay.error(e.message||"Something went wrong! Please try again"),r(!1)}finally{r(!1)}},placement:"bottomRight",loading:a,children:(0,A.jsx)(S.A,{variant:w.zB,children:(0,R.__)("Edit","vendtics")})})}));function an(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(r.Fill,{name:c.A.CAMPAIGN_DETAILS_SECONDARY_HEADER_RIGHT,children:(0,A.jsx)(sn,{})}),(0,A.jsxs)(Ht,{direction:"column",align:"center",justify:"center",gap:"15px",children:[(0,A.jsx)(j.$n,{}),(0,A.jsx)("h2",{children:"This Campaign is in the Pipeline"}),(0,A.jsxs)("p",{children:["The current campaign is running, with the ",(0,A.jsx)("br",{})," next one lined up to launch shortly."]}),(0,A.jsx)(we.N_,{to:"/campaigns",children:(0,A.jsx)(S.A,{variant:w.E3,sx:{border:`1px solid ${h.l.brand500}`,color:`${h.l.brand500}`},children:"Go to all campaigns"})})]})]})}var rn=n(82593);const ln=(0,o.withSelect)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{details:t.getDetails(),hasResolved:t.hasFinishedResolution("getDetails")}})),cn=(0,d.compose)([ln])((function(e){const{details:t,onFinish:n,hasResolved:s}=e,[i,a]=(0,l.useState)(Se()(t?.data?.schedule_time));return(0,l.useEffect)((()=>{s&&t?.data.schedule_time&&a(Se()(t?.data?.schedule_time))}),[s,t]),(0,A.jsxs)(r.Flex,{align:"center",justify:"center",style:{height:"100%"},children:[(0,A.jsx)(r.Fill,{name:c.A.CAMPAIGN_DETAILS_SECONDARY_HEADER_RIGHT,children:(0,A.jsx)(sn,{})}),(0,A.jsx)(rn.A,{targetDate:i,onFinishCountdown:()=>{_.isFunction(n)&&n()},label:"Emails sending Start"})]})}));function on(e){const{attributes:t,details:n}=e,{totals:s}=t||{},[i,a]=(0,l.useState)(s);(0,l.useEffect)((()=>{a(s)}),[s]);const c=(0,l.useMemo)((()=>i?.recipients>0?Math.round(i?.sent/i?.recipients*100):0),[i?.sent,i?.recipients]);return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(r.Flex,{direction:"column",align:"flex-start",justify:"center",gap:"15px",children:[(0,A.jsx)(r.FlexItem,{style:{alignSelf:"center"},children:(0,A.jsx)(dt,{percent:c||100,strokeColor:"#1C5DE8"})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(Qt,{gap:"14px",direction:"column",children:[n?.data.started_at&&(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"30px",className:"vendtics-start-progress-content",children:[(0,A.jsx)("span",{children:"Starting Time"}),(0,A.jsx)("p",{children:Se()(n?.data.started_at).format("MMM D, YYYY, h:mm A, [GTM]Z")})]}),n?.data.completed_at&&(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"30px",className:"vendtics-start-progress-content",children:[(0,A.jsx)("span",{children:"Completed Time"}),(0,A.jsx)("p",{children:Se()(n?.data.completed_at).format("MMM D, YYYY, h:mm A, [GTM]Z")})]})]})})]})})}const dn=e=>{const{attributes:t,status:n,start:s,details:i,id:a}=e;return(0,l.useCallback)((()=>{switch(n){case"schedule":return(0,A.jsx)(cn,{onFinish:s,details:i});case"processing":return(0,A.jsx)(Zt,{attributes:t,details:i});case"paused":return(0,A.jsx)(en,{attributes:t,details:i,start:s});case"completed":return(0,A.jsx)(on,{attributes:t,details:i});case"cancel":return(0,A.jsx)(Jt,{attributes:t,details:i});default:return(0,A.jsx)(an,{})}}),[n,i,s,t])()},xn=(0,o.withSelect)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{hasResolved:t.hasFinishedResolution("getAttributes")&&t.hasFinishedResolution("getDetails"),id:t.getId(),details:t.getDetails(),attributes:t.getAttributes()}})),pn=(0,o.withDispatch)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{refresh(){t.invalidateResolution("getAttributes")},refreshDetails(){t.invalidateResolution("getDetails")}}})),hn=(0,d.compose)([xn,pn,zt])((function(e){const{attributes:t,details:n,refresh:s,refreshDetails:i,id:a}=e,{start:r}=(({attributes:e,refresh:t,refreshDetails:n})=>{const{subscribe:s,start:i,stop:a}=(0,qt.cR)(3e3),[r,c]=(0,l.useState)(!0);return s(t),(0,l.useEffect)((()=>{["processing","in_queue"].includes(e.status)?(i(),"processing"===e.status&&r&&(n(),c(!1))):a()}),[e]),{start:i,stop:a}})({attributes:t,refresh:s,refreshDetails:i});return(0,A.jsx)(rt.A,{style:{height:"100%"},title:(0,A.jsx)(Ut,{status:t.status}),children:(0,A.jsx)(dn,{attributes:t,status:t.status,start:r,details:n,refresh:s,id:a})})})),un=(0,o.withSelect)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{attributes:t.getAttributes(),hasResolved:t.hasFinishedResolution("getAttributes")}})),mn=(0,d.compose)(un)((function(e){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Nt,{}),(0,A.jsxs)(Tt,{children:[(0,A.jsx)("div",{children:(0,A.jsx)(Bt,{})}),(0,A.jsx)("div",{children:(0,A.jsx)(hn,{})})]})]})}));var gn=n(4856);const jn=u.A.h2`
	color: ${h.A.neutral900};
	font-size: 22px;
	font-weight: 600;
	line-height: 28px;
`,An="vendtics-show-edit-campaign-title-modal",fn=(0,o.withSelect)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{details:t.getDetails(),hasResolved:t.hasFinishedResolution("getDetails")}})),yn=(0,o.withDispatch)((e=>({editStandardCampaignName:e(p.A.STANDARD_CAMPAIGNS).editStandardCampaignName}))),bn=(0,d.compose)([fn,yn])((function(e){const{details:t,editStandardCampaignName:n}=e,[s,i]=(0,l.useState)(!1),[a,c]=(0,l.useState)(""),[o,d]=(0,l.useState)("");return(0,l.useEffect)((()=>{t&&c(t?.data.name||"")}),[t]),(0,l.useLayoutEffect)((()=>((0,$.addAction)(An,"vendtics",(e=>{i(e)})),()=>{(0,$.removeAction)(An,"vendtics")})),[]),(0,A.jsx)(Dt.A,{visible:s,disableCloseRequestOnOuterClick:!0,onCloseRequest:()=>i(!1),width:"500px",children:(0,A.jsxs)(Ft.A,{onFinish:async e=>{d(!0);try{if(e.name){const t=await n({name:e.name});oe.Ay.success((0,R.__)(t.message,"vendtics")),d(!1)}}catch(e){d(!1),oe.Ay.error(e.message)}finally{d(!1),(0,$.doAction)(An,!1)}},initialValues:{name:a},children:[(0,A.jsx)(Dt.A.Header,{children:(0,A.jsx)(r.Flex,{align:"center",gap:2,children:(0,A.jsx)(jn,{children:(0,R.__)("Edit Campaign","vendtics")})})}),(0,A.jsx)(Dt.A.Body,{children:(0,A.jsx)(gn.A,{label:"Campaign Title",placeholder:"Enter campaign title",name:"name"})}),(0,A.jsx)(Dt.A.Footer,{children:(0,A.jsx)(r.Flex,{gap:2,justify:"flex-end",children:(0,A.jsx)(S.A,{variant:w.zB,htmlType:"submit",loading:o,children:(0,R.__)("Update campaign","vendtics")})})})]})})})),vn=u.A.section`
	display: grid;
	grid-template-columns: 1fr 570px;
	gap: 20px;
	margin-top: 20px;
`,Cn=u.A.div`
	background-color: ${h.l.light};
	border-radius: 16px;
	padding: 34px 30px;

	h2 {
		color: #1f2937;
		font-size: 18px;
		font-weight: 600;
		margin-bottom: 4px;
	}
	p {
		font-size: 12px;
		line-height: 16px;
		color: #6b7280;
	}
`,Sn=u.A.div`
	background-color: #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	height: 40px;
	width: 40px;
`;var wn=n(36847);function Fn(){return(0,A.jsx)(r.Flex,{style:{marginTop:"16px"},children:(0,A.jsx)(wn.A,{label:"Add UTM Parameters For URLs",editMode:!0,children:(0,A.jsxs)(r.Flex,{direction:"column",gap:"16px",children:[(0,A.jsxs)(r.__experimentalGrid,{columns:2,gap:5,children:[(0,A.jsx)(st.TextInput,{label:"Campaign Source",placeholder:"Campaign Source",type:"text",name:"utm_source"}),(0,A.jsx)(st.TextInput,{label:"Campaign Medium",placeholder:"Campaign Medium",type:"text",name:"utm_medium"})]}),(0,A.jsxs)(r.__experimentalGrid,{columns:2,gap:5,children:[(0,A.jsx)(st.TextInput,{label:"Campaign Name",placeholder:"Campaign Name",type:"text",name:"utm_campaign"}),(0,A.jsx)(st.TextInput,{label:"Campaign Term",placeholder:"Campaign Term",type:"text",name:"utm_term"})]}),(0,A.jsx)(r.__experimentalGrid,{columns:2,gap:5,children:(0,A.jsx)(st.TextInput,{label:"Campaign Content",placeholder:"Campaign Content",type:"text",name:"utm_content"})})]})})})}var In=n(14476),Dn=n(6299);const kn=In.Ay.object({subject:In.Ay.string({required_error:"Subject is required"}).trim().min(2,{message:"Subject is required"}),pre_header:In.Ay.string({required_error:"Pre header is required"}).trim().min(1,{message:"Pre header is required"}),utm_campaign:In.Ay.string({required_error:"Campaign name is required"}).trim(),utm_medium:In.Ay.string({required_error:"Campaign medium is required"}).trim(),utm_content:In.Ay.string({required_error:"Campaign content is required"}).trim(),utm_source:In.Ay.string({required_error:"Campaign source is required"}).trim(),utm_term:In.Ay.string({required_error:"Campaign term is required"}).trim()}),Rn=(0,Dn.w)(kn);var Nn=n(6994);const En=u.A.div`
	.ant-cascader-menu {
		min-width: 220px;
		min-height: 300px;
	}
`;function Tn(e){return(0,A.jsx)(En,{children:e})}function Pn(e){const t=e.icon||(()=>null);return(0,A.jsxs)(r.Flex,{gap:"8px",justify:"flex-start",align:"center",children:[(0,A.jsx)(t,{}),(0,A.jsx)("span",{children:e.label})]})}function Mn(e){const t=(0,l.useMemo)((()=>[{value:"contact",label:(0,R.__)("Contact","vendtics"),icon:j.EK,children:[{value:"first_name",label:(0,R.__)("First Name","vendtics")},{value:"last_name",label:(0,R.__)("Last Name","vendtics")},{value:"email",label:(0,R.__)("Email","vendtics")},{value:"phone",label:(0,R.__)("Phone","vendtics")},{value:"company",label:(0,R.__)("Company","vendtics")},{value:"designation",label:(0,R.__)("Designation","vendtics")},{value:"date_of_birth",label:(0,R.__)("Date of Birth","vendtics")},{value:"timezone",label:(0,R.__)("Timezone","vendtics")},{value:"city",label:(0,R.__)("City","vendtics")},{value:"state",label:(0,R.__)("State","vendtics")},{value:"postal_code",label:(0,R.__)("Postal Code","vendtics")},{value:"country",label:(0,R.__)("Country","vendtics")},{value:"status",label:(0,R.__)("Status","vendtics")},{value:"type",label:(0,R.__)("Type","vendtics")}]},{value:"business",label:(0,R.__)("Business","vendtics"),icon:j.EK,children:[{value:"company",label:(0,R.__)("Company","vendtics")},{value:"phone",label:(0,R.__)("Phone","vendtics")},{value:"address_line_one",label:(0,R.__)("Address Line One","vendtics")},{value:"address_line_two",label:(0,R.__)("Address Line Two","vendtics")},{value:"country",label:(0,R.__)("Country","vendtics")},{value:"state",label:(0,R.__)("State","vendtics")},{value:"city",label:(0,R.__)("City","vendtics")},{value:"zip_code",label:(0,R.__)("Zip Code","vendtics")},{value:"logo_url",label:(0,R.__)("Logo URL","vendtics")}]}]),[]),{form:n}=e;return(0,A.jsx)(Nn.A,{size:"large",style:{minWidth:"400px",width:"400px"},options:t,showSearch:!0,allowClear:!1,expandTrigger:"hover",onChange:(e,t)=>{let s=t.map((e=>e.value)).join(".");e&&n.setFieldValue("subject",n.getFieldValue("subject")+` {{${s}}}`)},placement:"topRight",dropdownRender:Tn,optionRender:Pn,children:(0,A.jsx)("div",{style:{cursor:"pointer"},children:(0,A.jsx)(j.mD,{})})})}function Ln(e){const{setEmailData:t,form:n}=e;return(0,A.jsxs)(Cn,{children:[(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"8px",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(Sn,{children:[" ",(0,A.jsx)(j.qY,{})]})}),(0,A.jsxs)(r.FlexItem,{children:[(0,A.jsx)("h2",{children:"Email Subject & Settings"}),(0,A.jsx)("p",{children:"Trigger the popup if a user stays inactive on the website and contiunes his"})]})]}),(0,A.jsxs)(r.Flex,{direction:"column",gap:"16px",style:{marginTop:"40px"},children:[(0,A.jsx)(st.TextInput,{label:"Email Subject",placeholder:"Write email subject",type:"text",name:"subject",value:n.getFieldValue("subject"),rules:[Rn],onChange:e=>{t((t=>({...t,subject:e.target.value}))),n.setFieldValue("subject",e.target.value)},suffix:(0,A.jsx)(Mn,{form:n})}),(0,A.jsx)(st.TextInput,{label:"Email Pre-header",placeholder:"Write email pre-header",type:"text",name:"pre_header",rules:[Rn],onChange:e=>t((t=>({...t,pre_header:e.target.value})))})]}),(0,A.jsx)(Fn,{})]})}var $n=n(12609);const Gn=(0,u.A)(r.Flex)`
	padding: 16px 20px;
	border: 1px solid ${h.l.neutral300};
	border-radius: 6px;

	.vendtics-switch-text {
		font-size: 16px;
		font-weight: 600;
		color: ${h.l.neutral900};
	}

	.ant-form-item {
		margin-bottom: 0;
	}
`;function zn(){return(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"8px",style:{marginBottom:"40px"},children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(Sn,{children:[" ",(0,A.jsx)(j.tF,{})]})}),(0,A.jsxs)(r.FlexItem,{children:[(0,A.jsx)("h2",{children:"Tracking & Automations"}),(0,A.jsx)("p",{children:"Select lists and tags that you want to send emails for this campaigns."})]})]})}function On(){return(0,A.jsxs)(Cn,{children:[(0,A.jsx)(zn,{}),(0,A.jsxs)(r.Flex,{gap:"16px",direction:"column",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(Gn,{children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)("h3",{className:"vendtics-switch-text",children:"Enable Open/Read Tracking"})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(st.Form.Item,{name:"tracking_open_read",children:(0,A.jsx)($n.A,{})})})]})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(Gn,{children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)("h3",{className:"vendtics-switch-text",children:"Enable Link Tracking"})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(st.Form.Item,{name:"tracking_link_click",children:(0,A.jsx)($n.A,{})})})]})})]})]})}var Bn=n(81392);const qn=u.A.h2`
	color: ${h.A.neutral900};
	font-size: 22px;
	font-weight: 600;
	line-height: 28px;
`,Yn=u.A.div`
	.ant-segmented {
		background: white;
		border: 1px solid ${h.A.neutral300};
		gap: 8px;
		margin-block: 20px;

		.ant-segmented-group {
			gap: 10px;
		}
	}
	.ant-segmented-item-icon {
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.ant-segmented-item-selected {
		border: 1px solid ${h.A.brand500};
		background-color: ${h.A.brand100};

		span {
			color: ${h.A.brand500};
		}
	}
	.ant-segmented-item-label {
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: transparent;
		font-weight: 600;

		.ant-checkbox-inner {
			border-radius: 100px;
		}
	}

	.vendtics-segment-label {
		font-size: 16px;
		font-weight: 600;
		color: ${h.A.neutral900};
	}

	.vendtics-send-now-campaign-text {
		color: ${h.A.neutral600};
		font-size: 16px;
		line-height: 28px;
		margin-block: 25px 10px;
		span {
			color: ${h.A.neutral900};
			font-weight: 600;
		}
	}

	.vendtics-schedule-campaign-helper-text {
		color: #6b7280;
		font-size: 12px;
		letter-spacing: 0.06px;
	}
`,Hn=u.A.p`
	font-size: 14px;
	font-weight: 600;
	line-height: normal;
	color: ${({launchCampaign:e})=>e?h.A.brand500:h.A.neutral900};
`;var Qn=n(91196);const Vn="vendtics_campaign_publish_modal_footer";function Un(e){const{children:t}=e;return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(r.Fill,{name:Vn,children:t})})}const Kn=e=>({utm_source:e.utm_source,utm_medium:e.utm_medium,utm_campaign:e.utm_campaign,utm_term:e.utm_term,utm_content:e.utm_content}),Wn=({values:e,lists:t,tags:n,query:s,campaignPayload:i,recipientSelectOption:a})=>{const r={recipient_type:a,subject:e.subject,pre_header:e.pre_header,body:i.emailBody,tracking_link_click:e.tracking_link_click?1:0,tracking_open_read:e.tracking_open_read?1:0,utm_parameters:Kn(e),name:i.campaignName};return"lists_tags"===a?(r.tags=n?.length?n.map((e=>e.id)):[],r.lists=t?.length?t.map((e=>e.id)):[]):"segment"===a?r.segment_id=+e.segment_id:r.advanced_filters=s,r},Zn=(0,o.withSelect)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{id:t.getId(),query:t.getQuery(),lists:t.getLists(),tags:t.getTags(),campaignPayload:t.getCampaignPayload(),recipientSelectOption:t.getRecipientSelectOption(),totalContacts:t.getCountRecipientsTotalContacts()}})),Jn=(0,o.withDispatch)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{publishSendNowCampaign:t.publishSendNowCampaign,editStandardCampaign:t.editStandardCampaign}})),Xn=(0,d.compose)([Zn,Jn])((function(e){const{id:t,lists:n,tags:i,query:a,totalContacts:c,campaignPayload:o,form:d,editStandardCampaign:x,recipientSelectOption:p,publishSendNowCampaign:h}=e,[u,m]=(0,l.useState)(!1),[g,f]=(0,l.useState)(!1),_=(0,s.Zp)();return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Un,{children:(0,A.jsx)(r.Flex,{gap:2,justify:"flex-end",children:(0,A.jsx)(S.A,{variant:w.zB,disabled:!u,loading:g,onClick:async()=>{f(!0);try{if(!o.emailBody)return oe.Ay.error("Please write your email body.");const e=d.getFieldsValue(),s=Wn({values:e,lists:n,tags:i,query:a,campaignPayload:o,recipientSelectOption:p});if(s.name&&s.pre_header&&(await x(s)).message){const e=await h();oe.Ay.success((0,R.__)(e.message,"vendtics")),_(`/campaigns/details/${t}/analytics`)}f(!1)}catch(e){f(!1),oe.Ay.error(e.message)}(0,$.doAction)(is.SHOW_CAMPAIGN_PUBLISH_MODAL,!1)},children:(0,R.__)("Publish","vendtics")})})}),(0,A.jsx)(r.Flex,{justify:"center",align:"center",children:(0,A.jsxs)(r.FlexItem,{style:{textAlign:"center"},children:[(0,A.jsx)(j.ym,{}),(0,A.jsxs)("p",{className:"vendtics-send-now-campaign-text",children:[(0,R.__)("This campaign is targeted to "),(0,A.jsx)("span",{children:c?.total||0}),(0,R.__)(" contacts")]}),(0,A.jsxs)(r.Flex,{justify:"center",align:"center",gap:"10px",children:[(0,A.jsx)(Qn.A,{onChange:()=>m((e=>!e)),checked:u})," ",(0,A.jsx)(Hn,{launchCampaign:u,children:(0,R.__)("Are you sure you want to launch the campaign now?")})]})]})})]})}));var es=n(79561);const ts=(0,o.withSelect)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{id:t.getId(),lists:t.getLists(),query:t.getQuery(),tags:t.getTags(),campaignPayload:t.getCampaignPayload(),recipientSelectOption:t.getRecipientSelectOption(),totalContacts:t.getCountRecipientsTotalContacts()}})),ns=(0,o.withDispatch)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{publishScheduleCampaign:t.publishScheduleCampaign,editStandardCampaign:t.editStandardCampaign}})),ss=(0,d.compose)([ts,ns])((function(e){const{id:t,lists:n,tags:i,query:a,campaignPayload:c,form:o,editStandardCampaign:d,recipientSelectOption:x,publishScheduleCampaign:p}=e,[h,u]=(0,l.useState)(!1),[m]=Ft.A.useForm(),g=(0,s.Zp)();return(0,A.jsxs)(l.Fragment,{children:[(0,A.jsx)(Un,{children:(0,A.jsx)(r.Flex,{gap:2,justify:"flex-end",children:(0,A.jsx)(S.A,{variant:w.zB,loading:h,onClick:m.submit,children:(0,R.__)("Publish","vendtics")})})}),(0,A.jsx)(Ft.A,{onFinish:async e=>{if(u(!0),!c.emailBody)return oe.Ay.error("Please write your email body.");try{const s=o.getFieldsValue(),r=Wn({values:s,lists:n,tags:i,query:a,campaignPayload:c,recipientSelectOption:x});if(r.name&&r.pre_header&&(await d(r)).message){const n={schedule_time:Se()(e.schedule_time).format("YYYY-MM-DD HH:mm:ss")},s=await p(n);oe.Ay.success((0,R.__)(s.message,"vendtics")),g(`/campaigns/details/${t}/analytics`)}u(!1)}catch(e){u(!1),oe.Ay.error(e.message)}(0,$.doAction)(is.SHOW_CAMPAIGN_PUBLISH_MODAL,!1)},form:m,children:(0,A.jsx)(es.A,{label:"Date & time",placeholder:"Select date & time",name:"schedule_time",showTime:!0,dateFormat:"YYYY-MM-DD HH:mm:ss",required:!0,handleDisabledDate:e=>{let t=Se()().startOf("day");return e&&e.isBefore(t)},rules:[{required:!0,message:"Please Select a date"}],help:(0,A.jsx)("p",{className:"vendtics-schedule-campaign-helper-text",children:"Campaign will be sent to the selected date & time."})})})]})})),is={SHOW_CAMPAIGN_PUBLISH_MODAL:"vendtics-show-campaign-publish-modal"},as=[{label:"Send Now",value:"send_now",icon:(0,A.jsx)(j.ws,{})},{label:"Schedule",value:"schedule",icon:(0,A.jsx)(j.bH,{})}],rs=function(e){const{form:t}=e,[n,s]=(0,l.useState)("send_now"),[i,a]=(0,l.useState)(!1);(0,l.useLayoutEffect)((()=>((0,$.addAction)(is.SHOW_CAMPAIGN_PUBLISH_MODAL,"vendtics",(e=>{a(e)})),()=>{(0,$.removeAction)(is.SHOW_CAMPAIGN_PUBLISH_MODAL,"vendtics")})),[]);const c=(0,l.useCallback)((()=>"send_now"===n?(0,A.jsx)(Xn,{form:t}):(0,A.jsx)(ss,{form:t})),[n]);return(0,A.jsxs)(Dt.A,{visible:i,disableCloseRequestOnOuterClick:!0,onCloseRequest:()=>a(!1),width:"500px",children:[(0,A.jsx)(Dt.A.Header,{children:(0,A.jsx)(r.Flex,{align:"center",gap:2,children:(0,A.jsx)(qn,{children:(0,R.__)("Campaign Publish","vendtics")})})}),(0,A.jsx)(Dt.A.Body,{children:(0,A.jsxs)(Yn,{children:[(0,A.jsx)(Bn.A,{options:as,onChange:s,size:"large",value:n,block:!0}),c()]})}),(0,A.jsx)(Dt.A.Footer,{children:(0,A.jsx)(r.Slot,{name:Vn})})]})};var ls=n(49120);const cs=function(){return(0,$.applyFilters)(ls.dy.VENDTICS_STANDARD_CAMPAIGN_DETAILS_ADVANCED_FILTER_MODAL)},os=(0,n(24893).Q)((function(){return(0,$.applyFilters)(ls.dy.VENDTICS_STANDARD_CAMPAIGN_SINGLE_ADVANCED_FILTER)})),ds=function(){return(0,$.applyFilters)(ls.dy.VENDTICS_STANDARD_CAMPAIGN_SINGLE_SEGMENT)},xs=u.A.h4`
	font-size: 16px;
	font-weight: 600;
	color: ${h.l.neutral900};
`,ps=u.A.div`
	margin-top: 40px;

	.ant-segmented {
		background: white;
		border: 1px solid ${h.l.neutral300};
		gap: 8px;
		margin-bottom: 30px;

		.ant-segmented-group {
			gap: 10px;
		}
	}

	.ant-segmented-item-selected {
		border: 1px solid ${h.l.brand500};
		background-color: ${h.l.brand100};
		.vendtics-segment-label {
			color: ${h.l.brand500};
		}
	}
	.ant-segmented-item-label {
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: transparent;
		font-weight: 600;

		.ant-checkbox-inner {
			border-radius: 100px;
		}
	}

	.vendtics-segment-label {
		font-size: 16px;
		font-weight: 600;
		color: ${h.l.neutral900};
	}
`,hs=((0,u.A)(r.Flex)`
	padding: 10px 20px;
	border: 1px solid ${h.l.neutral300};
	border-radius: 8px;

	.vendtics-advanced-filter {
		font-size: 16px;
		font-weight: 600;
		color: ${h.l.neutral900};
	}
`,(0,u.A)(De.A)`
	&.ant-tag {
		height: 30px;
		background-color: ${h.A.neutral200};
		border: none;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 6px;
		font-size: 14px;
		color: ${h.A.neutral700};

		.ant-tag-close-icon {
			background-color: transparent;
			height: 12px;
			width: 12px;
			padding: 2px;
			display: flex;
			align-items: center;
			justify-content: center;
			border-radius: 100%;
			&:hover {
				background-color: ${h.A.error};
				> svg {
					color: white;
				}
			}
			> svg {
				height: 8px;
				width: 8px;
			}
		}
	}
`),us=u.A.ul`
	overflow-y: scroll;
	max-height: 200px;
	height: 100%;

	&::-webkit-scrollbar {
		display: none;
	}

	& p {
		text-align: center;
		font-size: 14px;
		font-weight: 500;
	}
`,ms=u.A.li`
	padding: 8px 12px;
	border-radius: 5px;
	margin-bottom: 0px;
	cursor: pointer;
	&:hover {
		background-color: ${h.A.neutral200};
	}
	& label {
		width: 100% !important;
	}
`,gs=u.A.h3`
	font-size: 14px;
	font-weight: 600;
	color: ${h.A.neutral800};
	margin-block: 8px;
`;var js=n(28073);function As({handleSearch:e,title:t="Choose Tags"}){const n=(0,d.useDebounce)(e,300);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Q.A,{onChange:e=>n(e.target.value),placeholder:(0,R.__)("Search ...","vendtics")}),(0,A.jsx)(gs,{children:(0,R.__)(t,"vendtics")})]})}function fs({items:e,selectedItems:t,onChange:n}){return(0,A.jsx)(us,{children:t?.length>0?t.map(((t,s)=>(0,A.jsx)(ms,{children:(0,A.jsx)(Qn.A,{checked:e.map((e=>e.id)).includes(t.id),onChange:e=>n(e,t),children:t.name})},s))):(0,A.jsx)("p",{children:"Not Found!!"})})}var _s=n(22370);const ys=function(e){const{onChange:t,handleSearch:n,items:s,selectedItems:i}=e;return(0,A.jsx)(js.A,{title:(0,A.jsx)(As,{handleSearch:n}),trigger:"click",arrow:!1,content:(0,A.jsx)(fs,{items:s,selectedItems:i,onChange:t}),placement:"bottomLeft",zIndex:9999,children:(0,A.jsx)(S.A,{variant:w.E3,icon:(0,A.jsx)(_s.A,{}),sx:{height:"30px",border:"1px solid #1F66FF",fontSize:"14px",color:"#1F66FF",background:"#E9F0FF"},children:(0,R.__)("Add Tag","vendtics")})})},bs=(0,o.withSelect)((e=>{const t=e(p.A.TAGS),n=e(p.A.STANDARD_CAMPAIGNS);return{selectTags:t.getSelectTags(),tags:n.getTags()}})),vs=(0,o.withDispatch)((e=>({setTags:e(p.A.STANDARD_CAMPAIGNS).setTags}))),Cs=(0,d.compose)([bs,vs])((function(e){const{tags:t,setTags:n,selectTags:s}=e,[i,a]=(0,l.useState)(s.items);(0,l.useEffect)((()=>{s&&a(s.items)}),[s]);const c=async e=>{const s=t?t.filter((t=>t.id!==e)):[];n(s)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h2",{children:"Tags"}),(0,A.jsxs)(r.Flex,{gap:"6px",wrap:!0,justify:"flex-start",children:[t?.map((e=>(0,A.jsx)(hs,{closable:!0,onClose:()=>c(e.id),children:e.name},e.id))),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(ys,{items:t,selectedItems:i,onChange:async(e,s)=>{t.map((e=>e.id)).includes(s.id)?c(s.id):n([...t,s])},handleSearch:e=>{if(e){const t=i.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())));a(t)}else a(s.items)}})})]})]})})),Ss=function(e){const{onChange:t,handleSearch:n,items:s,selectedItems:i}=e;return(0,A.jsx)(js.A,{title:(0,A.jsx)(As,{handleSearch:n,title:"Choose Lists"}),trigger:"click",arrow:!1,content:(0,A.jsx)(fs,{items:s,selectedItems:i,onChange:t}),placement:"bottomLeft",zIndex:9999,children:(0,A.jsx)(S.A,{variant:w.E3,icon:(0,A.jsx)(_s.A,{}),sx:{height:"30px",border:"1px solid #1F66FF",fontSize:"14px",color:"#1F66FF",background:"#E9F0FF"},children:(0,R.__)("Add List","vendtics")})})},ws=(0,o.withSelect)((e=>{const t=e(p.A.LISTS),n=e(p.A.STANDARD_CAMPAIGNS);return{selectLists:t.getSelectLists(),lists:n.getLists()}})),Fs=(0,o.withDispatch)((e=>({setLists:e(p.A.STANDARD_CAMPAIGNS).setLists}))),Is=(0,d.compose)([ws,Fs])((function(e){const{lists:t,setLists:n,selectLists:s}=e,[i,a]=(0,l.useState)(s.items);(0,l.useEffect)((()=>{s&&a(s.items)}),[s]);const c=async e=>{const s=t?t.filter((t=>t.id!==e)):[];n(s)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h2",{children:"Lists"}),(0,A.jsxs)(r.Flex,{gap:"6px",wrap:!0,justify:"flex-start",children:[t?.map((e=>(0,A.jsx)(hs,{closable:!0,onClose:()=>c(e.id),children:e.name},e.id))),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Ss,{items:t,selectedItems:i,onChange:async(e,s)=>{t.map((e=>e.id)).includes(s.id)?c(s.id):n([...t,s])},handleSearch:e=>{if(e){const t=i.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())));a(t)}else a(s.items)}})})]})]})})),Ds=(0,o.withSelect)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{lists:t.getLists(),tags:t.getTags(),getCountRecipientsTotalContacts:t.getCountRecipientsTotalContacts}})),ks=(0,d.compose)([Ds])((function(e){const{lists:t,tags:n,getCountRecipientsTotalContacts:s}=e;return(0,l.useEffect)((()=>{(t?.length||n?.length)&&(async()=>{const e={lists:t,tags:n};try{await s("lists_tags",e)}catch(e){console.log(e.message)}})()}),[t,n,s]),(0,A.jsxs)(r.Flex,{direction:"column",gap:"20px",children:[(0,A.jsx)(Is,{}),(0,A.jsx)(Cs,{})]})})),Rs=[{title:"By List & Tag",value:"lists_tags"},{title:"By Dynamic Segment",value:"segment"},{title:"By Advanced Filter",value:"advanced_filter"}];function Ns({title:e,checked:t,value:n}){return(0,A.jsxs)(r.Flex,{gap:"5px",children:[(0,A.jsx)(Qn.A,{checked:t}),(0,A.jsx)("p",{className:"vendtics-segment-label",children:e}),"advanced_filter"!==n&&"segment"!==n||(0,_t.n_)()?null:(0,A.jsx)(j.uJ,{})]})}const Es=(0,o.withSelect)((e=>({recipientSelectOption:e(p.A.STANDARD_CAMPAIGNS).getRecipientSelectOption()}))),Ts=(0,o.withDispatch)((e=>({setRecipientSelectOption:e(p.A.STANDARD_CAMPAIGNS).setRecipientSelectOption}))),Ps=(0,d.compose)([Es,Ts])((function(e){const{recipientSelectOption:t,setRecipientSelectOption:n}=e,s=Rs.map((({title:e,value:n})=>({label:(0,A.jsx)(Ns,{value:n,title:e,checked:t===n}),value:n}))),i=(0,l.useCallback)((()=>{switch(t){case"segment":return(0,A.jsx)(ds,{});case"advanced_filter":return(0,A.jsx)(os,{});default:return(0,A.jsx)(ks,{})}}),[t]);return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(ps,{children:[(0,A.jsx)(Bn.A,{options:s,onChange:e=>{if(("advanced_filter"===e||"segment"===e)&&!(0,_t.n_)())return(0,$.doAction)(ls.Dz.SHOW_PRO_BADGE_MODAL,!0);n(e)},size:"large",value:t}),i(),(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"5px",style:{marginTop:"25px"},children:[(0,A.jsx)(j.Vk,{}),(0,A.jsx)("p",{children:"lists_tags"===t?"You are targeting all contacts in this email campaign as no tags or lists have been selected.":"You are targeting all contacts in this email campaign as no segment have been selected."})]})]})})})),Ms=(0,o.withSelect)((e=>({totalContacts:e(p.A.STANDARD_CAMPAIGNS).getCountRecipientsTotalContacts()}))),Ls=(0,d.compose)([Ms])((function(e){const{totalContacts:t}=e;return(0,A.jsxs)(r.Flex,{children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"8px",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(Sn,{children:[" ",(0,A.jsx)(j.DV,{})]})}),(0,A.jsxs)(r.FlexItem,{children:[(0,A.jsx)("h2",{children:(0,R.__)("Recipient Selection","vendtics")}),(0,A.jsx)("p",{children:(0,R.__)("Select lists and tags that you want to send emails for the campaigns.","vendtics")})]})]})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(xs,{children:(0,R.__)(`Total Contacts: ${t?.total||0}`,"venditcs")})})]})})),$s=(0,o.withSelect)((e=>({getCountRecipientsTotalContacts:e(p.A.STANDARD_CAMPAIGNS).getCountRecipientsTotalContacts}))),Gs=(0,d.compose)([$s])((function(e){const{getCountRecipientsTotalContacts:t}=e,n=async()=>{await t()};return(0,l.useEffect)((()=>{n()}),[n]),(0,A.jsxs)(Cn,{children:[(0,A.jsx)(Ls,{}),(0,A.jsx)(Ps,{})]})})),zs=u.A.h2`
	color: ${h.A.neutral900};
	font-size: 22px;
	font-weight: 600;
	line-height: 28px;
`,Os="vendtics-show-test-email-modal",Bs=(0,o.withSelect)((e=>({campaignPayload:e(p.A.STANDARD_CAMPAIGNS).getCampaignPayload()}))),qs=(0,o.withDispatch)((e=>({sendTestEmail:e(p.A.STANDARD_CAMPAIGNS).sendTestEmail}))),Ys=(0,d.compose)([Bs,qs])((function(e){const{subject:t,campaignPayload:n,sendTestEmail:s}=e,[i,a]=(0,l.useState)(!1),[c,o]=(0,l.useState)(!1);return(0,l.useLayoutEffect)((()=>((0,$.addAction)(Os,"vendtics",(e=>{a(e)})),()=>{(0,$.removeAction)(Os,"vendtics")})),[]),(0,A.jsx)(Dt.A,{visible:i,disableCloseRequestOnOuterClick:!0,onCloseRequest:()=>a(!1),width:"500px",children:(0,A.jsxs)(Ft.A,{onFinish:async e=>{const i={to:e.to,subject:t,body:n.emailBody};if(!t||!i.body)return oe.Ay.error("Please write your subject or email body ");o(!0);try{await s(i),oe.Ay.success("Send test email"),o(!1)}catch(e){o(!1),console.log(e.message),oe.Ay.error(e.message)}(0,$.doAction)(Os,!1)},children:[(0,A.jsx)(Dt.A.Header,{children:(0,A.jsx)(r.Flex,{align:"center",gap:2,children:(0,A.jsx)(zs,{children:"Test Email"})})}),(0,A.jsx)(Dt.A.Body,{children:(0,A.jsx)(gn.A,{label:"Write email address",placeholder:"Write email address",type:"email",required:!0,name:"to"})}),(0,A.jsx)(Dt.A.Footer,{children:(0,A.jsx)(r.Flex,{gap:2,justify:"flex-end",children:(0,A.jsx)(S.A,{variant:w.zB,htmlType:"submit",loading:c,children:"Send Email"})})})]})})})),Hs=(0,u.A)(r.FlexItem)`
	padding: 16px 20px;
	background: ${h.l.light};
	border-radius: 6px;
	border: 1px solid ${h.l.neutral200};
	display: flex;
	flex-direction: column;
	gap: 16px;
`,Qs=(0,u.A)(r.Flex)`
	padding: 16px 20px;
	border: 1px solid ${h.l.neutral200};
	border-radius: 6px;
`,Vs=u.A.div`
	h4 {
		font-size: 14px;
		font-weight: 500;
		color: ${h.l.neutral500};
		line-height: 20px;
		margin-bottom: 8px;
	}

	h2 {
		font-size: 20px;
		font-weight: 600;
		color: ${h.l.neutral900};
		line-height: 26px;
	}
	.ant-tag {
		padding: 4px 12px;
		font-size: 14px;
		color: ${h.l.neutral800};
		background: #3341551a;
		border: none;
		border-radius: 100px;
		margin-bottom: 8px;
	}
	p {
		font-size: 14px;
		color: ${h.l.neutral600};
		font-weight: 600;
	}
	.vendtics-svg-wrapper {
		border: 1px solid #edf0f4;
		height: 28px;
		width: 28px;
		display: flex;
		align-items: center;
		justify-content: center;
		box-shadow: rgba( 99, 99, 99, 0.2 ) 0px 2px 8px 0px;
		border-radius: 8px;
		background: #f8f8fa;
		cursor: pointer;
	}
`;var Us=n(6279),Ks=n.n(Us);const Ws=(0,o.withSelect)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{details:t.getDetails(),hasResolved:t.hasFinishedResolution("getDetails")}})),Zs=(0,d.compose)([Ws])((function(e){const{details:t}=e;Se().extend(Ks());const n=t?.data?.updated_at,s=n?Se()(n,"YYYY-MM-DD HH:mm:ss").fromNow():"Just now";return(0,A.jsxs)(Vs,{children:[(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:6,align:"center",children:[(0,A.jsx)("h4",{children:"Standard Campaign"}),(0,A.jsx)(De.A,{children:t?.data?.status})]}),(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:4,children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"4px",align:"center",children:[(0,A.jsx)("h2",{children:t?.data?.name}),(0,A.jsx)("div",{className:"vendtics-svg-wrapper",onClick:()=>{(0,$.doAction)(An,!0)},children:(0,A.jsx)(j.vL,{})})]})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"4px",align:"center",children:[(0,A.jsx)(j.O4,{}),(0,A.jsx)("p",{children:s})]})})]})]})}));var Js=n(32099);const Xs=(0,o.withSelect)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{campaignPayload:t.getCampaignPayload(),totalContacts:t.getCountRecipientsTotalContacts()}})),ei=(0,o.withDispatch)((e=>({deleteCampaign:e(p.A.STANDARD_CAMPAIGNS).deleteSingleStandardCampaign}))),ti=(0,d.compose)([Xs,ei])((function(e){const{form:t,deleteCampaign:n,campaignSaving:i,totalContacts:a,campaignPayload:c}=e,[o,d]=(0,l.useState)(!1),x=(0,s.Zp)();return(0,A.jsxs)(r.Flex,{gap:"10px",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(S.A,{icon:(0,A.jsx)(j.mY,{}),variant:w.Qq,onClick:()=>{(0,$.doAction)(Os,!0)},children:(0,R.__)("Test Email","vendtics")})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Js.A,{placement:"bottom",title:a&&a?.total?"":"can't publish campaign without recipient",children:(0,A.jsx)(S.A,{variant:w.Qq,sx:{background:"#F3F4F8"},onClick:()=>{if(t.getFieldValue("subject")&&t.getFieldValue("pre_header")&&c.emailBody?(0,$.doAction)(is.SHOW_CAMPAIGN_PUBLISH_MODAL,!0):t.validateFields(),!c.emailBody)return oe.Ay.error("Please write your email body.")},disabled:!a||!a?.total,children:(0,R.__)("Publish Campaign","vendtics")})})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(S.A,{variant:w.zB,onClick:t.submit,loading:i,children:(0,R.__)("Save Now","vendtics")})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(ce.A,{title:(0,R.__)("Delete Campaign","vendtics"),description:(0,R.__)("Are you sure you want to delete this Campaign?","vendtics"),okText:(0,R.__)("Confirm","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,R.__)("No","vendtics"),onConfirm:()=>{(async()=>{d(!0);try{await n(),d(!1),x("/campaigns/standard"),oe.Ay.success((0,R.__)("Campaign was deleted successfully","vendtics"))}catch(e){d(!1),oe.Ay.error(e.message)}})()},placement:"bottomLeft",children:(0,A.jsx)(S.A,{variant:w.Qq,sx:{background:"#F3F4F8"},disabled:o,children:(0,A.jsx)(j.d7,{})})})})]})}));function ni(e){return(0,A.jsx)(Hs,{children:(0,A.jsxs)(Qs,{justify:"space-between",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Zs,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(ti,{form:e.form,campaignSaving:e.isLoading})})]})})}function si({length:e=4}){return(0,A.jsx)(r.Flex,{direction:"column",children:Array.from({length:e}).map(((e,t)=>(0,A.jsx)(j.sM,{})))})}const ii=(0,u.A)(r.Flex)`
	padding-inline: 10px;
	.vendtics-inbox-name {
		color: ${h.l.neutral900};
		font-size: 12px;
		line-height: 14px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		width: 75px;
	}
	.vendtics-inbox-title {
		color: ${h.l.neutral900};
		font-size: 12px;
		font-weight: 600;
		line-height: 14px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		width: 105px;
		margin-left: 25px;
	}

	.vendtics-inbox-preheader {
		color: ${h.l.neutral600};
		overflow: hidden;
		text-overflow: ellipsis;
		font-size: 12px;
		font-weight: 400;
		line-height: 14px;
		white-space: nowrap;
		width: 150px;
		margin-left: 50px;
	}
`;function ai(e){const{emailData:t}=e;return(0,A.jsxs)(Cn,{children:[(0,A.jsx)("h2",{style:{marginBottom:"30px"},children:"Inbox Preview"}),(0,A.jsx)(si,{length:1}),(0,A.jsx)(r.Flex,{direction:"column",gap:"10px",style:{marginBlock:"10px"},children:(0,A.jsxs)(ii,{gap:"16px",align:"flex-start",justify:"flex-start",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(j.DB,{})}),(0,A.jsx)(r.FlexItem,{style:{marginLeft:"2px"},children:(0,A.jsx)(j.Pr,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)("p",{className:"vendtics-inbox-name",children:"Email From"})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)("h3",{className:"vendtics-inbox-title",children:t?.subject})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)("p",{className:"vendtics-inbox-preheader",children:t?.pre_header})})]})}),(0,A.jsx)(si,{length:3})]})}var ri=n(27174);const li=(0,o.withSelect)((e=>({campaignPayload:e(p.A.STANDARD_CAMPAIGNS).getCampaignPayload()}))),ci=(0,o.withDispatch)((e=>({setCampaignPayload:e(p.A.STANDARD_CAMPAIGNS).setCampaignPayload}))),oi=(0,d.compose)([li,ci])((function(e){const{campaignPayload:t,setCampaignPayload:n}=e;return(0,A.jsxs)(Cn,{children:[(0,A.jsx)("h2",{style:{marginBottom:"30px"},children:"Email Body"}),(0,A.jsx)(ri.A,{value:t?.emailBody||"",onChange:e=>n({emailBody:e}),useExtendStyles:!0})]})})),di=(0,d.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,details:s}=t;return!n&&_.isEmpty(s)?(0,A.jsx)(l.Fragment,{children:(0,A.jsx)(M.cU,{row:1})}):_.isEmpty(s)?null:(0,A.jsx)(e,{...t})}),"withLoading"),xi=(0,o.withSelect)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{details:t.getDetails(),query:t.getQuery(),hasResolved:t.hasFinishedResolution("getDetails"),id:t.getId(),campaignPayload:t.getCampaignPayload(),lists:t.getLists(),tags:t.getTags(),recipientSelectOption:t.getRecipientSelectOption()}})),pi=(0,o.withDispatch)((e=>{const t=e(p.A.STANDARD_CAMPAIGNS);return{setQuery:t.setQuery,editStandardCampaign:t.editStandardCampaign,setCampaignPayload:t.setCampaignPayload,setRecipientSelectOption:t.setRecipientSelectOption,setTags:t.setTags,setLists:t.setLists}})),hi=(0,d.compose)([xi,pi,di])((function(e){const{form:t,emailData:n,setEmailData:s,emailBody:i,isLoading:a,setEmailBody:c,query:o,setQuery:d,handleUpdateForm:x}=(e=>{const{lists:t,tags:n,query:s,setQuery:i,setTags:a,details:r,setLists:c,campaignPayload:o,setCampaignPayload:d,editStandardCampaign:x,recipientSelectOption:p,setRecipientSelectOption:h}=e,[u]=st.Form.useForm(),[m,g]=(0,l.useState)({}),[j,A]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{var e,t;switch(r?.data&&u.setFieldsValue({subject:null!==(e=r?.data.subject)&&void 0!==e?e:"",pre_header:null!==(t=r?.data.pre_header)&&void 0!==t?t:"",tracking_link_click:Boolean(+r?.data.tracking_link_click),tracking_open_read:Boolean(+r?.data.tracking_open_read),recipient_type:r?.data.recipient_type,utm_campaign:r?.data?.utm_parameters?.utm_campaign,utm_content:r?.data?.utm_parameters?.utm_content,utm_medium:r?.data?.utm_parameters?.utm_medium,utm_source:r?.data?.utm_parameters?.utm_source,utm_term:r?.data?.utm_parameters?.utm_term}),g({subject:r?.data.subject,pre_header:r?.data.pre_header}),d({campaignName:r?.data.name,emailBody:r?.data?.body||""}),h(r?.data.recipient_type),r?.data.recipient_type){case"segment":return u.setFieldValue("segment_id",r?.data?.segment_id);case"advanced_filter":return i(r?.data?.advanced_filters);default:a(r?.data?.tags.map((e=>({id:e.id,name:e.name})))||[]),c(r?.data?.lists.map((e=>({id:e.id,name:e.name})))||[])}}),[r]),{form:u,emailData:m,setEmailData:g,isLoading:j,handleUpdateForm:async e=>{if(!o.emailBody)return oe.Ay.error("Please write your email body.");const i=Wn({values:e,lists:t,tags:n,query:s,campaignPayload:o,recipientSelectOption:p});A(!0);try{const e=await x(i);return oe.Ay.success(e.message),A(!1),e}catch(e){oe.Ay.error(e.message),A(!1)}}}})(e);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ni,{form:t,isLoading:a}),(0,A.jsx)(bn,{}),(0,A.jsx)(rs,{form:t}),(0,A.jsx)(Ys,{subject:t.getFieldValue("subject"),body:i}),(0,A.jsx)(cs,{query:o,setQuery:d}),(0,A.jsx)(st.Form,{onFinish:x,form:t,children:(0,A.jsxs)(vn,{children:[(0,A.jsxs)(r.Flex,{direction:"column",gap:"20px",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Ln,{setEmailData:s,form:t})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Gs,{})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(On,{})})]}),(0,A.jsxs)(r.Flex,{direction:"column",gap:"20px",justify:"flex-start",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(ai,{emailData:n})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(oi,{content:i,setContent:c})})]})]})})]})})),ui=u.A.div`
	background-color: ${h.l.light};
	border-radius: 6px;
	padding: 34px 30px;
	border: 1px solid ${h.l.neutral300};

	h2 {
		color: #1f2937;
		font-size: 18px;
		font-weight: 600;
		margin-bottom: 4px;
	}
	p {
		font-size: 12px;
		line-height: 16px;
		color: #6b7280;
	}

	.vendtics-email-settings-content {
		display: flex;
		align-items: flex-start;
		flex-direction: column;
		justify-content: flex-start;
		gap: 20px;
		width: 100%;
		margin-bottom: 16px;
		margin-top: 40px;

		div {
			width: 100%;
			h3 {
				color: ${h.l.neutral900};
				font-size: 16px;
				font-weight: 600;
				margin-bottom: 12px;
			}
			p {
				border-radius: 6px;
				border: 1px solid ${h.l.neutral100};
				background: ${h.l.neutral100};
				color: ${h.l.neutral800};
				font-size: 16px;
				width: 100%;
				padding: 10px 12px;
			}
		}
	}

	.vendtics-utm_parameters-content {
		width: 100%;
		h3 {
			color: ${h.l.neutral900};
			font-size: 16px;
			font-weight: 600;
			margin-bottom: 12px;
		}
		p {
			border-radius: 6px;
			border: 1px solid ${h.l.neutral100};
			background: ${h.l.neutral100};
			color: ${h.l.neutral800};
			font-size: 16px;
			width: 100%;
			padding: 10px 12px;
		}
	}

	.vendtics-checkmark-text {
		color: ${h.l.neutral900};
		font-size: 16px;
		font-weight: 600;
	}

	.vendtics-advanced-filter-view {
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-radius: 6px;
		border: 1px solid ${h.l.neutral100};
		background: ${h.l.neutral100};
		padding: 20px 24px;

		h3 {
			color: ${h.l.neutral900};
			font-size: 16px;
			font-weight: 600;
		}
	}
	.vendtics-tracking-automation-view {
		border-radius: 6px;
		border: 1px solid ${h.l.neutral100};
		background: ${h.l.neutral100};
		padding: 20px 24px;
		margin-top: 10px;
		h3 {
			color: ${h.l.neutral900};
			font-size: 16px;
			font-weight: 600;
		}
	}
`,mi=u.A.div`
	background-color: #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	height: 40px;
	width: 40px;
`,gi=(0,u.A)(De.A)`
	&.ant-tag {
		height: 30px;
		background-color: ${h.l.neutral200};
		border: none;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 6px;
		font-size: 14px;
		color: ${h.l.neutral700};

		&.ant-tag-close-icon {
			padding: 2px;

			&:hover {
				color: white;
				background-color: ${h.l.error};
				border-radius: 50%;
			}
		}
	}
`;function ji(e){const{details:t}=e;return(0,A.jsxs)(ui,{children:[(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"8px",style:{marginBottom:"30px"},children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(mi,{children:[" ",(0,A.jsx)(j.tF,{})]})}),(0,A.jsxs)(r.FlexItem,{children:[(0,A.jsx)("h2",{children:(0,R.__)("Tracking & Automations","vendtics")}),(0,A.jsx)("p",{children:(0,R.__)("Select lists and tags that you want to send emails for the campaigns.","vendtics")})]})]}),t?.data?.tracking_open_read&&(0,A.jsx)("div",{className:"vendtics-tracking-automation-view",children:(0,A.jsx)("h3",{children:"Enable Open/Read Tracking"})}),t?.data?.tracking_link_click&&(0,A.jsx)("div",{className:"vendtics-tracking-automation-view",children:(0,A.jsx)("h3",{children:"Enable Link Tracking"})})]})}function Ai(e){const{details:t}=e,n=(0,l.useCallback)((e=>{switch(e){case"utm_source":return"UTM Source";case"utm_medium":return"UTM Medium";case"utm_campaign":return"UTM Campaign";case"utm_term":return"UTM Term";default:return"UTM Content"}}),[]);return(0,A.jsxs)(ui,{children:[(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"8px",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(mi,{children:(0,A.jsx)(j.qY,{})})}),(0,A.jsxs)(r.FlexItem,{children:[(0,A.jsx)("h2",{children:"Email Subject & Settings"}),(0,A.jsx)("p",{children:"Trigger the popup if a user stays inactive on the website and contiunes his"})]})]}),(0,A.jsxs)("div",{className:"vendtics-email-settings-content",children:[t?.data.subject&&(0,A.jsxs)("div",{children:[(0,A.jsx)("h3",{children:"Email Subject"}),(0,A.jsx)("p",{children:t?.data.subject})]}),t?.data?.pre_header&&(0,A.jsxs)("div",{children:[(0,A.jsx)("h3",{children:"Email Pre-header"}),(0,A.jsx)("p",{children:t?.data?.pre_header})]})]}),t?.data.utm_parameters&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(r.Flex,{gap:"10px",justify:"flex-start",style:{marginBottom:"20px"},children:[(0,A.jsx)(j.De,{}),(0,A.jsx)("h4",{className:"vendtics-checkmark-text",children:"UTM Parameters For URLs"})]}),(0,A.jsx)(r.__experimentalGrid,{columns:2,gap:5,children:Object.entries(t?.data.utm_parameters).map((([e,t])=>t&&(0,A.jsxs)("div",{className:"vendtics-utm_parameters-content",children:[(0,A.jsx)("h3",{children:n(e)}),(0,A.jsx)("p",{children:t})]})))})]})]})}const fi="vendtics-show-advanced-filter-modal",_i=(0,_t.n_)()?fi:null,yi=function(){return(0,$.applyFilters)(ls.dy.VENDTICS_STANDARD_CAMPAIGN_VIEW_ADVANCED_FILTER,_i)};function bi(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(r.Flex,{gap:"10px",justify:"flex-start",style:{marginBlock:"40px 30px"},children:[(0,A.jsx)(j.De,{}),(0,A.jsx)("h4",{className:"vendtics-checkmark-text",children:"Advanced Filter"})]}),(0,A.jsxs)("div",{className:"vendtics-advanced-filter-view",children:[(0,A.jsx)("h3",{children:"View custom contacts by advanced filters"}),(0,A.jsxs)(S.A,{variant:w.Rm,sx:{borderColor:`${h.l.brand500}`,color:`${h.l.brand500}`},icon:(0,A.jsx)(j.or,{}),onClick:()=>{if(!(0,_t.n_)())return(0,$.doAction)(ls.Dz.SHOW_PRO_BADGE_MODAL,!0);(0,$.doAction)(fi,!0)},children:["View Advanced Filters"," ",(0,_t.n_)()?null:(0,A.jsx)(j.uJ,{})]})]})]})}function vi(e){const{details:t}=e;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(r.Flex,{gap:"10px",justify:"flex-start",style:{marginBlock:"40px 30px"},children:[(0,A.jsx)(j.De,{}),(0,A.jsx)("h4",{className:"vendtics-checkmark-text",children:"List & Tag"})]}),(0,A.jsx)("h4",{className:"vendtics-checkmark-text",children:"Lists"}),(0,A.jsx)(r.Flex,{gap:"6px",wrap:!0,justify:"flex-start",style:{marginBlock:"8px 16px"},children:t?.data?.tags.map(((e,t)=>(0,A.jsx)(gi,{children:e.name},t)))}),(0,A.jsx)("h4",{className:"vendtics-checkmark-text",children:"Tags"}),(0,A.jsx)(r.Flex,{gap:"6px",wrap:!0,justify:"flex-start",style:{marginBlock:"8px 16px"},children:t?.data?.lists.map(((e,t)=>(0,A.jsx)(gi,{children:e.name},t)))})]})}const Ci=function(){return(0,$.applyFilters)(ls.dy.VENDTICS_STANDARD_CAMPAIGN_VIEW_SEGMENTS,(0,A.jsx)(Si,{}))};function Si(){return(0,A.jsxs)("div",{className:"vendtics-advanced-filter-view",style:{marginTop:"20px"},children:[(0,A.jsx)("h3",{children:"View segments"}),(0,A.jsxs)(S.A,{variant:w.Rm,sx:{borderColor:`${h.l.brand500}`,color:`${h.l.brand500}`},onClick:()=>{(0,_t.n_)()||(0,$.doAction)(ls.Dz.SHOW_PRO_BADGE_MODAL,!0)},children:["View Segments",(0,_t.n_)()?null:(0,A.jsx)(j.uJ,{})]})]})}function wi(e){const{details:t}=e,n=(0,l.useMemo)((()=>{switch(t?.data?.recipient_type){case"segment":return(0,A.jsx)(Ci,{});case"advanced_filter":return(0,A.jsx)(bi,{});default:return(0,A.jsx)(vi,{details:t})}}),[t]);return(0,A.jsxs)(ui,{children:[(0,A.jsx)(yi,{details:t}),(0,A.jsxs)(r.Flex,{justify:"flex-start",gap:"8px",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsxs)(mi,{children:[" ",(0,A.jsx)(j.DV,{})]})}),(0,A.jsxs)(r.FlexItem,{children:[(0,A.jsx)("h2",{children:(0,R.__)("Recipient Selection","vendtics")}),(0,A.jsx)("p",{children:(0,R.__)("Select lists and tags that you want to send emails for the campaigns.","vendtics")})]})]}),n]})}const Fi=(0,o.withSelect)((e=>{const t=e(p.A.CAMPAIGN_DETAILS);return{attributes:t.getAttributes(),details:t.getDetails(),hasResolved:t.hasFinishedResolution("getDetails")}})),Ii=(0,d.compose)([Fi])((function(e){const{details:t,hasResolved:n}=e,[s,i]=(0,l.useState)(400);return(0,A.jsxs)(r.Flex,{justify:"space-between",gap:"26px",align:"flex-start",children:[(0,A.jsx)(r.FlexItem,{style:{width:"100%"},children:(0,A.jsxs)(r.Flex,{direction:"column",gap:"20px",children:[(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(Ai,{details:t})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(wi,{details:t})}),(0,A.jsx)(r.FlexItem,{children:(0,A.jsx)(ji,{details:t})})]})}),(0,A.jsx)(r.FlexItem,{style:{flexBasis:"800px"},children:(0,A.jsx)(ui,{children:(0,A.jsx)("iframe",{srcDoc:t?.data?.html,height:s,onLoad:e=>{const t=e.target.contentWindow.document.documentElement.scrollHeight;i(t)}})})})]})}));function Di(){return(0,A.jsxs)(s.BV,{children:[(0,A.jsxs)(s.qh,{element:(0,A.jsx)(i.c,{}),children:[(0,A.jsx)(s.qh,{index:!0,element:(0,A.jsx)(a.A,{children:(0,A.jsx)(ge,{})},"all")}),(0,A.jsx)(s.qh,{path:"split",element:(0,A.jsx)(a.A,{children:(0,A.jsx)(it,{})},"split")}),(0,A.jsx)(s.qh,{path:"sequences",element:(0,A.jsx)(a.A,{children:(0,A.jsx)(at,{})},"sequences")})]}),(0,A.jsxs)(s.qh,{path:"standard/*",children:[(0,A.jsx)(s.qh,{element:(0,A.jsx)(i.c,{}),children:(0,A.jsx)(s.qh,{index:!0,element:(0,A.jsx)(a.A,{children:(0,A.jsx)(et,{})},"standard")})}),(0,A.jsx)(s.qh,{path:":id",element:(0,A.jsx)(i.fD,{}),children:(0,A.jsx)(s.qh,{index:!0,element:(0,A.jsx)(a.A,{children:(0,A.jsx)(hi,{})},"standard-single")})})]}),(0,A.jsxs)(s.qh,{path:"details/*",children:[(0,A.jsx)(s.qh,{index:!0,element:(0,A.jsx)(s.C5,{to:"/campaigns",replace:!0})}),(0,A.jsxs)(s.qh,{path:":id/*",element:(0,A.jsx)(i.tm,{}),children:[(0,A.jsx)(s.qh,{index:!0,element:(0,A.jsx)(s.C5,{to:"analytics",replace:!0})}),(0,A.jsx)(s.qh,{path:"analytics",element:(0,A.jsx)(a.A,{children:(0,A.jsx)(mn,{})},"details-analytics")}),(0,A.jsx)(s.qh,{path:"view",element:(0,A.jsx)(a.A,{children:(0,A.jsx)(Ii,{})},"details-view")}),(0,A.jsx)(s.qh,{path:"recipients",element:(0,A.jsx)(a.A,{children:(0,A.jsx)(wt,{})},"details-contacts")})]})]})]})}}}]);