1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DLt0VHLd.js","./3xMQmu_c.js","./B_azjxcp.js","./CiugyBoc.js","./BCbvMjQz.js","./DmyNGy7l.js","./CM1B3oR5.js","./DbYNonRq.js","./x9DMJJ95.js","./yp6H8a_p.js","./Df7TuwS-.js","./DiLnKlBr.js","./BSjwk6Z3.js","./D-n3A-8k2.js","./BHyipOjY.js","./BcJTp6Cm.js","./BdX5S4iW.js","./Bj36xqAO.js","./DgLP3hnZ.js","./89r93G292.js","./Chmi_cq1.js","./CxhCXM28.js","./BwaUv2Tp.js","./lYZkAuUl.js","./DrWGndIc.js","./quadro.BG8braTC.css"])))=>i.map(i=>d[i]); 2import{G as e,H as o,Ot as t,at as a,b as r,bt as i,ct as l,d as s,f as n,ht as u,m as c,p as d,st as p,u as m,v as f,x as v,y as g}from"./3xMQmu_c.js";import{d as _}from"./B_azjxcp.js";import{n as x}from"./CTGGgJbG.js";import{t as h}from"./DbYNonRq.js";import{t as z}from"./BcJTp6Cm.js";import{r as y}from"./GFyOEeMl.js";import{t as w}from"./DmyNGy7l.js";import{t as b}from"./DgLP3hnZ.js";import{i as j,n as P,r as C,t as A}from"./-YJ68iuv.js";import{t as I}from"./89r93G292.js";import{i as T,r as k}from"./C0xUdWZt.js";import{n as S}from"./Chmi_cq1.js";import{t as V}from"./DrWGndIc.js";import{i as F}from"./DqpV8bgV2.js";import{t as M}from"./DZ8S0lCE2.js";import{t as $}from"./CnIDZMu-.js";import{t as q}from"./apnwU1HE.js";import{t as E}from"./JmAKPrzM.js";import{a as O,n as D,r as G,t as L}from"./CgSakRMB.js";import{i as R,n as H,r as N,t as Q}from"./DA7biPJf.js";import{n as B,r as U,t as W}from"./CF01-P_J.js";import{t as J}from"./CdIOh0uX.js";var K=r(()=>h(()=>import("./DLt0VHLd.js").then(e=>e.default||e),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),X=r(()=>h(()=>import("./D-n3A-8k2.js").then(e=>e.default||e),__vite__mapDeps([13,1,14,2,3,4,15,16,17,7,5,18,19,20,21,10,11,22,23,24,25]),import.meta.url).then(e=>y(e))),Y={class:"min-h-screen bg-gray-50"},Z={class:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-red-100"},ee={class:"mx-auto max-w-7xl lg:px-8 lg:py-8"},oe={class:"lg:grid lg:grid-cols-12 lg:items-start lg:gap-8"},te=b(v({__name:"stampa-su-forex",async setup(r){let v,h;const{ratingValue:y,reviewCount:b}=k(),te=T(y);M({layout:"editor-carrello",scrollToTop:!0}),x({title:"Personalizza Forex",meta:[{name:"robots",content:"noindex"}]});const ae=i(!1),re=i(!1),ie=z(),{trackConfigStart:le,trackAddToCart:se}=E(),ne=i(!1),ue=F(),ce=i(!1),de=i(!1),pe=i("verticale"),me=i("30x40"),fe=[{value:"verticale",label:"Verticale",icon:H},{value:"quadrato",label:"Quadrato",icon:J},{value:"orizzontale",label:"Orizzontale",icon:Q}],ve=i(!1),ge=i(!1),_e=i(null);a(me,()=>{window.innerWidth<=1023&&(_e.value?.mostraEditor(),ge.value||setTimeout(()=>{ve.value||(ae.value=!0,ge.value=!0)},400))});const xe={verticale:"30x40",quadrato:"40x40",orizzontale:"40x30"};a(pe,e=>{const o=be.value.map(e=>e.formato),t=xe[e];me.value=t&&o.includes(t)?t:o[0]??me.value});const he=w(),{data:ze}=([v,h]=p(()=>he.from("products").select("name_ext, discount_id(discount_percent), products_details(id, orientamento, formato, crop, prezzo_listino, products_details_fotocolor(productId, descrizione_productId, formato))").eq("name","pannello-forex").limit(1).single()),v=await v,h(),v),{products_details:ye}=ze,we=ze.discount_id.discount_percent,be=m(()=>{return e=pe.value,ye.filter(o=>o.orientamento==e).sort(G).map(e=>({formato:e.formato,listino:e.prezzo_listino,prezzoNetto:D(e.prezzo_listino,we)}));var e}),je=m(()=>ye.find(e=>e.formato==me.value)),Pe=m(()=>{const e=je.value.prezzo_listino;return{price:e,netPrice:O(e-e*ze.discount_id.discount_percent/100)}}),Ce=m(()=>({crop:je.value.crop})),Ae=i(null),Ie=m(()=>je.value.products_details_fotocolor[0]),Te=i(),ke=A(),Se=W(Te);let Ve;const Fe=()=>{re.value=!1},Me=()=>{ne.value=!1},$e=async()=>{if(!ve.value)if(ie.isLogged){de.value=!0,ke.azzera();try{const e=await L(Te),o={name:ze.name_ext,size:me.value,price:Pe.value.price,discount:ze.discount_id.discount_percent,netPrice:Pe.value.netPrice,quantity:1,id_product:je.value?.id,thumbnail:e,idCartSession:V(0,99999999999),filePath:Ve};if(ke.fase("riepilogo"),Ve){const e=Ve.substring(0,Ve.lastIndexOf("/")),o=(()=>{const e=ze?.discount_id?.discount_percent||0;return["=== ORDINE PROVVISORIO ===",`Data: ${(new Date).toLocaleStr
2ing("it-IT")}`,`Prodotto: ${ze?.name_ext||"Stampa su Forex"}`,"",`Formato: ${me.value}`,"",`Prezzo di listino: â¬${Pe.value.price.toFixed(2)}`,...e>0?[`Sconto applicato: ${e}%`]:[],`Prezzo netto: â¬${Pe.value.netPrice.toFixed(2)}`,"Quantità : 1","",`ID Prodotto: ${je.value?.id}`,`ProductId Fotocolor: ${Ie.value?.productId}`,`Descrizione Fotocolor: ${Ie.value?.descrizione_productId}`,"","Stato: IN ATTESA DI PAGAMENTO"].join("\n")})(),t=new Blob([o],{type:"text/plain"}),a=`${e}/_provvisorio.txt`;await he.storage.from("orders").upload(a,t,{contentType:"text/plain",upsert:!1});const{data:r,error:i}=await he.storage.from("orders").list(e,{limit:100});if(i||!r||r.length<2){const e=r?.length??0;return de.value=!1,void alert(`Verifica upload fallita: attesi almeno 2 file, trovati ${e}. Riprova.`)}}ke.fase("carrello"),await async function(e){const{error:o}=await he.from("cart_items").insert({id_cart_session:e.idCartSession,quantity:e.quantity,id_product:e.id_product,filePath:Ve,thumbnail:e.thumbnail,customer_id:ie.user.id});if(o)throw de.value=!1,ne.value=!0,o}(o),ie.products.push(o),ke.completa(),se(o,"Quadro personalizzato"),await _("/carrello")}catch{de.value=!1}}else re.value=!0};return o(()=>{le({item_id:String(je.value?.id??""),item_name:ze.name_ext,item_category:"Quadro personalizzato",item_variant:me.value,price:Pe.value.netPrice}),setTimeout(()=>{window.scrollTo(0,0)},500),setTimeout(()=>{ue.value||Ae.value?.click()},1500)}),(o,a)=>{const r=$,i=K,p=S,m=q,v=X,_=j,x=R,h=N,z=C,y=P,w=U,A=B;return e(),c("div",Y,[g(r,{show:t(de),progress:t(de)?t(ke).percentuale.value:null,message:t(ke).messaggio.value},null,8,["show","progress","message"]),t(re)?(e(),n(i,{key:0,openModal:t(re),onCloseModal:Fe,onTransitionToAuth:a[0]||(a[0]=e=>re.value=!1),onAuthSuccess:$e},{icon:l(()=>[...a[12]||(a[12]=[s("svg",{class:"h-8 w-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"})],-1)])]),title:l(()=>[...a[13]||(a[13]=[f(" Crea il tuo prodotto personalizzato ",-1)])]),subtitle:l(()=>[...a[14]||(a[14]=[f(" Accedi per completare l'ordine ",-1)])]),default:l(()=>[a[15]||(a[15]=s("div",{class:"space-y-4"},[s("div",{class:"rounded-lg border border-brand/20 bg-brand/10 p-4"},[s("div",{class:"flex items-center space-x-3"},[s("div",{class:"flex-shrink-0"},[s("div",{class:"flex h-10 w-10 items-center justify-center rounded-full bg-white"},[s("svg",{class:"h-5 w-5 text-brand",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{d:"M4 3a2 2 0 100 4h12a2 2 0 100-4H4z"}),s("path",{"fill-rule":"evenodd",d:"M3 8h14v7a2 2 0 01-2 2H5a2 2 0 01-2-2V8zm5 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z","clip-rule":"evenodd"})])])]),s("div",null,[s("h4",{class:"font-semibold text-gray-900"}," Il tuo progetto è al sicuro "),s("p",{class:"text-sm text-gray-600"}," Salvalo nel tuo account per completarlo quando vuoi ")])])]),s("div",{class:"text-center"},[s("p",{class:"text-sm text-gray-600"},[s("span",{class:"font-semibold"},"Bastano pochi secondi"),f(" per creare il tuo account gratuito e iniziare a personalizzare i tuoi prodotti preferiti. ")])])],-1))]),_:1},8,["openModal"])):d("",!0),g(p,{openModal:t(ne),onCloseModal:Me},{icon:l(()=>[s("div",Z,[g(t(I),{class:"h-8 w-8 text-red-600","aria-hidden":"true"})])]),default:l(()=>[a[16]||(a[16]=s("h3",{class:"text-xl font-semibold leading-6 text-gray-900"}," Errore di Comunicazione ",-1)),a[17]||(a[17]=s("div",{class:"mt-3"},[s("p",{class:"text-sm text-gray-600"}," Si è verificato un problema durante la comunicazione con i nostri server. Ti preghiamo di riprovare o contattarci via email. ")],-1)),s("div",{class:"mt-6"},[s("button",{type:"button",class:"inline-flex w-full justify-center rounded-lg bg-red-600 px-4 py-3 text-base font-semibold text-white shadow-sm transition-all duration-200 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2",onClick:Me}," Riprova ")])]),_:1},8,["openModal"]),g(m,{show:t(ae),title:"Formato cambiato",message:"Controlla che i soggetti restino nell'area di
2stampa: trascina eventualmente la foto per sistemarla.",onClose:a[1]||(a[1]=e=>ae.value=!1)},null,8,["show"]),s("main",ee,[s("div",oe,[g(_,{ref_key:"colonnaEditor",ref:_e,class:"lg:col-span-7",titolo:t(ze).name_ext,"rating-value":t(te),"review-count":t(b),onCambiaFoto:a[5]||(a[5]=e=>t(Ae).click()),onAnteprima:t(Se).apri},{default:l(()=>[g(v,{ref_key:"childRef",ref:Te,crop:t(Ce).crop,"editor-src":t(ue),"formato-forn":t(Ie).formato,class:"w-full",onFase:t(ke).fase,onUploadDone:a[2]||(a[2]=e=>de.value=!1),onAlertQuality:a[3]||(a[3]=e=>ve.value=e),onOrderData:a[4]||(a[4]=e=>{Ve=e.filePath})},null,8,["crop","editor-src","formato-forn","onFase"])]),_:1},8,["titolo","rating-value","review-count","onAnteprima"]),s("input",{ref_key:"file",ref:Ae,class:"hidden",type:"file",accept:"image/*",onChange:a[6]||(a[6]=e=>(async()=>{const e=Ae.value.files[0];if(e)return e.type&&!e.type.startsWith("image/")?(alert("Formato non valido: carica solo un'immagine (JPG, PNG, HEIC)."),void(Ae.value.value="")):void(ue.value=e)})())},null,544),g(z,{class:"px-4 pb-8 pt-5 lg:col-span-5 lg:px-0 lg:pb-14 lg:pt-0",titolo:t(ze).name_ext,formato:t(me),prezzo:t(Pe).netPrice,listino:t(Pe).price,sconto:t(ze).discount_id.discount_percent,"rating-value":t(te),"review-count":t(b),"delivery-key":"forex","is-logged":t(ie).isLogged,"alert-quality":t(ve),"anteprima-titolo":"Guardala appesa al muro","anteprima-testo":"La tua foto su forex, in scala","anteprima-forma":t(pe),"anteprima-sfondo":null,onAggiungi:$e,onAnteprima:t(Se).apri},{default:l(()=>[g(x,{modelValue:t(pe),"onUpdate:modelValue":a[7]||(a[7]=e=>u(pe)?pe.value=e:null),options:fe},null,8,["modelValue"]),g(h,{modelValue:t(me),"onUpdate:modelValue":a[8]||(a[8]=e=>u(me)?me.value=e:null),formati:t(be),onGuida:a[9]||(a[9]=e=>ce.value=!0)},null,8,["modelValue","formati"])]),_:1},8,["titolo","formato","prezzo","listino","sconto","rating-value","review-count","is-logged","alert-quality","anteprima-forma","onAnteprima"])]),a[18]||(a[18]=s("div",{class:"h-24 lg:hidden","aria-hidden":"true"},null,-1))]),g(y,{riepilogo:`${t(me).replace("x","Ã")}`,prezzo:t(Pe).netPrice,listino:t(Pe).price,sconto:t(ze).discount_id.discount_percent,"alert-quality":t(ve),onAggiungi:$e},null,8,["riepilogo","prezzo","listino","sconto","alert-quality"]),g(w,{cornice:null,open:t(Se).aperta.value,"image-url":t(Se).url.value,error:t(Se).errore.value,titolo:"La tua stampa su forex appesa al muro",formato:t(me),dettaglio:"stampa su forex","add-disabled":t(ve),onClose:t(Se).chiudi,onAddToCart:a[10]||(a[10]=e=>t(Se).chiudiPoi($e))},null,8,["open","image-url","error","formato","add-disabled","onClose"]),g(A,{tipoProdotto:"pannello",openSizeGuide:t(ce),"initial-formato":t(me),onCloseSizeGuide:a[11]||(a[11]=e=>ce.value=!1)},null,8,["openSizeGuide","initial-formato"])])}}}),[["__scopeId","data-v-4031c7ec"]]);export{te 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.