1import{h as He,j as e,v as Je,b8 as We,b9 as Qe,aU as Ye,u as Ze,a as Ge,w as Xe,r as q,V as _e,ai as Ce,Y as Ie,$ as De,B as z,a2 as Fe,U as Ee,aa as Me,as as et,at as tt,au as Pe,av as we,aw as st,ax as Se,C as at,ad as nt,ae as rt,af as it,ag as ot,ak as lt,aZ as Ue,a_ as $e,a$ as qe,b0 as ze,b1 as je,I as Be,aJ as ct,aK as dt,aL as ht,aM as ut,aN as mt,aO as ft,aP as pt,aQ as xt,O as ke}from"./index-BA-hDO3C.js";import{u as gt}from"./use-pagination-ShpyJ5yg.js";import{B as yt}from"./badge-BmS2sdGI.js";import{T as jt}from"./trash-2-C0n4-7p4.js";import{C as vt}from"./chevron-left-CJuQnFIJ.js";import{B as bt}from"./building-2-B59OQuVd.js";import{U as _t}from"./upload-Bcxjbjcn.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Ct=He("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/** 7 * @license lucide-react v0.453.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const wt=He("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);function Re({className:G,...ve}){return e.jsx("div",{className:Je("animate-pulse rounded-md bg-muted",G),...ve})}var Ve={exports:{}};/* @license
12Papa Parse 13v5.5.3 14https://github.com/mholt/PapaParse 15License: MIT 16*/(function(G,ve){((de,_)=>{G.exports=_()})(We,function de(){var _=typeof self<"u"?self:typeof window<"u"?window:_!==void 0?_:{},me,X=!_.document&&!!_.postMessage,M=_.IS_PAPA_WORKER||!1,J={},ge=0,c={};function D(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(s){var n=pe(s);n.chunkSize=parseInt(n.chunkSize),s.step||s.chunk||(n.chunkSize=null),this._handle=new be(n),(this._handle.streamer=this)._config=n}).call(this,t),this.parseChunk=function(s,n){var r=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<r){let d=this._config.newline;d||(i=this._config.quoteChar||'"',d=this._handle.guessLineEndings(s,i)),s=[...s.split(d).slice(r)].join(d)}this.isFirstChunk&&w(this._config.beforeFirstChunk)&&(i=this._config.beforeFirstChunk(s))!==void 0&&(s=i),this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+s,i=(this._partialLine="",this._handle.parse(r,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(s=i.meta.cursor,r=(this._finished||(this._partialLine=r.substring(s-this._baseIndex),this._baseIndex=s),i&&i.data&&(this._rowCount+=i.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),M)_.postMessage({results:i,workerId:c.WORKER_ID,finished:r});else if(w(this._config.chunk)&&!n){if(this._config.chunk(i,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=i=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(i.data),this._completeResults.errors=this._completeResults.errors.concat(i.errors),this._completeResults.meta=i.meta),this._completed||!r||!w(this._config.complete)||i&&i.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),r||i&&i.meta.paused||this._nextChunk(),i}this._halted=!0},this._sendError=function(s){w(this._config.error)?this._config.error(s):M&&this._config.error&&_.postMessage({workerId:c.WORKER_ID,error:s,finished:!1})}}function re(t){var s;(t=t||{}).chunkSize||(t.chunkSize=c.RemoteChunkSize),D.call(this,t),this._nextChunk=X?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(n){this._input=n,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(s=new XMLHttpRequest,this._config.withCredentials&&(s.withCredentials=this._config.withCredentials),X||(s.onload=ae(this._chunkLoaded,this),s.onerror=ae(this._chunkError,this)),s.open(this._config.downloadRequestBody?"POST":"GET",this._input,!X),this._config.downloadRequestHeaders){var n,r=this._config.downloadRequestHeaders;for(n in r)s.setRequestHeader(n,r[n])}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,s.setRequestHeader("Range","bytes="+this._start+"-"+i));try{s.send(this._config.downloadRequestBody)}catch(d){this._chunkError(d.message)}X&&s.status===0&&this._chunkError()}},this._chunkLoaded=function(){s.readyState===4&&(s.status<200||400<=s.status?this._chunkError():(this._start+=this._config.chunkSize||s.responseText.length,this._finished=!this._config.chunkSize||this._start>=(n=>(n=n.getResponseHeader("Content-Range"))!==null?parseInt(n.substring(n.lastIndexOf("/")+1)):-1)(s),this.parseChunk(s.responseText)))},this._chunkError=function(n){n=s.statusText||n,this._sendError(new Error(n))}}function ie(t){(t=t||{}).chunkSize||(t.chunkSize=c.LocalChunkSize),D.call(this,t);var s,n,r=typeof FileReader<"u";this.stream=function(i){this._input=i,n=i.slice||i.webkitSlice||i.mozSlice,r?((s=new FileReader).onload=ae(this._chunkLoaded,this),s.onerror=ae(this._chunkError,this)):s=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var i=this._input,d=(this._config.chunkSize&&(d=Math.min(this._start+this._config.chunkSize,this._input.size),i=n.call(i,this._start,d)),s.readAsText(i,this._config.encoding));r||this._chunkLoaded({target:{result:d}})},this._chunkLoaded=function(i){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(i.target.result)},this._chunkError=function(){this._sendError(s.error)}}function oe(t){var s;D.call(this,t=t||{}),this.stream=function(n){return s=n,this._nextChunk()},this._nextChunk=function(){var n,r;if(!this._finished)return n=this._config.chunkSize,s=n?(r=s.substring(0,n),s.substring(n)):(r=s,""),this._finished=!s,this.parseChunk(r)}}function he(t){D.call(this,t=t||{});var s=[],n=!0,r=!1;this.pause=function(){D.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){D.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(i){this._input=i,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&s.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),s.length?this.parseChunk(s.shift()):n=!0},this._streamData=ae(function(i){try{s.push(typeof i=="string"?i:i.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(s.shift()))}catch(d){this._streamError(d)}},this),this._streamError=ae(function(i){this._streamCleanUp(),this._sendError(i)},this),this._streamEnd=ae(function(){this._streamCleanUp(),r=!0,this._streamData("")},this),this._streamCleanUp=ae(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function be(t){var s,n,r,i,d=Math.pow(2,53),F=-d,$=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,H=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,g=this,S=0,u=0,O=!1,f=!1,p=[],l={data:[],errors:[],meta:{}};function T(y){return t.skipEmptyLines==="greedy"?y.join("").trim()==="":y.length===1&&y[0].length===0}function I(){if(l&&r&&(Q("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),r=!1),t.skipEmptyLines&&(l.data=l.data.filter(function(h){return!T(h)})),P()){let h=function(k,A){w(t.transformHeader)&&(k=t.transformHeader(k,A)),p.push(k)};if(l)if(Array.isArray(l.data[0])){for(var y=0;P()&&y<l.data.length;
vendor: 9,122 bytes, lines 16-24
16y++)l.data[y].forEach(h);l.data.splice(0,1)}else l.data.forEach(h)}function v(h,k){for(var A=t.header?{}:[],b=0;b<h.length;b++){var C=b,x=h[b],x=((Y,m)=>(N=>(t.dynamicTypingFunction&&t.dynamicTyping[N]===void 0&&(t.dynamicTyping[N]=t.dynamicTypingFunction(N)),(t.dynamicTyping[N]||t.dynamicTyping)===!0))(Y)?m==="true"||m==="TRUE"||m!=="false"&&m!=="FALSE"&&((N=>{if($.test(N)&&(N=parseFloat(N),F<N&&N<d))return 1})(m)?parseFloat(m):H.test(m)?new Date(m):m===""?null:m):m)(C=t.header?b>=p.length?"__parsed_extra":p[b]:C,x=t.transform?t.transform(x,C):x);C==="__parsed_extra"?(A[C]=A[C]||[],A[C].push(x)):A[C]=x}return t.header&&(b>p.length?Q("FieldMismatch","TooManyFields","Too many fields: expected "+p.length+" fields but parsed "+b,u+k):b<p.length&&Q("FieldMismatch","TooFewFields","Too few fields: expected "+p.length+" fields but parsed "+b,u+k)),A}var R;l&&(t.header||t.dynamicTyping||t.transform)&&(R=1,!l.data.length||Array.isArray(l.data[0])?(l.data=l.data.map(v),R=l.data.length):l.data=v(l.data,0),t.header&&l.meta&&(l.meta.fields=p),u+=R)}function P(){return t.header&&p.length===0}function Q(y,v,R,h){y={type:y,code:v,message:R},h!==void 0&&(y.row=h),l.errors.push(y)}w(t.step)&&(i=t.step,t.step=function(y){l=y,P()?I():(I(),l.data.length!==0&&(S+=y.data.length,t.preview&&S>t.preview?n.abort():(l.data=l.data[0],i(l,g))))}),this.parse=function(y,v,R){var h=t.quoteChar||'"',h=(t.newline||(t.newline=this.guessLineEndings(y,h)),r=!1,t.delimiter?w(t.delimiter)&&(t.delimiter=t.delimiter(y),l.meta.delimiter=t.delimiter):((h=((k,A,b,C,x)=>{var Y,m,N,ne;x=x||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var ue=0;ue<x.length;ue++){for(var V,xe=x[ue],U=0,a=0,o=0,j=(N=void 0,new le({comments:C,delimiter:xe,newline:A,preview:10}).parse(k)),E=0;E<j.data.length;E++)b&&T(j.data[E])?o++:(V=j.data[E].length,a+=V,N===void 0?N=V:0<V&&(U+=Math.abs(V-N),N=V));0<j.data.length&&(a/=j.data.length-o),(m===void 0||U<=m)&&(ne===void 0||ne<a)&&1.99<a&&(m=U,Y=xe,ne=a)}return{successful:!!(t.delimiter=Y),bestDelimiter:Y}})(y,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=h.bestDelimiter:(r=!0,t.delimiter=c.DefaultDelimiter),l.meta.delimiter=t.delimiter),pe(t));return t.preview&&t.header&&h.preview++,s=y,n=new le(h),l=n.parse(s,v,R),I(),O?{meta:{paused:!0}}:l||{meta:{paused:!1}}},this.paused=function(){return O},this.pause=function(){O=!0,n.abort(),s=w(t.chunk)?"":s.substring(n.getCharIndex())},this.resume=function(){g.streamer._halted?(O=!1,g.streamer.parseChunk(s,!0)):setTimeout(g.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,n.abort(),l.meta.aborted=!0,w(t.complete)&&t.complete(l),s=""},this.guessLineEndings=function(k,h){k=k.substring(0,1048576);var h=new RegExp(B(h)+"([^]*?)"+B(h),"gm"),R=(k=k.replace(h,"")).split("\r"),h=k.split(` 17`),k=1<h.length&&h[0].length<R[0].length;if(R.length===1||k)return` 18`;for(var A=0,b=0;b<R.length;b++)R[b][0]===` 19`&&A++;return A>=R.length/2?`\r 20`:"\r"}}function B(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function le(t){var s=(t=t||{}).delimiter,n=t.newline,r=t.comments,i=t.step,d=t.preview,F=t.fastMode,$=null,H=!1,g=t.quoteChar==null?'"':t.quoteChar,S=g;if(t.escapeChar!==void 0&&(S=t.escapeChar),(typeof s!="string"||-1<c.BAD_DELIMITERS.indexOf(s))&&(s=","),r===s)throw new Error("Comment character same as delimiter");r===!0?r="#":(typeof r!="string"||-1<c.BAD_DELIMITERS.indexOf(r))&&(r=!1),n!==` 21`&&n!=="\r"&&n!==`\r 22`&&(n=` 23`);var u=0,O=!1;this.parse=function(f,p,l){if(typeof f!="string")throw new Error("Input must be a string");var T=f.length,I=s.length,P=n.length,Q=r.length,y=w(i),v=[],R=[],h=[],k=u=0;if(!f)return U();if(F||F!==!1&&f.indexOf(g)===-1){for(var A=f.split(n),b=0;b<A.length;b++){if(h=A[b],u+=h.length,b!==A.length-1)u+=n.length;else if(l)return U();if(!r||h.substring(0,Q)!==r){if(y){if(v=[],ne(h.split(s)),a(),O)return U()}else ne(h.split(s));if(d&&d<=b)return v=v.slice(0,d),U(!0)}}return U()}for(var C=f.indexOf(s,u),x=f.indexOf(n,u),Y=new RegExp(B(S)+B(g),"g"),m=f.indexOf(g,u);;)if(f[u]===g)for(m=u,u++;;){if((m=f.indexOf(g,m+1))===-1)return l||R.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:v.length,index:u}),V();if(m===T-1)return V(f.substring(u,m).replace(Y,g));if(g===S&&f[m+1]===S)m++;else if(g===S||m===0||f[m-1]!==S){C!==-1&&C<m+1&&(C=f.indexOf(s,m+1));var N=ue((x=x!==-1&&x<m+1?f.indexOf(n,m+1):x)===-1?C:Math.min(C,x));if(f.substr(m+1+N,I)===s){h.push(f.substring(u,m).replace(Y,g)),f[u=m+1+N+I]!==g&&(m=f.indexOf(g,u)),C=f.indexOf(s,u),x=f.indexOf(n,u);break}if(N=ue(x),f.substring(m+1+N,m+1+N+P)===n){if(h.push(f.substring(u,m).replace(Y,g)),xe(m+1+N+P),C=f.indexOf(s,u),m=f.indexOf(g,u),y&&(a(),O))return U();if(d&&v.length>=d)return U(!0);break}R.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:v.length,index:u}),m++}}else if(r&&h.length===0&&f.substring(u,u+Q)===r){if(x===-1)return U();u=x+P,x=f.indexOf(n,u),C=f.indexOf(s,u)}else if(C!==-1&&(C<x||x===-1))h.push(f.substring(u,C)),u=C+I,C=f.indexOf(s,u);else{if(x===-1)break;if(h.push(f.substring(u,x)),xe(x+P),y&&(a(),O))return U();if(d&&v.length>=d)return U(!0)}return V();function ne(o){v.push(o),k=u}function ue(o){var j=0;return j=o!==-1&&(o=f.substring(m+1,o))&&o.trim()===""?o.length:j}function V(o){return l||(o===void 0&&(o=f.substring(u)),h.push(o),u=T,ne(h),y&&a()),U()}function xe(o){u=o,ne(h),h=[],x=f.indexOf(n,u)}function U(o){if(t.header&&!p&&v.length&&!H){var j=v[0],E=Object.create(null),Z=new Set(j);let te=!1;for(let se=0;se<j.length;se++){let ee=j[se];if(E[ee=w(t.transformHeader)?t.transformHeader(ee,se):ee]){let ce,L=E[ee];for(;ce=ee+"_"+L,L++,Z.has(ce););Z.add(ce),j[se]=ce,E[ee]++,te=!0,($=$===null?{}:$)[ce]=ee}else E[ee]=1,j[se]=ee;Z.add(ee)}te&&console.warn("Duplicate headers found and renamed."),H=!0}return{data:v,errors:R,meta:{delimiter:s,linebreak:n,aborted:O,truncated:!!o,cursor:k+(p||0),renamedHeaders:$}}}function a(){i(U()),v=[],R=[]}},this.abort=function(){O=!0},this.getCharIndex=function(){return u}}function W(t){var s=t.data,n=J[s.workerId],r=!1;if(s.error)n.userError(s.error,s.file);else if(s.results&&s.results.data){var i={abort:function(){r=!0,fe(s.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:ye,resume:ye};if(w(n.userStep)){for(var d=0;d<s.results.data.length&&(n.userStep({data:s.results.data[d],errors:s.results.errors,meta:s.results.meta},i),!r);d++);delete s.results}else w(n.userChunk)&&(n.userChunk(s.results,i,s.file),delete s.results)}s.finished&&!r&&fe(s.workerId,s.results)}function fe(t,s){var n=J[t];w(n.userComplete)&&n.userComplete(s),n.terminate(),delete J[t]}function ye(){throw new Error("Not implemented.")}function pe(t){if(typeof t!="object"||t===null)return t;var s,n=Array.isArray(t)?[]:{};for(s in t)n[s]=pe(t[s]);return n}function ae(t,s){return function(){t.apply(s,arguments)}}function w(t){return typeof t=="function"}return c.parse=function(t,s){var n=(s=s||{}).dynamicTyping||!1;if(w(n)&&(s.dynamicTypingFunction=n,n={}),s.dynamicTyping=n,s.transform=!!w(s.transform)&&s.transform,!s.worker||!c.WORKERS_SUPPORTED)return n=null,c.NODE_STREAM_INPUT,typeof t=="string"?(t=(r=>r.charCodeAt(0)!==65279?r:r.slice(1))(t),n=new(s.download?re:oe)(s)):t.readable===!0&&w(t.read)&&w(t.on)?n=new he(s):(_.File&&t instanceof File||t instanceof Object)&&(n=new ie(s)),n.stream(t);(n=(()=>{var r;return!!c.WORKERS_SUPPORTED&&(r=(()=>{var i=_.URL||_.webkitURL||null,d=de.toString();return c.BLOB_URL||(c.BLOB_URL=i.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",d,")();"],{type:"text/javascript"})))})(),(r=new _.Worker(r)).onmessage=W,r.id=ge++,J[r.id]=r)})()).userStep=s.step,n.userChunk=s.chunk,n.userComplete=s.complete,n.userError=s.error,s.step=w(s.step),s.chunk=w(s.chunk),s.complete=w(s.complete),s.error=w(s.error),delete s.worker,n.postMessage({input:t,config:s,workerId:n.id})},c.unparse=function(t,s){var n=!1,r=!0,i=",",d=`\r 24`,F='"',$=F+F,H=!1,g=null,S=!1,u=((()=>{if(typeof s=="object"){if(typeof s.delimiter!="string"||c.BAD_DELIMITERS.filter(function(p){return s.delimiter.indexOf(p)!==-1}).length||(i=s.delimiter),typeof s.quotes!="boolean"&&typeof s.quotes!="function"&&!Array.isArray(s.quotes)||(n=s.quotes),typeof s.skipEmptyLines!="boolean"&&typeof s.skipEmptyLines!="string"||(H=s.skipEmptyLines),typeof s.newline=="string"&&(d=s.newline),typeof s.quoteChar=="string"&&(F=s.quoteChar),typeof s.header=="boolean"&&(r=s.header),Array.isArray(s.columns)){if(s.columns.length===0)throw new Error("Option columns is empty");g=s.columns}s.escapeChar!==void 0&&($=s.escapeChar+F),s.escapeFormulae instanceof RegExp?S=s.escapeFormulae:typeof s.escapeFormulae=="boolean"&&s.escapeFormulae&&(S=/^[=+\-@\t\r].*$/)}})(),new RegExp(B(F),"g"));if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return O(null,t,H);if(typeof t[0]=="object")return O(g||Object.keys(t[0]),t,H)}
24else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||g),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||typeof t.data[0]=="object"||(t.data=[t.data])),O(t.fields||[],t.data||[],H);throw new Error("Unable to serialize unrecognized input");function O(p,l,T){var I="",P=(typeof p=="string"&&(p=JSON.parse(p)),typeof l=="string"&&(l=JSON.parse(l)),Array.isArray(p)&&0<p.length),Q=!Array.isArray(l[0]);if(P&&r){for(var y=0;y<p.length;y++)0<y&&(I+=i),I+=f(p[y],y);0<l.length&&(I+=d)}for(var v=0;v<l.length;v++){var R=(P?p:l[v]).length,h=!1,k=P?Object.keys(l[v]).length===0:l[v].length===0;if(T&&!P&&(h=T==="greedy"?l[v].join("").trim()==="":l[v].length===1&&l[v][0].length===0),T==="greedy"&&P){for(var A=[],b=0;b<R;b++){var C=Q?p[b]:b;A.push(l[v][C])}h=A.join("").trim()===""}if(!h){for(var x=0;x<R;x++){0<x&&!k&&(I+=i);var Y=P&&Q?p[x]:x;I+=f(l[v][Y],x)}v<l.length-1&&(!T||0<R&&!k)&&(I+=d)}}return I}function f(p,l){var T,I;return p==null?"":p.constructor===Date?JSON.stringify(p).slice(1,25):(I=!1,S&&typeof p=="string"&&S.test(p)&&(p="'"+p,I=!0),T=p.toString().replace(u,$),(I=I||n===!0||typeof n=="function"&&n(p,l)||Array.isArray(n)&&n[l]||((P,Q)=>{for(var y=0;y<Q.length;y++)if(-1<P.indexOf(Q[y]))return!0;return!1})(T,c.BAD_DELIMITERS)||-1<T.indexOf(i)||T.charAt(0)===" "||T.charAt(T.length-1)===" ")?F+T+F:T)}},c.RECORD_SEP="�",c.UNIT_SEP="�",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",` 25`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!X&&!!_.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=le,c.ParserHandle=be,c.NetworkStreamer=re,c.FileStreamer=ie,c.StringStreamer=oe,c.ReadableStreamStreamer=he,_.jQuery&&((me=_.jQuery).fn.parse=function(t){var s=t.config||{},n=[];return this.each(function(d){if(!(me(this).prop("tagName").toUpperCase()==="INPUT"&&me(this).attr("type").toLowerCase()==="file"&&_.FileReader)||!this.files||this.files.length===0)return!0;for(var F=0;F<this.files.length;F++)n.push({file:this.files[F],inputElem:this,instanceConfig:me.extend({},s)})}),r(),this;function r(){if(n.length===0)w(t.complete)&&t.complete();else{var d,F,$,H,g=n[0];if(w(t.before)){var S=t.before(g.file,g.inputElem);if(typeof S=="object"){if(S.action==="abort")return d="AbortError",F=g.file,$=g.inputElem,H=S.reason,void(w(t.error)&&t.error({name:d},F,$,H));if(S.action==="skip")return void i();typeof S.config=="object"&&(g.instanceConfig=me.extend(g.instanceConfig,S.config))}else if(S==="skip")return void i()}var u=g.instanceConfig.complete;g.instanceConfig.complete=function(O){w(u)&&u(O,g.file,g.inputElem),i()},c.parse(g.file,g.instanceConfig)}}function i(){n.splice(0,1),r()}}),M&&(_.onmessage=function(t){t=t.data,c.WORKER_ID===void 0&&t&&(c.WORKER_ID=t.workerId),typeof t.input=="string"?_.postMessage({workerId:c.WORKER_ID,results:c.parse(t.input,t.config),finished:!0}):(_.File&&t.input instanceof File||t.input instanceof Object)&&(t=c.parse(t.input,t.config))&&_.postMessage({workerId:c.WORKER_ID,results:t,finished:!0})}),(re.prototype=Object.create(D.prototype)).constructor=re,(ie.prototype=Object.create(D.prototype)).constructor=ie,(oe.prototype=Object.create(oe.prototype)).constructor=oe,(he.prototype=Object.create(D.prototype)).constructor=he,c})})(Ve);var St=Ve.exports;const kt=Qe(St);function It(){const{id:G}=Ye(),[,ve]=Ze(),{user:de}=Ge(),{toast:_}=Xe(),[me,X]=q.useState(!1),[M,J]=q.useState(null),[ge,c]=q.useState(""),[D,re]=q.useState([]),[ie,oe]=q.useState(3),[he,be]=q.useState(""),[B,le]=q.useState(!1),[W,fe]=q.useState([]),[ye,pe]=q.useState(""),[ae,w]=q.useState(""),[t,s]=q.useState(null),[n,r]=q.useState([]),[i,d]=q.useState(null),[F,$]=q.useState(!1),[H,g]=q.useState(null),{data:S,isLoading:u}=_e({queryKey:["/api/contact-lists",G],enabled:!!de&&!!G}),{data:O=[],isLoading:f,refetch:p}=_e({queryKey:[`/api/contact-lists/${G}/contacts`],enabled:!!de&&!!G}),{currentPage:l,totalPages:T,startIndex:I,endIndex:P,paginatedItems:Q,handlePreviousPage:y,handleNextPage:v}=gt(O,{itemsPerPage:10}),{data:R=[]}=_e({queryKey:["/api/lists"],enabled:!!de&&M==="search-list"}),{data:h=[]}=_e({queryKey:["/api/companies"],enabled:!!de&&M==="companies"}),{data:k}=_e({queryKey:["/api/contacts"],enabled:!!de&&M==="manual"}),A=(k==null?void 0:k.contacts)||[],b=Ce({mutationFn:async a=>(await ke("POST",`/api/contact-lists/${G}/add-from-search-list`,{searchListId:a})).json(),onSuccess:a=>{_({title:"Success",description:`Added ${a.added} contacts to the list`}),p(),X(!1),J(null),c("")},onError:a=>{_({title:"Error",description:a.message||"Failed to add contacts",variant:"destructive"})}}),C=Ce({mutationFn:async({companyIds:a,maxContacts:o})=>(await ke("POST",`/api/contact-lists/${G}/add-from-companies`,{companyIds:a,maxContactsPerCompany:o})).json(),onSuccess:a=>{_({title:"Success",description:`Added ${a.addedCount||0} contacts to the list`}),p(),X(!1),J(null),re([]),oe(3)},onError:a=>{_({title:"Error",description:a.message||"Failed to add contacts from companies",variant:"destructive"})}}),x=Ce({mutationFn:async a=>(await ke("POST",`/api/contact-lists/${G}/contacts`,{contactIds:a,source:"manual"})).json(),onSuccess:a=>{_({title:"Success",description:`Added ${W.length} contacts to the list`}),p(),X(!1),J(null),fe([]),pe("")},onError:a=>{_({title:"Error",description:a.message||"Failed to add selected contacts",variant:"destructive"})}}),Y=Ce({mutationFn:async a=>(await ke("DELETE",`/api/contact-lists/${G}/contacts`,{contactIds:[a]})).json(),onSuccess:()=>{_({title:"Success",description:"Contact removed from list"}),p()},onError:a=>{_({title:"Error",description:a.message||"Failed to remove contact",variant:"destructive"})}}),m=Ce({mutationFn:async a=>(await ke("POST",`/api/contact-lists/${G}/import-csv`,{contacts:a})).json(),onSuccess:a=>{_({title:"Success",description:`Successfully imported ${a.imported||0} contacts`}),p(),X(!1),J(null),w(""),s(null),r([]),d(null)},onError:a=>{_({title:"Error",description:a.message||"Failed to import contacts",variant:"destructive"})}}),N=a=>{try{d(null);const o=a.trim().split(` 26`),j=o[0]||"",E=j.toLowerCase().includes("name")||j.toLowerCase().includes("email")||j.toLowerCase().includes("company");let Z=a;if(!E&&o.length>0){const L=j.split(",").map(K=>K.trim());if(L.length>=2&&L[0].includes("@")){let K="email, first_name";L.length===3?K="email, first_name, last_name":L.length===4?K="email, first_name, last_name, company":L.length===5?K="email, first_name, last_name, company, role":L.length>=6&&(K="email, first_name, last_name, company, role, city"),Z=K+` 27`+a}}const te=kt.parse(Z,{header:!0,skipEmptyLines:!0,transformHeader:L=>L.toLowerCase().trim().replace(" ","_")});if(te.errors.length>0){const L=te.errors.filter(K=>K.code!=="TooFewFields");if(L.length>0){const K=L[0];d(`CSV parsing error at row ${K.row}: ${K.message}`);return}}if(te.data.length===0){d("CSV must contain at least one data row");return}const se=["email","first_name"],ee=Object.keys(te.data[0]||{});for(const L of se)if(!ee.includes(L)){d(`Missing required header: ${L}`);return}const ce=[];for(const L of te.data){const K=(L.email||"").toString().trim(),Ne=(L.first_name||"").toString().trim(),Le=(L.last_name||"").toString().trim(),Oe=(L.company||"").toString().trim(),Ae=(L.role||"").toString().trim(),Te=(L.city||"").toString().trim();if(!K||!Ne)continue;const Ke={name:Le?`${Ne} ${Le}`.trim():Ne,email:K,...Oe&&{company:Oe},...Ae&&{role:Ae},...Te&&{city:Te}};ce.push(Ke)}if(ce.length===0){d("No valid contacts found in CSV (all rows missing required fields: email and/or first_name)");return}r(ce)}catch(o){d(`Failed to parse CSV: ${o instanceof Error?o.message:"Unknown error"}`)}},ne=a=>{var j;const o=(j=a.target.files)==null?void 0:j[0];if(o){s(o);const E=new FileReader;E.onload=Z=>{var se;const te=(se=Z.target)==null?void 0:se.result;w(te),N(te)},E.readAsText(o)}},ue=()=>{const a=`email,first_name,last_name,company,role,city 28[email protected],John,Doe,Acme Inc,CEO,New York 29[email protected],Jane,Smith,Tech Corp,CTO,Boston 30[email protected],Bob,Johnson,StartupCo,VP Sales,Austin`,o=new Blob([a],{type:"text/csv;charset=utf-8;"}),j=URL.createObjectURL(o),E=document.createElement("a");E.href=j,E.download="contacts_import_template.csv",document.body.appendChild(E),E.click(),document.body.removeChild(E),URL.revokeObjectURL(j)},V=()=>{M==="search-list"&&ge?(le(!0),b.mutate(parseInt(ge))):M==="companies"&&D.length>0?(le(!0),C.mutate({companyIds:D.map(a=>parseInt(a)),maxContacts:ie})):M==="manual"&&W.length>0?(le(!0),x.mutate(W)):M==="import-csv"&&n.length>0&&(le(!0),m.mutate(n))},xe=a=>{g(a),$(!0)},U=()=>{H&&Y.mutate(H),$(!1),g(null)};return q.useEffect(()=>{(b.isSuccess||b.isError||C.isSuccess||C.isError||x.isSuccess||x.isError||m.isSuccess||m.isError)&&le(!1)},[b.isSuccess,b.isError,C.isSuccess,C.isError,x.isSuccess,x.isError,m.isSuccess,m.
30isError]),u||f?e.jsx("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(Re,{className:"h-8 w-32"}),e.jsx(Re,{className:"h-12 w-full"}),e.jsx(Re,{className:"h-64 w-full"})]})}):S?e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs(z,{variant:"ghost",onClick:()=>ve("/contacts"),"data-testid":"button-back",children:[e.jsx(Fe,{className:"h-4 w-4 mr-2"}),"Back to Contacts"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(yt,{variant:"secondary",className:"text-sm",children:[e.jsx(Ee,{className:"h-3 w-3 mr-1"}),O.length," contact",O.length!==1?"s":""]}),e.jsxs(z,{onClick:()=>X(!0),className:"bg-blue-600 hover:bg-blue-700 text-white","data-testid":"button-add-contacts",children:[e.jsx(Me,{className:"h-4 w-4 mr-2"}),"Add Contacts"]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold","data-testid":"text-list-name",children:S.name}),S.description&&e.jsx("p",{className:"text-muted-foreground mt-2","data-testid":"text-list-description",children:S.description})]}),e.jsx(Ie,{children:e.jsxs(De,{className:"pt-6",children:[O.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ee,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"No contacts in this list yet"}),e.jsxs(z,{variant:"outline",onClick:()=>X(!0),"data-testid":"button-add-first-contacts",children:[e.jsx(Me,{className:"h-4 w-4 mr-2"}),"Add Your First Contacts"]})]}):e.jsxs(et,{children:[e.jsx(tt,{children:e.jsxs(Pe,{children:[e.jsx(we,{children:"Name"}),e.jsx(we,{children:"Email"}),e.jsx(we,{children:"Company"}),e.jsx(we,{children:"Role"}),e.jsx(we,{className:"text-right",children:"Actions"})]})}),e.jsx(st,{children:Q.map(a=>{var o;return e.jsxs(Pe,{"data-testid":`row-contact-${a.id}`,children:[e.jsx(Se,{className:"font-medium",children:a.name}),e.jsx(Se,{children:a.email?e.jsx("span",{className:"text-sm",children:a.email}):e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Se,{children:(o=a.company)!=null&&o.name?e.jsx("span",{children:a.company.name}):e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Se,{children:a.role?e.jsx("span",{children:a.role}):e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Se,{className:"text-right",children:e.jsx(z,{variant:"ghost",size:"sm",onClick:()=>xe(a.id),disabled:Y.isPending,"data-testid":`button-remove-${a.id}`,children:e.jsx(jt,{className:"h-4 w-4 text-red-500"})})})]},a.id)})})]}),T>1&&e.jsxs("div",{className:"flex items-center justify-between px-2 py-4 border-t mt-4",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Viewing ",I+1,"â",Math.min(P,O.length)," over"," ",O.length," results"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(z,{variant:"outline",size:"sm",onClick:y,disabled:l===1,"data-testid":"button-previous-page",children:[e.jsx(vt,{className:"w-4 h-4 mr-1"}),"Previous"]}),e.jsxs(z,{variant:"outline",size:"sm",onClick:v,disabled:l===T,"data-testid":"button-next-page",children:["Next",e.jsx(at,{className:"w-4 h-4 ml-1"})]})]})]})]})}),e.jsx(nt,{open:me,onOpenChange:X,children:e.jsxs(rt,{className:"sm:max-w-[500px]",children:[e.jsxs(it,{children:[e.jsx(ot,{children:"Add Contacts to List"}),e.jsx(lt,{children:"Choose how you want to add contacts to this list"})]}),M?e.jsxs("div",{className:"space-y-4 py-4",children:[M==="search-list"&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Select a Search List"}),e.jsxs(Ue,{value:ge,onValueChange:c,children:[e.jsx($e,{"data-testid":"select-search-list",children:e.jsx(qe,{placeholder:"Choose a search list..."})}),e.jsx(ze,{children:R.length===0?e.jsx("div",{className:"p-2 text-sm text-muted-foreground",children:"No search lists available"}):R.map(a=>e.jsxs(je,{value:a.listId.toString(),"data-testid":`option-list-${a.listId}`,children:[a.prompt," (",a.resultCount," results)"]},a.id))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This will add all contacts from the selected search list"})]})}),M==="companies"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",children:"Search Companies"}),e.jsx(Be,{type:"text",placeholder:"Search by company name...",value:he,onCh
30ange:a=>be(a.target.value),className:"mt-2"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",children:"Select Companies"}),e.jsxs("div",{className:"mt-2 max-h-64 overflow-y-auto border rounded-md p-2",children:[h.filter(a=>{var o;return(o=a.name)==null?void 0:o.toLowerCase().includes(he.toLowerCase())}).map(a=>e.jsxs("div",{className:"flex items-center p-2 hover:bg-gray-50",children:[e.jsx("input",{type:"checkbox",id:`company-${a.id}`,checked:D.includes(a.id.toString()),onChange:o=>{o.target.checked?re([...D,a.id.toString()]):re(D.filter(j=>j!==a.id.toString()))},className:"mr-2"}),e.jsxs("label",{htmlFor:`company-${a.id}`,className:"flex-1 cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:a.name}),a.description&&e.jsxs("span",{className:"text-sm text-gray-500 ml-2",children:["- ",a.description.substring(0,50),"..."]})]})]},a.id)),h.filter(a=>{var o;return(o=a.name)==null?void 0:o.toLowerCase().includes(he.toLowerCase())}).length===0&&e.jsx("p",{className:"text-sm text-muted-foreground p-2",children:"No companies found"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",children:"Max Contacts Per Company"}),e.jsxs(Ue,{value:ie.toString(),onValueChange:a=>oe(parseInt(a)),children:[e.jsx($e,{className:"mt-2",children:e.jsx(qe,{})}),e.jsxs(ze,{children:[e.jsx(je,{value:"1",children:"1 contact"}),e.jsx(je,{value:"2",children:"2 contacts"}),e.jsx(je,{value:"3",children:"3 contacts"}),e.jsx(je,{value:"5",children:"5 contacts"}),e.jsx(je,{value:"10",children:"10 contacts"})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Will add the top ",ie," contact",ie>1?"s":""," from each selected company"]})]}),D.length>0&&e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Selected: ",D.length," ",D.length===1?"company":"companies"]})]}),M==="manual"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",children:"Search Contacts"}),e.jsx(Be,{type:"text",placeholder:"Search by name, email, or company...",value:ye,onChange:a=>pe(a.target.value),className:"mt-2"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",children:"Select Contacts"}),e.jsxs("div",{className:"mt-2 max-h-64 overflow-y-auto border rounded-md p-2",children:[A.filter(a=>{var j,E,Z;const o=ye.toLowerCase();return((j=a.name)==null?void 0:j.toLowerCase().includes(o))||((E=a.email)==null?void 0:E.toLowerCase().includes(o))||((Z=a.companyName)==null?void 0:Z.toLowerCase().includes(o))}).map(a=>e.jsxs("div",{className:"flex items-center p-2 hover:bg-gray-50",children:[e.jsx("input",{type:"checkbox",id:`contact-${a.id}`,checked:W.includes(a.id),onChange:o=>{o.target.checked?fe([...W,a.id]):fe(W.filter(j=>j!==a.id))},className:"mr-2"}),e.jsxs("label",{htmlFor:`contact-${a.id}`,className:"flex-1 cursor-pointer",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:a.name}),a.email&&e.jsxs("span",{className:"text-sm text-gray-500 ml-2",children:["- ",a.email]})]}),a.companyName&&e.jsx("div",{className:"text-xs text-gray-500",children:a.companyName})]})]},a.id)),A.filter(a=>{var j,E,Z;const o=ye.toLowerCase();return((j=a.name)==null?void 0:j.toLowerCase().includes(o))||((E=a.email)==null?void 0:E.toLowerCase().includes(o))||((Z=a.companyName)==null?void 0:Z.toLowerCase().includes(o))}).length===0&&e.jsx("p",{className:"text-sm text-muted-foreground p-2",children:A.length===0?"Loading contacts...":"No contacts found"})]})]}),W.length>0&&e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Selected: ",W.length," ",W.length===1?"contact":"contacts"]})]}),M==="import-csv"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",children:"CSV Format Requirements"}),e.jsxs("div",{className:"mt-2 p-3 bg-gray-50 rounded-md text-xs text-gray-600",children:[e.jsx("code",{children:"email, first_name, last_name, company, role, city"}),e.jsx("p",{className:"mt-2",children:"Simple examples (headers auto-added):"}),e.jsx("code",{className:"block",children:"[email protected], John"}),e.jsx("code",{className:"block",children:"[email protected], Jane, Smith, Acme Inc, CEO, NYC"}),e.jsx("p",{className:"mt-2 text-green-600",children:"â Only email and first name are required!"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",children:"Paste CSV Data"}),e.jsx("textarea",{placeholder:`Paste your CSV data here... 31Examples: 32[email protected], John 33[email protected], Jane, Smith 34[email protected], Bob, Johnson, Acme Inc, CEO, NYC 35 36Or with headers: 37email, first_name, last_name, company, role, city 38[email protected], Alice, Lee, Tech Corp, CTO, Boston`,value:ae,onChange:a=>{w(a.target.value),a.target.value?N(a.target.value):(r([]),d(null))},className:"mt-2 w-full h-32 p-2 border rounded-md font-mono text-sm"})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-1 border-t"}),e.jsx("span",{className:"px-2 text-sm text-gray-500",children:"OR"}),e.jsx("div",{className:"flex-1 border-t"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",children:"Upload CSV File"}),e.jsxs("div",{className:"mt-2",children:[e.jsxs("label",{htmlFor:"csv-upload",className:"flex items-center justify-center w-full p-4 border-2 border-dashed rounded-md cursor-pointer hover:border-gray-400 transition-colors",children:[e.jsx(_t,{className:"h-5 w-5 mr-2 text-gray-400"}),e.jsx("span",{className:"text-sm text-gray-600",children:t?t.name:"Choose CSV file or drag and drop"})]}),e.jsx("input",{id:"csv-upload",type:"file",accept:".csv,text/csv",onChange:ne,className:"hidden"})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground mt-2",children:e.jsx("button",{type:"button",onClick:ue,className:"text-blue-600 hover:text-blue-700 underline",children:"Download CSV template"})})]}),i&&e.jsx("div",{className:"p-3 bg-red-50 text-red-700 rounded-md text-sm",children:i}),n.length>0&&!i&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm font-medium text-green-600",children:["â Successfully parsed ",n.length," contact",n.length!==1?"s":""]}),e.jsx("div",{className:"max-h-40 overflow-y-auto border rounded-md p-2",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-left p-1",children:"Name"}),e.jsx("th",{className:"text-left p-1",children:"Email"}),e.jsx("th",{className:"text-left p-1",children:"Company"})]})}),e.jsxs("tbody",{children:[n.slice(0,5).map((a,o)=>e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"p-1",children:a.name}),e.jsx("td",{className:"p-1",children:a.email}),e.jsx("td",{className:"p-1",children:a.company||"-"})]},o)),n.length>5&&e.jsx("tr",{children:e.jsxs("td",{colSpan:3,className:"p-1 text-center text-gray-500",children:["...and ",n.length-5," more"]})})]})]})})]})]}),e.jsxs("div",{className:"flex justify-between pt-4",children:[e.jsx(z,{variant:"outline",onClick:()=>{J(null),c(""),re([]),be(""),oe(3),fe([]),pe(""),w(""),s(null),r([]),d(null)},disabled:B,"data-testid":"button-back-to-methods",children:"Back"}),M==="search-list"&&e.jsx(z,{onClick:V,disabled:!ge||B,className:"bg-blue-600 hover:bg-blue-700 text-white","data-testid":"button-confirm-ad
38d",children:B?"Adding...":"Add Contacts"}),M==="companies"&&e.jsx(z,{onClick:V,disabled:D.length===0||B,className:"bg-blue-600 hover:bg-blue-700 text-white","data-testid":"button-confirm-add-companies",children:B?"Adding...":`Add Contacts from ${D.length} ${D.length===1?"Company":"Companies"}`}),M==="manual"&&e.jsx(z,{onClick:V,disabled:W.length===0||B,className:"bg-blue-600 hover:bg-blue-700 text-white","data-testid":"button-confirm-add-manual",children:B?"Adding...":`Add ${W.length} Selected ${W.length===1?"Contact":"Contacts"}`}),M==="import-csv"&&e.jsx(z,{onClick:V,disabled:n.length===0||B,className:"bg-blue-600 hover:bg-blue-700 text-white","data-testid":"button-confirm-import-csv",children:B?"Importing...":`Import ${n.length} Contact${n.length!==1?"s":""}`})]})]}):e.jsxs("div",{className:"space-y-3 py-4",children:[e.jsxs(z,{variant:"outline",className:"w-full justify-start",onClick:()=>J("search-list"),"data-testid":"button-add-from-search",children:[e.jsx(Ee,{className:"h-4 w-4 mr-2"}),"Add from Search List",e.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Import from existing searches"})]}),e.jsxs(z,{variant:"outline",className:"w-full justify-start",onClick:()=>J("companies"),"data-testid":"button-add-from-companies",children:[e.jsx(bt,{className:"h-4 w-4 mr-2"}),"Add from Companies",e.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Top 3 contacts per company"})]}),e.jsxs(z,{variant:"outline",className:"w-full justify-start",onClick:()=>J("manual"),"data-testid":"button-add-manually",children:[e.jsx(wt,{className:"h-4 w-4 mr-2"}),"Add Manually",e.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Select individual contacts"})]}),e.jsxs(z,{variant:"outline",className:"w-full justify-start",onClick:()=>J("import-csv"),"data-testid":"button-import-csv",children:[e.jsx(Ct,{className:"h-4 w-4 mr-2"}),"Paste or Import",e.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Bulk import from CSV"})]})]})]})}),e.jsx(ct,{open:F,onOpenChange:$,children:e.jsxs(dt,{children:[e.jsxs(ht,{children:[e.jsx(ut,{children:"Remove Contact"}),e.jsx(mt,{children:"Are you sure you want to remove this contact from the list? This action cannot be undone."})]}),e.jsxs(ft,{children:[e.jsx(pt,{onClick:()=>g(null),children:"Cancel"}),e.jsx(xt,{onClick:U,className:"bg-red-600 hover:bg-red-700 text-white",children:"Remove"})]})]})})]}):e.jsx("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:e.jsx(Ie,{children:e.jsxs(De,{className:"py-8 text-center",children:[e.jsx("p",{className:"text-muted-foreground",children:"Contact list not found"}),e.jsxs(z,{variant:"outline",className:"mt-4",onClick:()=>ve("/contacts"),"data-testid":"button-back-to-contacts",children:[e.jsx(Fe,{className:"h-4 w-4 mr-2"}),"Back to Contacts"]})]})})})}export{It as default};
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.