1import{p as _e,b as o,c as i,F as ee,g as ne,h as T,a as e,t as p,au as we,j as P,G as ye,l as ke,H as Se,o as me,bw as ae,s as ge,x as $e,u as t,J as le,K as ie,A as N,i as m,e as V,W as Pe,w as F,P as Ve,r as D,R as ce,y as be,m as Ce,a3 as De,bv as Ee,bu as Te,f as de,C as Ae,T as qe,Y as Be,bs as Le,bo as je,bt as Me,a4 as Ne,ad as We}from"./B27EFU-J.js";import{_ as Ie}from"./CwpyRGfW.js";import{_ as Fe}from"./BXr6lbg6.js";import{_ as Re}from"./CjaUwb4J.js";import{_ as ze}from"./wetWi9GO.js";import{_ as Oe}from"./B-d-rbkK.js";import{_ as Ue}from"./ijumM65x.js";import{u as Qe}from"./kczUj8SE.js";import{L as fe}from"./De8aetVT.js";import{I as he}from"./BTzF9C5N.js";import{E as xe}from"./mkYkv7If.js";import{E as Ge}from"./BPFx32zR.js";import{T as pe}from"./CPoY0LKQ.js";import{_ as He}from"./DlAUqK2U.js";import{C as Ke}from"./BNxa6bPW.js";import{C as Ye}from"./x5jxXiIz.js";import{_ as Xe}from"./Bvm_ey-5.js";import{m as Je}from"./CYrnlpoz.js";import{u as Ze}from"./CbylEqK8.js";import{M as et}from"./BaVZ4oPh.js";const tt=_e("/images/SVG.svg"),at={class:"grid grid-cols-2 sm:grid-cols-4 gap-4"},rt=["onClick","disabled"],st={class:"text-sm font-medium text-gray-900"},wr={__name:"BookCampaignCategory",props:{modelValue:{type:[String,Number],default:""},categories:{type:Object,default:()=>({})},isDisable:{type:Boolean,default:!1}},emits:["update:modelValue","update:categoryTitle"],setup(a){return(h,j)=>(o(),i("div",at,[(o(!0),i(ee,null,ne(a.categories?.results,g=>(o(),i("button",{key:g.id,onClick:y=>!a.isDisable&&(h.$emit("update:modelValue",g.id),h.$emit("update:categoryTitle",g.title)),disabled:a.isDisable,class:T(["flex flex-col items-start gap-3 p-5 rounded-xl border transition-all text-left",a.isDisable?"cursor-not-allowed opacity-50":"cursor-pointer",a.modelValue===g.id?"border-red-500 bg-red-50/30":"border-gray-100 hover:border-gray-200 bg-white"])}
1,[j[0]||(j[0]=e("div",{class:"self-start"},[e("img",{src:tt,alt:"category icon",class:"w-10 h-10 rounded-xl"})],-1)),e("span",st,p(g.title),1)],10,rt))),128))]))}},ue="partner_registration_email",ot=()=>{const a=we("partner-registered-email",()=>null),h=P(()=>!!a.value);return{registeredEmail:a,hasRegistered:h,restore:()=>{a.value=localStorage.getItem(ue)||null},markRegistered:k=>{a.value=k,localStorage.setItem(ue,k)},clear:()=>{a.value=null,localStorage.removeItem(ue)}}},lt={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4"},nt={class:"col-span-1","data-field-anchor":"email"},it=["for"],dt={class:"relative"},ut=["id"],pt={key:0,class:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 rounded-lg bg-red-50 px-3 py-2"},ct={key:1,class:"text-xs text-red-500 mt-1"},yt={class:"col-span-1","data-field-anchor":"phone"},mt=["for"],gt={key:0,class:"text-xs text-red-500 mt-1"},bt={class:"col-span-1","data-field-anchor":"first_name"},ft=["for"],ht=["id"],xt={key:0,class:"text-xs text-red-500 mt-1"},vt={class:"col-span-1","data-field-anchor":"last_name"},_t=["for"],wt=["id"],kt={key:0,class:"text-xs text-red-500 mt-1"},St={class:"col-span-full","data-field-anchor":"password"},$t=["for"],Pt={class:"relative"},Vt=["id","type"],Ct=["aria-label"],Dt={key:0,class:"text-xs text-red-500 mt-1"},Et={key:1,class:"text-xs text-gray-500 mt-1"},Tt=500,At={__name:"PartnerRegistration",props:{role:{type:Number,default:1}},emits:["logged-in","registered"],setup(a,{expose:h,emit:j}){const g=a,y=j,k=Qe(),A=ye(),{$toast:R}=ke(),{isAuthenticated:z}=Se(A),{hasRegistered:H,restore:K,markRegistered:Y}
1=ot(),O=P(()=>!z.value&&!H.value);me(K);const M=ae(),v=ae(),U=ae(),X=ae(),_=ae(),r=D(null),q=D(!1),B=D(!1),b=ce({first_name:"",last_name:"",email:"",password:"",phone:"",phone_country:"GB"}),x=ce({first_name:"",last_name:"",email:"",password:"",phone:""}),J=d=>["w-full px-4 py-2.5 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 bg-white",d?"border-red-500":"border-gray-200"],re=/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/,L={first_name:d=>d.trim()?"":"First name is required.",last_name:d=>d.trim()?"":"Last name is required.",email:d=>d.trim()?re.test(d.trim())?"":"Enter a valid email address.":"Email is required.",password:d=>d?d.length<8?"Password must be at least 8 characters.":/[A-Z]/.test(d)?/[0-9]/.test(d)?"":"Password must include at least one number.":"Password must include at least one uppercase letter.":"Password is required.",phone:d=>{const l=d.replace(/\D/g,"");return l?l.length<7||l.length>15?"Enter a valid phone number.":"":"Phone number is required."}},E=d=>(x[d]=L[d](b[d]??""),!x[d]),C=D(!1),W=D(!1),u=new Map;let n="",c=null;const S=()=>{c&&(clearTimeout(c),c=null)},$=async d=>{n=d,W.value=!0;try{const l=await k.checkEmailExists(d);if(u.set(d,l),d!==n)return;C.value=l}finally{d===n&&(W.value=!1)}},Q=async d=>(S(),u.has(d)?(n=d,W.value=!1,C.value=u.get(d)):await $(d),C.value);ge(()=>b.email,d=>{S();const l=d.trim();if(n=l,W.value=!1,u.has(l)){C.value=u.get(l);return}C.value=!1,re.test(l)&&(c=setTimeout(()=>{c=null,$(l)},Tt))});const s=async()=>{if(!E("email")){S(),C.value=!1;return}await Q(b.email.trim())};$e(S);const f=()=>{B.value=!1,y("logged-in")},I=async()=>{if(!O.value)return!0;let d=!0;for(const l of Object.keys(L))E(l)||(d=!1);return!x.email&&await Q(b.email.trim())&&(d=!1),d},se=async()=>{await be();const d=C.value?"email":Object.keys(L).find(G=>x[G]);if(!d)return;const l=r.value?.querySelector(`[data-field-anchor="${d}"]`);l?.scrollIntoView({behavior:"smooth",block:"center"}),l?.querySelector("input")?.focus({preventScroll:!0})},te=()=>({first_name:b.first_name.trim(),last_name:b.last_name.trim(),email:b.email.trim(),password1:b.password,phone_number:b.phone.trim(),phone_country_code:b.phone_country,role:g.role}),Z=D(!1);return h({validate:I,scrollToFirstError:se,getData:te,submit:async()=>{if(!O.value)return!0;if(Z.value||!await I())return!1;Z.value=!0;const d=b.email.trim();try{return await k.register(te()),Y(d),y("registered",d),!0}catch(l){const G=l.response?._data;return G&&typeof G=="object"?Object.values(G).flat().forEach(oe=>{oe.includes("A user with this email already exists.")?(u.set(d,!0),n=d,C.value=!0):R.show({title:"Error",message:oe,variant:"error"})}):R.show({title:"Error",message:"We couldn't create your account. Please try again.",variant:"error"}),!1}finally{Z.value=!1}},isSubmitting:Z}),(d,l)=>{const G=ze,oe=Oe,ve=Ue;return t(O)?(o(),i("div",{key:0,ref_key:"rootRef",ref:r},[l[15]||(l[15]=e("hr",{class:"col-span-full border-gray-200 my-4"},null,-1)),l[16]||(l[16]=e("div",{class:"mb-4"},[e("h3",{class:"text-base font-medium text-gray-900"},"Your Details"),e("p",{class:"text-sm text-gray-500 mt-1"}," Weâll set up your account so that you can manage this campaign once itâs created. ")],-1)),e("div",lt,[e("div",nt,[e("label",{for:t(U),class:"block text-sm font-medium text-gray-900 mb-1"}," Email ",8,it),e("div",dt,[le(e("input",{id:t(U),"onUpdate:modelValue":l[0]||(l[0]=w=>t(b).email=w),type:"email",autocomplete:"email",placeholder:"[email protected]",class:T([J(t(x).email),t(C)?"pr-10":""]),onBlur:s},null,42,ut),[[ie,t(b).email]]),t(W)?(o(),N(t(fe),{key:0,size:16,class:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 animate-spin"})):m("",!0)]),t(C)?(o(),i("div",pt,[V(t(he),{class:"size-4 shrink-0 text-white",fill:"#ef4444"}),l[13]||(l[13]=e("span",{class:"text-sm font-medium text-red-500"}," Existing email found, ",-1)),e("button",{type:"button",class:"text-sm font-medium text-red-700 underline underline-offset-2 hover:text-red-900 cursor-pointer",onClick:l[1]||(l[1]=w=>B.value=!0)}," log in? ")])):t(x).email?(o(),i("p",ct,p(t(x).email),1)):m("",!0)]),e("div",yt,[e("label",{for:t(_),class:"block text-sm font-medium text-gray-900 mb-1"}," Phone Number ",8,mt),V(G,{modelValue:t(b).phone,"onUpdate:modelValue":l[2]||(l[2]=w=>t(b).phone=w),"country-code":t(b).phone_country,"onUpdate:countryCode":l[3]||(l[3]=w=>t(b).phone_country=w),"input-id":t(_),"input-name":"phone",placeholder:"Phone Number",error:!!t(x).phone},null,8,["modelValue","country-code","input-id","error"]),t(x).phone?(o(),i("p",gt,p(t(x).phone),1)):m("",!0)]),e("div",bt,[e("label",{for:t(M),class:"block text-sm font-medium text-gray-900 mb-1"}," First Name ",8,ft),le(e("input",{id:t(M),"onUpdate:modelValue":l[4]||(l[4]=w=>t(b).first_name=w),type:"text",autocomplete:"given-name",placeholder:"e.g. John",class:T(J(t(x).first_name)),onBlur:l[5]||(l[5]=w=>E("first_name"))},null,42,ht),[[ie,t(b).first_name]]),t(x).first_name?(o(),i("p",xt,p(t(x).first_name),1)):m("",!0)]),e("div",vt,[e("label",{for:t(v),class:"block text-sm font-medium text-gray-900 mb-1"}," Last Name ",8,_t),le(e("input",{id:t(v),"onUpdate:modelValue":l[6]||(l[6]=w=>t(b).last_name=w),type:"text",autocomplete:"family-name",placeholder:"e.g. Smith",class:T(J(t(x).last_name)),onBlur:l[7]||
1(l[7]=w=>E("last_name"))},null,42,wt),[[ie,t(b).last_name]]),t(x).last_name?(o(),i("p",kt,p(t(x).last_name),1)):m("",!0)]),e("div",St,[e("label",{for:t(X),class:"block text-sm font-medium text-gray-900 mb-1"}," Password ",8,$t),e("div",Pt,[le(e("input",{id:t(X),"onUpdate:modelValue":l[8]||(l[8]=w=>t(b).password=w),type:t(q)?"text":"password",autocomplete:"new-password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",class:T([J(t(x).password),"pr-11"]),onBlur:l[9]||(l[9]=w=>E("password"))},null,42,Vt),[[Pe,t(b).password]]),e("button",{type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 cursor-pointer","aria-label":t(q)?"Hide password":"Show password",onClick:l[10]||(l[10]=w=>q.value=!t(q))},[t(q)?(o(),N(t(Ge),{key:1,size:18})):(o(),N(t(xe),{key:0,size:18}))],8,Ct)]),t(x).password?(o(),i("p",Dt,p(t(x).password),1)):(o(),i("p",Et," At least 8 characters, with one uppercase letter and one number. "))])]),V(ve,{modelValue:t(B),"onUpdate:modelValue":l[12]||(l[12]=w=>Ve(B)?B.value=w:null),"max-width":"max-w-lg","z-index":"z-[300]"},{header:F(()=>[...l[14]||(l[14]=[e("div",{class:"w-full pr-2 text-center pt-5"},[e("h2",{class:"mb-2 text-2xl font-medium text-gray-900"}," Log in to Marketize "),e("p",{class:"text-sm text-tertiary"}," Welcome back! Log in and weâll keep everything youâve entered so far. ")],-1)])]),default:F(()=>[V(oe,{"in-modal":"","redirect-on-success":!1,onSuccess:f,onSwitchToRegister:l[11]||(l[11]=w=>B.value=!1)})]),_:1},8,["modelValue"])],512)):m("",!0)}}},qt=(a=!1)=>[{key:"title",label:"Campaign Name",type:"text",placeholder:"e.g. February Promotion",fullWidth:!0,disabled:!1},{key:"type",label:"Campaign Type",type:"select",placeholder:"Select type",fullWidth:!1,disabled:a===!0||a==="true",options:[{value:"1",label:"Print"},{value:"2",label:"Distribution"},{value:"3",label:"Print and Distribution"}]},{key:"price",label:"Campaign Budget",type:"number",placeholder:"1000",fullWidth:!1,disabled:a===!0||a==="true"}],Bt=(a=!1,h=null)=>[{key:"description",label:"Description & Instructions",type:"rich-editor",placeholder:"Write campaign details, target audience, key messaging, and distribution instructions",fullWidth:!0,...String(h)==="5"&&{tooltip:{title:"You may want to include the following information:",items:["How many staff members you need and for how many shifts","How much time a regular shift is (usually it's a 4-hour period)","At what time you want people to be there","Special requests (if any) - such as breaking shifts in half - as in 2 hours with 2 hours","The specific location per person","Any extra requirements of wearing branded material and/or learning the tagline or answering questions about the company"]}}},{key:"start_date",label:"Preferred Start Date",type:"date",fullWidth:!1},{key:"end_date",label:"Preferred Deadline",type:"date",fullWidth:!1},{key:"_sep_base",type:"separator",fullWidth:!0},{key:"artworks",label:"Campaign Files",type:"file-upload",fullWidth:!0,disabled:a===!0||a==="true"}],Lt=(a=!1,h=null)=>[{key:"paper_style",label:"Printing Style",type:"select",placeholder:"Select style",fullWidth:!1,disabled:a===!0||a==="true",options:[{value:"1",label:"Single Sided"},{value:"2",label:"Double Sided"},{value:"3",label:"2 Pages"},{value:"4",label:"4 Pages"},{value:"5",label:"6 Pages"},{value:"6",label:"10 Pages"},{value:"7",label:"12 Pages"},{value:"8",label:"14 Pages"},{value:"9",label:"16 Pages"},{value:"10",label:"24 Pages"},{value:"11",label:"32 Pages"}]},{key:"print_quantity",label:"Print Quantity",type:"number",placeholder:"1000",fullWidth:!1,disabled:(a===!0||a==="true")&&String(h)==="3"},{key:"paper_orientation",label:"Page Orientation",type:"select",placeholder:"Select orientation",fullWidth:!1,disabled:!1,options:[{value:"1",label:"Portrait"},{value:"2",label:"Landscape"}]},{key:"paper_size",label:"Paper Size",type:"select",placeholder:"Select size",fullWidth:!1,disabled:a===!0||a==="true",options:[{value:"1",label:"A3"},{value:"2",label:"A4"},{value:"3",label:"A5"},{value:"4",label:"A6"},{value:"5",label:"Letter"},{value:"6",label:"DL"},{value:"7",label:"Square"},{value:"8",label:"Business Card"}]},{key:"paper_weight",label:"Paper Weight",type:"select",placeholder:"Select weight",fullWidth:!1,disabled:a===!0||a==="true",options:[{value:"1",label:"80 gsm"},{value:"2",label:"90 gsm"},{value:"3",label:"100 gsm"},{value:"4",label:"120 gsm"},{value:"5",label:"150 gsm"},{value:"6",label:"170 gsm"},{value:"7",label:"200 gsm"},{value:"8",label:"250 gsm"},{value:"9",label:"300 gsm"},{value:"10",label:"350 gsm"},{value:"11",label:"400 gsm"}]},{key:"print_quality",label:"Print Quality",type:"select",placeholder:"Select quality",fullWidth:!1,disabled:a===!0||a==="true",options:[{value:"1",label:"Glossy"},{value:"2",label:"Matte"},{value:"3",label:"Silk"},{value:"4",label:"Other"}]}],jt=(a=!1,h=null)=>[{key:"distribute_type",label:"Distribution Method",type:"select",placeholder:"Select method",fullWidth:!1,disabled:a===!0||a==="true",options:[{value:"1",label:"Door-to-Do
1or: Solus"},{value:"2",label:"Door-to-Door: Solus Sample"},{value:"3",label:"Door-to-Door: Consultation"},{value:"4",label:"Business-to-Business"},{value:"5",label:"Hand-to-Hand"}]},{key:"validation",label:"Validation Method",type:"select",placeholder:"Select validation",fullWidth:!1,disabled:a===!0||a==="true",options:[{value:"1",label:"GPS Tracking"},{value:"2",label:"GPS & Photo Tracking"},{value:"3",label:"Live GPS Tracking"},{value:"4",label:"Live GPS & Photo Tracking"}]},{key:"quantity",label:"Distribution Quantity",type:"number",placeholder:"1000",fullWidth:!1,disabled:!1,...String(h)==="5"&&{tooltip:{title:"Distribution Quantity",text:"Average distribution quantity is 500 leaflets per 4 hours"}}},String(h)!=="5"?{key:"letter_box",label:"Number of Letterboxes",type:"number",placeholder:"1000",fullWidth:!1,disabled:a===!0||a==="true"}:null,String(h)==="5"?{key:"distribution_hours",label:"Total Distribution Hours",type:"number",placeholder:"e.g. 8",fullWidth:!1,disabled:!1}:null].filter(Boolean),Mt=(a=[])=>({key:"partner_company",label:"Partner Agency",type:"select",placeholder:"Select partner agency",fullWidth:!1,optional:!0,options:[{value:"",label:"None"},...a.map(h=>({value:String(h.id),label:h.name}))],tooltip:{title:"Partner Agency",text:"Select our partner agency if you want your campaign to be carried out by them straight away. If youâd rather prefer to publish your campaign and pick a distributor among submitted proposals, select âNoneâ"}}),Nt={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4"},Wt={key:0,class:"col-span-full border-gray-200 my-1"},It=["data-field-anchor"],Ft={class:"flex items-center gap-1 mb-1"},Rt={class:"text-sm font-medium text-gray-900"},zt={class:"p-3 w-64 sm:w-80"},Ot={key:0,class:"text-sm font-medium text-gray-900 mb-2"},Ut={key:1,class:"text-sm text-gray-500 leading-relaxed bg-gray-100 rounded-lg p-3 border border-gray-200 text-left list-disc list-inside space-y-1"},Qt={key:2,class:"text-sm text-gray-500 leading-relaxed bg-gray-100 rounded-lg p-3 border border-gray-200 text-left"},Gt=["value","onInput","placeholder","disabled"],Ht=["value","onInput","placeholder","disabled"],Kt={key:0,class:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-gray-600 text-sm","aria-hidden":"true"},Yt=["disabled"],Xt={key:0,class:"text-gray-900"},Jt={key:1,class:"text-gray-400"},Zt={key:3,class:"relative"},ea=["value","onChange","disabled"],ta={value:"",disabled:"",selected:""},aa=["value"],ra={key:4},sa={key:5},oa={key:6,class:"text-xs text-red-500 mt-1"},la={__name:"BookCampaignDetails",props:{modelValue:{type:Object,default:()=>({})},draft:{type:[Boolean,String],default:!1},fileOptional:{type:Boolean,default:!1}},emits:["update:modelValue","logged-in","registered"],setup(a,{expose:h,emit:j}){const g=Ce(),y=a,k=j,A=D(null),R=()=>document.body,z=D(0),H=()=>{z.value+=1},K=ye(),Y=P(()=>K.isAuthenticated?K.getProfile?.partner_companies??[]:[]),O=P(()=>!!g.query.packageid),M=P(()=>{const u=y.modelValue.type,n=[...qt(y.draft)];return(u=="1"||u=="3")&&(n.push({key:"_sep_print",type:"separator",fullWidth:!0}),n.push(...Lt(y.draft,u))),(u=="2"||u=="3")&&(n.push({key:"_sep_dist",type:"separator",fullWidth:!0}),n.push(...jt(y.draft,y.modelValue.distribute_type))),n.push({key:"_sep_bottom",type:"separator",fullWidth:!0}),n.push(...Bt(y.draft,y.modelValue.distribute_type)),Y.value.length&&!O.value&&(n.push({key:"_sep_partner",type:"separator",fullWidth:!0}),n.push(Mt(Y.value))),n}),v=D({}),U=new Set(["separator","keyword"]),X=u=>{const n=y.modelValue[u];return n!=null&&String(n).trim()!==""},_=u=>{const n=y.modelValue[u];if(!n)return"";const c=new Date(n);return Number.isNaN(c.getTime())?n:c.toLocaleDateString("en-GB")},r=()=>{const u={};let n=!0;for(const c of M.value){if(U.has(c.type)||c.optional)continue;let S=!1;if(c.type==="rich-editor")S=!(y.modelValue[c.key]||"").replace(/<[^>]*>/g,"").trim();else if(c.type==="file-upload"){if(y.fileOptional)continue;S=!y.modelValue.artworks?.length}else{const $=y.modelValue[c.key];S=$==null||String($).trim()===""}S&&(u[c.key]=`${c.label} is required.`,n=!1)}return v.value=u,n};h({validate:async()=>{const u=r(),n=await A.value?.validate()??!0;return u&&n},scrollToFirstError:async()=>{await be();const u=M.value.find(c=>v.value[c.key]);if(!u){await A.value?.scrollToFirstError();return}const n=document.querySelector(`[data-field-anchor="${u.key}"]`);n?.scrollIntoView({behavior:"smooth",block:"center"}),n?.querySelector("input, select, textarea, button")?.focus({preventScroll:!0})},getRegistrationData:()=>A.value?.getData()??null,submitRegistration:async()=>await A.value?.submit()??!0});const J=["paper_style","print_quantity","paper_orientation","paper_size","paper_weight","print_quality"],re=["quantity","letter_box","distribution_hours","distribute_type","validation"],L=D(null);ge(()=>y.draft,()=>{L.value=null});const E=(u,n)=>{if(v.value[u]&&(v.value={...v.value,[u]:""}),u==="type"){const c=Number(n),S={};c!==1&&c!==3&&J.forEach($=>{S[$]=""}),c!==2&&c!==3&&re.forEach($=>{S[$]=""}),k("update:modelValue",{...y.modelValue,...S,[u]:n});return}if(u==="distribute_type"){const c={[u]:n};String(n)==="5"?c.letter_box="":c.distribution_hours="",k("update:modelValue",{...y.modelValue,...c});return}if(u==="quantity"&&g.query.draft==="true"){const c=String(y.modelValue.type),S=String(y.modelValue.distribute_type),$=c==="3",Q=(c==="2"||c==="3")&&S!=="5";if($||Q){const s={quantity:n};L.value===null&&(L.value={quantity:Number(y.modelValue.quantity)||0,print_quantity:Number(y.modelValue.print_quantity)||0,letter_box:Number(y.modelValue.letter_box)||0});const f=Number(n)||0,I=L.value.quantity,se=f-I;if($){const te=L.value.print_quantity,Z=I>0?Math.round(te*(f/I)):Math.max(0,te+se);s.print_quantity=String(Math.max(0,Z))}Q&&(s.letter_box=String(Math.max(0,L.value.letter_box+se))),k("update:modelValue",{...y.modelValue,...s});return}}k("update:modelValue",{...y.modelValue,[u]:n})},C=P({get:()=>y.modelValue.description||"",set:u=>E("description",u)}),W=P({get:()=>y.modelValue.artworks||[],set:u=>E("artworks",u)});return(u,n)=>{const c=Ie,S=Fe,$=Re,Q=At;return o(),i("div",null,[e("div",Nt,[(o(!0),i(ee,null,ne(M.value,s=>(o(),i(ee,{key:s.key},[s.type==="separator"?(o(),i("hr",Wt)):(o(),i("div",{key:1,"data-field-anchor":s.key,class:T(s.fullWidth?"col-span-full":"col-span-1")},[e("div",Ft,[e("label",Rt,p(s.label),1),s.tooltip?(o(),N(t(pe),{key:0,theme:"light-border",placement:"bottom-start","max-width":380,interactive:!0},{content:F(()=>[e("div",zt,[s.tooltip.title?(o(),i("p",Ot,p(s.tooltip.title),1)):m("",!0),s.tooltip.items?(o(),i("ul",Ut,[(o(!0),i(ee,null,ne(s.tooltip.items,f=>(o(),i("li",{key:f},p(f),1))),128))])):(o(),i("p",Qt,p(s.tooltip.text),1))])]),default:F(()=>[V(t(he),{size:15,class:"text-gray-400 hover:text-gray-600 transition-colors cursor-default"})]),_:2}
1,1024)):m("",!0)]),s.type==="text"?(o(),i("input",{key:0,type:"text",value:a.modelValue[s.key],onInput:f=>E(s.key,f.target.value),placeholder:s.placeholder,disabled:s.disabled,class:T(["w-full px-4 py-2.5 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500",v.value[s.key]?"border-red-500":"border-gray-200",s.disabled?"bg-white cursor-not-allowed opacity-60":""])},null,42,Gt)):s.type==="number"?(o(),i("div",{key:1,class:T(s.key==="price"?"relative":"")},[e("input",{type:"number",value:a.modelValue[s.key],onInput:f=>E(s.key,f.target.value),placeholder:s.placeholder,disabled:s.disabled,class:T(["w-full px-4 py-2.5 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500",v.value[s.key]?"border-red-500":"border-gray-200",s.disabled?"bg-white cursor-not-allowed opacity-60":"",s.key==="price"?"pl-5":""])},null,42,Ht),s.key==="price"?(o(),i("span",Kt," £ ")):m("",!0)],2)):s.type==="date"?(o(),N(t(pe),{key:2,tag:"div",class:"block w-full",theme:"calendar",placement:"bottom-start",trigger:"click",interactive:!0,arrow:!1,offset:[0,6],"append-to":R,disabled:s.disabled,"on-hidden":H},{content:F(({hide:f})=>[(o(),N(c,{key:z.value,modelValue:a.modelValue[s.key],"onUpdate:modelValue":I=>E(s.key,I),onCancel:f,onApply:f},null,8,["modelValue","onUpdate:modelValue","onCancel","onApply"]))]),default:F(()=>[e("button",{type:"button",disabled:s.disabled,class:T(["w-full px-4 py-2.5 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 cursor-pointer bg-white flex items-center justify-between",v.value[s.key]?"border-red-500":"border-gray-200",s.disabled?"bg-gray-100 cursor-not-allowed opacity-60":""])},[X(s.key)?(o(),i("span",Xt,p(_(s.key)),1)):(o(),i("span",Jt,p(s.placeholder||"dd/mm/yyyy"),1)),V(t(Ke),{size:15,class:"text-gray-400 ml-2 shrink-0"})],10,Yt)]),_:2},1032,["disabled"])):s.type==="select"?(o(),i("div",Zt,[e("select",{value:a.modelValue[s.key],onChange:f=>E(s.key,f.target.value),disabled:s.disabled,class:T(["w-full px-4 py-2.5 pr-10 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 appearance-none bg-white",v.value[s.key]?"border-red-500":"border-gray-200",s.disabled?"bg-white cursor-not-allowed opacity-60":""])},[e("option",ta,p(s.placeholder),1),(o(!0),i(ee,null,ne(s.options,f=>(o(),i("option",{key:f.value,value:f.value},p(f.label),9,aa))),128))],42,ea),V(t(Ye),{size:16,class:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"})])):s.type==="rich-editor"?(o(),i("div",ra,[V(S,{modelValue:C.value,"onUpdate:modelValue":n[0]||(n[0]=f=>C.value=f),placeholder:s.placeholder,class:T(v.value[s.key]?"ring-1 ring-red-500 rounded-xl":"")},null,8,["modelValue","placeholder","class"])])):s.type==="file-upload"?(o(),i("div",sa,[V($,{modelValue:W.value,"onUpdate:modelValue":n[1]||(n[1]=f=>W.value=f),label:"",accept:".docx,.xlsx,.csv,.pptx,.pdf,.jpg,.jpeg,.png",hint:"DOCX, XLSX, CSV, PPTX, PDF, PNG, JPG up to 50 MB"},null,8,["modelValue"])])):m("",!0),v.value[s.key]?(o(),i("p",oa,p(v.value[s.key]),1)):m("",!0)],10,It))],64))),128))]),V(Q,{ref_key:"registrationRef",ref:A,onLoggedIn:n[2]||(n[2]=s=>k("logged-in")),onRegistered:n[3]||(n[3]=s=>k("registered",s))},null,512)])}}},kr=He(la,[["__scopeId","data-v-fdcbf253"]]),na={class:"space-y-6"},ia={class:"text-sm border border-gray-100 rounded-xl"},da={class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},ua={class:"text-gray-900 text-right"},pa={class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},ca={class:"text-gray-900 text-right"},ya={class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},ma={class:"text-gray-900 text-right"},ga={class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},ba={class:"text-gray-900 text-right"},fa={class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},ha={class:"text-gray-900 text-right"},xa={key:0,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},va={class:"text-gray-900 text-right"},_a={key:1,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},wa={class:"text-gray-900 text-right"},ka={key:2,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Sa={class:"text-gray-900 text-right"},$a={key:3,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Pa={class:"text-gray-900 text-right"},Va={key:4,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Ca={class:"text-gray-900 text-right"},Da={key:5,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Ea={class:"text-gray-900 text-right"},Ta={key:6,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Aa={class:"text-gray-900 text-right"},qa={key:7,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Ba={class:"text-gray-900 text-right"},La={key:8,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},ja={class:"text-gray-900 text-right"},Ma={key:9,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Na={class:"text-gray-900 text-right"},Wa={key:10,class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Ia={class:"text-gray-900 text-right"},Fa={class:"flex justify-between gap-x-4 gap-y-1 flex-wrap items-center px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Ra={class:"flex items-center gap-2 flex-wrap justify-end"},za=["disabled"],Oa={key:1,class:"text-gray-900 text-sm"},Ua={key:11,class:"border-t border-gray-200"},Qa={class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap items-center px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Ga={class:"font-bold text-gray-900"},Ha={class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap items-center px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Ka={class:"text-gray-900"},Ya={class:"flex justify-between gap-x-4 gap-y-0.5 flex-wrap items-center px-3 py-2.5 border-y border-transparent hover:border-gray-200 hover:bg-gray-50"},Xa={class:"flex items-center gap-1 font-normal text-gray-900"},Ja={class:"font-normal text-gray-900"},Za={class:"relative bg-white rounded-2xl shadow-2xl w-full mx-4 sm:w-[80vw] sm:max-w-4xl"},er={class:"p-4 h-[60vh]"},Sr={__name:"BookCampaignConfirmation",props:{form:{type:Object,required:!0},categories:{type:Array,default:()=>[]}},emits:["edit-area"],setup(a,{emit:h}){const j=Ze(),g=a,y=D(""),k=D(!1),A=D(!1),R=P(()=>Le[g?.form?.paper_size]),z=P(()=>je[g?.form?.paper_weight]),H=P(()=>Me[g?.form?.print_quality]),K=P(()=>Ne[g?.form?.distribute_type]),Y=P(()=>We[g?.form?.validation]),O=P(()=>(Array.isArray(g.categories)?g.categories:Array.isArray(g.categories?.results)?g.categories.results:[]).find(q=>String(q.id)===String(g.form.category))?.title||g.form.category||"â"),M=_=>{if(!_)return"â";const r=new Date(_);return isNaN(r)?_:r.toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})},v=P(()=>parseFloat(g.form.price)||0),U=P(()=>v.value*.055),X=P(()=>v.value+U.value);return me(async()=>
1{const _=(g.form.areas||[]).map(Je).filter(Boolean);k.value=!0,await j.fetchCampaignCoverage({areas:_}).then(r=>{y.value=r?.result?.label}).finally(()=>{k.value=!1})}),(_,r)=>{const q=Xe;return o(),i(ee,null,[e("div",na,[r[25]||(r[25]=e("h3",{class:"text-gray-900 mb-2"},"Campaign Summary",-1)),e("div",ia,[e("div",da,[r[3]||(r[3]=e("span",{class:"text-gray-500 shrink-0"},"Title",-1)),e("span",ua,p(a.form.title||"â"),1)]),e("div",pa,[r[4]||(r[4]=e("span",{class:"text-gray-500 shrink-0"},"Category",-1)),e("span",ca,p(t(O)),1)]),e("div",ya,[r[5]||(r[5]=e("span",{class:"text-gray-500 shrink-0"},"Campaign Type",-1)),e("span",ma,p(("serviceType"in _?_.serviceType:t(De))[a.form.type]||"â"),1)]),e("div",ga,[r[6]||(r[6]=e("span",{class:"text-gray-500 shrink-0"},"Preferred Start Date",-1)),e("span",ba,p(M(a.form.start_date)),1)]),e("div",fa,[r[7]||(r[7]=e("span",{class:"text-gray-500 shrink-0"},"Preferred Deadline",-1)),e("span",ha,p(M(a.form.end_date)),1)]),a.form?.quantity?(o(),i("div",xa,[r[8]||(r[8]=e("span",{class:"text-gray-500 shrink-0"},"Distribution Quantity",-1)),e("span",va,p(a.form.quantity||"â"),1)])):m("",!0),a.form?.print_quantity?(o(),i("div",_a,[r[9]||(r[9]=e("span",{class:"text-gray-500 shrink-0"},"Print Quantity",-1)),e("span",wa,p(a.form?.print_quantity||"â"),1)])):m("",!0),t(R)?(o(),i("div",ka,[r[10]||(r[10]=e("span",{class:"text-gray-500 shrink-0"},"Paper Size",-1)),e("span",Sa,p(t(R)),1)])):m("",!0),a.form?.paper_weight?(o(),i("div",$a,[r[11]||(r[11]=e("span",{class:"text-gray-500 shrink-0"},"Page Orientation",-1)),e("span",Pa,p(("paperOrientationMap"in _?_.paperOrientationMap:t(Ee))[a.form?.paper_orientation]),1)])):m("",!0),a.form?.paper_style?(o(),i("div",Va,[r[12]||(r[12]=e("span",{class:"text-gray-500 shrink-0"},"Printing Style",-1)),e("span",Ca,p(("paperStyle"in _?_.paperStyle:t(Te))[a.form?.paper_style]),1)])):m("",!0),t(z)?(o(),i("div",Da,[r[13]||(r[13]=e("span",{class:"text-gray-500 shrink-0"},"Paper Weight",-1)),e("span",Ea,p(t(z)),1)])):m("",!0),t(H)?(o(),i("div",Ta,[r[14]||(r[14]=e("span",{class:"text-gray-500 shrink-0"},"Print Quality",-1)),e("span",Aa,p(t(H)),1)])):m("",!0),a.form?.distribution_hours?(o(),i("div",qa,[r[15]||(r[15]=e("span",{class:"text-gray-500 shrink-0"},"Distribution Hours",-1)),e("span",Ba,p(a.form.distribution_hours||"â"),1)])):m("",!0),a.form?.letter_box?(o(),i("div",La,[r[16]||(r[16]=e("span",{class:"text-gray-500 shrink-0"},"Number of Letterboxes",-1)),e("span",ja,p(a.form.letter_box||"â"),1)])):m("",!0),a.form?.distribute_type?(o(),i("div",Ma,[r[17]||(r[17]=e("span",{class:"text-gray-500 shrink-0"},"Distribution Method",-1)),e("span",Na,p(t(K)),1)])):m("",!0),a.form?.validation?(o(),i("div",Wa,[r[18]||(r[18]=e("span",{class:"text-gray-500 shrink-0"},"Validation Method",-1)),e("span",Ia,p(t(Y)),1)])):m("",!0),e("div",Fa,[r[20]||(r[20]=e("span",{class:"text-gray-500 shrink-0"},"Targeted Areas",-1)),e("div",Ra,[e("button",{type:"button",onClick:r[0]||(r[0]=B=>_.$emit("edit-area")),class:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-full transition-colors cursor-pointer"},[V(t(et),{size:14}),r[19]||(r[19]=de(" Edit Area ",-1))]),a.form.areas?.length?(o(),i("button",{key:0,type:"button",onClick:r[1]||(r[1]=B=>A.value=!0),disabled:t(k),class:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-full transition-colors cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed"},[t(k)?(o(),N(t(fe),{key:0,size:14,class:"animate-spin"})):(o(),N(t(xe),{key:1,size:14})),de(" "+p(t(k)?"Loading...":t(y)||"View Area"),1)],8,za)):m("",!0),a.form.areas?.length?m("",!0):(o(),i("span",Oa,"â"))])]),a.form.price?(o(),i("div",Ua,[e("div",Qa,[r[21]||(r[21]=e("span",{class:"font-normal text-gray-900"},"Budget",-1)),e("span",Ga,"£"+p(t(v).toFixed(2)),1)]),e("div",Ha,[r[22]||(r[22]=e("span",{class:"text-gray-500"},"Service Fee (5.5%)",-1)),e("span",Ka,"£"+p(t(U).toFixed(2)),1)]),e("div",Ya,[e("span",Xa,[r[24]||(r[24]=de(" Estimated Total ",-1)),V(t(pe),{theme:"light-border",placement:"top",content:"Final price may vary upon settling with the preferred distributor"},{default:F(()=>[...r[23]||(r[23]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-3 h-3 text-gray-400 cursor-help",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("circle",{cx:"12",cy:"12",r:"10"}),e("path",{d:"M12 16v-4"}),e("path",{d:"M12 8h.01"})],-1)])]),_:1})]),e("span",Ja,"£"+p(t(X).toFixed(2)),1)])])):m("",!0)])]),(o(),N(Be,{to:"body"},[V(qe,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition duration-150 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:F(()=>[t(A)?(o(),i("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:r[2]||(r[2]=Ae(B=>A.value=!1,["self"]))},[e("div",Za,[e("div",er,[V(q,{areas:a.form.areas||[],"show-draw":!1,title:"Operational Targeted Areas"},null,8,["areas"])])])])):m("",!0)]),_:1})]))],64)}}};export{At as _,Bt as a,Mt as b,qt as c,jt as d,wr as e,kr as f,Sr as g,Lt as p,ot as u};
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.