PageSourceSearch

https://app.homesberg.com/assets/GroupList-nOt8W0Fs.js

js homesberg.com collected 2026-09-25 03:13:11 UTC 6,686 bytes, 2 lines download raw bytes

1import{t as L,q as N,F as U,A as V,f as w,d as q,u as Z,o as f,c as P,Q,a as r,r as _,e as z,k as H,i as J,l as $,n as h,p as y,b as g,y as T,a4 as K,as as W,T as X,G as Y,w as R,V as ee,M as te,L as ae,I as oe,Z as se}from"./index-CH3E2DKz.js";import{r as re,b as le,u as ne}from"./index-DweXljlc.js";try{let l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new l.Error().stack;e&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[e]="fd09fac3-20c9-4767-8fde-42cf906785f5",l._sentryDebugIdIdentifier="sentry-dbid-fd09fac3-20c9-4767-8fde-42cf906785f5")}catch{}const ue=[{field:"name",header:L("name")},{field:"description",header:L("description")},{field:"listing_number",header:L("pricing.rateGroups.assignedListing")}],k=w(),I=w(!1),A=()=>{const l=N(),e=async()=>{if(!(I.value||k.value&&k.value.length>0))try{I.value=!0,k.value=(await V.getRateGroupsList({limit:1e4})).results}catch{l({type:"error",message:L("errors.gettingRateGroups")})}finally{I.value=!1}};return U(e),{isLoading:I,rateGroups:k,refetch:()=>{k.value=null,e()}}},ie=q({__name:"RateGroupDropdown",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(l){const{isLoading:e,rateGroups:b}=A(),v=Z(l,"modelValue");return(G,a)=>{const o=_("Select");return f(),P(o,Q({"input-id":"rate-groups",loading:r(e),"show-clear":!0,"option-value":"id","option-label":"name",options:r(b),placeholder:G.$t("dropdowns.rateGroupsDropdown"),class:"w-full","input-class":"w-full rounded-r-none",modelValue:v.value,"onUpdate:modelValue":a[0]||(a[0]=n=>v.value=n),virtualScrollerOptions:{itemSize:40}},G.$attrs,{filter:""}),null,16,["loading","options","placeholder","modelValue"])}}}),de={class:"grid mb-4"},ce={key:0,class:"grid mb-4"},pe={key:0,class:"text-red-500 mt-1"},me={key:1},fe={class:"grid mb-4"},ge={key:0,class:"text-red-500 mt-1"},ve={class:"grid mb-4"},Ge=q({__name:"GroupModal",setup(l){const{t:e}=z(),b=K("dialogRef"),v=N(),{refetch:G}=A(),a=w(null),o=w(""),n=w(null),p=w(!1),i=b.value.data.type==="edit",B=H(()=>({name:{required:re},selectedRateGroup:{required:le(()=>i)}})),s=ne(B,{name:o,selectedRateGroup:a}),M=async()=>{if(!await s.value.$validate()){v({type:"error",message:e("errors.fields")});return}try{p.value=!0;const d={name:o.value,description:n.value};i?await V.editRateGroup(Number(a.value),d):await V.createRateGroup(d),v({type:"success",message:e("pricing.rateGroups.rateGroupCreatedSuccess")}),b.value.close(),G()}catch{v({type:"error",message:e("pricing.rateGroups.rateGroupFailMessage")})}finally{p.value=!1}};return J(a,()=>{a.value&&V.getRateGroup(a.value).then(u=>{o.value=u.name,n.value=u.description})}),(u,d)=>{const D=_("InputText"),t=_("Textarea"),c=_("Button");return f(),$("form",de,[i?(f(),$("div",ce,[h("label",null,y(u.$t("pricing.rateGroups.selectRateGroup")),1),g(ie,{class:"w-full",modelValue:a.value,"onUpdate:modelValue":d[0]||(d[0]=m=>a.value=m),invalid:r(s).selectedRateGroup.$errors&&r(s).selectedRateGroup.$errors.length>0},null,8,["modelValue","invalid"]),r(s).selectedRateGroup.$errors&&r(s).selectedRateGroup.$errors.length>0?(f(),$("small",pe,y(r(s).selectedRateGroup.$errors[0].$message),1)):T("",!0)])):T("",!0),!i||a.value?(f(),$("div",me,[h("div",fe,[h("label",null,y(u.$t("name")),1),g(D,{label:"Name",class:"w-full",modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=m=>o.value=m),invalid:r(s).name.$errors&&r(s).name.$errors.length>0},null,8,["modelValue","invalid"]),r(s).name.$errors&&r(s).name.$errors.length>0?(f(),$("small",ge,y(r(s).name.$errors[0].$message),1)):T("",!0)]),h("div",ve,[h("label",null,y(u.$t("description")),1),g(t,{label:"Description",class:"w-full",modelValue:n.value,"onUpdate:modelValue":d[2]||(d[2]=m=>n.value=m),rows:"2",placeholder:u.$t("inputs.rateGroupDescriptionPlaceholder")},null,8,["modelValue","placeholder"])])])):T("",!0),g(c,{class:"w-full",label:i?u.$t("pricing.rateGroups.editRateGroupButton"):u.$t("pricing.rateGroups.createRateGroupButton"),loading:p.value,onClick:M},null,8,["label","loading"])])}}}),he={class:"flex flex-row-reverse gap-2"},ye={class:"flex flex-row-reverse"},we=20,Re=q({__name:"GroupList",setup(l){const{t:e}=z(),b=W(),v=se(),G=N(),a=X(),o=Y({search:"",offset:0}),n=w(!1),p=w(null),i=async()=>{try{n.value=!0,p.value=await V.getRateGroupsList({...o})}catch{G({type:"error",message:e("errors.gettingRateGroups")})}finally{n.value=!1}},B=async t=>{try{n.value=!0,await V.deleteRateGroup(t),G({type:"success",message:e("pricing.rateGroups.deleteSuccess")}),i()}catch{G({type:"error",message:e("errors.deleteRateGroup")})}finally{n.value=!1}},s=(t,c)=>{a.require({target:t.currentTarget,message:e("pricing.rateGroups.confirmDelete"),header:e("confirm"),icon:"pi pi-exclamation-triangle",rejectProps:{label:e("cancel"),severity:"secondary",outlined:!0},acceptProps:{label:e("delete")},accept:()=>B(c)})};U(i);const M=async({page:t})=>{o.offset=t*we,i()},u=({sortField:t,sortOrder:c})=>{c===0?o.ordering=void 0:o.ordering=`${c===1?"":"-"}${t}`,i()},d=t=>v.push(`/pricing/rate-groups/${t.data.id}`),D=t=>b.open(Ge,{data:{type:t},props:{header:e(t==="new"?"pricing.rateGroups.newRateGroup":"pricing.rateGroups.editRateGroup"),modal:!0,pt:{root:"w-[96vw] sm:w-[80vw] lg:w-[50vw]"},contentClass:"flex-1"},onClose:()=>i()});return(t,c)=>{const m=_("Button"),x=_("Column"),F=_("DataTable"),O=_("Card");return f(),P(O,{class:"grid w-full p-8 h-20rem",pt:{body:"overflow-auto"}},{header:R(()=>[h("div",he,[g(m,{icon:"pi pi-pen-to-square",label:t.$t("editGroupButton"),onClick:c[0]||(c[0]=S=>D("edit")),outlined:"",size:"small"},null,8,["label"]),g(m,{icon:"pi pi-plus",label:t.$t("newGroupButton"),onClick:c[1]||(c[1]=S=>D("new")),size:"small"},null,8,["label"])])]),content:R(()=>{var S,E;return[g(F,{"data-key":"id",first:o.offset,loading:n.value,rows:20,totalRecords:((S=p.value)==null?void 0:S.count)||0,value:(E=p.value)==null?void 0:E.results,onPage:M,onRowSelect:d,onSort:u,"removable-sort":"",rowGroupMode:"rowspan",lazy:"",paginator:"",selectionMode:"single",size:"small",sortMode:"single"},ee({header:R(()=>[h("h5",null,y(t.$t("pricing.rateGroups.title")),1)]),default:R(()=>[(f(!0),$(oe,null,ae(r(ue),C=>(f(),P(x,{key:C.field,field:C.field,header:C.header},null,8,["field","header"]))),128)),g(x,{header:""},{body:R(C=>[h("div",ye,[g(m,{icon:"pi pi-trash",text:"",rounded:"","aria-label":"Delete",severity:"danger",onClick:j=>s(j,C.data.id)},null,8,["onClick"])])]),_:1})]),_:2},[p.value?{name:"footer",fn:R(()=>[te(y(t.$t("totalRecords"))+": "+y(p.value.count),1)]),key:"0"}:void 0]),1032,["first","loading","totalRecords","value"])]}),_:1})}}});
1export{Re as default};
2//# sourceMappingURL=GroupList-nOt8W0Fs.js.map

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.