1define("HotelCommon/Components/guestSelector",["react/jsx-runtime","react","i18n!HotelCommon","HotelCommon/Common/Utils","HotelCommon/Common/Constants","Controls/scroll","Controls/popupTemplate","Controls/popup","Controls/dropdown","Controls/buttons","require","exports"],(function(e,t,n,o,l,i,s,a,d,r,c,u){var m,p,C,f;return Object.defineProperty(u,"__esModule",{value:!0}),m=function(e,t,n,o,l,i,s,a,d,r,c){"use strict";function u(e){return(0,n.jsxs)("div",{className:`tw-flex tw-items-center tw-justify-between controls-inlineheight-xl ${e.customClassName||""}`,children:[(0,n.jsx)("div",{children:`${e.additionFieldPrefix} ${e.index+1}`}),(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Selector,{emptyText:g,emptyKey:"0",source:x,selectedKeys:[e.value],keyProperty:"id",displayProperty:"title",menuPopupOptions:{maxHeight:350,width:200},fontColorStyle:"label",onSelectedKeysChanged:t=>{e.onSelectedKeyChanged(t,e.index)}}),(0,n.jsx)(l.Button,{viewMode:"link",className:"controls-margin_left-s",icon:"icon-Close",iconSize:"s",iconStyle:"unaccented",onClick:()=>{e.onRemoveChildren(e.index)}})]})]})}function m(e){return e.additionValue.map(((t,o)=>{const l=`additionAreaTemplate_${o}`;return(0,n.jsx)(u,{value:t,index:o,customClassName:e.customClassName,additionFieldPrefix:e.additionFieldPrefix,onSelectedKeyChanged:e.onSelectedKeyChanged,onRemoveChildren:e.onRemoveChildren},l)}))}function p(e){const t=e.value,o=e.additionField,i=e.readOnly||t===e.minCount,s=e.readOnly||t===e.maxCount,a={iconStyle:"default",buttonStyle:"default",viewMode:"filled"},d=(t,n,l)=>{let i=[];if(e.additionFieldName){const e=[...o];if(n)e.push("0");else if(void 0!==l)e.splice(l,1);else e.pop();i=e}e.setGuestObject({[e.propName]:t,...e.additionFieldName?{[e.additionFieldName]:i}:{}})};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:`tw-flex tw-items-center tw-justify-between ${e.customClassName||""}`,children:[(0,n.jsx)("div",{className:"controls-fontsize-xl",children:e.title}),(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-justify-between",children:[(0,n.jsx)(l.Button,{...a,icon:"icon-Subtraction",inlineHeight:"m",iconSize:"m",viewM
1ode:"filled-same",iconStyle:i?"unaccented":"default",buttonStyle:i?"default":"unaccented",readOnly:i,onClick:()=>d(t-1,!1)}),(0,n.jsx)("div",{className:"controls-padding_left-xs controls-padding_right-xs controls-fontsize-xl",children:t}),(0,n.jsx)(l.Button,{...a,icon:"icon-RoundPlus",inlineHeight:"m",iconSize:"m",viewMode:"filled-same",iconStyle:s?"unaccented":"default",buttonStyle:s?"default":"unaccented",readOnly:s,onClick:()=>d(t+1,!0)})]})]}),e.additionFieldName&&(null==o?void 0:o.length)&&t?(0,n.jsx)(m,{additionValue:o,additionFieldPrefix:e.additionFieldPrefix,customClassName:e.customClassName,onSelectedKeyChanged:(t,n)=>{o.splice(n,1,t),e.setGuestObject({[e.additionFieldName]:[...o]})},onRemoveChildren:e=>d(t-1,!1,e)}):null]})}function C(e){return(0,n.jsxs)("div",{className:"tw-flex tw-flex-col tw-min-h-0 controls-padding_top-m controls-padding_bottom-m controls-margin_bottom-s \n "+(e.index>0?"hsw-border-separator":""),children:[e.roomsCount>1?(0,n.jsxs)("div",{className:"tw-flex tw-justify-between tw-items-center controls-inlineheight-xl controls-margin_bottom-s",children:[(0,n.jsxs)("div",{className:"controls-text-unaccented controls-fontsize-xl",children:[e.index+1," ",c("номеÑ","room")]}),(0,n.jsx)(l.Button,{icon:"icon-Delete02",iconSize:"s",viewMode:"link",iconStyle:"danger",onClick:()=>{e.onRemoveRoom(e.index)}})]}):null,(0,n.jsx)(p,{title:c("ÐзÑоÑлÑе"),propName:"adultCount",value:e.itemData.adultCount,minCount:1,maxCount:20,setGuestObject:e.setGuestObject}),(0,n.jsx)(p,{customClassName:"controls-margin_top-s",title:c("ÐеÑи"),propName:"babyCount",additionField:e.itemData.childrenAges,additionFieldName:"childrenAges",additionFieldPrefix:c("Ребенок"),value:e.itemData.babyCount,minCount:0,maxCount:20,setGuestObject:e.setGuestObject})]})}function f(e){return e.guestObject.map(((t,o)=>{var l;const i=`roomBlockTemplate_${o}`;return(0,n.jsx)(C,{index:o,roomsCount:null===(l=e.guestObject)||void 0===l?void 0:l.length,itemData:t,setGuestObject:t=>e.setGuestObject(t,o),onRemoveRoom:e.onRemoveRoom},i)}))}function b(e){const[t,l]=(0,o.useState)(e.guestData);return(0,n.jsx)("div",{className:`${e.className} controls-padding_top-2xs controls_border-radius-l tw-flex tw-flex-col tw-min-h-0`,children:(0,n.jsx)(r.Container,{className:"tw-h-full controls_border-radius-l",children:(0,n.jsx)("div",{className:"controls-padding_left-s controls-padding_right-s",children:(0,n.jsx)("div",{className:"hsw-BookingPopup__body controls-padding_left-m controls-padding_right-m controls-background-default controls_border-radius-s",children:(0,n.jsx)(f,{guestObject:t,setGuestObject:(t,n)=>{l((o=>{var l;const i=[...o];return i[n]={...i[n],...t},null===(l=e.changedDataCallback)||void 0===l||l.call(e,i),i}))},onRemoveRoom:e=>{l((t=>{const n=[...t];return n.splice(e,1),n}))}})})})})})}Object.defineProperty(t,"__esModule",{value:!0}),t.GuestContentTemplate=t.DEFAULT_ROOM=void 0;const g=c("Ðенее года"),x=(0,s.createNumberListSource)(a.commonConstants.MAX_BABY_GUEST_AGE-1,!1,!0,{value:"0",title:g});return t.DEFAULT_ROOM={adultCount:2,babyCount:0,childrenAges:[]},t.GuestContentTemplate=b,t.default=(0,o.memo)((0,o.forwardRef)((function(e,t){const[l,s]=(0,o.useState)(e.guestData);return(0,n.jsx)(i.Dialog,{ref:t,...e,headerBackgroundStyle:"unaccented",backgroundStyle:"unaccented",className:"controls-padding_top-3xs",headingFontSize:"4xl",headingCaption:(0,n.jsx)("div",{className:"controls-padding_left-s",children:c("РазмеÑение")}),closeButtonViewMode:"externalWide",closeButtonVisible:!0,applyButtonVisible:!0,applyButtonCallback:()=>{null==e||e.applyDataCallback(l),null==e||e.onClose()},bodyContentTemplate:(0,n.jsx)(b,{...e,className:`${e.className} controls-background-unaccented`,guestData:e.guestData,changedDataCallback:s})})}))),t}(0,{},e,t,r,s,o,l,d,i,n),p=m,C=function(e,t,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openGuestPanel=t.getGuestCaption=void 0;t.getGuestCaption=(e,t=!1)=>{const n=e.reduce(((e,t,n)=>({adultCount:(e.adultCount||0)+t.adultCount,babyCount:(e.babyCount||0)+t.babyCount,roomsCount:n+1})),0),l=n.adultCount,i=n.babyCount;if(t)return i?`${l+i}`:`${l}`;else return`${l} ${o("взÑоÑлÑй(-ÑÑ
, -ÑÑ
)","StickyCounter",l)}${i?`, ${i} ${o("Ñебенок(-а, -ей)","StickyCounter",i)}`:""}`};return t.openGuestPanel=async(e,t,o)=>{const l=o||new n.StickyOpener;await l.open({template:"HotelCommon/Components/guestSelector:GuestDialogTemplate",allowAdaptive:!0,closeOnOutsideClick:!0,target:e.currentTarget,width:300,maxHeight:430,opener:null,actionOnScroll:"close",offset:t.offset,direction:t.direction,templateOptions:{guestData:t.guestData,shadowVisible:!0,footerBorderVisible:!1,
1closeButtonVisible:!1,headerContentTemplate:null,applyDataCallback:t.setGuestData,onClose:()=>l.close()}})},t}(0,{},a,n),f=C,u.openGuestPanel=u.getGuestCaption=u.DEFAULT_ROOM=u.GuestContentTemplate=u.GuestDialogTemplate=void 0,Object.defineProperty(u,"GuestDialogTemplate",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(u,"GuestContentTemplate",{enumerable:!0,get:function(){return p.GuestContentTemplate}}),Object.defineProperty(u,"DEFAULT_ROOM",{enumerable:!0,get:function(){return p.DEFAULT_ROOM}}),Object.defineProperty(u,"getGuestCaption",{enumerable:!0,get:function(){return f.getGuestCaption}}),Object.defineProperty(u,"openGuestPanel",{enumerable:!0,get:function(){return f.openGuestPanel}}),u}));
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.