"use strict";(globalThis.webpackChunkwpmvc=globalThis.webpackChunkwpmvc||[]).push([[725],{27174:(e,t,n)=>{t.A=void 0;var s,i=n(86087),r=(s=n(88611))&&s.__esModule?s:{default:s};function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}t.A=function(e){var t,n=e.value,s=e.onChange,l=e.height,a=void 0===l?250:l,c=e.useExtendStyles,d=void 0!==c&&c,h=e.hasMedia,u=void 0===h||h,x=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var s,i,r,o,l=[],a=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(s=r.call(n)).done)&&(l.push(s.value),l.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{if(!a&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,i.useState)(!1),2),p=x[0],m=x[1],g=(0,i.useRef)(null),j=(0,i.useMemo)((function(){return"wp_editor_".concat(Date.now()+parseInt(1e3*Math.random()))}),[]),A=!(null===(t=window.wp)||void 0===t||!t.editor),v=function(e){g.current=e,e.on("init",(function(){e.setContent(n)})),e.on("change",(function(){s(e.getContent())})),m(!0)};return(0,i.useEffect)((function(){g.current&&n!==g.current.getContent()&&g.current.setContent(n)}),[n]),(0,i.useEffect)((function(){p&&setTimeout((function(){g.current.setContent(n)}),500)}),[p]),(0,i.useEffect)((function(){return A&&(window.wp.editor.remove(j),window.wp.editor.initialize(j,{tinymce:{height:a,toolbar1:"formatselect,table,bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,underline,strikethrough,forecolor,removeformat,codeformat,outdent,indent,undo,redo",menubar:!1,setup:v},quicktags:!0,mediaButtons:u})),function(){A&&window.wp.editor.remove(j)}}),[A]),React.createElement(r.default,{extend:d.toString()},React.createElement("textarea",{className:"wpmvc-classic-editor",id:j}))}},88611:(e,t,n)=>{var s,i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=((s=n(21250))&&s.__esModule?s:{default:s}).default.div(i||(i=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n\t","\n\n\t.mce-toolbar .mce-btn i {\n\t\tfont-family: 'dashicons' !important;\n\t}\n\n\t.mce-ico {\n\t\tfont-family: 'tinymce', Arial !important;\n\t}\n\n\t.wpmvc-classic-editor {\n\t\tvisibility: visible !important;\n\t\twidth: 100%;\n\t}\n"])),(function(e){return"true"===e.extend&&"\n\t\tborder: 1px solid #dadbdd;\n\t\tborder-radius: 8px;\n\t\toverflow: hidden;\n\t\tposition: relative;\n\t\tbackground-color: #fff;\n\n\t\t.wp-editor-tabs,\n\t\t.wp-media-buttons {\n\t\t\tpadding: 8px;\n\t\t}\n\n\t\t.wp-editor-container {\n\t\t\tborder: 0;\n\t\t}\n\n\t\t.wp-switch-editor {\n\t\t\theight: auto;\n\t\t\tmargin: 0 0 0 4px;\n\t\t\tbackground-color: transparent;\n\t\t\tpadding: 7px 14px;\n\t\t\tfont-size: 14px;\n\t\t\tborder-radius: 5px;\n\t\t\tline-height: inherit;\n\t\t\tborder-color: transparent;\n\t\t\tfloat: none;\n\t\t\tfont-weight: 500;\n\t\t}\n\n\t\t.tmce-active .switch-tmce,\n\t\t.html-active .switch-html {\n\t\t\tbackground-color: #ededed;\n\t\t\tborder-color: #dadbdd;\n\t\t\tcolor: #1e1f21;\n\t\t}\n\n\t\t.mce-top-part {\n\t\t\tbackground: #f1f1f0;\n\n\t\t\t&:before {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t}\n\n\t\t.mce-toolbar-grp {\n\t\t\tborder: 0;\n\t\t}\n\n\t\t.wpmvc-classic-editor {\n\t\t\tpadding: 15px;\n\t\t\tborder: none;\n\n\t\t\t&:focus {\n\t\t\t\tbox-shadow: none;\n\t\t\t\tborder: none;\n\t\t\t}\n\t\t}\n\t"}));t.default=r},24893:(e,t,n)=>{n.d(t,{Q:()=>l});var s=n(51962),i=n(31890),r=n(38800),o=n(10790);function l(e){return t=>{const{bgUrl:n,...l}=t;return(0,r.n_)()?(0,o.jsx)(e,{...l}):(0,o.jsxs)(i.ComingSoon,{bgUrl:n,children:[(0,o.jsx)("h3",{children:"Upgrade to Pro"}),(0,o.jsx)("p",{children:"Get access to this premium feature with Vendtics PRO version!"}),(0,o.jsx)(i.Button,{variant:s.zB,sx:{background:"#F59E0B",border:"none"},children:"Upgrade to Pro!"})]})}}},50352:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ts});var s=n(47767),i=n(85011),r=n(86087),o=n(56427),l=n(67601),a=n(47143),c=n(29491),d=n(16772),h=n(70885),u=n(60258),x=n(71479);const p=x.A.div`
	padding: 30px;
	border-radius: 6px;
	border: 1px solid ${u.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: ${u.A.neutral700};
			text-transform: capitalize;
		}
		& > div {
			display: flex;
			align-items: baseline;
			gap: 5px;

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

	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding-inline: 32px;
`;var g=n(89745),j=n(10790);const A=(0,c.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,counts:s}=t;return!n&&_.isEmpty(s)?(0,j.jsx)(o.Fill,{name:l.A.CONTACTS_SECONDARY_HEADER_AFTER,children:(0,j.jsx)(o.__experimentalGrid,{columns,gap:4,children:Array.from({length:columns}).map(((e,t)=>(0,j.jsx)(m,{children:(0,j.jsx)(g.QE,{})},t)))})}):_.isEmpty(s)?null:(0,j.jsx)(e,{...t})}),"withLoading"),v=(0,a.withSelect)((e=>{const t=e(h.A.CONTACTS);return{countsVisibility:t.getCountsVisibility(),counts:t.getCounts(),hasResolved:t.hasFinishedResolution("getCounts")}})),y=(0,a.withDispatch)((e=>(e(h.A.CONTACTS).invalidateResolution("getCounts"),{}))),f=(0,c.compose)([y,v,A])((function(e){const t=(0,r.useRef)(null),{countsVisibility:n,counts:s}=e,i=(0,r.useCallback)((e=>{const t={all:{title:"Total Contacts",icon:(0,j.jsx)(g.qc,{})},subscribe:{title:"Subscribed",icon:(0,j.jsx)(g.Y1,{})},unsubscribe:{title:"Unsubscribed",icon:(0,j.jsx)(g.E0,{})},default:{title:"Pending",icon:(0,j.jsx)(g.tU,{})}};return t[e]||t.default}),[]);return(0,j.jsx)(o.Fill,{name:l.A.CONTACTS_SECONDARY_HEADER_AFTER,children:(0,j.jsx)(d.A,{in:n,timeout:280,classNames:"vendtics-fade-down",unmountOnExit:!0,nodeRef:t,children:(0,j.jsx)("div",{ref:t,children:(0,j.jsx)(o.__experimentalGrid,{columns:4,gap:4,children:Object.entries(s.counts).map((([e,t],n)=>(0,j.jsxs)(p,{children:[i(e).icon,(0,j.jsxs)("div",{children:[(0,j.jsx)("h3",{children:i(e).title}),(0,j.jsx)("div",{children:(0,j.jsx)("p",{children:t})})]})]},n)))})})})})}));var b=n(27723),C=n(31890),w=n(52619),S=n(74353),T=n.n(S),F=n(90888),R=n(38800),N=n(48737);const E="vendtics-show-add-contact-modal",L=(0,a.withDispatch)((e=>({createContactHandlar:e(h.A.CONTACTS).createNewContact}))),k=(0,c.compose)([L])((function(e){const[t]=C.Form.useForm(),{createContactHandlar:n}=e,{visible:s,setVisible:i,handleSubmit:l,isLoading:a}=((e,t)=>{const[n,s]=(0,r.useState)(!1),[i,o]=(0,r.useState)(!1);return(0,N.$3)(E,(e=>{s(e)})),{visible:n,setVisible:s,isLoading:i,handleSubmit:async n=>{o(!0);try{const s={...(0,R.uH)(n)};n.date_of_birth&&(s.date_of_birth=T()(n.date_of_birth).format("YYYY-MM-DD")),s.status=s?.status?n.status:"pending";const i=await e(s);F.Ay.success((0,b.__)(i.message||"New contact Created","vendtics")),o(!1),t.resetFields()}catch(e){o(!1),console.log("error",e),F.Ay.error(e.messsage)}(0,w.doAction)(E,!1)}}})(n,t);return(0,j.jsx)(r.Fragment,{children:(0,j.jsxs)(C.Modal,{visible:s,width:"800px",onCloseRequest:()=>i(!1),children:[(0,j.jsx)(C.Modal.Header,{children:(0,b.__)("Add New Contact","vendtics")}),(0,j.jsx)(C.Modal.Body,{children:(0,j.jsx)(C.Form,{onFinish:l,form:t,scrollToFirstError:{behavior:"smooth"},initialValues:{status:"pending"},children:(0,j.jsx)(C.ContactForm,{form:t})})}),(0,j.jsx)(C.Modal.Footer,{children:(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(C.Button,{variant:C.base,onClick:()=>i(!1),sx:{border:"1px solid transparent"},children:(0,b.__)("Close","vendtics")}),(0,j.jsx)(C.Button,{variant:C.primary,loading:a,onClick:t.submit,children:(0,b.__)("Add Contact","vendtics")})]})})]})})}));var I=n(65752),O=n(71804),D=n(85777),B=n(11402),$=n(51962);const H=(0,x.A)(o.Flex)`
	min-height: 460px;
	height: 100%;
	h4 {
		color: ${u.A.neutral900};
		text-align: center;
		font-size: 24px;
		font-weight: 600;
		margin-bottom: 10px;

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

	p {
		color: ${u.A.neutral800};
		font-size: 14px;
	}
`,z=(0,a.withSelect)((e=>({rules:e(h.A.CONTACTS).getQuery().rules}))),M=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{clear(){t.resetQuery(),t.invalidateResolution("getList")}}})),P=(0,c.compose)([z,M])((function(e){const{rules:t,clear:n}=e;return(0,j.jsxs)(H,{justify:"center",align:"center",gap:5,direction:"column",children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(O.r,{})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)("div",{children:[(0,j.jsxs)("h4",{children:["No Contacts Found"," ",(0,j.jsx)("span",{children:t.length?t[0].value:null})]}),(0,j.jsx)("p",{children:" Adjust your filters to see your contacts"})]})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(B.A,{onClick:n,icon:(0,j.jsx)(D.H,{}),variant:$.Rm,sx:{border:`1px solid ${u.A.brand500}`,color:u.A.brand500},children:"Clear Search"})})]})})),q=(0,x.A)(o.Flex)`
	min-height: 460px;
	height: 100%;
	h4 {
		color: ${u.A.neutral900};
		text-align: center;
		font-size: 24px;
		font-weight: 600;
		margin-bottom: 10px;

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

	p {
		color: ${u.A.neutral800};
		font-size: 14px;
	}
`,Q=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{clear(){t.resetQuery(),t.invalidateResolution("getList")}}})),K=(0,c.compose)([Q])((function(e){const{clear:t}=e;return(0,j.jsxs)(q,{justify:"center",align:"center",gap:5,direction:"column",children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(O.r,{})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)("div",{children:[(0,j.jsx)("h4",{children:"No Lists Have Been Added Yet"}),(0,j.jsx)("p",{children:" Refine your filters to find the lists you need"})]})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(B.A,{onClick:t,icon:(0,j.jsx)(D.H,{}),variant:$.Rm,sx:{border:`1px solid ${u.A.brand500}`,color:u.A.brand500},children:"Clear All Filters"})})]})}));var G=n(27862);var U=n(71579);const V=(0,c.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,contactList:s}=t;return!n&&_.isEmpty(s)?(0,j.jsx)(r.Fragment,{children:(0,j.jsx)(U.cU,{row:4})}):_.isEmpty(s)?null:(0,j.jsx)(e,{...t})}),"withLoading");var Y=n(20114);const W=(0,c.createHigherOrderComponent)((e=>t=>{const{contactList:n,rules:s}=t;return!_.isEmpty(n)&&n.total>0?(0,j.jsx)(e,{...t}):_.isEmpty(s)||n?.total?(0,j.jsxs)(Y.A,{children:[(0,j.jsx)("h3",{children:(0,b.__)("No data is available","vendtics")}),(0,j.jsxs)("p",{children:["This section will be updated once data ",(0,j.jsx)("br",{})," has been collected."]}),(0,j.jsxs)(o.Flex,{align:"center",justify:"center",gap:3,children:[(0,j.jsx)(B.A,{icon:(0,j.jsx)(g.XM,{}),iconPosition:"end",variant:$.Rm,children:"Learn More"}),(0,j.jsx)(B.A,{variant:$.zB,onClick:()=>{(0,w.doAction)(E,!0)},children:"Add Contact"})]})]}):(0,j.jsx)(e,{...t})}),"withEmpty"),J=(0,a.withSelect)((e=>{const t=e(h.A.CONTACTS);return{columns:t.getColumns(),rowKeys:t.getRowKeys(),contactList:t.getList(),rules:t.getQuery().rules,pagination:t.getPagination(),getOrderById:t.getOrderById,hasResolved:t.hasFinishedResolution("getList")}})),X=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{setPagination:t.setPagination,setRowKeys:t.setRowKeys,setOrder:t.setOrder,refreshList:()=>t.invalidateResolution("getList")}})),Z=(0,c.compose)([X,J,V,W])((function(e){const{contactList:t,pagination:n,hasResolved:s,rowKeys:i,setRowKeys:o}=e,{onPaginationChange:l,renderEmptyScreen:a,onTableChange:c,columnsContactWithOrder:d}=(e=>{const{setPagination:t,rules:n,refreshList:s,getOrderById:i,setOrder:o,columns:l}=e,a=(0,w.applyFilters)("vendtics-contact-table-columns",G.A,!1),c=(0,r.useCallback)(((e,n)=>{t({current:e,pageSize:n}),s()}),[t,s]),d=(0,r.useMemo)((()=>{const e=Object.keys(l).filter((e=>l[e])).concat(["action"]);return(_.isEmpty(a)?G.A:a).filter((t=>e.includes(t.key)))}),[l]),h=(0,r.useCallback)((()=>n.length&&"contact.all_fields"===n[0]?.field?(0,j.jsx)(P,{}):(0,j.jsx)(K,{})),[n]),u=(0,r.useCallback)(((e,t,n)=>{const i=_.pick(n,["order","columnKey"]);o(i),s()}),[o,s]),x=(0,r.useMemo)((()=>d.map((e=>{const t=i(e.key);return _.isEmpty(t)||(e.defaultSortOrder=t.order),e}))),[d,i]);return{onPaginationChange:c,filteredColumn:d,renderEmptyScreen:h,onTableChange:u,columnsContactWithOrder:x}})(e);return(0,j.jsx)(I.A,{loading:!s,pageSize:n.pageSize,currentPage:n.current,columns:d,uniqueKey:d.length,rowSelection:{selectedRowKeys:i,onChange:o},dataSource:t.contacts,onShowSizeChange:l,total:t.total,scroll:{x:1e3},emptyScreen:a(),onPaginationChange:l,onTableChange:c})})),ee=(0,r.memo)(Z),te=(0,a.withSelect)((e=>({countsVisibility:e(h.A.CONTACTS).getCountsVisibility()}))),ne=(0,a.withDispatch)((e=>({setCountsVisibility:e(h.A.CONTACTS).setCountsVisibility}))),se=(0,c.compose)([te,ne])((function(e){const{setCountsVisibility:t,countsVisibility:n}=e,s=(0,r.useMemo)((()=>({...$.Qq,style:{...$.Qq.style,color:n?u.A.primary:"inherit","--small-circle-color":n?u.A.primary:"transparent"}})),[n]);return(0,j.jsxs)(r.Fragment,{children:[(0,j.jsx)(B.A,{variant:s,onClick:()=>{t(!n)},children:(0,j.jsx)(g.Uy,{})}),(0,j.jsx)(B.A,{variant:$.zB,onClick:()=>{(0,w.doAction)(E,!0)},children:"Add Contact"})]})}));var ie=n(19670),re=n(36492);x.A.div`
	.vendtics-create-segment-wrapper {
		min-height: 50vh;
		position: relative;
		background-color: beige;
	}
`;const oe=(0,x.A)(o.Flex)`
	.vendtics-selected-row {
		color: ${u.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: ${u.l.brand500};
	}

	.vendtics-delete-selected-row {
		color: ${u.l.error};
	}
`,le=(0,x.A)(re.A)`
	&.ant-select-lg {
		height: 44px !important;
	}

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

		&:hover {
			border-color: ${u.l.brand500} !important;
			color: ${u.l.brand500} !important;
		}
	}
`;x.A.div`
	font-size: 14px;
	font-weight: 600;
	padding-block: 4px;
	${({isAdvancedFilter:e})=>e?`\n\t\tcolor: ${u.l.brand500};\n\t`:`\n\t\tcolor: ${u.l.neutral800};\n\n\t`}
`;var ae=n(76986);const ce="vendtics-show-bulk-edit-modal",de=(0,a.withSelect)((e=>({rowKeys:e(h.A.CONTACTS).getRowKeys()}))),he=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{bulkContactDeleteHandler:t.deleteBulkContacts,setRowsKey:t.setRowKeys}})),ue=(0,c.compose)([de,he])((function(e){const{rowKeys:t,bulkContactDeleteHandler:n,setRowsKey:s}=e;return(0,j.jsxs)(oe,{gap:3,children:[(0,j.jsx)("p",{className:"vendtics-selected-row",children:!_.isEmpty(t)&&`${t.length} Selected`}),!_.isEmpty(t)&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(B.A,{type:"text",onClick:()=>(0,w.doAction)(ce,!0),children:(0,j.jsxs)("p",{className:"vendtics-edit-selected-row",children:[(0,j.jsx)(g.uw,{}),(0,b.__)("Edit Property","vendtics")]})}),(0,j.jsx)(ie.A,{title:(0,b.__)("Delete Contacts","vendtics"),description:(0,b.__)("Are you sure you want to delete the selected contacts?","vendtics"),okText:(0,b.__)("Confirm","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,b.__)("No","vendtics"),onConfirm:()=>{n(t),s([])},children:(0,j.jsx)(B.A,{type:"text",children:(0,j.jsxs)("p",{className:"vendtics-delete-selected-row",children:[(0,j.jsx)(g.d7,{}),(0,b.__)("Delete","vendtics")]})})})]})]})}));var xe=n(32066);const pe=(0,a.withSelect)((e=>{const t=e(h.A.CONTACTS);return{value:(()=>{const e=t.getQueryByField("contact.all_fields");return e?e.value:null})(),isAdvancedFilterEnabled:t.getAdvancedFilters()}})),me=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{setValue:e=>{t.setQueryByField({field:"contact.all_fields",operator:"contains",value:e}),e||t.removeQueryByField("contact.all_fields")},refreshList:()=>t.invalidateResolution("getList")}})),ge=(0,c.compose)([pe,me])((function(e){const{value:t,setValue:n,refreshList:s,isAdvancedFilterEnabled:i}=e,r=(0,c.useDebounce)(s,500);return i?null:(0,j.jsx)(xe.A,{className:"contact-search-input",prefix:(0,j.jsx)(g.WI,{}),placeholder:(0,b.__)("Search..."),value:t,onChange:e=>{return t=e.target.value,n(t),void r();var t}})})),je=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{refreshList:()=>t.invalidateResolution("getList"),refreshCounts:()=>t.invalidateResolution("getCounts")}})),Ae=(0,c.compose)([je])((function(e){const{refreshList:t,refreshCounts:n}=e;return(0,j.jsx)(B.A,{onClick:()=>{t(),n()},variant:$.E3,sx:{height:"40px",border:`1px solid ${u.l.neutral400}`},children:(0,j.jsx)(g.jf,{})})}));var ve=n(28073);function ye({handleSearch:e}){const t=(0,c.useDebounce)(e,300);return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(xe.A,{onChange:e=>t(e.target.value),placeholder:(0,b.__)("Search columns...","vendtics")})})}var fe=n(91196);x.A.h3`
	font-size: 14px;
	font-weight: 600;
	color: ${u.l.neutral800};
	margin-block: 8px;
`;const _e=x.A.ul`
	overflow-y: scroll;
	max-height: 300px;
	height: 100%;

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

	& p {
		text-align: left;
		font-size: 14px;
		font-weight: 500;
	}
`,be=x.A.li`
	padding: 8px 12px;
	border-radius: 5px;
	margin-bottom: 0px;
	cursor: pointer;
	&:hover {
		background-color: ${u.l.neutral200};
	}
	& label {
		width: 100% !important;
	}
`;function Ce({columns:e,selectColumns:t,onToggleColumn:n}){return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(_e,{children:e.length>0?e.map(((e,s)=>(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{children:e.title}),e?.menus?.filter((e=>"action"!==e.key&&"id"!==e.key&&"first_name"!==e.key)).map(((e,s)=>(0,j.jsx)(be,{children:(0,j.jsx)(fe.A,{checked:t[e.key],onChange:()=>{n(e.key)},children:e.title})},s)))]},s))):(0,j.jsx)("p",{style:{textAlign:"center"},children:"Not Found!!"})})})}const we=(0,a.withSelect)((e=>({columns:e(h.A.CONTACTS).getColumns()}))),Se=(0,a.withDispatch)((e=>({setColumns:e(h.A.CONTACTS).setColumns}))),Te=(0,c.compose)([we,Se])((function(e){const{columns:t,setColumns:n}=e,[s,i]=(0,r.useState)([]),o=(0,w.applyFilters)("vendtics-contact-table-columns",[{title:"Primary Fields",menus:G.A}],!0),l=(0,r.useMemo)((()=>s.length>0?s:o),[s,o]);return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(ve.A,{title:(0,j.jsx)(ye,{handleSearch:function(e){const t=o.map((t=>{if(t.menus){const n=t.menus.filter((t=>t.title.toLowerCase().includes(e.toLowerCase())));return{...t,menus:n}}return t})).filter((e=>e.menus?.length>0));i(t)}}),trigger:"click",arrow:!1,content:(0,j.jsx)(Ce,{columns:l,selectColumns:t,onToggleColumn:e=>{n({...t,[e]:!t[e]})}}),placement:"bottomLeft",children:(0,j.jsx)(B.A,{variant:$.E3,sx:{height:"40px",border:`1px solid ${u.l.neutral400}`},children:(0,j.jsx)(g.aR,{})})})})}));var Fe=n(12609),Re=n(49120);const Ne=(0,a.withSelect)((e=>({visible:e(h.A.CONTACTS).getAdvancedFilters()}))),Ee=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{setVisible:t.setAdvancedFilters,refresh(){t.invalidateResolution("getList")}}})),Le=(0,c.compose)([Ne,Ee])((function(e){const{visible:t,setVisible:n,refresh:s}=e;return(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)(B.A,{variant:$.E3,onClick:()=>{if(!(0,R.n_)())return(0,w.doAction)(Re.Dz.SHOW_PRO_BADGE_MODAL,!0);s(),n(!t)},sx:t?{borderColor:u.l.primary,color:u.l.primary}:{borderColor:u.l.neutral400},children:[(0,j.jsx)(Fe.A,{checked:t}),(0,b.__)("Advanced filters","vendtics")," ",(0,R.n_)()?null:(0,j.jsx)(g.uJ,{})]})})})),ke=(0,a.withSelect)((e=>{const t=e(h.A.CONTACTS),n=t.getQuery(),s=t.getAdvancedFilters();return{visible:_.size(_.omit(n.rules,(e=>"contact.all_fields"===e.field)))>0&&!s}})),Ie=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{clear(){t.resetQuery(),t.invalidateResolution("getList")}}})),Oe=(0,c.compose)([ke,Ie])((function(e){const{visible:t,clear:n}=e;return t?(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(B.A,{onClick:n,variant:$.Qq,sx:{color:u.l.error},children:(0,b.__)("Clear All","vendtics")})}):null})),De=function(){return(0,w.applyFilters)(Re.dy.VENDTICS_CONTACT_ADVANCED_FILTER_MODAL)},Be=(0,a.withSelect)((e=>{const t=e(h.A.CONTACTS);return{value:(()=>{const e=t.getQueryByField("status");return e?String(e.value[0]):null})()}})),$e=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{setValue:e=>{e?t.setQueryByField({field:"status",operator:"contains",value:[e]}):t.removeQueryByField("status")},refreshList:()=>t.invalidateResolution("getList")}})),He=(0,c.compose)([Be,$e])((function(e){const{setValue:t,refreshList:n,value:s}=e,i=(0,N.ie)();return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(le,{size:"large",onChange:e=>{t(e),n()},placeholder:(0,b.__)("Status","vendtics"),value:s,allowClear:!0,style:{width:120},options:i})})})),ze=(0,a.withSelect)((e=>{const t=e(h.A.LISTS),n=e(h.A.CONTACTS);return{lists:t.getSelectLists(),value:(()=>{const e=n.getQueryByField("lists");return e?String(e.value[0]):null})(),hasResolved:t.hasFinishedResolution("getSelectLists")}})),Me=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{setValue:e=>{e?t.setQueryByField({field:"lists",operator:"contains",value:[e]}):t.removeQueryByField("lists")},refreshList:()=>t.invalidateResolution("getList")}})),Pe=(0,c.compose)([ze,Me])((function(e){const{lists:t,value:n,setValue:s,hasResolved:i,refreshList:o}=e,l=(0,r.useMemo)((()=>i?[...(0,R.Wf)(t.items,{label:"name",value:"id"})]:[]),[t,i]);return(0,j.jsx)(le,{size:"large",disabled:!i,placeholder:"Lists",value:n,allowClear:!0,onChange:e=>{s(e),o()},style:{width:120},options:l})})),qe=(0,a.withSelect)((e=>{const t=e(h.A.TAGS),n=e(h.A.CONTACTS);return{tags:t.getSelectTags(),value:(()=>{const e=n.getQueryByField("tags");return e?String(e.value[0]):null})(),hasResolved:t.hasFinishedResolution("getSelectTags")}})),Qe=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{setValue:e=>{e?t.setQueryByField({field:"tags",operator:"contains",value:[e]}):t.removeQueryByField("tags")},refreshList:()=>t.invalidateResolution("getList")}})),Ke=(0,c.compose)([qe,Qe])((function(e){const{tags:t,value:n,setValue:s,hasResolved:i,refreshList:o}=e,l=(0,r.useMemo)((()=>i?(0,R.Wf)(t.items,{label:"name",value:"id"}):[]),[t,i]);return(0,j.jsx)(le,{size:"large",disabled:!i,placeholder:"Tags",value:n,allowClear:!0,onChange:e=>{s(e),o()},style:{width:120},options:l})})),Ge=(0,a.withSelect)((e=>({isAdvancedFilterEnabled:e(h.A.CONTACTS).getAdvancedFilters()}))),Ue=(0,c.compose)([Ge])((function(e){const{isAdvancedFilterEnabled:t}=e;return(0,j.jsxs)(o.Flex,{gap:3,children:[t?(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(De,{})})}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(He,{})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(Pe,{})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(Ke,{})})]}),(0,j.jsx)(Oe,{}),(0,j.jsx)(Le,{})]})}));function Ve(){return(0,j.jsxs)(o.Flex,{justify:"space-between",style:{paddingInline:"12px",marginBottom:"24px"},children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)(o.Flex,{gap:4,children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(Ue,{})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(ue,{})})]})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)(o.Flex,{gap:2,children:[(0,j.jsx)(Ae,{}),(0,j.jsx)(ge,{}),(0,j.jsx)(Te,{})]})})]})}const Ye=x.A.div`
	background-color: ${u.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 We=n(60742),Je=n(89671),Xe=n(42855);const Ze=x.A.h2`
	color: ${u.A.neutral900};
	font-size: 22px;
	font-weight: 600;
	line-height: 28px;
`,et=[{label:"Assign To Tags",value:ae.$c.ASSIGN_TO_TAGS},{label:"Assign To Lists",value:ae.$c.ASSIGN_TO_LISTS},{label:"Remove From Tags",value:ae.$c.REMOVE_FROM_TAGS},{label:"Remove From Lists",value:ae.$c.REMOVE_FROM_LISTS},{label:"Change Contact Status",value:ae.$c.CHANGE_CONTACT_STATUS},{label:"Change Contact Type",value:ae.$c.CHANGE_CONTACT_TYPE}];function tt(){const e=(0,N.ie)();return(0,j.jsx)(Xe.A,{label:(0,b.__)("Lead Status","vendtics"),placeholder:(0,b.__)("Select Status","vendtics"),name:"status",suffixIcon:(0,j.jsx)(g.LM,{}),options:e})}const nt=(0,a.withSelect)((e=>{const t=e(h.A.TAGS);return{tags:t.getSelectTags(),hasResolved:t.hasFinishedResolution("getList")}})),st=(0,c.compose)([nt])((function(e){const{tags:t,hasResolved:n}=e,s=(0,r.useMemo)((()=>n?(0,R.Wf)(t.items,{label:"name",value:"id"}):[]),[t,n]);return(0,j.jsx)(Xe.A,{label:(0,b.__)("Tags","vendtics"),placeholder:(0,b.__)("Select Tags","vendtics"),name:"tag_ids",mode:"multiple",maxTagCount:"responsive",suffixIcon:(0,j.jsx)(g.LM,{}),options:s})})),it=(0,a.withSelect)((e=>{const t=e(h.A.LISTS);return{lists:t.getSelectLists(),hasResolved:t.hasFinishedResolution("getList")}})),rt=(0,c.compose)([it])((function(e){const{lists:t,hasResolved:n}=e,s=(0,r.useMemo)((()=>n?(0,R.Wf)(t.items,{label:"name",value:"id"}):[]),[t,n]);return(0,j.jsx)(Xe.A,{label:(0,b.__)("Lists","vendtics"),placeholder:(0,b.__)("Select Lists","vendtics"),name:"list_ids",mode:"multiple",maxTagCount:"responsive",suffixIcon:(0,j.jsx)(g.LM,{}),options:s})}));function ot(){return(0,j.jsx)(Xe.A,{label:(0,b.__)("Type","vendtics"),placeholder:(0,b.__)("Select Type","vendtics"),name:"type",suffixIcon:(0,j.jsx)(g.LM,{}),options:[{value:"customer",label:"Customer"},{value:"lead",label:"Lead"}]})}const lt=(0,a.withSelect)((e=>({rowKeys:e(h.A.CONTACTS).getRowKeys()}))),at=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{bulkContactAssignTagsHandle:t.bulkContactAssignTags,bulkContactUnAssignTagsHandle:t.bulkContactUnAssignTags,bulkContactAssignListsHandle:t.bulkContactAssignLists,bulkContactUnAssignListsHandle:t.bulkContactUnAssignLists,bulkContactStatusUpdateHandle:t.bulkContactStatusUpdate,bulkContactTypeUpdateHandle:t.bulkContactTypeUpdate,setRowsKey:t.setRowKeys}})),ct=(0,c.compose)([lt,at])((function(e){const{visible:t,setVisible:n,handleUpdate:s,selectBulkEditProperty:i,setSelectBulkEditProperty:l}=(e=>{const{rowKeys:t,bulkContactStatusUpdateHandle:n,bulkContactTypeUpdateHandle:s,bulkContactAssignTagsHandle:i,bulkContactUnAssignTagsHandle:o,bulkContactAssignListsHandle:l,bulkContactUnAssignListsHandle:a,setRowsKey:c}=e,[d,h]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null);return(0,r.useLayoutEffect)((()=>((0,w.addAction)(ce,"vendtics",(e=>h(e))),()=>(0,w.removeAction)(ce,"vendtics"))),[]),{visible:d,setVisible:h,selectBulkEditProperty:u,setSelectBulkEditProperty:x,handleUpdate:async e=>{let r={ids:t};const d={[ae.$c.ASSIGN_TO_TAGS]:i,[ae.$c.REMOVE_FROM_TAGS]:o,[ae.$c.ASSIGN_TO_LISTS]:l,[ae.$c.REMOVE_FROM_LISTS]:a,[ae.$c.CHANGE_CONTACT_TYPE]:s,[ae.$c.CHANGE_CONTACT_STATUS]:n};if(e.property&&d[e.property]){const t=e.property===ae.$c.ASSIGN_TO_TAGS||e.property===ae.$c.REMOVE_FROM_TAGS?"tag_ids":"list_ids";if(e[t]||e.type||e.status){r={...r,[t]:e[t],type:e.type,status:e.status};try{const t=await d[e.property](r);F.Ay.success((0,b.__)(t.message,"vendtics"))}catch(e){F.Ay.error((0,b.__)(e.message,"vendtics"))}finally{(0,w.doAction)(ce,!1),c([])}}}}}})(e),a=(0,r.useCallback)((()=>{switch(i){case ae.$c.CHANGE_CONTACT_STATUS:return(0,j.jsx)(tt,{});case ae.$c.ASSIGN_TO_TAGS:case ae.$c.REMOVE_FROM_TAGS:return(0,j.jsx)(st,{});case ae.$c.ASSIGN_TO_LISTS:case ae.$c.REMOVE_FROM_LISTS:return(0,j.jsx)(rt,{});case ae.$c.CHANGE_CONTACT_TYPE:return(0,j.jsx)(ot,{});default:return null}}),[i]);return(0,j.jsx)(Je.A,{visible:t,disableCloseRequestOnOuterClick:!0,onCloseRequest:()=>n(!1),width:"500px",children:(0,j.jsxs)(We.A,{onFinish:s,children:[(0,j.jsx)(Je.A.Header,{children:(0,j.jsx)(o.Flex,{align:"center",gap:2,children:(0,j.jsx)(Ze,{children:"Bulk contacts edit"})})}),(0,j.jsx)(Je.A.Body,{children:(0,j.jsxs)(o.Flex,{direction:"column",gap:"20px",children:[(0,j.jsx)(Xe.A,{label:(0,b.__)("Property to update","vendtics"),options:et,placeholder:(0,b.__)("Select a property to edit","vendtics"),name:"property",onChange:l,suffixIcon:(0,j.jsx)(g.LM,{})}),a()]})}),(0,j.jsx)(Je.A.Footer,{children:(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(B.A,{variant:$.E3,onClick:()=>n(!1),sx:{border:"1px solid transparent"},children:"Close"}),(0,j.jsx)(B.A,{variant:$.zB,htmlType:"submit",children:"Update"})]})})]})})}));var dt=n(49426);const ht=(0,a.withSelect)((e=>{const t=e(h.A.CONTACTS);return{id:t.getId(),details:t.getDetails(),hasResolved:t.hasFinishedResolution("getDetails")}})),ut=(0,a.withDispatch)((e=>{const t=e(h.A.CONTACTS);return{editContactByIdHandler:t.editContactById,refreshDetails:()=>t.invalidateResolution("getDetails")}})),xt=(0,c.compose)([ht,ut])((function(e){const[t]=C.Form.useForm(),{visible:n,setVisible:s,handleSubmit:i,isLoading:l}=(0,dt.A)({...e,form:t});return(0,j.jsx)(r.Fragment,{children:(0,j.jsxs)(C.Modal,{visible:n,width:"800px",onCloseRequest:()=>s(!1),children:[(0,j.jsx)(C.Modal.Header,{children:(0,b.__)("Update Contact","vendtics")}),(0,j.jsx)(C.Modal.Body,{children:e.hasResolved?(0,j.jsx)(C.Form,{onFinish:i,form:t,disabled:!e.hasResolved,children:(0,j.jsx)(C.ContactForm,{editMode:!0})}):(0,j.jsx)(C.BasicLoader,{})}),(0,j.jsx)(C.Modal.Footer,{children:(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(C.Button,{variant:C.base,onClick:()=>s(!1),sx:{border:"1px solid transparent"},children:(0,b.__)("Close","vendtics")}),(0,j.jsx)(C.Button,{variant:C.primary,onClick:t.submit,loading:l,children:(0,b.__)("Update Contact","vendtics")})]})})]})})}));function pt(){return(0,j.jsxs)(r.Fragment,{children:[(0,j.jsx)(o.Fill,{name:l.A.PRIMARY_HEADER_NAME,children:"Contacts"}),(0,j.jsx)(o.Fill,{name:l.A.CONTACTS_SECONDARY_HEADER_RIGHT,children:(0,j.jsx)(se,{})}),(0,j.jsx)(f,{}),(0,j.jsx)(k,{}),(0,j.jsx)(xt,{}),(0,j.jsx)(ct,{}),(0,j.jsxs)(Ye,{children:[(0,j.jsx)(Ve,{}),(0,j.jsx)(ee,{})]})]})}const mt=x.A.div`
	background-color: ${u.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 gt=n(4856),jt=n(93037),At=n(14476),vt=n(6299);const yt=At.Ay.object({name:At.Ay.string({required_error:"Name is required"}).trim().min(2,{message:"Name at least 2 characters long"})}),ft=(0,vt.w)(yt),_t="vendtics-show-add-list-modal",bt=(0,a.withDispatch)((e=>({createListHandlar:e(h.A.LISTS).createNewList}))),Ct=(0,c.compose)([bt])((function(e){const{createListHandlar:t}=e,[n,s]=(0,r.useState)(!1);return(0,r.useLayoutEffect)((()=>((0,w.addAction)(_t,"vendtics",(e=>{s(e)})),()=>{(0,w.removeAction)(_t,"vendtics")})),[]),(0,j.jsx)(Je.A,{visible:n,width:"450px",onCloseRequest:()=>s(!1),children:(0,j.jsxs)(We.A,{onFinish:async e=>{Object.keys(e).length&&(await t(e),(0,w.doAction)(_t,!1))},children:[(0,j.jsx)(Je.A.Header,{children:(0,b.__)("Add New List","vendtics")}),(0,j.jsx)(Je.A.Body,{children:(0,j.jsxs)(o.Flex,{direction:"column",gap:"20px",children:[(0,j.jsx)(gt.A,{label:"List Name",placeholder:"Write your list name",type:"text",name:"name",required:!0,rules:[ft]}),(0,j.jsx)(jt.A,{label:"Description",type:"textarea",name:"description"})]})}),(0,j.jsx)(Je.A.Footer,{children:(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(B.A,{variant:$.E3,onClick:()=>s(!1),sx:{border:"1px solid transparent"},children:(0,b.__)("Back","vendtics")}),(0,j.jsx)(B.A,{variant:$.zB,htmlType:"submit",children:(0,b.__)("Create List","vendtics")})]})})]})})})),wt=(0,a.withSelect)((e=>({hasListResolved:e(h.A.LISTS).hasFinishedResolution("getList")}))),St=(0,c.compose)([wt])((function(e){const{hasListResolved:t}=e;return(0,j.jsx)(r.Fragment,{children:(0,j.jsx)(B.A,{disabled:!t,variant:$.zB,onClick:()=>{(0,w.doAction)(_t,!0)},children:"Add List"})})})),Tt=(0,c.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,lists:s}=t;return!n&&_.isEmpty(s)?(0,j.jsx)(r.Fragment,{children:(0,j.jsx)(U.cU,{row:4})}):_.isEmpty(s)?null:(0,j.jsx)(e,{...t})}),"withLoading"),Ft=(0,c.createHigherOrderComponent)((e=>t=>{const{lists:n,searchQuery:s}=t;return!_.isEmpty(n)&&n.total>0||s?(0,j.jsx)(e,{...t}):(0,j.jsxs)(Y.A,{children:[(0,j.jsx)("h3",{children:(0,b.__)("No data is available","vendtics")}),(0,j.jsxs)("p",{children:["This section will be updated once ",(0,j.jsx)("br",{})," data has been collected."]}),(0,j.jsxs)(o.Flex,{align:"center",justify:"center",gap:3,children:[(0,j.jsx)(B.A,{icon:(0,j.jsx)(g.XM,{}),iconPosition:"end",variant:$.Rm,children:"Learn More"}),(0,j.jsx)(B.A,{variant:$.zB,onClick:()=>{(0,w.doAction)(_t,!0)},children:"Add List"})]})]})}),"withEmpty"),Rt=At.Ay.object({name:At.Ay.string({required_error:"Name is required"}).trim().min(2,{message:"Name at least 2 characters long"})}),Nt=(0,vt.w)(Rt),Et="vendtics-show-edit-list-modal",Lt=(0,a.withSelect)((e=>({initialData:e(h.A.LISTS).getEditInitialData()}))),kt=(0,a.withDispatch)((e=>({editListHandlar:e(h.A.LISTS).editListById}))),It=(0,c.compose)([Lt,kt])((function(e){const{initialData:t,editListHandlar:n}=e,[s,i]=(0,r.useState)(!1);return(0,r.useLayoutEffect)((()=>((0,w.addAction)(Et,"vendtics",(e=>{i(e)})),()=>{(0,w.removeAction)(Et,"vendtics")})),[]),(0,j.jsx)(Je.A,{visible:s,width:"450px",onCloseRequest:()=>i(!1),children:(0,j.jsxs)(We.A,{onFinish:async e=>{if(Object.keys(e).length){const s={...e,id:t.id};await n(s),(0,w.doAction)(Et,!1)}},initialValues:t,children:[(0,j.jsx)(Je.A.Header,{children:(0,b.__)("Edit List","vendtics")}),(0,j.jsx)(Je.A.Body,{children:(0,j.jsxs)(o.Flex,{direction:"column",gap:"20px",children:[(0,j.jsx)(gt.A,{label:"List Name",placeholder:"Write your list name",type:"text",name:"name",required:!0,rules:[Nt]}),(0,j.jsx)(jt.A,{label:"Description",type:"textarea",name:"description"})]})}),(0,j.jsx)(Je.A.Footer,{children:(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(B.A,{variant:$.E3,onClick:()=>i(!1),sx:{border:"1px solid transparent"},children:(0,b.__)("Back","vendtics")}),(0,j.jsx)(B.A,{variant:$.zB,htmlType:"submit",children:(0,b.__)("Update List","vendtics")})]})})]})})})),Ot=(0,a.withDispatch)(((e,{record:t})=>{const n=e(h.A.LISTS);return{deleteHandler:()=>n.deleteSingleList(t.id),setEditInitialData:()=>n.setEditInitialData(t)}})),Dt=(0,c.compose)([Ot])((function(e){const{deleteHandler:t,setEditInitialData:n}=e;return(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(B.A,{variant:$.E3,sx:{height:"40px"},onClick:()=>{n(),(0,w.doAction)(Et,!0)},children:(0,j.jsx)(g.qU,{})}),(0,j.jsx)(ie.A,{title:(0,b.__)("Delete List","vendtics"),description:(0,b.__)("Are you sure you want to delete this list?","vendtics"),okText:(0,b.__)("Confirm","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,b.__)("No","vendtics"),onConfirm:()=>{t()},placement:"topRight",children:(0,j.jsx)(B.A,{variant:$.E3,sx:{height:"40px"},children:(0,j.jsx)(g.d7,{})})})]})})),Bt=[{title:(0,b.__)("Name","vendtics"),dataIndex:"name",key:"name",fixed:"left",width:"150px",sorter:(e,t)=>e.name.localeCompare(t.name),render:(e,{name:t})=>(0,j.jsx)("span",{children:t})},{title:(0,b.__)("Description","vendtics"),dataIndex:"description",key:"description",sorter:(e,t)=>e.description.localeCompare(t.description),width:"250px",render:(e,{description:t})=>(0,j.jsx)("span",{children:t})},{title:(0,b.__)("Total Contacts","vendtics"),dataIndex:"total_contacts",key:"total_contacts",width:"150px",render:(e,{total_contacts:t})=>(0,j.jsx)("span",{children:t})},{title:(0,b.__)("Date Created","vendtics"),dataIndex:"created_at",key:"created_at",width:"250px",sorter:(e,t)=>new Date(e.created_at)-new Date(t.created_at),render:(e,{created_at:t})=>(0,j.jsx)("span",{children:T()(new Date(t).toDateString()).format("MMM D, YYYY h:mm A")})},{title:(0,b.__)("Action","vendtics"),dataIndex:"action",key:"action",width:"120px",fixed:"right",render:(e,t)=>(0,j.jsx)(Dt,{record:t})}],$t=(0,x.A)(o.Flex)`
	h4 {
		color: ${u.A.neutral900};
		text-align: center;
		font-size: 24px;
		font-weight: 600;
		margin-bottom: 10px;

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

	p {
		color: ${u.A.neutral800};
		font-size: 14px;
	}
`,Ht=(0,a.withSelect)((e=>({searchQuery:e(h.A.LISTS).getSearchQuery()}))),zt=(0,a.withDispatch)((e=>{const t=e(h.A.LISTS);return{clear(){t.setSearchQuery(""),t.invalidateResolution("getList")}}})),Mt=(0,c.compose)([Ht,zt])((function(e){const{searchQuery:t,clear:n}=e;return(0,j.jsxs)($t,{justify:"center",align:"center",gap:5,direction:"column",children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(O.r,{})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)("div",{children:[(0,j.jsxs)("h4",{children:["No lists Found ",(0,j.jsx)("span",{children:t})]}),(0,j.jsx)("p",{children:" Adjust your filters to see your lists"})]})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(B.A,{onClick:n,icon:(0,j.jsx)(D.H,{}),variant:$.Rm,sx:{border:`1px solid ${u.A.brand500}`,color:u.A.brand500},children:"Clear Search"})})]})})),Pt=(0,a.withSelect)((e=>{const t=e(h.A.LISTS);return{pagination:t.getPagination(),getOrderById:t.getOrderById,lists:t.getList(),rowKeys:t.getRowKeys(),searchQuery:t.getSearchQuery(),hasResolved:t.hasFinishedResolution("getList")}})),qt=(0,a.withDispatch)((e=>{const t=e(h.A.LISTS);return{setPagination:t.setPagination,setOrder:t.setOrder,setRowKeys:t.setRowKeys,refreshList:()=>t.invalidateResolution("getList")}})),Qt=(0,c.compose)([qt,Pt,Tt,Ft])((function(e){const{lists:t,pagination:n,setPagination:s,refreshList:i,rowKeys:o,getOrderById:l,hasResolved:a,setOrder:c,setRowKeys:d}=e,h=(e,t)=>{s({current:e,pageSize:t}),i()},u=(0,r.useMemo)((()=>Bt.map((e=>{const t=l(e.key);return _.isEmpty(t)||(e.defaultSortOrder=t.order),e}))),[]);return(0,j.jsx)(I.A,{loading:!a,pageSize:n.pageSize,currentPage:n.current,columns:u,uniqueKey:t.lists.length,rowSelection:{selectedRowKeys:o,onChange:d},dataSource:t.lists,onShowSizeChange:h,total:t.total,scroll:{x:1e3},emptyScreen:(0,j.jsx)(Mt,{}),onPaginationChange:h,onTableChange:(e,t,n)=>{const s=_.pick(n,["order","columnKey"]);c(s),i()}})})),Kt=(0,r.memo)(Qt),Gt=(0,a.withSelect)((e=>({searchQuery:e(h.A.LISTS).getSearchQuery()}))),Ut=(0,a.withDispatch)((e=>{const t=e(h.A.LISTS);return{setSearchQuery:e=>t.setSearchQuery(e),refreshList:()=>t.invalidateResolution("getList")}})),Vt=(0,c.compose)([Gt,Ut])((function(e){const{searchQuery:t,setSearchQuery:n,refreshList:s}=e,i=(0,c.useDebounce)(s,500);return(0,j.jsx)(xe.A,{className:"lists-search-input",prefix:(0,j.jsx)(g.WI,{}),value:t,placeholder:(0,b.__)("Search..."),onChange:e=>{return t=e.target.value,n(t),void i();var t}})})),Yt=(0,a.withDispatch)((e=>{const t=e(h.A.LISTS);return{refreshList:()=>t.invalidateResolution("getList")}})),Wt=(0,c.compose)([Yt])((function(e){const{refreshList:t}=e;return(0,j.jsx)(B.A,{onClick:()=>{t()},variant:$.E3,sx:{height:"40px",border:`1px solid ${u.l.neutral400}`},children:(0,j.jsx)(g.jf,{})})})),Jt=(0,a.withSelect)((e=>({rowKeys:e(h.A.LISTS).getRowKeys()}))),Xt=(0,a.withDispatch)((e=>{const t=e(h.A.LISTS);return{bulkListsDeleteHandler:t.deleteBulkLists,setRowsKey:t.setRowKeys}})),Zt=(0,c.compose)([Jt,Xt])((function(e){const{rowKeys:t,setRowsKey:n,bulkListsDeleteHandler:s}=e;return(0,j.jsxs)(o.Flex,{gap:"5px",align:"center",justify:"flex-start",children:[(0,j.jsx)("p",{className:"vendtics-selected-row",children:!_.isEmpty(t)&&`${t.length} Selected`}),!_.isEmpty(t)&&(0,j.jsx)(ie.A,{title:(0,b.__)("Delete Lists","vendtics"),description:(0,b.__)("Are you sure you want to delete the selected Lists?","vendtics"),okText:(0,b.__)("Confirm","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,b.__)("No","vendtics"),onConfirm:()=>{s(t),n([])},placement:"topRight",children:(0,j.jsx)(B.A,{variant:$.Qq,icon:(0,j.jsx)(g.d7,{}),size:"medium",children:(0,j.jsx)("p",{className:"vendtics-delete-selected-row",children:(0,b.__)("Delete","vendtics")})})})]})})),en=((0,x.A)(re.A)`
	&.ant-select-lg {
		height: 44px !important;
	}

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

		&:hover {
			border-color: ${u.l.brand500} !important;
			color: ${u.l.brand500} !important;
		}
	}
`,(0,x.A)(o.Flex)`
	.vendtics-delete-selected-row {
		color: ${u.l.error};
	}

	.vendtics-selected-row {
		color: ${u.l.neutral800};
		font-size: 14px;
		font-weight: 600;
		white-space: nowrap;
		cursor: default;
	}
`);function tn(){return(0,j.jsxs)(en,{justify:"space-between",style:{paddingInline:"12px",marginBottom:"24px"},children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(o.Flex,{gap:4,children:(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(Zt,{})})})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)(o.Flex,{gap:2,children:[(0,j.jsx)(Wt,{}),(0,j.jsx)(Vt,{})]})})]})}function nn(){return(0,j.jsxs)(r.Fragment,{children:[(0,j.jsx)(o.Fill,{name:l.A.PRIMARY_HEADER_NAME,children:"Lists"}),(0,j.jsx)(o.Fill,{name:l.A.CONTACTS_SECONDARY_HEADER_RIGHT,children:(0,j.jsx)(St,{})}),(0,j.jsx)(Ct,{}),(0,j.jsx)(It,{}),(0,j.jsxs)(mt,{children:[(0,j.jsx)(tn,{}),(0,j.jsx)(Kt,{})]})]})}const sn=x.A.div`
	background-color: ${u.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;
		}
	}
