PageSourceSearch

https://superkoopjes.be/assets/ExpressListing-a-zuyOnw.js

js superkoopjes.be collected 2026-10-02 01:18:02 UTC 27,022 bytes, 1 lines download raw bytes

1import{r as l,a as $e,a1 as We,s as S,N as us,bP as hs,b as xs,cn as fs,cl as js,j as e,B as D,A as bs,D as G,bv as ws,h as fe,a8 as J,i as je,a7 as vs,b2 as _s,a0 as be,k as B,ao as Ee,ap as Fe,aq as De,ar as ze,as as K,I as Le,_ as ys,X as Ns,aK as Me,aL as Ue,aM as Re,aN as Te,b1 as Oe,aP as Ge,c2 as ks}from"./index-C-GMF1w8.js";import{T as Ss}from"./textarea-D7e56OfZ.js";import{S as Cs}from"./steps-C4WyQ8Qa.js";import{u as Ps,a as Is,I as As,L as Es,A as Fs,b as Ds,S as zs,C as Ls,c as Ms,P as Us,m as Be}from"./AuctionOptionsSelector-D39p64A9.js";import{u as Rs,C as Ts}from"./useContentPolicy-DmV34FSL.js";import{a as Os,c as Ve}from"./contentPolicy-dYWk5r9B.js";import{u as Gs}from"./useUserCredits-DxY5JZpY.js";import{L as Bs,p as Vs}from"./listingPayment-CPJ3mii4.js";import{d as $s,v as Ws,a as Qs}from"./auction-COwh8X30.js";import{u as qs}from"./useSellerShippingDefaults-DpywKTQW.js";import{e as Hs,a as Js,d as Ks,v as Ys,f as Xs,b as Zs,c as et,t as st}from"./animalListing-BoTNqb3v.js";import{d as tt,a as it,v as rt,b as at}from"./shippingOptions-Vq3p8o_6.js";import{W as nt}from"./wand-sparkles-DpftdW1o.js";import"./radio-group-BMHLG4Pj.js";import"./badge-check-DYCNfIID.js";import"./boostTranslations-DJ7zTKsj.js";import"./package-open-C89kUuqK.js";import"./handshake-BJjX6unH.js";import"./gavel-BrqbCfF-.js";import"./PaymentBrands-w7k3KgPE.js";import"./paypal-C1JI37v9.js";import"./orderPayment-BFKEyGSy.js";import"./paymentRedirect-Hyf9-okN.js";const ot=()=>{const[v,_]=l.useState(!1),[h,t]=l.useState(!1),[ie,L]=l.useState(!1),[V,$]=l.useState(0),{toast:Y}=us(),{user:F}=$e(),{t:re}=We(),ae=async a=>{const{compressImage:g}=await hs(async()=>{const{compressImage:u}=await import("./imageCompression-D40gh0bc.js");return{compressImage:u}},[]),m=await g(a);return{file:m.compressedFile,webpFile:m.webpFile,avifFile:m.avifFile,blurDataURL:m.blurPlaceholder}};return{uploadImages:async a=>{_(!0),$(0);const g=[];try{if(!(F!=null&&F.id))throw new Error("Niet ingelogd");for(let m=0;m<a.length;m++){const u=a[m],{file:I,webpFile:x,avifFile:f,blurDataURL:N}=await ae(u),X=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,M=`${F.id}/${X}`,j=`${M}.jpg`,{error:U}=await S.storage.from("product-images").upload(j,I,{contentType:"image/jpeg",cacheControl:"3600",upsert:!0});if(U)throw U;const{data:{publicUrl:C}}=S.storage.from("product-images").getPublicUrl(j);let R,z;if(x){const A=`${M}.webp`,{error:k}=await S.storage.from("product-images").upload(A,x);if(k)console.error("WebP upload error:",k);else{const{data:{publicUrl:W}}=S.storage.from("product-images").getPublicUrl(A);R=W,z=A}}let T,Z;if(f){const A=`${M}.avif`,{error:k}=await S.storage.from("product-images").upload(A,f);if(k)console.error("AVIF upload error:",k);else{const{data:{publicUrl:W}}=S.storage.from("product-images").getPublicUrl(A);T=W,Z=A}}g.push({url:C,path:j,webpUrl:R,webpPath:z,avifUrl:T,avifPath:Z,blurDataURL:N}),$((m+1)/a.length*100)}return g}catch(m){throw console.error("Error uploading images:",m),m}finally{_(!1),$(0)}},classifyImage:async a=>{t(!0);try{const{data:g,error:m}=await S.functions.invoke("classify-product-image",{body:{imageDataUrl:a}});if(m){let u="";try{const I=m==null?void 0:m.context;if(I&&typeof I.text=="function"){const x=await I.text();try{const f=JSON.parse(x);u=(f==null?void 0:f.error)||x}catch{u=x}}}catch{}throw new Error(u||m.message)}if(g&&g.success===!1)throw new Error(g.error||"Onbekende fout");return g}catch(g){return console.error("Error classifying image:",g),Y({title:re("express.error.classification_title","AI-analyse niet beschikbaar"),description:re("express.error.classification_failed","We kunnen je foto momenteel niet automatisch analyseren. Kies zelf een categorie uit de lijst om verder te gaan."),variant:"destructive",duration:15e3}),{primary_category_id:null,primary_category_name:"",secondary_category_id:null,secondary_category_name:null,confidence:0,suggested_title:"",suggested_description:"",estimated_price:null,estimated_brand:"",suggested_condition:"used",keywords:[],reasoning:"Classification failed"}}finally{t(!1)}},submitListing:async a=>{L(!0);try{if(!F)throw new Error("User not authenticated");const{data:g,error:m}=await S.from("products").insert([{seller_id:F.id,title:a.title,de
1scription:a.description,short_description:a.description.substring(0,100),price:a.is_free?0:parseFloat(a.price),is_free:!!a.is_free,category_id:a.category_id,condition:a.condition,quantity:1,status:a.status??"active",is_active:(a.status??"active")!=="draft",shipping_cost:5.99,free_shipping:!1,meta_title:a.title,meta_description:a.description.substring(0,160),created_via:"express_mobile",ai_suggested_category:a.ai_suggested,ai_confidence_score:a.ai_confidence,listing_channel:a.listing_channel||"private",external_url:a.listing_channel==="external"&&a.external_url||null,...a.shipping||{},...a.auction||{},...a.animal||{}}]).select().single();if(m)throw m;if(a.uploadedImages.length>0){const u=a.uploadedImages.map((f,N)=>({product_id:g.id,image_url:f.url,is_primary:N===0,sort_order:N})),I=u.map((f,N)=>({...f,webp_url:a.uploadedImages[N].webpUrl||null,avif_url:a.uploadedImages[N].avifUrl||null}));let{error:x}=await S.from("product_images").insert(I);if(x&&(console.error("Error inserting images (with variants):",x),x=(await S.from("product_images").insert(u)).error),x)throw console.error("Error inserting images:",x),new Error(`Zoekertje aangemaakt, maar de foto's konden niet worden opgeslagen: ${x.message}`)}return a.silent||Y({title:a.status==="draft"?"Concept opgeslagen":"Success!",description:a.status==="draft"?"Je zoekertje is bewaard als concept. Je vindt het terug in je dashboard.":"Your listing is now live with optimized images"}),g}catch(g){throw console.error("Error creating listing:",g),g}finally{L(!1)}},isUploading:v,isClassifying:h,isSubmitting:ie,uploadProgress:V}},we=768;function lt(){const[v,_]=l.useState(void 0);return l.useEffect(()=>{const h=window.matchMedia(`(max-width: ${we-1}px)`),t=()=>{_(window.innerWidth<we)};return h.addEventListener("change",t),_(window.innerWidth<we),()=>h.removeEventListener("change",t)},[]),!!v}const Ft=()=>{const v=xs(),{user:_,profile:h}=$e(),{t}=We(),ie=lt(),L=l.useRef(null),V=Rs(),{uploadImages:$,classifyImage:Y,submitListing:F,isUploading:re,isClassifying:ae,isSubmitting:ne,uploadProgress:oe}=ot(),[y,a]=l.useState(1),[g,m]=l.useState(null),{reward:u,claim:I,clearReward:x}=Ps(),{grantListingSpins:f}=fs(),{credits:N}=Gs(),[X,M]=l.useState(!1),[j,U]=l.useState(null),[C,R]=l.useState([]),[z,T]=l.useState([]),[Z,A]=l.useState([]),[k,W]=l.useState([]),[n,Qe]=l.useState(null),[i,w]=l.useState({title:"",description:"",price:"",is_free:!1,category_id:"",condition:"used",listing_channel:"private",external_url:""}),[le,ve]=l.useState({...tt}),ee=qs(),[_e,qe]=l.useState(!1);l.useEffect(()=>{if(ee.loading||_e)return;const s=ee.defaults;ve(o=>({...o,domesticCost:s.shippingCost!==""?s.shippingCost:o.domesticCost,freeFromAmount:s.freeFromAmount,freeFromVatMode:s.freeFromVatMode})),qe(!0)},[ee.loading,ee.defaults,_e]);const{hasShop:ye}=js(),[ce,He]=l.useState(Hs()),Je=s=>{if(He(o=>({...o,...s})),s.animal_type){const o=Zs(s.animal_type,k);o&&w(r=>({...r,category_id:o.id}))}},de=Js(i.category_id,k),Ne=Ks(i.category_id,k,i.title,i.description),me=Ys({state:ce,inAnimalCategory:de,signals:Ne,hkNumber:h==null?void 0:h.hk_number}),[E,Ke]=l.useState({...$s}),{quota:c}=Is(i.category_id||null,i.listing_channel),[Ye,ke]=l.useState(!1),[Se,pe]=l.useState(!1),[P,se]=l.useState("idle"),[te,b]=l.useState({show:!1,title:"",message:""}),[Xe,Q]=l.useState(!1),[ge,Ze]=l.useState("mollie"),[ue,es]=l.useState(!1),Ce=(N==null?void 0:N.balance)||0;l.useEffect(()=>{if(!_){v("/auth");return}localStorage.getItem("express_listing_tutorial_seen")||(ke(!0),localStorage.setItem("express_listing_tutorial_seen","true")),ss()},[_]);const ss=async()=>{const{data:s}=await S.from("categories").select("*").eq("is_active",!0).order("name");W(s||[])},Pe=s=>{const o=s.filter(p=>p.type.startsWith("image/")).filter(p=>p.size<=10485760);if(o.length===0)return;const r=[...C,...o].slice(0,5);R(r),T(r.map(p=>URL.createObjectURL(p)))},ts=s=>{Pe(Array.from(s.target.files||[])),s.target.value=""},Ie=s=>{s.preventDefault(),Se||pe(!0)},is=s=>{s.preventDefault(),pe(!1)},rs=s=>{s.preventDefault(),pe(!1),Pe(Array.from(s.dataTransfer.files||[]))},as=s=>{const o=C.filter((p,d)=>d!==s),r=z.filter((p,d)=>d!==s);R(o),T(r)},ns=(s,o)=>{R(r=>
1Be(r,s,o)),T(r=>Be(r,s,o))},os=s=>new Promise((o,r)=>{const p=new FileReader;p.onerror=()=>r(new Error("read failed")),p.onload=()=>{const d=new Image;d.onerror=()=>o(p.result),d.onload=()=>{const H=Math.min(1,1024/Math.max(d.width,d.height)),O=document.createElement("canvas");O.width=Math.round(d.width*H),O.height=Math.round(d.height*H);const Ae=O.getContext("2d");if(!Ae)return o(p.result);Ae.drawImage(d,0,0,O.width,O.height),o(O.toDataURL("image/jpeg",.8))},d.src=p.result},p.readAsDataURL(s)}),ls=async()=>{if(C.length===0){b({show:!0,title:t("error.title","Fout"),message:t("express.error.no_images","Selecteer minimaal één foto om door te gaan.")});return}if(!(P==="uploading"||P==="analyzing"))try{se("uploading");const s=await $(C);A(s),se("analyzing");const o=await os(C[0]),r=await Y(o);Qe(r);const p=r.confidence>=60&&r.primary_category_id;w(d=>{var xe,H;return{...d,category_id:p?r.primary_category_id:d.category_id,condition:r.suggested_condition||d.condition||"used",title:!d.title&&((xe=r.suggested_title)!=null&&xe.trim())?r.suggested_title.trim().slice(0,100):d.title,description:!d.description&&((H=r.suggested_description)!=null&&H.trim())?r.suggested_description.trim().slice(0,500):d.description,price:!d.price&&r.estimated_price&&r.estimated_price>0?String(Number(r.estimated_price).toFixed(2)):d.price}}),se("done"),a(2)}catch(s){console.error("Error processing images:",s),se("idle"),b({show:!0,title:t("error.upload_failed","Upload Mislukt"),message:t("express.error.upload_message","Er is een fout opgetreden bij het uploaden van je afbeeldingen. Probeer het opnieuw.")})}},q=Os({title:i.title,description:i.description},{context:"listing",isAdmin:V}),cs=()=>{w(s=>({...s,title:Ve(s.title,{context:"listing",isAdmin:V}).sanitized,description:Ve(s.description,{context:"listing",isAdmin:V}).sanitized}))},ds=async()=>{if(!i.title||!E.enabled&&!i.is_free&&!i.price||!i.category_id){b({show:!0,title:t("error.incomplete","Onvolledige Gegevens"),message:t("express.error.required_fields","Vul alle verplichte velden in: titel, prijs en categorie.")});return}if(q.result.hasBlocking){b({show:!0,title:t("policy.blocked.title","Verwijzingen naar buiten het platform zijn niet toegelaten"),message:t("policy.blocked.toast","Verwijder eerst de links of contactgegevens uit je tekst.")});return}if(i.listing_channel==="external"&&!/^https?:\/\//i.test(i.external_url.trim())){b({show:!0,title:t("error.incomplete","Onvolledige Gegevens"),message:t("channel.external.url_required","Geef de link (https://...) naar het product op je eigen site.")});return}const s=Ws(E);if(s){b({show:!0,title:t("error.incomplete","Onvolledige Gegevens"),message:s});return}const o=rt(le);if(o){b({show:!0,title:t("error.incomplete","Onvolledige Gegevens"),message:o});return}if(me.needsHkNumber||me.error){b({show:!0,title:t("error.incomplete","Onvolledige Gegevens"),message:me.error||"Voor de verkoop van katten of honden is een geverifieerd HK-nummer verplicht. Vul dit in via je verkopersprofiel."});return}try{await he("active")}catch(r){console.error("Error submitting listing:",r);const p=String((r==null?void 0:r.message)||"");if(/FREE_LISTING_QUOTA_EXCEEDED|CATEGORY_ACTIVE_FREE_LIMIT|CATEGORY_REQUIRES_PAID_LISTING/.test(p)){Q(!0);return}const d=st(p);b({show:!0,title:d?"Zoekertje voor dieren geweigerd":t("error.submit_failed","Publicatie Mislukt"),message:d||t("express.error.submit_message","Er is een fout opgetreden bij het publiceren van je zoekertje. Probeer het opnieuw.")})}},he=async(s,o)=>{const r=await F({title:i.title,description:i.description,price:E.enabled?E.startPrice:i.is_free?"0":i.price,is_free:!E.enabled&&i.is_free,category_id:i.category_id,condition:i.condition,uploadedImages:Z,ai_suggested:(n==null?void 0:n.primary_category_id)===i.category_id,ai_confidence:(n==null?void 0:n.confidence)||0,keywords:(n==null?void 0:n.keywords)||[],listing_channel:i.listing_channel,external_url:i.external_url.trim(),shipping:at(le),auction:Qs(E),animal:et(ce,{inAnimalCategory:de}),status:s,silent:o==null?void 0:o.silent});if(s==="draft")return r;if(r!=null&&r.id){await I(r.id);const p=await f(r.id);p.spinsGranted>0&&U(p),m(r.id)}else v("/seller/dashboard");return r},ms=async()=>{Q(!1);try{const s=await he("draft");s!=null&&s.id&&v("/seller/dashboard")}catch(s){console.error("Error saving draft:",s),b({show:!0,title:t("error.submit_failed","Publicatie Mislukt"),message:t("express.error.submit_message","Er is een fout opgetreden bij het publiceren van je zoekertje. Probeer het opnieuw.")})}},ps=async()=>{Q(!1);try{const s=await he("draft",{silent:!0});if(!(s!=null&&s.id))throw new Error("Concept kon niet worden bewaard");await Vs({productId:s.id,title:i.title,amount:(c==null?void 0:c.extraListingPrice)??2.79,provider:ge,userId:_==null?void 0:_.id,creditsAmount:ue?Math.min(Ce,(c==null?void 0:c.extraListingPrice)??2.79):0})||v(`/product/${s.id}`)}catch(s){console.error("Error starting listing payment:",s),b({show:!0,title:t("error.submit_failed","Publicatie Mislukt"),message:t("listing.quota.payment_failed","De betaling kon niet gestart worden. Je zoekertje is wel als concept bewaard in je dashboard.")})}},gs=[{title:t("express.step1","Photos"),completed:y>1,active:y===1},{title:t("express.step2","Details"),completed:y>2,active:y===2},{title:t("express.step3","Publish"),completed:!1,active:y===3}];return e.jsxs("div",{className:"min-h-screen bg-background pb-20",children:[e.jsx("div",{className:"sticky top-0 z-10 bg-background border-b",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-4 flex items-center gap-3",children:[e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>y===1?v(-1):a(y-1),className:"shrink-0",children:e.jsx(bs,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-xl font-bold tracking-tight",children:t("express.title","Quick Sell")}),e.jsxs(G,{variant:"secondary",className:"gap-1 text-xs font-semibold",children:[e.jsx(nt,{className:"h-3 w-3"}),"AI"]})]}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:t("express.subtitle","List in seconds")})]})]})}),e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-6 space-y-6",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-primary/20 bg-gradient-to-br from-primary/10 via-primary/5 to-background p-4 shadow-sm",children:[e.jsx("div",{className:"absolute -right-4 -top-4 h-24 w-24 rounded-full bg-primary/15 blur-2xl","aria-hidden":!0}),e.jsxs("div",{className:"relative flex items-start gap-3",children:[e.jsx("div",{className:"shrink-0 rounded-lg bg-primary/15 p-2",children:e.jsx(ws,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:t("express.verify_title","Snel publiceren, wel eerst even checken")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t("express.verify_notice","Onze AI helpt je op weg, maar controleer zelf de titel, categorie, prijs en omschrijving voor je je zoekertje publiceert.")})]})]})]}),e.jsx("div",{className:"px-1",children:e.jsx(Cs,{steps:gs,currentStep:y-1})}),Ye&&e.jsxs(fe,{className:"bg-primary/10 border-primary",children:[e.jsx(J,{className:"h-4 w-4 text-primary"}),e.jsxs(je,{className:"space-y-2",children:[e.jsx("p",{className:"font-medium",children:t("express.tutorial.title","Quick tips:")}),e.jsxs("ul",{className:"list-disc list-inside text-sm space-y-1",children:[e.jsx("li",{children:t("express.tutorial.tip1","Take clear photos with good lighting")}),e.jsx("li",{children:t("express.tutorial.tip2","AI will suggest the category automatically")}),e.jsx("li",{children:t("express.tutorial.tip3","Add price and short description")})]}),e.jsx(D,{size:"sm",onClick:()=>ke(!1),className:"mt-2",children:t("button.gotIt","Got it!")})]})]}),y===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("input",{ref:L,t
1ype:"file",accept:"image/*",capture:ie?"environment":void 0,multiple:!0,onChange:ts,className:"hidden",id:"camera-input"}),e.jsx(As,{images:z,onRemove:as,onReorder:ns,className:"grid grid-cols-2 gap-3",mainLabel:t("express.mainPhoto","Main")}),C.length<5&&e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>{var s;return(s=L.current)==null?void 0:s.click()},onKeyDown:s=>{var o;(s.key==="Enter"||s.key===" ")&&((o=L.current)==null||o.click())},onDragOver:Ie,onDragEnter:Ie,onDragLeave:is,onDrop:rs,className:`w-full min-h-32 rounded-lg border-2 border-dashed flex flex-col items-center justify-center gap-2 py-8 px-4 text-center cursor-pointer transition-colors ${Se?"border-primary bg-primary/10":"border-border hover:border-primary/60 hover:bg-muted/40"}`,children:[e.jsx(vs,{className:"h-8 w-8 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:z.length===0?t("express.takePhoto","Take Photo"):t("express.addMore","Add More")}),e.jsx("span",{className:"text-sm text-muted-foreground",children:t("express.dropzone.hint","Of sleep je foto’s hierheen")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t("express.dropzone.formats","JPG, PNG, WEBP, AVIF of GIF — max. 10 MB per foto")}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[C.length,"/5 ",t("express.photos","photos")]}),z.length>1&&e.jsx("span",{className:"text-xs text-muted-foreground",children:t("express.dropzone.reorder","Sleep de foto’s hierboven om de volgorde te wijzigen.")})]}),(P==="uploading"||P==="analyzing")&&e.jsxs("div",{className:"space-y-2 rounded-lg border bg-muted/40 p-4",children:[e.jsx(_s,{value:P==="uploading"?Math.max(5,oe*.6):80}),e.jsx("p",{className:"text-sm text-center font-medium",children:P==="uploading"?`${t("express.phase.uploading","Foto's opladen")}… ${Math.round(oe)}%`:t("express.phase.analyzing","Details automatisch invullen…")}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:t("express.phase.wait","Even geduld, je gaat automatisch naar de details.")})]}),e.jsx(D,{size:"lg",className:"w-full",onClick:ls,disabled:C.length===0||P==="uploading"||P==="analyzing",children:P==="uploading"||P==="analyzing"?t("express.phase.busy","Bezig…"):t("express.button.next_to_details","NAAR DE VOLGENDE STAP :  DETAILS invullen")})]}),y===2&&e.jsxs("div",{className:"space-y-4",children:[n&&n.confidence>0&&e.jsxs(fe,{className:n.confidence>=60?"border-primary":"border-warning",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsxs(je,{className:"space-y-2",children:[e.jsxs("p",{className:"font-medium",children:[t("express.aiSuggests","AI-suggestie"),": ",n.primary_category_name]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(G,{variant:n.confidence>=60?"default":"secondary",children:[n.confidence,"% ",t("express.confident","zekerheid")]}),(n.suggested_title||n.estimated_price)&&e.jsx(G,{variant:"outline",className:"text-xs",children:t("express.aiFilledFields","AI heeft enkele velden ingevuld")})]}),n.reasoning&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.reasoning}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("express.aiCheckFields","Controleer de ingevulde gegevens en wijzig indien nodig.")})]})]}),ae&&e.jsxs("div",{className:"flex items-center justify-center py-4",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"}),e.jsx("span",{className:"ml-3",children:t("express.analyzing","Analyzing image...")})]}),!ye&&c&&e.jsxs(fe,{children:[e.jsx(be,{className:"h-4 w-4"}),e.jsx(je,{className:"text-sm",children:c.unlimited?t("listing.quota.unlimited","Je mag onbeperkt gratis zoekertjes plaatsen."):c.remaining>0?t("channel.private.free_left","Nog {n} gratis deze maand in deze categorie").replace("{n}",String(c.remaining)):t("channel.private.paid","Gratis maandquotum op — extra zoekertje: €{p}").replace("{p}",c.extraListingPrice.toFixed(2))})]}),ye&&e.jsx(Es,{value:i.listing_channel,onChange:s=>w({...i,listing_channel:s}),externalUrl:i.external_url,onExternalUrlChange:s=>w({...i,external_url:s}),freeRemaining:c?c.remaining:null,extraListingPrice:c?c.extraListingPrice:null}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:t("form.category","Category")}),e.jsxs(Ee,{value:i.category_id,onValueChange:s=>w({...i,category_id:s}),children:[e.jsx(Fe,{children:e.jsx(De,{placeholder:t("form.selectCategory","Select category")})}),e.jsx(ze,{children:k.map(s=>e.jsx(K,{value:s.id,children:s.name},s.id))})]})]}),e.jsx(Fs,{value:ce,onChange:Je,inAnimalCategory:de,signals:Ne,hkNumber:h==null?void 0:h.hk_number,hkVerified:!!(h!=null&&h.hk_number_verified),onRequestHkNumber:()=>v("/seller/onboarding"),onMoveToAnimalCategory:()=>{const s=Xs(k);s&&w(o=>({...o,category_id:s.id}))}}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(B,{children:t("form.title","Title")}),(n==null?void 0:n.suggested_title)&&i.title===n.suggested_title.trim().slice(0,100)&&e.jsxs(G,{variant:"outline",className:"text-xs font-normal gap-1",children:[e.jsx(J,{className:"h-3 w-3"}),t("express.aiSuggestion","AI-voorstel")]})]}),e.jsx(Le,{value:i.title,onChange:s=>w({...i,title:s.target.value}),placeholder:t("express.titlePlaceholder","e.g., Red Nike Sneakers Size 42"),maxLength:100})]}),e.jsx(Ds,{value:E,onChange:Ke,compact:!0}),!E.enabled&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(B,{children:[t("form.price","Price")," (€)"]}),(n==null?void 0:n.estimated_price)&&i.price===String(Number(n.estimated_price).toFixed(2))&&e.jsxs(G,{variant:"outline",className:"text-xs font-normal gap-1",children:[e.jsx(J,{className:"h-3 w-3"}),t("express.aiSuggestion","AI-voorstel")]})]}),e.jsxs("div",{className:"flex items-center gap-2 rounded-md border p-3",children:[e.jsx(ys,{id:"express_is_free",checked:i.is_free,onCheckedChange:s=>w({...i,is_free:s===!0,price:s===!0?"0":i.price})}),e.jsx(B,{htmlFor:"express_is_free",className:"cursor-pointer text-sm",children:t("form.give_away_free",'Ik geef dit gratis weg — toon "GRATIS" in plaats van een prijs')})]}),e.jsx(Le,{type:"number",step:"0.01",value:i.is_free?"0":i.price,onChange:s=>w({...i,price:s.target.value}),disabled:i.is_free,placeholder:"0.00"}),(n==null?void 0:n.estimated_price)&&i.price===String(Number(n.estimated_price).toFixed(2))&&e.jsx("p",{className:"text-xs text-muted-foreground",children:t("express.priceEstimateDisclaimer","Deze prijs is een AI-schatting; pas deze aan naar jouw verwachte verkoopprijs.")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:t("form.condition","Condition")}),e.jsxs(Ee,{value:i.condition,onValueChange:s=>w({...i,condition:s}),children:[e.jsx(Fe,{children:e.jsx(De,{})}),e.jsxs(ze,{children:[e.jsx(K,{value:"new",children:t("condition.new","New")}),e.jsx(K,{value:"like_new",children:t("condition.likeNew","2nd hand - like new")}),e.jsx(K,{value:"fair",children:t("condition.fair","2nd hand - good state")}),e.jsx(K,{value:"poor",children:t("condition.poor","Reasonable state")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(B,{children:t("form.description","Description")}),(n==null?void 0:n.suggested_description)&&i.description===n.suggested_description.trim().slice(0,500)&&e.jsxs(G,{variant:"outline",className:"text-xs font-normal gap-1",children:[e.jsx(J,{className:"h-3 w-3"}),t("express.aiSuggestion","AI-voorstel")]})]}),e.jsx(Ss,{value:i.description,onChange:s=>w({...i,description:s.target.value}),placeholder:t("express.descPlaceholder","Add a short description..."),rows:4,maxLength:500}),e.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[i.description.length,"/500"]})]}),e.jsx(zs,{value:le,onChange:ve,suggestedPickupLocation:it(h)}),e.jsx(Ts,{blocking:q.result.blocking,onAutoFix:q.result.hasBlocking?cs:void 0,showUpgrade:q.result.hasBlocking}),e.jsx(D,{size:"lg",className:"w-full",onClick:ds,disabled:!i.title||!E.enabled&&!i.is_free&&!i.price||!i.category_id||!i.description||q.result.hasBlocking||ne,children:ne?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),t("express.publishing","Publishing...")]}):e.jsxs(e.Fragment,{children:[e.jsx(Ns,{className:"h-5 w-5 mr-2"}),t("express.publish","Publish Listing")]})})]})]}),e.jsx(Me,{open:te.show,onOpenChange:s=>b({...te,show:s}),children:e.jsxs(Ue,{children:[e.jsxs(Re,{children:[e.jsxs("div",{className:"flex items-center gap-2 text-destructive mb-2",children:[e.jsx(be,{className:"h-5 w-5"}),e.jsx(Te,{children:te.title})]}),e.jsx(Oe,{className:"text-base",children:te.message})]}),e.jsx(Ge,{children:e.jsx(D,{onClick:()=>b({show:!1,title:"",message:""}),children:t("button.ok","OK")})})]})}),e.jsx(Me,{open:Xe,onOpenChange:Q,children:e.jsxs(Ue,{children:[e.jsxs(Re,{children:[e.jsxs("div",{className:"flex items-center gap-2 text-primary mb-2",children:[e.jsx(be,{className:"h-5 w-5"}),e.jsx(Te,{children:t("listing.quota.exceeded_title","Gratis limiet bereikt")})]}),e.jsx(Oe,{className:"text-base",children:t("listing.quota.exhausted","In deze categorie kan je deze maand geen gratis zoekertjes meer plaatsen. Een extra zoekertje kost €{price}.").replace("{price}",((c==null?void 0:c.extraListingPrice)??2.79).toFixed(2))})]}),e.jsx(Bs,{amount:(c==null?void 0:c.extraListingPrice)??2.79,provider:ge==="credits"?"mollie":ge,onProviderChange:Ze,useCredits:ue,onUseCreditsChange:es,creditsAmount:ue?Math.min(Ce,(c==null?void 0:c.extraListingPrice)??2.79):0}),e.jsxs(Ge,{className:"flex-col gap-2 sm:flex-col",children:[e.jsx(D,{onClick:ps,className:"w-full",children:t("listing.quota.pay_and_publish","Betaal €{price} en publiceer").replace("{price}",((c==null?void 0:c.extraListingPrice)??2.79).toFixed(2))}),e.jsx(D,{variant:"outline",onClick:ms,className:"w-full",children:t("listing.draft.save","Bewaar als concept")}),e.jsx(D,{variant:"ghost",onClick:()=>Q(!1),className:"w-full",children:t("common.cancel","Annuleren")})]})]})}),e.jsx(Ls,{open:!!u,reward:u,onClose:x}),e.jsx(Ms,{open:!!j&&!u,spinsGranted:(j==null?void 0:j.spinsGranted)??0,spinsRemaining:(j==null?void 0:j.spinsRemaining)??0,onSpinNow:()=>{U(null),M(!0)},onClose:()=>U(null)}),e.jsx(ks,{open:X&&!u&&!j,onClose:()=>M(!1)}),e.jsx(Us,{open:!!g&&!u&&!X&&!j,productId:g,onSkip:()=>{m(null),v("/seller/dashboard")}})]})};export{Ft 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.