1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6435],{31520:function(e,t,r){r.d(t,{Au:function(){return g},BF:function(){return T},Bi:function(){return S},F9:function(){return _},H5:function(){return U},I5:function(){return s},PC:function(){return c},Sv:function(){return R},V2:function(){return o},V8:function(){return d},W3:function(){return b},YR:function(){return v},ed:function(){return A},el:function(){return h},g3:function(){return y},gK:function(){return C},pl:function(){return m},sP:function(){return f},vA:function(){return l},vW:function(){return w}});var n=r(55406),i=r(87411),u=r(93792),a=r(94826);let o=async e=>{let{token:t,limit:r,offset:u}=e;try{if(!t)return null;let e=new URLSearchParams;void 0!==r&&e.set("limit",String(r)),void 0!==u&&e.set("offset",String(u));let i=await fetch("".concat(n.v.public.SELL_BFF,"/v1/orders/?").concat(e),{headers:{Authorization:t}}),a=await i.json();return{orders:a.data.sellOrdersDetails,count:a.data.count}}catch(e){i.kg.error(e,"error in get sale orders")}},l=e=>btoa(e),c=e=>atob(e),s=(e,t)=>({full_name:{value:e.name,isValid:(0,u.$m)(e.name)},account_number:{value:e.account_number,isValid:(0,u._P)(e.account_number,t).success}}),d=e=>{var t,r,n;let i;let u="",a=!1;if(null==e?void 0:null===(t=e.social_providers)||void 0===t?void 0:t.length){let t=null==e?void 0:e.social_providers.find(e=>{var t;return null===(t=e.provider_user_id)||void 0===t?void 0:t.includes("emag:")});t&&(u=t.provider_user_id.split("emag:")[1],a=!!(null===(r=t.subscription_attributes)||void 0===r?void 0:r.has_genius),i=null===(n=t.subscription_attributes)||void 0===n?void 0:n.genius_plan)}return{emagId:u,isGenius:a,geniusPlan:i}},f=e=>{if(!e||!Object.hasOwn(e,"social_providers"))return"not-authenticated";let{emagId:t,isGenius:r}=d(e);return t?r?"emag-genius":"emag":"flip"};async function g(e){let{token:t,lang:r}=e;try{let e=await fetch("/api/account/get-returns",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,lang:r})});return await e.json()}catch(e){return i.kg.error(e,"get returns error"),null}}async function _(e){let{token:t,lang:r,orderId:u}=e;try{let e=await fetch("".concat(n.v.public.BASE_URL,"/api/account/get-return-details/"),{method:"POST",body:JSON.stringify({token:t,lang:r,orderId:u})});return await e.json()}catch(e){return i.kg.error(e,"get return details error"),null}}let h=e=>{if(!(null==e?void 0:e.id))return!1;if("COMANDA_LIVRATA"===e.order_state&&e.delivered_at){let t=(0,a.Pe)(e.delivered_at);return(!e.payment_type.includes("tbi")||!(t+1>=31))&&e.sell_orders.some(t=>v(t,e))}return!1},v=(e,t)=>
1{let{warranty_order_state:r,return_order_state:n}=e;return!!(t.delivered_at&&(0,a.Pe)(t.delivered_at)<t.return_validity&&[null,"GARANTIE_RETURNAT_CUMPARATOR","GARANTIE_ANULATA"].includes(r)&&[null,"RETUR_ANULAT"].includes(n))},p=["batteries","protector_applied"],m=e=>p.includes(e.category),y=(e,t)=>{var r;if(!e)return[];let n=new Set((e.ongoing_return_orders||[]).flatMap(e=>{var t;return null!==(t=e.returned_accessories_list)&&void 0!==t?t:[]}).map(e=>e.sale_id));return(null!==(r=e.accessories)&&void 0!==r?r:[]).filter(e=>{let r=!n.has(e.sale_id),i=null===e.sell_id,u=e.sell_id===(null==t?void 0:t.id);return r&&(i||u)})};async function w(e){let{token:t,limit:r,offset:n,lang:u}=e;try{let e=await fetch("/api/account/get-warranties",{method:"POST",body:JSON.stringify({token:t,limit:r,offset:n,lang:u})});return await e.json()}catch(e){return i.kg.error(e,"get warranties error"),null}}async function A(e){let{token:t,lang:r,orderId:u}=e;try{let e=await fetch("".concat(n.v.public.BASE_URL,"/api/account/get-warranty-details/"),{method:"POST",body:JSON.stringify({token:t,lang:r,orderId:u})});return await e.json()}catch(e){return i.kg.error(e,"get warranty details error"),null}}let R=async e=>{let{token:t,orderId:r,sellOrderId:n,type:i,lang:u,filename:a}=e;try{var o;let e=new URLSearchParams({type:i,lang:u});null!=n&&e.append("sellOrderId",String(n)),null!=r&&e.append("orderId",String(r));let l=await fetch("/api/download-file?".concat(e.toString()),{method:"GET",headers:{Authorization:t}});if(!l.ok)return{error:!0};let c=await l.blob();if("application/pdf"!==c.type)return{error:!0};let s=window.URL.createObjectURL(new Blob([c])),d=document.createElement("a");d.href=s,d.setAttribute("download","".concat(null!==(o=null!=a?a:n)&&void 0!==o?o:r,".pdf")),document.body.appendChild(d),d.click(),document.body.removeChild(d)}catch(e){return{error:!0}}},T=(e,t)=>{let r=null!==(i=null===(n=t.extra_warranty)||void 0===n?void 0:n.periodMonths)&&void 0!==i?i:0;var n,i,u,a=new Date(t.delivered_at);return a.setDate(a.getDate()+(null!==(u=t.warranty_validity)&&void 0!==u?u:0)),new Date(new Date(a).setMonth(a.getMonth()+r))},b=e=>{let{sell_orders:t}=e;return t&&t.length?t.filter(t=>{if(!t.delivered_at||!t.warranty_validity)return!1;let r=T(e,t),n=new Date().getTime()<r.getTime(),i=[null,"GARANTIE_RETURNAT_CUMPARATOR","GARANTIE_ANULATA"].includes(t.warranty_requisition_status),u=[null,"RETUR_CUMPARATOR","RETUR_ANULAT"].includes(t.return_requisition_status);return n&&i&&u}):[]};async function S(e){let{token:t,lang:r}=e;try{let e=await fetch("".concat(n.v.public.BASE_URL,"/api/account/get-insurances/"),{method:"POST",body:JSON.stringify({token:t,lang:r})});return await e.json()}catch(e){return i.kg.error(e,"get insurances error"),null}}let U=e=>{if(!e.deliveredAt)return!1;let{devices:t}=e;return!!t&&!!t.length&&t.every(e=>{let t=C(e);return t&&new Date().getTime()<new Date(t).getTime()})},C=e=>{var t,r;return null!==(r=null===(t=e.insurancePolicy)||void 0===t?void 0:t.policyExpiryDate)&&void 0!==r?r:""}},34866:function(e,t,r){var n,i;r.d(t,{G:function(){return n},l:function(){return u}}),(i=n||(n={})).Login="login",i.EmailCheck="emailCheck",i.CreateAccountInitialData="initialDataEntry",i.CreateAccountPhoneRegister="phoneNumberRegister",i.CheckPhoneNumber="checkPhoneNumber",i.ForgotPassowrd="forgot",i.Success="success",i.EmagFirstLogin="emagFirstLogin",i.EmagFirstLoginEmailCheck="emagFirstLoginEmailCheck",i.EmagFirstLoginEmailCheckNoFastForward="emagFirstLoginEmailCheckNoFastForward";let u={MY_ACCOUNT:"my account",SELL_FLOW:"sell flow",CHECKOUT:"checkout"}},93792:function(e,t,r){r.d(t,{$m:function(){return a},JZ:function(){return o},P:function(){return s},Si:function(){return c},_P:function(){return d},_w:function(){return i},bx:function(){return _},cQ:function(){return g},jb:function(){return u},kQ:function(){return l}});var n=r(18394);let i=e=>n.j9.test(e),u=e=>n.HN.test(e),a=e=>n.yJ.test(e),o=e=>void 0!==e&&(null==e?void 0:e.length)!==0&&n.xd.test(e),l=e=>e.length>=6,c=e=>{switch(e.toUpperCase()){case"BG":return n.T2;case"CZ":return n.ll;case"HU":return n.c3;case"GR":return n.Wy;case"SK":return n.oD;default:return n.AU}},s=(e,t)=>{switch(t.toUpperCase()){case"BG":return n.T2.test(e);case"CZ":return n.ll.test(e);case"HU":return n.c3.test(e);case"GR":return n.Wy.test(e);case"SK":return n.oD.test(e);default:return n.AU.test(e)}},d=(e,t)=>{if(e){let r=e.toUpperCase().replace(/ /g,""),n=r.match(/^([A-Z]{2})(\d{2})([A-Z\d]+)$/);
1if(r.slice(0,2)!==t)return{success:!1,code:"countryFormat"};if(!n||r.length!==({BG:22,CZ:24,GR:27,GT:28,HU:28,RO:24,SK:24})[t])return{success:!1,code:"incorrectLength"};if(1===f((n[3]+n[1]+n[2]).replace(/[A-Z]/g,e=>(e.charCodeAt(0)-55).toString())))return{success:!0}}return{success:!1,code:"checksum"}},f=e=>{let t=(e=e.toString()).slice(0,2);for(let r=2;r<e.length;r+=7)t=parseInt(t+e.substring(r,r+7),10)%97;return t},g=e=>e.replace(/(.{4})(?!$)/g,"$1 "),_=e=>n.UM.test(e)},94826:function(e,t,r){r.d(t,{Ks:function(){return u},Pe:function(){return n},g8:function(){return i}});let n=e=>Math.ceil((new Date().getTime()-new Date(e).getTime())/864e5),i=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date,n=new Date(r);n.setDate(n.getDate()+1);let i=r.getHours()>=14,u=e.toDateString()===r.toDateString(),a=e.toDateString()===n.toDateString(),o=e.getDay();if(0===o||6===o||"GR"===t&&1===o&&[0,6].includes(r.getDay()))return!1;if("HU"===t){if(u)return!1;if(i)return!a}else if("GR"===t){if(u||a)return!1}else if(u)return!1;return!0},u=(e,t,r)=>{let n=new Date(e);for(let e=0;e<366&&(!t||!(n>t));e++){if(i(n,r))return n;n.setDate(n.getDate()+1)}return null}}}]); 2//# sourceMappingURL=../../sourcemaps/static/chunks/6435-f6579bf085066342.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.