`,rn=At.Ay.object({name:At.Ay.string({required_error:"Name is required"}).trim().min(2,{message:"Name at least 2 characters long"})}),on=(0,vt.w)(rn),ln="vendtics-show-add-tag-modal",an=(0,a.withDispatch)((e=>({createTagHandlar:e(h.A.TAGS).createNewTag}))),cn=(0,c.compose)([an])((function(e){const{createTagHandlar:t}=e,[n,s]=(0,r.useState)(!1);return(0,r.useLayoutEffect)((()=>((0,w.addAction)(ln,"vendtics",(e=>{s(e)})),()=>{(0,w.removeAction)(ln,"vendtics")})),[]),(0,j.jsx)(Je.A,{visible:n,width:"450px",onCloseRequest:()=>s(!1),children:(0,j.jsxs)(We.A,{onFinish:async e=>{Object.keys(e).length&&(await t(e),(0,w.doAction)(ln,!1))},children:[(0,j.jsx)(Je.A.Header,{children:(0,b.__)("Add New Tag","vendtics")}),(0,j.jsx)(Je.A.Body,{children:(0,j.jsxs)(o.Flex,{direction:"column",gap:"20px",children:[(0,j.jsx)(gt.A,{label:"Tag Name",placeholder:"Write your tag name",type:"text",name:"name",required:!0,rules:[on]}),(0,j.jsx)(jt.A,{label:"Description",type:"textarea",name:"description"})]})}),(0,j.jsx)(Je.A.Footer,{children:(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(B.A,{variant:$.E3,onClick:()=>s(!1),sx:{border:"1px solid transparent"},children:(0,b.__)("Back","vendtics")}),(0,j.jsx)(B.A,{variant:$.zB,htmlType:"submit",children:(0,b.__)("Create Tag","vendtics")})]})})]})})})),dn=(0,a.withSelect)((e=>({hasTagResolved:e(h.A.TAGS).hasFinishedResolution("getList")}))),hn=(0,c.compose)([dn])((function(e){const{hasTagResolved:t}=e;return(0,j.jsx)(r.Fragment,{children:(0,j.jsx)(B.A,{disabled:!t,variant:$.zB,onClick:()=>{(0,w.doAction)(ln,!0)},children:"Add Tag"})})})),un=(0,x.A)(o.Flex)`
	h4 {
		color: ${u.A.neutral900};
		text-align: center;
		font-size: 24px;
		font-weight: 600;
		margin-bottom: 10px;

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

	p {
		color: ${u.A.neutral800};
		font-size: 14px;
	}
`,xn=(0,a.withSelect)((e=>({searchQuery:e(h.A.TAGS).getSearchQuery()}))),pn=(0,a.withDispatch)((e=>{const t=e(h.A.TAGS);return{clear(){t.setSearchQuery(""),t.invalidateResolution("getList")}}})),mn=(0,c.compose)([xn,pn])((function(e){const{searchQuery:t,clear:n}=e;return(0,j.jsxs)(un,{justify:"center",align:"center",gap:5,direction:"column",children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(O.r,{})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)("div",{children:[(0,j.jsxs)("h4",{children:["No Tags Found ",(0,j.jsx)("span",{children:t})]}),(0,j.jsx)("p",{children:" Adjust your filters to see your lists"})]})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(B.A,{onClick:n,icon:(0,j.jsx)(D.H,{}),variant:$.Rm,sx:{border:`1px solid ${u.A.brand500}`,color:u.A.brand500},children:"Clear Search"})})]})})),gn=(0,c.createHigherOrderComponent)((e=>t=>{const{hasResolved:n,tags:s}=t;return!n&&_.isEmpty(s)?(0,j.jsx)(r.Fragment,{children:(0,j.jsx)(U.cU,{row:4})}):_.isEmpty(s)?null:(0,j.jsx)(e,{...t})}),"withLoading"),jn=At.Ay.object({name:At.Ay.string({required_error:"Name is required"}).trim().min(2,{message:"Name at least 2 characters long"})}),An=(0,vt.w)(jn),vn="vendtics-show-edit-tag-modal",yn=(0,a.withSelect)((e=>({initialData:e(h.A.TAGS).getEditInitialData()}))),fn=(0,a.withDispatch)((e=>({editTagHandlar:e(h.A.TAGS).editTagById}))),bn=(0,c.compose)([yn,fn])((function(e){const{initialData:t,editTagHandlar:n}=e,[s,i]=(0,r.useState)(!1);return(0,r.useLayoutEffect)((()=>((0,w.addAction)(vn,"vendtics",(e=>{i(e)})),()=>{(0,w.removeAction)(vn,"vendtics")})),[]),(0,j.jsx)(Je.A,{visible:s,width:"450px",onCloseRequest:()=>i(!1),children:(0,j.jsxs)(We.A,{onFinish:async e=>{if(Object.keys(e).length){const s={...e,id:t.id};await n(s),(0,w.doAction)(vn,!1)}},initialValues:t,children:[(0,j.jsx)(Je.A.Header,{children:(0,b.__)("Edit Tag","vendtics")}),(0,j.jsx)(Je.A.Body,{children:(0,j.jsxs)(o.Flex,{direction:"column",gap:"20px",children:[(0,j.jsx)(gt.A,{label:"Tag Name",placeholder:"Write your tag name",type:"text",name:"name",required:!0,rules:[An]}),(0,j.jsx)(jt.A,{label:"Description",type:"textarea",name:"description"})]})}),(0,j.jsx)(Je.A.Footer,{children:(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(B.A,{variant:$.E3,onClick:()=>i(!1),sx:{border:"1px solid transparent"},children:(0,b.__)("Back","vendtics")}),(0,j.jsx)(B.A,{variant:$.zB,htmlType:"submit",children:(0,b.__)("Update Tag","vendtics")})]})})]})})})),Cn=(0,a.withDispatch)(((e,{record:t})=>{const n=e(h.A.TAGS);return{deleteHandler:()=>n.deleteSingleTag(t.id),setEditInitialData:()=>n.setEditInitialData(t)}})),wn=(0,c.compose)([Cn])((function(e){const{deleteHandler:t,setEditInitialData:n}=e;return(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(B.A,{variant:$.E3,sx:{height:"40px"},onClick:()=>{n(),(0,w.doAction)(vn,!0)},children:(0,j.jsx)(g.qU,{})}),(0,j.jsx)(ie.A,{title:(0,b.__)("Delete Tag","vendtics"),description:(0,b.__)("Are you sure you want to delete this Tag?","vendtics"),okText:(0,b.__)("Confirm","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,b.__)("No","vendtics"),onConfirm:()=>{t()},placement:"topRight",children:(0,j.jsx)(B.A,{variant:$.E3,sx:{height:"40px"},children:(0,j.jsx)(g.d7,{})})})]})})),Sn=[{title:(0,b.__)("Name","vendtics"),dataIndex:"name",key:"name",fixed:"left",width:"150px",sorter:(e,t)=>e.name.localeCompare(t.name),render:(e,{name:t})=>(0,j.jsx)("span",{children:t})},{title:(0,b.__)("Description","vendtics"),dataIndex:"description",key:"description",width:"250px",sorter:(e,t)=>e.description.localeCompare(t.description),render:(e,{description:t})=>(0,j.jsx)("span",{children:t})},{title:(0,b.__)("Total Contacts","vendtics"),dataIndex:"total_contacts",key:"total_contacts",width:"150px",render:(e,{total_contacts:t})=>(0,j.jsx)("span",{children:t})},{title:(0,b.__)("Date Created","vendtics"),dataIndex:"created_at",key:"created_at",width:"250px",sorter:(e,t)=>new Date(e.created_at)-new Date(t.created_at),render:(e,{created_at:t})=>(0,j.jsx)("span",{children:T()(new Date(t).toDateString()).format("MMM D, YYYY h:mm A")})},{title:(0,b.__)("Action","vendtics"),dataIndex:"action",key:"action",width:"120px",fixed:"right",render:(e,t)=>(0,j.jsx)(wn,{record:t})}],Tn=(0,c.createHigherOrderComponent)((e=>t=>{const{tags:n,searchQuery:s}=t;return!_.isEmpty(n)&&n.total>0||s?(0,j.jsx)(e,{...t}):(0,j.jsxs)(Y.A,{children:[(0,j.jsx)("h3",{children:(0,b.__)("No data is available","vendtics")}),(0,j.jsxs)("p",{children:["This section will be updated once ",(0,j.jsx)("br",{})," data has been collected."]}),(0,j.jsxs)(o.Flex,{align:"center",justify:"center",gap:3,children:[(0,j.jsx)(B.A,{icon:(0,j.jsx)(g.XM,{}),iconPosition:"end",variant:$.Rm,children:"Learn More"}),(0,j.jsx)(B.A,{variant:$.zB,onClick:()=>{(0,w.doAction)(ln,!0)},children:"Add List"})]})]})}),"withEmpty"),Fn=(0,a.withSelect)((e=>{const t=e(h.A.TAGS);return{pagination:t.getPagination(),getOrderById:t.getOrderById,tags:t.getList(),searchQuery:t.getSearchQuery(),rowKeys:t.getRowKeys(),hasResolved:t.hasFinishedResolution("getList")}})),Rn=(0,a.withDispatch)((e=>{const t=e(h.A.TAGS);return{setPagination:t.setPagination,setRowKeys:t.setRowKeys,setOrder:t.setOrder,refreshList:()=>t.invalidateResolution("getList")}})),Nn=(0,c.compose)([Rn,Fn,gn,Tn])((function(e){const{tags:t,pagination:n,setPagination:s,refreshList:i,getOrderById:o,hasResolved:l,setOrder:a,rowKeys:c,setRowKeys:d}=e,h=(e,t)=>{s({current:e,pageSize:t}),i()},u=(0,r.useMemo)((()=>Sn.map((e=>{const t=o(e.key);return _.isEmpty(t)||(e.defaultSortOrder=t.order),e}))),[]);return(0,j.jsx)(I.A,{loading:!l,pageSize:n.pageSize,currentPage:n.current,columns:u,uniqueKey:t.tags.length,rowSelection:{selectedRowKeys:c,onChange:d},dataSource:t.tags,onShowSizeChange:h,total:t.total,scroll:{x:1e3},emptyScreen:(0,j.jsx)(mn,{}),onPaginationChange:h,onTableChange:(e,t,n)=>{const s=_.pick(n,["order","columnKey"]);a(s),i()}})})),En=(0,r.memo)(Nn),Ln=(0,a.withSelect)((e=>({searchQuery:e(h.A.TAGS).getSearchQuery()}))),kn=(0,a.withDispatch)((e=>{const t=e(h.A.TAGS);return{setSearchQuery:e=>t.setSearchQuery(e),refreshList:()=>t.invalidateResolution("getList")}})),In=(0,c.compose)([Ln,kn])((function(e){const{searchQuery:t,setSearchQuery:n,refreshList:s}=e,i=(0,c.useDebounce)(s,500);return(0,j.jsx)(xe.A,{className:"lists-search-input",prefix:(0,j.jsx)(g.WI,{}),value:t,placeholder:(0,b.__)("Search..."),onChange:e=>{return t=e.target.value,n(t),void i();var t}})})),On=(0,a.withDispatch)((e=>{const t=e(h.A.TAGS);return{refreshList:()=>t.invalidateResolution("getList")}})),Dn=(0,c.compose)([On])((function(e){const{refreshList:t}=e;return(0,j.jsx)(B.A,{onClick:()=>{t()},variant:$.E3,sx:{height:"40px",border:`1px solid ${u.l.neutral400}`},children:(0,j.jsx)(g.jf,{})})})),Bn=(0,a.withSelect)((e=>({rowKeys:e(h.A.TAGS).getRowKeys()}))),$n=(0,a.withDispatch)((e=>{const t=e(h.A.TAGS);return{bulkTagsDeleteHandler:t.deleteBulkTags,setRowsKey:t.setRowKeys}})),Hn=(0,c.compose)([Bn,$n])((function(e){const{rowKeys:t,setRowsKey:n,bulkTagsDeleteHandler:s}=e;return(0,j.jsxs)(o.Flex,{gap:"5px",align:"center",justify:"flex-start",children:[(0,j.jsx)("p",{className:"vendtics-selected-row",children:!_.isEmpty(t)&&`${t.length} Selected`}),!_.isEmpty(t)&&(0,j.jsx)(ie.A,{title:(0,b.__)("Delete Tags","vendtics"),description:(0,b.__)("Are you sure you want to delete the selected tags?","vendtics"),okText:(0,b.__)("Confirm","vendtics"),cancelButtonProps:{size:"medium"},okButtonProps:{size:"medium",danger:!0},cancelText:(0,b.__)("No","vendtics"),onConfirm:()=>{s(t),n([])},placement:"topRight",children:(0,j.jsx)(B.A,{variant:$.Qq,icon:(0,j.jsx)(g.d7,{}),size:"medium",children:(0,j.jsx)("p",{className:"vendtics-delete-selected-row",children:(0,b.__)("Delete","vendtics")})})})]})})),zn=((0,x.A)(re.A)`
	&.ant-select-lg {
		height: 44px !important;
	}

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

		&:hover {
			border-color: ${u.l.brand500} !important;
			color: ${u.l.brand500} !important;
		}
	}
