1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[3505],{33505:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var n=r(65043),i=r(91357),o=r(79722),a=r(63331),s=r(70579);function l(){const e=(0,i.Zp)(),t=(0,i.zy)(),[r,l]=(0,n.useState)([]),[d,c]=(0,n.useState)(!0),[g,m]=(0,n.useState)(null),[u,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{b();"true"===new URLSearchParams(t.search).get("create")&&(h(),e("/client/websites",{replace:!0}))},[]);const b=async()=>{c(!0),m(null);const t=localStorage.getItem("token");if(t)try{const e=await o.A.get("".concat(a.n,"/client/websites"),{headers:{Authorization:"Bearer ".concat(t)}});l(e.data.websites||[])}catch(r){console.error("Failed to fetch websites:",r),m("Failed to load websites. Please try again.")}finally{c(!1)}else e("/client/login")},h=async()=>{p(!0);const t=localStorage.getItem("token");try{const r=await o.A.post("".concat(a.n,"/client/websites"),{business_name:"My New Website",content:{template_version:"v3",template_id:"wellness-modern",tagline:"Your success is our mission",sections:[]}},{headers:{Authorization:"Bearer ".concat(t)}});e("/client/websites/".concat(r.data.website_id,"/edit"))}catch(i){var r,n;console.error("Failed to create website:",i),alert((null===(r=i.response)||void 0===r||null===(n=r.data)||void 0===n?void 0:n.detail)||"Failed to create website. Please try again."),p(!1)}};return(0,s.jsxs)("div",{style:{minHeight:"100vh",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",padding:"2rem"},children:[(0,s.jsxs)("div",{style:{maxWidth:"1400px",margin:"0 auto 2rem auto",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{style:{fontSize:"2.5rem",fontWeight:"700",color:"white",margin:0,marginBottom:"0.5rem"},children:"\ud83c\udf10 My Websites"}),(0,s.jsx)("p",{style:{color:"rgba(255, 255, 255, 0.9)",fontSize:"1.125rem",margin:0},children:"Create and manage your professional websites"})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,s.jsx)("button",{onClick:()=>e("/client/dashboard"),style:{padding:"0.75rem 1.5rem",background:"rgba(255, 255, 255, 0.2)",border:"none",borderRadius:"10px",color:"white",fontWeight:"600",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:e=>e.target.style.background="rgba(255, 255, 255, 0.3)",onMouseLeave:e=>e.target.style.background="rgba(255, 255, 255, 0.2)",children:"\u2190 Back to Dashboard"}),(0,s.jsx)("button",{onClick:h,disabled:u,style:{padding:"0.75rem 1.5rem",background:u?"#9ca3af":"white",border:"none",borderRadius:"10px",color:"#667eea",fontWeight:"600",cursor:u?"not-allowed":"pointer",transition:"all 0.2s"},onMouseEnter:e=>{u||(e.target.style.background="#f8f9fa",e.target.style.transform="translateY(-2px)")},onMouseLeave:e=>{u||(e.target.style.background="white",e.target.style.transform="translateY(0)")},children:u?"Creating...":"+ Create New Website"})]})]}),(0,s.jsx)("div",{style:{maxWidth:"1400px",margin:"0 auto"},children:d?(0,s.jsxs)("div",{style:{background:"white",borderRadius:"20px",padding:"4rem",textAlign:"center"},children:[(0,s.jsx)("div",{style:{width:"50px",height:"50px",border:"4px solid #f3f3f3",borderTop:"4px solid #667eea",borderRadius:"50%",animation:"spin 1s linear infinite",margin:"0 auto 1rem auto"}}),(0,s.jsx)("p",{style:{color:"#666",fontSize:"1.125rem"},children:"Loading your websites..."}),(0,s.jsx)("style",{children:"\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]}):g?(0,s.jsxs)("div",{style:{background:"white",borderRadius:"20px",padding:"3rem",textAlign:"center"},children:[(0,s.jsx)("div",{style:{fontSize:"4rem",marginBottom:"1rem"},children:"\u26a0\ufe0f"}),(0,s.jsx)("p",{style:{color:"#666",fontSize:"1.125rem"},children:g}),(0,s.jsx)("button",{onClick:b,style:{marginTop:"1rem",padding:"0.75rem 1.5rem",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",border:"none",borderRadius:"10px",color:"white",fontWeight:"600",cursor:"pointer"},children:"Try Again"})]}):0===r.length?(0,s.jsxs)("div",{style:{background:"white",borderRadius:"20px",padding:"4rem",textAlign:"center"},children:[(0,s.jsx)("div",{style:{fontSize:"5rem",marginBottom:"1rem"},children:"\ud83c\udf10"}),(0,s.jsx)("h2",{style:{fontSize:"2rem",fontWeight:"700",color:"#1e293b",marginBottom:"1rem"},children:"No Websites Yet"}),(0,s.jsx)("p",{style:{color:"#64748b",fontSize:"1.125rem",marginBottom:"2rem",maxWidth:"500px",margin:"0 auto 2rem auto"},children:"Create your first professional website in minutes with our powerful drag-and-drop builder!"}),(0,s.jsx)("button",{onClick:h,disabled:u,style:{padding:"1rem 2rem",background:u?"#9ca3af":"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",border:"none",borderRadius:"12px",color:"white",fontWeight:"600",fontSize:"1.125rem",cursor:u?"not-allowed":"pointer",transition:"transform 0.2s",boxShadow:"0 10px 25px rgba(102, 126, 234, 0.3)"},onMouseEnter:e=>!u&&(e.target.style.transform="translateY(-2px)"),onMouseLeave:e=>!u&&(e.target.style.transform="translateY(0)"),children:u?"Creating...":"Create Your First Website"})]}):(0,s.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(350px, 1fr))",gap:"2rem"},children:r.map(t=>{var n,i;return(0,s.jsxs)("div",{style:{background:"white",borderRadius:"20px",overflow:"hidden",transition:"transform 0.2s, box-shadow 0.2s",boxShadow:"0 10px 25px rgba(0, 0, 0, 0.1)",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-5px)",e.currentTarget.style.boxShadow="0 20px 40px rgba(0, 0, 0, 0.15)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 10px 25px rgba(0, 0, 0, 0.1)"},children:[(0,s.jsxs)("div",{style:{height:"150px",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[(0,s.jsx)("div",{style:{fontSize:"4rem",filter:"brightness(0) invert(1)",opacity:.3},children:"\ud83c\udf10"}),t.published&&"Free"!==(null===(n=t.subscription)||void 0===n?void 0:n.plan_name)?(0,s.jsx)("span",{style:{position:"absolute",top:"1rem",right:"1rem",background:"#10b981",color:"white",padding:"0.375rem 0.75rem",borderRadius:"20px",fontSize:"0.75rem",fontWeight:"700",textTransform:"uppercase",letterSpacing:"0.05em"},children:"\u2713 Published"}):"Free"===(null===(i=t.subscription)||void 0===i?void 0:i.plan_name)?(0,s.jsx)("span",{style:{position:"absolute",top:"1rem",right:"1rem",background:"#3b82f6",color:"white",padding:"0.375rem 0.75rem",borderRadius:"20px",fontSize:"0.75rem",fontWeight:"700",textTransform:"uppercase",letterSpacing:"0.05em"},children:"\ud83d\udc41\ufe0f Preview Only"}):null]}),(0,s.jsxs)("div",{style:{padding:"1.5rem"},children:[(0,s.jsx)("h3",{style:{fontSize:"1.5rem",fontWeight:"700",color:"#1e293b",marginBottom:"0.5rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.business_name}),(0,s.jsx)("p",{style:{color:"#64748b",fontSize:"0.875rem",marginBottom:"1rem",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",minHeight:"2.5rem"},children:t.business_description}),t.custom_domain&&(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginBottom:"1rem",padding:"0.5rem",background:"#f8f9fa",borderRadius:"8px"},children:[(0,s.jsx)("span",{style:{fontSize:"0.875rem"},children:"\ud83d\udd17"}),(0,s.jsx)("span",{style:{fontSize:"0.875rem",color:"#667eea",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.custom_domain})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",color:"#94a3b8",fontSize:"0.75rem",marginBottom:"1.5rem"},children:[(0,s.jsx)("span",{children:"\ud83d\udcc5"}),(0,s.jsxs)("span",{children:["Created ",new Date(t.created_at).toLocaleDateString()]})]}),(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.75rem"},children:[(0,s.jsx)("button",{onClick:r=>{r.stopPropagation(),e("/client/websites/".concat(t.id,"/edit"))},style:{padding:"0.75rem",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",border:"none",borderRadius:"10px",color:"white",fontWeight:"600",cursor:"pointer",fontSize:"0.875rem",transition:"transform 0.2s"},onMouseEnter:e=>e.target.style.transform="scale(1.05)",onMouseLeave:e=>e.target.style.transform="scale(1)",children:"\u270f\ufe0f Edit"}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),(async e=>{var t;const n=localStorage.getItem("token"),i=r.find(t=>
1t.id===e);let s;if("active"===(null===i||void 0===i||null===(t=i.subscription)||void 0===t?void 0:t.status)){const e=i.subscription.plan_name,t=i.subscription.billing_period_end?new Date(i.subscription.billing_period_end).toLocaleDateString():"the end of the billing period";s="\u26a0\ufe0f WARNING: This website has an active subscription (".concat(e,").\n\nBy deleting this website:\n\u2022 The subscription will be cancelled\n\u2022 It will remain active until: ").concat(t,"\n\u2022 You will not be charged again\n\u2022 This action is irreversible\n\nDo you want to continue?")}else s="Are you sure you want to delete this website?";if(window.confirm(s))try{const t=await o.A.delete("".concat(a.n,"/client/websites/").concat(e),{headers:{Authorization:"Bearer ".concat(n)}});if(t.data.subscription_cancelled&&t.data.subscription_info){const{plan_name:e,billing_period_end:r}=t.data.subscription_info,n=new Date(r).toLocaleDateString(),i="Website deleted successfully.\n\nYour ".concat(e," subscription has been cancelled and will remain active until ").concat(n,".");alert(i)}b()}catch(l){console.error("Failed to delete website:",l),alert("Failed to delete website. Please try again.")}})(t.id)},style:{padding:"0.75rem",background:"#ef4444",border:"none",borderRadius:"10px",color:"white",fontWeight:"600",cursor:"pointer",fontSize:"0.875rem",transition:"transform 0.2s"},onMouseEnter:e=>{e.target.style.background="#dc2626",e.target.style.transform="scale(1.05)"},onMouseLeave:e=>{e.target.style.background="#ef4444",e.target.style.transform="scale(1)"},children:"\ud83d\uddd1\ufe0f Delete"})]})]})]},t.id)})})})]})}}}]); 2//# sourceMappingURL=3505.e6ff3a7f.chunk.js.map
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.