PageSourceSearch

https://www.volumn.ai/_next/static/chunks/24375.048f70bacf1d78e1.js

js volumn.ai collected 2026-10-01 16:18:30 UTC 29,321 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[24375],{24375:(e,t,r)=>{r.d(t,{A:()=>w});var n=r(53757),i=r(24361),a=r(58428),s=r(96782),l=r(79428),o=r(29978),d=r(70145);let c=[{username:"elonmusk",profileUrl:"https://x.com/elonmusk",name:"Elon Musk"},{username:"sama",profileUrl:"https://x.com/sama",name:"Sam Altman"}];function u(e){return!e||"object"!=typeof e||Array.isArray(e)?null:e}function m(e){return"string"==typeof e?e:null==e?"":String(e)}function h(e){return m(e).trim()||null}function x(e){if(null==e||"string"==typeof e&&""===e.trim())return null;if("number"==typeof e&&Number.isFinite(e))return e;let t=Number(e);return Number.isFinite(t)?t:null}function b(e){let t=m(e).trim().replace(/^@+/,"");return t?t.toLowerCase():null}function p(e){let t=m(e).trim();if(!t)return null;try{let e=new URL(t),r=e.hostname.toLowerCase();if(!/(^|\.)x\.com$/.test(r)&&!/(^|\.)twitter\.com$/.test(r))return null;let n=(e.pathname.split("/").filter(Boolean)[0]??"").replace(/^@+/,"").trim();if(!n||["i","home","search","intent","share","explore","hashtag"].includes(n.toLowerCase()))return null;return/^[A-Za-z0-9_]{1,15}$/.test(n)?n:null}catch{return null}}function f(e){let t=p(e);if(t)return t;let r=m(e).trim();if(!r)return null;let n=r.replace(/^@+/,"").trim();return/^[A-Za-z0-9_]{1,15}$/.test(n)?n:null}function z(e,t){let r=new Map;for(let t of e)r.set(t.participantId,t);for(let e of t)r.set(e.participantId,e);return Array.from(r.values())}function g(e){let t=m(e.participantId).trim();return t?{participantId:t,username:b(e.username),name:h(e.name),profileUrl:h(e.profileUrl),avatarUrl:h(e.avatarUrl),bio:h(e.bio),language:h(e.language),followersCount:x(e.followersCount),matchScore:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(let e of t){let t=x(e);if(null!==t)return t}return null}(e.matchScore,e.leadScore,e.score),verified:!!e.verified,stage:"new",updatedAt:new Date().toISOString()}:null}async function k(){return await Promise.all([r.e(8430),r.e(93914)]).then(r.bind(r,91242))}async function v(e){return e?await e()??null:(await (0,d.oC)({timeoutMs:6e3,retries:1,retryDelayMs:350})).accessToken??null}function w(e){let{isOpen:t,onClose:r,uiLang:d,resolveApiAccessToken:w,onCreated:y}=e,[j,N]=(0,i.useState)(""),[S,C]=(0,i.useState)("select"),[_,I]=(0,i.useState)("search"),[A,$]=(0,i.useState)(""),[U,E]=(0,i.useState)(!1),[L,R]=(0,i.useState)(!1),[M,D]=(0,i.useState)(null),[X,B]=(0,i.useState)([]),[P,W]=(0,i.useState)([]),[T,O]=(0,i.useState)(!1),[F,V]=(0,i.useState)(null),[q,G]=(0,i.useState)(null),[K,Y]=(0,i.useState)(!1),[Z,J]=(0,i.useState)(null),H=(0,i.useRef)(null),Q=(0,i.useRef)(null);(0,i.useEffect)(()=>{t&&(N(""),C("select"),I("search"),$(""),E(!1),R(!1),D(null),B([]),W([]),O(!1),V(null),G(null),Y(!1),J(null))},[t]);let ee="zh"===d?"确认并创建列表":"Review and create",et=P.length>0,er=U||!!M||L,en=(0,i.useCallback)(()=>{K||r()},[K,r]),ei=(0,i.useCallback)(async()=>{let e=A.trim();if(e&&!U){E(!0),R(!1),D(null);try{let t=await v(w),r=new URLSearchParams;r.set("query",e),r.set("limit","20");let n=await fetch(`/api/promotion/auto-dm/search-users?${r.toString()}`,{method:"GET",headers:t?{Authorization:`Bearer ${t}`}:{},credentials:"include",cache:"no-store"}),i=await n.json().catch(()=>null),a=u(i),s=!!a?.ok,l=a?.items;if(!n.ok||!s||!Array.isArray(l)){let e=m(a?.error).trim();throw Error(e||("zh"===d?"搜索失败":"Search failed"))}let o=l.map(e=>u(e)).filter(Boolean).map(e=>g(e)).filter(Boolean);B(o),R(!0)}catch(e){D(e instanceof Error?e.message:"zh"===d?"搜索失败":"Search failed"),B([]),R(!0)}finally{E(!1)}}},[A,U,w,d]),ea=(0,i.useCallback)(e=>{W(t=>t.some(t=>t.participantId===e.participantId)?t.filter(t=>t.participantId!==e.participantId):[...t,e]),R(!1),D(null)},[]);(0,i.useEffect)(()=>{if(!t)return;let e=U||!!M||L;if("select"!==S||"search"!==_||!e)return;let r=e=>{let t=e.target;!t||Q.current?.contains(t)||(R(!1),D(null))};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[t,_,M,L,U,S]);let es=(0,i.useCallback)(async e=>{let t=c.map(e=>({username:e.username,profileUrl:e.profileUrl,name:e.name})),r="zh"===d?"联系人导入示例":"contacts-import-example";if("csv"===e){var n;let e,i,a;return void(e=new Blob([[(n={fileName:`${r}.csv`,header:["username","profileUrl","name"],rows:t.map(e=>[e.username,e.profileUrl,e.name])}).header.join(","),...n.rows.map(e=>e.map(e=>`"${String(e).replaceAll('"','""')}"`).join(","))].join("\n")],{type:"text/csv;charset=utf-8"}),i=URL.createObjectURL(e),(a=document.createElement("a")).href=i,a.download=n.fileName,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i))}let i=await k(),a=i.utils.book_new(),s=i.utils.json_to_sheet(t);i.utils.book_append_sheet(a,s,"Contacts"),i.writeFile(a,`${r}.xlsx`)},[d]),el=(0,i.useCallback)(async e=>{if(!T&&!K){O(!0),V(null),G(null),J(null);try{let t=await k(),r=await e.arrayBuffer(),n=t.read(r,{type:"array"}),i=n.SheetNames[0];if(!i)throw Error("zh"===d?"文件中没有可读取的工作表":"No readable worksheet found");let a=n.Sheets[i],s=t.utils.sheet_to_json(a,{header:1,defval:"",blankrows:!1}),l=function(e){if(!Array.isArray(e)||0===e.length)return[];let t=(Array.isArray(e[0])?e[0]:[]).map(e=>m(e).trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")),r=t.some(e=>["username","handle","screen_name","twitter","twitter_username","x","x_username","profile_url","url","link","participant_id","user_id","rest_id","id","name","display_name"].includes(e)),n=t.map((e,t)=>["username","handle","screen_name","twitter","twitter_username","x","x_username","account"].includes(e)?t:-1).filter(e=>e>=0),i=t.map((e,t)=>["profile_url","url","link","twitter_url","x_url","profile"].includes(e)?t:-1).filter(e=>e>=0),a=t.map((e,t)=>["participant_id","participantid","user_id","userid","rest_id","restid","twitter_id","x_id"].includes(e)?t:-1).filter(e=>e>=0),s=t.map((e,t)=>["name","display_name","displayname","full_name","fullname"].includes(e)?t:-1).filter(e=>e>=0),l=r?e.slice(1):e,o=new Set,d=[];return l.forEach((e,t)=>{if(!Array.isArray(e))return;let l=null,c=null,u=null,m=null;if(r){for(let t of a){let r=h(e[t]);if(r){l=r;break}}for(let t of n){let r=f(e[t]);if(r){c=r;break}}for(let t of i){let r=h(e[t]);if(r){m=r,c||(c=f(r));break}}for(let t of s){let r=h(e[t]);if(r){u=r;break}}}if(!l&&!c)for(let t of e){if(!m){let e=h(t);if(e&&p(e)){m=e,c=p(e);break}}let e=f(t);if(e){c=e;break}}if(!l&&!c)return;let x=l?`id:${l}
1`:`handle:${(c??"").toLowerCase()}`;!x||o.has(x)||(o.add(x),d.push({participantId:l,username:c,name:u,profileUrl:m,rowNumber:t+(r?2:1)}))}),d}(s);if(0===l.length)throw Error("zh"===d?"未识别到可导入的 X 用户,请至少提供 username、profileUrl 或 userId 列":"No importable X users found. Please provide at least username, profileUrl, or userId columns");let o=l.filter(e=>e.participantId).map(e=>({participantId:e.participantId,username:e.username,name:e.name,profileUrl:function(e,t,r){let n=h(r);if(n)return n;let i=b(t);if(i)return`https://x.com/${encodeURIComponent(i)}`;let a=h(e);return a?`https://x.com/i/user/${encodeURIComponent(a)}`:null}(e.participantId,e.username,e.profileUrl),avatarUrl:null,bio:null,language:null,followersCount:null,verified:!1,stage:"new",updatedAt:new Date().toISOString()})),c=Array.from(new Set(l.filter(e=>!e.participantId&&e.username).map(e=>b(e.username)).filter(Boolean))),x=await v(w),y=[],j=[];for(let e of c){let t=new URLSearchParams;t.set("query",e),t.set("limit","1");let r=await fetch(`/api/promotion/auto-dm/search-users?${t.toString()}`,{method:"GET",headers:x?{Authorization:`Bearer ${x}`}:{},credentials:"include",cache:"no-store"}),n=await r.json().catch(()=>null),i=u(n),a=Array.isArray(i?.items)?i.items:[];if(!r.ok||!i?.ok){let e=m(i?.error).trim();throw Error(e||("zh"===d?"导入识别失败":"Import lookup failed"))}let s=a.map(e=>u(e)).filter(Boolean).map(e=>g(e)).find(t=>b(t?.username)===e)??null;s?y.push(s):j.push(e)}let N=z(o,y),S=z(P,N),_=Math.max(0,S.length-P.length),I=S.length;W(S),G({fileName:e.name,detectedCount:l.length,matchedCount:N.length,addedCount:_,totalSelectedCount:I,unresolved:j}),I>0&&C("review")}catch(e){V(e instanceof Error?e.message:"zh"===d?"导入失败,请重试":"Import failed, please try again")}finally{O(!1)}}},[T,K,P,w,d]),eo=(0,i.useCallback)(async()=>{if(!K){if(!j.trim())return void J("zh"===d?"请填写列表名称":"Please enter a list name");if(0===P.length)return void J("zh"===d?"请先选择用户":"Please select users");Y(!0),J(null);try{let e=await v(w),t=P.map(e=>({participantId:e.participantId,username:e.username,name:e.name,profileUrl:e.profileUrl,avatarUrl:e.avatarUrl,bio:e.bio??null,language:e.language??null,followersCount:e.followersCount??null,matchScore:e.matchScore??null,verified:e.verified,stage:"new",updatedAt:e.updatedAt??new Date().toISOString()})),n=await fetch("/api/promotion/auto-dm/lists",{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:`Bearer ${e}`}:{}},credentials:"include",body:JSON.stringify({name:j.trim(),users:t})}),i=await n.json().catch(()=>null),a=u(i),s=!!a?.ok,l=u(a?.item);if(!n.ok||!s||!l){let e=m(a?.error).trim();throw Error(e||("zh"===d?"创建失败":"Failed to create list"))}let o={id:m(l.id).trim(),name:m(l.name).trim(),userCount:Math.max(0,Math.floor(x(l.userCount)??P.length))};y&&await y(o),r()}catch(e){J(e instanceof Error?e.message:"zh"===d?"操作失败":"Request failed")}finally{Y(!1)}}},[j,K,P,r,y,w,d]);return(0,i.useMemo)(()=>!t||"u"<typeof document?null:(0,a.createPortal)((0,n.jsx)("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-slate-950/45 p-4 backdrop-blur-sm sm:p-6",onMouseDown:e=>{e.target===e.currentTarget&&en()},children:(0,n.jsx)("div",{className:"flex min-h-full items-start justify-center py-4 sm:py-8",children:(0,n.jsxs)("div",{className:"flex max-h-[calc(100vh-2rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[28px] border border-zinc-200 bg-white shadow-2xl shadow-black/10 dark:border-zinc-800 dark:bg-zinc-950 dark:shadow-black/30 sm:max-h-[calc(100vh-4rem)]",children:[(0,n.jsxs)("div",{className:"border-b border-zinc-200 px-5 py-4 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsx)("div",{className:"min-w-0",children:(0,n.jsx)("div",{className:"text-base font-semibold text-zinc-900 dark:text-zinc-100",children:"zh"===d?"新建列表":"Create list"})}),(0,n.jsx)("button",{type:"button",onClick:en,className:"rounded-lg p-1.5 text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-900 dark:hover:text-zinc-100",children:(0,n.jsx)(s.A,{className:"h-5 w-5"})})]}),(0,n.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-2",children:[(0,n.jsxs)("div",{className:["rounded-xl border px-3 py-3 transition-colors","select"===S?"border-zinc-300 bg-zinc-50 text-zinc-900 dark:border-zinc-700 dark:bg-zinc-900/70 dark:text-zinc-100":"border-zinc-200 bg-white text-zinc-500 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-400"].join(" "),children:[(0,n.jsx)("div",{className:"text-xs font-semibold",children:"zh"===d?"步骤 1":"Step 1"}),(0,n.jsx)("div",{className:"mt-1 text-sm font-semibold",children:"zh"===d?"搜索或导入用户":"Search or import users"})]}),(0,n.jsxs)("div",{className:["rounded-xl border px-3 py-3 transition-colors","review"===S?"border-zinc-300 bg-zinc-50 text-zinc-900 dark:border-zinc-700 dark:bg-zinc-900/70 dark:text-zinc-100":"border-zinc-200 bg-white text-zinc-500 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-400"].join(" "),children:[(0,n.jsx)("div",{className:"text-xs font-semibold",children:"zh"===d?"步骤 2":"Step 2"}),(0,n.jsx)("div",{className:"mt-1 text-sm font-semibold",children:ee})]})]})]}),(0,n.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-5 py-5",children:[(0,n.jsx)("input",{ref:H,type:"file",accept:".csv,.xlsx,.xls",className:"hidden",onChange:e=>{let t=e.target.files?.[0];e.currentTarget.value="",t&&el(t)}}),Z?(0,n.jsx)("div",{className:"mb-4 rounded-xl border border-rose-200 bg-rose-50 px-3 py-2 text-sm font-semibold text-rose-700 dark:border-rose-500/40 dark:bg-rose-500/10 dark:text-rose-200",children:Z}
1):null,"select"===S?(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"zh"===d?"先选择要加入列表的用户":"Choose users for this list first"}),(0,n.jsx)("div",{className:"mt-1 text-xs font-medium text-zinc-500 dark:text-zinc-400",children:"zh"===d?"先完成搜索或导入,确认选中用户后,再进入下一步创建列表。":"Finish searching or importing users first, then continue to create the list."})]}),(0,n.jsxs)("div",{className:"shrink-0 rounded-full border border-zinc-200 bg-zinc-50 px-3 py-1 text-xs font-semibold text-zinc-700 dark:border-zinc-700 dark:bg-zinc-900/70 dark:text-zinc-200",children:["zh"===d?"已选":"Selected"," ",P.length]})]}),(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400",children:"zh"===d?"添加方式":"Add method"}),(0,n.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>I("search"),className:["rounded-xl border px-3 py-3 text-sm font-semibold transition-colors","search"===_?"border-zinc-900 bg-zinc-900 text-white hover:bg-zinc-800 dark:border-zinc-100 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200":"border-zinc-200 bg-white text-zinc-700 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-200 dark:hover:bg-zinc-900"].join(" "),children:"zh"===d?"手动搜索":"Manual search"}),(0,n.jsx)("button",{type:"button",onClick:()=>I("import"),className:["rounded-xl border px-3 py-3 text-sm font-semibold transition-colors","import"===_?"border-zinc-900 bg-zinc-900 text-white hover:bg-zinc-800 dark:border-zinc-100 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200":"border-zinc-200 bg-white text-zinc-700 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-200 dark:hover:bg-zinc-900"].join(" "),children:"zh"===d?"导入文档":"Import file"})]})]}),"search"===_?(0,n.jsxs)("div",{ref:Q,className:"rounded-xl border border-zinc-200 bg-zinc-50 p-4 dark:border-zinc-800 dark:bg-zinc-900/40",children:[(0,n.jsx)("div",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"zh"===d?"搜索用户":"Search users"}),(0,n.jsx)("div",{className:"mt-1 text-xs font-medium text-zinc-500 dark:text-zinc-400",children:"zh"===d?"输入用户名(不含@)或关键词":"Enter a username (no @) or keywords"}),(0,n.jsxs)("div",{className:"relative mt-3 flex gap-2",children:[(0,n.jsx)("input",{value:A,onChange:e=>{$(e.target.value),R(!1),D(null),B([])},onKeyDown:e=>{"Enter"===e.key&&ei()},className:"h-11 flex-1 rounded-xl border border-zinc-200 bg-white px-3 text-sm text-zinc-900 placeholder:text-zinc-400 outline-none focus:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-100 dark:placeholder:text-zinc-600 dark:focus:border-zinc-600",placeholder:"zh"===d?"例如:elonmusk":"e.g. elonmusk"}),(0,n.jsxs)("button",{type:"button",onClick:()=>void ei(),disabled:U||!A.trim(),className:"inline-flex h-11 items-center gap-2 rounded-xl bg-zinc-900 px-4 text-sm font-semibold text-white hover:bg-zinc-800 disabled:opacity-60 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:[U?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):(0,n.jsx)(o.A,{className:"h-4 w-4"}),"zh"===d?"搜索":"Search"]}),er?(0,n.jsx)("div",{className:"absolute left-0 right-0 top-[calc(100%+10px)] z-20 overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-xl shadow-black/10 dark:border-zinc-800 dark:bg-zinc-950 dark:shadow-black/20",children:M?(0,n.jsx)("div",{className:"px-4 py-3 text-sm font-semibold text-rose-700 dark:text-rose-200",children:M}):U?(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2 px-4 py-6 text-sm font-semibold text-zinc-500 dark:text-zinc-400",children:[(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}),"zh"===d?"搜索中...":"Searching..."]}):0===X.length?(0,n.jsx)("div",{className:"px-4 py-6 text-center text-sm font-semibold text-zinc-500 dark:text-zinc-400",children:"zh"===d?"暂无搜索结果":"No results"}):(0,n.jsx)("div",{className:"max-h-[320px] overflow-auto divide-y divide-zinc-100 dark:divide-zinc-900",children:X.map(e=>{var t,r,i;let a,s,l,o=P.some(t=>t.participantId===e.participantId),c=e.username?`@${e.username}`:e.participantId,u=(t=e.username,r=e.avatarUrl,a=[],(s=(r??"").trim())&&a.push(s),(l=(t??"").replace(/^@+/,"").trim())&&(a.push(`https://unavatar.io/twitter/${encodeURIComponent(l)}`),a.push(`https://unavatar.io/x/${encodeURIComponent(l)}
1`)),Array.from(new Set(a))),m=u[0]??null;return(0,n.jsxs)("button",{type:"button",onClick:()=>ea(e),className:["flex w-full items-center justify-between gap-3 px-4 py-3 text-left",o?"bg-zinc-50 dark:bg-zinc-900/70":"bg-white hover:bg-zinc-50 dark:bg-zinc-950 dark:hover:bg-zinc-900"].join(" "),children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[m?(0,n.jsx)("img",{src:m,alt:"",className:"h-10 w-10 rounded-full border border-zinc-200 object-cover dark:border-zinc-800",referrerPolicy:"no-referrer",loading:"lazy",decoding:"async",onError:e=>(function(e,t){let r=e.currentTarget,n=r.getAttribute("src")??"",i=t.findIndex(e=>e===n),a=i>=0?t[i+1]:null;if(a){r.src=a;return}r.style.visibility="hidden"})(e,u)}):(0,n.jsx)("div",{className:"h-10 w-10 rounded-full bg-zinc-200 dark:bg-zinc-800"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"truncate text-sm font-semibold text-zinc-900 dark:text-zinc-50",children:e.name??c}),(0,n.jsxs)("div",{className:"truncate text-xs font-medium text-zinc-500 dark:text-zinc-400",children:[c,null!==e.followersCount?` \xb7 ${"number"!=typeof(i=e.followersCount)||Number.isNaN(i)?"-":new Intl.NumberFormat("en-US").format(i)}`:null]})]})]}),(0,n.jsx)("div",{className:`shrink-0 text-xs font-semibold ${o?"text-zinc-900 dark:text-zinc-100":"text-zinc-500 dark:text-zinc-400"}`,children:o?"zh"===d?"已选":"Selected":"zh"===d?"选择":"Select"})]},e.participantId)})})}):null]}),(0,n.jsx)("div",{className:[er?"mt-16":"mt-4","rounded-xl border border-dashed border-zinc-200 bg-white px-4 py-3 text-xs font-medium text-zinc-600 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-300"].join(" "),children:"zh"===d?"从搜索结果中点击用户即可加入本次创建流程,下一步再统一确认已选用户。":"Click users in the search results to add them, then review all selected users in the next step."})]}):(0,n.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-zinc-50 p-4 dark:border-zinc-800 dark:bg-zinc-900/40",children:[(0,n.jsx)("div",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"zh"===d?"上传 CSV 或 XLSX":"Upload CSV or XLSX"}),(0,n.jsx)("div",{className:"mt-1 text-xs font-medium text-zinc-500 dark:text-zinc-400",children:"zh"===d?"支持从 username、profileUrl、userId 等列识别 X 用户。":"Recognizes X users from columns like username, profileUrl, or userId."}),(0,n.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>H.current?.click(),disabled:T,className:"inline-flex items-center gap-2 rounded-xl bg-zinc-900 px-4 py-2.5 text-sm font-semibold text-white hover:bg-zinc-800 disabled:opacity-60 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:[T?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):null,"zh"===d?"选择文件并导入":"Choose file and import"]}),(0,n.jsx)("button",{type:"button",onClick:()=>void es("csv"),className:"rounded-xl border border-zinc-200 bg-white px-3 py-2.5 text-xs font-semibold text-zinc-700 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-200 dark:hover:bg-zinc-900",children:"zh"===d?"下载 CSV 示例":"Sample CSV"}),(0,n.jsx)("button",{type:"button",onClick:()=>void es("xlsx"),className:"rounded-xl border border-zinc-200 bg-white px-3 py-2.5 text-xs font-semibold text-zinc-700 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-200 dark:hover:bg-zinc-900",children:"zh"===d?"下载 XLSX 示例":"Sample XLSX"})]}),(0,n.jsx)("div",{className:"mt-2 text-[11px] font-medium text-zinc-500 dark:text-zinc-400",children:"zh"===d?"导入识别会调用现有 X 用户搜索能力;按当前规则,通常每成功识别 1 个用户约消耗 0.01 credit。":"Import lookup uses the existing X user search flow; under the current rule, each matched user usually costs about 0.01 credit."}),F?(0,n.jsx)("div",{className:"mt-3 rounded-lg border border-rose-200 bg-rose-50 px-3 py-2 text-sm font-semibold text-rose-700 dark:border-rose-500/40 dark:bg-rose-500/10 dark:text-rose-200",children:F}):null,q?(0,n.jsxs)("div",{className:"mt-3 rounded-lg border border-emerald-200 bg-emerald-50 px-3 py-2 text-sm font-semibold text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-200",children:["zh"===d?`已处理 ${q.fileName}:识别 ${q.detectedCount} 条,成功匹配 ${q.matchedCount} 条,新加入 ${q.addedCount} 条,当前已选 ${q.totalSelectedCount} 条(已自动进入下一步)。`:`Processed ${q.fileName}: detected ${q.detectedCount}, matched ${q.matchedCount}, added ${q.addedCount}, total selected ${q.totalSelectedCount} (auto moved to next step).`,q.unresolved.length>0?(0,n.jsx)("div",{className:"mt-1 text-xs font-medium text-amber-700 dark:text-amber-200",children:"zh"===d?`未匹配:${q.unresolved.slice(0,6).join(", ")}${q.unresolved.length>6?" ...":""}`:`Unmatched: ${q.unresolved.slice(0,6).join(", ")}${q.unresolved.length>6?" ...":""}`}):null]}):null,(0,n.jsxs)("div",{className:"mt-4 rounded-xl border border-dashed border-zinc-200 bg-white p-3 dark:border-zinc-700 dark:bg-zinc-950",children:[(0,n.jsx)("div",{className:"text-xs font-semibold text-zinc-800 dark:text-zinc-100",children:"zh"===d?"文档示例":"Example file"}),(0,n.jsx)("div",{className:"mt-1 text-[11px] font-medium text-zinc-500 dark:text-zinc-400",children:"zh"===d?"推荐列名:username、profileUrl、name。也支持 userId / participantId。":"Recommended columns: username, profileUrl, name. userId / participantId also work."}),(0,n.jsxs)("div",{className:"mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"grid grid-cols-3 bg-zinc-100 text-[11px] font-semibold text-zinc-700 dark:bg-zinc-900 dark:text-zinc-200",children:[(0,n.jsx)("div",{className:"px-3 py-2",children:"username"}),(0,n.jsx)("div",{className:"px-3 py-2",children:"profileUrl"}),(0,n.jsx)("div",{className:"px-3 py-2",children:"name"})]}),c.map(e=>(0,n.jsxs)("div",{className:"grid grid-cols-3 border-t border-zinc-200 bg-white text-[11px] text-zinc-600 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-300",children:[(0,n.jsx)("div",{className:"truncate px-3 py-2",children:e.username}),(0,n.jsx)("div",{className:"truncate px-3 py-2",children:e.profileUrl}),(0,n.jsx)("div",{className:"truncate px-3 py-2",children:e.name})]},e.username))]})]})]})]}):(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"rounded-xl border border-zinc-200 bg-zinc-50 p-4 dark:border-zinc-800 dark:bg-zinc-900/40",children:[(0,n.jsx)("div",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:ee}),(0,n.jsx)("div",{className:"mt-1 text-xs font-medium text-zinc-500 dark:text-zinc-400",children:"zh"===d?"确认已选用户无误后,再完成列表名称并提交创建。":"Review the selected users, then finish the list details and submit."})]}),(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400",children:"zh"===d?"列表名称":"List name"}),(0,n.jsx)("div",{className:"mt-1 text-xs font-medium text-zinc-500 dark:text-zinc-400",children:"zh"===d?"取一个 list 的名字":"Name your list"}),(0,n.jsx)("input",{value:j,onChange:e=>N(e.target.value),className:"mt-2 h-11 w-full rounded-xl border border-zinc-200 bg-white px-3 text-sm text-zinc-900 placeholder:text-zinc-400 outline-none focus:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-100 dark:placeholder:text-zinc-600 dark:focus:border-zinc-600",placeholder:"zh"===d?"例如:AI 海外营销":"e.g. AI outbound"})]})]}),(0,n.jsxs)("div",{className:"sticky bottom-0 mt-5 -mx-5 flex items-center justify-between gap-2 border-t border-zinc-200 bg-white/95 px-5 py-3 backdrop-blur supports-[backdrop-filter]:bg-white/85 dark:border-zinc-800 dark:bg-zinc-950/95 dark:supports-[backdrop-filter]:bg-zinc-950/85",children:[(0,n.jsx)("div",{className:"text-xs font-medium text-zinc-500 dark:text-zinc-400",children:"select"===S?"zh"===d?"完成选人后进入下一步。":"Continue after you finish selecting users.":"zh"===d?"如需调整人选,可返回上一步继续搜索或导入。":"Go back if you want to keep searching or importing users."}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:en,disabled:K,className:"rounded-xl border border-zinc-200 bg-white px-4 py-2.5 text-sm font-semibold text-zinc-700 hover:bg-zinc-50 disabled:opacity-60 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-200 dark:hover:bg-zinc-900",children:"zh"===d?"取消":"Cancel"}),"review"===S?(0,n.jsx)("button",{type:"button",onClick:()=>C("select"),disabled:K,className:"rounded-xl border border-zinc-200 bg-white px-4 py-2.5 text-sm font-semibold text-zinc-700 hover:bg-zinc-50 disabled:opacity-60 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-200 dark:hover:bg-zinc-900",children:"zh"===d?"上一步":"Back"}
1):null,"select"===S?(0,n.jsx)("button",{type:"button",onClick:()=>C("review"),disabled:!et,className:"rounded-xl bg-zinc-900 px-4 py-2.5 text-sm font-semibold text-white hover:bg-zinc-800 disabled:opacity-60 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:"zh"===d?"下一步":"Next"}):(0,n.jsxs)("button",{type:"button",onClick:()=>void eo(),disabled:K||0===P.length||!j.trim(),className:"inline-flex items-center gap-2 rounded-xl bg-zinc-900 px-4 py-2.5 text-sm font-semibold text-white hover:bg-zinc-800 disabled:opacity-60 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-200",children:[K?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):null,"zh"===d?"创建":"Create"]})]})]})]})]})})}),document.body),[en,es,el,t,et,F,q,T,_,j,A,ee,Z,K,er,M,X,Q,U,P,S,eo,ei,ea,d])}},29978:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(56059).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},70145:(e,t,r)=>{r.d(t,{cB:()=>a,iD:()=>d.iD,W0:()=>d.W0,XI:()=>d.XI,eV:()=>d.eV,KE:()=>n.getSessionWithTimeout,Mq:()=>d.Mq,$G:()=>n.$G,oC:()=>d.oC,eh:()=>d.eh,cU:()=>s,bb:()=>o,ND:()=>n.ND,Yx:()=>d.Yx});var n=r(4018);let i="__aipersona_hard_signout_at_v1";function a(e){return n.ND.auth.exchangeCodeForSession(e)}function s(e){try{window.localStorage.removeItem(i),window.sessionStorage.removeItem(i)}catch{}return n.ND.auth.signInWithOAuth(e)}function l(e,t){if("u"<typeof document)return;let r="https:"===window.location.protocol,n=["path=/","samesite=lax","max-age=0"];r&&n.push("secure"),t&&n.push(`domain=${t}`),document.cookie=`${e}=; ${n.join("; ")}`}async function o(e){let t=(e?.redirectTo??"/").toString()||"/",r="number"==typeof e?.timeoutMs&&e.timeoutMs>0?Math.floor(e.timeoutMs):1200;try{let e=String(Date.now());window.localStorage.setItem(i,e),window.sessionStorage.setItem(i,e)}catch{}try{n.ND.auth.stopAutoRefresh()}catch{}let a=new Promise(e=>setTimeout(e,r));await Promise.race([n.ND.auth.signOut({scope:"local"}).then(()=>void 0).catch(()=>void 0),a]),n.ND.auth.signOut({scope:"global"}).catch(()=>null);try{window.localStorage.removeItem("__aipersona_membership_cache_v1")}catch{}try{window.localStorage.removeItem("aipersona.lastPath")}catch{}try{let e=(e,t)=>{let r=[];for(let t=0;t<e.length;t+=1){let n=e.key(t);n&&r.push(n)}for(let n of r)t(n)&&e.removeItem(n)};for(let t of[window.localStorage,window.sessionStorage])e(t,e=>e.startsWith("sb-")&&(e.endsWith("-auth-token")||e.endsWith("-auth-token-storage")||e.includes("-auth-token"))||e.startsWith("dashboard.")||e.startsWith("autoReply.")||e.startsWith("context.")||"schedule.weekStart"===e)}catch{}let s=function(){let e=(window.location.hostname??"").toString().trim().toLowerCase();if(!e||"localhost"===e||e.endsWith(".vercel.app")||/^\d{1,3}(\.\d{1,3}){3}$/.test(e))return;if(e.startsWith("www."))return e.slice(4);let t=e.split(".").filter(Boolean);return t.length>=2?t.slice(-2).join("."):e}();for(let e of["__aipersona_rt_v1","x_supabase_token","gcal_supabase_token","notion_supabase_token"])l(e,void 0),s&&l(e,s);window.location.assign(t)}var d=r(18028)},79428:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(56059).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])}}]);

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.