import{j as e}from"./index-5JG4S71q.js";import{r as f}from"./vendor-react-DP_h-t3b.js";import{X as p,k as x}from"./vendor-ui-B25LK1Jt.js";class y extends f.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,c){}render(){var t;return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:[e.jsx("h3",{className:"text-red-800 font-semibold mb-2",children:"Something went wrong"}),e.jsx("p",{className:"text-red-600 text-sm",children:((t=this.state.error)==null?void 0:t.message)||"An unexpected error occurred"})]}):this.props.children}}function N({isOpen:o,onClose:t,onUpgrade:c}){return o?e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 animate-in fade-in duration-200",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:t}),e.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full overflow-hidden transform transition-all scale-100 animate-in zoom-in-95 duration-200",children:[e.jsx("button",{onClick:t,className:"absolute top-3 right-3 z-20 w-8 h-8 rounded-full bg-gray-100 hover:bg-gray-200 flex items-center justify-center text-gray-500 hover:text-gray-800 transition-colors",children:e.jsx(p,{size:18})}),e.jsxs("div",{className:"pt-8 px-6 pb-2 text-center",children:[e.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Run out of credits?"}),e.jsx("p",{className:"text-gray-600 leading-relaxed text-sm",children:"Upgrade now to unlock unlimited potential."})]}),e.jsx("div",{className:"relative h-48 w-full mt-4",children:e.jsx("img",{src:"/its_fine.gif",alt:"Unlock creativity",className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"px-6 pb-8 mt-6",children:[e.jsx("div",{className:"bg-white rounded-xl mb-6",children:e.jsxs("ul",{className:"space-y-3",children:[e.jsxs("li",{className:"flex items-center gap-3 text-sm text-gray-700",children:[e.jsx("div",{className:"p-1 rounded-full bg-blue-100 text-blue-600",children:e.jsx(x,{size:14,strokeWidth:3})}),e.jsx("span",{children:"Instant credit refill"})]}),e.jsxs("li",{className:"flex items-center gap-3 text-sm text-gray-700",children:[e.jsx("div",{className:"p-1 rounded-full bg-blue-100 text-blue-600",children:e.jsx(x,{size:14,strokeWidth:3})}),e.jsx("span",{children:"Uninterrupted creative flow"})]}),e.jsxs("li",{className:"flex items-center gap-3 text-sm text-gray-700",children:[e.jsx("div",{className:"p-1 rounded-full bg-blue-100 text-blue-600",children:e.jsx(x,{size:14,strokeWidth:3})}),e.jsx("span",{children:"Keep your accounts growing"})]})]})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("button",{onClick:c,className:"group relative w-full p-[1px] rounded-full bg-gradient-to-r from-cyan-400 via-fuchsia-500 to-amber-500 shadow-lg hover:shadow-xl hover:shadow-fuchsia-500/20 transition-all active:scale-[0.98]",children:e.jsx("div",{className:"relative w-full h-full bg-black rounded-full px-4 py-3 flex items-center justify-center transition-colors group-hover:bg-gray-900",children:e.jsx("span",{className:"font-bold text-white",children:"Upgrade"})})}),e.jsx("button",{onClick:t,className:"w-full py-2 px-4 text-gray-400 font-medium hover:text-gray-600 transition-colors text-sm",children:"No thanks"})]})]})]})]}):null}function g(o,t){const c=o.length,u=t.length,i=Array(c+1).fill(0).map(()=>Array(u+1).fill(0));for(let n=1;n<=c;n++)for(let a=1;a<=u;a++)o[n-1]===t[a-1]?i[n][a]=i[n-1][a-1]+1:i[n][a]=Math.max(i[n-1][a],i[n][a-1]);const d=[];let s=c,r=u;for(;s>0||r>0;)s>0&&r>0&&o[s-1]===t[r-1]?(d.unshift({type:"equal",value:t[r-1]}),s--,r--):r>0&&(s===0||i[s][r-1]>=i[s-1][r])?(d.unshift({type:"insert",value:t[r-1]}),r--):s>0&&(d.unshift({type:"delete",value:o[s-1]}),s--);return d}function w(o,t){const c=o.split(`
`),u=t.split(`
`),i=[];for(let d=0;d<Math.max(c.length,u.length);d++){const s=c[d]||"",r=u[d]||"",n=s.split(/(\s+)/).filter(h=>h.trim().length>0),a=r.split(/(\s+)/).filter(h=>h.trim().length>0),m=g(n,a),l=[];for(const h of m)h.type==="equal"?(l.length>0&&!l[l.length-1].endsWith(" ")&&l.push(" "),l.push(h.value)):h.type==="insert"&&(l.length>0&&!l[l.length-1].endsWith(" ")&&l.push(" "),l.push(`<span class="text-green-600 font-medium">${h.value}</span>`));i.push(l.join(""))}return i.join(`
`)}export{y as E,N as O,w as h};