1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5361],{13258:function(e,n,o){"use strict";o.d(n,{Z:function(){return _}});var t=o(87462),i=o(45987),r=o(67294),d=o(86010),a=o(56608),l=o(63786),c=(0,l.Z)(r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),s=(0,l.Z)(r.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),u=o(59693),v=(0,l.Z)(r.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox"),p=o(93871),m=o(14670),h=r.createElement(s,null),f=r.createElement(c,null),b=r.createElement(v,null),y=r.forwardRef((function(e,n){var o=e.checkedIcon,l=void 0===o?h:o,c=e.classes,s=e.color,u=void 0===s?"secondary":s,v=e.icon,m=void 0===v?f:v,y=e.indeterminate,_=void 0!==y&&y,k=e.indeterminateIcon,g=void 0===k?b:k,w=e.inputProps,E=e.size,O=void 0===E?"medium":E,S=(0,i.Z)(e,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),Z=_?g:m,P=_?g:l;return r.createElement(a.Z,(0,t.Z)({type:"checkbox",classes:{root:(0,d.Z)(c.root,c["color".concat((0,p.Z)(u))],_&&c.indeterminate),checked:c.checked,disabled:c.disabled},color:u,inputProps:(0,t.Z)({"data-indeterminate":_},w),icon:r.cloneElement(Z,{fontSize:void 0===Z.props.fontSize&&"small"===O?O:Z.props.fontSize}),checkedIcon:r.cloneElement(P,{fontSize:void 0===P.props.fontSize&&"small"===O?O:P.props.fontSize}),ref:n},S))})),_=(0,m.Z)((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,u.Fq)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,u.Fq)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiCheckbox"})(y)},31189:function(e,n,o){"use strict";o.r(n),o.d(n,{__N_SSP:function(){return C}});var t=o(92809),i=o(67294),r=o(21235),d=o(19501),a=o(94649),l=o(11163),c=o(37703),s=o(11177),u=o(62072),v=o(35804),p=o(17586),m=o(31669),h=o(25739),f=o(54039),b=o(5152),y=o(66188),_=o(94290),k=o(30114),g=o(33944),w=o(85893);function E(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,t)}return o}function O(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?E(Object(o),!0).forEach((function(n){(0,t.Z)(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):E(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}const S=(0,b.default)((()=>o.e(8113).then(o.bind(o,8113))),{loadableGenerated:{webpack:()=>[8113],modules:["[city]/account/delivery/[id].tsx -> @/components/Account/AccountPageWrapper"]}}),Z=(0,b.default)((()=>o.e(6929).then(o.bind(o,26929))),{loadableGenerated:{webpack:()=>[26929],modules:["[city]/account/delivery/[id].tsx -> @/components/Core/Header/GoBack"]}}),P=(0,b.default)((()=>Promise.resolve().then(o.bind(o,85561))),{loadableGenerated:{webpack:()=>[85561],modules:["[city]/account/delivery/[id].tsx -> @/components/Core/Spinner/Spinner"]}}),j=(0,b.default)((()=>o.e(7062).then(o.bind(o,57062))),{loadableGenerated:{webpack:()=>[57062],modules:["[city]/account/delivery/[id].tsx -> @/components/Core/EmptyData"]}}),x=["places"];var C=!0;n.default=function(e){var n,o,t,b,E,C;const{id:$}=e,A=(0,l.useRouter)(),N=(0,c.I0)(),{t:z,i18n:I}=(0,h.$G)(),R=(0,g.S7)(),G=(0,g.gk)(),q=A.query.id||$||"",D=(0,c.v9)(v.np),F=(0,c.v9)(y.wF),H=(0,c.v9)(y.oJ),{0:M,1:L}=(0,i.useState)(),{0:V,1:B}=(0,i.useState)(!1);(0,i.useEffect)((()=>{V&&L((0,_.t)()),"new"===q&&X.resetForm()}),[V]);const T=d.Ry({user_address:d.Ry({street:"zelenograd"===(null===F||void 0===F?void 0:F.slug)?d.Z_():d.Z_().required(z("common:validations.is_required")),house:null!==H&&void 0!==H&&null!==(n=H.env)&&void 0!==n&&n.ADDRESS_AS_ONE_STRING?d.Z_():d.Z_().required(z("common:validations.is_required")),apartment:d.Z_(),intercom:d.Z_(),entrance:d.Z_(),city:d.Z_().nullable(),address:d.Z_().nullable(),businessRegionId:d.Z_().nullable(),floor:d.Z_(),name:d.Z_().nullable(),type:d.Z_()})}),X=(0,a.TA)({initialValues:{user_address:{street:"",house:"",apartment:"",intercom:"",entrance:"",city:"",businessRegionId:null===F||void 0===F?void 0:F.id,floor:"",name:"",office:"",type:"apartment"}}
1,validateOnChange:!0,validationSchema:T,onSubmit:async e=>{let n;const o=(null===D||void 0===D?void 0:D.addresses)||[],{city:t,street:i,house:r,apartment:d,entrance:a,floor:l,intercom:c}=null===e||void 0===e?void 0:e.user_address,s=O(O({},null===e||void 0===e?void 0:e.user_address),{},{address:`${t}, ${i} ${r},${d&&` \u043a\u0432. ${d},`}${a&&` \u043f. ${a},`}${l&&` \u044d\u0442. ${l},`}${c&&` \u0434\u043c\u0444. ${c}`}`});n=N("new"===q?(0,p.$X)(null===D||void 0===D?void 0:D.id,{addAddress:s},o):(0,p.$X)(null===D||void 0===D?void 0:D.id,{updateAddress:s},o)),await n,window.location.href=G("/account/delivery")}}),K="path"===(0,g.FH)()?"/[city]/account/delivery":"/account/delivery",W=R("/account/delivery"),Y=(0,w.jsxs)("div",{className:"account-delivery-page",children:[(0,w.jsx)(s.default,{children:(0,w.jsx)(Z,{title:z("deliveryAddress:back_to_addresses"),href:K,asPath:W,noPadding:!0})}),(0,w.jsx)(u.default,{children:(0,w.jsx)(Z,{title:z("deliveryAddress:back_to_addresses"),href:K,asPath:W,noPadding:!0})}),(0,w.jsx)("form",{onSubmit:X.handleSubmit,autoComplete:"off",children:(0,w.jsx)(r.Z,{formik:X,id:q,refreshSessionToken:()=>L((0,_.t)()),sessionToken:M})})]});return(0,w.jsxs)(S,{children:[(0,w.jsx)(m.default,{title:z("new"===q?"deliveryAddress:add_new":"deliveryAddress:edit_address"),hideFromRobots:!0}),("new"===(null===q||void 0===q?void 0:q.toLowerCase())||(null===D||void 0===D||null===(o=D.addresses)||void 0===o?void 0:o.some((e=>(null===e||void 0===e?void 0:e.id)===q))))&&(0,w.jsxs)(w.Fragment,{children:[(null===H||void 0===H||null===(t=H.env)||void 0===t?void 0:t.MAP_SERVICE)===(null===k.N||void 0===k.N?void 0:k.N.GOOGLE)&&(0,w.jsx)(f.ZP,{googleMapsApiKey:null===H||void 0===H||null===(b=H.env)||void 0===b?void 0:b.GOOGLE_MAPS_API_KEY_BROWSER,language:null===I||void 0===I?void 0:I.language,libraries:x,loadingElement:(0,w.jsx)(P,{minHeight:200}),onLoad:()=>B(!0),children:V&&Y}),(null===H||void 0===H||null===(E=H.env)||void 0===E?void 0:E.MAP_SERVICE)===(null===k.N||void 0===k.N?void 0:k.N.YANDEX)&&Y]}),A.query.id&&"new"!==(null===q||void 0===q?void 0:q.toLowerCase())&&!(null!==D&&void 0!==D&&null!==(C=D.addresses)&&void 0!==C&&C.some((e=>(null===e||void 0===e?void 0:e.id)===q)))&&(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(j,{showCta:!1})})]})}},88451:function(e,n,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[city]/account/delivery/[id]",function(){return o(31189)}])}},function(e){e.O(0,[1255,9351,4314,635,1548,9501,8286,9015,7345,9774,2888,179],(function(){return n=88451,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.