PageSourceSearch

https://app.clycklist.com/_next/static/chunks/pages/app/lists/[id]-5bf1d01836abff7a.js

js clycklist.com collected 2026-10-02 01:28:45 UTC 121,323 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[663],{16763:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var l=a(37876),s=a(77328),i=a.n(s),r=a(89099),n=a(55504);let o={title:n.A.appname,siteName:n.A.appname,description:"Export leads from LinkedIn with valid emails to build your email lists in just 1 click.",url:"https://clycklist.com",type:"website",robots:"follow, index",image:"https://clycklist.com/images/global/website-preview.png"};function d(e){let t=(0,r.useRouter)(),a={...o,...e};a.title=e.templateTitle?"".concat(e.templateTitle," | ").concat(a.siteName):a.title;let s="/"===t.asPath?"":t.asPath;return(0,l.jsxs)(i(),{children:[(0,l.jsx)("title",{children:a.title}),(0,l.jsx)("meta",{name:"robots",content:a.robots}),(0,l.jsx)("meta",{content:a.description,name:"description"}),(0,l.jsx)("meta",{property:"og:url",content:"".concat(a.url).concat(s)}),(0,l.jsx)("link",{rel:"canonical",href:"".concat(a.url).concat(s)}),(0,l.jsx)("meta",{property:"og:type",content:a.type}),(0,l.jsx)("meta",{property:"og:site_name",content:a.siteName}),(0,l.jsx)("meta",{property:"og:description",content:a.description}),(0,l.jsx)("meta",{property:"og:title",content:a.title}),(0,l.jsx)("meta",{name:"image",property:"og:image",content:a.image}),(0,l.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,l.jsx)("meta",{name:"twitter:site",content:"@clycklist"}),(0,l.jsx)("meta",{name:"twitter:title",content:a.title}),(0,l.jsx)("meta",{name:"twitter:description",content:a.description}),(0,l.jsx)("meta",{name:"twitter:image",content:a.image}),a.date&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("meta",{property:"article:published_time",content:a.date}),(0,l.jsx)("meta",{name:"publish_date",property:"og:publish_date",content:a.date})]}),c.map(e=>(0,l.jsx)("link",{...e},e.href)),(0,l.jsx)("meta",{name:"msapplication-TileColor",content:"#ffffff"}),(0,l.jsx)("meta",{name:"msapplication-config",content:"/favicon/browserconfig.xml"}),(0,l.jsx)("meta",{name:"theme-color",content:"#ffffff"})]})}let c=[{rel:"apple-touch-icon",sizes:"180x180",href:"/favicon/apple-touch-icon.png"},{rel:"icon",type:"image/png",sizes:"96x96",href:"/favicon/favicon-96x96.png"},{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicon/favicon-16x16.png"},{rel:"manifest",href:"/favicon/site.webmanifest"},{rel:"mask-icon",href:"/favicon/safari-pinned-tab.svg",color:"#00e887"},{rel:"shortcut icon",href:"/favicon/favicon.ico"}]},20749:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var l=a(37876);a(14232);var s=a(63248);function i(e){let{className:t,...a}=e;return(0,l.jsx)("span",{className:(0,s.A)("inline-block animate-shimmer bg-[#f6f7f8]",t),style:{backgroundImage:"linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%)",backgroundSize:"700px 100%",backgroundRepeat:"no-repeat"},...a})}},21157:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var l=a(37876),s=a(14232),i=a(46318),r=a(63248);let n=s.forwardRef((e,t)=>{let{className:a,disabled:s,isLoading:n,variant:o="primary",size:d="base",isDarkBg:c=!1,icon:u,iconClassName:m,...h}=e,p=n||s;return(0,l.jsxs)("button",{ref:t,type:"button",disabled:p,className:(0,r.A)("inline-flex items-center justify-center rounded font-medium","focus:outline-none focus-visible:ring focus-visible:ring-primary-500","shadow-sm","transition-colors duration-75",["base"===d&&["min-h-[38px] min-w-[38px]","text-sm md:text-base"],"sm"===d&&["min-h-[30px] min-w-[30px]","text-xs md:text-sm"]],["primary"===o&&["bg-primary-500 text-white","border border-primary-600","hover:bg-primary-600 hover:text-white","active:bg-primary-700","disabled:bg-primary-700"],"outline"===o&&["text-primary-500","border border-primary-500","hover:bg-primary-50 active:bg-primary-100 disabled:bg-primary-100",c&&"hover:bg-gray-900 active:bg-gray-800 disabled:bg-gray-800"],"ghost"===o&&["text-primary-500","shadow-none","hover:bg-primary-50 active:bg-primary-100 disabled:bg-primary-100",c&&"hover:bg-gray-900 active:bg-gray-800 disabled:bg-gray-800"],"light"===o&&["bg-white text-gray-700","border border-gray-300","hover:bg-gray-100 hover:text-dark","active:bg-white/80 disabled:bg-gray-200"],"dark"===o&&["bg-gray-900 text-white","border border-gray-600","hover:bg-gray-800 active:bg-gray-700 disabled:bg-gray-700"]],"disabled:cursor-not-allowed",n&&"relative text-transparent transition-none hover:text-transparent disabled:cursor-wait",a),...h,children:[n&&(0,l.jsx)("div",{className:(0,r.A)("absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",{"text-white":["primary","dark"].includes(o),"text-black":["light"].includes(o),"text-primary-500":["outline","ghost"].includes(o)}),children:(0,l.jsx)(i.kiM,{className:"animate-spin"})}
1),u&&(0,l.jsx)(u,{className:(0,r.A)(["base"===d&&"md:text-md text-md","sm"===d&&"md:text-md text-sm"],m)})]})})},38838:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>aw,default:()=>aN});var l=a(37876),s=a(14232),i=a(11123),r=a(21157),n=a(4847),o=a(61198),d=a(81156),c=a(16763),u=a(66725),m=a(63248);function h(e){let{folder:t}=e,a=(0,s.useMemo)(()=>{let e=[];return(null==t?void 0:t.isArchived)&&e.push({msg:"Archived"}),e},[t]);return(0,l.jsx)(l.Fragment,{children:!!a.length&&(0,l.jsx)("div",{className:"mt-2 ml-2 flex items-center",children:a.map(e=>(0,l.jsx)("p",{className:(0,m.A)("mr-1 rounded bg-gray-100 px-1 py-[2px] text-xs text-slate-500","error"===e.type&&"bg-red-100 text-red-500","warn"===e.type&&"bg-yellow-100 text-yellow-600"),children:e.msg},e.msg))})})}var p=a(42649),x=a(78399);let f={featureFlags:[{label:"Advanced table",value:"advancedTable",icon:p.A,tooltipTitle:"Toggle advanced table",tooltipDescription:"A filter and sort builder to filter and sort rows."},{label:"Floating bar",value:"floatingBar",icon:x.A,tooltipTitle:"Toggle floating bar",tooltipDescription:"A floating bar that sticks to the top of the table."}],textOperators:[{label:"Contains",value:"iLike"},{label:"Does not contain",value:"notILike"},{label:"Is",value:"eq"},{label:"Is not",value:"ne"},{label:"Is empty",value:"isEmpty"},{label:"Is not empty",value:"isNotEmpty"}],numericOperators:[{label:"Is",value:"eq"},{label:"Is not",value:"ne"},{label:"Is less than",value:"lt"},{label:"Is less than or equal to",value:"lte"},{label:"Is greater than",value:"gt"},{label:"Is greater than or equal to",value:"gte"},{label:"Is empty",value:"isEmpty"},{label:"Is not empty",value:"isNotEmpty"}],dateOperators:[{label:"Is",value:"eq"},{label:"Is not",value:"ne"},{label:"Is before",value:"lt"},{label:"Is after",value:"gt"},{label:"Is on or before",value:"lte"},{label:"Is on or after",value:"gte"},{label:"Is between",value:"isBetween"},{label:"Is relative to today",value:"isRelativeToToday"},{label:"Is empty",value:"isEmpty"},{label:"Is not empty",value:"isNotEmpty"}],selectOperators:[{label:"Is",value:"eq"},{label:"Is not",value:"ne"},{label:"Is empty",value:"isEmpty"},{label:"Is not empty",value:"isNotEmpty"}],booleanOperators:[{label:"Is",value:"eq"},{label:"Is not",value:"ne"}],joinOperators:[{label:"And",value:"and"},{label:"Or",value:"or"}],sortOrders:[{label:"Asc",value:"asc"},{label:"Desc",value:"desc"}],columnTypes:["text","number","date","boolean","select","multi-select"],globalOperators:["iLike","notILike","eq","ne","isEmpty","isNotEmpty","lt","lte","gt","gte","isBetween","isRelativeToToday","and","or"]};var g=a(29091);function v(e){return"text"===e?"iLike":"eq"}function j(e){let{data:t,filters:a,joinOperator:l}=e;return t.filter(e=>{let t=a.map(t=>{let{id:a,operator:l,value:s,type:i}=t,r="boolean"===i?(0,g.G4)(s):s,n=e[a];switch(l){case"eq":return Array.isArray(r)?r.includes(n):n===r;case"ne":return Array.isArray(r)?!r.includes(n):n!==r;case"iLike":return"text"===i&&"string"==typeof n&&n.toLowerCase().includes(r.toLowerCase());case"notILike":return"text"===i&&"string"==typeof n&&!n.toLowerCase().includes(r.toLowerCase());case"lt":return n<r;case"lte":return n<=r;case"gt":return n>r;case"gte":return n>=r;case"isBetween":return!!Array.isArray(r)&&2===r.length&&n>=r[0]&&n<=r[1];case"isEmpty":return null==n||""===n;case"isNotEmpty":return null!=n&&""!==n;default:throw Error("Unsupported operator: ".concat(l))}});return"and"===l?t.every(e=>e):t.some(e=>e)})}function b(e,t){return e.sort((e,a)=>{for(let{id:l,desc:s}of t){let t=e[l],i=a[l];if(t<i)return s?1:-1;if(t>i)return s?-1:1}return 0})}var y=function(e){return e.AND="and",e.OR="or",e}({}),w=a(80035),N=a(72649),A=a.n(N);class C{updateFilters(e){(0,w.h5)(()=>{var t;this.sorts=e.sorts?[...e.sorts]:this.sorts,this.filters=e.filters?[...e.filters]:this.filters,this.joinOperator=null!=(t=e.joinOperator)?t:this.joinOperator}),this.filteredData__()}get filteredData(){let{filters:e,sorts:t,joinOperator:a,masterData:l}=this,s=[...l];return e.length>0&&(s=j({data:s,joinOperator:a,filters:e})),t.length>0&&(s=b(s,t)),this.updateTableRowData(s),A()(s)}filteredData__(){let{filters:e,sorts:t,joinOperator:a,masterData:l}=this,s=[...l];e.length>0&&(s=j({data:s,joinOperator:a,filters:e})),t.length>0&&(s=b(s,t)),this.updateTableRowData(s)}get selectedRowsArray(){return Array.from(this.selectedRows.values())}get tableApi(){var e,t;return null!=(t=null==(e=this.tableRef.current)?void 0:e.api)?t:void 0}constructor(e){this.selectedRows=[],this.filters=[],this.sorts=[],this.joinOperator=y.AND,this.masterData=[],this.columnDefs=[],this.setMasterData=e=>{let t=A()(e);this.masterData=t,this.updateTableRowData(t)},this.setColumnDefs=e=>{this.columnDefs=[...e],this.updateTableColumn(e)},this.updateTableRowData=e=>{var t;null==(t=this.tableApi)||t.setGridOption("rowData",e)},this.updateTableColumn=e=>{var t;
1null==(t=this.tableApi)||t.setGridOption("columnDefs",e)},this.resetFilters=()=>{this.sorts=[],this.filters=[],this.joinOperator=y.AND,this.filteredData__()},this.updateSelectedRows=e=>{let t=null==e?void 0:e.getSelectedRows();t&&(this.selectedRows=t)},this.clearSelectRow=()=>{this.selectedRows=[]},this.tableRef=e,(0,w.Gn)(this,{tableRef:w.sH.ref,selectedRows:w.sH,filters:w.sH.deep,sorts:w.sH.shallow,joinOperator:w.sH,masterData:w.sH.deep,columnDefs:w.sH,filteredData:w.EW,selectedRowsArray:w.EW,setMasterData:w.XI,updateFilters:w.XI,resetFilters:w.XI,updateSelectedRows:w.XI,clearSelectRow:w.XI,updateTableRowData:w.XI,updateTableColumn:w.XI,setColumnDefs:w.XI})}}var I=a(41010);let S=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"active",a=await fetch("/api/leads/leads-by-list?listId=".concat(e,"&leadType=").concat(t),{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});return await a.json().catch(()=>{})},k=async e=>{let t=await fetch("/api/leads/leads-count?listId=".concat(e),{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});return await t.json().catch(()=>{})},R=async e=>{let t=await fetch("/api/leads/update-user-version-lead",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)});return await t.json().catch(()=>{})},T=async e=>{let t=await fetch("/api/leads/delete-user-leads",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)});return await t.json().catch(()=>{})};var L=a(31186);class _ extends C{constructor(e,t){super(e),this._tableRef=e,this.folderId=t,this.selectLeadModalState={state:!1},this.init=async()=>{var e,t;this.abortController&&this.abortController.abort(),this.abortController=new AbortController;let a=this.abortController.signal;null==(e=this.tableApi)||e.updateGridOptions({loading:!0,rowData:[]});try{let e=await I.id.folder.getLeads.query({folderId:this.folderId},{signal:a}),t=(0,L.pR)(e);this.setMasterData(t)}catch(e){console.log(e)}finally{null==(t=this.tableApi)||t.updateGridOptions({loading:!1})}},this.toggleSelectSegmentSearchModal=e=>{(null==e?void 0:e.state)===!0?this.selectLeadModalState=e:this.selectLeadModalState={state:!1}},this.updateFilters=async e=>{super.updateFilters(e)},this.mutateTableRowData=e=>{R(e),this.masterData.forEach(t=>{t._id===e.leadId&&(t[e.column]=e.value)}),this.filteredData__()},this.deleteTableRowData=async e=>{await T(e),this.masterData=this.masterData.filter(t=>!e.some(e=>e.leadId===t._id)),this.filteredData__()},(0,w.Gn)(this,{selectedRows:w.$Z,filters:w.$Z,sorts:w.$Z,joinOperator:w.$Z,masterData:w.$Z,setMasterData:w.$Z,updateFilters:w.$Z,resetFilters:w.$Z,updateSelectedRows:w.$Z,clearSelectRow:w.$Z,filteredData:w.$Z,tableRef:w.$Z,selectedRowsArray:w.$Z,updateTableColumn:w.$Z,updateTableRowData:w.$Z,selectLeadModalState:w.sH,toggleSelectSegmentSearchModal:w.XI,init:w.XI,mutateTableRowData:w.XI,deleteTableRowData:w.XI}),this.init()}}var E=a(95148),V=a(16175),O=a(86032),D=a(66748),F=a(17178),M=a(90935),z=a(81143),W=a(46512),P=a(65682),$=a(77041),Z=a(88671),B=a(92188),X=a(65870),q=a(59829);let H=q.AM,G=s.forwardRef((e,t)=>{let{className:a,children:s,...i}=e;return(0,l.jsx)(q.Wv,{ref:t,className:(0,X.cn)(a),...i,children:s})});G.displayName="FacetedFilterTrigger";let U=s.forwardRef((e,t)=>{let{className:a,children:s,...i}=e;return(0,l.jsx)(q.hl,{ref:t,className:(0,X.cn)("w-[12.5rem] p-0",a),align:"start",...i,children:(0,l.jsx)(B.uB,{children:s})})});U.displayName="FacetedFilterContent";let Q=B.G7,Y=B.oI,J=B.xL,K=B.L$,ee=s.forwardRef((e,t)=>{let{className:a,children:s,selected:i,...r}=e;return(0,l.jsxs)(B.h_,{ref:t,"aria-selected":i,"data-selected":i,className:(0,X.cn)(a),...r,children:[(0,l.jsx)("span",{className:(0,X.cn)("mr-2 flex size-4 items-center justify-center rounded-sm border border-primary",i?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,l.jsx)(F.A,{className:"size-4"})}),s]})});ee.displayName="FacetedFilterItem";var et=a(48971),ea=a(89285),el=a(14664),es=a(34159),ei=a(54287),er=a(63727),en=a(82987);function eo(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return e=>t.forEach(t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)})}let ed={vertical:{modifiers:[es.FN,es.gj],strategy:ei._G},horizontal:{modifiers:[es.dU,es.gj],strategy:ei.m$},mixed:{modifiers:[es.gj],strategy:void 0}};
1function ec(e){let{value:t,onValueChange:a,collisionDetection:i=el.fp,modifiers:r,strategy:n,onMove:o,orientation:d="vertical",overlay:c,children:u,...m}=e,[h,p]=s.useState(null),x=(0,el.FR)((0,el.MS)(el.cA),(0,el.MS)(el.IG),(0,el.MS)(el.uN)),f=ed[d];return(0,l.jsxs)(el.Mp,{modifiers:null!=r?r:f.modifiers,sensors:x,onDragStart:e=>{let{active:t}=e;return p(t.id)},onDragEnd:e=>{let{active:l,over:s}=e;if(s&&l.id!==(null==s?void 0:s.id)){let e=t.findIndex(e=>e.id===l.id),i=t.findIndex(e=>e.id===s.id);o?o({activeIndex:e,overIndex:i}):null==a||a((0,ei.be)(t,e,i))}p(null)},onDragCancel:()=>p(null),collisionDetection:i,...m,children:[(0,l.jsx)(ei.gB,{items:t,strategy:null!=n?n:f.strategy,children:u}),c?(0,l.jsx)(em,{activeId:h,children:c}):null]})}let eu={sideEffects:(0,el.WB)({styles:{active:{opacity:"0.4"}}})},em=s.forwardRef((e,t)=>{let{activeId:a,dropAnimation:s=eu,children:i,...r}=e;return(0,l.jsx)(el.Hd,{dropAnimation:s,...r,children:a?(0,l.jsx)(ep,{ref:t,value:a,className:"cursor-grabbing",asChild:!0,children:i}):null})});em.displayName="SortableOverlay";let eh=s.createContext({attributes:{},listeners:void 0,isDragging:!1}),ep=s.forwardRef((e,t)=>{let{value:a,asTrigger:i,asChild:r,className:n,...o}=e,{attributes:d,listeners:c,setNodeRef:u,transform:m,transition:h,isDragging:p}=(0,ei.gl)({id:a}),x=s.useMemo(()=>({attributes:d,listeners:c,isDragging:p}),[d,c,p]),f={opacity:p?.5:1,transform:er.Ks.Translate.toString(m),transition:h},g=r?en.DX:"div";return(0,l.jsx)(eh.Provider,{value:x,children:(0,l.jsx)(g,{"data-state":p?"dragging":void 0,className:(0,X.cn)("data-[state=dragging]:cursor-grabbing",{"cursor-grab":!p&&i},n),ref:eo(t,u),style:f,...i?d:{},...i?c:{},...o})})});ep.displayName="SortableItem";let ex=s.forwardRef((e,t)=>{let{className:a,...i}=e,{attributes:r,listeners:n,isDragging:o}=function(){let e=s.useContext(eh);if(!e)throw Error("useSortableItem must be used within a SortableItem");return e}();return(0,l.jsx)($.$,{ref:eo(t),"data-state":o?"dragging":void 0,className:(0,X.cn)("cursor-grab data-[state=dragging]:cursor-grabbing",a),...r,...n,...i})});function ef(e,t){let a=function(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>function(){for(var e,a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return null==(e=t.current)?void 0:e.call(t,...l)},[])}(e),l=s.useRef(null);return s.useEffect(()=>()=>{null!==l.current&&window.clearTimeout(l.current)},[]),Object.assign(s.useCallback(function(){for(var e=arguments.length,s=Array(e),i=0;i<e;i++)s[i]=arguments[i];null!==l.current&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{queueMicrotask(()=>{a(...s)})},t)},[a,t]),{cancel:s.useCallback(()=>{null!==l.current&&(window.clearTimeout(l.current),l.current=null)},[])})}function eg(e){let{filterFields:t,debounceMs:a,filters:i,joinOperator:r,setFilters:n,setJoinOperator:o,gridRef:d}=e,c=s.useId(),u=ef(n,a);function m(e){let{rowId:t,field:a,debounced:l=!1}=e;(l?u:n)(i.map(e=>e.rowId===t?{...e,...a}:e))}return(0,l.jsx)(ec,{value:i.map(e=>({id:e.rowId})),onMove:e=>{let{activeIndex:t,overIndex:a}=e;n((e=>{let l=[...i],[s]=l.splice(t,1);return s?(l.splice(a,0,s),l):e})(i))},overlay:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"h-8 min-w-[4.5rem] rounded-sm bg-primary/10"}),(0,l.jsx)("div",{className:"h-8 w-32 rounded-sm bg-primary/10"}),(0,l.jsx)("div",{className:"h-8 w-32 rounded-sm bg-primary/10"}),(0,l.jsx)("div",{className:"h-8 min-w-36 flex-1 rounded-sm bg-primary/10"}),(0,l.jsx)("div",{className:"size-8 shrink-0 rounded-sm bg-primary/10"}),(0,l.jsx)("div",{className:"size-8 shrink-0 rounded-sm bg-primary/10"})]}),children:(0,l.jsxs)(q.AM,{children:[(0,l.jsx)(q.Wv,{asChild:!0,children:(0,l.jsxs)($.$,{variant:"outline",size:"sm",className:"h-8 gap-2","aria-label":"Open filters","aria-controls":"".concat(c,"-filter-dialog"),children:[(0,l.jsx)(D.A,{className:"h-3 w-3","aria-hidden":"true"}),"Filters",i.length>0&&(0,l.jsx)(P.E,{variant:"secondary",className:"h-[1.14rem] rounded-[0.2rem] px-[0.32rem] font-mono text-[0.65rem] font-normal",children:i.length})]})}),(0,l.jsxs)(q.hl,{id:"".concat(c,"-filter-dialog"),align:"start",collisionPadding:16,className:(0,X.cn)("flex w-[calc(100vw-theme(sp
1acing.12))] min-w-60 origin-[var(--radix-popover-content-transform-origin)] flex-col p-4 sm:w-[36rem]",i.length>0?"gap-3.5":"gap-2"),children:[i.length>0?(0,l.jsx)("h4",{className:"font-medium leading-none",children:"Filters"}):(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h4",{className:"font-medium leading-none",children:"No filters applied"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Add filters to refine your results."})]}),(0,l.jsx)("div",{className:"flex max-h-40 flex-col gap-2 py-0.5 pr-1",children:i.map((e,a)=>{var s,d,u,h;let p="".concat(c,"-filter-").concat(e.rowId),x="".concat(p,"-join-operator-listbox"),g="".concat(p,"-field-listbox"),j="".concat(p,"-field-trigger"),b="".concat(p,"-operator-listbox"),y="".concat(p,"-input");return(0,l.jsx)(ep,{value:e.rowId,asChild:!0,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"min-w-[4.5rem] text-center",children:0===a?(0,l.jsx)("span",{className:"text-sm text-muted-foreground",children:"Where"}):1===a?(0,l.jsxs)(ea.l6,{value:r,onValueChange:e=>o(e),children:[(0,l.jsx)(ea.bq,{"aria-label":"Select join operator","aria-controls":x,className:"h-8 rounded lowercase",children:(0,l.jsx)(ea.yv,{placeholder:r})}),(0,l.jsx)(ea.gC,{id:x,position:"popper",className:"min-w-[var(--radix-select-trigger-width)] lowercase",children:f.joinOperators.map(e=>(0,l.jsx)(ea.eb,{value:e.value,children:e.label},e.value))})]}):(0,l.jsx)("span",{className:"text-sm text-muted-foreground",children:r})}),(0,l.jsxs)(q.AM,{modal:!0,children:[(0,l.jsx)(q.Wv,{asChild:!0,children:(0,l.jsxs)($.$,{id:j,variant:"outline",size:"sm",role:"combobox","aria-label":"Select filter field","aria-controls":g,className:"h-8 w-32 justify-between gap-2 rounded focus:outline-none focus:ring-1 focus:ring-ring focus-visible:ring-0",children:[(0,l.jsx)("span",{className:"truncate",children:null!=(d=null==(s=t.find(t=>t.id===e.id))?void 0:s.label)?d:"Select field"}),(0,l.jsx)(V.A,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),(0,l.jsx)(q.hl,{id:g,align:"start",className:"w-40 p-0",onCloseAutoFocus:()=>{var e;return null==(e=document.getElementById(j))?void 0:e.focus({preventScroll:!0})},children:(0,l.jsxs)(B.uB,{children:[(0,l.jsx)(B.G7,{placeholder:"Search fields..."}),(0,l.jsxs)(B.oI,{children:[(0,l.jsx)(B.xL,{children:"No fields found."}),(0,l.jsx)(B.L$,{children:t.map(a=>(0,l.jsxs)(B.h_,{value:a.id,onSelect:a=>{var l;let s=t.find(e=>e.id===a);s&&(m({rowId:e.rowId,field:{id:a,type:s.type,operator:v(s.type),value:""}}),null==(l=document.getElementById(j))||l.click())},children:[(0,l.jsx)("span",{className:"mr-1.5 truncate",children:a.label}),(0,l.jsx)(F.A,{className:(0,X.cn)("ml-auto h-4 w-4 shrink-0",a.id===e.id?"opacity-100":"opacity-0")})]},a.id))})]})]})})]}),(0,l.jsxs)(ea.l6,{value:e.operator,onValueChange:t=>m({rowId:e.rowId,field:{operator:t,value:"isEmpty"===t||"isNotEmpty"===t?"":e.value}}),children:[(0,l.jsx)(ea.bq,{"aria-label":"Select filter operator","aria-controls":b,className:"h-8 w-32 rounded",children:(0,l.jsx)("div",{className:"truncate",children:(0,l.jsx)(ea.yv,{placeholder:e.operator})})}),(0,l.jsx)(ea.gC,{id:b,children:(u=e.type,null!=(h=({text:f.textOperators,number:f.numericOperators,select:f.selectOperators,"multi-select":f.selectOperators,boolean:f.booleanOperators,date:f.dateOperators})[u])?h:f.textOperators).map(e=>(0,l.jsx)(ea.eb,{value:e.value,children:e.label},e.value))})]}),(0,l.jsx)("div",{className:"min-w-36 flex-1",children:function(e){var a,s,i,r,n,o,d,c,u,h,p,x,f,g;let{filter:v,inputId:j}=e,b=t.find(e=>e.id===v.id);if(!b)return null;if("isEmpty"===v.operator||"isNotEmpty"===v.operator)return(0,l.jsx)("div",{id:j,role:"status","aria-live":"polite","aria-label":"".concat(b.label," filter is ").concat("isEmpty"===v.operator?"empty":"not empty"),className:"h-8 w-full rounded border border-dashed"});switch(v.type){case"text":case"number":return(0,l.jsx)(et.p,{id:j,type:v.type,"aria-label":"".concat(b.label," filter value"),"aria-describedby":"".concat(j,"-description"),placeholder:null!=(a=b.placeholder)?a:"Enter a value...",className:"h-8 w-full rounded",defaultValue:"string"==typeof v.value?v.value:void 0,onChange:e=>m({rowId:v.rowId,field:{value:e.target.value},debounced:!0})});case"select":return(0,l.jsxs)(H,{children:[(0,l.jsx)(G,{asChild:!0,children:(0,l.jsx)($.$,{id:j,variant:"outline",size:"sm","aria-label":"".concat(b.label," filter value"),"aria-controls":"".concat(j,"-listbox"),className:"h-8 w-full justify-start gap-2 rounded px-1.5 text-left text-muted-foreground hover:text-muted-foreground",children:v.value&&"string"==typeof v.value?(0,l.jsx)(P.E,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:(null==b||null==(i=b.o
1ptions)||null==(s=i.find(e=>e.value===v.value))?void 0:s.label)||v.value}):(0,l.jsxs)(l.Fragment,{children:[null!=(n=b.placeholder)?n:"Select an option...",(0,l.jsx)(V.A,{className:"h-4 w-4","aria-hidden":"true"})]})})}),(0,l.jsxs)(U,{id:"".concat(j,"-listbox"),className:"w-[12.5rem] origin-[var(--radix-popover-content-transform-origin)]",children:[(0,l.jsx)(Q,{placeholder:null!=(o=null==b?void 0:b.label)?o:"Search options...","aria-label":"Search ".concat(null==b?void 0:b.label," options")}),(0,l.jsxs)(Y,{children:[(0,l.jsx)(J,{children:"No options found."}),(0,l.jsx)(K,{children:null==b||null==(r=b.options)?void 0:r.map(e=>(0,l.jsxs)(ee,{value:e.value,selected:v.value===e.value,onSelect:e=>{m({rowId:v.rowId,field:{value:e}}),setTimeout(()=>{var e;null==(e=document.getElementById(j))||e.click()},0)},children:[e.icon&&(0,l.jsx)(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground","aria-hidden":"true"}),(0,l.jsx)("span",{children:e.label}),e.count&&(0,l.jsx)("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:e.count})]},e.value))})]})]})]});case"multi-select":let y=new Set(Array.isArray(v.value)?v.value:[]);return(0,l.jsxs)(H,{children:[(0,l.jsx)(G,{asChild:!0,children:(0,l.jsxs)($.$,{id:j,variant:"outline",size:"sm","aria-label":"".concat(b.label," filter values"),"aria-controls":"".concat(j,"-listbox"),className:"h-8 w-full justify-start gap-2 rounded px-1.5 text-left text-muted-foreground hover:text-muted-foreground",children:[(0,l.jsx)(l.Fragment,{children:0===y.size&&(0,l.jsxs)(l.Fragment,{children:[null!=(u=b.placeholder)?u:" Select options...",(0,l.jsx)(V.A,{className:"h-4 w-4","aria-hidden":"true"})]})}),(null==y?void 0:y.size)>0&&(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(P.E,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:y.size}),(0,l.jsx)("div",{className:"hidden min-w-0 gap-1 lg:flex",children:y.size>2?(0,l.jsxs)(P.E,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[y.size," selected"]}):null==b||null==(d=b.options)?void 0:d.filter(e=>y.has(e.value)).map(e=>(0,l.jsx)(P.E,{variant:"secondary",className:"truncate rounded-sm px-1 font-normal",children:e.label},e.value))})]})]})}),(0,l.jsxs)(U,{id:"".concat(j,"-listbox"),className:"w-[12.5rem] origin-[var(--radix-popover-content-transform-origin)]",children:[(0,l.jsx)(Q,{"aria-label":"Search ".concat(null==b?void 0:b.label," options"),placeholder:null!=(h=null==b?void 0:b.label)?h:"Search options..."}),(0,l.jsxs)(Y,{children:[(0,l.jsx)(J,{children:"No options found."}),(0,l.jsx)(K,{children:null==b||null==(c=b.options)?void 0:c.map(e=>(0,l.jsxs)(ee,{value:e.value,selected:y.has(e.value),onSelect:e=>{let t=Array.isArray(v.value)?v.value:[],a=t.includes(e)?t.filter(t=>t!==e):[...t,e];m({rowId:v.rowId,field:{value:a}})},children:[e.icon&&(0,l.jsx)(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground","aria-hidden":"true"}),(0,l.jsx)("span",{children:e.label}),e.count&&(0,l.jsx)("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:e.count})]},e.value))})]})]})]});case"date":let w=Array.isArray(v.value)?v.value.filter(Boolean):[v.value,v.value].filter(Boolean),N="isBetween"===v.operator&&2===w.length?"".concat((0,X.Yq)(null!=(p=w[0])?p:new Date)," - ").concat((0,X.Yq)(null!=(x=w[1])?x:new Date)):w[0]?(0,X.Yq)(w[0]):"Pick a date";return(0,l.jsxs)(q.AM,{children:[(0,l.jsx)(q.Wv,{asChild:!0,children:(0,l.jsxs)($.$,{id:j,variant:"outline",size:"sm","aria-label":"".concat(b.label," date filter"),"aria-controls":"".concat(j,"-calendar"),className:(0,X.cn)("h-8 w-full justify-start gap-2 rounded text-left font-normal",!v.value&&"text-muted-foreground"),children:[(0,l.jsx)(O.A,{className:"size-3.5 shrink-0","aria-hidden":"true"}),(0,l.jsx)("span",{className:"truncate",children:N})]})}),(0,l.jsx)(q.hl,{id:"".concat(j,"-calendar"),align:"start",className:"w-auto p-0",children:"isBetween"===v.operator?(0,l.jsx)(Z.V,{id:"".concat(j,"-calendar"),mode:"range","aria-label":"Select ".concat(b.label," date range"),selected:2===w.length?{from:new Date(null!=(f=w[0])?f:""),to:new Date(null!=(g=w[1])?g:"")}:{from:new Date,to:new Date},onSelect:e=>{var t,a,l,s;m({rowId:v.rowId,field:{value:e?[null!=(l=null==(t=e.from)?void 0:t.toISOString())?l:"",null!=(s=null==(a=e.to)?void 0:a.toISOString())?s:""]:[]}})},initialFocus:!0,numberOfMonths:1}):(0,l.jsx)(Z.V,{id:"".concat(j,"-calendar"),mode:"single","aria-label":"Select ".concat(b.label," date"),selected:w[0]?new Date(w[0]):void 0,onSelect:e=>{var t;m({rowId:v.rowId,field:{value:null!=(t=null==e?void 0:e.toISOString())?t:""}}),setTimeout(()=>{var e;
1null==(e=document.getElementById(j))||e.click()},0)},initialFocus:!0})})]});case"boolean":if(Array.isArray(v.value))return null;return(0,l.jsxs)(ea.l6,{value:v.value,onValueChange:e=>m({rowId:v.rowId,field:{value:e}}),children:[(0,l.jsx)(ea.bq,{id:j,"aria-label":"".concat(b.label," boolean filter"),"aria-controls":"".concat(j,"-listbox"),className:"h-8 w-full rounded bg-transparent",children:(0,l.jsx)(ea.yv,{placeholder:v.value?"True":"False"})}),(0,l.jsxs)(ea.gC,{id:"".concat(j,"-listbox"),children:[(0,l.jsx)(ea.eb,{value:"true",children:"True"}),(0,l.jsx)(ea.eb,{value:"false",children:"False"})]})]});default:return null}}({filter:e,inputId:y})}),(0,l.jsx)($.$,{variant:"outline",size:"icon","aria-label":"Remove filter ".concat(a+1),className:"size-8 shrink-0 rounded",onClick:()=>{var t;return t=e.rowId,void n(i.filter(e=>e.rowId!==t))},children:(0,l.jsx)(M.A,{className:"h-5 w-5 text-red-400","aria-hidden":"true"})}),(0,l.jsx)(ex,{variant:"outline",size:"icon",className:"size-8 shrink-0 rounded",children:(0,l.jsx)(z.A,{className:"h-5 w-5","aria-hidden":"true"})})]})},e.rowId)})}),(0,l.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,l.jsx)($.$,{size:"sm",className:"h-[1.85rem] rounded",onClick:function(){let e=t[0];e&&n([...i,{id:e.id,value:"",type:e.type,operator:v(e.type),rowId:(0,W.d_)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",6)()}])},children:"Add filter"}),i.length>0?(0,l.jsx)($.$,{size:"sm",variant:"outline",className:"rounded",onClick:()=>{n([]),o(y.AND)},children:"Reset filters"}):null]})]})]})})}ex.displayName="SortableDragHandle";var ev=a(74244);function ej(e){var t,a;let{debounceMs:i,gridRef:r,setSorting:n,sorting:o}=e,d=s.useId(),c=[];null==(t=r.current)||t.api;let u=s.useMemo(()=>o.filter((e,t,a)=>t===a.findIndex(t=>t.id===e.id)),[o]),m=ef(n,i),h=s.useMemo(()=>{var e,t,a;return null!=(a=null==(t=r.current)||null==(e=t.api)?void 0:e.getAllGridColumns().filter(e=>e.isSortable()&&!o.some(t=>t.id===e.getId())).map(e=>({id:e.getId(),label:(0,X.zX)(e.getId()),selected:!1})))?a:[]},[o,null==(a=r.current)?void 0:a.api]),p=s.useCallback(()=>{let e=h.find(e=>!o.some(t=>t.id===e.id));e&&n([...o,{id:e.id,desc:!1}])},[h,o]),x=s.useCallback(e=>{let{id:t,field:a,debounced:l=!1}=e;(l?m:n)(o?o.map(e=>e.id===t?{...e,...a}:e):o)},[o]),g=s.useCallback(e=>{n(o.filter(t=>t.id!==e))},[o]);return(0,l.jsx)(ec,{value:o,onValueChange:n,overlay:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"h-8 w-[11.25rem] rounded-sm bg-primary/10"}),(0,l.jsx)("div",{className:"h-8 w-24 rounded-sm bg-primary/10"}),(0,l.jsx)("div",{className:"size-8 shrink-0 rounded-sm bg-primary/10"}),(0,l.jsx)("div",{className:"size-8 shrink-0 rounded-sm bg-primary/10"})]}),children:(0,l.jsxs)(q.AM,{children:[(0,l.jsx)(q.Wv,{asChild:!0,children:(0,l.jsxs)($.$,{variant:"outline",size:"sm",className:"h-8 gap-2","aria-label":"Open sorting","aria-controls":"".concat(d,"-sort-dialog"),children:[(0,l.jsx)(ev.A,{className:"h-3 w-3","aria-hidden":"true"}),"Sort",u.length>0&&(0,l.jsx)(P.E,{variant:"secondary",className:"h-[1.14rem] rounded-[0.2rem] px-[0.32rem] font-mono text-[0.65rem] font-normal",children:u.length})]})}),(0,l.jsxs)(q.hl,{id:"".concat(d,"-sort-dialog"),align:"start",collisionPadding:16,className:(0,X.cn)("flex w-[calc(100vw-theme(spacing.20))] min-w-72 max-w-[25rem] origin-[var(--radix-popover-content-transform-origin)] flex-col p-4 sm:w-[25rem]",o.length>0?"gap-3.5":"gap-2"),children:[u.length>0?(0,l.jsx)("h4",{className:"font-medium leading-none",children:"Sort by"}):(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h4",{className:"font-medium leading-none",children:"No sorting applied"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Add sorting to organize your results."})]}),(0,l.jsx)("div",{className:"flex max-h-40 flex-col gap-2 overflow-y-auto p-0.5",children:(0,l.jsx)("div",{className:"flex w-full flex-col gap-2",children:u.map(e=>{var t;let a="".concat(d,"-sort-").concat(e.id),s="".concat(a,"-field-listbox"),i="".concat(a,"-field-trigger"),r="".concat(a,"-direction-listbox");return(0,l.jsx)(ep,{value:e.id,asChild:!0,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(q.AM,{modal:!0,children:[(0,l.jsx)(q.Wv,{asChild:!0,children:(0,l.jsxs)($.$,{id:i,variant:"outline",size:"sm",role:"combobox",className:"h-8 w-44 justify-between gap-2 rounded focus:outline-none focus:ring-1 focus:ring-ring","aria-controls":s,children:[(0,l.jsx)("span",{className:"truncate",children:(0,X.zX)(e.id)}),(0,l.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[1===c.length&&(null==(t=c[0])?void 0:t.id)===e.id?(0,l.jsx)(P.E,{variant:"secondary",className:"h-[1.125rem] rounded px-1 font-mono text-[0.65rem] font-normal",children:"Default"}):null,(0,l.jsx)(V.A,{className:"h-4 w-4 shrink-0 opacity-50","aria-hidden":"true"})]})]})}),(0,l.jsx)(q.hl,{id:s,className:"w-[var(--radix-popover-trigger-width)] p-0",onCloseAutoFocus:()=>{var e;
1return null==(e=document.getElementById(i))?void 0:e.focus()},children:(0,l.jsxs)(B.uB,{children:[(0,l.jsx)(B.G7,{placeholder:"Search fields..."}),(0,l.jsxs)(B.oI,{children:[(0,l.jsx)(B.xL,{children:"No fields found."}),(0,l.jsx)(B.L$,{children:h.map(t=>(0,l.jsxs)(B.h_,{value:t.id,onSelect:t=>{let a="".concat(d,"-sort-").concat(t,"-field-trigger");x({id:e.id,field:{id:t}}),requestAnimationFrame(()=>{var e;null==(e=document.getElementById(a))||e.focus()})},children:[(0,l.jsx)("span",{className:"mr-1.5 truncate",children:t.label}),(0,l.jsx)(F.A,{className:(0,X.cn)("ml-auto h-4 w-4 shrink-0",t.id===e.id?"opacity-100":"opacity-0"),"aria-hidden":"true"})]},t.id))})]})]})})]}),(0,l.jsxs)(ea.l6,{value:e.desc?"desc":"asc",onValueChange:t=>x({id:e.id,field:{id:e.id,desc:"desc"===t}}),children:[(0,l.jsx)(ea.bq,{"aria-label":"Select sort direction","aria-controls":r,className:"h-8 w-24 rounded",children:(0,l.jsx)("div",{className:"truncate",children:(0,l.jsx)(ea.yv,{})})}),(0,l.jsx)(ea.gC,{id:r,className:"min-w-[var(--radix-select-trigger-width)]",children:f.sortOrders.map(e=>(0,l.jsx)(ea.eb,{value:e.value,children:e.label},e.value))})]}),(0,l.jsx)($.$,{variant:"outline",size:"icon","aria-label":"Remove sort ".concat(e.id),className:"size-8 shrink-0 rounded",onClick:()=>g(e.id),children:(0,l.jsx)(M.A,{className:"h-5 w-5 text-red-400","aria-hidden":"true"})}),(0,l.jsx)(ex,{variant:"outline",size:"icon",className:"size-8 shrink-0 rounded",children:(0,l.jsx)(z.A,{className:"h-5 w-5","aria-hidden":"true"})})]})},e.id)})})}),(0,l.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,l.jsx)($.$,{size:"sm",className:"h-[1.85rem] rounded",onClick:p,disabled:o.length>=h.length,children:"Add sort"}),o.length>0?(0,l.jsx)($.$,{size:"sm",variant:"outline",className:"rounded",onClick:()=>n([]),children:"Reset sorting"}):null]})]})]})})}var eb=a(75472),ey=a(52171);let ew=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(ey.bL,{className:(0,X.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...s,ref:t,children:(0,l.jsx)(ey.zi,{className:(0,X.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})});ew.displayName=ey.bL.displayName;var eN=a(5259);let eA="ag-Grid-ControlsColumn";function eC(e){var t,a,i,r;let{gridRef:n,toggleColumnVisiblityCb:o}=e,d=null==n||null==(t=n.current)?void 0:t.api,c=s.useRef(null),[u,m]=s.useState([]),h=s.useMemo(()=>{var e,t,a;return null!=(a=null==(t=n.current)||null==(e=t.api)?void 0:e.getAllGridColumns())?a:[]},[null!=(r=null==(i=n.current)||null==(a=i.api)?void 0:a.getAllGridColumns())?r:[]]),p=s.useCallback((e,t)=>{null==d||d.setColumnsVisible(e,t);let a=h.filter(e=>e.getColId()!==eA);m(null!=a?a:[]),o&&o(a)},[u,h]);return s.useEffect(()=>{var e;m(null!=(e=h.filter(e=>e.getColId()!==eA))?e:[])},[h]),(0,l.jsxs)(q.AM,{modal:!0,children:[(0,l.jsx)(q.Wv,{asChild:!0,children:(0,l.jsxs)($.$,{ref:c,"aria-label":"Toggle columns",variant:"outline",role:"combobox",size:"sm",className:"ml-auto hidden h-8 gap-2 focus:outline-none focus:ring-1 focus:ring-ring focus-visible:ring-0 lg:flex",children:[(0,l.jsx)(eb.A,{className:"h-3 w-3"}),u.filter(e=>e.isVisible()).length,"/",u.length," columns",(0,l.jsx)(V.A,{className:"ml-auto h-3 w-3 shrink-0 opacity-50"})]})}),(0,l.jsx)(q.hl,{align:"end",className:"w-48 p-1 ",onCloseAutoFocus:()=>{var e;return null==(e=c.current)?void 0:e.focus()},children:(0,l.jsx)(B.uB,{children:(0,l.jsxs)(B.oI,{className:"max-h-[400px]",children:[(0,l.jsx)(B.fx,{}),(0,l.jsxs)(B.L$,{children:[(0,l.jsxs)(B.h_,{onSelect:()=>p(u,!0),children:[(0,l.jsx)(eN.N5q,{}),(0,l.jsx)("span",{children:"Show all columns"})]}),(0,l.jsxs)(B.h_,{onSelect:()=>p(u,!1),children:[(0,l.jsx)(eN.V$C,{}),(0,l.jsx)("span",{children:"Hide all columns"})]})]}),(0,l.jsx)(B.fx,{}),(0,l.jsx)(B.L$,{children:u.map(e=>(0,l.jsxs)(B.h_,{children:[(0,l.jsx)("span",{className:"truncate",children:(0,X.zX)(e.getColId())}),(0,l.jsx)(ew,{id:e.getColId(),checked:e.isVisible(),onClick:()=>p([e],!e.isVisible()),className:"ml-auto shrink-0"})]},e.getColId()))})]})})})]})}function eI(e){let{value:t,onChange:a,debounce:i=500,...r}=e,[n,o]=s.useState(t);return s.useEffect(()=>{o(t)},[t]),s.useEffect(()=>{let e=setTimeout(()=>{a(n)},i);return()=>clearTimeout(e)},[n]),(0,l.jsxs)("div",{className:"relative flex gap-x-2",children:[(0,l.jsx)(et.p,{...r,value:n,onChange:e=>o(e.target.value),className:"h-8 w-36 xl:w-64 "}),n.length>0&&(0,l.jsx)($.$,{"aria-label":"Reset",size:"icon",variant:"secondary",className:"absolute right-0 rounded-l-none border-l-0",onClick:()=>o(""),children:(0,l.jsx)(eN.raE,{className:"h-3","aria-hidden":"true"})})]})}function eS(e){let{filterFields:t=[],debounceMs:a=0,children:s,className:i,quickFilterText:r,setQuickFilterText:n,filters:o,setFilters:d,joinOperator:c,setJoinOperator:u,gridRef:m,setSorting:h,sorting:p,toggleVisibleColumn:x,onDeleteSelectedRows:f,...g}=e;return(0,l.jsx)("div",{className:(0,X.cn)("flex w-full items-center justify-between gap-2 overflow-auto p-1",i),...g,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(eC,{gridRef:m,toggleColumnVisiblityCb:e=>{var t;x(null!=(t=null==e?void 0:e.filter(e=>e.isVisible()).map(e=>e.getId()))?t:[])}}),(0,l.jsx)(eg,{filterFields:t,debounceMs:a,filters:o,gridRef:m,setFilters:d,joinOperator:c,setJoinOperator:u}),(0,l.jsx)(ej,{debounceMs:a,gridRef:m,setSorting:h,sorting:p}),(0,l.jsx)(eI,{placeholder:"Search in all columns...",onChange:e=>n&&n(e),value:null!=r?r:""})]})})}var ek=a(52210);let eR=[{id:"firstName",label:"First Name",type:"text"},{id:"lastName",label:"Last Name",type:"text"},{id:"jobTitle",label:"Job Title",type:"text"},{id:"companyName",label:"Company Name",type:"text"},{id:"industry",label:"Industry",type:"text"},{id:"city",label:"Location",type:"text"},{id:"email",label:"Email",type:"text"},{id:"linkedinProfileHash",label:"LinkedIn Profile URL",type:"text"},{id:"salesNavProfileHash",label:"Sales Navigator Profile URL",type:"text"},{id:"companySize",label:"Company Size",type:"text"},{id:"isLinkedinPremium",label:"Have LinkedIn Premium",type:"boolean"},{id:"companyWebsite",label:"Company Website",type:"text"},{id:"companyLinkedinUrl",label:"Company LinkedIn URL",type:"text"},{id:"emailStatus",label:"Email Status",type:"multi-select",options:Object.values(ek.A).map(e=>({value:e,label:e}))}];var eT=a(19968),eL=a(90408),e_=a(75861),eE=a(82102),eV=a(98294),eO=a(55504),eD=a(23820),eF=a(22373),eM=a(92161);function ez(e){let{open:t,setOpen:a}=e,{authedUser:r}=(0,e_.A)(),n=(0,s.useMemo)(()=>r&&(0,eF.RX)(r)&&!(0,eF.ip)(r)?"trial expired":"no enough credits",[r]);return(0,l.jsx)(eM.lG,{open:t,onOpenChange:a,children:(0,l.jsxs)(eM.Cf,{children:[(0,l.jsx)(eM.L3,{className:"hidden"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{children:"trial expired"===n?"Your free trial has expired":"Insufficient credits"}),(0,l.jsx)("p",{className:"mt-3",children:"trial expired"===n?"Your free trial has expired, please upgrade to find email addresses on ".concat(eO.A.appname,"."):(0,l.jsxs)(l.Fragment,{children:["You need credits to search for email addresses.",(0,l.jsx)("br",{}),"Please upgrade to get more credits."]})}),(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(eE.A,{variant:"light",onClick:()=>a(!1),children:"Not for now"}),(0,l.jsx)(eV.A,{rightIcon:i.L2n,className:"ml-2",href:eD.A.paymentPlans,children:"See available plans"})]})]})]})})}var eW=a(86257),eP=a(24261),e$=a(91869),eZ=a(68970),eB=a(61623),eX=a(13702),eq=a(23042),eH=a(4425),eG=a.n(eH);function eU(e){let{lead:t}
1=e,[a,r]=(0,s.useState)(!1),n=(0,e$.w)(),o=(0,eq.d4)((0,eB.gr)(t.listId)),d=(0,eq.d4)((0,eZ.yu)(t._id)),[c,u]=(0,s.useState)(!1),h=(0,s.useMemo)(()=>(null==o?void 0:o.source)===eP.A.csvImport,[o]),{authedUser:p}=(0,e_.A)(),x=(0,eq.d4)((0,eZ.ME)(t._id)),f=null==x?void 0:x.email,g=null==x?void 0:x.emailStatus;null==x||x.emailsearchedAt;let v=(0,s.useCallback)(()=>{(null==o?void 0:o.source)===eP.A.csvImport&&!(null==p?void 0:p.credits)||p&&(0,eF.RX)(p)&&!(0,eF.ip)(p)?u(!0):n((0,eZ.eV)({leadsIds:[t._id],sourceListId:t.listId}))},[t,n,p,o]),j=(0,s.useCallback)(()=>()=>{if((null==o?void 0:o.source)===eP.A.csvImport&&!(null==p?void 0:p.credits)||p&&(0,eF.RX)(p)&&!(0,eF.ip)(p))return u(!0),!1;n((0,eZ.eV)({leadsIds:[t._id],sourceListId:t.listId}))},[t,n,o]);return d?(0,l.jsxs)("button",{className:"relative  whitespace-nowrap rounded bg-primary-500 py-[4px] pl-3 pr-8 text-sm text-white transition-all hover:bg-primary-600",disabled:!0,children:["Searching",(0,l.jsx)(eG(),{className:"absolute mb-[-16px]",size:4,margin:2,color:"#ccc",speedMultiplier:.7})]}):(0,l.jsxs)(s.Fragment,{children:[f?(0,l.jsx)("div",{className:"relative flex",children:(0,l.jsx)(eW.A,{label:g===ek.A.catchAll?"Risky email":"Valid email",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("span",{className:(0,m.A)("max-w-[250px] truncate"),children:f}),g===ek.A.catchAll?(0,l.jsx)(eL.qVL,{className:"ml-[2px] mt-[-8px] text-[15px] text-yellow-400"}):(0,l.jsx)("span",{className:"relative ml-[2px] mt-[-8px] block rounded bg-green-100 p-[1px]",children:(0,l.jsx)(i.q9z,{className:"text-[10px] text-green-600"})})]})})}):g&&g!==ek.A.skip?(0,l.jsxs)("span",{className:(0,m.A)("inline-flex gap-x-2 whitespace-nowrap rounded bg-slate-100 px-3 py-1 text-xs text-slate-500",g===ek.A.catchAll&&"bg-yellow-50 text-yellow-600",!g&&"bg-lime-50 text-lime-600"),children:[g===ek.A.catchAll?"Risky email":g===ek.A.notFound?"No email found":g,(0,l.jsx)(eX.A,{className:"h-4 w-4 cursor-pointer text-primary-500",onClick:j()})]}):(0,l.jsx)(eW.A,{disableTooltip:h,label:"Email finding is free and does not consume credits.",children:(0,l.jsx)("button",{className:" whitespace-nowrap rounded bg-primary-500 px-3 py-[4px] text-sm text-white transition-all hover:bg-primary-600",onClick:v,children:(null==o?void 0:o.source)!==eP.A.csvImport||(null==p?void 0:p.credits)?"Search email":"Insufficient credits"})}),(0,l.jsx)(ez,{open:c,setOpen:u})]})}var eQ=a(70645);let eY=[{field:"linkedinProfileHash",colId:"linkedinProfileHash",headerName:"LinkedIn URL",minWidth:200,sortable:!0,hide:!1,cellRenderer:e=>e.data?(0,l.jsx)(eW.A,{label:"".concat(e.data.firstName," ").concat(e.data.lastName),children:(0,l.jsx)(eT.A,{href:(0,L.d$)(e.data),target:"_blank",className:"line-clamp-1 font-normal hover:underline",children:(0,g.W5)("".concat(e.data.firstName," ").concat(e.data.lastName))})}):null},{field:"salesNavProfileHash",colId:"salesNavProfileHash",headerName:"Sales Nav URL",minWidth:200,sortable:!0,hide:!0,cellRenderer:e=>e.data?(0,l.jsx)(eW.A,{label:"".concat(e.data.firstName," ").concat(e.data.lastName),children:(0,l.jsx)(eT.A,{href:(0,L.MN)(e.data),target:"_blank",className:"line-clamp-1 font-normal hover:underline",children:(0,g.W5)("".concat(e.data.firstName," ").concat(e.data.lastName))})}):null},{field:"firstName",colId:"firstName",headerName:"First Name",minWidth:150,sortable:!0,hide:!0,cellRenderer:e=>{var t,a;return(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.firstName,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.firstName)})})}},{field:"lastName",colId:"lastName",headerName:"Last Name",minWidth:150,sortable:!0,hide:!0,cellRenderer:e=>{var t,a;return(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.lastName,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.lastName)})})}},{field:"jobTitle",colId:"jobTitle",headerName:"Job Title",minWidth:200,sortable:!0,hide:!1,cellRenderer:e=>{var t;return(null==(t=e.data)?void 0:t.jobTitle)?(0,l.jsx)(eW.A,{label:e.data.jobTitle,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(e.data.jobTitle)})}):null}},{field:"companyName",colId:"companyName",headerName:"Company",minWidth:200,sortable:!0,hide:!1,cellRenderer:e=>(0,l.jsx)(eW.A,{label:e.data.companyName,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(e.data.companyName)})})},{field:"industry",colId:"industry",headerName:"Industry",minWidth:150,sortable:!0,hide:!0,cellRenderer:e=>{var t,a;return(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.industry,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.industry)})})}},{field:"companySize",colId:"companySize",headerName:"Company Size",minWidth:120,sortable:!0,hide:!0,cellRenderer:e=>{var t,a;return(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.companySize,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.companySize)})})}},{field:"city",colId:"city",headerName:"City",minWidth:120,sortable:!0,hide:!0,cellRenderer:e=>{var t,a;return(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.city,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.city)})})}},{field:"country",colId:"country",headerName:"Country",minWidth:120,sortable:!0,hide:!0,cellRenderer:e=>{var t,a;return(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.country,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.country)})})}},{field:"isLinkedinPremium",colId:"isLinkedinPremium",headerName:"LinkedIn Premium",minWidth:140,sortable:!0,hide:!0,cellRenderer:e=>{var t,a;return(0,l.jsx)(eW.A,{label:(null==(t=e.data)?void 0:t.isLinkedinPremium)?"Yes":"No",children:(0,l.jsx)("span",{className:"line-clamp-1",children:(null==(a=e.data)?void 0:a.isLinkedinPremium)?"Yes":"No"})})}},{field:"companyWebsite",colId:"companyWebsite",headerName:"Website",minWidth:200,sortable:!0,hide:!0,cellRenderer:e=>{var t,a,s;return(0,l.jsx)("span",{className:"line-clamp-1",children:(null==(t=e.data)?void 0:t.companyWebsite)?(0,l.jsx)(eT.b,{href:null==(a=e.data)?void 0:a.companyWebsite,target:"_blank",className:"line-clamp-1 font-normal hover:underline",children:(0,eQ.N8)(null==(s=e.data)?void 0:s.companyWebsite)}):""})}},{field:"email",colId:"email",headerName:"Email",minWidth:200,sortable:!0,hide:!1,cellRenderer:e=>(0,l.jsx)(eU,{lead:e.data})}];var eJ=a(39975),eK=a(28806),e0=a(5811);let e1=(0,e0.PA)(e=>{let{folderId:t,listView:a,st:i}
1=e,r=(0,e$.w)(),[n,o]=(0,s.useState)(),d=(0,s.useRef)();(0,s.useEffect)(()=>{d.current=t},[t]);let[c,u]=(0,s.useState)(""),m=i.current.tableRef,h=(0,s.useMemo)(()=>i.current.masterData.map(e=>e._id),[i.current.masterData.length]),p=(0,eq.d4)((0,eK.Xn)(h)),x=(0,eq.d4)((0,eZ.Ln)(h)),f=(0,eq.d4)((0,eJ.Jz)(h)),g=(0,s.useMemo)(()=>p||x||f,[p,x,f]);return(0,s.useEffect)(()=>{n&&n.folderId===d.current&&console.log("useListPage pullRequested",n)},[n,i]),(0,s.useEffect)(()=>{let e;return g&&(null==n?void 0:n.folderId)&&n.folderId===t&&(e=setTimeout(()=>o({at:Date.now(),folderId:t}),5e3)),()=>{e&&clearTimeout(e)}},[n,g]),(0,s.useEffect)(()=>{let e;if(f&&d.current){let t=d.current;console.log("useListPage.isRequestingCrmSync changed",f),e=setTimeout(()=>o({at:Date.now(),folderId:t}),5e3)}return()=>{e&&clearTimeout(e)}},[f]),(0,s.useEffect)(()=>{let e=(0,w.mJ)(()=>i.current.masterData.map(e=>e._id),e=>{let t=i.current.masterData,a=Object.groupBy(t,e=>e.listId);for(let e in a)a[e]&&r((0,eB.Vw)({listId:e,leads:A()((0,w.HO)(a[e]))}));r((0,eZ.pU)({leads:A()((0,w.HO)(t))})),r((0,eJ.dt)({leads:A()((0,w.HO)(t))})),r((0,eK.n$)({leads:A()((0,w.HO)(t))}))});return()=>e()},[i.current.masterData]),(0,l.jsxs)(s.Fragment,{children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-1",children:[a,(0,l.jsx)(eS,{onDeleteSelectedRows:async e=>{await i.current.deleteTableRowData(e.map(e=>({listId:e.listId,leadId:e._id})))},toggleVisibleColumn:()=>{},setQuickFilterText:u,filterFields:eR,filters:i.current.filters,joinOperator:i.current.joinOperator,setFilters:e=>{i.current.updateFilters({filters:e})},setSorting:e=>{i.current.updateFilters({sorts:e})},setJoinOperator:e=>{i.current.updateFilters({joinOperator:e})},sorting:i.current.sorts,gridRef:m})]}),(0,l.jsx)(E.b,{columns:eY,calcHeight:75,quickFilterText:c,girdRef:m,isLoading:!0,tableprops:{stopEditingWhenCellsLoseFocus:!0,rowSelection:{mode:"multiRow",selectAll:"filtered",enableSelectionWithoutKeys:!0},onSelectionChanged(e){let t=e.api;i.current.updateSelectedRows(t)},onCellValueChanged(e){"edit"===e.source&&i.current.mutateTableRowData({listId:e.data.listId,leadId:e.data._id,column:e.colDef.field,value:e.newValue})}}})]})}),e2=(0,e0.PA)(e=>{let{folderId:t,listView:a,setStore:i}=e,r=(0,s.useRef)(null),n=(0,s.useRef)(new _(r,t));return(0,s.useEffect)(()=>{i(n.current)},[]),(0,s.useMemo)(()=>(0,l.jsx)(e1,{folderId:t,listView:a,st:n}),[t,a,n])});class e5 extends C{init(){var e;null==(e=this.tableApi)||e.updateGridOptions({loading:!0,rowData:[]}),(0,w.h5)(()=>{I.id.folder.getLists.query({folderId:this.folderId}).then(e=>{this.setMasterData(e)}).finally(()=>{var e;null==(e=this.tableApi)||e.updateGridOptions({loading:!1})})})}constructor(e,t){super(e),this._tableRef=e,this.folderId=t,this.updateFilters=async e=>{super.updateFilters(e)},(0,w.Gn)(this,{selectedRows:w.$Z,filters:w.$Z,sorts:w.$Z,joinOperator:w.$Z,masterData:w.$Z,setMasterData:w.$Z,updateFilters:w.$Z,resetFilters:w.$Z,updateSelectedRows:w.$Z,clearSelectRow:w.$Z,filteredData:w.$Z,tableRef:w.$Z,selectedRowsArray:w.$Z,updateTableColumn:w.$Z,updateTableRowData:w.$Z,init:w.XI}),this.init()}}let e4=[{id:"name",label:"List Name",type:"text"},{id:"createdAt",label:"Created At",type:"date"}];var e8=a(74555),e3=a(46392);let e6=[{field:"name",headerName:"List name",sortable:!0,hide:!1,cellRenderer:e=>(0,l.jsx)(eW.A,{label:e.data.name,children:(0,l.jsx)(eT.A,{href:eD.A.appList.replace(":id",e.data._id),className:"line-clamp-1 font-normal hover:underline",children:e.data.name})})},{field:"salesNavUrl",headerName:"Sales Nav URL",sortable:!0,editable:!1,hide:!1,cellRenderer:e=>e.data.salesNavUrl?(0,l.jsx)(eW.A,{label:e.data.name,children:(0,l.jsx)(eT.A,{href:e.data.salesNavUrl,className:"line-clamp-1 font-normal hover:underline",target:"_blank",children:e.data.name})}):e.data.source===eP.A.csvImport?(0,l.jsx)("span",{children:"-"}):(0,l.jsx)("span",{children:e.data.name})},{field:"createdAt",headerName:"Created at",sortable:!0,editable:!1,hide:!1,width:200,valueFormatter:e=>{var t,a;return e.data?"".concat((0,e3.sq)(null==(t=e.data)?void 0:t.createdAt)," at ").concat((0,e3.t5)(null==(a=e.data)?void 0:a.createdAt)):""}},{field:"source",headerName:"Type",sortable:!0,editable:!1,hide:!1,width:200,valueFormatter:e=>{var t;return(null==(t=e.data)?void 0:t.source)===eP.A.csvImport?"Import":"Sales Nav"}},{field:"leadsCount",headerName:"Leads",sortable:!0,editable:!1,hide:!1}
1,{field:"validEmailsCount",headerName:"Emails found",sortable:!0,editable:!1,hide:!1,valueGetter:e=>e.data&&e.data.validEmailsCount+e.data.catchallEmailsCount},{field:"extractionStatus",headerName:"Status",sortable:!0,editable:!1,hide:!1,valueFormatter:e=>e.value===e8.A.todo?"Queued":e.value}];var e7=a(48230),e9=a.n(e7);let te=()=>(0,l.jsxs)("p",{className:"mb-2 text-xs italic text-slate-500",children:["\uD83D\uDC49 No lists yet. First install our"," ",(0,l.jsx)(e9(),{href:eD.A.downloadLastReleasedChromeExtension,target:"_blank",rel:"nofollow",className:"text-primary-500 underline",children:"Chrome extension"})," ","then start your first extraction via"," ",(0,l.jsx)(e9(),{href:"https://www.linkedin.com/sales/home",target:"_blank",rel:"nofollow",className:"text-primary-500 underline",children:"Sales Navigator"})," ","to fill this dashboard \uD83D\uDE80"]}),tt=(0,e0.PA)(e=>{var t;let{st:a,listView:i}=e,[r,n]=(0,s.useState)("");return(0,l.jsx)(s.Fragment,{children:(null==(t=a.current.tableApi)?void 0:t.getGridOption("loading"))===!1&&0===a.current.masterData.length?(0,l.jsx)(te,{}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-1",children:[i,(0,l.jsx)(eS,{toggleVisibleColumn:()=>{},setQuickFilterText:n,filterFields:e4,filters:a.current.filters,joinOperator:a.current.joinOperator,setFilters:e=>{a.current.updateFilters({filters:e})},setSorting:e=>{a.current.updateFilters({sorts:e})},setJoinOperator:e=>{a.current.updateFilters({joinOperator:e})},sorting:a.current.sorts,gridRef:a.current.tableRef})]}),(0,l.jsx)(E.b,{columns:e6,calcHeight:75,quickFilterText:r,girdRef:a.current.tableRef,isLoading:!1,tableprops:{rowSelection:{mode:"multiRow",selectAll:"filtered",enableClickSelection:!0,enableSelectionWithoutKeys:!0},onSelectionChanged(e){let t=e.api;a.current.updateSelectedRows(t)}}})]})})}),ta=(0,e0.PA)(e=>{let{folderId:t,listView:a,setStore:i}=e;console.log("asdasdasd");let r=(0,s.useRef)(null),n=(0,s.useRef)(new e5(r,t));return(0,s.useEffect)(()=>{i(n.current)},[]),(0,s.useMemo)(()=>(0,l.jsx)(tt,{st:n,listView:a}),[n,a])});function tl(e){let{setViewType:t,viewType:a}=e,[i,r]=(0,s.useState)(!1);return(0,l.jsxs)(q.AM,{onOpenChange:r,open:i,children:[(0,l.jsxs)("div",{className:"flex gap-x-2",children:[(0,l.jsx)(et.p,{className:(0,X.cn)("h-8 !w-auto max-w-[600px] cursor-default capitalize leading-loose"),readOnly:!0,value:"".concat(a," view")}),(0,l.jsx)(q.Wv,{asChild:!0,children:(0,l.jsx)($.$,{size:"icon",variant:"outline",className:"h-8",onClick:()=>r(!0),children:(0,l.jsx)(eN.D3D,{})})})]}),(0,l.jsx)(q.hl,{className:"w-52 p-0",align:"end",children:(0,l.jsx)(B.uB,{children:(0,l.jsx)(B.oI,{className:"max-h-[400px]",children:(0,l.jsx)(B.L$,{children:["list","lead"].map((e,s)=>(0,l.jsxs)(B.h_,{className:"cursor-pointer",onSelect:()=>{t(e),r(!1)},children:[(0,g.ZH)(e)," View",(0,l.jsx)("span",{className:"ml-auto",children:a===e&&(0,l.jsx)(eN.Srz,{})})]},s))})})})})]})}var ts=a(99395),ti=a(88211),tr=a(28547),tn=a(12304),to=a(53647);let td=to.bL,tc=to.l9,tu=to.YJ,tm=to.ZL,th=to.Pb;to.z6;let tp=s.forwardRef((e,t)=>{let{className:a,inset:s,children:i,...r}=e;return(0,l.jsxs)(to.ZP,{ref:t,className:(0,X.cn)("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s&&"pl-8",a),...r,children:[i,(0,l.jsx)(eN.vKP,{className:"ml-auto"})]})});tp.displayName=to.ZP.displayName;let tx=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(to.G5,{ref:t,className:(0,X.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...s})});tx.displayName=to.G5.displayName;let tf=s.forwardRef((e,t)=>
1{let{className:a,sideOffset:s=4,...i}=e;return(0,l.jsx)(to.ZL,{children:(0,l.jsx)(to.UC,{ref:t,sideOffset:s,className:(0,X.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})})});tf.displayName=to.UC.displayName;let tg=s.forwardRef((e,t)=>{let{className:a,inset:s,...i}=e;return(0,l.jsx)(to.q7,{ref:t,className:(0,X.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",s&&"pl-8",a),...i})});tg.displayName=to.q7.displayName,s.forwardRef((e,t)=>{let{className:a,children:s,checked:i,...r}=e;return(0,l.jsxs)(to.H_,{ref:t,className:(0,X.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:i,...r,children:[(0,l.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,l.jsx)(to.VF,{children:(0,l.jsx)(eN.Srz,{className:"h-4 w-4"})})}),s]})}).displayName=to.H_.displayName,s.forwardRef((e,t)=>{let{className:a,children:s,...i}=e;return(0,l.jsxs)(to.hN,{ref:t,className:(0,X.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...i,children:[(0,l.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,l.jsx)(to.VF,{children:(0,l.jsx)(eN.RiX,{className:"h-2 w-2 fill-current"})})}),s]})}).displayName=to.hN.displayName,s.forwardRef((e,t)=>{let{className:a,inset:s,...i}=e;return(0,l.jsx)(to.JU,{ref:t,className:(0,X.cn)("px-2 py-1.5 text-sm font-semibold",s&&"pl-8",a),...i})}).displayName=to.JU.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(to.wv,{ref:t,className:(0,X.cn)("-mx-1 my-1 h-px bg-muted",a),...s})}).displayName=to.wv.displayName;var tv=a(84081);let tj=(0,e0.PA)(e=>{let{leads:t,name:a,selectedRows:r}=e,n=(0,s.useCallback)(e=>async()=>{let l=[];"all"===e?l.push(...t):"found"===e?l.push(...t.filter(e=>e.emailStatus===ek.A.found)):l.push(...t.filter(e=>r.map(e=>e._id).includes(e._id))),(0,tn.g4)(a,l,"csv")},[t,a,r]);return(0,l.jsx)(s.Fragment,{children:(0,l.jsxs)(th,{children:[(0,l.jsxs)(tp,{children:[(0,l.jsx)(tv.QaY,{}),"Export CSV"]}),(0,l.jsx)(tm,{children:(0,l.jsxs)(tx,{title:"Exporting a folder into a CSV will merge all lists within the folder, and will remove duplicate profiles",children:[(0,l.jsxs)(tg,{onClick:n("selected"),disabled:0===r.length,children:[(0,l.jsx)(i.cIQ,{})," Selected leads (",r.length,")"]}),(0,l.jsxs)(tg,{onClick:n("all"),children:[(0,l.jsx)(i.cIQ,{})," All leads"]}),(0,l.jsxs)(tg,{onClick:n("found"),children:[(0,l.jsx)(i.cIQ,{})," Valid emails only"]})]})})]})})}),tb=(0,e0.PA)(e=>{let{folder:t,selectedRows:a}
1=e,[r,o]=(0,s.useState)(!1),d=(0,s.useCallback)(e=>async()=>{o(!0);let l=await (0,tr.od)(t._id,"found"===e?ek.A.found:void 0),s="selected"===e?l.filter(e=>a.map(e=>e._id).includes(e.listId)):l;(0,tn.g4)(t.name,s,"csv"),o(!1)},[t,a]);return(0,l.jsx)(s.Fragment,{children:(0,l.jsx)(n.A,{dropdownClassName:"min-w-[200px]",ButtonElement:e=>(0,l.jsx)(eE.A,{onClick:e.onClick,variant:"light",size:"sm",leftIcon:i.cIQ,disabled:r,isLoading:r,children:"Export CSV"},"export"),menu:[{title:"Export Selected List  (".concat(a.length,")"),onClick:d("selected"),icon:i.cIQ,hoverTitle:"Exporting a folder into a CSV will merge all lists within the folder, and will remove duplicate profiles"},{title:"Export All Leads",onClick:d("all"),icon:i.cIQ,hoverTitle:"Exporting a folder into a CSV will merge all lists within the folder, and will remove duplicate profiles"},{title:"Export Valid Emails Only",onClick:d("found"),icon:i.cIQ,hoverTitle:"Exporting a folder into a CSV will merge all lists within the folder, and will remove duplicate profiles"}]},"more-1")})});var ty=a(49486);function tw(e){let{getLeads:t}=e,{authedUser:a}=(0,e_.A)(),l=(0,e$.w)(),[i,r]=(0,s.useState)({open:!1,leads:[]}),[n,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)(!1),[u,m]=(0,s.useState)(!1),h=(0,s.useCallback)(e=>async()=>{if(!a)return;if((0,eF.RX)(a))return o(!0);let l=ty.t.find(e=>"hubspot"===e.slug);if(!l)return;let s=!1;try{s=!!(await l.getAccountStatus()).token}catch(e){}if(!s)return c(!0);m(!0);try{let a=await t(e);r({open:!0,leads:a})}finally{m(!1)}},[a,t]),p=(0,s.useCallback)(()=>{i.leads.length&&l((0,eJ.Ui)({leadsIds:i.leads}))},[i,l]);return{loading:u,handleCrmPush:h,crmIntegrationPopupState:i,setCrmIntegrationPopupState:r,exportLeads:p,freeUserDialogOpen:n,setFreeUserDialogOpen:o,connectToCrmDialogOpen:d,setConnectToCrmDialogOpen:c}}function tN(e){let{onPush:t,isLoading:a=!1,selectedCount:s=0}=e;return(0,l.jsx)(l.Fragment,{})}var tA=a(84331);function tC(e){let{children:t,onSubmit:a,listName:s,provider:i,state:r,setState:n}=e;return(0,l.jsxs)(tA.Lt,{open:r.open,onOpenChange:e=>{!1===e&&n({open:e,leads:[]}),n({open:e,leads:r.leads})},children:[(0,l.jsx)(tA.tv,{asChild:!0,children:t}),(0,l.jsxs)(tA.EO,{children:[(0,l.jsxs)(tA.wd,{children:[(0,l.jsx)(tA.r7,{children:"Are you absolutely sure?"}),(0,l.jsxs)(tA.$v,{children:["Send ",(0,l.jsx)("b",{children:r.leads.length})," ",1===r.leads.length?"prospect":"prospects"," from list ",(0,l.jsx)("b",{children:s})," to"," ",(0,l.jsx)("b",{children:(0,g.ZH)(i)}),"?",(0,l.jsx)("br",{}),"Existing contacts/companies in ",(0,l.jsx)("b",{children:(0,g.ZH)(i)})," will be updated based on email/domain."]})]}),(0,l.jsxs)(tA.ck,{children:[(0,l.jsx)(tA.Zr,{children:"Cancel"}),(0,l.jsx)(tA.Rx,{onClick:async()=>{null==a||a(),n({open:!1,leads:[]})},children:"Continue"})]})]})]})}var tI=a(87279),tS=function(e){return e.hubspot="hubspot",e}(tS||{});let tk=(0,e0.PA)(e=>{let{leads:t,listId:a,selectedRows:i}=e,r=(0,eq.d4)((0,eB.gr)(a)),n=(0,eq.d4)((0,eB.j5)(a)),{loading:o,handleCrmPush:d,crmIntegrationPopupState:c,setCrmIntegrationPopupState:u,exportLeads:m,freeUserDialogOpen:h,setFreeUserDialogOpen:p,connectToCrmDialogOpen:x,setConnectToCrmDialogOpen:f}=tw({getLeads:async e=>{if("all"===e)return t.map(e=>e._id);if("valid-email"===e)return t.filter(e=>e.emailStatus===ek.A.found).map(e=>e._id);let a=i.map(e=>e._id);return t.filter(e=>a.includes(e._id)).map(e=>e._id)}});return(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(tN,{onPush:d,selectedCount:i.length}),(0,l.jsx)(tC,{listName:(null==r?void 0:r.name)||(null==n?void 0:n.name)||"",onSubmit:m,provider:tS.hubspot,state:c,setState:u}),(0,l.jsx)(tI.s,{open:h,onOpenChange:p}),(0,l.jsx)(tI.A,{open:x,onOpenChange:f})]})}),tR=(0,e0.PA)(e=>{let{folderId:t,selectedRows:a}=e,i=(0,eq.d4)((0,eB.j5)(t)),{loading:r,handleCrmPush:n,crmIntegrationPopupState:o,setCrmIntegrationPopupState:d,exportLeads:c,freeUserDialogOpen:u,setFreeUserDialogOpen:m,connectToCrmDialogOpen:h,setConnectToCrmDialogOpen:p}=tw({getLeads:async e=>{let l=await (0,tr.od)(t,"valid-email"===e?ek.A.found:void 0);return"valid-email"===e?l.filter(e=>e.emailStatus===ek.A.found).map(e=>e._id):"selected"===e?l.filter(e=>a.some(t=>t._id===e.listId)).map(e=>e._id):l.map(e=>e._id)}});return(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(tN,{onPush:n,selectedCount:a.length,isLoading:r}),(0,l.jsx)(tC,{listName:(null==i?void 0:i.name)||"",onSubmit:c,provider:tS.hubspot,state:o,setState:d}),(0,l.jsx)(tI.s,{open:u,onOpenChange:m}),(0,l.jsx)(tI.A,{open:h,onOpenChange:p})]})}),tT=(0,e0.PA)(e=>{var t,a,m,p,x,f;let{folderId:g,folderName:v}
1=e,[j,b]=(0,s.useState)(),[y,w]=(0,s.useState)(),[N,A]=(0,s.useState)("list"),[C,I]=(0,s.useState)(void 0),S=(0,eq.d4)((0,eB.j5)(g)),{renameFolder:k,archiveFolder:R,deleteFolder:T}=(0,ts.A)(),[L,_]=(0,s.useState)(),[E,V]=(0,s.useState)(!0),[O,D]=(0,s.useState)(!1),[F,M]=(0,s.useState)(!1),z=(0,s.useRef)(),W=(0,s.useMemo)(()=>S?S.name===ti.I7?"Archived Lists":[ti.Pp,ti.Q$].includes(S.name)?"Active Lists":S.name:null,[S]);(0,s.useEffect)(()=>{z.current!==g&&(V(!0),z.current=g,_(void 0),(0,tr.eE)(g).then(e=>{_(e),V(!1)}))},[g]),(0,s.useCallback)(e=>()=>{D(!0),(0,tr.od)(g,e).then(e=>{(0,tn.g4)(v,e,"csv"),D(!1)})},[g,v]);let P=(0,s.useCallback)(e=>{M(!0),(0,tr.od)(g).then(t=>{(0,tn.g4)(v,t,e),M(!1)})},[g,v]),$=(0,s.useCallback)(e=>{S&&k({_id:S._id,currentName:e,name:S.name})},[k,S]),Z=(0,s.useCallback)(()=>{S&&R({_id:S._id,type:ti._V.folder},{isArchived:S.isArchived})},[g,R]),B=(0,s.useCallback)(()=>{S&&T({_id:S._id,type:ti._V.folder})},[S,T]),X=(0,s.useCallback)(e=>{I({state:!0,type:e})},[]),q=(0,s.useCallback)(e=>{"archive"===e?Z():"delete"===e&&B()},[Z,B]),H=(0,s.useMemo)(()=>"list"===N?(0,l.jsx)(ta,{folderId:g,listView:(0,l.jsx)(tl,{setViewType:A,viewType:N}),setStore:b}):(0,l.jsx)(e2,{setStore:w,folderId:g,listView:(0,l.jsx)(tl,{setViewType:A,viewType:N})}),[N,g,w,b,A]);return(0,l.jsxs)(o.A,{titleIcon:i.W5h,title:W||v,layoutId:g,editableTitle:(null==S?void 0:S.isRoot)!==!0,onTitleChange:$,titleRightElement:(0,l.jsx)(h,{folder:S}),rightActions:[(0,l.jsx)(s.Fragment,{children:"lead"===N?(0,l.jsx)(tk,{leads:null!=(t=null==y?void 0:y.masterData)?t:[],listId:g,selectedRows:null!=(a=null==y?void 0:y.selectedRows)?a:[]}):(0,l.jsx)(tR,{folderId:g,selectedRows:null!=(m=null==j?void 0:j.selectedRows)?m:[]})},"push-to-crm"),(0,l.jsx)(s.Fragment,{children:"lead"===N?(0,l.jsx)(tj,{leads:null!=(p=null==y?void 0:y.masterData)?p:[],name:null==S?void 0:S.name,selectedRows:null!=(x=null==y?void 0:y.selectedRows)?x:[]}):(0,l.jsx)(tb,{folder:S,selectedRows:null!=(f=null==j?void 0:j.selectedRows)?f:[]})},"export-csv"),(0,l.jsx)(n.A,{dropdownClassName:"min-w-[200px]",ButtonElement:e=>(0,l.jsx)(r.A,{className:"ml-2",variant:"light",size:"sm",icon:i.KV9,onClick:e.onClick},"more-2-1"),menu:[{title:"Other exports"},{title:"Export XLS",onClick:()=>P("xls"),icon:i.cIQ,isLoading:F},{title:"Export XLSX",onClick:()=>P("xlsx"),icon:i.cIQ,isLoading:F},!E&&(null==S?void 0:S.isRoot)!==!0&&{title:"Manage your folder"},!E&&(null==S?void 0:S.isRoot)!==!0&&{title:"".concat((null==S?void 0:S.isArchived)?"Unarchive":"Archive"," folder"),onClick:()=>(null==S?void 0:S.isArchived)?Z():X("archive"),icon:i.UdI},!E&&(null==S?void 0:S.isRoot)!==!0&&{title:"Delete folder",onClick:()=>X("delete"),icon:i.WWR,className:"text-red-500"}]}
1,"more-2")],children:[(0,l.jsx)(c.A,{templateTitle:null!=W?W:v}),(0,l.jsxs)("main",{className:"flex flex-1  flex-col",children:[(0,l.jsx)(d.A,{isLoading:E,distinctLeadsCount:null==L?void 0:L.stats.distinctLeadsCount,validEmailsCount:null==L?void 0:L.stats.validEmailsCount,catchallEmailsCount:null==L?void 0:L.stats.catchallEmailsCount,unarchivedListsCount:null==L?void 0:L.stats.unarchivedListsCount,archivedListsCount:null==L?void 0:L.stats.archivedListsCount,phonesCount:null==L?void 0:L.stats.phonesCount}),(0,l.jsx)("div",{className:"mt-3 px-8",children:H})]}),(0,l.jsx)(u.t,{onConfirm:q,type:null==C?void 0:C.type,open:!!C,onClose:()=>{I(void 0)}})]})}),tL=function(e){let t=(0,s.useRef)();return(0,s.useEffect)(()=>{t.current=e}),t.current},t_=e=>{let t=(0,e$.w)(),[a,l]=(0,s.useState)(),i=tL(e),r=(0,s.useRef)(e);(0,s.useEffect)(()=>{r.current=e},[e]);let n=(0,s.useCallback)(e=>{console.log("useLeadsByListId._refreshLeads",e),S(e,"active").then(a=>{r.current===e&&(l(a),t((0,eB.Vw)({listId:e,leads:a})),t((0,eK.n$)({leads:a})),t((0,eZ.pU)({leads:a})),t((0,eJ.dt)({leads:a})))})},[t]);return(0,s.useEffect)(()=>{if(e&&i!==e){l(void 0),n(e);return}},[n,i,e]),{leads:a,setLeads:(0,s.useCallback)((t,a)=>{e===t&&l(a)},[e]),refreshLeads:n}};var tE=a(27946),tV=a(39600),tO=a(25416);let tD=e=>{let t=(0,e$.w)(),a=(0,eq.d4)(tV.SQ),{leads:l,setLeads:i,refreshLeads:r}=t_(e),n=(0,eq.d4)((0,eB.gr)(e)),o=!l||!n||n.extractionStatus===e8.A.inProgress||n.extractionStatus===e8.A.todo,d=(0,s.useCallback)(()=>{n&&(t((0,eB.ti)({listId:n._id,isArchived:!n.isArchived})),a.toggleArchive({_id:n._id,type:ti._V.list}))},[n,t,a]),[c,u]=(0,s.useState)(),m=null==n?void 0:n._id,h=(0,s.useRef)();(0,s.useEffect)(()=>{h.current=m},[m]);let p=tL(null==n?void 0:n._id),x=(0,s.useMemo)(()=>(null==l?void 0:l.map(e=>e._id))||[],[l]),f=(0,eq.d4)((0,eK.Xn)(x)),g=(0,eq.d4)((0,eZ.Ln)(x)),v=(0,eq.d4)((0,eJ.Jz)(x)),j=(0,s.useMemo)(()=>f||g||v||(null==n?void 0:n.extractionStatus)&&[e8.A.todo,e8.A.inProgress].includes(null==n?void 0:n.extractionStatus),[null==n?void 0:n.extractionStatus,f,g,v]);return(0,s.useEffect)(()=>{!1===v&&t((0,tO.qo)({}))},[v]),(0,s.useEffect)(()=>{c&&c.listId===h.current&&(console.log("useListPage pullRequested",c),t((0,eB.Zk)({listId:c.listId})),r(c.listId),(0,tE.M)())},[c,t,r]),(0,s.useEffect)(()=>{let e;return j&&(null==c?void 0:c.listId)&&c.listId===h.current&&(e=setTimeout(()=>u({at:Date.now(),listId:c.listId}),8e3)),()=>{e&&clearTimeout(e)}},[c,j]),(0,s.useEffect)(()=>{let e;return m&&m!==p&&(console.log("useListPage.currentListId changed",m,"isListWorking",j),j&&(e=setTimeout(()=>u({at:Date.now(),listId:m}),8e3))),()=>{e&&clearTimeout(e)}},[m,p,j]),(0,s.useEffect)(()=>{let e;if(f&&h.current){let t=h.current;console.log("useListPage.isRequestingPhone  changed",f),e=setTimeout(()=>u({at:Date.now(),listId:t}),8e3)}return()=>{e&&clearTimeout(e)}},[f]),(0,s.useEffect)(()=>{let e;if(g&&h.current){let t=h.current;console.log("useListPage.isRequestingEmail changed",g),e=setTimeout(()=>u({at:Date.now(),listId:t}),8e3)}return()=>{e&&clearTimeout(e)}},[g]),(0,s.useEffect)(()=>{let e;if(v&&h.current){let t=h.current;console.log("useListPage.isRequestingCrmSync changed",v),e=setTimeout(()=>u({at:Date.now(),listId:t}),8e3)}return()=>{e&&clearTimeout(e)}},[v]),(0,s.useEffect)(()=>{t((0,eB.Zk)({listId:e}))},[e,t]),{leads:l,isLoading:o,listMeta:n,toggleArchiveList:d,setLeads:i}};var tF=a(46318);let tM=function(){let e=arguments.length>
10&&void 0!==arguments[0]&&arguments[0],[t,a]=(0,s.useState)(e),l=(0,s.useCallback)(()=>a(!0),[]),i=(0,s.useCallback)(()=>a(!1),[]),r=(0,s.useCallback)(()=>a(!t),[t]);return{isVisible:t,show:l,hide:i,toggle:r}};function tz(e){let{onCancel:t,onHide:a}=e;return(0,l.jsxs)("div",{className:"flex flex-col py-4 px-8",children:[(0,l.jsx)("span",{className:"text-2xl font-bold",children:"Confirm cancelation"}),(0,l.jsx)("p",{className:"my-2 max-w-[400px] text-sm",children:"Do you really want to cancel this active extraction? Already found emails will still be deducted from your credits."}),(0,l.jsxs)("div",{className:"mt-2 flex items-center",children:[(0,l.jsx)(eE.A,{className:"mr-2",size:"sm",variant:"light",onClick:a,children:"No, keep going"}),(0,l.jsx)(eE.A,{className:"ml-2",size:"sm",variant:"primary",onClick:t,children:"Yes, cancel now"})]})]})}function tW(e){let{children:t,onHideModal:a}=e;(0,s.useEffect)(()=>{document.body.style.overflow="hidden",document.body.style.height="100%"},[]);let i=(0,s.useCallback)(()=>{a&&a(),document.body.style.overflow="auto",document.body.style.height="auto"},[a]);return(0,l.jsxs)("div",{className:"fixed top-0 right-0 left-0 z-[299] flex h-[100vh] items-center justify-center bg-slate-900 bg-opacity-80",children:[(0,l.jsx)("button",{onClick:i,className:"absolute top-0 right-0 left-0 bottom-0 cursor-default"}),(0,l.jsx)("div",{className:"mx-5 rounded bg-white drop-shadow",children:t})]})}function tP(e){let{queuePosition:t,remainingExtractionTimeSec:a,listId:i}=e,{isVisible:r,show:n,hide:o}=tM(),d=(0,eq.d4)((0,eB.uA)(i)),c=(0,e$.w)(),u=(0,eq.d4)((0,eB.gr)(i)),m=(0,s.useMemo)(()=>(null==u?void 0:u.source)===eP.A.csvImport,[u]),h=(0,s.useMemo)(()=>m?"Import":"Extraction",[m]),p=(0,s.useCallback)(()=>{c((0,eB.Lg)(i)),o(),m&&c((0,eZ.pU)({leads:d.map(e=>({...e,isSearchingEmail:!1}))}))},[i,c,o,m,d]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"mb-1 mt-3 flex items-start text-sm text-slate-500",children:[(0,l.jsx)(tF.pNz,{className:"mr-2 mt-[3px] animate-spin text-sm text-slate-300"}),(0,l.jsxs)("p",{children:[void 0!==t?"".concat(h," queued").concat(t?" at position n\xb0".concat(t):""," ").concat(m?"":", it will automatically start, do not logout of Linkedin"):"".concat(h," in progress").concat(m?"":", do not logout of Linkedin",", remaining time: ").concat((0,e3.$2)(a||0)),(0,l.jsx)("button",{className:"ml-2 text-xs underline hover:text-slate-700",onClick:n,children:"(Click here to cancel)"})]})]}),r&&(0,l.jsx)(tW,{onHideModal:o,children:(0,l.jsx)(tz,{onCancel:p,onHide:o})})]})}var t$=a(20749),tZ=a(5895),tB=a(20727);function tX(e){let{leads:t,listMeta:a}=e;(0,s.useMemo)(()=>(null==a?void 0:a.source)===eP.A.csvImport,[a]);let i=(0,s.useMemo)(()=>null==t?void 0:t.every(e=>e.emailStatus===ek.A.skip),[t]);(0,s.useMemo)(()=>null==t?void 0:t.every(e=>void 0===e.phoneSearchedAt),[t]);let r=(0,s.useMemo)(()=>(t||[]).filter(e=>e.email&&e.emailStatus===ek.A.found).length,[t]),n=(0,s.useMemo)(()=>(t||[]).filter(e=>e.emailStatus===ek.A.catchAll).length,[t]);(0,s.useMemo)(()=>(t||[]).filter(e=>e.phone&&!(0,L.PS)(e)).length,[t]);let o=(0,s.useMemo)(()=>n+r,[n,r]),d=(0,s.useCallback)(e=>{let a=(null==t?void 0:t.length)||0;return 0===a?"0%":"".concat(Math.round(e/a*1e4)/100,"%")},[o,null==t?void 0:t.length]),c=(0,s.useMemo)(()=>{let e=(null==t?void 0:t.length)||0;if(0===e)return"0%";let a=e-o;return"".concat(Math.round(a/e*1e4)/100,"%")},[null==t?void 0:t.length,o]),u=!t;return(0,l.jsxs)("div",{className:"mt-4 flex justify-start text-center gap-x-4 ",children:[(0,l.jsxs)(tB.Zp,{children:[(0,l.jsx)(tB.aR,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,l.jsx)(tB.ZB,{className:"text-sm font-medium",children:"Total leads"})}),(0,l.jsx)(tB.Wu,{children:u?(0,l.jsx)(t$.A,{className:"mt-[1px] h-[20px] w-[25px] rounded"}):t.length})]}),(0,l.jsxs)(tB.Zp,{children:[(0,l.jsx)(tB.aR,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,l.jsx)(tB.ZB,{className:"text-sm font-medium",children:"Email Found"})}),(0,l.jsx)(tB.Wu,{children:u?(0,l.jsx)(t$.A,{className:"mt-[1px] h-[20px] w-[25px] rounded"}):i?"-":o})]}),(0,l.jsx)(tB.Zp,{className:"flex justify-center items-center",children:(0,l.jsx)(tB.Wu,{className:"pb-0",children:u?(0,l.jsx)(t$.A,{className:"mt-[1px] h-[20px] w-[25px] rounded"}):(0,l.jsxs)("span",{className:"flex flex-col items-start justify-center gap-y-0 ",children:[(0,l.jsxs)("span",{className:"flex items-center justify-center text-xs text-green-500",children:[(0,l.jsx)(tZ.xgK,{className:"text-xl"}),"Valid:"," ",i?"-":"".concat(r," (").concat(d(r),")")]}),(0,l.jsxs)("span",{className:" flex items-center justify-center text-xs text-yellow-500",children:[(0,l.jsx)(tZ.xgK,{className:"text-xl"}),"Risky:"," ",i?"-":"".concat(n," (").concat(d(n),")")]}),(0,l.jsxs)("span",{className:" flex items-center justify-center text-xs text-slate-400",children:[(0,l.jsx)(tZ.xgK,{className:"text-xl"}),"Not found:"," ",i?"-":"".concat(t.length-o," (").concat(c,")")]})]})})})]})}let tq=async e=>{let t=await fetch("/api/list-view/create",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({listView:e})});return await t.json()},tH=async(e,t)=>{let a=await fetch("/api/list-view/update",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({listViewId:e,listView:t})});return await a.json()},tG=async e=>{let t=await fetch("/api/list-view/delete",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({listViewId:e})});return await t.json()},tU=async(e,t)=>{let a=await fetch("/api/list-view/update-name?listViewId=".concat(e),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({name:t})});return await a.json()};class tQ extends C{constructor(e){super(e),this._tableRef=e,this.masterTableViews=[],this.activeView=void 0,this.selectLeadModalState={state:!1},this.toggleSelectSegmentSearchModal=e=>{(null==e?void 0:e.state)===!0?this.selectLeadModalState=e:this.selectLeadModalState={state:!1}},this.addToTableView=async(e,t)=>{let a=(0,g.Os)();t.name="Copy of ".concat((0,g.ZH)(t.name));let l={...t,id:a,filters:this.filters,sorts:this.sorts,joinOperator:this.joinOperator};this.masterTableViews=[...this.masterTableViews,l],this.activeView=l;try{let{listView:t}=await tq({listId:e,name:l.name,filters:l.filters,sort:l.sorts,c
1olumns:l.colIds});t&&(this.masterTableViews.forEach(e=>{e.id===a&&(e.id=t._id)}),this.activeView.id=t._id)}catch(e){console.error("Failed to create List View:",e),this.masterTableViews=this.masterTableViews.filter(e=>e.id!==a),this.activeView=void 0}return this.activeView},this.deleteTableView=async e=>{this.masterTableViews=this.masterTableViews.filter(t=>t.id!==e),this.activeView=void 0,await tG(e)},this.updateViewName=async(e,t)=>{this.masterTableViews.forEach(a=>{a.id===t.id&&(a.name=e)}),this.activeView&&(this.activeView.name=e),await tU(t.id,e)},this.toggleVisibleColumn=async e=>{this.masterTableViews.forEach(t=>{var a;t.id===(null==(a=this.activeView)?void 0:a.id)&&(t.colIds=[...e])}),this.activeView&&this.activeView.id&&await tH(this.activeView.id,{columns:e})},this.applyTableView=e=>{let{id:t}=e,a=this.masterTableViews.find(e=>e.id===t);if(a)return this.activeView=a,this.filters=[...a.filters],this.sorts=[...a.sorts],this.joinOperator=a.joinOperator,a},this.updateFilters=async e=>{super.updateFilters(e),e.sorts&&e.sorts.length>0&&this.activeView&&this.activeView.id&&(this.masterTableViews.forEach(t=>{var a,l;t.id===(null==(a=this.activeView)?void 0:a.id)&&(t.sorts=null!=(l=e.sorts)?l:[])}),await tH(this.activeView.id,{sort:e.sorts})),e.filters&&e.filters.length>0&&this.activeView&&this.activeView.id&&(this.masterTableViews.forEach(t=>{var a,l;t.id===(null==(a=this.activeView)?void 0:a.id)&&(t.filters=null!=(l=e.filters)?l:[])}),await tH(this.activeView.id,{filters:e.filters})),e.joinOperator&&this.activeView&&this.activeView.id&&(this.masterTableViews.forEach(t=>{var a,l;t.id===(null==(a=this.activeView)?void 0:a.id)&&(t.joinOperator=null!=(l=e.joinOperator)?l:y.AND)}),await tH(this.activeView.id,{joinOperator:e.joinOperator}))},this.mutateTableRowData=e=>{R(e),this.masterData.forEach(t=>{t._id===e.leadId&&(t[e.column]=e.value)}),this.filteredData__()},this.deleteTableRowData=async e=>{await T(e),this.masterData=this.masterData.filter(t=>!e.some(e=>e.leadId===t._id)),this.filteredData__()},(0,w.Gn)(this,{selectedRows:w.$Z,filters:w.$Z,sorts:w.$Z,joinOperator:w.$Z,masterData:w.$Z,setMasterData:w.$Z,updateFilters:w.$Z,resetFilters:w.$Z,updateSelectedRows:w.$Z,clearSelectRow:w.$Z,filteredData:w.$Z,tableRef:w.$Z,selectedRowsArray:w.$Z,masterTableViews:w.sH,activeView:w.sH,selectLeadModalState:w.sH,toggleSelectSegmentSearchModal:w.XI,addToTableView:w.XI,deleteTableView:w.XI,updateViewName:w.XI,toggleVisibleColumn:w.XI,applyTableView:w.XI,mutateTableRowData:w.XI,deleteTableRowData:w.XI})}}let tY=e=>{var t;let{params:a,children:s}=e;return(null==(t=a.data)?void 0:t.isLoading)?(0,l.jsx)(t$.A,{className:"block h-6 mt-2 rounded"}):(0,l.jsx)(l.Fragment,{children:s})};var tJ=a(39243),tK=a(52386);function t0(e){let{canHide:t=!0,canSort:a=!0,className:i,onHideCb:r,...n}=e,[o,d]=(0,s.useState)(n.column.getSort());if(!t&&!a)return(0,l.jsx)("div",{className:(0,X.cn)(i),title:n.displayName,children:n.displayName});let c="".concat(n.column.getColId(),"-asc"),u="".concat(n.column.getColId(),"-desc"),m="".concat(n.column.getColId(),"-hide");return(0,l.jsx)("div",{className:(0,X.cn)("flex w-full items-center gap-2"),title:n.displayName,children:(0,l.jsxs)(ea.l6,{value:"desc"===o?u:"asc"===o?c:void 0,onValueChange:e=>{e===c?n.setSort("asc"):e===u?n.setSort("desc"):e===m&&(n.api.setColumnsVisible([n.column],!1),null==n||n.api.getAllGridColumns().filter(e=>e.getColId()!==eA)),d(n.column.getSort())},children:[(0,l.jsx)(ea.bq,{"aria-label":"desc"===o?"Sorted descending. Click to sort ascending.":"asc"===o?"Sorted ascending. Click to sort descending.":"Not sorted. Click to sort ascending.",className:"-ml-3 h-8 w-full border-none text-xs shadow-none  data-[state=open]:bg-accent [&>svg:last-child]:hidden",children:n.displayName}),(0,l.jsx)(ea.gC,{align:"start",children:n.column.isSortable()&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ea.eb,{value:c,children:(0,l.jsxs)("span",{className:"flex items-center",children:[(0,l.jsx)(tJ.A,{className:"mr-2 size-3.5 text-muted-foreground/70","aria-hidden":"true"}),"Asc"]})}),(0,l.jsx)(ea.eb,{value:u,children:(0,l.jsxs)("span",{className:"flex items-center",children:[(0,l.jsx)(tK.A,{className:"mr-2 size-3.5 text-muted-foreground
1/70","aria-hidden":"true"}),"Desc"]})})]})})]})})}function t1(e){let{toggleVisibleColumn:t}=t3();return(0,l.jsx)(t0,{...e,onHideCb:e=>{t(e)}})}let t2=[{field:"firstName",colId:"firstName",headerName:"First Name",minWidth:150,sortable:!0,hide:!1,headerComponent:t1,cellRenderer:e=>{var t,a;return(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.firstName,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.firstName)})})})}},{field:"lastName",colId:"lastName",headerName:"Last Name",minWidth:150,sortable:!0,hide:!1,headerComponent:t1,cellRenderer:e=>{var t,a;return(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.lastName,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.lastName)})})})}},{field:"jobTitle",colId:"jobTitle",headerName:"Job Title",minWidth:200,sortable:!0,hide:!1,headerComponent:t1,cellRenderer:e=>{var t;return(0,l.jsx)(tY,{params:e,children:(null==(t=e.data)?void 0:t.jobTitle)?(0,l.jsx)(eW.A,{label:e.data.jobTitle,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(e.data.jobTitle)})}):null})}},{field:"companyName",colId:"companyName",headerName:"Company",minWidth:200,sortable:!0,hide:!1,headerComponent:t1,cellRenderer:e=>e.data?(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:e.data.companyName,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(e.data.companyName)})})}):null},{field:"industry",colId:"industry",headerName:"Industry",minWidth:150,sortable:!0,hide:!0,headerComponent:t1,cellRenderer:e=>{var t,a;return(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.industry,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.industry)})})})}},{field:"companySize",colId:"companySize",headerName:"Company Size",minWidth:120,sortable:!0,hide:!0,headerComponent:t1,cellRenderer:e=>{var t,a;return(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.companySize,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.companySize)})})})}},{field:"city",colId:"city",headerName:"City",minWidth:120,sortable:!0,hide:!0,headerComponent:t1,cellRenderer:e=>{var t,a;return(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.city,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.city)})})})}},{field:"country",colId:"country",headerName:"Country",minWidth:120,sortable:!0,hide:!0,headerComponent:t1,cellRenderer:e=>{var t,a;return(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.country,children:(0,l.jsx)("span",{className:"line-clamp-1",children:(0,g.W5)(null==(a=e.data)?void 0:a.country)})})})}},{field:"isLinkedinPremium",colId:"isLinkedinPremium",headerName:"LinkedIn Premium",minWidth:140,sortable:!0,hide:!0,headerComponent:t1,cellRenderer:e=>{var t,a;return(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:(null==(t=e.data)?void 0:t.isLinkedinPremium)?"Yes":"No",children:(0,l.jsx)("span",{className:"line-clamp-1",children:(null==(a=e.data)?void 0:a.isLinkedinPremium)?"Yes":"No"})})})}},{field:"companyWebsite",colId:"companyWebsite",headerName:"Website",minWidth:200,sortable:!0,hide:!0,headerComponent:t1,cellRenderer:e=>{var t,a,s;return(0,l.jsx)(tY,{params:e,children:(null==(t=e.data)?void 0:t.companyWebsite)?(0,l.jsx)(eT.b,{href:null==(a=e.data)?void 0:a.companyWebsite,target:"_blank",className:"line-clamp-1 font-normal hover:underline",children:(0,eQ.N8)(null==(s=e.data)?void 0:s.companyWebsite)}):""})}},{field:"companyLinkedinUrl",colId:"companyLinkedinUrl",headerName:"Linkedin Company URL",minWidth:200,sortable:!0,editable:!1,hide:!0,headerComponent:t1,cellRenderer:e=>{var t,a,s,i;return(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:null==(t=e.data)?void 0:t.companyLinkedinUrl,children:(0,l.jsx)(eT.A,{href:null!=(i=null==(a=e.data)?void 0:a.companyLinkedinUrl)?i:"#",target:"_blank",className:"line-clamp-1 font-normal hover:underline",children:(0,g.W5)(null==(s=e.data)?void 0:s.companyName)})})})}},{field:"email",colId:"email",headerName:"Email",minWidth:200,sortable:!0,hide:!1,headerComponent:t1,cellRenderer:e=>(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eU,{lead:e.data})})}];var t5=a(89099);let t4=(0,s.createContext)(void 0),t8=e=>{let{children:t,masterLeads:a,masterTableViews:i,listId:r}=e,n=(0,t5.useRouter)(),o=(0,s.useRef)(!1),d=(0,s.useRef)(!1),c=(0,s.useRef)(null),u=(0,s.useRef)(new tQ(c)),m=(0,eq.d4)((0,eB.gr)(r)),h=(0,s.useCallback)(e=>{let t=(null==m?void 0:m.source)===eP.A.csvImport,a=[...t2];if(e.some(e=>e.linkedinProfileHash)){let e=[{field:"linkedinProfileHash",colId:"linkedinProfileHash",headerName:"LinkedIn URL",minWidth:200,sortable:!0,editable:!1,hide:t,headerComponent:t1,cellRenderer:e=>e.data?(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:"".concat(e.data.firstName," ").concat(e.data.lastName),children:(0,l.jsx)(eT.A,{href:(0,L.d$)(e.data),target:"_blank",className:"line-clamp-1 font-normal hover:underline",children:(0,g.W5)("".concat(e.data.firstName," ").concat(e.data.lastName))})})}):null},{field:"salesNavProfileHash",colId:"salesNavProfileHash",headerName:"Sales Nav URL",minWidth:200,editable:!1,sortable:!0,hide:t,headerComponent:t1,cellRenderer:e=>e.data?(0,l.jsx)(tY,{params:e,children:(0,l.jsx)(eW.A,{label:"".concat(e.data.firstName," ").concat(e.data.lastName),children:(0,l.jsx)(eT.A,{href:(0,L.MN)(e.data),target:"_blank",className:"line-clamp-1 font-normal hover:underline",children:(0,g.W5)("".concat(e.data.firstName," ").concat(e.data.lastName))})})}):null}];a.unshift(...e)}return a},[m]),p=(0,s.useCallback)(()=>
1{if(!1===o.current&&a.length>0){var e,t;u.current.resetFilters(),u.current.setMasterData(a),u.current.setColumnDefs(h(a)),null==(t=u.current.tableRef.current)||null==(e=t.api)||e.hideOverlay(),o.current=!0}},[a]),x=(0,s.useCallback)(()=>{!1===d.current&&(u.current.activeView=void 0,u.current.masterTableViews=[...i],d.current=!0)},[i]);return(0,s.useEffect)(()=>{n.pathname.startsWith("/app/list")&&(console.log("refresh"),u.current.setMasterData([]),o.current=!1,d.current=!1,p(),x())},[n,p,x]),(0,l.jsx)(t4.Provider,{value:u.current,children:t})},t3=()=>{let e=(0,s.useContext)(t4);if(!e)throw Error("useLeadStore must be used within a LeadStoreProvider");return e};var t6=a(65473),t7=a(96069),t9=function(e){return e.all="all",e.emailNotFound="emailNotFound",e.emailRisky="emailRisky",e.emailValid="emailValid",e.one="one",e}({}),ae=function(e){return e.all="all",e.one="one",e}({}),at=a(54587),aa=a.n(at);function al(e){let{open:t,setOpen:a,listId:r,allowSingleLead:n=!1,selectedLead:o}=e,{authedUser:d}=(0,e_.A)(),c=(0,eq.d4)((0,eB.uA)(r)),u=(0,e$.w)(),m=(0,eq.d4)((0,eB.gr)(r)),[h,p]=(0,s.use
1State)(!1),x=(0,s.useMemo)(()=>(null==m?void 0:m.source)===eP.A.csvImport,[m]),[f,g]=(0,s.useState)(),v=(0,s.useCallback)(()=>{a(!1),g(void 0)},[a]),j=(0,s.useCallback)(async()=>{if((!(null==d?void 0:d.credits)||(0,eF.RX)(d)&&!(0,eF.ip)(d))&&x)return p(!0),!1;if(f){if(f===ae.one&&o)u((0,eZ.eV)({sourceListId:r,leadsIds:[o._id]}));else{let e=c.filter(e=>!e.email||e.emailStatus&&[ek.A.skip,ek.A.notFound].includes(e.emailStatus));u((0,eZ.eV)({sourceListId:r,leadsIds:e.map(e=>e._id)}))}a(!1)}},[f,o,c,x]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eM.lG,{open:t,onOpenChange:e=>{a(e),g(void 0)},children:(0,l.jsxs)(eM.Cf,{children:[(0,l.jsx)(eM.L3,{className:"hidden"}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("h1",{children:[(0,l.jsx)(t6.mm2,{className:"mr-1 inline",size:30})," Select leads segments"]}),(0,l.jsx)("p",{className:"mt-3 max-w-[480px]",children:"Choose which segment of leads you want to search emails for. The search can take several minutes."}),(0,l.jsxs)("div",{className:"mt-4 flex max-w-[300px] flex-wrap",children:[(0,l.jsx)(eE.A,{leftIcon:tZ.sBy,className:"mx-1 mb-2",variant:f===ae.all?"primary":"outline",onClick:()=>g(ae.all),children:"All leads"}),n&&(0,l.jsx)(eE.A,{leftIcon:tZ.YQq,className:"mx-1 mb-2",variant:f===ae.one?"primary":"outline",onClick:()=>g(ae.one),children:"Only this lead"})]}),(0,l.jsxs)("div",{className:"mt-4 flex justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eE.A,{variant:"light",onClick:v,children:"Cancel"}),(0,l.jsx)(eE.A,{variant:"primary",className:"ml-2",onClick:j,rightIcon:i.L2n,disabled:!f,children:"Search Emails"})]}),(0,l.jsx)(t7.A,{label:x?"Amount of credits consumed per email found.":"Email finding is free and does not consume credits.",children:(0,l.jsxs)(eE.A,{variant:"light",className:"flex cursor-default gap-x-2 rounded-full",children:[(0,l.jsx)(aa(),{width:50,height:50,src:"/img/logo.png",alt:"logo",className:"w-6"}),x?eO.A.chargeForOneEmailCredit:"Free"]})})]})]})]})}),(0,l.jsx)(ez,{open:h,setOpen:p})]})}var as=a(41618),ai=a(89003);function ar(e){let{open:t,setOpen:a}=e,{authedUser:r}=(0,e_.A)(),n=(0,s.useMemo)(()=>r&&(0,eF.RX)(r)&&!(0,eF.ip)(r)?"trial expired":"no enough credits",[r]);return(0,l.jsx)(eM.lG,{open:t,onOpenChange:a,children:(0,l.jsxs)(eM.Cf,{children:[(0,l.jsx)(eM.L3,{className:"hidden"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{children:"trial expired"===n?"Your free trial has expired":"Insufficient credits"}),(0,l.jsx)("p",{className:"mt-3",children:"trial expired"===n?"Your free trial has expired, please upgrade to find phone numbers on ".concat(eO.A.appname,"."):(0,l.jsxs)(l.Fragment,{children:["You need credits to search the availability of phone numbers.",(0,l.jsx)("br",{}),"Please upgrade to get more credits."]})}),(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(eE.A,{variant:"light",onClick:()=>a(!1),children:"Not for now"}),(0,l.jsx)(eV.A,{rightIcon:i.L2n,className:"ml-2",href:eD.A.paymentPlans,children:"See available plans"})]})]})]})})}function an(e){let{open:t,setOpen:a,listId:r,allowSingleLead:n=!1,selectedLead:o}=e,d=(0,e$.w)(),c=(0,eq.d4)((0,eB.uA)(r)),[u,h]=(0,s.useState)(!1),[p,x]=(0,s.useState)(),{authedUser:f}=(0,e_.A)(),g=(0,s.useCallback)(e=>()=>!(null==f?void 0:f.credits)||(0,eF.RX)(f)&&!(0,eF.ip)(f)||f.credits/eO.A.chargeForOnePhoneCredit<1?(h(!0),!1):(e.length&&d((0,eK.e3)({leadsIds:e.map(e=>e._id),sourceListId:r})),!0),[r,c,f,d]),v=(0,s.useCallback)(()=>{p&&g((p===t9.one?[o]:(c||[]).filter(e=>!e.phone&&(p===t9.all||p===t9.emailNotFound&&e.emailStatus===ek.A.notFound||e.emailStatus===ek.A.skip||p===t9.emailRisky&&e.emailStatus===ek.A.catchAll||p===t9.emailValid&&e.emailStatus===ek.A.found||!1))).filter(Boolean))()&&j()},[p,o,c,g]),j=(0,s.useCallback)(()=>{a(!1),x(void 0)},[]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eM.lG,{open:t,onOpenChange:e=>{a(e),x(void 0)},children:(0,l.jsxs)(eM.Cf,{children:[(0,l.jsx)(eM.L3,{className:"hidden"}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("h1",{children:[(0,l.jsx)(tv.dRU,{className:"mr-1 inline",size:25})," Select leads segment"]}),(0,l.jsx)("p",{className:"mt-3 max-w-[480px]",children:"Choose which segment of leads you want to search phones for. The search can take several minutes."}),(0,l.jsxs)("div",{className:(0,m.A)("mt-4 flex flex-wrap",n?"max-w-[460px]":"max-w-[300px]"),children:[(0,l.jsx)(eE.A,{leftIcon:tZ.sBy,className:"mx-1 mb-2",variant:p===t9.all?"primary":"outline",onClick:()=>x(t9.all),children:"All leads"}),(0,l.jsx)(eE.A,{leftIcon:as.reO,className:"mx-1 mb-2",variant:p===t9.emailNotFound?"primary":"outline",onClick:()=>x(t9.emailNotFound),children:"Emails not found"}),n&&(0,l.jsx)(eE.A,{leftIcon:tZ.YQq,className:"mx-1 mb-2",variant:p===t9.one?"primary":"outline",onClick:()=>x(t9.one),children:"Only this lead"}),(0,l.jsx)(eE.A,{leftIcon:ai.tr_,className:"mx-1 mb-2",variant:p===t9.emailRisky?"primary":"outline",onClick:()=>x(t9.emailRisky),children:"Emails risky"}),(0,l.jsx)(eE.A,{leftIcon:tZ.mcb,className:"mx-1 mb-2",variant:p===t9.emailValid?"primary":"outline",onClick:()=>x(t9.emailValid),children:"Valid emails"})]}),(0,l.jsxs)("div",{className:"mt-4 flex justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eE.A,{variant:"light",onClick:j,children:"Cancel"}),(0,l.jsx)(eE.A,{variant:"primary",className:"ml-2",onClick:v,rightIcon:i.L2n,disabled:!p,children:"Search Phones"})]}),(0,l.jsx)(t7.A,{label:"Amount of credits consumed per phone number found.",children:(0,l.jsxs)(eE.A,{variant:"light",className:"flex cursor-default gap-x-1 rounded-full",children:[(0,l.jsx)(aa(),{width:50,height:50,src:"/img/logo.png",alt:"logo",className:"w-6"}
1),eO.A.chargeForOnePhoneCredit]})})]})]})]})}),(0,l.jsx)(ar,{open:u,setOpen:h})]})}var ao=a(60452),ad=a(99942),ac=a(46601);let au=(0,e0.PA)(e=>{let{listId:t,leads:a,selectedRows:r,listName:n}=e,o=(0,e$.w)(),{showDialog:d}=(0,ac.Xw)(),c=(0,eq.d4)((0,eB.gr)(t)),[u,m]=(0,s.useState)(!1),h=(0,s.useMemo)(()=>(null==c?void 0:c.source)===eP.A.csvImport,[c]),{authedUser:p}=(0,e_.A)(),x=(0,s.useCallback)(e=>async()=>{let t=[];"all"===e?t.push(...a):"found"===e?t.push(...a.filter(e=>e.emailStatus===ek.A.found)):t.push(...a.filter(e=>r.map(e=>e._id).includes(e._id))),(0,tn.g4)(n,t,"csv")},[a,n,r]),f=(0,s.useCallback)(e=>async()=>{if((!(null==p?void 0:p.credits)||(0,eF.RX)(p)&&!(0,eF.ip)(p))&&h)return setTimeout(()=>{m(!0)},150),!1;let l=[];"all"===e?l.push(...a):"found"===e?l.push(...a.filter(e=>e.emailStatus===ek.A.found)):l.push(...a.filter(e=>r.map(e=>e._id).includes(e._id))),d({title:"Find emails",description:"Do you want to continue?",onConfirm:()=>{o((0,eZ.eV)({sourceListId:t,leadsIds:l.map(e=>e._id)}))}})},[a,r,h,p,t,o]);return(0,l.jsxs)(s.Fragment,{children:[(0,l.jsxs)(td,{children:[(0,l.jsx)(tc,{asChild:!0,children:(0,l.jsx)(eE.A,{size:"sm",rightIcon:ad.Cje,children:"Action"})}),(0,l.jsx)(tf,{className:"w-36",align:"end",children:(0,l.jsxs)(tu,{children:[(0,l.jsxs)(th,{children:[(0,l.jsxs)(tp,{children:[(0,l.jsx)(tv.QaY,{}),"Export CSV"]}),(0,l.jsx)(tm,{children:(0,l.jsxs)(tx,{title:"Exporting a folder into a CSV will merge all lists within the folder, and will remove duplicate profiles",children:[(0,l.jsxs)(tg,{onClick:x("selected"),disabled:0===r.length,children:[(0,l.jsx)(i.cIQ,{})," Selected leads (",r.length,")"]}),(0,l.jsxs)(tg,{onClick:x("all"),children:[(0,l.jsx)(i.cIQ,{})," All leads"]}),(0,l.jsxs)(tg,{onClick:x("found"),children:[(0,l.jsx)(i.cIQ,{})," Valid emails only"]})]})})]}),(0,l.jsxs)(th,{children:[(0,l.jsxs)(tp,{children:[(0,l.jsx)(t6.mm2,{}),"Find emails"]}),(0,l.jsx)(tm,{children:(0,l.jsxs)(tx,{children:[(0,l.jsxs)(tg,{disabled:0===r.length,onClick:f("selected"),children:[(0,l.jsx)(tv.KSO,{}),"Selected leads (",r.length,")"]}),(0,l.jsxs)(tg,{onClick:f("all"),children:[(0,l.jsx)(tv.KSO,{}),"All leads"]})]})})]})]})})]}),(0,l.jsx)(ez,{open:u,setOpen:m})]})}),am=(0,e0.PA)(e=>{let{toggleArchiveList:t,isListArchived:a,listName:o,leads:d,isLoading:c,listId:u}=e;(0,e$.w)();let{tableRef:m,selectedRows:h,masterData:p}=t3(),[x,f]=(0,s.useState)({open:!1,leads:[]}),g=(0,eq.d4)((0,eB.gr)(u));(0,s.useMemo)(()=>(null==g?void 0:g.source)===eP.A.csvImport,[g]);let[v,j]=(0,s.useState)(!1),[b,y]=(0,s.useState)(!1);(0,s.useCallback)(()=>j(!0),[]),(0,s.useCallback)(()=>j(!1),[]),(0,s.useCallback)(()=>y(!0),[]),(0,eq.d4)((0,eZ.Ln)((null==d?void 0:d.map(e=>e._id))||[])),(0,eq.d4)((0,eK.Xn)((null==d?void 0:d.map(e=>e._id))||[]));let w=(0,s.useCallback)((e,t)=>()=>{if(o&&(null==d?void 0:d.length)){if(t){let a=d.filter(e=>e.emailStatus===t);return(0,ao.C8)({format:e,leadsCount:a.length,type:"".concat(t===ek.A.found?"valid":"risky"," emails only")}),(0,tn.g4)(o,a,e)}(0,ao.C8)({format:e,leadsCount:d.length,type:"all leads"}),(0,tn.g4)(o,d,e)}},[d,o]);return(0,s.useMemo)(()=>(null==d?void 0:d.filter(e=>e.emailStatus&&[ek.A.skip,ek.A.notFound].includes(e.emailStatus)||!e.email).length)===0,[d]),(0,s.useMemo)(()=>(null==d?void 0:d.filter(e=>!e.phone).length)===0,[d]),(0,l.jsxs)(l.Fragment,{children:[[(0,l.jsx)(au,{listName:o,listId:u,leads:null!=p?p:[],selectedRows:h}),(0,l.jsx)(n.A,{dropdownClassName:"min-w-[200px]",ButtonElement:e=>(0,l.jsx)(r.A,{className:"ml-2",variant:"light",size:"sm",icon:i.KV9,onClick:e.onClick},"more-3-1"),menu:[{title:"Other exports"},{title:"Export XLS",onClick:w("xls"),icon:i.cIQ},{title:"Export XLSX",onClick:w("xlsx"),icon:i.cIQ},!c&&{title:"Manage your list"},!c&&{title:"".concat(a?"Unarchive":"Archive"," list"),onClick:t,icon:i.UdI}]},"more-3")],(0,l.jsx)(an,{open:v,setOpen:j,listId:u}),(0,l.jsx)(al,{open:b,setOpen:y,listId:u})]})});function ah(e){let{listMeta:t}=e,a=(0,s.useMemo)(()=>{let e=[];return(null==t?void 0:t.extractionStatus)===e8.A.failed&&e.push({msg:t.source===eP.A.csvImport?"Import failed":"Extraction failed",type:"error"}),(null==t?void 0:t.extractionStatus)===e8.A.canceled&&e.push({msg:t.source===eP.A.csvImport?"Import canceled":"Extraction canceled",type:"warn"}),(null==t?void 0:t.isArchived)&&e.push({msg:"Archived"}),e},[t]);return(0,l.jsx)(l.Fragment,{children:!!a.length&&(0,l.jsx)("div",{className:"ml-2 mt-2 flex items-center",children:a.map(e=>(0,l.jsx)("p",{className:(0,m.A)("mr-1 rounded bg-gray-100 px-1 py-[2px] text-xs text-slate-500","error"===e.type&&"bg-red-100 text-red-500","warn"===e.type&&"bg-yellow-100 text-yellow-600"),children:e.msg},e.msg))})})}function ap(e){let{isLoading:t,children:a,leads:i,listMeta:r,listId:n,listName:d,toggleArchiveList:u}=e,{renameList:m}=(0,ts.A)(),h=(0,s.useCallback)(e=>{m({listId:n,name:e})},[n,m]);
1return(0,l.jsxs)(o.A,{title:d,layoutId:n,editableTitle:!0,onTitleChange:h,titleRightElement:(0,l.jsx)(ah,{listMeta:r}),rightActions:(0,l.jsx)(am,{listId:n,listName:d,leads:i,isLoading:t,isListArchived:!!(null==r?void 0:r.isArchived),toggleArchiveList:u}),children:[(0,l.jsx)(c.A,{templateTitle:d}),(0,l.jsx)("main",{className:"flex flex-1 flex-col",children:a})]})}let ax=(0,e0.PA)(e=>{let{tableViews:t,isLoading:a,listMeta:i}=e;(0,s.useRef)([]);let{selectLeadModalState:r,filteredData:n,toggleSelectSegmentSearchModal:o,tableRef:d,updateSelectedRows:c,updateFilters:u,filters:m,joinOperator:h,sorts:p,toggleVisibleColumn:x,mutateTableRowData:f,deleteTableRowData:g,columnDefs:v}=t3(),[j,b]=(0,s.useState)("");return(0,l.jsx)(s.Fragment,{children:(0,l.jsx)(E.b,{calcHeight:50,columns:v,girdRef:d,showSkeleton:!0,isLoading:!!a,quickFilterText:j,tableprops:{stopEditingWhenCellsLoseFocus:!0,rowSelection:{mode:"multiRow",selectAll:"filtered",enableSelectionWithoutKeys:!0},onSelectionChanged(e){c(e.api)},onCellValueChanged(e){"edit"===e.source&&f({listId:e.data.listId,leadId:e.data._id,column:e.colDef.field,value:e.newValue})}},row:n,children:(0,l.jsx)("div",{className:"flex items-center gap-x-1",children:(0,l.jsx)(eS,{onDeleteSelectedRows:async e=>{let t=e.map(e=>({listId:e.listId,leadId:e._id}));await g(t)},toggleVisibleColumn:x,quickFilterText:j,setQuickFilterText:b,debounceMs:500,filterFields:eR,setFilters:e=>{u({filters:e})},filters:m,setJoinOperator:e=>{u({joinOperator:e})},gridRef:d,joinOperator:h,setSorting:e=>{var t,a;u({sorts:e}),null==(a=d.current)||null==(t=a.api)||t.applyColumnState({state:e.map(e=>({colId:e.id,sort:e.desc?"desc":"asc"})),defaultState:{sort:null}})},sorting:p})})})})}),af=e=>{var t,a;let{...i}=e,r=(0,s.useMemo)(()=>{var e,t;return(null!=(t=null==(e=i.listMeta)?void 0:e.listViews)?t:[]).map(e=>{var t,a,l;return{colIds:null!=(t=e.columns)?t:[],filters:null!=(a=e.filters)?a:[],id:e._id,joinOperator:y.AND,name:e.name,sorts:null!=(l=e.sort)?l:[]}})},[i.listMeta]);return(0,l.jsx)(t8,{listId:null==(t=i.listMeta)?void 0:t._id,masterLeads:null!=(a=i.leads)?a:[],masterTableViews:r,children:i.children})},ag=["active"],av=e=>{let{selectedView:t,isReadOnlyView:a}=e,{updateViewName:i}=t3(),[r,n]=(0,s.useState)("string"!=typeof t?t.name:"".concat(t.toString()," leads")),o=ef((e,t)=>{i(t,e)},500),[d,c]=(0,s.useState)(!1),u=(0,s.useCallback)(e=>{if(a)return c(!1);c(e)},[a]);return(0,s.useEffect)(()=>{n("string"!=typeof t?t.name:"".concat(t.toString()," leads"))},[t]),(0,l.jsx)(et.p,{onFocus:()=>u(!0),onBlur:()=>u(!1),className:(0,X.cn)("h-8 !w-auto max-w-[600px] capitalize leading-loose",!d&&"cursor-pointer ",a&&"!cursor-default"),readOnly:!d,onChange:e=>{let a=e.target.value;"string"!=typeof t&&(n(a),o(t,a))},value:r})};function aj(e){var t;let{selectedView:a,listId:i,setSelectdView:r}=e,n=(0,s.useMemo)(()=>"string"==typeof a,[a]),[o,d]=(0,s.useState)({}),{tableRef:c,applyTableView:u,masterTableViews:m,resetFilters:h,addToTableView:p,deleteTableView:x}=t3(),f=null==(t=c.current)?void 0:t.api,g=(0,s.useMemo)(()=>{var e,t;return null!=(t=null==f||null==(e=f.getAllGridColumns())?void 0:e.filter(e=>e.getColId()!==eA))?t:[]},[f]);(0,s.useEffect)(()=>{k(i).then(d),v("active")},[i]);let v=(0,s.useCallback)(e=>{var t,a;if(r(e),null==f||f.setColumnsVisible(g,!1),"string"==typeof e)null==f||f.setColumnsVisible(null!=(t=t2.filter(e=>!1===e.hide).map(e=>e.colId))?t:[],!0);else{let t=u(e);null==f||f.setColumnsVisible([...null!=(a=null==t?void 0:t.colIds)?a:[]],!0)}},[g,f,u]),j=(0,s.useCallback)(()=>async()=>{let e=g.filter(e=>e.isVisible()).map(e=>e.getId()),t=await p(i,{colIds:e,name:"string"==typeof a?"".concat(a.toString()," leads"):a.name});t&&r(t)},[a]),b=(0,s.useCallback)(e=>"string"==typeof e&&"string"==typeof a?e===a:("string"!=typeof e&&e.id)===("string"!=typeof a&&a.id),[a]);return(0,l.jsxs)(q.AM,{children:[(0,l.jsx)(av,{selectedView:a,isReadOnlyView:n}),(0,l.jsx)(q.Wv,{asChild:!0,children:(0,l.jsx)($.$,{size:"icon",variant:"outline",className:"h-8",children:(0,l.jsx)(eN.D3D,{})})}),(0,l.jsx)(q.hl,{className:"w-52 p-0",align:"end",children:(0,l.jsx)(B.uB,{children:(0,l.jsxs)(B.oI,{className:"max-h-[400px]",children:[(0,l.jsxs)(B.L$,{className:"cursor-pointer",children:[ag.map((e,t)=>(0,l.jsxs)(B.h_,{className:"cursor-pointer",onSelect:()=>{v(e),h()},children:[(0,l.jsx)("span",{className:"capitalize",children:e})," leads (",o[e],") (R)"," ",(0,l.jsx)("span",{className:"ml-auto",children:b(e)&&(0,l.jsx)(eN.Srz,{})})]},t)),m.map(e=>(0,l.jsxs)(B.h_,{className:"cursor-pointer",value:e.id,onSelect:()=>{v(e)},children:[e.name," ",(0,l.jsx)("span",{className:"ml-auto",children:b(e)&&(0,l.jsx)(eN.Srz,{})})]},e.id))]}),(0,l.jsx)(B.fx,{}),(0,l.jsxs)(B.L$,{children:[(0,l.jsxs)(B.h_,{className:"cursor-pointer",onSelect:j(),children:[(0,l.jsx)(eN.TdU,{})," Duplicate view"]}),(0,l.jsxs)(B.h_,{onSelect:async()=>{"string"!=typeof a&&(await x(a.id),r("active"),h())},className:(0,X.cn)("cursor-pointer text-destructive hover:!text-destructive/90 data-[selected=true]:!text-destructive/90",n&&"!cursor-not-allowed"),children:[(0,l.jsx)(eN.ucK,{className:"h-4 w-4"})," Delete view"]})]})]})})})]})}
1function ab(e){let t=(0,e$.w)(),[a,i]=(0,s.useState)(ag[0]),{isLoading:r,leads:n=[],setLeads:o,listMeta:d,toggleArchiveList:c}=tD(e.listId),u=(0,s.useCallback)(async()=>{!d||(null==d?void 0:d.isSeen)||t((0,eB.zw)(d._id))},[d]);return(0,s.useEffect)(()=>{u()},[u]),(0,l.jsx)(af,{listMeta:d,isLoading:r,leads:n,children:(0,l.jsxs)(ap,{listId:e.listId,listName:(null==d?void 0:d.name)||e.listName,isLoading:r,leads:n,listMeta:d,toggleArchiveList:c,children:[(0,l.jsxs)("div",{className:"px-8",children:[(0,l.jsx)("p",{className:"flex items-center text-xs text-slate-400",children:d?"".concat((0,e3.sq)(d.createdAt)," at ").concat((0,e3.t5)(d.createdAt)):(0,l.jsx)(t$.A,{className:"mt-1 h-3 w-[120px] rounded-sm"})}),(null==d?void 0:d.source)!==eP.A.csvImport&&(0,l.jsxs)("a",{className:"inline-flex  items-center gap-2 text-xs font-medium text-[#1981B9] ",href:null==d?void 0:d.sourceUrl,target:"_blank",children:["Your Sales Navigator Search url ",(0,l.jsx)(tv.QEs,{})]}),((null==d?void 0:d.extractionStatus)===e8.A.inProgress||(null==d?void 0:d.extractionStatus)===e8.A.todo)&&(0,l.jsx)(tP,{queuePosition:d.queuePosition,remainingExtractionTimeSec:d.remainingExtractionTimeSec,listId:d._id}),(0,l.jsx)(tX,{leads:n,listMeta:d})]}),(0,l.jsx)("section",{className:"relative flex-1",children:(0,l.jsx)("div",{className:"w-full px-8 py-4 pt-0",children:(0,l.jsx)(ax,{isLoading:r,listMeta:d,tableViews:()=>(0,l.jsx)(aj,{listId:e.listId,selectedView:a,setSelectdView:i})})})})]})})}function ay(e){let{listId:t}=e,{authedUser:a}=(0,e_.A)(),r=(0,s.useMemo)(()=>(null==a?void 0:a.credits)===0,[a]),[n,o]=(0,s.useState)(!1),d=(0,eq.d4)((0,eB.gr)(t)),c=(0,eq.d4)((0,eB.uA)(t)),{XX:u}=(0,s.useMemo)(()=>{let e=c.filter(e=>e.emailStatus===ek.A.found);return{XX:c.length-e.length}},[c]),m=(0,s.useMemo)(()=>{if(a&&0===a.credits&&u>0)return"You have insufficient credits and there are ".concat(u," more leads you can find emails for.")},[a,u]);(0,s.useEffect)(()=>{if(a&&!(0,eF.p3)(a)&&u>0&&!a.credits){let e=localStorage["sl:upgradeModalDisplayedAt:".concat(a._id,":").concat(t)];(!e||Date.now()>parseInt(e)+864e5)&&(localStorage["sl:upgradeModalDisplayedAt:".concat(a._id,":").concat(t)]=Date.now()+"",o(!0))}},[a,t,u]);let h=(0,s.useCallback)(()=>o(!1),[]);return(null==d?void 0:d.source)!==eP.A.csvImport?null:(0,l.jsx)(eM.lG,{open:n,onOpenChange:o,children:(0,l.jsxs)(eM.Cf,{children:[(0,l.jsx)(eM.L3,{className:"hidden"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{children:r?"Credit quota reached":"Your free trial has expired"}),(0,l.jsx)("p",{className:"mt-3 max-w-[600px]",children:m}),(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(eE.A,{variant:"light",onClick:h,children:"Not for now"}),(0,l.jsx)(eV.A,{rightIcon:i.L2n,className:"ml-2",href:eD.A.paymentPlans,target:"_blank",children:"Get more credits"})]})]})]})})}var aw=!0;let aN=(0,eq.Ng)(e=>e)(function(e){let{id:t,name:a,type:s}=e;return(0,l.jsx)(l.Fragment,{children:s===ti._V.list?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ab,{listId:t,listName:a}),(0,l.jsx)(ay,{listId:t})]}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(tT,{folderId:t,folderName:a})})})})},49486:(e,t,a)=>{"use strict";a.d(t,{t:()=>s});var l=a(76504);let s=[{name:"Hubspot",slug:"hubspot",image:"/svg/hubspot.svg",color:"#FF7A59",description:"Connect your HubSpot CRM to sync contacts and companies.",connect:async()=>{let e=await (0,l.vp)();e.url&&(window.location.href=e.url)},getAccountStatus:l.Je,disconnect:l.pU}]},60452:(e,t,a)=>{"use strict";a.d(t,{C8:()=>i,aS:()=>s,b2:()=>l,g2:()=>n,go:()=>r,jH:()=>d,t4:()=>o});let l=async e=>{await fetch("/api/users/tmp-add-me-credits?amount="+e,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}})},s=async e=>{await fetch("/api/users/update-daily-limit-linkedin-extraction?val="+e,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}})},i=async e=>{await fetch("/api/users/first-time-lead-exported",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)})},r=async e=>{await fetch("/api/users/finish-signup",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)})},n=async()=>{await fetch("/api/users/ensure-free-trial-has-started",{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}})},o=async()=>{let e=await fetch("/api/users/create-portal-link",{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(200!==e.status)throw Error((await e.json()).error||"createCustomerPortalLinkApi http ".concat(e.status," error"));return await e.json()};async function d(e){let t=await fetch("/api/users/change-user-profile-image",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({dataUrl:e})});if(200!==t.status)throw Error("Request failed with status code ".concat(t.statusText));return await t.json()}},61198:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var l=a(37876),s=a(14232),i=a(11123),r=a(63248),n=a(46768),o=a(65870);function d(e){let{children:t,title:a,rightActions:d,editableTitle:c,onTitleChange:u,layoutId:m,titleIcon:h,titleRightElement:p,className:x}=e,{state:f}
1=(0,n.cL)(),[g,v]=(0,s.useState)(!1),[j,b]=(0,s.useState)(a);(0,s.useEffect)(()=>{b(a),v(!1)},[a,m]);let y=(0,s.useCallback)(()=>{c&&v(!0)},[c]),w=(0,s.useCallback)(()=>{v(!1),a!==j&&j.trim()&&u&&u(j.trim())},[j,a,u]),N=(0,s.useCallback)(e=>{"enter"===e.key.toLocaleLowerCase()&&w()},[w]),A=(0,s.useCallback)(e=>{b(e.target.value)},[]);return(0,l.jsxs)("div",{style:{overflowY:"unset"},className:(0,o.cn)("mb-5  mr-5 flex flex-1 flex-col h-[98%] overflow-y-auto rounded-xl bg-white shadow-md","expanded"===f?"ml-5":"",x),children:[(0,l.jsxs)("div",{className:"mt-5 flex items-center px-8",children:[h&&(0,l.jsx)(h,{className:"mr-3 text-xl"}),(0,l.jsx)("button",{onClick:y,children:g?(0,l.jsx)("input",{className:"ml-[-5px] w-fit  min-w-[50px] rounded bg-slate-100 px-[5px] text-xl font-medium",style:{width:12*j.length+"px"},value:j,onBlur:w,onKeyDown:N,autoFocus:!0,onChange:A}):(0,l.jsxs)("h1",{className:(0,r.A)("relative text-xl font-medium"),children:[j,!!c&&(0,l.jsx)("div",{className:"absolute bottom-0 left-0 right-[-15px] top-[-2px] cursor-pointer opacity-0 transition-all hover:opacity-100",children:(0,l.jsx)(i.FT6,{className:"absolute right-0 top-0 text-sm text-slate-800"})})]})}),p,(0,l.jsx)("span",{className:"flex-1"}),d]}),t]})}},81156:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var l=a(37876),s=a(20749),i=a(14232),r=a(5895),n=a(20727);function o(e){let{isLoading:t,distinctLeadsCount:a,validEmailsCount:o,archivedListsCount:d,unarchivedListsCount:c,catchallEmailsCount:u,phonesCount:m}=e,h=(0,i.useMemo)(()=>(null!=o?o:0)+(null!=u?u:0),[o,u]),p=(0,i.useCallback)(e=>{let t=null!=a?a:0;return 0===t?"0%":"".concat(Math.round(e/t*1e4)/100,"%")},[a]),x=(0,i.useMemo)(()=>{let e=null!=a?a:0;if(0===e)return"0%";let t=e-h;return"".concat(Math.round(t/e*1e4)/100,"%")},[a,h]);return(0,l.jsxs)("div",{className:"mt-3 flex justify-start px-8 text-center gap-x-4",children:[(0,l.jsxs)(n.Zp,{children:[(0,l.jsx)(n.aR,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,l.jsx)(n.ZB,{className:"text-sm font-medium text-violet-500",children:"Total leads"})}),(0,l.jsx)(n.Wu,{children:t?(0,l.jsx)(s.A,{className:"mt-1 h-5 w-12 rounded"}):a})]}),(0,l.jsxs)(n.Zp,{children:[(0,l.jsx)(n.aR,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,l.jsx)(n.ZB,{className:"text-sm font-medium text-[#6ba1c1]",children:"Email Found"})}),(0,l.jsx)(n.Wu,{children:t?(0,l.jsx)(s.A,{className:"mt-1 h-5 w-12 rounded"}):h})]}),(0,l.jsx)(n.Zp,{children:(0,l.jsx)(n.Wu,{className:"p-5",children:(0,l.jsx)("span",{className:"text-xl font-medium ",children:t?(0,l.jsx)(s.A,{className:"mt-[1px] h-[20px] w-[25px] rounded"}):(0,l.jsxs)("span",{className:"flex flex-col items-start gap-y-0 ",children:[(0,l.jsxs)("span",{className:"flex items-center justify-center text-xs text-green-500",children:[(0,l.jsx)(r.xgK,{className:"text-xl"}),"Valid:"," ","".concat(o," (").concat(p(null!=o?o:0),")")]}),(0,l.jsxs)("span",{className:" flex items-center justify-center text-xs text-yellow-500",children:[(0,l.jsx)(r.xgK,{className:"text-xl"}),"Risky:"," ","".concat(u," (").concat(p(null!=u?u:0),")")]}),(0,l.jsxs)("span",{className:" flex items-center justify-center text-xs text-slate-400",children:[(0,l.jsx)(r.xgK,{className:"text-xl"}),"Not found:"," ","".concat((null!=a?a:0)-h," (").concat(x,")")]})]})})})}),0!=c&&(0,l.jsxs)(n.Zp,{children:[(0,l.jsx)(n.aR,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,l.jsx)(n.ZB,{className:"text-sm font-medium text-slate-600",children:"Active lists"})}),(0,l.jsx)(n.Wu,{children:t?(0,l.jsx)(s.A,{className:"mt-1 h-5 w-12 rounded"}):c})]}),0!=d&&(0,l.jsxs)(n.Zp,{children:[(0,l.jsx)(n.aR,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:(0,l.jsx)(n.ZB,{className:"text-sm font-medium text-slate-600",children:"Archived lists"})}),(0,l.jsx)(n.Wu,{children:t?(0,l.jsx)(s.A,{className:"mt-1 h-5 w-12 rounded"}):d})]})]})}},86257:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var l=a(37876),s=a(83763);let i=function(e){let{label:t,children:a,disableTooltip:i=!1}=e;return i?(0,l.jsx)(l.Fragment,{children:a}):(0,l.jsx)(s.Bc,{children:(0,l.jsxs)(s.m_,{children:[(0,l.jsx)(s.k$,{asChild:!0,children:a}),(0,l.jsx)(s.ZI,{children:(0,l.jsx)("span",{children:t})})]})})}},87279:(e,t,a)=>{"use strict";a.d(t,{A:()=>c,s:()=>d});var l=a(37876),s=a(84331),i=a(48230),r=a.n(i),n=a(23820),o=a(55504);function d(e){let{open:t,onOpenChange:a}=e;return(0,l.jsx)(s.Lt,{open:t,onOpenChange:a,children:(0,l.jsxs)(s.EO,{children:[(0,l.jsxs)(s.wd,{children:[(0,l.jsx)(s.r7,{children:"CRM Integrations are available for paid plans only"}),(0,l.jsx)(s.$v,{children:"Seamlessly send your prospects to your CRM. Our CRM integration is available on paid plans. Upgrade your account to connect your CRM and streamline your sales workflow"})]}),(0,l.jsxs)(s.ck,{children:[(0,l.jsx)(s.Zr,{children:"Not now"}),(0,l.jsx)(s.Rx,{asChild:!0,children:(0,l.jsx)(r(),{href:n.A.paymentPlans,children:"Upgrade Now"})})]})]})})}function c(e){let{open:t,onOpenChange:a}=e;return(0,l.jsx)(s.Lt,{open:t,onOpenChange:a,children:(0,l.jsxs)(s.EO,{children:[(0,l.jsxs)(s.wd,{children:[(0,l.jsx)(s.r7,{children:"Connect Your CRM to Push Leads"}),(0,l.jsxs)(s.$v,{children:["To send your leads, you first need to connect your CRM. This will allow ",o.A.appname," to create contacts and companies."]})]}),(0,l.jsxs)(s.ck,{children:[(0,l.jsx)(s.Zr,{children:"Not now"}),(0,l.jsx)(s.Rx,{asChild:!0,children:(0,l.jsx)(r(),{href:n.A.appIntegration,children:"Connect CRM"})})]})]})})}},88671:(e,t,a)=>{"use strict";a.d(t,{V:()=>d});var l=a(37876);a(14232);var s=a(58889),i=a(60922),r=a(7550),n=a(65870),o=a(77041);function d(e){let{className:t,classNames:a,showOutsideDays:d=!0,...c}=e;return(0,l.jsx)(r.hv,{showOutsideDays:d,className:(0,n.cn)("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
1ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:(0,n.cn)((0,o.r)({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:(0,n.cn)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===c.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:(0,n.cn)((0,o.r)({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50  aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},components:{IconLeft:()=>(0,l.jsx)(s.A,{className:"size-4"}),IconRight:()=>(0,l.jsx)(i.A,{className:"size-4"})},...c})}d.displayName="Calendar"},89970:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/lists/[id]",function(){return a(38838)}])},92188:(e,t,a)=>{"use strict";a.d(t,{G7:()=>d,L$:()=>m,fx:()=>h,h_:()=>p,oI:()=>c,uB:()=>o,xL:()=>u});var l=a(37876),s=a(14232),i=a(58687),r=a(65870);a(92161);var n=a(5259);let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(i.uB,{ref:t,className:(0,r.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",a),...s})});o.displayName=i.uB.displayName;let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsxs)("div",{className:"flex items-center border-b px-3 border rounded-md","cmdk-input-wrapper":"",children:[(0,l.jsx)(n.$p$,{className:"mr-1 h-4 w-4 shrink-0 opacity-50"}),(0,l.jsx)(i.uB.Input,{ref:t,className:(0,r.cn)("flex h-10 w-full border-0  focus:ring-0 rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...s})]})});d.displayName=i.uB.Input.displayName;let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(i.uB.List,{ref:t,className:(0,r.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden",a),...s})});c.displayName=i.uB.List.displayName;let u=s.forwardRef((e,t)=>(0,l.jsx)(i.uB.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));u.displayName=i.uB.Empty.displayName;let m=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(i.uB.Group,{ref:t,className:(0,r.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",a),...s})});m.displayName=i.uB.Group.displayName;let h=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(i.uB.Separator,{ref:t,className:(0,r.cn)("-mx-1 h-px bg-border",a),...s})});h.displayName=i.uB.Separator.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,l.jsx)(i.uB.Item,{ref:t,className:(0,r.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...s})});p.displayName=i.uB.Item.displayName},96069:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var l=a(37876),s=a(63248);function i(e){let{children:t,label:a,width:i,className:r,pinClassName:n}=e,o=i||280;return(0,l.jsxs)("span",{className:"group relative",children:[t,(0,l.jsxs)("span",{className:(0,s.A)("absolute top-[100%] left-[50%] z-[99] mt-[13px] items-center justify-center rounded-lg border bg-white px-4 py-3 text-left text-slate-700 shadow-arround","font-base text-[14px] leading-[17px]","invisible flex opacity-0 transition-all","group-hover:visible group-hover:opacity-100",r),style:{width:o+"px",marginLeft:"-"+o/2+"px"},children:[(0,l.jsx)("span",{className:(0,s.A)("absolute top-0 mt-[-5px] h-[12px] w-[12px] rotate-45 rounded bg-white",n)}),a]})]})}},98294:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var l=a(37876),s=a(14232),i=a(63248),r=a(68522);let n=s.forwardRef((e,t)=>
1{let{children:a,className:s,variant:n="primary",size:o="base",isDarkBg:d=!1,leftIcon:c,rightIcon:u,leftIconClassName:m,rightIconClassName:h,...p}=e;return(0,l.jsxs)(r.A,{ref:t,...p,className:(0,i.A)("inline-flex items-center rounded font-medium","focus:outline-none focus-visible:ring focus-visible:ring-primary-500","shadow-sm","transition-colors duration-75",["base"===o&&["px-3 py-1.5","text-sm md:text-base"],"sm"===o&&["px-2 py-1","text-xs md:text-sm"]],["primary"===n&&["bg-primary-500 text-white","border border-primary-600","hover:bg-primary-600 hover:text-white","active:bg-primary-700","disabled:bg-primary-700"],"outline"===n&&["text-primary-500","border border-primary-500","hover:bg-primary-50 active:bg-primary-100 disabled:bg-primary-100",d&&"hover:bg-gray-900 active:bg-gray-800 disabled:bg-gray-800"],"ghost"===n&&["text-primary-500","shadow-none","hover:bg-primary-50 active:bg-primary-100 disabled:bg-primary-100",d&&"hover:bg-gray-900 active:bg-gray-800 disabled:bg-gray-800"],"light"===n&&["bg-white text-gray-700","border border-gray-300","hover:bg-gray-100 hover:text-dark","active:bg-white/80 disabled:bg-gray-200"],"dark"===n&&["bg-gray-900 text-white","border border-gray-600","hover:bg-gray-800 active:bg-gray-700 disabled:bg-gray-700"]],"disabled:cursor-not-allowed",s),children:[c&&(0,l.jsx)("div",{className:(0,i.A)(["base"===o&&"mr-1","sm"===o&&"mr-1.5"]),children:(0,l.jsx)(c,{className:(0,i.A)(["base"===o&&"md:text-md text-md","sm"===o&&"md:text-md text-sm"],m)})}),a,u&&(0,l.jsx)("div",{className:(0,i.A)(["base"===o&&"ml-1","sm"===o&&"ml-1.5"]),children:(0,l.jsx)(u,{className:(0,i.A)(["base"===o&&"text-md md:text-md","sm"===o&&"md:text-md text-sm"],h)})})]})})}},e=>{var t=t=>e(e.s=t);e.O(0,[483,9509,1167,9239,4188,8752,9507,2216,6927,513,9034,2491,8283,6134,6569,6935,4073,993,5114,636,6593,8792],()=>t(89970)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.