1import{r as e}from"./chunk-QTnfLwEv.js";import{t}from"./react-xd4aoMiW.js";import{t as n}from"./link-BzNjvRVF.js";import{t as r}from"./jsx-runtime-DsKLSDJq.js";import{t as i}from"./client-Dx86dDvJ.js";import{r as a}from"./dist-Dwz9hXTh.js";import{t as o}from"./button-eRC2Y0Fi.js";import{t as s}from"./upload-DjNt3cTs.js";import{Tn as c,dt as l,it as u,pn as d,ut as f}from"./index-BAF8SXXG.js";var p=e(t()),m=r();function h(){let e=c(),[t,r]=(0,p.useState)(!1),[u,h]=(0,p.useState)({companyName:``,email:``,password:``,phone:``,taxId:``,city:``,categories:``,brands:``,serviceArea:``,about:``});function y(e,t){h(n=>({...n,[e]:t}))}async function b(t){t.preventDefault(),r(!0);let{data:n,error:o}=await i.auth.signUp({email:u.email,password:u.password,options:{emailRedirectTo:`${window.location.origin}/firma-panel`,data:{full_name:u.companyName,phone:u.phone,role:`provider`}}});if(o){a.error(o.message),r(!1);return}if(n.user){let e=u.companyName.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,60)||`firma-${Date.now()}`,{error:t}=await i.from(`providers`).insert({owner_user_id:n.user.id,company_name:u.companyName,slug:`${e}-${n.user.id.slice(0,6)}`,city:u.city||null,about:u.about||null,contact_phone:u.phone||null,contact_email:u.email,is_verified:!1});t&&console.warn(`provider insert:`,t.message)}a.success(`Firma hesabınız oluÅturuldu. Email adresinizi doÄrulayın.`),r(!1),setTimeout(()=>e({to:`/auth`}),1200)}return(0,m.jsx)(`div`,{className:`min-h-screen bg-mist py-10 px-4`,children:(0,m.jsxs)(`div`,{className:`mx-auto max-w-2xl`,children:[(0,m.jsx)(n,{to:`/`,className:`mb-6 flex items-center justify-center`,children:(0,m.jsxs)(`span`,{className:`font-display text-3xl font-extrabold text-ink`,children:[`servis`,(0,m.jsx)(`span`,{className:`text-brand`,children:`.net`})]})}),(0,m.jsxs)(`div`,{className:`rounded-2xl border border-line bg-paper p-8 shadow-sm`,children:[(0,m.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,m.jsx)(`div`,{className:`grid h-12 w-12 place-items-center rounded-xl bg-brand-soft text-brand`,children:(0,m.jsx)(d,{className:`h-6 w-6`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`font-display text-2xl font-bold text-ink`,children:`Firma Olarak Ãye Ol`}),(0,m.jsx)(`p`,{className:`text-sm text-muted-ink`,children:`Ãcretsiz profil oluÅturun, teklif talepleri almaya baÅlayın.`})]})]}),(0,m.jsxs)(`form`,{onSubmit:b,className:`space-y-5`,children:[(0,m.jsxs)(g,{title:`Åirket Bilgileri`,children:[(0,m.jsx)(_,{children:(0,m.jsx)(v,{label:`Firma Adı`,required:!0,children:(0,m.jsx)(l,{required:!0,value:u.companyName,onChange:e=>y(`companyName`,e.target.value)})})}),(0,m.jsxs)(_,{cols:2,children:[(0,m.jsx)(v,{label:`Vergi No / TC`,required:!0,children:(0,m.jsx)(l,{required:!0,value:u.taxId,onChange:e=>y(`taxId`,e.target.value)})}),(0,m.jsx)(v,{label:`Åehir`,required:!0,children:(0,m.jsx)(l,{required:!0,value:u.city,onChange:e=>y(`city`,e.target.value)})})]}),(0,m.jsxs)(_,{cols:2,children:[(0,m.jsx)(v,{label:`Email`,required:!0,children:(0,m.jsx)(l,{type:`email`,required:!0,value:u.email,onChange:e=>y(`email`,e.target.value)})}),(0,m.jsx)(v,{label:`Telefon`,required:!0,children:(0,m.jsx)(l,{required:!0,value:u.phone,onChange:e=>y(`phone`,e.target.value)})})]}),(0,m.jsx)(_,{children:(0,m.jsx)(v,{label:`Åifre`,required:!0,children:(0,m.jsx)(l,{type:`password`,required:!0,minLength:6,value:u.password,onChange:e=>y(`password`,e.target.value)})})})]}),(0,m.jsxs)(g,{title:`Hizmet Bilgileri`,children:[(0,m.jsx)(_,{children:(0,m.jsx)(v,{label:`Hizmet VerdiÄi Kategoriler`,hint:`Virgülle ayırın: Beyaz EÅya, Klima...`,children:(0,m.jsx)(l,{value:u.categories,onChange:e=>y(`categories`,e.target.value)})})}),(0,m.jsx)(_,{children:(0,m.jsx)(v,{label:`Yetkili/Servis Verilen Markalar`,hint:`Arçelik, Bosch, Samsung...`,children:(0,m.jsx)(l,{value:u.brands,onChange:e=>y(`brands`,e.target.value)})})}),(0,m.jsx)(_,{children:(0,m.jsx)(v,{label:`Hizmet Bölgesi`,hint:`İlçe listesi`,children:(0,m.jsx)(l,{value:u.serviceArea,onChange:e=>y(`serviceArea`,e.target.value)})})}),(0,m.jsx)(_,{children:(0,m.jsx)(v,{label:`Firma Hakkında`,children:(0,m.jsx)(f,{rows:3,value:u.about,onChange:e=>y(`about`,e.target.value)})})})]}),(0,m.jsx)(g,{title:`Evraklar`,children:(0,m.jsxs)(`div`,{className:`rounded-xl border-2 border-dashed border-line bg-mist p-6 text-center`,children:[(0,m.jsx)(s,{className:`mx-auto h-6 w-6 text-muted-ink`}),(0,m.jsx)(`p`,{className:`mt-2 text-sm text-ink-2`,children:`Vergi levhası, yetkili servis belgesi (opsiyonel)`}),(0,m.jsx)(`p`,{className:`text-xs text-muted-ink`,children:`PDF, JPG â yükleme sonraki fazda aktifleÅecek`})]})}),(0,m.jsx)(o,{type:`submit`,className:`w-full`,size:`lg`,disabled:t,children:t?`Kaydediliyor...`:`Firma Hesabı OluÅtur`}),(0,m.jsxs)(`p`,{className:`text-center text-xs text-muted-ink`,children:[`Zaten hesabınız var mı? `,(0,m.jsx)(n,{to:`/auth`,className:`font-semibold text-brand hover:underline`,children:`GiriÅ yapın`})]})]})]})]})})}function g({title:e,children:t}){return(0,m.jsxs)(`div`,{className:`rounded-xl border border-line bg-mist/40 p-4 space-y-3`,children:[(0,m.jsx)(`h3`,{className:`font-display text-sm font-bold uppercase tracking-wider text-muted-ink`,children:e}),t]})}function _({children:e,cols:t=1}){return(0,m.jsx)(`div`,{className:t===2?`grid gap-3 sm:grid-cols-2`:``,children:e})}function v({label:e,hint:t,required:n,children:r}){return(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsxs)(u,{children:[e,n&&(0,m.jsx)(`span`,{className:`text-danger`,children:` *`})]}),r,t&&(0,m.jsx)(`p`,{className:`text-xs text-muted-ink`,children:t})]})}
1export{h as component};
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.