1"use strict";(self.webpackChunke_trade_react=self.webpackChunke_trade_react||[]).push([[8241],{88241:function(e,t,r){r.r(t),r.d(t,{default:function(){return k}});var n=r(67958),l=r(87401),a=r(76082),m=r(74220),i=r(20596),c=r(50522),o=r(76740),d=r(24628),s=r(81631),p=r(34087),u=r(32022),_=r.n(u),E=r(22125),y=r(98348),f=r(82174),h=r(85561),x=r(17317),g=r(47957),v=r.n(g);const Z=(0,a.Z)((e=>({root:{alignItems:"flex-start"},previewText:{background:"#319cca",color:"#fff",padding:"15px",borderRadius:"4px",margin:"0 0 15px","& h2":{margin:"0"},"& h6":{margin:"10px 0 0 0"}},yourOrderDataHolder:{},yourOrderTextHolder:{padding:"15px",background:"#fff",borderRadius:"4px"},orderOptionHolder:{margin:"0 0 15px",padding:"15px",borderRadius:"4px",background:"#fff","& p":{margin:"10px 0"}},orderItemsHolder:{padding:"15px",border:"1px solid #ddd",boxShadow:"grey 0px 2px 3px",borderRadius:"4px"},caption:{width:"100%"},orderItems:{borderBottom:"1px solid #ddd",margin:"0 0 10px"},redirectHomePage:{color:"#fff",borderRadius:"2px",backgroundColor:"#ec462e"},imgContainer:{display:"flex",justifyContent:"center",alignItems:"center","& img":{height:"70px"}}}))),w=e=>{const t=Z(),{createOrder:r,languageReducer:a,authentication:m,shoppingCartOrderItem:u,getCurrentPreOrderById:E,currentPreOrderById:x,session:g,customer_id:w,sell_currency_id:b,user:N}=e;(0,s.Uj)();const[k,O]=l.useState(),[I,C]=l.useState(),[S,P]=l.useState(JSON.parse(localStorage.getItem("otherOrderOptionData"))),[R,H]=l.useState(),[T,B]=l.useState(!1),[D,$]=l.useState(),A=document.createElement("script"),L=document.createElement("script"),{t:U}=(0,i.$)();let j={session_key:g.key,customer_id:w,currency_id:b,pre_order_id:k,change_author_manager_id:N&&N.manager_by_user&&N.manager_by_user.id};(0,l.useEffect)((()=>{1===window.performance.navigation.type&&window.location.replace("/profile/orders")}),[]),(0,l.useEffect)((()=>{k&&E(j)}),[k]),(0,l.useEffect)((()=>{C(x&&x.result)}),[x]),(0,l.useEffect)((()=>{if(r&&"ok"===r.result&&r.order.id)O(r.order.id);else{let e=d.m8.location.pathname.split("/").pop();O(e)}}),[r]);let M=0;(0,l.useEffect)((()=>{x.result&&x.result.items.all.map(((e,t)=>{M+=e.price_current_sum*e.quantity,H(M)})),x&&x.result&&P(x.result.order_delivery_data.other_order_options)}),[x]),(0,l.useEffect)((()=>{D&&(A.onload=()=>{(void 0).loadClientWhenGapiReady(A)},A.insertAdjacentText("afterbegin",D),L.src="https://apis.google.com/js/platform.js?onload=renderOptIn",document.body.appendChild(L),document.body.appendChild(A))}),[D]),(0,l.useEffect)((()=>{let e;if(x&&void 0!==x.result&&void 0!==k){let t=_()(x.result.order_created).format("YYYY-MM-DD"),r=[];x.result.items.all.map(((e,t)=>{e.barcodes&&e.barcodes.length>0&&r.push(`{"gtin":"${e.barcodes}"}`)}));let n=v()(x.result,"order_delivery_data.other_order_options.recipient_email","");e=`\n window.renderOptIn = function() {\n window.gapi.load('surveyoptin', function() {\n window.gapi.surveyoptin.render(\n {\n "merchant_id": '5355565779',\n "order_id": '${x.result.order_id}',\n "email": '${n}',\n "delivery_country": 'UA',\n "estimated_delivery_date": '${t}',\n "products":[${r}],\n });\n });\n }`,$(e)}}),[x]),(0,l.useEffect)((()=>{if(!T&&S&&S.recipient_email){let e=document.getElementById("htmlMarkup"),t="VBavto",r=S&&S.recipient_email,n="ÐÑкÑÑмо за ваÑе Ð·Ð°Ð¼Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ñ ÐºÐ¾Ð¼Ð¿Ð°Ð½ÑÑ Â«VBavto â вÑÑ Ð°Ð²ÑозапÑаÑÑини в Ð¾Ð´Ð½Ð¾Ð¼Ñ Ð¼Ð°Ð³Ð°Ð·Ð¸Ð½Ñ»";e&&e.outerHTML;x&&!1===x.loading&&setTimeout((function(){let l=e&&e.outerHTML;Y(l,t,r,n)}),2e3)}}),[T,S,x,document]);const Y=(e,t,r,n)=>{h.Z.post("/shopping-cart/send-pdf-to-email/",JSON.stringify({html_for_pdf:e,email_html_message:e,email:r,email_subject:n,email_message:"VBavto"})).then((e=>{B(e.data.result)})).catch((e=>{}))};(0,l.useEffect)((()=>{(x&&x.result&&w!==x.result.order_delivery_data.other_order_options.recipient_id||u.error)&&d.m8.push("ru"===a.ln_ch?`/${a.ln_ch}/profile/orders`:"/profile/orders")}),[x,w]);const z="to_warehouse"===S.type?U("common:department"):"to_parsel_automat"===S.type?U("common:Postmate"):U("common:Street"),W=[{name:U("common:Service"),field:"serviceName"},{name:U("common:Delivery type"),field:S.area?"typeName":""},{name:U("common:Area"),field:S.area?"areaName":""},{name:U("common:city"),field:S.area?"cityName":""},{name:z,field:S.area?"divisionName":""},{name:U("common:House"),field:S.area?"house":""}],q=[{name:"",field:"recipient_type_name"},{name:U("common:Surname"),field:"p"===S.recipient_type?"recipient_last_name":""},{name:U("common:Name"),field:"p"===S.recipient_type?"recipient_first_name":""},{name:U("common:Middle Name"),field:"p"===S.recipient_type?"recipient_meddle_name":""},{name:U("common:Phone"),field:"recipient_phone1"},{name:U("common:Phone"),field:"recipient_phone2"},{name:U("common:Organization"),field:"c"===S.recipient_type?"recipient_organization":""},{name:U("common:EDRPOU"),field:"c"===S.recipient_type?"recipient_edrpo":""}];return l.createElement("div",null,x&&x.result&&x.result.order_delivery_data&&x.result.order_delivery_data.other_order_options.recipient_id?l.createElement("div",null,l.createElement("h3",{style:{textAlign:"center"}},U("common:Thank_you_for_your_purchase"),"!"),l.createElement("div",{className:t.previewText},l.createElement("h2",null,U("common:You_have_successfully_completed_your_purchase"))),l.createElement(y.Z,{container:!0,xs:12,className:(0,
1c.default)(t.root,"thanks_message_holder")},l.createElement(y.Z,{container:!0,xs:12,md:8,className:t.yourOrderDataHolder,"aria-label":"your_order_data"},x&&x.result&&l.createElement(y.Z,{container:!0,item:!0,xs:12,md:11,className:t.orderOptionHolder},l.createElement(y.Z,{container:!0,xs:12,className:t.caption,style:{display:"flex",alignItems:"center",margin:"0 0 15px",borderBottom:"1px solid #ddd"}},l.createElement(y.Z,{container:!0,item:!0,xs:8,md:10,style:{display:"flex",alignItems:"center"}},l.createElement(y.Z,{item:!0,xs:12,md:6},l.createElement("h3",{style:{margin:"10px 0",padding:"0 5px 0 0"}},U("common:Your_order"))),l.createElement(y.Z,{item:!0,xs:12,md:6},l.createElement("p",{style:{margin:"0"}},U("common:of_goods"),": ",x.result.items.all.length))),l.createElement(y.Z,{item:!0,xs:4,md:2,style:{textAlign:"right"}},l.createElement("strong",{style:{fontSize:"18px"}},x.result.price_sum_all," гÑн"))),x.result.items.all.map(((e,r)=>l.createElement(y.Z,{container:!0,item:!0,xs:12,className:t.orderItems},l.createElement(y.Z,{item:!0,xs:12,md:2,className:t.imgContainer},l.createElement("img",{src:e.art_photos})),l.createElement(y.Z,{item:!0,xs:12,md:8},l.createElement(f.Z,{variant:"subtitle1",className:"description"},e.brand," ",e.name," ",e.article),l.createElement(f.Z,{variant:"subtitle1",className:"description"},e.quantity," x ",e.price_current," гÑн")),l.createElement(y.Z,{item:!0,xs:12,md:2},l.createElement("strong",null,e.price_current_sum)," гÑн"))))),l.createElement(y.Z,{item:!0,xs:12,md:11,className:t.orderOptionHolder},l.createElement("div",{className:t.caption},l.createElement("h3",null,U("common:Delivery"))),S&&S.version?l.createElement(y.Z,{item:!0,container:!0,xs:12},W.map(((e,t)=>""===e.field||""===S[e.field]?null:"serviceName"===e.field?l.createElement(y.Z,{item:!0,container:!0,xs:12,key:t},l.createElement("p",null,S[e.field].toUpperCase())):l.createElement(y.Z,{item:!0,container:!0,xs:12,key:t},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,e.name,":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S[e.field])))))):l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:12},"delivery_service"===S.delivery_type?l.createElement("div",null,l.createElement("p",null,U("common:Courier_service"),": ",S.delivery_service_name),l.createElement("p",null,U("common:city"),": ",S.delivery_city_full_name),l.createElement("p",null,S.delivery_department_name)):"delivery_address"===S.delivery_type?l.createElement("div",null,l.createElement("p",null,U("common:Courier_service"),": ",S.delivery_service_name),l.createElement("p",null,U("common:city"),": ",S.delivery_city_full_name),l.createElement("p",null,U("common:Street"),": ",S.delivery_street_name),l.createElement("p",null,U("common:House"),": ",S.delivery_house),l.createElement("p",null,U("common:Apartment"),": ",S.delivery_apartment)):l.createElement("div",null,l.createElement("p",null,U("common:Pickup")))))),l.createElement(y.Z,{item:!0,xs:12,md:11,className:t.orderOptionHolder},l.createElement("div",{className:t.caption},l.createElement("h3",null,U("common:Payment"))),l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:12},S&&"card"===S.payment?l.createElement("p",null,U("common:To_a_bank_card")):S&&"cashless_for_individuals"===S.payment?l.createElement("div",null,l.createElement("p",null,U("common:Cashless_for_individuals")),l.createElement("p",null,U("common:Payment_for_individuals"))):l.createElement("p",null,U("common:Payment_upon_receipt_of_goods"))))),l.createElement(y.Z,{item:!0,xs:12,md:11,className:t.orderOptionHolder},l.createElement("div",{className:t.caption},l.createElement("h3",null,U("common:Buyer_data"))),S&&S.version?l.createElement(y.Z,{container:!0,xs:12},l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,U("common:Name"),":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S.customer_first_name))),l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,U("common:Surname"),":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S.customer_last_name))),l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,U("common:Phone"),":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S.customer_phone))),l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,U("common:Email"),":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S.customer_email)))):l.createElement(y.Z,{container:!0,xs:12},l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,U("common:Name"),":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S.recipient_first_name_scheduled_delivery))),l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,U("common:Surname"),":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S.recipient_last_name_scheduled_delivery))),l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,U("common:Phone"),":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S.recipient_phone))),l.createElement(y.Z,{item:!0,container:!0,xs:12},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,U("common:Email"),":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S.recipient_email))))),l.createElement(y.Z,{item:!0,xs:12,md:11,className:t.orderOptionHolder},l.createElement("div",{className:t.caption},l.createElement("h3",null,U("common:Recipient data"))),S&&S.version&&l.createElement(y.Z,{item:!0,container:!0,xs:12},q.map(((e,t)=>""===e.field||""===S[e.field]?null:"recipient_type_name"===e.field?l.createElement(y.Z,{item:!0,container:!0,xs:12,key:t},l.createElement("p",null,S[e.field].toUpperCase())):l.createElement(y.Z,{item:!0,container:!0,xs:12,key:t},l.createElement(y.Z,{item:!0,xs:5},l.createElement("p",null,e.name,":")),l.createElement(y.Z,{item:!0,xs:7},l.createElement("p",null,S[e.field]))))))),l.createElement(y.Z,{container:!0,xs:12,md:11},l.createElement(n.Z,{fullWidth:!0,xs:12,md:11,"aria-label":"redirect-home-page",component:o.Z,className:(0,
1c.default)(t.redirectHomePage,"redirectHomePage"),to:"ru"===a.ln_ch?`/${a.ln_ch}/`:"/"},U("common:CONTINUE_PURCHASES")))),l.createElement(y.Z,{container:!0,xs:12,md:4,className:t.yourOrderTextHolder},l.createElement(y.Z,{item:!0,sx:12},m.loggedIn?l.createElement("p",null,U("common:Thank_you_your_order")," â ",x.result.order_id," ",U("common:successfully_completed"),". ",U("common:In_the_near_future1"),l.createElement(p.Z,{"aria-label":"Thank_you_your_order",component:o.Z,to:"ru"===a.ln_ch?`/${a.ln_ch}/profile/orders`:"/profile/orders"}," ",U("common:personal_office"),".")):l.createElement("p",null,U("common:Thank_you_your_order")," â ",x.result.order_id," ",U("common:successfully_completed"),". ",U("common:In_the_near_future2"))))),l.createElement("div",{style:{height:"0",overflow:"hidden",pointerEvent:"none"}},l.createElement("div",{id:"htmlMarkup",style:{width:"100%",background:"#eee"}},l.createElement("div",{style:{padding:"20px",width:"700px",margin:"0 auto"}},l.createElement("h3",{style:{textAlign:"center"}},U("common:Thank_you_for_your_purchase"),"!"),l.createElement("div",{style:{background:"#319cca",color:"#fff",padding:"15px",borderRadius:"4px",margin:"0 0 15px",textAlign:"center"}},l.createElement("h2",{style:{margin:"0",fontSize:window.innerWidth<600?"18px":"20px"}},U("common:You_have_successfully_completed_your_purchase"))),l.createElement("div",null,l.createElement("div",{style:{width:"100%",margin:"0 0 15px"}},l.createElement("div",{style:{background:"#fff",padding:"15px",boderRadius:"4px"}},m.loggedIn?l.createElement("p",null,U("common:Thank_you_your_order")," â ",x.result.order_id," ",U("common:successfully_completed"),". ",U("common:In_the_near_future1"),l.createElement("a",{"aria-label":"Thank_you_your_order",href:"ru"===a.ln_ch?`vbavto.ua/${a.ln_ch}/profile/orders`:"vbavto.ua/profile/orders"}," ",U("common:personal_office"),".")):l.createElement("p",null,U("common:Thank_you_your_order")," â ",x.result.order_id," ",U("common:successfully_completed"),". ",U("common:In_the_near_future2")))),l.createElement("div",{style:{width:"100%"}},l.createElement("div",null,l.createElement("div",null,x&&x.result&&x.result.items.all.length>0&&l.createElement("div",{style:{margin:"0 0 15px",padding:"15px",borderRadius:"4px",background:"#fff"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",margin:"0 0 15px",borderBottom:"1px solid #ddd"}},l.createElement("div",{style:{display:"flex",alignItems:"center",width:"75%"}},l.createElement("div",{style:{width:"50%"}},l.createElement("h3",{style:{margin:"0",padding:"0 5px 0 0",fontSize:"16px"}},U("common:Your_order"))),l.createElement("div",{style:{display:"flex",alignItems:"center",width:"50%"}},l.createElement("p",{style:{margin:"0"}},U("common:of_goods"),": ",x.result.items.all.length))),l.createElement("div",{style:{textAlign:"right",width:"25%"}},l.createElement("strong",{style:{fontSize:"18px"}},x.result.price_sum_all," гÑн"))),x.result.items.all.map(((e,t)=>l.createElement("div",{style:{borderBottom:"1px solid #ddd",margin:"0 0 10px",display:"flex"}},l.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"20%",flexWrap:"wrap",overflow:"hidden"}},l.createElement("img",{src:e.art_photos,style:{height:"70px"}})),l.createElement("div",{style:{width:"60%"}},l.createElement("p",null,e.brand," ",e.name," ",e.article),l.createElement("p",null,e.quantity," x ",e.price_current," гÑн")),l.createElement("div",{style:{width:"20%",display:"flex",marginTop:"15px",paddingLeft:"20px"}},l.createElement("strong",{style:{paddingRight:"10px"}},e.price_current_sum)," гÑн"))))),l.createElement("div",{style:{margin:"0 0 15px",padding:"15px",borderRadius:"4px",background:"#fff"}},l.createElement("div",{className:t.caption},l.createElement("h3",null,U("common:Delivery"))),S&&l.createElement("div",null,W.map(((e,t)=>""===e.field||""===S[e.field]?null:"serviceName"===e.field?l.createElement("div",{style:{display:"flex",width:"100%"}},l.createElement("div",{style:{width:"99%"}},l.createElement("p",null,l.createElement("b",null,S[e.field])))):l.createElement("div",{style:{display:"flex",width:"100%"}},l.createElement("div",{style:{width:"40%"}},l.createElement("p",null,e.name,":")),l.createElement("div",{style:{width:"60%"}},l.createElement("p",null,S[e.field]))))))),l.createElement("div",{style:{margin:"0 0 15px",padding:"15px",borderRadius:"4px",background:"#fff"}},l.createElement("div",{className:t.caption},l.createElement("h3",null,U("common:Payment"))),l.createElement("div",null,S&&"card"===S.payment?l.createElement("p",null,U("common:To_a_bank_card")):S&&"cashless_for_individuals"===S.payment?l.createElement("div",null,l.createElement("p",null,U("common:Cashless_for_individuals")),l.createElement("p",null,U("common:Payment_for_individuals"))):l.createElement("p",null,U("common:Payment_upon_receipt_of_goods")))),l.createElement("div",{style:{margin:"0 0 15px",padding:"15px",borderRadius:"4px",background:"#fff"}},l.createElement("div",{className:t.caption},l.createElement("h3",null,U("common:Buyer_data"))),S&&l.createElement("div",{style:{width:"100%"}},l.createElement("div",{style:{display:"flex",width:"100%"}},l.createElement("div",{style:{width:"40%"}},l.createElement("p",null,U("common:Name"),":")),l.createElement("div",{style:{width:"60%"}},l.createElement("p",null,S.customer_first_name))),l.createElement("div",{style:{display:"flex",width:"100%"}},l.createElement("div",{style:{width:"40%"}},l.createElement("p",null,U("common:Surname"),":")),l.createElement("div",{style:{width:"60%"}},l.createElement("p",null,S.customer_last_name))),l.createElement("div",{style:{display:"flex",width:"100%"}},l.createElement("div",{style:{width:"40%"}},l.createElement("p",null,U("common:Phone"),":")),l.createElement("div",{style:{width:"60%"}},l.createElement("p",null,S.customer_phone))),l.createElement("div",{style:{display:"flex",width:"100%"}},l.createElement("div",{style:{width:"40%"}},l.createElement("p",null,U("common:Email"),":")),l.createElement("div",{style:{width:"60%"}},l.createElement("p",null,S.customer_email))))),l.createElement("div",{style:{margin:"0 0 15px",padding:"15px",borderRadius:"4px",background:"#fff"}},l.createElement("div",{className:t.caption},l.createElement("h3",null,U("common:Recipient data"))),S&&q&&q.length>0&&l.createElement("div",{style:{width:"100%"}},q.map(((e,t)=>""===e.field||""===S[e.field]?null:"recipient_type_name"===e.field?l.createElement("div",{style:{display:"flex",width:"100%"}},l.createElement("div",{style:{width:"99%"}},l.createElement("p",null,l.createElement("b",null,S[e.field])))):l.createElement("div",{style:{display:"flex",width:"100%"}},l.createElement("div",{style:{width:"40%"}},l.createElement("p",null,e.name,":")),l.createElement("div",{style:{width:"60%"}},l.createElement("p",null,S[e.field]))))))))))))))):l.createElement(l.Fragment,null))};const b={getOrderList:E.Uw.getOrderList,getShoppingCartOrderList:E.Uw.getShoppingCartOrderList,getCurrentPreOrderById:x.H.getCurrentPreOrderById};class N extends l.Component{componentDidMount(){}render(){return l.createElement(w,this.props)}}var k=(0,m.$j)((function(e){const{createOrder:t,authentication:r,languageReducer:n,userSelectedData:l,orders:a,shoppingCartOrderList:m,shoppingCartOrderItem:i,session:c,
1currentPreOrderById:o}=e,{user:d}=e.frontendData,{customer_id:s,sell_currency_id:p}=l;return{createOrder:t,authentication:r,languageReducer:n,userSelectedData:l,orders:a,shoppingCartOrderList:m,shoppingCartOrderItem:i,session:c,customer_id:s,sell_currency_id:p,currentPreOrderById:o,user:d}}),b)(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.