`,(0,x.A)(o.Flex)`
	.vendtics-delete-selected-row {
		color: ${u.l.error};
	}

	.vendtics-selected-row {
		color: ${u.l.neutral800};
		font-size: 14px;
		font-weight: 600;
		white-space: nowrap;
		cursor: default;
	}
`);function Mn(){return(0,j.jsxs)(zn,{justify:"space-between",style:{paddingInline:"12px",marginBottom:"24px"},children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(o.Flex,{gap:4,children:(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(Hn,{})})})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)(o.Flex,{gap:2,children:[(0,j.jsx)(Dn,{}),(0,j.jsx)(In,{})]})})]})}function Pn(){return(0,j.jsxs)(r.Fragment,{children:[(0,j.jsx)(o.Fill,{name:l.A.PRIMARY_HEADER_NAME,children:"Tags"}),(0,j.jsx)(o.Fill,{name:l.A.CONTACTS_SECONDARY_HEADER_RIGHT,children:(0,j.jsx)(hn,{})}),(0,j.jsx)(cn,{}),(0,j.jsx)(bn,{}),(0,j.jsxs)(sn,{children:[(0,j.jsx)(Mn,{}),(0,j.jsx)(En,{})]})]})}const qn=(0,n(24893).Q)((function(){return(0,w.applyFilters)(Re.dy.VENDTICS_CONTACT_SEGMENTS_FIELDS,"vendtics")}));var Qn=n(72404);function Kn(){return(0,R.n_)()?(0,w.applyFilters)(Re.dy.VENDTICS_CONTACT_SINGLE_CUSTOME_FIELDS,"vendtics"):"Pro version required"}function Gn(e){const{address:t,city:n,state:s,postal_code:i,country:r}=e?.data||{},{getName:l}=(0,N.Av)();return(0,j.jsxs)(o.Flex,{className:"address-information",direction:"column",gap:"20px",children:[(0,j.jsx)("h2",{children:"Address Information"}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"Address "}),(0,j.jsx)("p",{children:t})]}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"City"}),(0,j.jsx)("p",{children:n})]}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"State"}),(0,j.jsx)("p",{children:s})]}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"Zip Code"}),(0,j.jsx)("p",{children:i})]}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"Country"}),(0,j.jsx)("p",{children:l(r||"")})]})]})}function Un(e){const{first_name:t,last_name:n,email:s,phone_number:i,date_of_birth:r}=e.data||{};return(0,j.jsxs)(o.Flex,{className:"basic-information",direction:"column",gap:"20px",children:[(0,j.jsx)("h2",{children:"Basic Information"}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"Full name"}),(0,j.jsxs)("p",{children:[t," ",n]})]}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"Email*"}),(0,j.jsx)("p",{children:s})]}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"Phone Number"}),(0,j.jsx)("p",{children:i})]}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"Gender"}),(0,j.jsx)("p",{children:"Male"})]}),(0,j.jsxs)(o.Flex,{justify:"flex-start",gap:"50px",children:[(0,j.jsx)("h4",{children:"Date of Birth"}),(0,j.jsx)("p",{children:r})]})]})}const Vn=(0,c.createHigherOrderComponent)((e=>t=>{const{hasResolved:n}=t;return n?(0,j.jsx)(e,{...t}):(0,j.jsx)("div",{style:{marginTop:"15px"},children:(0,j.jsx)(U.CJ,{columns:2,height:"250px"})})}),"withLoading"),Yn=x.A.div`
	padding: 40px;
	background-color: ${u.l.light};
	border-bottom-left-radius: 6px;
	border-bottom-right-radius: 6px;

	h2 {
		font-size: 22px;
		font-weight: 600;
		color: ${u.l.neutral900};
		margin-bottom: 16px;
	}
	h4 {
		flex-basis: 30%;
	}
