PageSourceSearch

https://bbcc.ai/build/assets/DomainList-txcqE_Xx.js

js bbcc.ai collected 2026-10-05 12:12:51 UTC 28,006 bytes, 49 lines download raw bytes

1import{r as o,b as z,j as e,H as ge,L as U}from"./app-DP13319Q.js";import{D as he}from"./DraggableMenu-Bk7Spryo.js";import{M as fe}from"./react-tooltip.min-DW3XhwOj.js";import{F as n,ah as O,b as V,h as J,j as A,ai as N,X as k,aj as se,c as pe,ak as be,K as Z,v as ye,g as je}from"./index-CtyZ6W6U.js";/* empty css            */import"./index-DQkUn08L.js";const we=[{value:"recent",label:"Most recent"},{value:"oldest",label:"Oldest first"},{value:"alphabetical",label:"Alphabetical"}],ve=[{value:"all",label:"All Domains"},{value:"active",label:"With Slug"},{value:"pending",label:"No Slug"}],Ne=t=>{if(!t)return"N/A";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"N/A"}},ke=t=>{if(t==null)return"0.00";const x=Number(t);return isNaN(x)?"0.00":x.toFixed(2)},F=t=>t.funnelid&&t.slug?"active":"pending",ee=t=>t?Array.isArray(t)?t:typeof t=="object"&&"data"in t&&Array.isArray(t.data)?t.data:[]:[],E=({size:t=20})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"animate-spin text-yellow-400",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Se=({status:t})=>{const x={active:"bg-green-400/20 text-green-400 border-green-400/30",pending:"bg-yellow-400/20 text-yellow-400 border-yellow-400/30"},m={active:"Active",pending:"Pending"};return e.jsxs("span",{className:`inline-flex items-center gap-1.5 ${x[t]} text-[10px] px-2 py-0.5 rounded-md font-bold uppercase tracking-wide border`,children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current"}),e.jsx("span",{className:"truncate",children:m[t]})]})},Ce=({message:t,type:x,onClose:m})=>{o.useEffect(()=>{const v=setTimeout(()=>{m()},5e3);return()=>clearTimeout(v)},[m]);const b={success:"bg-green-500/20 border-green-500/30 text-green-400",error:"bg-red-500/20 border-red-500/30 text-red-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-400",warning:"bg-yellow-500/20 border-yellow-500/30 text-yellow-400"},w={success:e.jsx("svg",{className:"w-5 h-5 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),error:e.jsx("svg",{className:"w-5 h-5 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})}),info:e.jsx("svg",{className:"w-5 h-5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),warning:e.jsx("svg",{className:"w-5 h-5 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})};return e.jsx("div",{className:`fixed top-20 right-4 z-[200] p-4 rounded-xl border ${b[x]} bg-gray-800/90 backdrop-blur-sm shadow-2xl max-w-md animate-slide-left`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0",children:w[x]}),e.jsx("div",{className:"flex-1 text-sm font-medium break-words",children:t}),e.jsx("button",{onClick:m,className:"flex-shrink-0 opacity-50 hover:opacity-100 transition-opacity text-gray-400",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]})})},Ae=({domain:t,isSelected:x,onSelect:m,onCopy:b,onOpenSlug:w,copiedField:v})=>{const R=F(t);return e.jsxs("div",{onClick:()=>m(t),className:`conversation-card bg-gray-800 border-2 rounded-2xl p-5 shadow-sm relative transition cursor-pointer ${x?"border-yellow-400 shadow-lg shadow-yellow-400/10":"border-gray-700 hover:border-yellow-400"}`,children:[e.jsx("div",{className:"flex justify-between items-start",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center flex-shrink-0",children:e.jsx(n,{icon:A,className:"text-white text-sm"})}),e.jsxs("h3",{className:"font-bold text-white text-base truncate",children:[t.domain,".",t.domainselected]})]}),e.jsxs("button",{onClick:f=>{f.stopPropagation(),w(t)},className:"inline-flex items-center gap-1.5 bg-yellow-400/10 hover:bg-yellow-400/20 text-yellow-400 border border-yellow-400/30 px-2.5 py-1 rounded-lg text-[11px] font-bold transition-all hover:shadow-md hover:shadow-yellow-400/10","data-tooltip-id":"main-tooltip","data-tooltip-content":t.slug?`Slug: /X/${t.slug} — Click to change`:"No slug yet — Click to assign",children:[e.jsx(n,{icon:N,className:"text-[10px]"}),e.jsx("span",{children:t.slug?"Slug":"Add Slug"}),t.slug?e.jsx(n,{icon:k,className:"text-[9px] text-green-400"}):e.jsx(n,{icon:O,className:"text-[9px]"})]}),e.jsx(Se,{status:R})]}),e.jsx("div",{className:"bg-gray-700/30 rounded-lg px-3 py-2 border border-gray-600 mb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(n,{icon:be,className:"text-purple-400 text-xs flex-shrink-0"}),e.jsx("span",{className:"text-xs font-mono text-purple-400 truncate",children:t.handle||"X000324"})]}),e.jsx("button",{onClick:f=>{f.stopPropagation(),b(t.handle||"X000324",`handle-${t.id}`)},className:"ml-2 p-1 hover:bg-purple-500/20 rounded transition-colors text-gray-400 hover:text-purple-400 flex-shrink-0","data-tooltip-id":"main-tooltip","data-tooltip-content":"Copy handle",children:v===`handle-${t.id}`?e.jsx(n,{icon:k,className:"text-green-400 text-xs"}):e.jsx(n,{icon:Z,className:"text-xs"})})]})}),e.jsx("div",{className:"bg-gray-700/30 rounded-lg px-3 py-2 border border-gray-600 mb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(n,{icon:N,className:"text-yellow-400 text-xs flex-shrink-0"}),e.jsxs("span",{className:"text-xs font-mono text-gray-400 truncate",children:["/X/",t.slug||"no-slug"]})]}),e.jsx("div",{className:"flex items-center gap-1 ml-2 flex-shrink-0",children:t.slug&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:f=>{f.stopPropagation(),b(`/X/${t.slug}`,`slug-${t.id}`)},className:"p-1 hover:bg-yellow-500/20 rounded transition-colors text-gray-400 hover:text-yellow-400","data-tooltip-id":"main-tooltip","data-tooltip-content":"Copy slug",children:v===`slug-${t.id}`?e.jsx(n,{icon:k,className:"text-green-400 text-xs"}):e.jsx(n,{icon:Z,className:"text-xs"})}),e.jsx("a",{href:`/X/${t.slug}`,target:"_blank",rel:"noopener noreferrer",onClick:f=>f.stopPropagation(),className:"p-1 hover:bg-yellow-500/20 rounded transition-colors text-gray-400 hover:text-yellow-400","data-tooltip-id":"main-tooltip","data-tooltip-content":"Open slug in new tab",children:e.jsx(n,{icon:ye,className:"text-xs"})})]})})]})}),e.jsxs("div",{className:"flex items-center justify-between gap-2 mt-3",children:[e.jsx("div",{className:"flex items-center gap-2 text-[11px] text-gray-500 flex-wrap",children:e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(n,{icon:se,className:"text-[9px]"}),"Created ",Ne(t.created_at)]})}),t.sells&&t.sells.length>0&&e.jsxs("div",{className:"flex items-center gap-1 text-yellow-400 bg-yellow-400/10 px-2 py-1 rounded-lg border border-yellow-400/30",children:[e.jsx(n,{icon:je,className:"text-[10px]"}),e.jsx("span",{className:"text-[11px] font-bold",children:ke(t.sells[0].price)})]})]})]})}),x&&e.jsx("div",{className:"absolute top-3 right-3",children:e.jsx("div",{className:"w-5 h-5 rounded-full bg-yellow-400 flex items-center justify-center",children:e.jsx(n,{icon:k,className:"text-black text-xs"})})})]})};function Ie({domains:t,totalDomains:x=0,currentPage:m=1,lastPage:b=1,perPage:w=20,auth:v,tooltips:R={}}){const f=o.useMemo(()=>
1ee(t),[t]),[y,M]=o.useState(f),[S,W]=o.useState(!1),[C,B]=o.useState(m<b),[P,H]=o.useState(m),[j,Y]=o.useState(""),[T,te]=o.useState([]),[c,$]=o.useState(null),[I,ae]=o.useState("recent"),[_,le]=o.useState("all"),[re,_e]=o.useState(!0),[ne,q]=o.useState(null),[l,p]=o.useState({isActive:!1,domain:null,slugs:[],loading:!1,selectedSlugId:null,saving:!1,search:""}),[X,G]=o.useState({show:!1,message:"",type:"info"}),K=o.useRef(null),oe=o.useRef(null),u=o.useCallback((s,a="error")=>{G({show:!0,message:s,type:a})},[]),ie=o.useMemo(()=>y.filter(s=>F(s)==="active").length,[y]),ce=o.useMemo(()=>y.filter(s=>F(s)==="pending").length,[y]);o.useEffect(()=>{const s=ee(t);M(s),H(m),B(m<b)},[t,m,b]),o.useEffect(()=>{let s=Array.isArray(y)?[...y]:[];if(_!=="all"&&(s=s.filter(a=>F(a)===_)),j.trim()){const a=j.trim().toLowerCase();s=s.filter(r=>{var h;const i=`${r.domain}.${r.domainselected}`.toLowerCase(),g=(r.handle||"X000324").toLowerCase(),d=(r.slug||"").toLowerCase();return i.includes(a)||g.includes(a)||d.includes(a)||((h=r.email)==null?void 0:h.toLowerCase().includes(a))})}s.sort((a,r)=>{switch(I){case"oldest":return new Date(a.created_at).getTime()-new Date(r.created_at).getTime();case"alphabetical":return a.domain.localeCompare(r.domain);case"recent":default:return new Date(r.created_at).getTime()-new Date(a.created_at).getTime()}}),te(s)},[y,j,I,_]),o.useEffect(()=>{const s=new IntersectionObserver(r=>{r[0].isIntersecting&&C&&!S&&de()},{threshold:.5,rootMargin:"100px"}),a=K.current;return a&&s.observe(a),()=>{a&&s.unobserve(a)}},[C,S]);const de=o.useCallback(async()=>{if(!(S||!C)){W(!0);try{const s=await z.get("/domains/load-more",{params:{page:P+1,per_page:w}});if(s.data.success){const a=Array.isArray(s.data.data)?s.data.data:[];M(r=>[...Array.isArray(r)?r:[],...a]),H(s.data.meta.current_page),B(s.data.meta.current_page<s.data.meta.last_page)}}catch(s){console.error("Failed to load more domains:",s),u("Failed to load more domains","error")}finally{W(!1)}}},[S,C,P,w,u]),xe=o.useCallback((s,a)=>{navigator.clipboard.writeText(s),q(a),u("Copied to clipboard!","success"),setTimeout(()=>{q(null)},2e3)},[u]),me=o.useCallback(s=>{$(s)},[]),Q=o.useCallback(async s=>{p({isActive:!0,domain:s,slugs:[],loading:!0,selectedSlugId:null,saving:!1,search:""}),$(s);try{const a=await z.get("/domains/user-slugs");if(a.data.success){const r=(a.data.slugs||[]).filter(i=>i.funnel_id!==null&&i.funnel_id!==void 0);p(i=>({...i,slugs:r,loading:!1}))}else p(r=>({...r,loading:!1})),u("Failed to load slugs.","error")}catch(a){console.error("Failed to load user slugs:",a),p(r=>({...r,loading:!1})),u("Failed to load slugs. Please try again.","error")}},[u]),L=o.useCallback(()=>{p({isActive:!1,domain:null,slugs:[],loading:!1,selectedSlugId:null,saving:!1,search:""})},[]),ue=o.useCallback(async()=>{var s,a,r;if(!l.domain||!l.selectedSlugId){u("Please select a slug first.","warning");return}p(i=>({...i,saving:!0}));try{const i=((s=document.querySelector('meta[name="csrf-token"]'))==null?void 0:s.getAttribute("content"))||"",g=await z.patch(`/domains/${l.domain.id}/assign-slug`,{slug_id:l.selectedSlugId},{headers:{"X-CSRF-TOKEN":i,"Content-Type":"application/json"}});if(g.data.success){const d=g.data.domain;M(h=>h.map(D=>D.id===l.domain.id?{...D,funnelid:d.funnelid,funnel_token:d.funnel_token,slug:d.slug,conversation_id:d.conversation_id,conversation_title:d.conversation_title,handle:d.handle||D.handle}:D)),$(h=>h&&h.id===l.domain.id?{...h,funnelid:d.funnelid,funnel_token:d.funnel_token,slug:d.slug,conversation_id:d.conversation_id,conversation_title:d.conversation_title,handle:d.handle||h.handle}:h),u("Slug assigned successfully!","success"),setTimeout(()=>{L()},1200)}else throw new Error(g.data.message||"Failed to assign slug")}catch(i){console.error("Failed to assign slug:",i);const g=((r=(a=i.response)==null?void 0:a.data)==null?void 0:r.message)||i.message||"Failed to assign slug. Please try again.";u(g,"error")}finally{p(i=>({...i,saving:!1}))}},[l,u,L]);return e.jsxs(e.Fragment,{children:[e.jsx(ge,{title:"Domain Management"}),e.jsx("style",{children:`
2                .react-tooltip {
3                    z-index: 99999 !important;
4                    opacity: 1 !important;
5                    font-size: 12px;
6                    padding: 4px 8px;
7                }
8            `}),e.jsx(fe,{id:"main-tooltip",place:"top",className:"!bg-gray-800 !text-white !text-xs !px-3 !py-2 !rounded-lg !z-[100] !shadow-xl border !border-gray-700",effect:"solid"}),e.jsx(he,{auth:v}),e.jsx("style",{children:`
9                @keyframes fade-in {
10                    from { opacity: 0; }
11                    to { opacity: 1; }
12                }
13                @keyframes slide-in-from-bottom-2 {
14                    from { transform: translateY(0.5rem); opacity: 0; }
15                    to { transform: translateY(0); opacity: 1; }
16                }
17                @keyframes slide-left {
18                    from { transform: translateX(100%); opacity: 0; }
19                    to { transform: translateX(0); opacity: 1; }
20                }
21                @keyframes slideDown {
22                    from { opacity: 0; transform: translate(-50%, -20px); }
23                    to { opacity: 1; transform: translate(-50%, 0); }
24                }
25                .animate-in {
26                    animation-duration: 0.3s;
27                    animation-fill-mode: both;
28                }
29                .fade-in { animation-name: fade-in; }
30                .slide-in-from-bottom-2 { animation-name: slide-in-from-bottom-2; }
31                .animate-slide-left { animation: slide-left 0.3s ease-out; }
32                .animate-slideDown { animation: slideDown 0.3s ease-out; }
33
34                .custom-scrollbar::-webkit-scrollbar { width: 5px; }
35                .custom-scrollbar::-webkit-scrollbar-track {
36                    background: #1f2937; border-radius: 20px;
37                }
38                .custom-scrollbar::-webkit-scrollbar-thumb {
39                    background: #4b5563; border-radius: 20px;
40                }
41                .custom-scrollbar::-webkit-scrollbar-thumb:hover {
42                    background: #6b7280;
43                }
44                .conversation-card:hover {
45                    border-color: #fbbf24;
46                    box-shadow: 0 8px 20px -6px rgba(251, 191, 36, 0.15);
47                }
48                button, .card-transition { transition: all 0.15s ease; }
49            `}),e.jsx("main",{className:"flex-1 flex flex-col p-8 overflow-hidden",children:re&&e.jsx("div",{className:"relative mt-4 mx-auto bottom-4 z-50 backdrop-blur-sm p-4 rounded-xl border border-white-700 overflow-y-auto shadow-2xl w-full max-w-7xl",style:{background:"rgba(31, 41, 55, 0.8)"},children:e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-start mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-yellow-400 tracking-tight",children:"Domain Management"}),e.jsxs("div",{className:"flex gap-4 mt-2 items-center flex-wrap",children:[e.jsxs("span",{className:"bg-yellow-400/20 text-yellow-400 px-3 py-1 rounded-full text-xs font-semibold border border-yellow-400/30",children:[x," domain",x!==1?"s":""]}),e.jsxs("span",{className:"text-green-400 text-xs flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),ie," active"]}),e.jsxs("span",{className:"text-yellow-400 text-xs flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-yellow-400 rounded-full"}),ce," pending"]})]})]}),e.jsxs(U,{href:"/",className:"bg-yellow-400 hover:bg-yellow-500 text-black px-5 py-2.5 rounded-xl flex items-center gap-2 font-bold text-sm transition shadow-lg shadow-yellow-400/20",children:[e.jsx(n,{icon:O,className:"text-sm"}),"New Domain"]})]}),e.jsxs("div",{className:"flex flex-1 gap-7 overflow-hidden",children:[e.jsxs("div",{className:"w-[40%] flex flex-col",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4 px-1 gap-2",children:[e.jsxs("p",{className:"text-xs text-gray-500 font-medium",children:["Showing ",T.length," of ",x," domains"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:_,onCh
49ange:s=>le(s.target.value),className:"flex items-center gap-2 border border-gray-700 rounded-lg px-3 py-2 bg-gray-800 text-gray-300 text-xs font-semibold cursor-pointer shadow-sm hover:bg-gray-700 outline-none",children:ve.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx("select",{value:I,onChange:s=>ae(s.target.value),className:"flex items-center gap-2 border border-gray-700 rounded-lg px-3 py-2 bg-gray-800 text-gray-300 text-xs font-semibold cursor-pointer shadow-sm hover:bg-gray-700 outline-none",children:we.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))})]})]}),e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"relative w-full max-w-4xl",children:[e.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-4 text-gray-500",children:e.jsx(n,{icon:V,className:"text-base"})}),e.jsx("input",{ref:oe,type:"text",value:j,onChange:s=>Y(s.target.value),placeholder:"Search by domain, handle, slug, or email...",className:"w-full pl-11 pr-5 py-3.5 border border-gray-700 rounded-2xl focus:ring-2 focus:ring-yellow-400/30 focus:border-yellow-400/50 outline-none bg-gray-800 text-white placeholder-gray-500 shadow-sm transition"}),j&&e.jsx("button",{onClick:()=>Y(""),className:"absolute right-3 top-1/2 transform -translate-y-1/2 p-1 hover:bg-gray-700 rounded-full text-gray-400 hover:text-white",children:e.jsx(n,{icon:J,className:"text-sm"})})]})}),e.jsx("div",{className:"space-y-4 overflow-y-auto pr-2 custom-scrollbar max-h-[calc(100vh)]",children:T.length===0?e.jsxs("div",{className:"text-center py-20 bg-gray-800 rounded-2xl border-2 border-gray-700 shadow-sm",children:[e.jsx("div",{className:"w-24 h-24 mx-auto mb-6 bg-gradient-to-br from-gray-700 to-gray-600 rounded-full flex items-center justify-center",children:e.jsx(n,{icon:A,className:"text-4xl text-gray-500"})}),e.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:j?"No matches found":"No domains yet"}),e.jsx("p",{className:"text-gray-400 mb-8 max-w-md mx-auto",children:j?`No domains match "${j}". Try different keywords.`:"Get your first custom domain to establish your online presence."}),e.jsxs(U,{href:"/",className:"inline-flex items-center px-6 py-3 bg-yellow-400 hover:bg-yellow-500 text-black rounded-xl text-sm font-bold transition shadow-lg shadow-yellow-400/20",children:[e.jsx(n,{icon:O,className:"mr-2 text-sm"}),"Get a Domain"]})]}):T.map(s=>e.jsx(Ae,{domain:s,isSelected:(c==null?void 0:c.id)===s.id,onSelect:me,onCopy:xe,onOpenSlug:Q,copiedField:ne},s.id))}),e.jsxs("div",{ref:K,className:"py-12 text-center",children:[S&&e.jsxs("div",{className:"inline-flex items-center gap-3 px-6 py-3 bg-gray-800 border-2 border-gray-700 rounded-2xl shadow-sm",children:[e.jsx(E,{size:22}),e.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Loading more domains..."})]}),!C&&y.length>0&&e.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-gray-500",children:[e.jsx("div",{className:"w-12 h-px bg-gradient-to-r from-transparent to-gray-600"}),e.jsx("span",{children:"You've reached the end"}),e.jsx("div",{className:"w-12 h-px bg-gradient-to-l from-transparent to-gray-600"})]})]})]}),e.jsx("div",{className:"w-[60%]",children:e.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-3xl shadow-xl flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 border-b border-gray-700 flex items-center justify-between",children:[e.jsxs("h2",{className:"text-lg font-bold text-white flex items-center gap-2",children:[e.jsx(n,{icon:l.isActive?N:A,className:"text-yellow-400"}),l.isActive?"Assign Slug to Domain":"Domain Details"]}),l.isActive&&e.jsx("button",{onClick:L,className:"p-2 hover:bg-gray-700 rounded-lg transition-colors text-gray-400 hover:text-white","data-tooltip-id":"main-tooltip","data-tooltip-content":"Close slug selector",children:e.jsx(n,{icon:J})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:l.isActive?e.jsxs("div",{className:"space-y-5",children:[l.domain&&e.jsxs("div",{className:"bg-gradient-to-r from-yellow-400/10 to-amber-500/10 border border-yellow-400/30 rounded-xl p-4",children:[e.jsx("p",{className:"text-[10px] text-yellow-400/80 uppercase font-bold tracking-wider mb-1",children:"Assigning slug to"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(n,{icon:A,className:"text-yellow-400"}),e.jsxs("span",{className:"text-sm font-mono text-white font-bold",children:[l.domain.domain,".",l.domain.domainselected]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500",children:e.jsx(n,{icon:V,className:"text-sm"})}),e.jsx("input",{type:"text",value:l.search,onChange:s=>p(a=>({...a,search:s.target.value})),placeholder:"Search slugs or titles...",className:"w-full pl-9 pr-4 py-2.5 border border-gray-700 rounded-xl focus:ring-2 focus:ring-yellow-400/30 focus:border-yellow-400/50 outline-none bg-gray-900 text-white text-sm placeholder-gray-500"})]}),l.loading?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(E,{size:28}),e.jsx("span",{className:"text-sm text-gray-400",children:"Loading your slugs..."})]})}):(()=>{const s=l.slugs.filter(a=>{if(a.funnel_id===null||a.funnel_id===void 0)return!1;if(!l.search.trim())return!0;const r=l.search.toLowerCase();return a.slug.toLowerCase().includes(r)||(a.conversation_title||"").toLowerCase().includes(r)});return s.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-700/50 rounded-full flex items-center justify-center border border-gray-600",children:e.jsx(n,{icon:N,className:"text-2xl text-gray-500"})}),e.jsx("p",{className:"text-gray-300 font-medium",children:l.search?"No slugs match your search":"No slugs available"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:l.search?"Try a different keyword.":"Create a conversation and build a funnel first to have assignable slugs."})]}):e.jsx("div",{className:"space-y-2",children:s.map(a=>{var g;const r=l.selectedSlugId===a.id,i=((g=l.domain)==null?void 0:g.funnelid)&&a.funnel_id===l.domain.funnelid;return e.jsx("button",{onClick:()=>p(d=>({...d,selectedSlugId:a.id})),className:`w-full text-left p-4 rounded-xl border-2 transition-all ${r?"border-yellow-400 bg-yellow-400/10 shadow-lg shadow-yellow-400/10":"border-gray-700 bg-gray-700/30 hover:border-gray-600 hover:bg-gray-700/50"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center flex-shrink-0 ${r?"bg-yellow-400 text-black":"bg-gray-600/50 text-gray-300"}`,children:e.jsx(n,{icon:N,className:"text-sm"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:`text-sm font-mono font-bold truncate ${r?"text-yellow-400":"text-white"}`,children:["/X/",a.slug]}),i&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] bg-green-500/20 text-green-400 border border-green-500/30 px-1.5 py-0.5 rounded font-bold uppercase",children:[e.jsx(n,{icon:k,className:"text-[7px]"}),"Current"]})]}),a.conversation_title&&e.jsx("p",{className:"text-xs text-gray-400 mt-1 truncate",children:a.conversation_title}),e.jsxs("div",{className:"flex items-center gap-3 mt-2 text-[10px] text-gray-500 flex-wrap",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(n,{icon:se,className:"text-[9px]"}),a.created_at_formatted]}),a.funnel_token&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx("span",{className:"font-mono text-purple-400",children:a.funnel_token})]})]})]}),r&&e.jsx("div",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-yellow-400 flex items-center justify-center",children:e.jsx(n,{icon:k,className:"text-black text-xs"})})]})},a.id)})})})(),!l.loading&&l.slugs.length>0&&e.jsxs("div",{className:"sticky bottom-0 bg-gray-800 border-t border-gray-700 pt-4 mt-4 flex gap-3",children:[e.jsx("button",{onClick:ue,disabled:l.saving||!l.selectedSlugId,className:"flex-1 bg-yellow-400 hover:bg-yellow-500 text-black font-bold py-3 px-4 roun
49ded-xl transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:l.saving?e.jsxs(e.Fragment,{children:[e.jsx(E,{size:16}),e.jsx("span",{children:"Assigning..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(n,{icon:pe}),e.jsx("span",{children:"Assign Slug"})]})}),e.jsx("button",{onClick:L,disabled:l.saving,className:"flex-1 bg-gray-700 hover:bg-gray-600 text-gray-300 font-medium py-3 px-4 rounded-xl transition-colors disabled:opacity-50",children:"Cancel"})]})]}):e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center space-y-6",children:[e.jsx("div",{className:"w-24 h-24 bg-gradient-to-br from-yellow-500/20 to-yellow-400/10 rounded-3xl flex items-center justify-center border border-yellow-500/30",children:e.jsx(n,{icon:A,className:"text-4xl text-yellow-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:c?"Domain Selected":"No Domain Selected"}),e.jsx("p",{className:"text-gray-400 max-w-sm",children:c?`You've selected ${c.domain}.${c.domainselected}. Click "Add Slug" on the card to assign a slug.`:'Select a domain from the list, then click "Add Slug" to assign a slug.'})]}
49),c&&e.jsxs("div",{className:"w-full max-w-md space-y-4 mt-4",children:[e.jsxs("div",{className:"bg-gray-700/30 rounded-xl p-4 border border-gray-600",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"Domain"}),e.jsxs("span",{className:"text-sm font-mono text-white",children:[c.domain,".",c.domainselected]})]}),e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"Handle"}),e.jsx("span",{className:"text-sm font-mono text-purple-400",children:c.handle||"X000324"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"Slug"}),e.jsxs("span",{className:"text-sm font-mono text-yellow-400",children:["/X/",c.slug||"no-slug"]})]}),c.funnel_token&&e.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t border-gray-600",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"Funnel"}),e.jsx("span",{className:"text-sm font-mono text-green-400",children:c.funnel_token})]})]}),e.jsxs("button",{onClick:()=>Q(c),className:"w-full flex items-center justify-center gap-2 bg-yellow-400/10 hover:bg-yellow-400/20 text-yellow-400 border border-yellow-400/30 px-4 py-3 rounded-xl text-sm font-bold transition-all",children:[e.jsx(n,{icon:N}),e.jsx("span",{children:c.slug?"Change Slug":"Add Slug"})]})]})]})}),e.jsx("div",{className:"p-4 border-t border-gray-700",children:e.jsx("p",{className:"text-[10px] text-gray-500 text-center",children:l.isActive?"Selecting a slug updates the domain funnel link":"Domain management panel"})})]})})]})]})})}),X.show&&e.jsx(Ce,{message:X.message,type:X.type,onClose:()=>G({show:!1,message:"",type:"info"})})]})}export{Ie 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.