PageSourceSearch

https://app.praefy.com/assets/NewDevelopment.2f577fab.js

js praefy.com collected 2026-10-06 19:06:34 UTC 9,025 bytes, 1 lines download raw bytes

1import{u as _e,eJ as fe,e as we,f as be,i as Se,r as ye,q as Ve,dx as Ne,x as g,y as U,A as P,B as Ae,C as I,E as h,_ as Be,e0 as $e,eY as Ce,T as n,e1 as j,U as $,e2 as We,e3 as Me,o as N,V as r,X as De,Y as e,Z as C,a as u,c as L,b as k,$ as O,a0 as d,bp as H,a7 as Ue,a8 as Pe,a1 as Ie,a2 as Le,a3 as J,a9 as ke,aa as Oe,F as Ee,eX as Te,ea as qe,b7 as xe,eZ as Re,t as Fe,aG as Ge,ay as Xe}from"./index.2b12a2d5.js";const Ye={class:"flex justify-between items-start w-full"},Ze={key:0},je={class:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4 mb-5"},He={class:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 mb-5"},Je={class:"grid grid-cols-1 gap-4 md:grid-cols-3 lg:grid-cols-5"},ze={class:"grid grid-cols-1 mt-5 gap-4 md:grid-cols-2 lg:grid-cols-3"},Ke={class:"mt-5 grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4"},ll={__name:"NewDevelopment",setup(Qe){const f=$e(),E=Ee(),w=_e(),B=fe(),z=we(),T=be(),q=Se(),K=ye(),Q=Ve(),b=Ne(),a=g(()=>Q.getViewTranslations("newDevelopment")).value,W="add",ee=a.updateButton,le=a.addButton,x=f.params.id===W,oe=`/new-developments/${f.params.id}/photos`;let s,S,M="",c=U("");const y=U(!1),R=U(!1);let D="";const te=g(()=>q.getEmployeeOptions),se=g(()=>b.getSubregions),ae=g(()=>b.getCities),re=t=>{b.fetchCitiesBySubregionId(t)},ie=t=>{t.assignee=q.getEmployeeOptionByEmployeeId(t.assignee),t.features_new_development_type=Ce(t.features_new_development_type),t.province=b.getSubregionById(t.province_id),t.province_id&&b.fetchCitiesBySubregionId(t.province_id).then(l=>{l.status===200&&(t.town=b.getCityById(t.town_id))})};x?(s=P({...B.getNewDevelopment}),M=le):(R.value=!0,s=P({...B.getNewDevelopmentById(f.params.id)}),S=P([...w.getPropertiesByNewDevelopmentId(f.params.id)]),D=g(()=>{const t=S.map(l=>l.id);return w.getProperties.filter(l=>!t.includes(l.id)&&!l.new_development).map(l=>({code:l.id,label:l.title}))}),ie(s),M=ee);const i=g(()=>T.getValidationsMessages),v=g(()=>T.getCustomRegexValidators),ne=g(()=>ge()),p=Ae(ne,s),de=async t=>{if(p.value.$validate(),!p.value.$error){const l=ue(t);f.params.id==W?pe(l):me(l,S)}},ue=t=>{var o,_,V,A,m,F,G,X,Y,Z;let l={...t};return f.params.id==W&&(l.company=z.getEmployeeCompany,l.office=K.getCurrentOffice.id),l.assignee=(o=t.assignee)==null?void 0:o.code,l.features_new_development_type=(_=t.features_new_development_type)==null?void 0:_.code,l.province_id=(A=(V=t.province)==null?void 0:V.id)!=null?A:null,l.province=(F=(m=t.province)==null?void 0:m.name)!=null?F:null,l.town_id=(X=(G=t.town)==null?void 0:G.id)!=null?X:null,l.town=(Z=(Y=t.town)==null?void 0:Y.name)!=null?Z:null,l},pe=async t=>{y.value=!0,(await B.createNewDevelopment(t)).status===201?E.push("/new-developments"):y.value=!1},me=async(t,l)=>{y.value=!0,(await B.updateNewDevelopment(t,l)).status===200?ce(s,l):y.value=!1},ce=async(t,l)=>{const o=l.map(m=>m.id),_=w.getPropertiesByNewDevelopmentId(t.id).map(m=>m.id),V=o.filter(m=>!_.includes(m)),A=_.filter(m=>!o.includes(m));V.length>0&&await w.assignPropertiesToNewDevelopment(t.id,V),A.length>0&&await w.unassignPropertiesFromNewDevelopment(A),y.value=!1,E.push("/new-developments")};function ge(){return{new_building_reference:{maxLength:n.withMessage(i.value.reference,j(50))},features_new_development_name:{required:n.withMessage(i.value.required,$),alphaNumericWithSpacesAndSimbols:n.withMessage(i.value.alphaNumericWithSpacesAndSimbols,v.value.alphaNumericWithSpacesAndSimbols)},features_new_development_type:{required:n.withMessage(i.value.required,$),alphaNumericWithSpacesAndSimbols:n.withMessage(i.value.alphaNumericWithSpacesAndSimbols,v.value.alphaNumericWithSpacesAndSimbols)},street_name:{required:n.withMessage(i.value.required,$),alphaNumericWithSpacesAndSimbols:n.withMessage(i.value.alphaNumericWithSpacesAndSimbols,v.value.alphaNumericWithSpacesAndSimbols)},street_number:{alphaNumericWithSpacesAndSimbols:n.withMessage(i.value.alphaNumericWithSpacesAndSimbols,v.value.alphaNumericWithSpacesAndSimbols)},floor:{alphaNumericWithSpacesAndSimbols:n.withMessage(i.value.alphaNumericWithSpacesAndSimbols,v.value.alphaNumericWithSpacesAndSimbols)},stair:{alphaNumericWithSpacesAndSimbols:n.withMessage(i.value.alphaNumericWithSpacesAndSimbols,v.value.alphaNumericWithSpacesAndSimbols)},door:{alphaNumericWithSpacesAndSimbols:n.withMessage(i.value.alphaNumericWithSpacesAndSimbols,v.value.alphaNumericWithSpacesAndSimbols)},postal_code:{required:n.withMessage(i.value.required,$),numeric:n.withMessage(i.value.numeric,We),minLength:n.withMessage(i.value.postal_code,Me(5)),maxLength:n.withMessage(i.value.postal_code,j(5
1))}}}const he=()=>{if(c.value){const t=w.getPropertyById(c.value.code);S.push({...t}),c.value=""}},ve=t=>{S.splice(t,1)};return(t,l)=>(N(),I(Be,null,{default:h(()=>[r(Oe,null,{default:h(()=>[r(De,{icon:e(Te),title:e(a).title,main:""},{default:h(()=>[r(C,{to:"/new-developments",label:e(a).backButton,icon:e(qe),color:"info","rounded-full":"",small:""},null,8,["label","icon"])]),_:1},8,["icon","title"]),u("div",Ye,[R.value?(N(),L("div",Ze,[r(C,{to:oe,color:"info",label:e(a).photosButton,icon:e(xe),class:"mb-4"},null,8,["label","icon"])])):k("",!0)]),r(O,null,{default:h(()=>[u("div",je,[r(d,{modelValue:e(s).features_new_development_name,"onUpdate:modelValue":l[0]||(l[0]=o=>e(s).features_new_development_name=o),error:e(p).features_new_development_name.$errors,placeholder:e(a).newDevelopmentName,help:e(a).newDevelopmentName},null,8,["modelValue","error","placeholder","help"]),r(d,{modelValue:e(s).new_building_reference,"onUpdate:modelValue":l[1]||(l[1]=o=>e(s).new_building_reference=o),error:e(p).new_building_reference.$errors,placeholder:e(a).newBuildingReference,help:e(a).newBuildingReference},null,8,["modelValue","error","placeholder","help"])]),u("div",He,[r(d,{modelValue:e(s).features_new_development_type,"onUpdate:modelValue":l[2]||(l[2]=o=>e(s).features_new_development_type=o),type:"list",error:e(p).features_new_development_type.$errors,options:e(Re),help:e(a).newDevelopmentType,"no-empty-option":""},null,8,["modelValue","error","options","help"]),r(d,{modelValue:e(s).assignee,"onUpdate:modelValue":l[3]||(l[3]=o=>e(s).assignee=o),type:"list",help:e(a).responsible,options:e(te)},null,8,["modelValue","help","options"])])]),_:1}),r(O,{class:"mt-5"},{default:h(()=>[r(H,{title:e(a).address,class:"mb-12"},null,8,["title"]),u("div",Je,[u("div",null,[r(d,{modelValue:e(s).street_name,"onUpdate:modelValue":l[4]||(l[4]=o=>e(s).street_name=o),error:e(p).street_name.$errors,help:e(a).street,placeholder:e(a).street},null,8,["modelValue","error","help","placeholder"])]),u("div",null,[r(d,{modelValue:e(s).street_number,"onUpdate:modelValue":l[5]||(l[5]=o=>e(s).street_number=o),error:e(p).street_number.$errors,help:e(a).number,placeholder:e(a).number},null,8,["modelValue","error","help","placeholder"])]),u("div",null,[r(d,{modelValue:e(s).floor,"onUpdate:modelValue":l[6]||(l[6]=o=>e(s).floor=o),error:e(p).floor.$errors,help:e(a).floor,placeholder:e(a).floor},null,8,["modelValue","error","help","placeholder"])]),u("div",null,[r(d,{modelValue:e(s).door,"onUpdate:modelValue":l[7]||(l[7]=o=>e(s).door=o),error:e(p).door.$errors,help:e(a).door,placeholder:e(a).door},null,8,["modelValue","error","help","placeholder"])]),u("div",null,[r(d,{modelValue:e(s).stair,"onUpdate:modelValue":l[8]||(l[8]=o=>e(s).stair=o),error:e(p).stair.$errors,help:e(a).staircase,placeholder:e(a).staircase},null,8,["modelValue","error","help","placeholder"])])]),u("div",ze,[r(d,{modelValue:e(s).province,"onUpdate:modelValue":[l[9]||(l[9]=o=>e(s).province=o),l[10]||(l[10]=o=>re(o==null?void 0:o.id))],type:"list",options:e(se),help:e(a).province,searchable:""},null,8,["modelValue","options","help"]),r(d,{modelValue:e(s).town,"onUpdate:modelValue":l[11]||(l[11]=o=>e(s).town=o),type:"list",options:e(ae),help:e(a).town,searchable:""},null,8,["modelValue","options","help"]),r(d,{modelValue:e(s).postal_code,"onUpdate:modelValue":l[12]||(l[12]=o=>e(s).postal_code=o),error:e(p).postal_code.$errors,help:e(a).postalCode,placeholder:e(a).postalCode},null,8,["modelValue","error","help","placeholder"])])]),_:1}),x?k("",!0):(N(),I(O,{key:0,class:"mt-5"},{default:h(()=>[r(H,{title:e(a).properties,class:"mb-12"},null,8,["title"]),(N(!0),L(Pe,null,Ue(e(S),(o,_)=>(N(),L("div",{key:o.id,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 mb-4"},[u("p",null,Fe(o.title),1),r(J,null,{default:h(()=>[r(C,{color:"danger",icon:e(Ge),onClick:V=>ve(_)},null,8,["icon","onClick"])]),_:2},1024)]))),128)),e(D).length?(N(),I(Ie,{key:0})):k("",!0),u("div",Ke,[r(d,{modelValue:e(c),"onUpdate:modelValue":l[13]||(l[13]=o=>Le(c)?c.value=o:c=o),type:"list",options:e(D),"no-empty-option":"",searchable:""},null,8,["modelValue","options"]),r(J,null,{default:h(()=>[r(C,{color:"info",icon:e(Xe),disabled:!e(c),onClick:he},null,8,["icon","disabled"])]),_:1})])]),_:1})),r(d,{class:"mt-4","button-label":e(M),"button-color":"info",onClick:l[14]||(l[14]=o=>de(e(s)))},null,8,["button-label"]),r(ke,{active:y.value},null,8,["active"])]),_:1})]),_:1}))}};export{ll 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.