`,Wn=(0,a.withSelect)((e=>{const t=e(h.A.CONTACTS_SINGLE);return{details:t.getDetails(),hasResolved:t.hasFinishedResolution("getDetails")}})),Jn=(0,c.compose)([Wn,Vn])((function(e){const{details:t}=e;return(0,j.jsxs)(o.Flex,{gap:"12px",direction:"column",children:[(0,j.jsx)(Yn,{children:(0,j.jsxs)(o.__experimentalGrid,{columns:2,gap:5,children:[(0,j.jsx)(Un,{data:t?.data}),(0,j.jsx)(Gn,{data:t?.data})]})}),(0,j.jsx)(Yn,{children:(0,j.jsx)(Kn,{})})]})}));var Xn=n(51164);function Zn(){return(0,j.jsxs)(Xn.A,{children:[(0,j.jsx)("h3",{children:"Coming soon"}),(0,j.jsxs)("p",{children:["Are you Ready to get something new from us. Then ",(0,j.jsx)("br",{})," ","subscribe the news latter to get latest updates?"]}),(0,j.jsx)(C.Button,{variant:$.zB,sx:{background:"#F59E0B",border:"none"},children:"Upgrade to Pro!"})]})}var es=n(27174);const ts="vendtics-show-add-note-modal",ns=(0,a.withDispatch)((e=>({createNoteHandler:e(h.A.NOTES).createNewNote}))),ss=(0,c.compose)([ns])((function(e){const{createNoteHandler:t}=e,[n,s]=(0,r.useState)(!1),[i,l]=(0,r.useState)("");return(0,N.$3)(ts,(e=>{s(e)})),(0,j.jsx)(Je.A,{visible:n,width:"600px",onCloseRequest:()=>s(!1),children:(0,j.jsxs)(We.A,{onFinish:async e=>{try{const n={...e,note:i},s=await t(n);F.Ay.success((0,b.__)(s.message,"vendtics"))}catch(e){F.Ay.error((0,b.__)(e.message,"vendtics")),console.log("error",e.message)}(0,w.doAction)(ts,!1)},children:[(0,j.jsx)(Je.A.Header,{children:(0,b.__)("Add Note","vendtics")}),(0,j.jsx)(Je.A.Body,{children:(0,j.jsxs)(o.Flex,{direction:"column",gap:"20px",children:[(0,j.jsx)(gt.A,{label:"Note Title",placeholder:"Write your note title",type:"text",name:"title",required:!0}),(0,j.jsx)(es.A,{value:i,onChange:e=>l(e),useExtendStyles:!0})]})}),(0,j.jsx)(Je.A.Footer,{children:(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(B.A,{variant:$.E3,onClick:()=>s(!1),sx:{border:"1px solid transparent"},children:(0,b.__)("Close","vendtics")}),(0,j.jsx)(B.A,{variant:$.zB,htmlType:"submit",children:(0,b.__)("Create Note","vendtics")})]})})]})})}));var is=n(52292);const rs="vendtics-show-edit-note-modal",os=(0,a.withSelect)((e=>{const t=e(h.A.NOTES);return{id:t.getId(),noteDetails:t.getSingleNote(),hasResolved:t.hasFinishedResolution("getSingleNote")}})),ls=(0,a.withDispatch)((e=>{const t=e(h.A.NOTES);return{editNoteById:t.editNoteById,refreshSingleNote:()=>t.invalidateResolution("getSingleNote")}})),as=(0,c.compose)([os,ls])((function(e){const{id:t,editNoteById:n,hasResolved:s,noteDetails:i,refreshSingleNote:l}=e,[a]=(0,is.A)(),[c,d]=(0,r.useState)(!1),[h,u]=(0,r.useState)(""),{resetPath:x}=(0,N._K)();(0,N.$3)(rs,(e=>{d(e)})),(0,r.useEffect)((()=>{s&&(u(i?.data.note),a.setFieldValue("title",i?.data.title))}),[s]),(0,r.useEffect)((()=>{t&&l()}),[t]);const p=()=>{x(),d(!1)};return(0,j.jsx)(Je.A,{visible:c,width:"600px",onCloseRequest:()=>p(),children:(0,j.jsxs)(We.A,{onFinish:async e=>{try{const t={...e,note:h},s=await n(t);F.Ay.success((0,b.__)(s.message,"vendtics"))}catch(e){F.Ay.error((0,b.__)(e.message,"vendtics")),console.log("error",e.message)}x(),(0,w.doAction)(rs,!1)},disabled:!s,form:a,children:[(0,j.jsx)(Je.A.Header,{children:(0,b.__)("Edit Note","vendtics")}),(0,j.jsxs)(Je.A.Body,{children:[(0,j.jsx)(gt.A,{label:"Note Title",placeholder:"Write your note title",type:"text",name:"title",disabled:!s,required:!0}),(0,j.jsx)(es.A,{value:h,onChange:e=>u(e),useExtendStyles:!0})]}),(0,j.jsx)(Je.A.Footer,{children:(0,j.jsxs)(o.Flex,{gap:2,justify:"flex-end",children:[(0,j.jsx)(B.A,{variant:$.E3,onClick:()=>p(),sx:{border:"1px solid transparent"},children:(0,b.__)("Close","vendtics")}),(0,j.jsx)(B.A,{variant:$.zB,htmlType:"submit",children:(0,b.__)("Update Note","vendtics")})]})})]})})})),cs=(0,c.createHigherOrderComponent)((e=>t=>{const{hasResolved:n}=t;return n?(0,j.jsx)(e,{...t}):(0,j.jsx)("div",{style:{marginTop:"15px"},children:(0,j.jsx)(U.CJ,{columns:2,height:"250px"})})}),"withLoading");var ds=n(84976);const hs=[{label:(0,b.__)("Normal","vendtics"),value:"normal"},{label:(0,b.__)("High","vendtics"),value:"high"},{label:(0,b.__)("Medium","vendtics"),value:"medium"},{label:(0,b.__)("Low","vendtics"),value:"low"}];var us=n(11575);const xs=(0,x.A)(o.Flex)`
	border-radius: 0px 0px 6px 6px;
	border: 1px solid ${u.l.neutral200};
	background: ${u.l.light};
	padding: 16px 32px;

	h3 {
		color: ${u.l.neutral800};
		font-size: 16px;
	}
