PageSourceSearch

https://path-client-hbwdj.ondigitalocean.app/assets/SelfRegisterView-kIMwzcz8.js

js path-client-hbwdj.ondigitalocean.app collected 2026-10-03 14:54:28 UTC 7,790 bytes, 1 lines download raw bytes

1import{a as b,r as E,H as y,I as V,o as g,c as p,b as e,J as z,t,w as l,v as c,f as s,n,C as v,l as w,e as R,K as O,E as $,k as q,m as x,p as k,q as C}from"./index-B1nPZB43.js";import{c as U,a as d}from"./index.esm-BPbZZr1V.js";const F={class:"mb:my-0 container mx-auto my-8 grid h-lvh place-content-center px-4"},A={class:"card bg-base-100 border-primary w-full border shadow-xl md:w-[650px]"},S={class:"card-body"},M={class:"card-title"},N={class:"card-title mt-5"},D={class:"form-control w-full"},B={class:"label"},P={class:"label-text"},I={class:"text-error"},K={class:"form-control w-full max-w-xs"},T={class:"label"},j={class:"label-text"},H={value:""},J=e("option",{value:"Admin"},"Admin",-1),L={class:"text-error"},G={class:"card-title mt-5"},Q={class:"form-control w-full"},W={class:"label"},X={class:"label-text"},Y={class:"text-error"},Z={class:"form-control w-full"},ee={class:"label"},re={class:"label-text"},se={class:"text-error"},te={class:"form-control w-full"},oe={class:"label"},ae={class:"label-text"},ie={class:"text-error"},le={class:"form-control w-full"},ne={class:"label"},de={class:"label-text"},ce={class:"text-error"},ue={class:"form-control w-full"},me={class:"label"},ge={class:"label-text"},pe={class:"text-error"},_e={class:"form-control w-full"},he={class:"label"},fe={class:"label-text"},be={class:"text-error"},Ee={class:"mt-4"},ye={class:"btn btn-primary mr-4",type:"submit"},Ve={key:0,role:"alert",class:"alert alert-success mt-4"},ze=e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 shrink-0 stroke-current",fill:"none",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),ve=e("span",null,"Admin and organization register complete",-1),we=[ze,ve],Re={class:"mt-2"},Oe={class:"text-primary"},$e={class:"modal",role:"dialog"},qe={class:"modal-box"},xe={class:"text-lg font-bold"},ke={class:"py-1"},Ce={class:"py-1"},Ue={class:"py-1"},Me={__name:"SelfRegisterView",setup(Fe){const r=b(),u=E(!1),_=U().shape({userEmail:d().email().required(),role:d().required("Role is required").notOneOf([""],"Please select a role"),name:d().required("Name is required"),address:d().required("Address is required"),country:d().required("Country is required"),city:d().required("City is required"),phone:d().required("Phone is required"),organizationEmail:d().email().required("Email is required")}),h=()=>{x.get(`user/check?email=${r.registerFormValues.userEmail}`).then(o=>{o.data=="OK"?u.value=!0:k.error(C.global.t("toast.email_not_available"))})},f=async()=>{try{const o={...r.registerFormValues,...r.registerOrganizationValue};await _.validate(o,{abortEarly:!1}),r.registerOrganization()}catch(o){const a={};o.inner.forEach(m=>{a[m.path]=m.message}),r.setFormErrorsRegister(a)}};return y(()=>{r.registerFormValues.userEmail&&(r.formErrorsRegister.userEmail=""),r.registerFormValues.role&&(r.formErrorsRegister.role=""),r.getUserData.role==="SUPERADMIN"&&(r.registerOrganizationValue.name&&(r.formErrorsRegister.name=""),r.registerOrganizationValue.address&&(r.formErrorsRegister.address=""),r.registerOrganizationValue.country&&(r.formErrorsRegister.country=""),r.registerOrganizationValue.city&&(r.formErrorsRegister.city=""),r.registerOrganizationValue.phone&&(r.formErrorsRegister.phone=""),r.registerOrganizationValue.organizationEmail&&(r.formErrorsRegister.organizationEmail=""))}),(o,a)=>{const m=V("router-link");return g(),p("main",F,[e("section",null,[e("div",A,[e("div",S,[e("form",{onSubmit:z(h,["prevent"]),novalidate:""},[e("h1",M,t(o.$t("navbar.register_organization")),1),e("h1",N,t(o.$t("headers.user_information")),1),e("label",D,[e("div",B,[e("span",P,t(o.$t("headers.email")),1)]),l(e("input",{type:"email",placeholder:"[email protected]",class:n(["input input-bordered w-full",{"input-error":s(r).formErrorsRegister.userEmail}]),"onUpdate:modelValue":a[0]||(a[0]=i=>s(r).registerFormValues.userEmail=i)},null,2),[[c,s(r).registerFormValues.userEmail]]),e("span",I,t(s(r).formErrorsRegister.userEmail),1)]),e("label",K,[e("div",T,[e("span",j,t(o.$t("headers.select_user_role")),1)]),l(e("select",{class:n(["select select-bordered",{"border-error":s(r).formErrorsRegister.role}]),"onUpdate:modelValue":a[1]||(a[1]=i=>s(r).registerFormValues.role=i)},[e("option",H,t(o.$t("headers.select_role")),1),J],2),[[v,s(r).registerFormValues.role]]),e("span",L,t(s(r).formErrorsRegister.role),1)]),e("h1",G,t(o.$t("headers.organization_information")),1),e("label",Q,[e("div",W,[e("span",X,t(o.$t("headers.org_name")),1)]),l(e("input",{type:"text",placeholder:"Organization name",class:n(["input input-bordered w-full",{"input-error":s(r).formErrorsRegister.name}]),"onUpdate:modelValue":a[2]||(a[2]=i=>s(r).registerOrganizationValue.name=i)},null,2),[[c,s(r).registerOrganizationValue.name]]),e("span",Y,t(s(r).formErrorsRegister.name),1)]),e("label",Z,[e("div",ee,[e("span",re,t(o.$t("headers.org_address")),1)]),l(e("input",{type:"text",placeholder:"Organization address",class:n(["input input-bordered w-full",{"input-error":s(r).formErrorsRegister.address}]),"onUpdate:modelValue":a[3]||(a[3]=i=>
1s(r).registerOrganizationValue.address=i)},null,2),[[c,s(r).registerOrganizationValue.address]]),e("span",se,t(s(r).formErrorsRegister.address),1)]),e("label",te,[e("div",oe,[e("span",ae,t(o.$t("headers.org_country")),1)]),l(e("input",{type:"text",placeholder:"Organization country",class:n(["input input-bordered w-full",{"input-error":s(r).formErrorsRegister.country}]),"onUpdate:modelValue":a[4]||(a[4]=i=>s(r).registerOrganizationValue.country=i)},null,2),[[c,s(r).registerOrganizationValue.country]]),e("span",ie,t(s(r).formErrorsRegister.country),1)]),e("label",le,[e("div",ne,[e("span",de,t(o.$t("headers.org_city")),1)]),l(e("input",{type:"text",placeholder:"Organization city",class:n(["input input-bordered w-full",{"input-error":s(r).formErrorsRegister.city}]),"onUpdate:modelValue":a[5]||(a[5]=i=>s(r).registerOrganizationValue.city=i)},null,2),[[c,s(r).registerOrganizationValue.city]]),e("span",ce,t(s(r).formErrorsRegister.city),1)]),e("label",ue,[e("div",me,[e("span",ge,t(o.$t("headers.org_phone")),1)]),l(e("input",{type:"text",placeholder:"Organization phone",class:n(["input input-bordered w-full",{"input-error":s(r).formErrorsRegister.phone}]),"onUpdate:modelValue":a[6]||(a[6]=i=>s(r).registerOrganizationValue.phone=i)},null,2),[[c,s(r).registerOrganizationValue.phone]]),e("span",pe,t(s(r).formErrorsRegister.phone),1)]),e("label",_e,[e("div",he,[e("span",fe,t(o.$t("headers.org_email")),1)]),l(e("input",{type:"email",placeholder:"[email protected]",class:n(["input input-bordered w-full",{"input-error":s(r).formErrorsRegister.organizationEmail}]),"onUpdate:modelValue":a[7]||(a[7]=i=>s(r).registerOrganizationValue.organizationEmail=i)},null,2),[[c,s(r).registerOrganizationValue.organizationEmail]]),e("span",be,t(s(r).formErrorsRegister.organizationEmail),1)]),e("div",Ee,[e("button",ye,t(o.$t("headers.send_request")),1)]),s(r).isAdminAndOrgRegisterComplete?(g(),p("div",Ve,we)):w("",!0),e("div",Re,[R(m,{to:"/"},{default:O(()=>[q(t(o.$t("headers.go_to"))+" ",1),e("span",Oe,t(o.$t("headers.login").toLowerCase()),1)]),_:1})])],32)])])]),l(e("input",{type:"checkbox","onUpdate:modelValue":a[8]||(a[8]=i=>u.value=i),class:"modal-toggle"},null,512),[[$,u.value]]),e("div",$e,[e("div",qe,[e("h3",xe,t(o.$t("headers.org_reg_confirm")),1),e("p",ke,t(o.$t("headers.org_reg_confirm_1")),1),e("p",Ce,t(o.$t("headers.org_reg_confirm_2")),1),e("p",Ue,t(o.$t("headers.org_reg_confirm_3")),1),e("div",null,[e("button",{class:"btn",onClick:f},t(o.$t("headers.org_confirm_request")),1),e("button",{class:"btn",onClick:a[9]||(a[9]=i=>u.value=!1)},t(o.$t("headers.close")),1)])])])])}}};export{Me 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.