1import{B as j,C as F,u as V,g as x,aV as N,s as I,_ as O,H as G,c as r,o as a,a as e,w as c,e as d,t as n,b as J,F as T,J as H,n as A}from"./index.u65Ff0R7.js";import{a as K}from"./index.DW_MHI2K.js";import{u as M}from"./EnquiryPageComponentMixin.B5R-KLG8.js";const Q=j({__name:"EnquiryPageDownloads",props:{step:{},groupDownloads:{},componentId:{},componentUrl:{},prevStepButtonEnabled:{type:Boolean}},emits:["prev-step","next-step","send-request"],setup(y,{expose:s,emit:m}){s();const o=y,b=m,h={componentId:String(o.componentId??o.step),componentUrl:o.componentUrl??"",prevStepButtonEnabled:o.prevStepButtonEnabled??!0,step:o.step},{palette:t}=F(),{t:l}=V(),u=M(h,(i,p)=>b(i,p)),{isCurrentStep:g,isDone:S,isLastStep:C,isSending:E,prevStep:D,nextStep:P,sendRequest:L}=u,f=x(()=>o.groupDownloads??[]),z=x(()=>!0);function B(i,p=1){const _=typeof i=="string"?Number(i):i;return N(_,p)}function U(i){switch(i){case"application/pdf":return"PDF";case"image/jpeg":return"JPEG";case"image/png":return"PNG";case"image/jpg":return"JPG";default:return"OTHER"}}async function q(i,p){try{const _=await K.get(i,{responseType:"blob"}),k=window.URL.createObjectURL(_.data),v=document.createElement("a");v.href=k,v.download=p,document.body.appendChild(v),v.click(),document.body.removeChild(v),window.URL.revokeObjectURL(k)}catch(_){I.error(l("common.something-went-wrong-please-try-again")||"Error"),console.error("[downloadFile] error:",_)}}function R(){return{downloaded:f.value.map(i=>i.name)}}const w={props:o,emit:b,normalizedProps:h,palette:t,t:l,stepApi:u,isCurrentStep:g,isDone:S,isLastStep:C,isSending:E,prevStep:D,nextStep:P,sendRequest:L,documentsList:f,isValid:z,formatSizeLocal:B,formatExtension:U,downloadFile:q,preparePayload:R};return Object.defineProperty(w,"__isScriptSetup",{enumerable:!1,value:!0}),w}}),W={class:"number"},X={key:0,class:"number-done"},Y={key:1,class:"number-current"},Z={key:2,class:"number-next"},$={class:"block"},oo={key:0,class:"check"},eo={class:"card content"},to={class:"mb-10"},no={class:"grid grid-cols-12 text-gray-300 font-semibold mb-4"},ro={class:"col-span-7"},ao={class:"col-span-2"},so={class:"col-span-2"},lo={class:"flex justify-end"},io={class:"text-right"},co={class:"downloads"},mo={class:"download__name"},po={class:"name__icon"},_o={class:"ict-document text-xl"},vo={class:"download__format"},uo={class:"download__size"},bo={class:"download__action"},ho=["onClick"],yo={class:"flex flex-wrap flex-spacing buttons"},go={class:"w-6/12 columns"},fo=["disabled"],wo={key:0,class:"w-6/12 columns text-right"},ko={key:1,class:"w-6/12 columns text-right"},xo=["disabled"];function So(y,s,m,o,b,h){const t=G("styled");return a(),r("div",{class:A(["step",{done:o.isDone,current:o.isCurrentStep}])},[e("div",W,[o.isDone?c((a(),r("div",X,[d(n(m.step),1)])),[[t,o.palette.colors.primary.main,"background"],[t,o.palette.colors.primary.main,"border-color"],[t,o.palette.colors.primary.alt,"color",{after:!0}]]):o.isCurrentStep?c((a(),r("div",Y,[d(n(m.step),1)])),[[t,o.palette.colors.primary.main,"color"],[t,o.palette.colors.primary.main,"border-color"]]):c((a(),r("div",Z,[d(n(m.step),1)])),[[t,o.palette.colors.primary.main,"color"]])]),e("div",$,[e("h3",null,[d(n(o.t("appointment.documents-download"))+" ",1),e("span",null,"("+n(o.t("appointment.required"))+")",1)]),o.isCurrentStep?(a(),r("div",oo,[s[4]||(s[4]=e("p",{class:"description"},null,-1)),e("div",eo,[e("p",to,n(o.t("appointment.download-and-save")),1),e("div",no,[e("div",ro,[e("span",null,n(o.t("appointment.file-name")),1)]),e("div",ao,[e("span",null,n(o.t("appointment.format")),1)]),e("div",so,[e("span",null,n(o.t("appointment.size")),1)]),e("div",lo,[e("span",io,n(o.t("appointment.download")),1)])]),e("div",co,[(a(!0),r(T,null,H(o.documentsList,(l,u)=>(a(),r("div",{class:"download",key:u},[e("div",mo,[e("div",po,[c(e("i",_o,null,512),[[t,o.palette.colors.secondary.main,"color"]])]),e("span",null,n(l.name),1)]),e("div",vo,[e("span",null,n(o.formatExtension(l.type)),1)]),e("div",uo,[e("span",null,n(o.formatSizeLocal(l.size,1)),1)]),e("div",bo,[c((a(),r("div",{onClick:g=>o.downloadFile(l.url,l.name),class:"action__button"},s[3]||(s[3]=[e("i",{class:"ict-download text-xl font-light"},null,-1)]),8,ho)),[[t,o.palette.colors.secondary.main,"color"],[t,o.palette.colors.primary.alt,"background"],[t,o.palette.colors.hover.main,"background",{hover:!0}],[t,o.palette.colors.hover.alt,"color",{hover:!0}]])])]))),128))])]),e("div",yo,[e("div",go,[c((a(),r("button",{disabled:o.isSending,class:"button border-gray medium",onClick:s[0]||(s[0]=l=>o.prevStep())},[d(n(o.t("appointment.step-back")),1)],8,fo)),[[t,o.palette.colors.secondary.main,"color"],[t,o.palette.colors.primary.alt,"background"],[t,o.palette.colors.primary.main,"border-color"],[t,o.palette.colors.hover.main,"background",{hover:!0}],[t,o.palette.colors.hover.alt,"color",{hover:!0}]])]),o.isLastStep?(a(),r("div",ko,[c((a(),r("button",{class:"button accent medium",onClick:s[2]||(s[2]=l=>o.sendRequest(o.preparePayload())),disabled:o.isValid===!1||o.isSending===!0},[d(n(o.t("appointment.send")),1)],8,xo)),[[t,o.palette.colors.primary.alt,"color"],[t,o.palette.colors.primary.main,"background"],[t,o.palette.colors.primary.main,"border-color"],[t,o.palette.colors.hover.alt,"background",{hover:!0}],[t,o.palette.colors.hover.main,"color",{hover:!0}
1]])])):(a(),r("div",wo,[c((a(),r("button",{onClick:s[1]||(s[1]=l=>o.nextStep(o.preparePayload())),class:"button accent medium"},[d(n(o.t("appointment.next-step")),1)])),[[t,o.palette.colors.primary.alt,"color"],[t,o.palette.colors.primary.main,"background"],[t,o.palette.colors.primary.main,"border-color"],[t,o.palette.colors.hover.alt,"background",{hover:!0}],[t,o.palette.colors.hover.main,"color",{hover:!0}]])]))])])):J("",!0)])],2)}const Po=O(Q,[["render",So],["__file","EnquiryPageDownloads.vue"]]);export{Po 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.