`,ps=(0,x.A)(us.A)`
	p {
		color: ${u.l.neutral700};
		font-size: 14px;
	}
`,ms=(0,x.A)(o.Flex)`
	img {
		width: 30px;
		height: 30px;
		border-radius: 30px;
	}
	h4 {
		color: ${u.l.neutral900};
		font-size: 16px;
	}
	p {
		color: ${u.l.neutral700};
		font-size: 12px;
	}
`,gs=(0,a.withDispatch)((e=>{const t=e(h.A.NOTES);return{setId:t.setId,editNoteById:t.editNoteById}})),js=(0,c.compose)([gs])((function(e){const{note:t,editNoteById:n,setId:i}=e,l=(0,s.Zp)(),a=(0,s.zy)();return(0,r.useEffect)((()=>{a.search&&((0,w.doAction)(rs,!0),i(Number(a.search.split("=")[1])))}),[a.search]),(0,j.jsxs)(ms,{children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)(o.Flex,{children:[(0,j.jsx)("img",{src:t.user?.avatar_url,alt:t.user?.display_name}),(0,j.jsx)("h4",{children:t.title}),(0,j.jsx)("p",{children:"Today, 7:44 PM"})]})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsxs)(o.Flex,{children:[(0,j.jsx)(re.A,{placeholder:"Priority Select",options:hs,size:"middle",style:{minWidth:"100px"},value:t.priority||"normal",onChange:async e=>{const s={...t,priority:e};try{await n(s)}catch(e){console.log("error",e)}}}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(B.A,{variant:$.Qq,sx:{background:"#F3F4F8",height:"35px"},onClick:()=>{return e=t.id,void l({pathname:a.pathname,search:(0,ds.PI)({id:e}).toString()});var e},children:(0,j.jsx)(g.qU,{})})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(B.A,{variant:$.Qq,sx:{background:"#F3F4F8",height:"35px"},children:(0,j.jsx)(g.aR,{width:16,height:16})})})]})})]})}));function As({notes:e}){return(0,j.jsx)(o.Flex,{direction:"column",gap:"20px",style:{marginTop:"50px"},children:e.map((e=>(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(ps,{title:(0,j.jsx)(js,{note:e}),children:(0,j.jsx)("p",{dangerouslySetInnerHTML:{__html:e.note}})})},e.id)))})}function vs(){return(0,j.jsxs)(xs,{children:[(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)("h3",{children:"Filter by: "})}),(0,j.jsx)(o.FlexItem,{children:(0,j.jsx)(B.A,{variant:$.Rm,onClick:()=>(0,w.doAction)(ts,!0),sx:{borderColor:u.l.primary,color:u.l.primary},children:"Create Note"})})]})}const ys=(0,a.withSelect)((e=>{const t=e(h.A.NOTES),n=e(h.A.CONTACTS_SINGLE);return{id:n.getId(),notes:n.getId()?t.getNotes():[],hasResolved:t.hasFinishedResolution("getNotes")}})),fs=(0,a.withDispatch)((e=>{const t=e(h.A.NOTES);return{refreshNotes:()=>t.invalidateResolution("getNotes")}})),_s=(0,c.compose)([ys,fs,cs])((function(e){const{notes:t}=e;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(vs,{}),(0,j.jsx)(As,{notes:t?.notes||[]}),(0,j.jsx)(as,{}),(0,j.jsx)(ss,{})]})})),bs=n.p+"chunks/images/contacts-email.webp";function Cs(){return(0,j.jsxs)(Xn.A,{bgUrl:bs,children:[(0,j.jsx)("h3",{children:"Coming soon"}),(0,j.jsxs)("p",{children:["Are you Ready to get something new from us. Then ",(0,j.jsx)("br",{})," ","subscribe the news latter to get latest updates?"]}),(0,j.jsx)(C.Button,{variant:$.zB,sx:{background:"#F59E0B",border:"none"},children:"Upgrade to Pro!"})]})}const ws=n.p+"chunks/images/contacts-order-history.webp";function Ss(){return(0,j.jsxs)(Xn.A,{bgUrl:ws,children:[(0,j.jsx)("h3",{children:"Coming soon"}),(0,j.jsxs)("p",{children:["Are you Ready to get something new from us. Then ",(0,j.jsx)("br",{})," ","subscribe the news latter to get latest updates?"]}),(0,j.jsx)(C.Button,{variant:$.zB,sx:{background:"#F59E0B",border:"none"},children:"Upgrade to Pro!"})]})}function Ts(){return(0,j.jsxs)(s.BV,{children:[(0,j.jsxs)(s.qh,{element:(0,j.jsx)(i.Kv,{}),children:[(0,j.jsx)(s.qh,{index:!0,element:(0,j.jsx)(Qn.A,{children:(0,j.jsx)(pt,{})},"contacts")}),(0,j.jsx)(s.qh,{path:"lists",element:(0,j.jsx)(Qn.A,{children:(0,j.jsx)(nn,{})},"lists")}),(0,j.jsx)(s.qh,{path:"tags",element:(0,j.jsx)(Qn.A,{children:(0,j.jsx)(Pn,{})},"tags")}),(0,j.jsx)(s.qh,{path:"segments",element:(0,j.jsx)(Qn.A,{children:(0,j.jsx)(qn,{bgUrl:""})},"segments")})]}),(0,j.jsxs)(s.qh,{path:":id/*",element:(0,j.jsx)(i.Ig,{}),children:[(0,j.jsx)(s.qh,{index:!0,element:(0,j.jsx)(s.C5,{replace:!0,to:"overview"})}),(0,j.jsx)(s.qh,{path:"overview",element:(0,j.jsx)(Qn.A,{children:(0,j.jsx)(Jn,{})},"overview")}),(0,j.jsx)(s.qh,{path:"activity",element:(0,j.jsx)(Qn.A,{children:(0,j.jsx)(Zn,{})},"activity")}),(0,j.jsx)(s.qh,{path:"notes",element:(0,j.jsx)(Qn.A,{children:(0,j.jsx)(_s,{})},"notes")}),(0,j.jsx)(s.qh,{path:"email",element:(0,j.jsx)(Qn.A,{children:(0,j.jsx)(Cs,{})},"email")}),(0,j.jsx)(s.qh,{path:"order-history",element:(0,j.jsx)(Qn.A,{children:(0,j.jsx)(Ss,{})},"order-history")}),(0,j.jsx)(s.qh,{path:"*",element:(0,j.jsx)(s.C5,{to:"/contacts",replace:!0})})]})]})}}}]);