1import{_ as E}from"./jb0slt8C.js";import{d as N,b as T,du as j,u as O,c as G,s as J,y as K,a as Q,H as X,x as l,z as S,cq as p,g as Y,j as f,i as n,k as e,m as k,t as u,bl as _,P as B,a5 as Z,h as ee}from"./CTwjLVo9.js";import{c as te,a as D,b as C,u as oe}from"./BWxOVg1T.js";import{V}from"./DyJ9bgkC.js";import{u as se}from"./w1MSXho_.js";import{u as ne}from"./BAbdV6gz.js";import{u as R}from"./BinXVSQ2.js";import"./BLXxdsiG.js";import"./B_dCBO1A.js";import"./hBKOvaze.js";import"./BbON9zhe.js";import"./DMsxsjxB.js";import"./D8B-1ICt.js";import"./BXWXHAo2.js";import"./Doz9SQD6.js";import"./SMfikpvB.js";const re={class:"h-screen flex flex-col"},ae={class:"text-body-l text-surface-600 mb-4"},ie={class:"flex gap-2 mt-8"},le={type:"submit",class:"app-button app-button--dark w-min",form:"special-event-form"},_e=N({__name:"student-verification",setup(ue){const{t}=T(),z=j(),H=O();G({title:t("communities.profile.studentDiscountForm.title")});const{isWebWidth:F}=se(),{fileParams:I}=J(K()),P=te().shape({studentIdFrontFile:D().of(C()).min(1,t("errors.required")),studentIdBackFile:D().of(C()).min(1,t("errors.required"))}),$={studentIdFrontFile:[],studentIdBackFile:[]},{defineField:h,handleSubmit:A,errors:v}=oe({validationSchema:P,initialValues:$}),[a]=h("studentIdFrontFile"),[i]=h("studentIdBackFile"),d=Q(),L=X(),g=A(s=>{const o={frontImage:s.studentIdFrontFile[0],backImage:s.studentIdBackFile[0]};z.applyForStudentDiscount(Number(d.params.id),o).then(()=>{H.showBanner({type:"success",message:t("communities.profile.studentDiscountForm.applySuccess")}),W.value=!0;const c=decodeURIComponent(d.query.redirectPath||"");L.push(c||`/organizations/${d.params.id}`)})}),U=l(()=>a.value.length>0||i.value.length>0),{ensureClosingView:m,allowLeavingView:W}=ne(U),b=S(),q=l(()=>{const{top:s}=R(b);return`calc(100dvh - ${s.value}px)`}),y=S(),M=l(()=>{var s;return(s=y.value)==null?void 0:s.$el}),{width:w}=R(M),x=l(()=>w.value?Math.round(w.value/p.StudentId):400);return(s,o)=>{const c=E;return ee(),Y("div",re,[f(c,{header:e(t)("communities.profile.studentDiscountForm.title"),onClose:e(m)},null,8,["header","onClose"]),n("div",{ref_key:"viewContent",ref:b,style:Z({height:e(q)}),class:"overflow-y-auto"},[n("div",{class:k(["view-wrapper--narrow-md",[e(F)?"py-10 px-6":"pa-4"]])},[n("h2",{class:k(["text-h1 mt-4 mb-2 text-primary",[e(F)?"text-header-xl":"text-header-l"]])},u(e(t)("communities.profile.studentDiscountForm.header")),3),n("p",ae,u(e(t)("communities.profile.studentDiscountForm.description")),1),n("form",{id:"special-event-form",class:"registration-user-input pt-6 flex flex-col gap-2 field",onSubmit:o[3]||(o[3]=_((...r)=>e(g)&&e(g)(...r),["prevent"]))},[f(V,{ref_key:"studentIdInputRef",ref:y,modelValue:e(a),"onUpdate:modelValue":o[0]||(o[0]=r=>B(a)?a.value=r:null),name:"studentIdFrontFile",errors:e(v).studentIdFrontFile,label:e(t)("communities.profile.studentDiscountForm.studentIdLabelFront"),"field-props":{single:!0,fileParams:e(I).communityAvatar,fullScreenDragAndDrop:!1,aspectRatio:e(p).StudentId,previewHeight:e(x)},type:"image-crop"},null,8,["modelValue","errors","label","field-props"]),f(V,{modelValue:e(i),"onUpdate:modelValue":o[1]||(o[1]=r=>B(i)?i.value=r:null),name:"studentIdBackFile",errors:e(v).studentIdBackFile,label:e(t)("communities.profile.studentDiscountForm.studentIdLabelBack"),"field-props":{single:!0,fileParams:e(I).communityAvatar,fullScreenDragAndDrop:!1,aspectRatio:e(p).StudentId,previewHeight:e(x)},type:"image-crop"},null,8,["modelValue","errors","label","field-props"]),n("div",ie,[n("button",{class:"app-button w-min",onClick:o[2]||(o[2]=_((...r)=>e(m)&&e(m)(...r),["prevent"]))},u(e(t)("common.cancel")),1),n("button",le,u(e(t)("common.apply")),1)])],32)],2)
1],4)])}}});export{_e 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.