1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[414],{28897:(e,a,t)=>{"use strict";t.d(a,{A:()=>d});var s=t(37876);t(14232);var r=t(88992),n=t(39074),c=t(51826),o=t(21991),l=t(50154),i=t.n(l);let d=function(e){let{deleteConfig:a,updateConfig:t,formName:l}=e,{getValues:d,formState:{isSubmitting:u}}=(0,r.xW)(),m=d(),g=(0,n.A)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"".concat(i().footer__errors),children:[(0,s.jsx)(o.A,{errors:null==a?void 0:a.errors,className:"".concat(i().footer__error)}),(0,s.jsx)(o.A,{errors:null==t?void 0:t.errors,className:"".concat(i().footer__error)})]}),(0,s.jsx)("footer",{className:"".concat(i().footer),children:(0,s.jsxs)("div",{className:"".concat(i().footer__actions),children:[(0,s.jsx)(c.A,{className:"".concat(i().footer__action),label:"Save",type:"submit",dataEvent:"manager_portal_save_".concat(l),name:"save",disabled:u?"loading":void 0}),!!a&&"pms_bookings"!==g&&(0,s.jsx)(c.A,{type:"button",className:"".concat(i().footer__action),label:"Delete",onClick:()=>a.delete(m),dataEvent:"manager_portal_delete_".concat(l),name:"delete",ghost:"warning",disabled:a.deleting?"loading":void 0})]})})]})}},35336:(e,a,t)=>{"use strict";t.d(a,{A:()=>n}),t(14232);var s=t(88992),r=t(53174);let n=()=>{let{formState:{isSubmitSuccessful:e,isDirty:a}}=(0,s.xW)();return(0,r.y)({hasChanges:a,isSaved:e}),null}},54987:(e,a,t)=>{"use strict";t.d(a,{A:()=>n});var s=t(89099),r=t(99452);let n=()=>{var e;let a=(0,s.useRouter)(),{manager:t}=(0,r.z)()||{};return(null==t?void 0:t.activeCampground)?t.activeCampground:t&&(null==(e=a.query)?void 0:e.campground)&&t.campgrounds.find(e=>{let{slug:t}=e;return t===a.query.campground})||null}},68086:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/manager/campgrounds/[campground]/pricing/rates/[rate]",function(){return t(68776)}])},68776:(e,a,t)=>{"use strict";t.r(a),t.d(a,{__N_SSP:()=>b,default:()=>y});var s=t(37876);t(14232);var r=t(89099),n=t(74441),c=t.n(n),o=t(40606),l=t(54987),i=t(6998),d=t(35336),u=t(37823),m=t(39182),g=t(78745),_=t(78561),p=t(29906),h=t(61976),x=t(81197),v=t(75582),j=t(28897);let A=e=>{let{className:a,rate:t,allAccommodations:n,taxes:A,fees:f,accommodationIds:N}=e,b=(0,l.A)(),y=(0,r.useRouter)(),{updateRate:S,errors:C}=(0,v.A)(null==b?void 0:b.id,n,A,f),{deleteRecord:k,errors:w,loading:E}=(0,o.A)(),P=async e=>k(e,()=>{y.replace("/manager/campgrounds/".concat(y.query.campground,"/pricing/rates"))});return(0,s.jsxs)("div",{className:"".concat(a||""),children:[(0,s.jsx)(u.A,{title:"Edit Rate"}),(0,s.jsxs)(i.h,{onSubmit:async e=>{if(!c()(e))return await S({taxes:A,fees:f,accommodationIds:N,...e})},afterSubmit:()=>{y.push("/manager/campgrounds/".concat(null==b?void 0:b.slug,"/pricing/rates"))},formOptions:{defaultValues:{...t,taxes:A,fees:f,accommodationIds:N}},focusInputName:"basePrice",children:[(0,s.jsx)(h.A,{}),(0,s.jsx)(m.A,{}),(0,s.jsx)(_.A,{}),(0,s.jsx)(p.A,{}),(0,s.jsx)(g.A,{accommodations:n}),(0,s.jsx)(x.A,{}),(0,s.jsx)(d.A,{}),(0,s.jsx)(j.A,{updateConfig:{errors:C},deleteConfig:{delete:P,deleting:E,errors:w},formName:"site"})]})]})};var f=t(16165),N=t(96422),b=!0;let y=e=>{let{rate:a,allAccommodations:t,taxes:n,fees:c,accommodationIds:o}=e,l=(0,r.useRouter)();return(0,s.jsx)(f.A,{pageTitle:"Manager Prices | The Dyrt",content:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.A,{title:"Pricing",backLabel:"All Rates",backPath:"/manager/campgrounds/".concat(l.query.campground,"/pricing/rates")}),(0,s.jsx)(A,{rate:a,allAccommodations:t,taxes:n,fees:c,accommodationIds:o,className:"m-t-lg"})]})})}},78745:(e,a,t)=>{"use strict";t.d(a,{A:()=>d});var s=t(37876);t(14232);var r=t(88992),n=t(16973),c=t(18843),o=t(50154),l=t.n(o);let i="accommodationIds",d=e=>{let{className:a,accommodations:t}=e,{setValue:o}=(0,r.xW)(),d=(0,r.FH)({name:i})||[],u=e=>{o(i,e,{shouldDirty:!0})};return(0,s.jsxs)("section",{id:"sites",className:"".concat(l().section," ").concat(a||""),children:[(0,s.jsx)("h2",{className:l().section__title,children:"Select Sites"}),(0,s.jsx)("p",{className:l().section__description,children:"Select which Sites to apply the rule."}),(0,s.jsx)(c.A,{name:"all",label:"Select All",isChecked:d.length===t.length,onChange:e=>{e.target.checked?u(t.map(e=>{let{id:a}=e;return a})):u([])}}),(0,s.jsx)("div",{className:l().section__row,children:t.map(e=>{let a=d.includes(e.id);return(0,s.jsx)(n.A,{name:e.name,className:"".concat(l().section__column," ").concat(l()["section__column--is-1-2"]),label:"".concat(e.name),isChecked:a,category:"site-types",icon:e.category,onChange:()=>{a?u(d.filter(a=>a!==e.id)):u([...d,e.id])}},e.id)})})]})}}},e=>{e.O(0,[9469,4587,2867,8992,3814,9548,6215,7122,5419,7703,9160,636,6593,8792],()=>e(e.s=68086)),_N_E=e.O()}]); 2//# sourceMappingURL=[rate]-79efc072ff1c3355.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.