1import{u as it,r as p,j as e,b as W,H as At,G as It}from"./app-DP13319Q.js";import{F as w,j as Lt,b8 as nt,h as ze,f as ut,aU as se,b9 as le,c as De,ba as ve,K as Ut,al as qt,aQ as Vt,ah as Bt,ax as dt,bb as ct,x as Wt,bc as Ht,bd as Ot,Q as Xt,R as Gt,T as Zt,U as Yt}from"./index-CtyZ6W6U.js";import{D as Kt}from"./DraggableMenu-Bk7Spryo.js";import"./model-viewer-BNdxy5m2.js";import{M as ie}from"./react-tooltip.min-DW3XhwOj.js";import{b as Qt,i as Jt,s as eo,h as to,d as $e,l as oo,q as so,c as ao,a as ro,e as lo,f as io,u as no,o as co,g as mo,j as po,M as uo,t as ho,k as xo,m as go,n as bo,p as fo,r as yo}from"./markdown-editor-DgLOEOaX.js";/* empty css */import"./index-DQkUn08L.js";import"./index-WruS1vxz.js";const mt=(d=!1)=>{let j=null;return{name:d?"backgroundColor":"color",keyCommand:d?"backgroundColor":"color",buttonProps:{"aria-label":d?"Add background color":"Add text color","data-tooltip-id":"mdeditor-tooltip","data-tooltip-content":d?"Background Color":"Text Color"},icon:e.jsx("div",{className:"flex items-center justify-center w-5 h-5",children:e.jsx(w,{icon:d?Zt:Yt,className:"text-current text-sm"})}),execute:(c,F)=>{const _=document.getElementById("color-picker-modal");_&&document.body.removeChild(_),j=document.createElement("div"),j.id="color-picker-modal",j.style.position="fixed",j.style.top="0",j.style.left="0",j.style.width="100%",j.style.height="100%",j.style.backgroundColor="rgba(0, 0, 0, 0.8)",j.style.display="flex",j.style.alignItems="center",j.style.justifyContent="center",j.style.zIndex="10000",j.style.backdropFilter="blur(8px)";const g=document.createElement("div");g.style.backgroundColor="#2d3748",g.style.padding="24px",g.style.borderRadius="16px",g.style.boxShadow="0 25px 50px -12px rgba(0, 0, 0, 0.5)",g.style.width="90%",g.style.maxWidth="420px",g.style.border="1px solid #4a5568";const i=document.createElement("div");i.style.display="flex",i.style.justifyContent="space-between",i.style.alignItems="center",i.style.marginBottom="20px";const D=document.createElement("h3");D.textContent=d?"Choose Background Color":"Choose Text Color",D.style.color="white",D.style.fontSize="18px",D.style.fontWeight="bold",D.style.margin="0";const b=document.createElement("button");b.innerHTML="Ã",b.style.background="none",b.style.border="none",b.style.color="white",b.style.fontSize="24px",b.style.cursor="pointer",b.style.width="32px",b.style.height="32px",b.style.borderRadius="50%",b.style.display="flex",b.style.alignItems="center",b.style.justifyContent="center",b.style.transition="background-color 0.2s",b.onmouseenter=()=>b.style.backgroundColor="#4a5568",b.onmouseleave=()=>b.style.backgroundColor="transparent",b.onclick=()=>{j&&j.parentNode&&document.body.removeChild(j)},i.appendChild(D),i.appendChild(b);const N=document.createElement("div");N.style.display="grid",N.style.gridTemplateColumns="repeat(6, 1fr)",N.style.gap="8px",N.style.marginBottom="20px",["#FF0000","#FF6B6B","#FFA500","#FFD93D","#6BCF7F","#4ECDC4","#45B7D1","#4D96FF","#5D6DFF","#9B59B6","#FF9FF3","#F368E0","#FFFFFF","#F1F2F6","#DFE4EA","#CED6E0","#A4B0BE","#747D8C","#57606F","#2F3542","#000000","#2D3436","#636E72","#B2BEC3"].forEach(A=>{const h=document.createElement("button");h.style.width="40px",h.style.height="40px",h.style.borderRadius="8px",h.style.border="2px solid #4a5568",h.style.cursor="pointer",h.style.transition="all 0.2s",h.style.backgroundColor=A,h.onmouseenter=()=>{h.style.transform="scale(1.1)",h.style.borderColor="#fff"},h.onmouseleave=()=>{h.style.transform="scale(1)",h.style.borderColor="#4a5568"},h.onclick=()=>{const I=A,U=d?`<span style="background-color: ${I}">${c.selectedText}</span>`:`<span style="color: ${I}">${c.selectedText}</span>`;F.replaceSelection(U),j&&j.parentNode&&document.body.removeChild(j)},N.appendChild(h)});const E=document.createElement("div");E.style.marginBottom="20px";const S=document.createElement("label");S.textContent="Custom Color:",S.style.color="white",S.style.display="block",S.style.marginBottom="8px",S.style.fontSize="14px";const v=document.createElement("input");v.type="color",v.value="#FF0000",v.style.width="60px",v.style.height="60px",v.style.borderRadius="12px",v.style.border="2px s
1olid #4a5568",v.style.cursor="pointer";const m=document.createElement("button");m.textContent="Apply Custom Color",m.style.marginLeft="12px",m.style.padding="12px 16px",m.style.backgroundColor="#4299e1",m.style.color="white",m.style.border="none",m.style.borderRadius="8px",m.style.cursor="pointer",m.style.fontWeight="bold",m.style.transition="background-color 0.2s",m.onmouseenter=()=>m.style.backgroundColor="#3182ce",m.onmouseleave=()=>m.style.backgroundColor="#4299e1",m.onclick=()=>{const A=v.value,h=d?`<span style="background-color: ${A}">${c.selectedText}</span>`:`<span style="color: ${A}">${c.selectedText}</span>`;F.replaceSelection(h),j&&j.parentNode&&document.body.removeChild(j)};const z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.appendChild(v),z.appendChild(m),E.appendChild(S),E.appendChild(z),g.appendChild(i),g.appendChild(N),g.appendChild(E),j.appendChild(g),j.onclick=A=>{A.target===j&&j.parentNode&&document.body.removeChild(j)},document.body.appendChild(j)}}},wo={name:"advancedTable",keyCommand:"advancedTable",buttonProps:{"aria-label":"Insert advanced table","data-tooltip-id":"mdeditor-tooltip","data-tooltip-content":"Advanced Table"},icon:e.jsx("div",{className:"flex items-center justify-center w-5 h-5",children:e.jsx(w,{icon:Xt,className:"text-current text-sm"})}),execute:(d,j)=>{const c=document.createElement("div");c.id="table-modal",c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%",c.style.backgroundColor="rgba(0, 0, 0, 0.8)",c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.zIndex="10000",c.style.backdropFilter="blur(8px)";const F=document.createElement("div");F.style.backgroundColor="#2d3748",F.style.padding="24px",F.style.borderRadius="16px",F.style.boxShadow="0 25px 50px -12px rgba(0, 0, 0, 0.5)",F.style.width="90%",F.style.maxWidth="500px",F.style.border="1px solid #4a5568";const _=document.createElement("div");_.style.display="flex",_.style.justifyContent="space-between",_.style.alignItems="center",_.style.marginBottom="20px";const g=document.createElement("h3");g.textContent="Create Table",g.style.color="white",g.style.fontSize="18px",g.style.fontWeight="bold",g.style.margin="0";const i=document.createElement("button");i.innerHTML="Ã",i.style.background="none",i.style.border="none",i.style.color="white",i.style.fontSize="24px",i.style.cursor="pointer",i.style.width="32px",i.style.height="32px",i.style.borderRadius="50%",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.transition="background-color 0.2s",i.onmouseenter=()=>i.style.backgroundColor="#4a5568",i.onmouseleave=()=>i.style.backgroundColor="transparent",i.onclick=()=>{c.parentNode&&document.body.removeChild(c)},_.appendChild(g),_.appendChild(i);const D=document.createElement("div");D.style.marginBottom="20px";const b=document.createElement("div");b.style.marginBottom="12px";const N=document.createElement("label");N.textContent="Number of Rows:",N.style.color="white",N.style.display="block",N.style.marginBottom="4px";const $=document.createElement("input");$.type="number",$.min="1",$.max="20",$.value="3",$.style.width="100%",$.style.padding="8px",$.style.backgroundColor="#4a5568",$.style.border="1px solid #718096",$.style.borderRadius="4px",$.style.color="white",b.appendChild(N),b.appendChild($);const E=document.createElement("div");E.style.marginBottom="12px";const S=document.createElement("label");S.textContent="Number of Columns:",S.style.color="white",S.style.display="block",S.style.marginBottom="4px";const v=document.createElement("input");v.type="number",v.min="1",v.max="10",v.value="3",v.style.width="100%",v.style.padding="8px",v.style.backgroundColor="#4a5568",v.style.border="1px solid #718096",v.style.borderRadius="4px",v.style.color="white",E.appendChild(S),E.appendChild(v);const m=document.createElement("div");m.style.marginBottom="12px";const z=document.createElement("input");z.type="checkbox",z.id="includeHeader",z.checked=!0,z.style.marginRight="8px";const A=document.createElement("label");A.htmlFor="includeHeader",A.textContent="Include header row",A.style.color="white",m.appendChild(z),m.appendChild(A),D.appendChild(b),D.appendChild(E),D.appendChild(m);const h=document.createElement("button");h.textContent="Generate Table",h.style.width="100%",h.style.padding="12px",h.style.backgroundColor="#4299e1",h.style.color="white",h.style.border="none",h.style.borderRadius="8px",h.style.cursor="pointer",h.style.fontWeight="bold",h.style.transition="background-color 0.2s",h.onmouseenter=()=>h.style.backgroundColor="#3182ce",h.onmouseleave=()=>h.style.backgroundColor="#4299e1",h.onclick=()=>{const I=parseInt($.value),U=parseInt(v.value),G=z.checked;let f="";if(G){f+="|";for(let q=0;q<U;q++)f+=` Header ${q+1} |`;f+=` 2|`;for(let q=0;q<U;q++)f+="----------|";f+=` 3`}const ee=G?0:1,P=G?I:I+1;for(let q=ee;q<P;q++){f+="|";for(let oe=0;oe<U;oe++)f+=` Cell ${q+1}-${oe+1} |`;q<P-1&&(f+=` 4`)}j.replaceSelection(f),c.parentNode&&document.body.removeChild(c)},F.appendChild(_),F.appendChild(D),F.appendChild(h),c.appendChild(F),c.onclick=I=>{I.target===c&&c.parentNode&&document.body.removeChild(c)},document.body.appendChild(c)}},vo={name:"macros",keyCommand:"macros",buttonProps:{"aria-label":"Insert macros","data-tooltip-id":"mdeditor-tooltip","data-tooltip-content":"Insert Macros"},icon:e.jsx("div",{className:"flex items-center justify-center w-5 h-5",children:e.jsx(w,{icon:Gt,className:"text-current text-sm"})}),execute:(d,j)=>{const c=document.createElement("div");c.id="macros-modal",c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%",c.style.backgroundColor="rgba(0, 0, 0, 0.8)",c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.zIndex="10000",c.style.backdropFilter="blur(8px)";const F=document.createElement("div");F.style.backgroundColor="#2d3748",F.style.padding="24px",F.style.borderRadius="16px",F.style.boxShadow="0 25px 50px -12px rgba(0, 0, 0, 0.5)",F.style.width="90%",F.style.maxWidth="500px",F.style.border="1px solid #4a5568";const _=document.createElement("div");_.style.display="flex",_.style.justifyContent="space-between",_.style.alignItems="center",_.style.marginBottom="20px";const g=document.createElement("h3");g.textContent="Insert Macros",g.style.color="white",g.style.fontSize="18px",g.style.fontWeight="bold",g.style.margin="0";const i=document.createElement("button");i.innerHTML="Ã",i.style.background="none",i.style.border="none",i.style.color="white",i.style.fontSize="24px",i.style.cursor="pointer",i.style.width="32px",i.style.height="32px",i.style.borderRadius="50%",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.transition="background-color 0.2s",i.onmouseenter=()=>i.style.backgroundColor="#4a5568",i.onmouseleave=()=>i.style.backgroundColor="transparent",i.onclick=()=>{c.parentNode&&document.body.removeChild(c)},_.appendChild(g),_.appendChild(i);const D=document.createElement("div");D.style.display="grid",D.style.gridTemplateColumns="1fr",D.style.gap="12px",[{name:"Current Date",description:"Insert current date",code:"{{date:YYYY-MM-DD}}"},{name:"Current Time",description:"Insert current time",code:"{{time:HH:mm}}"},{name:"User Name",description:"Insert current user name",code:"{{user:name}}"},{name:"Random Number",description:"Generate random number",code:"{{random:1-100}}"},{name:"Page Title",description:"Insert page title",code:"{{page:title}}"},{name:"Custom Variable",description:"Insert custom variable",code:"{{var:variable_name}}"}
4].forEach(v=>{const m=document.createElement("button");m.style.padding="16px",m.style.backgroundColor="#4a5568",m.style.border="1px solid #718096",m.style.borderRadius="8px",m.style.cursor="pointer",m.style.transition="all 0.2s",m.style.textAlign="left",m.style.color="white",m.onmouseenter=()=>{m.style.backgroundColor="#5a67d8",m.style.borderColor="#5a67d8",m.style.transform="translateY(-2px)"},m.onmouseleave=()=>{m.style.backgroundColor="#4a5568",m.style.borderColor="#718096",m.style.transform="translateY(0)"},m.onclick=()=>{j.replaceSelection(v.code),c.parentNode&&document.body.removeChild(c)};const z=document.createElement("div");z.textContent=v.name,z.style.fontWeight="bold",z.style.marginBottom="4px";const A=document.createElement("div");A.textContent=v.description,A.style.fontSize="12px",A.style.color="#cbd5e0";const h=document.createElement("div");h.textContent=v.code,h.style.fontFamily="monospace",h.style.fontSize="11px",h.style.color="#90cdf4",h.style.marginTop="8px",h.style.padding="4px 8px",h.style.backgroundColor="#2d3748",h.style.borderRadius="4px",m.appendChild(z),m.appendChild(A),m.appendChild(h),D.appendChild(m)});const N=document.createElement("div");N.style.marginTop="20px",N.style.paddingTop="20px",N.style.borderTop="1px solid #4a5568";const $=document.createElement("label");$.textContent="Custom Macro:",$.style.color="white",$.style.display="block",$.style.marginBottom="8px",$.style.fontSize="14px";const E=document.createElement("input");E.type="text",E.placeholder="Enter custom macro code...",E.style.width="100%",E.style.padding="12px",E.style.backgroundColor="#4a5568",E.style.border="1px solid #718096",E.style.borderRadius="8px",E.style.color="white",E.style.marginBottom="12px";const S=document.createElement("button");S.textContent="Insert Custom Macro",S.style.width="100%",S.style.padding="12px",S.style.backgroundColor="#4299e1",S.style.color="white",S.style.border="none",S.style.borderRadius="8px",S.style.cursor="pointer",S.style.fontWeight="bold",S.style.transition="background-color 0.2s",S.onmouseenter=()=>S.style.backgroundColor="#3182ce",S.onmouseleave=()=>S.style.backgroundColor="#4299e1",S.onclick=()=>{E.value.trim()&&(j.replaceSelection(E.value.trim()),c.parentNode&&document.body.removeChild(c))},N.appendChild($),N.appendChild(E),N.appendChild(S),F.appendChild(_),F.appendChild(D),F.appendChild(N),c.appendChild(F),c.onclick=v=>{v.target===c&&c.parentNode&&document.body.removeChild(c)},document.body.appendChild(c)}},pt=({form:d,index:j,updateForm:c,removeForm:F,activePins:_,setActivePins:g,moveFormUp:i,moveFormDown:D,isFirst:b,isLast:N})=>{var Y,ae,Ne,ke;const[$,E]=p.useState(!1),[S,v]=p.useState(d.customWidth||33),[m,z]=p.useState(!d.unique_id),[A,h]=p.useState(!1),I=()=>d.imageUrl||d.imageFile?"images":"text",[U,G]=p.useState(I),[f,ee]=p.useState(null),[P,q]=p.useState(d.imageUrl||null),oe=[Qt,Jt,eo,to,po([ho,xo,go,bo,fo,yo],{name:"title",groupName:"title",buttonProps:{"aria-label":"Insert title","data-tooltip-id":"mdeditor-tooltip","data-tooltip-content":"Headings"}}),$e,oo,so,ao,ro,lo,io,$e,no,co,mo,wo,vo,$e,mt(!1),mt(!0)],ne=(n,C)=>{if(n.target.files&&n.target.files.length>0){const M=n.target.files[0];ee(M);const de=URL.createObjectURL(M);q(de),c(C,"imageFile",M),c(C,"imageUrl",de),c(C,"url","")}},ue=n=>{P&&P.startsWith("blob:")&&URL.revokeObjectURL(P),ee(null),q(null),c(n,"imageFile",null),c(n,"imageUrl","")},Z=n=>{n.stopPropagation()},V=()=>{d.unique_id&&(navigator.clipboard.writeText(d.unique_id),h(!0),setTimeout(()=>h(!1),2e3))},B=n=>{var C;return n.user_email||((C=n.user)==null?void 0:C.email)||(n.post_type==="visitor"?"Visitor Submission":"")};p.useEffect(()=>{d.customWidth&&v(d.customWidth)},[d.customWidth]),p.useEffect(()=>{d.imageUrl&&!P&&d.imageUrl.startsWith("blob:")&&q(d.imageUrl)},[d.imageUrl,P]),p.useEffect(()=>()=>{P&&P.startsWith("blob:")&&URL.revokeObjectURL(P)},[P]);const T=()=>{E(!1)};return p.useEffect(()=>()=>{document.removeEventListener("mouseup",T)},[]),e.jsxs("div",{id:`frame-${d.id}`,className:"border border-gray-700 rounded-lg p-4 space-y-4 bg-gray-800/80",children:[e.jsx("input",{type:"hidden",value:d.approve||"APPROVED",onChange:n=>c(d.id,"approve",n.target.value)}),e.jsx("div",{className:"flex justify-between items-center",children:e.jsxs("div",{className:"flex items-center gap-4",children:[d.unique_id&&e.jsxs("div",{className:"flex items-center bg-purple-600 rounded text-xs font-mono",children:[e.jsxs("a",{href:`https://ez.wiki/${d.unique_id}`,target:"_blank",rel:"noopener noreferrer",className:"text-white pl-2 py-1 cursor-pointer hover:underline","data-tooltip-id":"form-tooltip","data-tooltip-content":`Frame ID: ${d.unique_id}`,children:["ID: ",d.unique_id]}),e.jsx("button",{type:"button",onClick:V,className:"text-purple-200 hover:text-white hover:bg-purple-700/50 transition-colors duration-200 focus:outline-none px-2 py-1 rounded-r","data-tooltip-id":"action-tooltip","data-tooltip-content":A?"Copied!":"Copy ID",children:e.jsx(w,{icon:A?ut:Ut,className:"h-3 w-3"})})]}),d.post_type==="visitor"&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{"data-tooltip-id":"form-tooltip","data-tooltip-content":B(d)?`Crowd Submission by: ${B(d)}`:"Crowd Submission",children:B(d)&&B(d)!=="Visitor Submission"&&e.jsx("a",{href:`mailto:${B(d)}`,className:"text-xs text-cyan-300 bg-cyan-900/30 px-2 py-1 rounded hover:bg-cyan-800/50 hover:text-cyan-200 transition-colors duration-200",onClick:n=>n.stopPropagation(),title:`Send email to ${B(d)}`,children:e.jsx(w,{icon:qt,className:"text-cyan-400"})})})}),e.jsx("button",{onClick:()=>F(d.id),onMouseDown:Z,className:"text-rose-500 hover:text-rose-400 transition-colors","aria-label":`Remove form ${d.id}`,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Remove this frame",children:e.jsx(w,{icon:se})}),e.jsx("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-white transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-lime-400 rounded-full",onClick:()=>z(!m),"data-tooltip-id":"action-tooltip","data-tooltip-content":m?"Collapse Frame":"Expand Frame",children:e.jsx(w,{icon:m?Vt:Bt,className:"h-4 w-4"})})]})}),m&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-4 text-yellow-400 text-sm font-semibold",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"Emoji Markers"}),e.jsx(w,{icon:dt,className:"text-yellow-400 hover:text-yellow-300 cursor-help transition-colors","data-tooltip-id":"form-tooltip","data-tooltip-content":"Emoji markers determine frame width: 1ï¸â£=Custom, 2ï¸â£=42%, 3ï¸â£=50%, 4ï¸â£=66%, 5ï¸â£=100%"})]}),e.jsxs("select",{onMouseDown:Z,className:"w-full rounded-lg border border-gray-600 bg-gray-700 text-white text-sm px-4 py-2 focus:ring-2 focus:ring-yellow-400 focus:border-transparent h-10",value:d.emojiMarker,onCh
4ange:n=>c(d.id,"emojiMarker",n.target.value),"data-tooltip-id":"form-tooltip","data-tooltip-content":"Select the frame's size or type",children:[e.jsx("option",{value:"1ï¸â£",children:"1ï¸â£ = Frame width Custom"}),e.jsx("option",{value:"2ï¸â£",children:"2ï¸â£ = Frame width 42%"}),e.jsx("option",{value:"3ï¸â£",children:"3ï¸â£ = Frame width 50%"}),e.jsx("option",{value:"4ï¸â£",children:"4ï¸â£ = Frame width 66%"}),e.jsx("option",{value:"5ï¸â£",children:"5ï¸â£ = Frame width 100%"}),e.jsx("option",{value:"0ï¸â£",children:"0ï¸â£ = Frame kept but hidden from display"}),e.jsx("option",{value:"ð",children:"ð For password protected frames"}),e.jsx("option",{value:"ð",children:"ð For redirect link"}),e.jsx("option",{value:"ð§¨",children:"𧨠For multiredirect link"})]})]}),e.jsx("div",{className:"space-y-3",children:d.emojiMarker==="1ï¸â£"&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{htmlFor:"custom-width-input",className:"flex items-center gap-2 text-sm font-medium text-white",children:[e.jsx("span",{children:"Width"}),e.jsx(w,{icon:dt,className:"text-yellow-400 hover:text-yellow-300 cursor-help transition-colors","data-tooltip-id":"form-tooltip","data-tooltip-content":"Adjust the custom width percentage for this frame (10-100%)","aria-label":"Width information"})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{id:"custom-width-input",type:"number",min:"10",max:"100",value:S,onChange:n=>{const C=Number(n.target.value);v(C),c(d.id,"customWidth",C)},className:"flex-1 border border-gray-600 bg-gray-700 text-white text-sm px-4 py-2.5 focus:ring-2 focus:ring-yellow-400 focus:border-transparent outline-none rounded-l-lg rounded-r-none border-r-0 transition-colors",placeholder:"Enter width (10-100)","aria-describedby":"width-percentage","data-tooltip-id":"form-tooltip","data-tooltip-content":"Adjust the custom width for this frame"}),e.jsx("span",{id:"width-percentage",className:"inline-flex items-center bg-gradient-to-r from-green-700 to-green-600 text-white px-4 py-2.5 text-sm font-medium border border-l-0 border-green-600 rounded-r-lg rounded-l-none min-h-[44px]",children:"%"})]})]})})]}),e.jsxs("div",{className:"w-full p-2 rounded-xl bg-slate-800/60 backdrop-blur-sm shadow-2xl space-y-4",children:[e.jsxs("div",{className:"flex border-b border-slate-700",children:[e.jsx("button",{onClick:()=>{G("text"),c(d.id,"imageUrl","")},className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors duration-200 focus:outline-none ${U==="text"?"border-lime-400 text-white":"border-transparent text-slate-400 hover:text-white"}`,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Paste",children:"Markdown/EmbedCode/URL/SimpleText"}),e.jsx("button",{onClick:()=>{G("images"),c(d.id,"url","")},className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors duration-200 focus:outline-none ${U==="images"?"border-lime-400 text-white":"border-transparent text-slate-400 hover:text-white"}`,"data-tooltip-id":"action-tooltip","data-tooltip-content":"PDF/Image/Video/Audio",children:"Upload"})]}),e.jsxs("div",{className:"pt-4",children:[U==="text"&&e.jsx("div",{className:"space-y-3",children:e.jsx("div",{className:"grid grid-cols-1 gap-4",children:e.jsxs("div",{className:"flex border-2 border-green-600 rounded-xl overflow-hidden bg-gray-800",children:[e.jsxs("div",{className:"bg-gradient-to-r from-green-700 to-green-600 flex items-center justify-center px-5 text-3xl w-20",children:[e.jsx("button",{onClick:()=>i(j),disabled:b,className:"text-gray-200 hover:text-white disabled:opacity-30","data-tooltip-id":"action-tooltip","data-tooltip-content":"Move this frame up",children:"â"}),e.jsx("button",{onClick:()=>D(j),disabled:N,className:"text-gray-200 hover:text-white disabled:opacity-30","data-tooltip-id":"action-tooltip","data-tooltip-content":"Move this frame down",children:"â"})]}),e.jsx("div",{className:"enhanced-md-editor flex-1 w-full relative","data-color-mode":"dark","data-tooltip-id":"form-tooltip","data-tooltip-content":"Enter the URL, embed code, or Markdown content",style:{minHeight:"150px"},onMouseDown:Z,children:e.jsx(uo,{value:d.url,onChange:n=>{c(d.id,"url",n||""),c(d.id,"imageUrl","")},commands:oe,textareaProps:{placeholder:"Enter URL, embedded code, or Markdown content..."},preview:"live"})}),e.jsxs("button",{onMouseDown:Z,className:`flex flex-col items-center justify-center px-4 space-y-1 transition-all duration-200 w-20 focu
4s:outline-none focus:ring-2 ${_[d.id]?"bg-gradient-to-r from-blue-700 to-blue-600 text-white focus:ring-blue-400":d.post_type==="visitor"&&d.approve==="NOT APPROVED"?d.emojiMarker==="0ï¸â£"?"bg-gradient-to-r from-red-700 to-red-600 text-white focus:ring-red-400":d.emojiMarker==="1ï¸â£"?"bg-gradient-to-r from-yellow-700 to-yellow-600 text-white focus:ring-yellow-400":"bg-gradient-to-r from-green-700 to-green-600 text-white focus:ring-green-400":"bg-gradient-to-r from-green-700 to-green-600 text-white focus:ring-green-400"}`,type:"button",onClick:()=>g(n=>({...n,[d.id]:!n[d.id]})),"data-tooltip-id":"action-tooltip","data-tooltip-content":"Pin this frame to show it by default",children:[_[d.id]?e.jsx(w,{icon:ct,className:"text-xl text-yellow-300"}):e.jsx(w,{icon:ct,className:d.post_type==="visitor"&&d.approve==="NOT APPROVED"?d.emojiMarker==="0ï¸â£"?"text-xl text-red-400":d.emojiMarker==="1ï¸â£"?"text-xl text-yellow-300":"text-xl text-green-400":"text-xl text-green-400"}),e.jsx("span",{className:"font-medium text-sm",children:_[d.id]?"Pinned":"Pin It"}),e.jsx("span",{className:"text-xs opacity-80",children:"</>"})]})]})})}),U==="images"&&e.jsxs("div",{className:"space-y-3 animate-fadeIn",children:[e.jsx("label",{className:"text-sm font-semibold text-lime-400",children:"Upload Media (Image, PDF, Video, Audio)"}),!P&&!f?e.jsxs("label",{htmlFor:`dropzone-file-${d.id}`,className:"flex flex-col items-center justify-center w-full h-40 border-2 border-dashed border-gray-600 rounded-xl cursor-pointer bg-gray-800/30 hover:bg-gray-800/50 transition-all duration-200 group",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[e.jsx("svg",{className:"w-12 h-12 mb-3 text-gray-500 group-hover:text-lime-400 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),e.jsxs("p",{className:"mb-1 text-sm text-gray-400 group-hover:text-lime-300",children:[e.jsx("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),e.jsx("p",{className:"text-xs text-gray-500",children:"SVG, PNG, JPG, GIF, WEBP, PDF, MP4, WEBM, MOV, AVI, MP3, WAV, OGG, M4A (Max 100MB)"})]}),e.jsx("input",{id:`dropzone-file-${d.id}`,type:"file",className:"hidden",accept:"image/*,.pdf,video/*,audio/*,.mp4,.webm,.mov,.avi,.mp3,.wav,.ogg,.m4a",onChange:n=>ne(n,d.id)})]}):e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{className:"relative group bg-gray-800/40 rounded-lg p-3 border border-gray-600",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[(f==null?void 0:f.type)==="application/pdf"||(Y=d.imageUrl)!=null&&Y.toLowerCase().endsWith(".pdf")||(ae=d.imageUrl)!=null&&ae.includes("/pdf/")?e.jsx("div",{className:"w-16 h-16 bg-red-600 rounded flex items-center justify-center overflow-hidden",children:e.jsxs("div",{className:"text-white text-center",children:[e.jsx(w,{icon:Wt,className:"text-2xl mb-1"}),e.jsx("span",{className:"text-xs block",children:"PDF"})]})}):f!=null&&f.type.startsWith("video/")||(Ne=d.imageUrl)!=null&&Ne.match(/\.(mp4|webm|mov|avi)$/i)?e.jsxs("div",{className:"w-16 h-16 bg-purple-600 rounded flex items-center justify-center overflow-hidden relative",children:[e.jsxs("div",{className:"text-white text-center",children:[e.jsx(w,{icon:Ht,className:"text-2xl mb-1"}),e.jsx("span",{className:"text-xs block",children:"Video"})]}),P&&e.jsx("video",{src:P,className:"absolute inset-0 w-full h-full object-cover opacity-20",muted:!0})]}):f!=null&&f.type.startsWith("audio/")||(ke=d.imageUrl)!=null&&ke.match(/\.(mp3|wav|ogg|m4a)$/i)?e.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded flex items-center justify-center overflow-hidden",children:e.jsxs("div",{className:"text-white text-center",children:[e.jsx(w,{icon:Ot,className:"text-2xl mb-1"}),e.jsx("span",{className:"text-xs block",children:"Audio"})]})}):e.jsx("div",{className:"w-16 h-16 bg-gray-700 rounded flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:P,alt:"Preview",className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-white truncate",children:f?f.name:"Uploaded File"}),e.jsx("p",{className:"text-xs text-gray-400",children:f?`${(f.size/1024/1024).toFixed(2)} MB`:"File"}),e.jsx("p",{className:"text-xs text-blue-400",children:(f==null?void 0:f.type)==="application/pdf"?"PDF Document":f!=null&&f.type.startsWith("video/")?"Video File":f!=null&&f.type.startsWith("audio/")?"Audio File":"Image"})]}),e.jsx("button",{onClick:()=>ue(d.id),className:"w-6 h-6 flex items-center justify-center rounded-full bg-red-500/20 hover:bg-red-500/40 text-red-400 hover:text-red-300 transition-colors",children:"Ã"})]}),(f==null?void 0:f.type.startsWith("video/"))&&P&&e.jsx("div",{className:"mt-3",children:e.jsx("video",{src:P,controls:!0,className:"w-full rounded-lg",preload:"metadata",children:"Your browser does not support the video tag."})}),(f==null?void 0:f.type.startsWith("audio/"))&&P&&e.jsx("div",{className:"mt-3",children:e.jsx("audio",{src:P,controls:!0,className:"w-full",preload:"metadata",children:"Your browser does not support the audio element."})})]})})]})]})]})]})]})},je={flySign:!1,eyeTracking:!1,visibility:!1,seoTag:"",theme:[],color:"#4ade80",transparency:80,mode:"light",autoApproveTime:"02:00",approve:"APPROVED",designView:"A",displaymode:"dressed"};function zo(){const d=it().props;p.useRef(null);const[j,c]=p.useState(!0),[F,_]=p.useState({}),{auth:g,template:i,initialFunnels:D}=it().props,[b,N]=p.useState([{id:0,unique_id:"",emojiMarker:"1ï¸â£",url:"",imageUrl:"",imageFile:null,reference:"",customWidth:33,post_type:"user",approve:"APPROVED",user_email:""}]),[$,E]=p.useState(1),[S,v]=p.useState(!1),[m,z]=p.useState(null),[A,h]=p.useState(!1),[I,U]=p.useState(!1),[G,f]=p.useState(!1),[ee,P]=p.useState(!1),[q,oe]=p.useState({}),[ne,ue]=p.useState({}),[Z,V]=p.useState(""),[B,T]=p.useState(""),[Y,ae]=p.useState(80),[Ne,ke]=p.useState(null),[n,C]=p.useState(je),[M,de]=p.useState(null),[Q,he]=p.useState(!1),[J,xe]=p.useState([]),[ge,Re]=p.useState(""),[re,be]=p.useState("fuzzy"),[Pe,Ae]=p.useState(1),[Ie,fe]=p.useState(!0),[k,ht]=p.useState({userTemplates:[],defaultTemplates:[],themecollections:[]}),[xt,ye]=p.useState(!1),[Ce,gt]=p.useState("https://linktr.ee/demo"),[Fe,bt]=p.useState("X1234"),[Le,Ue]=p.useState(!1),[ft,qe]=p.useState(!1),[Ve,Be]=p.useState(!1),[H,We]=p.useState(null),[X,He]=p.useState(null),[jo,yt]=p.useState(null),wt=async t=>{var o,s,u;try{oe(x=>({...x,[t]:!0}));const r=`https://ez.wiki/${t}`,a=((o=document.querySelector('meta[name="csrf-token"]'))==null?void 0:o.getAttribute("content"))||"",l=new FormData;l.append("frame_url",r),l.append("frame_unique_id",t);const y=await W.post("/ezframepostinlinkedin",l,{headers:{"X-CSRF-TOKEN":a,"X-Requested-With":"XMLHttpRequest"}});y.data.success?V("Frame successfully posted to LinkedIn!"):T(y.data.message||"Failed to post frame to LinkedIn")}catch(r){console.error("LinkedIn frame post error:",r),T(((u=(s=r.response)==null?void 0:s.data)==null?void 0:u.message)||"Failed to post frame to LinkedIn. Please try again.")}finally{oe(r=>({...r,[t]:!1}))}},vt=async t=>{var o;try{ue(l=>({...l,[t]:!0}));const s=`https://ez.wiki/${t}`,u=((o=document.querySelector('meta[name="csrf-token"]'))==null?void 0:o.getAttribute("content"))||"",r=new FormData;r.append("frame_url",s),r.append("frame_unique_id",t);const a=await W.post("/ezframepostinreddit",r,{headers:{"X-CSRF-TOKEN":u,"X-Requested-With":"XMLHttpRequest"}});a.data.success?V("Frame successfully posted to Reddit!"):T(a.data.message||"Failed to post frame to Reddit")}catch(s){console.error("Reddit frame share error:",s),T("Failed to open Reddit share. Please try again.")}finally{ue(s=>({...s,[t]:!1}))}},Oe=async t=>{var o;try{P(!0);const s=((o=document.querySelector('meta[name="csrf-token"]'))==null?void 0:o.getAttribute("content"))||"",u=`https://ez.wiki/${t.token}`,r=`My EZ Funnel: ${t.token}`,a=new FormData;a.append("funnel_url",u),a.append("post_title",r),a.append("funnel_token",t.token),a.append("funnel_id",t.id.toString());const l=await W.post("/ezfunnelpostinreddit",a,{headers:{"X-CSRF-TOKEN":s,"X-Requested-With":"XMLHttpRequest"}});l.data.success?V("Funnel successfully posted to Reddit!"):T(l.data.message||"Failed to post to Reddit")}catch(s){console.error("Reddit share error:",s),T("Failed to open Reddit share. Please try again.")}finally{P(!1)}};p.useEffect(()=>{console.log("Funnels data:",J),J.length>0&&(console.log("First funnel fields:",J[0].fields),J[0].fields&&J[0].fields.length>0&&(console.log("First field data:",J[0].fields[0]),console.log("First field user data:",J[0].fields[0].user)))},[J]);const Xe=t=>{C(o=>({...o,color:t.target.value}))},Se=t=>{t<=0||N(o=>{const s=[...o];return[s[t],s[t-1]]=[s[t-1],s[t]],s})},Te=t=>{N(o=>{if(t>=o.length-1)return o;const s=[...o];return[s[t],s[t+1]]=[s[t+1],s[t]],s})},jt=async()=>{try{Be(!0),T(""),V("");const o=(await W.get("/generate-bio-excreate",{params:{url:Ce}})).data,s=o.map((r,a)=>{var l;return{id:a,unique_id:r.unique_id||"",emojiMarker:r.emoji_marker||"1ï¸â£",url:r.url||"",imageUrl:"",imageFile:null,reference:r.reference||"",customWidth:r.custom_width||33,post_type:r.post_type||"user",approve:r.approve||"APPROVED",user_email:r.user_email||((l=r.user)==null?void 0:l.email)||""}}),u=o.reduce((r,a,l)=>(r[l]=a.pinned||!1,r),{});N(s),_(u),E(s.length),V("Data extracted successfully from URL!"),ye(!1)}catch(t){console.error("Multi Iframe extraction error:",t),T("Failed to extract data from URL. Please check the URL and try again.")}finally{Be(!1)}};p.useEffect(()=>{if(B){const t=setTimeout(()=>{T("")},5e3);return()=>clearTimeout(t)}},[B]);const Ge=async(t,o)=>{z({id:t,type:"funnel",name:`Funnel: ez.wiki/${o}`}),v(!0)},Ze=async(t,o,s)=>{z({id:t,type:"customDomain",name:`Custom Domain: ${s}/${o}`}),v(!0)},Ye=async(t,o,s)=>{z({id:t,type:"handleDomain",name:`Handle Domain: ${o}.${s}`}),v(!0)},Nt=async()=>{var t,o;if(m)try{We(m.id),He(m.type);let s;switch(m.type){case"funnel":s=await W.delete(`/ez-funnels/${m.id}`);break;case"customDomain":s=await W.delete(`/custom-domains/${m.id}`);break;case"handleDomain":s=await W.delete(`/handle-domains/${m.id}`);break}s!=null&&s.data.success?(V(`${m.type==="funnel"?"Funnel":m.type==="customDomain"?"Custom domain":"Handle domain"} deleted successfully`),te()):T((s==null?void 0:s.data.message)||`Failed to delete ${m.type}`)}catch(s){console.error("Delete error:",s),T(((o=(t=s.response)==null?void 0:t.data)==null?void 0:o.message)||`Failed to delete ${m.type}`)}finally{We(null),He(null),v(!1),z(null)}},Ke=async t=>{var o,s,u;try{f(!0);const r=((o=document.querySelector('meta[name="csrf-token"]'))==null?void 0:o.getAttribute("content"))||"",a=`https://ez.wiki/${t.token}`,l=`My EZ Funnel: ${t.token}`,y=new FormData;y.append("funnel_url",a),y.append("post_title",l),y.append("funnel_token",t.token),y.append("funnel_id",t.id.toString());const x=await W.post("/ezfunnelpostinlinkedin",y,{headers:{"X-CSRF-TOKEN":r,"X-Requested-With":"XMLHttpRequest"}});x.data.success?V("Funnel successfully posted to LinkedIn!"):T(x.data.message||"Failed to post to LinkedIn")}catch(r){console.error("LinkedIn post error:",r),T(((u=(s=r.response)==null?void 0:s.data)==null?void 0:u.message)||"Failed to post to LinkedIn. Please try again.")}finally{f(!1)}},kt=async()=>{try{U(!0),T(""),V("");const o=(await W.get(`https://4x4.ai/api/_ezimport?token=${Fe}`)).data,s=o.map((r,a)=>{var l;return{id:a,unique_id:r.unique_id||"",emojiMarker:r.emoji_marker||"1ï¸â£",url:r.url||"",imageUrl:"",imageFile:null,reference:r.reference||"",customWidth:r.custom_width||33,post_type:r.post_type||"user",approve:r.approve||"APPROVED",user_email:r.user_email||((l=r.user)==null?void 0:l.email)||""}}),u=o.reduce((r,a,l)=>(r[l]=a.pinned||!1,r),{});N(s),_(u),E(s.length),ye(!1),V("Data extracted successfully!")}catch(t){console.error("Extraction error:",t),T("Failed to extract data. Please check the handle and try again.")}finally{U(!1)}},Qe=t=>{C(o=>o.theme.includes(t)?{...o,theme:o.theme.filter(s=>s!==t)}:{...o,theme:[...o.theme,t]})},Je=t=>{t<=0||C(o=>{const s=[...o.theme];return[s[t],s[t-1]]=[s[t-1],s[t]],{...o,theme:s}})},et=t=>{C(o=>{if(t>=o.theme.length-1)return o;const s=[...o.theme];return[s[t],s[t+1]]=[s[t+1],s[t]],{...o,theme:s}})},tt=p.useCallback(t=>{try{return new URL(t),!0}catch{return!1}},[]),ce=p.useCallback(t=>{var s;return(s=t.split("?")[0].split(".").pop())==null?void 0:s.toLowerCase()},[]),me=p.useCallback(t=>t?["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"].includes(t):!1,[]),Ct=p.useMemo(()=>
4{if(!(i!=null&&i.image))return null;const t=ce(i.image)||"";return me(t)?e.jsx("style",{children:` 5 .blur-bg { 6 background: url('${i.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${i.image}') no-repeat center center; 7 background-size: cover; 8 } 9 `}):null},[i,ce,me]);p.useEffect(()=>{const t=async()=>{var o,s,u;try{const r=await fetch("/templates",{headers:{"Content-Type":"application/json","X-CSRF-TOKEN":((o=document.querySelector('meta[name="csrf-token"]'))==null?void 0:o.getAttribute("content"))||""}});if(!r.ok)throw new Error("Failed to fetch templates");const a=await r.json();ht({userTemplates:a.userTemplates||[],defaultTemplates:a.defaultTemplates||[],themecollections:a.themecollections||[]});const l=((s=a.userTemplates[0])==null?void 0:s.id)||((u=a.defaultTemplates[0])==null?void 0:u.id);l&&C(y=>({...y,theme:l?[l.toString()]:[]}))}catch(r){console.error("Error fetching templates:",r)}};g.user&&t()},[g.user]);const we=t=>{const o={id:$,unique_id:"",emojiMarker:"1ï¸â£",url:"",imageUrl:"",imageFile:null,reference:"",customWidth:33,post_type:"user",approve:"APPROVED",user_email:""};N(t==="top"?[o,...b]:[...b,o]),E($+1)},ot=p.useCallback((t,o,s)=>{N(u=>u.map(r=>r.id===t?{...r,[o]:s}:r))},[]),st=t=>{N(b.filter(o=>o.id!==t))},_e=()=>{var o,s;N([{id:0,unique_id:"",emojiMarker:"1ï¸â£",url:"",imageUrl:"",imageFile:null,reference:"",customWidth:33,post_type:"user",approve:"APPROVED",user_email:""}]),E(1);const t=((o=k.userTemplates[0])==null?void 0:o.id)||((s=k.defaultTemplates[0])==null?void 0:s.id);C({...je,theme:t?[t.toString()]:[]}),_({}),V(""),T("")},Ft=async()=>{var t,o,s,u,r;try{U(!0),V(""),T("");const a=((t=document.querySelector('meta[name="csrf-token"]'))==null?void 0:t.getAttribute("content"))||"",l=new FormData;l.append("flySign",n.flySign?"1":"0"),l.append("eyeTracking",n.eyeTracking?"1":"0"),l.append("visibility",n.visibility?"1":"0"),l.append("seoTag",n.seoTag||""),l.append("theme",n.theme.join(",")),l.append("color",n.color),l.append("transparency",Y.toString()),l.append("mode",n.mode),l.append("autoApproveTime",n.autoApproveTime||""),l.append("designView",n.designView||"A"),l.append("displaymode",n.displaymode||"dressed");for(let R=0;R<b.length;R++){const K=b[R];let pe=K.url||"";l.append(`dynamicFields[${R}][emojiMarker]`,K.emojiMarker),l.append(`dynamicFields[${R}][url]`,pe),l.append(`dynamicFields[${R}][reference]`,K.reference||""),l.append(`dynamicFields[${R}][pinned]`,F[K.id]?"1":"0"),l.append(`dynamicFields[${R}][customWidth]`,(K.customWidth||33).toString()),l.append(`dynamicFields[${R}][post_type]`,K.post_type||"user"),l.append(`dynamicFields[${R}][approve]`,K.approve||"APPROVED"),K.imageFile&&l.append(`dynamicFields[${R}][image]`,K.imageFile)}const x=(await W.post("/save-ez-funnel",l,{headers:{"X-CSRF-TOKEN":a,"X-Requested-With":"XMLHttpRequest"}})).data.token;V(e.jsxs(e.Fragment,{children:["EZ Funnel saved successfully!"," ",e.jsxs("a",{href:`https://ez.wiki/${x}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-2 py-1 text-sm bg-yellow-400 text-black rounded-md hover:bg-yellow-500 transition-colors ml-2",children:["https://ez.wiki/",x]})]})),te(),N([{id:0,unique_id:"",emojiMarker:"1ï¸â£",url:"",imageUrl:"",imageFile:null,reference:"",customWidth:33,post_type:"user",approve:"APPROVED",user_email:""}]),E(1);const L=((o=k.userTemplates[0])==null?void 0:o.id)||((s=k.defaultTemplates[0])==null?void 0:s.id);C({...je,theme:L?[L.toString()]:[]}),_({}),h(!1)}catch(a){console.error("Error:",a),T(((r=(u=a.response)==null?void 0:u.data)==null?void 0:r.message)||"Failed to save EZ Funnel. Please try again."),setTimeout(()=>T(""),1e4)}finally{U(!1)}},at=t=>{const o=[...t.fields].sort((r,a)=>(a.pinned?1:0)-(r.pinned?1:0)),s=t.transparency??80;de({id:t.id,token:t.token,flySign:t.fly_sign,eyeTracking:t.eye_tracking,visibility:t.visibility!==void 0?t.visibility:!0,seoTag:t.seo_tag,theme:t.theme?t.theme.split(",").filter(Boolean):[],color:t.color||"#4ade80",transparency:s,mode:t.mode||"light",designView:t.design_view||"A",displaymode:t.displaymode||"dressed",fields:t.fields.map(r=>{var a;return{id:r.id,unique_id:r.unique_id||"",emojiMarker:r.emoji_marker,url:r.url,imageUrl:r.image_url,reference:r.reference,pinned:r.pinned,custom_width:r.custom_width,post_type:r.post_type,approve:r.approve||"APPROVED",user_email:((a=r.user)==null?void 0:a.email)||r.user_email||""}})}),C({flySign:t.fly_sign,eyeTracking:t.eye_tracking,visibility:t.visibility!==void 0?t.visibility:!0,seoTag:t.seo_tag,theme:t.theme?t.theme.split(",").filter(
9Boolean):[],color:t.color||"#4ade80",transparency:s,mode:t.mode||"light",autoApproveTime:t.auto_approve_time||"02:00",designView:t.design_view||"A",displaymode:t.displaymode||"dressed"}),ae(s),N(o.map(r=>{var a;return{id:r.id,unique_id:r.unique_id||"",emojiMarker:r.emoji_marker,url:r.url||"",imageUrl:r.image_url||"",imageFile:null,reference:r.reference,customWidth:r.custom_width||33,post_type:r.post_type,approve:r.approve||"APPROVED",user_email:((a=r.user)==null?void 0:a.email)||r.user_email||""}}));const u=t.fields.reduce((r,a)=>(r[a.id]=!!a.pinned,r),{});_(u),he(!0)},Ee=async()=>{var t,o,s,u,r;try{U(!0),V(""),T("");const a=((t=document.querySelector('meta[name="csrf-token"]'))==null?void 0:t.getAttribute("content"))||"",l=new FormData;l.append("id",((o=M==null?void 0:M.id)==null?void 0:o.toString())||""),l.append("flySign",n.flySign?"1":"0"),l.append("eyeTracking",n.eyeTracking?"1":"0"),l.append("visibility",n.visibility?"1":"0"),l.append("seoTag",n.seoTag||""),l.append("theme",n.theme.join(",")),l.append("color",n.color),l.append("transparency",Y.toString()),l.append("mode",n.mode),l.append("autoApproveTime",n.autoApproveTime||""),l.append("designView",n.designView||"A"),l.append("displaymode",n.displaymode||"dressed"),l.append("_method","PUT");for(let x=0;x<b.length;x++){const L=b[x];let R=L.url||"";l.append(`dynamicFields[${x}][id]`,((s=L.id)==null?void 0:s.toString())||""),l.append(`dynamicFields[${x}][emojiMarker]`,L.emojiMarker),l.append(`dynamicFields[${x}][url]`,R),l.append(`dynamicFields[${x}][reference]`,L.reference||""),l.append(`dynamicFields[${x}][pinned]`,F[L.id]?"1":"0"),l.append(`dynamicFields[${x}][customWidth]`,(L.customWidth||33).toString()),l.append(`dynamicFields[${x}][post_type]`,L.post_type||"user"),l.append(`dynamicFields[${x}][approve]`,L.approve||"APPROVED"),l.append(`dynamicFields[${x}][imageUrl]`,L.imageUrl||""),L.imageFile&&l.append(`dynamicFields[${x}][image]`,L.imageFile)}const y=await W.post("/update-ez-funnel",l,{headers:{"X-CSRF-TOKEN":a,"X-Requested-With":"XMLHttpRequest"}});V(e.jsxs(e.Fragment,{children:["EZ Funnel updated successfully!"," ",e.jsxs("a",{href:`https://ez.wiki/${(M==null?void 0:M.token)||""}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-2 py-1 text-sm bg-yellow-400 text-black rounded-md hover:bg-yellow-500 transition-colors ml-2",children:["https://ez.wiki/",(M==null?void 0:M.token)||""]})]})),setTimeout(()=>{var L,R;te(),N([{id:0,unique_id:"",emojiMarker:"1ï¸â£",url:"",imageUrl:"",imageFile:null,reference:"",customWidth:33,post_type:"user",approve:"APPROVED",user_email:""}]),E(1);const x=((L=k.userTemplates[0])==null?void 0:L.id)||((R=k.defaultTemplates[0])==null?void 0:R.id);C({...je,theme:x?[x.toString()]:[]}),_({}),he(!1),de(null)},3e3)}catch(a){console.error("Error:",a),T(((r=(u=a.response)==null?void 0:u.data)==null?void 0:r.message)||"Failed to update EZ Funnel. Please try again."),setTimeout(()=>T(""),1e4)}finally{U(!1)}},St=p.useCallback(async()=>{Ue(!0);try{const t={formData:n,dynamicForms:b.map(o=>({...o,pinned:!!F[o.id]})),themes:n.theme.map(o=>[...k.userTemplates,...k.defaultTemplates,...k.themecollections].find(u=>u.id.toString()===o)).filter(Boolean),isEditing:Q,editingFunnelId:M==null?void 0:M.id,isSinglePreview:!1};sessionStorage.setItem("ezFunnelPreview",JSON.stringify(t)),await W.post("/store-preview-data",{previewData:t}),qe(!0)}catch(t){console.error("Preview error:",t),T(t.message||"Failed to prepare preview. Please try again."),setTimeout(()=>T(""),5e3)}finally{Ue(!1)}},[n,b,F,k,Q,M]),Me=()=>e.jsx("button",{className:"bg-gradient-to-r flex from-blue-600 to-blue-500 text-white rounded-lg px-4 py-2 font-medium hover:shadow-lg hover:from-blue-700 hover:to-blue-600 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-blue-400",type:"button",onClick:St,disabled:Le,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Preview your entire creation",children:Le?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Preparing..."]}):"Preview"}),Tt=async()=>{try{const o=(await W.get("/loadframe/demo")).data;N(o.fields.map((s,u)=>{var r;return{id:u,unique_id:s.unique_id||"",emojiMarker:s.emoji_marker||"1ï¸â£",url:s.url||"",imageUrl:"",imageFile:null,reference:s.reference||"",customWidth:s.custom_width||33,post_type:s.post_type||"user",approve:s.approve||"APPROVED",user_email:s.user_email||((r=s.user)==null?void 0:r.email)||""}}))}catch(t){console.error("Error loading demo data:",t)}};p.useEffect(()=>{d.initialFunnels&&(xe(d.initialFunnels.data),fe(d.initialFunnels.next_page_url!==null))},[d.initialFunnels]),p.useEffect(()=>{D&&(xe(D.data),fe(D.next_page_url!==null))},[D]);const te=async()=>{try{const t=await W.get("/search-ez-funnels",{params:{query:ge,type:re,page:1,with:"user"}});console.log("Search results:",t.data),xe(t.data.data),Ae(1),fe(t.data.next_page_url!==null)}catch(t){console.error("Search error:",t),T("Failed to search funnels. Please try again."),setTimeout(()=>T(""),5e3)}},rt=async()=>{var t,o,s;try{U(!0);const u=((t=document.querySelector('meta[name="csrf-token"]'))==null?void 0:t.getAttribute("content"))||"",r=await W.get("/search-ez-funnels",{params:{query:ge,type:re,page:Pe+1,with:"customDomains"},headers:{"X-CSRF-TOKEN":u,"Content-Type":"application/json"}});r.data&&r.data.data&&(xe(a=>{const l=[...a];return r.data.data.forEach(y=>{const x=l.findIndex(L=>L.id===y.id);x>=0?l[x]={...l[x],...y,handle_domains:[...l[x].handle_domains||[],...y.handle_domains||[]],custom_domains:[...l[x].custom_domains||[],...y.custom_domains||[]]}:l.push(y)}),l}),Ae(Pe+1),fe(r.data.next_page_url!==null))}catch(u){console.error("Load more error:",u),T(((s=(o=u.response)==null?void 0:o.data)==null?void 0:s.message)||"Failed to load more items. Please try again."),setTimeout(()=>T(""),5e3)}finally{U(!1)}},lt=t=>new Date(t).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),_t=t=>{yt(t);const o=document.getElementById(`frame-${t}`);if(o){o.scrollIntoView({behavior:"smooth",block:"center"}),o.classList.add("ring-2","ring-yellow-400"),setTimeout(()=>{o.classList.remove("ring-2","ring-yellow-400")},2e3);const s=o.querySelector('[data-tooltip-content="Expand Frame"]');s&&s.click()}},Et=p.useMemo(()=>
9{if(!i)return null;const t=ce(i.image)||"",s=`${i.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${i.image}`,u=/(?:youtube(?:-nocookie)?\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i,r=/(?:https?:\/\/)?(?:www\.)?linkedin\.com\/(?:in|posts|company|feed|showcase|embed\/feed\/update\/urn:li:[^/]+:[^"&?/ ]+)/i,a=/^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$/im,l=/^(https?:\/\/)?(www\.)?fb\.watch\/[a-zA-Z0-9(\.\?)?]/,y=/^(https?:\/\/)?(www\.)?facebook\.com\/[a-zA-Z0-9(\.\?)?]/,x=/<iframe.*?src=["'](.*?)["'].*?>.*?<\/iframe>/is,L=/<blockquote/,R=i.image.match(u),K=i.image.match(r),pe=i.image.match(a),Mt=i.image.match(l),zt=i.image.match(y),Dt=i.image.match(x)||L.test(i.image),$t=new Blob([i.image],{type:"text/html"}),Rt=URL.createObjectURL($t);if(me(t))return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 10 .blur-overlay { 11 position: fixed; 12 top: 0; 13 left: 0; 14 width: 100%; 15 height: 100%; 16 backdrop-filter: blur(20px); 17 z-index: -1; 18 } 19 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("img",{src:s,alt:"Background",className:"absolute inset-0 max-w-full max-h-full m-auto z-0 rounded-lg",onError:O=>console.error("Image failed to load",O)},`image-${s}`)]});if(Dt){const O=i.image.replace(/<(iframe|blockquote)([^>]*)\s(height|width|style)=["'][^"']*["']([^>]*)>/gi,'<$1$2$4 class="fixed top-0 left-0 w-full h-full" scrolling="yes">').replace(/class="([^"]*)"/g,'class="$1 absolute inset-0 m-auto"'),Pt=/<(iframe|blockquote)[^>]*class="/i.test(O)?O:O.replace(/<(iframe|blockquote)/g,'<$1 scrolling="yes" class="absolute w-full h-full inset-0 m-auto"');return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 20 .blur-overlay { 21 position: fixed; 22 top: 0; 23 left: 0; 24 width = '100%'; 25 height = '100%'; 26 backdrop-filter: blur(20px); 27 z-index: -2; 28 } 29 .twitter-tweet { 30 position: fixed; 31 top: 0; 32 left: 0; 33 width: 100vw; 34 height: 100vh; 35 object-fit: cover; 36 z-index: 0; 37 border: none; 38 } 39 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full object-cover",dangerouslySetInnerHTML:{__html:Pt}},`iframe-${i.image.substring(0,20)}`)]})}if(R){const O=i.option==="autoplay"?"autoplay=1":i.option==="mute"?"autoplay=1&mute=1":"mute=1";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-0 left-0 w-full h-full z-[-2]",children:e.jsx("iframe",{loading:"lazy",src:`https://www.youtube.com/embed/${R[1]}?${O}&loop=1&playlist=${R[1]}&controls=0&showinfo=0&modestbranding=1&iv_load_policy=3`,className:"w-full h-full object-cover",frameBorder:"0",allow:"autoplay; fullscreen",allowFullScreen:!0},`youtube-${R[1]}`)}),e.jsx("style",{children:` 40 .blur-overlay { 41 position: fixed; 42 top: 0; 43 left: 0; 44 width: 100%; 45 height: 100%; 46 backdrop-filter: blur(20px); 47 z-index: -1; 48 } 49 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{id:"bgVideo",loading:"lazy",className:"fixed top-0 left-0 w-full h-full object-cover",src:`https://www.youtube.com/embed/${R[1]}?${i.option}=1&mute=1&loop=1&playlist=${R[1]}`,title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;
49 web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0},`youtube-main-${R[1]}`)]})}if(K){let O=i.image;return O.includes("?compact=1")||(O+=(O.includes("?")?"&":"?")+"compact=1"),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black",children:e.jsx("iframe",{id:"bgVideo",src:O,className:"w-full h-full",frameBorder:"0",allowFullScreen:!0,title:"Embedded LinkedIn Post",scrolling:"yes"},`linkedin-${O.substring(0,20)}`)})}return pe?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 50 .blur-overlay { 51 position: fixed; 52 top: 0; 53 left: 0; 54 width = '100%'; 55 height = '100%'; 56 backdrop-filter: blur(20px); 57 z-index: -1; 58 } 59 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:`https://player.vimeo.com/video/${pe[3]}?h=33160d1512&color=de0101`,className:"fixed top-0 left-0 w-full h-full object-cover",frameBorder:"0",allowFullScreen:!0},`vimeo-${pe[3]}`)]}):Mt||zt&&!i.image.includes("groups")?e.jsx("div",{className:"fixed top-0 left-0 w-full h-full",children:e.jsx("div",{className:"fb-post","data-href":i.image,"data-width":"1400","data-show-text":"true"},`facebook-${i.image.substring(0,20)}`)}):t==="mp4"?e.jsxs(e.Fragment,{children:[e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"fixed top-0 left-0 w-full h-full object-cover z-[-3]",children:[e.jsx("source",{src:s,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-bg-${s}`),e.jsx("style",{children:` 60 .blur-overlay { 61 position: fixed; 62 top: 0; 63 left: 0; 64 width: 100%; 65 height: 100%; 66 backdrop-filter: blur(20px); 67 z-index: -2; 68 } 69 `}),e.jsx("div",{className:"blur-overlay"}),e.jsxs("video",{id:"bgVideo",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"absolute inset-0 max-w-full max-h-full m-auto",controls:!0,children:[e.jsx("source",{src:s,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-main-${s}`)]}):t==="glb"?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 70 .blur-overlay { 71 position: fixed; 72 top: 0; 73 left: 0; 74 width: 100%; 75 height: 100%; 76 backdrop-filter: blur(20px); 77 z-index: -1; 78 } 79 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("model-viewer",{src:s,alt:"3D model",className:"fixed top-0 left-0 w-full h-full",ar:!0,"auto-rotate":!0,"camera-controls":!0,"shadow-intensity":"1"},`model-${s}`)]}):tt(i.image)?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 80 .blur-overlay { 81 position: fixed; 82 top: 0; 83 left: 0; 84 width: 100%; 85 height: 100%; 86 backdrop-filter: blur(20px); 87 z-index: -1; 88 } 89 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:i.image,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",allowFullScreen:!0,scrolling:"yes"},`iframe-url-${i.image.substring(0,20)}`)]}):e.jsx("iframe",{src:Rt,className:"fixed top-0 left-0 w-full h-full border-none",allow:"microphone *; camera *; autoplay *; fullscreen *; display-capture *;
89",sandbox:`allow-forms allow-modals allow-orientation-lock allow-pointer-lock 90 allow-popups allow-popups-to-escape-sandbox allow-presentation 91 allow-same-origin allow-scripts allow-top-navigation 92 allow-top-navigation-by-user-activation allow-downloads allow-storage-access-by-user-activation`,allowFullScreen:!0,loading:"lazy",name:"binauralMixerFrame",allowTransparency:"true",scrolling:"yes"},`html-${i.image.substring(0,20)}`)},[i,ce,tt,me]);return p.useEffect(()=>{if(i!=null&&i.image.includes("facebook.com")||i!=null&&i.image.includes("fb.watch")){const t=document.createElement("script");return t.src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0",t.async=!0,t.defer=!0,t.crossOrigin="anonymous",document.body.appendChild(t),()=>{document.body.removeChild(t)}}},[i]),e.jsxs(e.Fragment,{children:[e.jsxs(At,{children:[e.jsx("title",{children:"Ez Funnel"}),Ct,e.jsx("style",{children:` 93 .react-tooltip { 94 z-index: 99999 !important; 95 opacity: 1 !important; 96 font-size: 12px; 97 padding: 4px 8px; 98 } 99 100 .enhanced-md-editor .w-md-editor { 101 border: 1px solid #4a5568 !important; 102 border-radius: 0.75rem !important; 103 overflow: hidden; 104 } 105 106 .enhanced-md-editor .w-md-editor-toolbar { 107 background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%) !important; 108 border-bottom: 1px solid #4a5568 !important; 109 padding: 12px !important; 110 border-radius: 0.75rem 0.75rem 0 0 !important; 111 } 112 113 .enhanced-md-editor .w-md-editor-toolbar button { 114 color: #cbd5e0 !important; 115 border-radius: 0.5rem !important; 116 margin: 0 2px !important; 117 padding: 6px 8px !important; 118 transition: all 0.2s ease !important; 119 } 120 121 .enhanced-md-editor .w-md-editor-toolbar button:hover { 122 background: linear-gradient(135deg, #4a5568 0%, #5a67d8 100%) !important; 123 color: white !important; 124 transform: translateY(-1px); 125 box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); 126 } 127 128 .enhanced-md-editor .w-md-editor-content { 129 background-color: #1a202c !important; 130 } 131 132 .enhanced-md-editor .w-md-editor-text { 133 background-color: #1a202c !important; 134 color: white !important; 135 font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important; 136 } 137 138 .enhanced-md-editor .w-md-editor-text-pre { 139 color: white !important; 140 } 141 142 .enhanced-md-editor .w-md-editor-preview { 143 background-color: #1a202c !important; 144 color: white !important; 145 border-left: 1px solid #4a5568 !important; 146 } 147 148 .enhanced-md-editor ::-webkit-scrollbar {
149 width: 8px; 150 } 151 152 .enhanced-md-editor ::-webkit-scrollbar-track { 153 background: #2d3748; 154 } 155 156 .enhanced-md-editor ::-webkit-scrollbar-thumb { 157 background: #4a5568; 158 border-radius: 4px; 159 } 160 161 .enhanced-md-editor ::-webkit-scrollbar-thumb:hover { 162 background: #5a67d8; 163 } 164 `})]}),e.jsx(ie,{id:"nav-tooltip"}),e.jsx(ie,{id:"action-tooltip"}),e.jsx(ie,{id:"form-tooltip"}),e.jsx(ie,{id:"modal-tooltip"}),e.jsx(ie,{id:"ezui-tooltip"}),e.jsx(ie,{id:"mdeditor-tooltip"}),e.jsx(Kt,{auth:g}),e.jsxs("main",{className:`relative flex justify-end p-4 min-h-screen overflow-hidden ${i!=null&&i.image&&me(ce(i.image))?"blur-bg":""}`,children:[e.jsx("div",{className:"absolute inset-0 z-0",children:Et}),S&&e.jsx("div",{className:"fixed inset-0 z-70 flex items-center justify-center",children:e.jsxs("div",{className:"bg-gray-900 rounded-xl shadow-2xl w-full max-w-md border border-gray-700 overflow-hidden",children:[e.jsxs("div",{className:"p-5 border-b border-gray-800 flex justify-between items-center bg-gradient-to-r from-gray-900 to-gray-800",children:[e.jsx("h3",{className:"text-xl font-bold text-white",children:"Confirm Deletion"}),e.jsx("button",{onClick:()=>{v(!1),z(null)},className:"text-gray-400 hover:text-white transition-colors duration-200 text-2xl font-light","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Cancel deletion",children:"Ã"})]}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("p",{className:"text-white text-lg mb-2",children:"Are you sure you want to delete?"}),e.jsx("p",{className:"text-yellow-400 font-semibold",children:m==null?void 0:m.name}),e.jsx("p",{className:"text-red-400 text-sm mt-2",children:"This action cannot be undone!"})]}),e.jsxs("div",{className:"flex justify-center gap-4",children:[e.jsx("button",{onClick:()=>{v(!1),z(null)},className:"bg-gray-600 text-white px-6 py-2 rounded-lg hover:bg-gray-700 transition-colors","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Do not delete",children:"Cancel"}),e.jsxs("button",{onClick:Nt,disabled:H!==null,className:"bg-red-600 text-white px-6 py-2 rounded-lg hover:bg-red-700 transition-colors disabled:opacity-50 flex items-center gap-2","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Permanently delete this item",children:[H!==null&&e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Delete"]})]})]})]})}),xt&&e.jsx("div",{className:"fixed inset-0 z-60 flex items-center justify-center",children:e.jsxs("div",{className:"bg-gray-900 rounded-xl shadow-2xl w-full max-w-md border max-h-full border-gray-700 overflow-y-auto animate-fade-in",children:[e.jsxs("div",{className:"p-5 border-b border-gray-800 flex justify-between items-center bg-gradient-to-r from-gray-900 to-gray-800",children:[e.jsx("h3",{className:"text-xl font-bold text-white",children:"Extract to Demo"}),e.jsx("button",{onClick:()=>ye(!1),className:"text-gray-400 hover:text-white transition-colors duration-200 text-2xl font-light","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Close import modal",children:"Ã"})]}),e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"flex rounded-md overflow-hidden mb-4",children:[e.jsx("div",{className:"flex items-center justify-center bg-green-700 p-3",children:e.jsx(w,{icon:Lt,className:"text-white text-xl"})}),e.jsx("input",{type:"text",value:Ce,onChange:t=>gt(t.target.value),className:"w-full px-3 py-2 bg-white text-gray-900 border-none focus:ring-2 focus:ring-yellow-400 focus:outline-none text-base",placeholder:"Enter URL","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Enter a URL to extract frames from"}),e.jsx("button",{className:"bg-green-700 text-white px-5 py-2 whitespace-nowrap font-medium hover:bg-green-800 transition-colors flex items-center justify-center",onClick:jt,disabled:Ve||!Ce.trim(),"data-tooltip-id":"modal-tooltip","data-tooltip-content":"Extract frames from the URL",children:Ve?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Extracting..."]}):"Multi Iframe"})]}),e.jsxs("div",{className:"relative my-4",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-700"})}),e.jsx("div",{className:"relative flex justify-center",children:e.jsx("span",{className:"px-2 bg-gray-900 text-yellow-400 text-sm",children:"or"})})]}),e.jsxs("div",{className:"flex rounded-md overflow-hidden",children:[e.jsxs("div",{className:"flex bg-white items-stretch flex-grow border-r border-transparent",children:[e.jsx("span",{className:"flex items-center px-4 text-gray-600 bg-white",children:"https://4x4.ai/"}
164),e.jsx("input",{type:"text",value:Fe,onChange:t=>bt(t.target.value),className:"w-full pl-1 pr-3 py-2 bg-white text-gray-900 border-none focus:ring-2 focus:ring-yellow-400 focus:outline-none text-base",placeholder:"Enter handle","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Enter a 4x4.ai handle to import"})]}),e.jsx("button",{className:"bg-green-700 text-white px-5 py-2 whitespace-nowrap font-medium hover:bg-green-800 transition-colors",onClick:kt,disabled:I||!Fe.trim(),"data-tooltip-id":"modal-tooltip","data-tooltip-content":"Import data from the 4x4.ai handle",children:I?"Extracting...":"Extract to Demo"})]}),B&&e.jsx("div",{className:"mt-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded",children:B})]})]})}),ft&&e.jsx("div",{className:"fixed inset-0 z-70 flex items-center justify-center bg-black bg-opacity-75",children:e.jsxs("div",{className:"relative w-full h-full max-w-6xl max-h-[95vh] bg-gray-900 rounded-xl shadow-2xl border border-gray-700",children:[e.jsxs("div",{className:"absolute top-0 left-0 right-0 p-3 bg-gray-800 flex justify-between items-center z-10",children:[e.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Preview: ",Q?`Editing ${M==null?void 0:M.token}`:"New Funnel"]}),e.jsx("button",{onClick:()=>qe(!1),className:"text-gray-400 hover:text-white transition-colors","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Close preview",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"absolute inset-0 top-12",children:e.jsx("iframe",{src:Q&&(M!=null&&M.id)?`/preview/${M.id}?mode=edit`:"/preview?mode=create",className:"w-full h-full border-none",allow:"fullscreen",title:"Funnel Preview",scrolling:"yes"})})]})}),A&&e.jsx("div",{className:"fixed inset-0 z-60 flex items-center justify-center",children:e.jsxs("div",{className:"bg-gray-900 rounded-xl shadow-2xl w-full max-w-md border max-h-full border-gray-700 overflow-y-auto animate-fade-in",children:[e.jsxs("div",{className:"p-5 border-b border-gray-800 flex justify-between items-center bg-gradient-to-r from-gray-900 to-gray-800",children:[e.jsx("h3",{className:"text-xl font-bold text-white",children:"Instant Create"}),e.jsx("button",{onClick:()=>h(!1),className:"text-gray-400 hover:text-white transition-colors duration-200","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Close instant create",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("p",{className:"text-gray-300 font-medium text-sm",children:"Generate free generic handle and embed site on"}),e.jsx("p",{className:"text-white font-bold text-2xl mt-1 bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent",children:"ez.wiki"}),Z&&e.jsxs("div",{className:"mb-4 p-4 bg-green-900/80 border border-green-700/80 text-green-200 rounded-lg",children:[Z,e.jsx("button",{onClick:()=>V(""),className:"float-right font-bold text-green-400 hover:text-green-200",children:"Ã"})]}),B&&e.jsxs("div",{className:"mb-4 p-4 bg-red-900/50 border border-red-700 text-red-400 rounded-lg",children:[B,e.jsx("button",{onClick:()=>T(""),className:"float-right font-bold text-red-300 hover:text-red-100",children:"Ã"})]})]}),e.jsx("hr",{className:"border-t border-gray-800 mb-6"}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex justify-center items-center mb-4 gap-4",children:[e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Toggle Fly-Sign feature",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",id:"flySignToggle",className:"sr-only peer",checked:n.flySign,onChange:()=>C(t=>({...t,flySign:!t.flySign}))}),e.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-rose-400"})]}),e.jsx("span",{className:"text-white font-medium",children:"Fly-Sign"})]}),e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer","data-tooltip-id":"modal-tooltip","data-tooltip-content":"See More?",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",id:"eyeTrackingToggle",className:"sr-only peer",checked:n.eyeTracking,onChange:()=>C(t=>({...t,eyeTracking:!t.eyeTracking}))}),e.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-rose-400"})]}),e.jsx("span",{className:"text-2xl",children:"ð"})]}),e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Toggle Content Moderation",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",id:"visibilityToggle",className:"sr-only peer",checked:n.visibility,onChange:()=>{const t=!n.visibility;C(o=>({...o,visibility:t})),t||N(o=>
164o.map(s=>({...s,emojiMarker:s.emojiMarker==="0ï¸â£"?"1ï¸â£":s.emojiMarker})))}}),e.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-rose-400"})]}),e.jsx("span",{className:"text-white font-medium",children:"Content Moderation"})]})]}),e.jsx("div",{className:"flex justify-center items-center mb-4 gap-4",children:n.visibility&&e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("span",{className:"text-white font-medium",children:"Auto Approve Time"}),e.jsx("div",{"data-tooltip-id":"modal-tooltip","data-tooltip-content":"Set automatic approval time for submissions",children:e.jsx("input",{type:"time",onChange:t=>C(o=>({...o,autoApproveTime:t.target.value})),value:n.autoApproveTime?n.autoApproveTime.substring(0,5):"",className:"bg-gray-700 border border-gray-600 text-white text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-[130px] p-2",style:{colorScheme:"dark"}})}),e.jsx("span",{className:"text-gray-400 text-sm",children:"(HH:MM)"})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"block text-sm font-medium text-yellow-400/90",children:["Frame Color",e.jsx("span",{className:"ml-1 text-xs text-gray-400",children:"(click to change)"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"relative","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Choose the color for the frames",children:e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-gray-600/50 shadow-lg cursor-pointer transition-all hover:border-yellow-400/50 hover:scale-105",style:{backgroundColor:n.color,boxShadow:`0 0 12px ${n.color}40`},children:e.jsx("input",{type:"color",name:"framecolor",value:n.color,onChange:Xe,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"text-sm font-mono text-white bg-gray-800/80 px-3 py-2 rounded-lg border border-gray-700 truncate",children:n.color.toUpperCase()})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"block text-sm font-medium text-yellow-400/90",children:"Frame Transparency"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 relative","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Adjust the transparency of the frames",children:[e.jsx("input",{type:"range",min:"0",max:"100",value:Y,onChange:t=>{const o=parseInt(t.target.value);ae(o),C(s=>({...s,transparency:o}))},className:`w-full h-2 bg-gray-800 rounded-full appearance-none cursor-pointer 165 [&::-webkit-slider-thumb]:appearance-none 166 [&::-webkit-slider-thumb]:h-4 167 [&::-webkit-slider-thumb]:w-4 168 [&::-webkit-slider-thumb]:rounded-full 169 [&::-webkit-slider-thumb]:bg-yellow-400 170 [&::-webkit-slider-thumb]:shadow-md 171 [&::-webkit-slider-thumb]:border 172 [&::-webkit-slider-thumb]:border-yellow-200/50 173 [&::-webkit-slider-thumb]:transition-all 174 [&::-webkit-slider-thumb]:hover:scale-125 175 [&::-webkit-slider-runnable-track]:bg-gradient-to-r 176 [&::-webkit-slider-runnable-track]:from-gray-700 177 [&::-webkit-slider-runnable-track]:to-gray-500`}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-2 rounded-full pointer-events-none overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-yellow-400/30 to-yellow-400/70",style:{width:`${Y}%`}})})]}),e.jsxs("div",{className:"w-14 text-center text-sm font-medium text-white bg-gray-800/80 px-2 py-1.5 rounded-lg border border-gray-700 shadow-inner",children:[Y,"%"]})]}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-400 mt-1 px-1",children:[e.jsx("span",{children:"0%"}),e.jsx("span",{children:"50%"}),e.jsx("span",{children:"100%"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-yellow-400/90",children:"Seo Tag:"}),e.jsxs("div",{className:"group relative","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Add an SEO tag for better discoverability",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:e.jsx("span",{className:"text-gray-500 font-medium",children:"#"})}),e.jsx("input",{type:"text",placeholder:"Enter SEO tag, e.g. Marketing",className:"w-full h-10 pl-10 pr-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-yellow-400 focus:border-transparent transition-all duration-200",value:n.seoTag,onChange:t=>C(o=>({...o,seoTag:t.target.value}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-yellow-400/90",children:"View:"}),e.jsxs("select",{className:"w-full rounded-lg border border-gray-600 bg-gray-700 text-white text-sm px-4 py-2 focus:ring-2 focus:ring-yellow-400 focus:border-transparent","data-tooltip-id":"ezui-tooltip","data-tooltip-content":"Choose a pre-defined layout for your themes",value:n.designView,onChange:t=>C(o=>({...o,designView:t.target.value})),children:[e.jsx("option",{value:"A",children:"A: Design View"}),e.jsx("option",{value:"B",children:"B: Tile View"}
177),e.jsx("option",{value:"C",children:"C: Theme Only"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-yellow-400/90",children:"Display View:"}),e.jsxs("select",{className:"w-full rounded-lg border border-gray-600 bg-gray-700 text-white text-sm px-4 py-2 focus:ring-2 focus:ring-yellow-400 focus:border-transparent","data-tooltip-id":"ezui-tooltip","data-tooltip-content":"Choose a pre-defined layout for your themes",value:n.displaymode,onChange:t=>C(o=>({...o,displaymode:t.target.value})),children:[e.jsx("option",{value:"dressed",children:"EZ View"}),e.jsx("option",{value:"naked",children:"HYBRID View"}),e.jsx("option",{value:"ai",children:"AI View"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex items-center space-x-3 mb-1",children:e.jsx("span",{className:"text-yellow-400 font-medium text-sm whitespace-nowrap",children:"Select Themes:"})}),e.jsx("div",{className:"mb-3 space-y-2 max-h-48 overflow-y-auto pr-2",children:n.theme.length>0?n.theme.map((t,o)=>{const u=[...k.userTemplates,...k.defaultTemplates,...k.themecollections].find(y=>{var x;return((x=y.id)==null?void 0:x.toString())===t||y.unique_id===t});if(!u)return null;const r=k.themecollections.some(y=>{var x;return((x=y.id)==null?void 0:x.toString())===t||y.unique_id===t}),a=k.userTemplates.some(y=>{var x;return((x=y.id)==null?void 0:x.toString())===t||y.unique_id===t});let l="bg-gray-700 hover:bg-gray-700/80";return r&&(l="bg-purple-800/60 hover:bg-purple-800/80 border border-purple-500/30"),a&&(l="bg-blue-800/60 hover:bg-blue-800/80 border border-blue-500/30"),e.jsxs("div",{className:`flex items-center gap-2 p-2 rounded transition-colors ${l}`,children:[e.jsx("button",{onClick:()=>Je(o),disabled:o===0,className:"w-6 h-6 flex items-center justify-center text-gray-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed rounded bg-gray-600 hover:bg-gray-500",title:"Move up",children:"â"}),e.jsx("button",{onClick:()=>et(o),disabled:o===n.theme.length-1,className:"w-6 h-6 flex items-center justify-center text-gray-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed rounded bg-gray-600 hover:bg-gray-500",title:"Move down",children:"â"}),e.jsxs("span",{className:"flex-1 text-white text-sm truncate",children:[e.jsx("span",{className:`font-mono text-xs mr-2 ${r?"text-purple-300":a?"text-blue-300":"text-gray-400"}`,children:u.unique_id||u.id}),u.title||"Untitled Theme"]}),e.jsx("button",{onClick:()=>Qe(t),className:"w-6 h-6 flex items-center justify-center text-red-400 hover:text-red-300 hover:bg-red-900/30 rounded",title:"Remove theme",children:"Ã"})]},`${t}-${o}`)}):e.jsxs("div",{className:"text-center py-4 border-2 border-dashed border-gray-700 rounded-lg",children:[e.jsx(w,{icon:nt,className:"text-gray-500 text-2xl mb-2"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"No themes selected"})]})}),e.jsxs("div",{className:"relative","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Select and order themes for your funnel",children:[e.jsxs("select",{className:"w-full rounded-lg border border-gray-600 bg-gray-700 text-white text-sm px-4 py-2 focus:ring-2 focus:ring-yellow-400 focus:border-transparent h-10 appearance-none",onChange:t=>{const o=t.target.value;o&&!n.theme.includes(o)&&C(s=>({...s,theme:[...s.theme,o]})),t.target.value=""},value:"",style:{backgroundImage:"none"},children:[e.jsx("option",{value:"",children:"Add a theme..."}),k.themecollections.length>0&&e.jsx("optgroup",{label:"My Collections",className:"bg-purple-800/60 text-purple-100 border-b border-purple-500/30",children:k.themecollections.map(t=>{var o,s;return e.jsxs("option",{value:((o=t.id)==null?void 0:o.toString())||t.unique_id,disabled:n.theme.includes(((s=t.id)==null?void 0:s.toString())||t.unique_id),className:"bg-purple-800/60 hover:bg-purple-800/80 text-white",children:[t.unique_id," ",t.title," (Collection)"]},`collection-${t.id}`)})}),k.userTemplates.length>0&&e.jsx("optgroup",{label:"My Templates",className:"bg-blue-800/60 text-blue-100 border-b border-blue-500/30",children:k.userTemplates.map(t=>{var o,s;return e.jsxs("option",{value:((o=t.id)==null?void 0:o.toString())||t.unique_id,disabled:n.theme.includes(((s=t.id)==null?void 0:s.toString())||t.unique_id),className:"bg-blue-800/60 hover:bg-blue-800/80 text-white",children:[t.unique_id," ",t.title]},`user-${t.id}`)})}),k.defaultTemplates.length>0&&e.jsx("optgroup",{label:"Default Templates",className:"bg-gray-700 text-gray-100 border-b border-gray-500/30",children:k.defaultTemplates.map(t=>{var o,s;return e.jsxs("option",{value:((o=t.id)==null?void 0:o.toString())||t.unique_id,disabled:n.theme.includes(((s=t.id)==null?void 0:s.toString())||t.unique_id),className:"bg-gray-700 hover:bg-gray-700/80 text-white",children:[t.unique_id," ",t.title]},`default-${t.id}`)})}),k.userTemplates.length===0&&k.defaultTemplates.length===0&&k.themecollections.length===0&&e.jsx("option",{disabled:!0,className:"text-gray-400 bg-gray-700",children:"No themes available"})]}),e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),e.jsx("div",{className:"pt-4",children:e.jsx("button",{className:"w-full bg-gradient-to-r from-lime-400 to-lime-500 hover:from-lime-500 hover:to-lime-600 text-black font-bold py-3 px-6 rounded-lg shadow-lg transform hover:scale-[1.02] transition-all duration-200 flex items-center justify-center",onClick:Q?Ee:Ft,disabled:I,"data-tooltip-id":"modal-tooltip","data-tooltip-content":Q?"Update your funnel":"Create a new funnel",children:I?e.jsxs("div",{className:"flex items-center",children:[e.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-black",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsx("span",{children:Q?"Updating...":"Saving..."})]}):e.jsx("span",{children:Q?"Update Funnel":"EZ Funnel"})})})]})]})]})}),j&&e.jsxs("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 max-h-[calc(100vh-4rem)]",children:[e.jsx("button",{onClick:()=>c(!1),className:"absolute top-2 right-2 w-8 h-8 bg-black rounded-full flex items-center justify-center z-50 hover:bg-gray-800 transition-colors focus:outline-none focus:ring-2 focus:ring-white","data-tooltip-id":"action-tooltip","data-tooltip-content":"Hide Control Panel",children:e.jsx(w,{icon:ze,className:"text-white text-lg",style:{textShadow:"0.7px 0.7px 0 rgb(255,0,0), -0.7px -0.7px 0 rgb(0,255,255)"}})}),Z&&e.jsxs("div",{className:"mb-4 p-4 bg-green-900/80 border border-green-700/80 text-green-200 rounded-lg flex items-start gap-4 animate-fade-in shadow-lg max-w-lg mx-auto w-full",children:[e.jsx("div",{className:"flex-shrink-0 pt-0.5",children:e.jsx(w,{icon:ut,className:"h-5 w-5 text-green-400"})}),e.jsx("div",{className:"flex-grow text-sm",children:Z}),e.jsx("div",{className:"flex-shrink-0",children:e.jsx("button",{onClick:()=>V(""),className:"text-green-400/70 hover:text-green-200 transition-colors duration-200 focus:outline-none","aria-label":"Close message",children:e.jsx(w,{icon:ze,className:"h-5 w-5"})})})]}),B&&e.jsxs("div",{className:"mb-4 p-4 bg-red-900/50 border border-red-700 text-red-400 rounded-lg flex justify-between items-center animate-fade-in max-w-lg mx-auto w-full shadow-md",children:[e.jsx("div",{className:"flex-grow text-sm",children:B}),e.jsx("button",{onClick:()=>T(""),className:"ml-4 font-bold text-red-300 hover:text-red-100 text-xl leading-none focus:outline-none","aria-label":"Close error",children:"Ã"})]}
177),Q?e.jsxs("div",{className:"grid grid-cols-3 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-4 space-y-4 sticky top-4 self-start h-[calc(100vh-8rem)] overflow-y-auto custom-scrollbar",children:[e.jsx("div",{className:"flex flex-wrap gap-3 mb-4",children:e.jsx("button",{className:"bg-gradient-to-r from-red-600 to-red-500 text-white rounded-lg px-4 py-2 font-medium hover:shadow-lg hover:from-red-700 hover:to-red-600 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-red-400",type:"button",onClick:()=>{he(!1),_e()},"data-tooltip-id":"action-tooltip","data-tooltip-content":"Clear the form and start a new funnel",children:"CREATE NEW EZ FUNNEL"})}),e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("input",{type:"text",placeholder:"Search by token",className:"flex-grow bg-white text-gray-900 px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-yellow-400 min-w-0",value:ge,onChange:t=>Re(t.target.value),onKeyPress:t=>t.key==="Enter"&&te(),"data-tooltip-id":"form-tooltip","data-tooltip-content":"Search your saved funnels by token"}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs("button",{className:`font-semibold px-3 py-2 flex items-center gap-1.5 whitespace-nowrap rounded-l-md border-r transition-colors ${re==="fuzzy"?"bg-green-600 text-white border-green-700 hover:bg-green-700":"bg-gray-600 text-gray-300 border-gray-700 hover:bg-gray-700"}`,onClick:()=>{be("fuzzy"),te()},"data-tooltip-id":"action-tooltip","data-tooltip-content":"Use fuzzy (approximate) search",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 0 11-16 0 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),"Fuzzy"]}),e.jsxs("button",{className:`font-semibold px-3 py-2 flex items-center gap-1.5 whitespace-nowrap rounded-r-md transition-colors ${re==="exact"?"bg-green-600 text-white hover:bg-green-700":"bg-gray-600 text-gray-300 hover:bg-gray-700"}`,onClick:()=>{be("exact"),te()},"data-tooltip-id":"action-tooltip","data-tooltip-content":"Use exact match search",children:[e.jsx("span",{className:"text-sm",children:"ð"}),"Exact"]})]})]}),e.jsx("div",{className:"space-y-2",children:J.map(t=>{var o,s,u,r;return e.jsxs(It.Fragment,{children:[e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center p-4 gap-3 bg-[#5d0f6e] rounded-lg",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center flex-shrink-0",children:[e.jsx("span",{className:"text-4xl select-none",children:"ð"}),e.jsxs("span",{className:"text-xs text-white font-semibold mt-1 bg-black/20 px-2 py-0.5 rounded",children:["Frames: ",t.fields.length]})]}),e.jsx("div",{className:"flex-grow min-w-0 w-full md:w-auto",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("a",{href:`https://ez.wiki/${encodeURIComponent(t.token)}`,target:"_blank",rel:"noopener noreferrer",className:"text-yellow-400 font-semibold hover:text-yellow-300 transition-colors break-all",children:["https://ez.wiki/",t.token]}),e.jsx("span",{className:"text-purple-300 text-sm whitespace-nowrap",children:lt(t.created_at)})]}),t.ai_search_history&&e.jsx("div",{className:"flex flex-wrap items-center gap-2 bg-blue-900/30 p-2 rounded cursor-pointer hover:bg-blue-800/50 transition-colors",onClick:()=>{window.open(`https://ez.wiki/X/${t.ai_search_history.slug}`,"_blank")},children:e.jsxs("a",{href:`https://ez.wiki/X/${encodeURIComponent(t.ai_search_history.slug)}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-300 font-semibold hover:text-blue-200 transition-colors break-all",onClick:a=>a.stopPropagation(),children:["https://ez.wiki/X/",t.ai_search_history.slug]})}),(o=t.handle_domains)==null?void 0:o.map(a=>e.jsxs("div",{className:"flex flex-wrap items-center gap-2 bg-purple-900/30 p-2 rounded",children:[e.jsxs("a",{href:`https://${a.domain}.${a.domainselected}`,target:"_blank",rel:"noopener noreferrer",className:"text-yellow-400 font-semibold hover:text-yellow-300 transition-colors break-all flex-grow",children:["https://",a.domain,".",a.domainselected]}),e.jsx("button",{onClick:()=>Ye(a.id,a.domain,a.domainselected),disabled:H===a.id&&X==="handleDomain",className:"bg-red-600 text-white font-bold py-1 px-2 rounded-md text-sm hover:bg-red-700 transition-colors whitespace-nowrap flex items-center justify-center min-w-[2rem]","data-tooltip-id":"action-tooltip","data-tooltip-content":"Delete handle domain",children:H===a.id&&X==="handleDomain"?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsx(w,{icon:se,className:"h-4 w-4"})})]},a.id)),(s=t.custom_domains)==null?void 0:s.map(a=>e.jsxs("div",{className:"flex flex-wrap items-center gap-2 bg-purple-900/30 p-2 rounded",children:[e.jsxs("a",{href:`https://{domain.domainselected}/${a.domain}`,target:"_blank",rel:"noopener noreferrer",className:"text-yellow-400 font-semibold hover:text-yellow-300 transition-colors break-all flex-grow",children:["https://",a.domainselected,"/",a.domain]}),e.jsx("button",{onClick:()=>Ze(a.id,a.domain,a.domainselected),disabled:H===a.id&&X==="customDomain",className:"bg-red-600 text-white font-bold py-1 px-2 rounded-md text-sm hover:bg-red-700 transition-colors whitespace-nowrap flex items-center justify-center min-w-[2rem]","data-tooltip-id":"action-tooltip","data-tooltip-content":"Delete custom domain",children:H===a.id&&X==="customDomain"?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsx(w,{icon:se,className:"h-4 w-4"})})]},a.id))]})}),e.jsxs("div",{className:"flex flex-col gap-2 ml-auto flex-shrink-0",children:[e.jsx("button",{className:"bg-yellow-400 text-black font-bold py-1 px-3 md:px-5 rounded-md text-sm hover:bg-yellow-500 transition-colors whitespace-nowrap",onClick:a=>{a.preventDefault(),at(t)},"data-tooltip-id":"action-tooltip","data-tooltip-content":"Edit this funnel",children:"Edit"}),(g==null?void 0:g.linkedin_access_token)&&e.jsx(e.Fragment,{children:e.jsx("button",{className:"bg-blue-600 text-white font-bold py-1 px-3 rounded-md text-sm hover:bg-blue-700 transition-colors whitespace-nowrap flex items-center justify-center gap-1",onClick:a=>{a.preventDefault(),Ke(t)},disabled:G,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Post this funnel on LinkedIn",children:G?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{icon:le,className:"h-3 w-3"}),"LinkedIn"]})})}),(g==null?void 0:g.reddit_token)&&e.jsx(e.Fragment,{children:e.jsx("button",{className:"bg-orange-600 text-white font-bold py-1 px-3 rounded-md text-sm hover:bg-orange-700 transition-colors whitespace-nowrap flex items-center justify-center gap-1",onClick:a=>{a.preventDefault(),Oe(t)},disabled:ee,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Share this funnel on Reddit",children:ee?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{icon:le,className:"h-3 w-3"}),"Reddit"]})})}),((u=t.handle_domains)==null?void 0:u.length)===0&&((r=t.custom_domains)==null?void 0:r.length)===0&&e.jsx("button",{onClick:()=>Ge(t.id,t.token),disabled:H===t.id&&X==="funnel",className:"bg-red-600 text-white font-bold py-1 px-3 rounded-md text-sm hover:bg-red-700 transition-colors whitespace-nowrap flex items-center justify-center","data-tooltip-id":"action-tooltip","data-tooltip-content":"Delete this funnel",children:H===t.id&&X==="funnel"?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsx(w,{icon:se,className:"h-4 w-4"})})]})]}),Q&&(M==null?void 0:M.id)===t.id&&e.jsxs("div",{className:"mt-2 p-3 bg-gray-700 rounded-md",children:[e.jsx("div",{className:"text-xs text-white font-semibold mb-2",children:"Frame Order:"}),e.jsx("div",{className:"space-y-1 max-h-24 overflow-y-auto",children:b.map((a,l)=>e.jsxs("div",{className:"flex items-center gap-2 bg-gray-600/50 p-1.5 rounded text-xs",children:[e.jsx("button",{onClick:()=>Se(l),disabled:l===0,className:"text-gray-400 hover:text-white disabled:opacity-30 w-4 h-4 flex items-center justify-center transition-colors",title:"Move frame up",children:"â"}),e.jsx("button",{onClick:()=>Te(l),disabled:l===b.length-1,className:"text-gray-400 hover:text-white disabled:opacity-30 w-4 h-4 flex items-center justify-center transition-colors",title:"Move frame down",children:"â"}),e.jsxs("span",{className:"flex-1 text-white cursor-pointer hover:text-yellow-300 transition-colors truncate",onClick:()=>_t(a.id),title:`Frame ${l+1} - Click to scroll`,children:["Frame ",l+1," ",a.unique_id?`(ID: #${a.unique_id})`:`(Temp ID: ${a.id})`]}),a.unique_id&&e.jsxs("div",{className:"flex gap-1",children:[(g==null?void 0:g.linkedin_access_token)&&e.jsxs("button",{onClick:y=>{y.stopPropagation(),wt(a.unique_id)},disabled:q[a.unique_id],className:"flex items-center gap-1 px-2 py-1 text-blue-400 hover:text-blue-300 hover:bg-blue-900/30 rounded-md transition-all duration-200 border border-blue-700/50 hover:border-blue-500/70 disabled:opacity-50 disabled:cursor-not-allowed",title:"Post this frame on LinkedIn","data-tooltip-id":"action-tooltip","data-tooltip-content":"Post this frame on LinkedIn",children:[q[a.unique_id]?e.jsxs("svg",{className:"animate-spin h-3 w-3 text-blue-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsx(w,{icon:le,className:"h-3 w-3"}),e.jsx("span",{className:"text-xs font-medium",children:q[a.unique_id]?"Posting...":"LinkedIn"})]}),(g==null?void 0:g.reddit_token)&&e.jsxs("button",{onClick:y=>{y.stopPropagation(),vt(a.unique_id)},disabled:ne[a.unique_id],className:"flex items-center gap-1 px-2 py-1 text-orange-400 hover:text-orange-300 hover:bg-orange-900/30 rounded-md transition-all duration-200 border border-orange-700/50 hover:border-orange-500/70 disabled:opacity-50 disabled:cursor-not-allowed",title:"Share this frame on Reddit","data-tooltip-id":"action-tooltip","data-tooltip-content":"Share this frame on Reddit",children:[ne[a.unique_id]?e.jsxs("svg",{className:"animate-spin h-3 w-3 text-orange-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsx(w,{icon:le,className:"h-3 w-3"}),e.jsx("span",{className:"text-xs font-medium",children:ne[a.unique_id]?"Sharing...":"Reddit"})]})]})]},a.id))})]})]},t.id)})}),Ie&&e.jsx("div",{className:"flex justify-center mt-4",children:e.jsx("button",{className:"bg-black text-white border border-white px-8 py-2 rounded-md font-semibold hover:bg-white hover:text-black transition-colors",onClick:rt,disabled:I,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Load more of your saved funnels",children:I?"Loading...":"Load More"})})]}),e.jsxs("div",{className:"space-y-4 col-span-2",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("h2",{className:"text-xl font-bold text-white",children:[e.jsx(w,{icon:De,className:"mr-2"}),"Editing Funnel: ",M==null?void 0:M.token]}),e.jsx("button",{onClick:()=>{he(!1),_e()},className:"text-gray-400 hover:text-white transition-colors flex items-center","data-tooltip-id":"action-tooltip","data-tooltip-content":"Cancel editing and create new",children:e.jsx(w,{icon:ze,className:"mr-1"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 mb-4",children:[e.jsx("button",{className:"flex bg-gradient-to-r from-yellow-600 to-yellow-500 text-black rounded-lg px-4 py-2 font-medium hover:shadow-lg hover:from-yellow-700 hover:to-yellow-600 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-yellow-400",onClick:Ee,disabled:I,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Save changes to this funnel",children:I?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Updating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{icon:De,className:"mr-2"}
177),"Update Funnel"]})}),Me()]}),B&&e.jsx("div",{className:"mb-4 p-4 bg-red-900/50 border border-red-700 text-red-400 rounded-lg",children:B}),e.jsx("div",{className:"bg-gray-900 rounded-xl shadow-2xl w-full border border-gray-700",children:e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex justify-center items-center mb-4 gap-4",children:[e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer","data-tooltip-id":"form-tooltip","data-tooltip-content":"Toggle Fly-Sign feature",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",id:"flySignToggle",className:"sr-only peer",checked:n.flySign,onChange:()=>C(t=>({...t,flySign:!t.flySign}))}),e.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-rose-400"})]}),e.jsx("span",{className:"text-white font-medium",children:"Fly-Sign"})]}),e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer","data-tooltip-id":"form-tooltip","data-tooltip-content":"See More?",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",id:"eyeTrackingToggle",className:"sr-only peer",checked:n.eyeTracking,onChange:()=>C(t=>({...t,eyeTracking:!t.eyeTracking}))}),e.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-rose-400"})]}),e.jsx("span",{className:"text-2xl",children:"ð"})]}),e.jsxs("label",{className:"flex items-center space-x-3 cursor-pointer","data-tooltip-id":"form-tooltip","data-tooltip-content":"Toggle Content Moderation",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",id:"visibilityToggle",className:"sr-only peer",checked:n.visibility,onChange:()=>{const t=!n.visibility;C(o=>({...o,visibility:t})),t||N(o=>o.map(s=>({...s,emojiMarker:s.emojiMarker==="0ï¸â£"?"1ï¸â£":s.emojiMarker})))}}),e.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-rose-400"})]}),e.jsx("span",{className:"text-white font-medium",children:"Content Moderation"})]})]}),n.visibility&&e.jsx("div",{className:"flex justify-center items-center mb-4 gap-4",children:e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("span",{className:"text-white font-medium",children:"Auto Approve Time"}),e.jsx("div",{"data-tooltip-id":"form-tooltip","data-tooltip-content":"Set automatic approval time for submissions",children:e.jsx("input",{type:"time",onChange:t=>C(o=>({...o,autoApproveTime:t.target.value})),value:n.autoApproveTime?n.autoApproveTime.substring(0,5):"",className:"bg-gray-700 border border-gray-600 text-white text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-[130px] p-2",style:{colorScheme:"dark"}})}),e.jsx("span",{className:"text-gray-400 text-sm",children:"(HH:MM)"})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"block text-sm font-medium text-yellow-400/90",children:["Frame Color",e.jsx("span",{className:"ml-1 text-xs text-gray-400",children:"(click to change)"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"relative","data-tooltip-id":"form-tooltip","data-tooltip-content":"Choose the color for the frames",children:e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-gray-600/50 shadow-lg cursor-pointer transition-all hover:border-yellow-400/50 hover:scale-105",style:{backgroundColor:n.color,boxShadow:`0 0 12px ${n.color}40`},children:e.jsx("input",{type:"color",name:"framecolor",value:n.color,onChange:Xe,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"text-sm font-mono text-white bg-gray-800/80 px-3 py-2 rounded-lg border border-gray-700 truncate",children:n.color.toUpperCase()})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"block text-sm font-medium text-yellow-400/90",children:"Frame Transparency"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 relative","data-tooltip-id":"form-tooltip","data-tooltip-content":"Adjust the transparency of the frames",children:[e.jsx("input",{type:"range",min:"0",max:"100",value:Y,onChange:t=>{const o=parseInt(t.target.value);ae(o),C(s=>({...s,transparency:o}))},className:`w-full h-2 bg-gray-800 rounded-full appearance-none cursor-pointer 178 [&::-webkit-slider-thumb]:appearance-none 179 [&::-webkit-slider-thumb]:h-4 180 [&::-webkit-slider-thumb]:w-4 181 [&::-webkit-slider-thumb]:rounded-full 182 [&::-webkit-slider-thumb]:bg-yellow-400 183 [&::-webkit-slider-thumb]:shadow-md 184 [&::-webkit-slider-thumb]:border 185 [&::-webkit-slider-thumb]:border-yellow-200/50 186 [&::-webkit-slider-thumb]:transition-all 187 [&::-webkit-slider-thumb]:hover:scale-125 188 [&::-webkit-slider-runnable-track]:bg-gradient-to-r 189 [&::-webkit-slider-runnable-track]:from-gray-700 190 [&::-webkit-slider-runnable-track]:to-gray-500`}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-2 rounded-full pointer-events-none overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-yellow-400/30 to-yellow-400/70",style:{width:`${Y}%`}})})]}),e.jsxs("div",{className:"w-14 text-center text-sm font-medium text-white bg-gray-800/80 px-2 py-1.5 rounded-lg border border-gray-700 shadow-inner",children:[Y,"%"]})]}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-400 mt-1 px-1",children:[e.jsx("span",{children:"0%"}),e.jsx("span",{children:"50%"}),e.jsx("span",{children:"100%"})]})]})]}),e.jsxs("div",{className:"flex justify-center items-center mb-4 gap-4",children:[e.jsxs("div",{className:"group relative",children:[e.jsx("div",{className:"flex items-center space-x-2 mb-1",children:e.jsx("span",{className:"text-yellow-400 font-medium text-sm whitespace-nowrap",children:"Seo Tag:"})}),e.jsxs("div",{className:"relative","data-tooltip-id":"form-tooltip","data-tooltip-content":"Add an SEO tag for better discoverability",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:e.jsx("span",{className:"text-gray-500 font-medium h-full flex items-center",children:"#"})}),e.jsx("input",{type:"text",placeholder:"Enter SEO tag, e.g. Marketing",className:"w-full h-10 pl-10 pr-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-yellow-400 focus:border-transparent transition-all duration-200",value:n.seoTag,onChange:t=>C(o=>({...o,seoTag:t.target.value}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-yellow-400/90",children:"View:"}),e.jsxs("select",{className:"w-full rounded-lg border border-gray-600 bg-gray-700 text-white text-sm px-4 py-2 focus:ring-2 focus:ring-yellow-400 focus:border-transparent","data-tooltip-id":"ezui-tooltip","data-tooltip-content":"Choose a pre-defined layout for your themes",value:n.designView,onChange:t=>C(o=>({...o,designView:t.target.value})),children:[e.jsx("option",{value:"A",children:"A: Design View"}),e.jsx("option",{value:"B",children:"B: Tile View"}
190),e.jsx("option",{value:"C",children:"C: Theme Only"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-yellow-400/90",children:"Display View:"}),e.jsxs("select",{className:"w-full rounded-lg border border-gray-600 bg-gray-700 text-white text-sm px-4 py-2 focus:ring-2 focus:ring-yellow-400 focus:border-transparent","data-tooltip-id":"ezui-tooltip","data-tooltip-content":"Choose a pre-defined layout for your themes",value:n.displaymode,onChange:t=>C(o=>({...o,displaymode:t.target.value})),children:[e.jsx("option",{value:"dressed",children:"EZ View"}),e.jsx("option",{value:"naked",children:"HYBRID View"}),e.jsx("option",{value:"ai",children:"AI View"})]})]}),e.jsxs("div",{className:"relative max-w-sm",children:[e.jsx("div",{className:"flex items-center space-x-2 mb-1",children:e.jsx("span",{className:"text-yellow-400 font-medium text-sm whitespace-nowrap",children:"Select Themes:"})}),e.jsx("div",{className:"mb-3 space-y-2 max-h-48 overflow-y-auto pr-2",children:n.theme.length>0?n.theme.map((t,o)=>{const u=[...k.userTemplates,...k.defaultTemplates,...k.themecollections].find(y=>{var x;return((x=y.id)==null?void 0:x.toString())===t||y.unique_id===t});if(!u)return null;const r=k.themecollections.some(y=>{var x;return((x=y.id)==null?void 0:x.toString())===t||y.unique_id===t}),a=k.userTemplates.some(y=>{var x;return((x=y.id)==null?void 0:x.toString())===t||y.unique_id===t});let l="bg-gray-700 hover:bg-gray-700/80";return r&&(l="bg-purple-800/60 hover:bg-purple-800/80 border border-purple-500/30"),a&&(l="bg-blue-800/60 hover:bg-blue-800/80 border border-blue-500/30"),e.jsxs("div",{className:`flex items-center gap-2 p-2 rounded transition-colors ${l}`,children:[e.jsx("button",{onClick:()=>Je(o),disabled:o===0,className:"w-6 h-6 flex items-center justify-center text-gray-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed rounded bg-gray-600 hover:bg-gray-500",title:"Move up",children:"â"}),e.jsx("button",{onClick:()=>et(o),disabled:o===n.theme.length-1,className:"w-6 h-6 flex items-center justify-center text-gray-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed rounded bg-gray-600 hover:bg-gray-500",title:"Move down",children:"â"}),e.jsxs("span",{className:"flex-1 text-white text-sm truncate",children:[e.jsx("span",{className:`font-mono text-xs mr-2 ${r?"text-purple-300":a?"text-blue-300":"text-gray-400"}`,children:u.unique_id||u.id}),u.title||"Untitled Theme"]}),e.jsx("button",{onClick:()=>Qe(t),className:"w-6 h-6 flex items-center justify-center text-red-400 hover:text-red-300 hover:bg-red-900/30 rounded",title:"Remove theme",children:"Ã"})]},`${t}-${o}`)}):e.jsxs("div",{className:"text-center py-4 border-2 border-dashed border-gray-700 rounded-lg",children:[e.jsx(w,{icon:nt,className:"text-gray-500 text-2xl mb-2"}),e.jsx("p",{className:"text-gray-400 text-sm",children:"No themes selected"})]})}),e.jsxs("div",{className:"relative","data-tooltip-id":"form-tooltip","data-tooltip-content":"Select and order themes for your funnel",children:[e.jsxs("select",{className:"w-full rounded-lg border border-gray-600 bg-gray-700 text-white text-sm px-4 py-2 focus:ring-2 focus:ring-yellow-400 focus:border-transparent h-10 appearance-none",onChange:t=>{const o=t.target.value;o&&!n.theme.includes(o)&&C(s=>({...s,theme:[...s.theme,o]})),t.target.value=""},value:"",style:{backgroundImage:"none"},children:[e.jsx("option",{value:"",children:"Add a theme..."}),k.themecollections.length>0&&e.jsx("optgroup",{label:"My Collections",className:"bg-purple-800/60 text-purple-100 border-b border-purple-500/30",children:k.themecollections.map(t=>{var o,s;return e.jsxs("option",{value:((o=t.id)==null?void 0:o.toString())||t.unique_id,disabled:n.theme.includes(((s=t.id)==null?void 0:s.toString())||t.unique_id),className:"bg-purple-800/60 hover:bg-purple-800/80 text-white",children:[t.unique_id," ",t.title," (Collection)"]},`collection-${t.id}`)})}),k.userTemplates.length>0&&e.jsx("optgroup",{label:"My Templates",className:"bg-blue-800/60 text-blue-100 border-b border-blue-500/30",children:k.userTemplates.map(t=>{var o,s;return e.jsxs("option",{value:((o=t.id)==null?void 0:o.toString())||t.unique_id,disabled:n.theme.includes(((s=t.id)==null?void 0:s.toString())||t.unique_id),className:"bg-blue-800/60 hover:bg-blue-800/80 text-white",children:[t.unique_id," ",t.title]},`user-${t.id}`)})}),k.defaultTemplates.length>0&&e.jsx("optgroup",{label:"Default Templates",className:"bg-gray-700 text-gray-100 border-b border-gray-500/30",children:k.defaultTemplates.map(t=>{var o,s;return e.jsxs("option",{value:((o=t.id)==null?void 0:o.toString())||t.unique_id,disabled:n.theme.includes(((s=t.id)==null?void 0:s.toString())||t.unique_id),className:"bg-gray-700 hover:bg-gray-700/80 text-white",children:[t.unique_id," ",t.title]},`default-${t.id}`)})}),k.userTemplates.length===0&&k.defaultTemplates.length===0&&k.themecollections.length===0&&e.jsx("option",{disabled:!0,className:"text-gray-400 bg-gray-700",children:"No themes available"})]}),e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]})]})]})})}),e.jsxs("button",{className:"bg-gradient-to-r from-yellow-500 to-yellow-400 text-gray-900 rounded-lg px-4 py-2 flex items-center gap-2 justify-center font-medium hover:shadow-lg hover:from-yellow-400 hover:to-yellow-300 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-yellow-500",type:"button",onClick:()=>we("top"),"data-tooltip-id":"action-tooltip","data-tooltip-content":"Add a new frame at the beginning",children:[e.jsx(w,{icon:ve,className:"text-lg"}),"Add to the Top"]}),e.jsx("div",{className:"space-y-4",children:b.map((t,o)=>e.jsx(pt,{index:o,form:t,updateForm:ot,removeForm:st,activePins:F,setActivePins:_,moveFormUp:Se,moveFormDown:Te,isFirst:o===0,isLast:o===b.length-1},t.id))}),e.jsxs("button",{className:"bg-gradient-to-r from-yellow-500 to-yellow-400 text-gray-900 rounded-lg px-4 py-2 flex items-center gap-2 justify-center font-medium hover:shadow-lg hover:from-yellow-400 hover:to-yellow-300 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-yellow-500",type:"button",onClick:()=>we("bottom"),"data-tooltip-id":"action-tooltip","data-tooltip-content":"Add a new frame at the end",children:[e.jsx(w,{icon:ve,className:"text-lg"}),"Add at the End"]}),Z&&e.jsxs("div",{className:"mb-4 p-4 bg-green-900/80 border border-green-700/80 text-green-200 rounded-lg",children:[Z,e.jsx("button",{onClick:()=>V(""),className:"float-right font-bold text-green-400 hover:text-green-200",children:"Ã"})]}),B&&e.jsx("div",{className:"mb-4 p-4 bg-red-900/50 border border-red-700 text-red-400 rounded-lg",children:B}),e.jsxs("div",{className:"flex flex-wrap gap-3 mb-4",children:[e.jsx("button",{className:"flex bg-gradient-to-r from-yellow-600 to-yellow-500 text-black rounded-lg px-4 py-2 font-medium hover:shadow-lg hover:from-yellow-700 hover:to-yellow-600 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-yellow-400",onClick:Ee,disabled:I,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Save changes",children:I?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Updating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{icon:De,className:"mr-2"}
190),"Update Funnel"]})}),Me()]})]})]}):e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-4 space-y-4 sticky top-4 self-start h-[calc(100vh-8rem)] overflow-y-auto custom-scrollbar",children:[e.jsx("div",{className:"flex flex-wrap gap-3 mb-4",children:e.jsx("button",{className:"bg-gradient-to-r from-red-600 to-red-500 text-white rounded-lg px-4 py-2 font-medium hover:shadow-lg hover:from-red-700 hover:to-red-600 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-red-400",type:"button",onClick:_e,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Start a new funnel from scratch",children:"CREATE NEW EZ FUNNEL"})}),e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("input",{type:"text",placeholder:"Search by token",className:"flex-grow bg-white text-gray-900 px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-yellow-400 min-w-0",value:ge,onChange:t=>Re(t.target.value),onKeyPress:t=>t.key==="Enter"&&te(),"data-tooltip-id":"form-tooltip","data-tooltip-content":"Search by funnel token"}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs("button",{className:`font-semibold px-3 py-2 flex items-center gap-1.5 whitespace-nowrap rounded-l-md border-r transition-colors ${re==="fuzzy"?"bg-green-600 text-white border-green-700 hover:bg-green-700":"bg-gray-600 text-gray-300 border-gray-700 hover:bg-gray-700"}`,onClick:()=>{be("fuzzy"),te()},"data-tooltip-id":"action-tooltip","data-tooltip-content":"Use fuzzy (approximate) search",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 0 11-16 0 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),"Fuzzy"]}),e.jsxs("button",{className:`font-semibold px-3 py-2 flex items-center gap-1.5 whitespace-nowrap rounded-r-md transition-colors ${re==="exact"?"bg-green-600 text-white hover:bg-green-700":"bg-gray-600 text-gray-300 hover:bg-gray-700"}`,onClick:()=>{be("exact"),te()},"data-tooltip-id":"action-tooltip","data-tooltip-content":"Use exact match search",children:[e.jsx("span",{className:"text-sm",children:"ð"}),"Exact"]})]})]}),e.jsx("div",{className:"space-y-2",children:J.map(t=>{var o,s,u,r;return e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center p-4 gap-3 bg-[#5d0f6e] rounded-lg",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center flex-shrink-0",children:[e.jsx("span",{className:"text-4xl select-none",children:"ð"}),e.jsxs("span",{className:"text-xs text-white font-semibold mt-1 bg-black/20 px-2 py-0.5 rounded",children:["Frames: ",t.fields.length]})]}),e.jsx("div",{className:"flex-grow min-w-0 w-full md:w-auto",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("a",{href:`https://ez.wiki/${encodeURIComponent(t.token)}`,target:"_blank",rel:"noopener noreferrer",className:"text-yellow-400 font-semibold hover:text-yellow-300 transition-colors break-all",children:["https://ez.wiki/",t.token]}),e.jsx("span",{className:"text-purple-300 text-sm whitespace-nowrap",children:lt(t.created_at)})]}),t.ai_search_history&&e.jsx("div",{className:"flex flex-wrap items-center gap-2 bg-blue-900/30 p-2 rounded cursor-pointer hover:bg-blue-800/50 transition-colors",onClick:()=>{window.open(`https://ez.wiki/X/${t.ai_search_history.slug}`,"_blank")},children:e.jsxs("a",{href:`https://ez.wiki/X/${encodeURIComponent(t.ai_search_history.slug)}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-300 font-semibold hover:text-blue-200 transition-colors break-all",onClick:a=>a.stopPropagation(),children:["https://ez.wiki/X/",t.ai_search_history.slug]})}),(o=t.handle_domains)==null?void 0:o.map(a=>e.jsxs("div",{className:"flex flex-wrap items-center gap-2 bg-purple-900/30 p-2 rounded",children:[e.jsxs("a",{href:`https://${a.domain}.${a.domainselected}`,target:"_blank",rel:"noopener noreferrer",className:"text-yellow-400 font-semibold hover:text-yellow-300 transition-colors break-all flex-grow",children:["https://",a.domain,".",a.domainselected]}),e.jsx("button",{onClick:()=>Ye(a.id,a.domain,a.domainselected),disabled:H===a.id&&X==="handleDomain",className:"bg-red-600 text-white font-bold py-1 px-2 rounded-md text-sm hover:bg-red-700 transition-colors whitespace-nowrap flex items-center justify-center min-w-[2rem]","data-tooltip-id":"action-tooltip","data-tooltip-content":"Delete handle domain",children:H===a.id&&X==="handleDomain"?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsx(w,{icon:se,className:"h-4 w-4"})})]},a.id)),(s=t.custom_domains)==null?void 0:s.map(a=>e.jsxs("div",{className:"flex flex-wrap items-center gap-2 bg-purple-900/30 p-2 rounded",children:[e.jsxs("a",{href:`https://{domain.domainselected}/${a.domain}`,target:"_blank",rel:"noopener noreferrer",className:"text-yellow-400 font-semibold hover:text-yellow-300 transition-colors break-all flex-grow",children:["https://",a.domainselected,"/",a.domain]}),e.jsx("button",{onClick:()=>Ze(a.id,a.domain,a.domainselected),disabled:H===a.id&&X==="customDomain",className:"bg-red-600 text-white font-bold py-1 px-2 rounded-md text-sm hover:bg-red-700 transition-colors whitespace-nowrap flex items-center justify-center min-w-[2rem]","data-tooltip-id":"action-tooltip","data-tooltip-content":"Delete custom domain",children:H===a.id&&X==="customDomain"?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsx(w,{icon:se,className:"h-4 w-4"})})]},a.id))]})}),e.jsxs("div",{className:"flex flex-col gap-2 ml-auto flex-shrink-0",children:[e.jsx("button",{className:"bg-yellow-400 text-black font-bold py-1 px-3 md:px-5 rounded-md text-sm hover:bg-yellow-500 transition-colors whitespace-nowrap",onClick:a=>{a.preventDefault(),at(t)},"data-tooltip-id":"action-tooltip","data-tooltip-content":"Edit this funnel",children:"Edit"}),(g==null?void 0:g.linkedin_access_token)&&e.jsx(e.Fragment,{children:e.jsx("button",{className:"bg-blue-600 text-white font-bold py-1 px-3 rounded-md text-sm hover:bg-blue-700 transition-colors whitespace-nowrap flex items-center justify-center gap-1",onClick:a=>{a.preventDefault(),Ke(t)},disabled:G,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Post this funnel on LinkedIn",children:G?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{icon:le,className:"h-3 w-3"}),"LinkedIn"]})})}),(g==null?void 0:g.reddit_token)&&e.jsx(e.Fragment,{children:e.jsx("button",{className:"bg-orange-600 text-white font-bold py-1 px-3 rounded-md text-sm hover:bg-orange-700 transition-colors whitespace-nowrap flex items-center justify-center gap-1",onClick:a=>{a.preventDefault(),Oe(t)},disabled:ee,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Share this funnel on Reddit",children:ee?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{icon:le,className:"h-3 w-3"}),"Reddit"]})})}),((u=t.handle_domains)==null?void 0:u.length)===0&&((r=t.custom_domains)==null?void 0:r.length)===0&&e.jsx("button",{onClick:()=>Ge(t.id,t.token),disabled:H===t.id&&X==="funnel",className:"bg-red-600 text-white font-bold py-1 px-3 rounded-md text-sm hover:bg-red-700 transition-colors whitespace-nowrap flex items-center justify-center","data-tooltip-id":"action-tooltip","data-tooltip-content":"Delete this funnel",children:H===t.id&&X==="funnel"?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsx(w,{icon:se,className:"h-4 w-4"})})]})]},t.id)})}),Ie&&e.jsx("div",{className:"flex justify-center mt-4",children:e.jsx("button",{className:"bg-black text-white border border-white px-8 py-2 rounded-md font-semibold hover:bg-white hover:text-black transition-colors",onClick:rt,disabled:I,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Load more funnels",children:I?"Loading...":"Load More"})})]}),e.jsxs("div",{className:"space-y-4 col-span-2",children:[e.jsxs("div",{className:"flex flex-wrap gap-3 mb-4",children:[e.jsxs("button",{className:"bg-gradient-to-r from-pink-600 to-rose-500 text-white rounded-lg px-4 py-2 flex items-center gap-2 hover:shadow-lg hover:from-pink-700 hover:to-rose-600 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-rose-400",type:"button",onClick:async t=>{var s;t.target===t.currentTarget.lastElementChild||t.target===((s=t.currentTarget.lastElementChild)==null?void 0:s.firstElementChild)?ye(!0):await Tt()},"data-tooltip-id":"action-tooltip","data-tooltip-content":"Load a demo or import from a URL",children:[e.jsx("span",{className:"font-medium",children:"EZ Funnel"}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer"}),e.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-rose-400"})]}),e.jsx("span",{className:"font-medium",children:"EZ Import"})]}),Me(),e.jsx("button",{className:"bg-gradient-to-r from-red-600 to-red-500 text-white rounded-lg px-4 py-2 font-medium hover:shadow-lg hover:from-red-700 hover:to-red-600 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-red-400",type:"button",onClick:()=>h(!0),"data-tooltip-id":"action-tooltip","data-tooltip-content":"Quickly create and save your funnel",children:"Instant Create"})]}),e.jsxs("button",{className:"bg-gradient-to-r from-yellow-500 to-yellow-400 text-gray-900 rounded-lg px-4 py-2 flex items-center gap-2 justify-center font-medium hover:shadow-lg hover:from-yellow-400 hover:to-yellow-300 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-yellow-500",type:"button",onClick:()=>we("top"),"data-tooltip-id":"action-tooltip","data-tooltip-content":"Add a new frame at the beginning",children:[e.jsx(w,{icon:ve,className:"text-lg"}),"Add to the Top"]}),e.jsx("div",{className:"space-y-4",children:b.map((t,o)=>e.jsx(pt,{index:o,form:t,updateForm:ot,removeForm:st,activePins:F,setActivePins:_,moveFormUp:Se,moveFormDown:Te,isFirst:o===0,isLast:o===b.length-1},t.id))}),e.jsxs("button",{className:"bg-gradient-to-r from-yellow-500 to-yellow-400 text-gray-900 rounded-lg px-4 py-2 flex items-center gap-2 justify-center font-medium hover:shadow-lg hover:from-yellow-400 hover:to-yellow-300 transition-all duration-200 h-10 focus:outline-none focus:ring-2 focus:ring-yellow-500",type:"button",onClick:()=>we("bottom"),"data-tooltip-id":"action-tooltip","data-tooltip-content":"Add a new frame at the end",children:[e.jsx(w,{icon:ve,className:"text-lg"}),"Add at the End"]})]})]})]})]})]})}export{zo 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.