PageSourceSearch

https://bro-depot.com/_next/static/chunks/pages/apps/listing/lazada-listing-23ccb51430707672.js

js bro-depot.com collected 2026-10-04 02:38:54 UTC 74,087 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5487],{7472:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/apps/listing/lazada-listing",function(){return n(648)}])},96735:function(e,t,n){"use strict";n.d(t,{FD:function(){return I},rl:function(){return Z}});var i=n(47568),r=n(26042),o=n(69396),a=n(828),l=n(70655),s=n(85893),u=n(32978),d=n(60445),c=n(24394),v=n(77107),f=n(5759);function m(){let e=!1;const t=[],n=new Set,i={subscribe:e=>(n.add(e),()=>{n.delete(e)}),start(i,r){if(e){const e=[];return n.forEach((t=>{e.push((0,v.d5)(t,i,{transitionOverride:r}))})),Promise.all(e)}return new Promise((e=>{t.push({animation:[i,r],resolve:e})}))},set:t=>((0,c.k)(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),n.forEach((e=>{(0,f.gg)(e,t)}))),stop(){n.forEach((e=>{(0,v.p_)(e)}))},mount:()=>(e=!0,t.forEach((({animation:e,resolve:t})=>{i.start(...e).then(t)})),()=>{e=!1,i.stop()})};return i}var p=n(67294),h=n(96681);const x=function(){const e=(0,h.h)(m);return(0,p.useEffect)(e.mount,[]),e};var g=n(2014),j=(0,p.createContext)(void 0),b="Please make sure to upload product images(s), fill product name, and select the correct category to publish a product.",y={name:"Use brand name and unique selling points of your product to boost searchability by up to 6x. For example: Adidas 100% Cotton Men's Sport T-Shirt.\n\n  Avoid stacking irrelevant keywords as this will result in product suspension.",brand_id:"Search your brand by typing the keyword. If your brand is not in the list, click No Brand button or request to create a new brand here\n  Search your brand by typing a keyword.",price:"This is the price, that the customer has to pay for the product. This price includes the taxes. The price is separated with a point delimiter",special_price:"Sales Price for a Product for Promotion. The rate of the special price to the price must be between 0.20 and 1.00",description:"The product description should give the customer useful information about the product to ensure a purchase.",package_weight:"Please ensure you have entered the right package weight (kg) and dimensions (cm) to avoid incorrect shipping fee charges. Click here for more information https://bit.ly/2OZBVbG",package_length:"Input the accurate package dimension in centimeter to avoid incorrect shipping fee charges."},I=function(e){var t=e.children,n=e.ePlatformStoreId,c=e.currency,v=e.defaultValues,f=e.listingMode,m=(0,p.useState)(n),h=m[0],I=m[1],Z=(0,p.useState)(c),V=Z[0],k=Z[1],w=(0,p.useState)([]),_=w[0],P=w[1],S=(0,p.useState)(b),N=S[0],C=S[1],E=(0,d.AQ)({variables:{ePlatformStoreId:h,getLazadaCategoryInput:{language_code:void 0}},skip:!h}).data,O=(0,a.Z)((0,d.H7)(),1)[0],T=(0,p.useCallback)(function(){var e=(0,i.Z)((function(e){var t,n,i;return(0,l.__generator)(this,(function(r){switch(r.label){case 0:return[4,O({variables:{ePlatformStoreId:h,getLazadaCategoryAttribInput:{primary_category_id:e}}})];case 1:return t=r.sent().data,i=null!==(n=null===t||void 0===t?void 0:t.getLazadaCategoryAttributes)&&void 0!==n?n:[],[2,i.filter((function(e){return!g.Du.includes(e.name)}))]}}))}));return function(t){return e.apply(this,arguments)}}(),[O,h]),D=(0,p.useCallback)(function(){var e=(0,i.Z)((function(e){var t;return(0,l.__generator)(this,(function(n){switch(n.label){case 0:return[4,T(e)];case 1:return t=n.sent(),P(t),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),[T]),F=(0,p.useMemo)((function(){var e,t=null===E||void 0===E?void 0:E.getLazadaFlattenCategoryTree,n=null!==(e=null===t||void 0===t?void 0:t.map((function(e){var t,n;return(0,o.Z)((0,r.Z)({},e),{pId:null!==(n=null===(t=e.parent_id)||void 0===t?void 0:t.toString())&&void 0!==n?n:u.dz,title:e.name,uId:e.id.toString(),disabled:!e.leaf})})))&&void 0!==e?e:[];return n}),[E]),B=x(),z=(0,p.useCallback)((function(){B.start("initial"),setTimeout((function(){B.start("normal")}),100)}),[B]),L=(0,p.useCallback)((function(e,t){if(e.target===document.activeElement){if(t){var n=function(e){var t;return null!==(t=y[e])&&void 0!==t?t:b}(t);C(n)}}else C(b);z()}),[z]),R=(0,p.useMemo)((function(){return{storeId:h,setStoreId:I,currency:V,setCurrency:k,flatCategories:F,lazadaInputDetails:_,triggerGetLazadaCategoryAttributes:D,defaultValues:v,framerTipsControl:B,handleTipsTransition:z,formTips:N,setFormTips:C,handleSwapFormTips:L,listingMode:f}}),[h,F,V,_,D,v,B,z,N,L,f]);return(0,s.jsx)(j.Provider,{value:R,children:t})},Z=(j.Consumer,function(){var e=(0,p.useContext)(j);if(!e)throw new Error("No Context.Provider found when calling useContext.");return e})},37563:function(e,t,n){"use strict";n.d(t,{Z:function(){return Tt}});var i=n(47568),r=n(26042),o=n(69396),a=n(99534),l=n(70655),s=n(85893),u=n(76366),d=n(53722),c=n(47533),v=n(57891),f=n(43085),m=n(91359),p=n(79072),h=n(45135),x=n(54225),g=n(96486),j=n(67294),b=n(87536),y=n(2014),I=n(12971),Z=n(49837),V=n(86010),k=n(15734),w=n(41664),_=n.n(w),P=n(91033),S=e=>{let t=e.parentNode;for(;t;){if("contents"!==getComputedStyle(t,null).getPropertyValue("display"))break;t=t.parentNode}return t||window},N=null;"undefined"!==typeof CSS&&CSS.supports&&(CSS.supports("position","sticky")?N="sticky":CSS.supports("position","-webkit-sticky")&&(N="-webkit-sticky"));var C,E=!1;try{C=Object.defineProperty({},"passive",{get(){E={passive:!0}}}),window.addEventListener("testPassive",null,C),window.removeEventListener("testPassive",null,C)}catch(Dt){}var O=(e,{offsetTop:t,offsetBottom:n,bottom:i})=>{const r=(e=>{let t=e;for(;t=t.parentElement;){const e=getComputedStyle(t,null).getPropertyValue("overflow-y");if(t===document.body)return window;if("auto"===e||"scroll"===e)return t}return window}
1)(e);let o=r===window?window.scrollY:r.scrollTop;const a=[];let l,s,u,d,c,v,f;const m=()=>"relative"===l?s:"stickyTop"===l?Math.max(0,v+o-d+t):"stickyBottom"===l?Math.max(0,v+o+f-(d+u+n)):void 0,p=e=>{e+v+f>=d+u+s+n&&h("stickyBottom")},h=r=>{if(l=r,"relative"===r)if(e.style.position="relative",i){const t=Math.max(0,c-u-s);e.style.bottom=`${t}px`}else e.style.top=`${s}px`;else e.style.position=N,"stickyBottom"===r?i?e.style.bottom=`${n}px`:e.style.top=f-u-n+"px":i?e.style.bottom=f-u-n+"px":e.style.top=`${t}px`;s=m()},x=()=>{i?"stickyBottom"!==l&&h("stickyBottom"):"stickyTop"!==l&&h("stickyTop")},g=(e,t,n,i)=>{e.addEventListener(t,n,i),a.push((()=>e.removeEventListener(t,n)))},j=()=>{const e=r===window?window.scrollY:r.scrollTop;if(e===o)return;if(u+t+n<=f)return x(),void(o=e);const i=e-o;s=m(),i>0?"stickyTop"===l?e+v+t>d&&h(e+v+f<=d+u+s+n?"relative":"stickyBottom"):"relative"===l&&p(e):"stickyBottom"===l?v+e+f<d+c+n&&h(v+e+t>=d+s?"relative":"stickyTop"):"relative"===l&&v+e+t<d+s&&h("stickyTop"),o=e},b=()=>{f=window.innerHeight,v=0,j()},y=()=>{f=r.offsetHeight,0===f&&console.warn("react-sticky-box's scroll pane has a height of 0. This seems odd. Please check this node:",r),v=r.firstChild.offsetParent===r?r.getBoundingClientRect().top:0,j()},I=()=>{const t=S(e),n=getComputedStyle(t,null),a=parseInt(n.getPropertyValue("padding-top"),10),s=a+parseInt(n.getPropertyValue("padding-bottom"),10);d=((e,t)=>{let n=e,i=0;t.firstChild&&t.firstChild.offsetParent!==t&&(i+=e.offsetTop-t.offsetTop,t=e.offsetParent,i+=-e.offsetTop);do{i+=n.offsetTop,n=n.offsetParent}while(n&&n!==t);return i})(t,r)+a+v;const u=c;c=t.getBoundingClientRect().height-s,"relative"===l&&(i?h("relative"):u>c&&p(o)),u!==c&&"relative"===l&&(o=Number.POSITIVE_INFINITY,j())},Z=({initial:r}={})=>{const o=u;if(u=e.getBoundingClientRect().height,!r&&o!==u){if(u+t+n<=f)return l=void 0,void x();{const e=o-u,t=c-u,n=Math.min(t,m()+(i?e:0));s=Math.max(0,n),i&&"stickyBottom"===l||h("relative")}}},V=(e,t)=>{const n=new P.Z(t);n.observe(e),a.push((()=>n.disconnect()))};return g(r,"scroll",j,E),g(r,"mousewheel",j,E),r===window?(g(window,"resize",b),b()):(V(r,y),y()),V(S(e),I),I(),V(e,Z),Z({initial:!0}),x(),()=>a.forEach((e=>e()))},T=({offsetTop:e,offsetBottom:t,bottom:n,children:i,className:r,style:o})=>{const a=(({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[i,r]=(0,j.useState)(null),o=(0,j.useRef)({offsetTop:e,offsetBottom:t,bottom:n});return(0,j.useEffect)((()=>{o.current={offsetTop:e,offsetBottom:t,bottom:n}})),(0,j.useEffect)((()=>{if(i)return O(i,o.current)}),[i]),r})({offsetTop:e,offsetBottom:t,bottom:n});return j.createElement("div",{className:r,style:o,ref:a},i)},D=n(96735),F={normal:{opacity:1,y:0,transition:{duration:.5}},initial:{opacity:0,y:"20%",transition:{duration:.05}}},B=function(e){var t=e.getBoundingClientRect(),n=t.height,i=t.top,r=i+n,o=window.innerHeight;return r>0&&i<0+o};var z=function(e){var t=e.errors,n=e._onSubmit,i=e.handleSubmit,o=(0,D.rl)(),a=o.framerTipsControl,l=o.formTips,u=(0,I.Z)({threshold:600,disableHysteresis:!0}),d=(0,j.useState)([]),c=d[0],f=d[1];(0,j.useEffect)((function(){if("undefined"!==typeof IntersectionObserver){var e=new Map;f(y.SZ.map((function(t){var n=document.getElementById(t.id);return n&&e.set(t.id,n),n?{inView:B(n),element:n,sectionId:t.id}:{sectionId:t.id}})));var t=new Map;e.forEach((function(e,n){return t.set(e,n)}));var n=new IntersectionObserver((function(e){f((function(n){var i=n.map((function(e){return(0,r.Z)({},e)}));return e.forEach((function(e){var n=t.get(e.target);if(n){var r=i.find((function(e){return e.sectionId===n}));r&&(r.inView=e.isIntersecting)}})),i}))}));return e.forEach((function(e){return n.observe(e)})),function(){return n.disconnect()}}f(y.SZ.map((function(e){var t=document.getElementById(e.id);return t?{inView:B(t),element:t,sectionId:e.id}:{sectionId:e.id}})))}),[]);var m=(0,s.jsxs)("div",{className:"relative h-full min-w-[11rem] max-w-[11rem]",children:[(0,s.jsx)(Z.Z,{className:"my-5",children:(0,s.jsx)("div",{className:"mx-5 mt-5",children:(0,s.jsx)("div",{className:"w-full text-xs",children:(0,s.jsx)("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:y.SZ.map((function(e){var t,n=c.find((function(t){return t.sectionId===e.id})),i=null!==(t=null===n||void 0===n?void 0:n.inView)&&void 0!==t&&t;return(0,s.jsxs)("li",{className:"mb-5 ml-4",children:[(0,s.jsx)("div",{className:"absolute -left-1.5 mt-1.5 h-3 w-3 rounded-full border border-white bg-gray-200 dark:border-gray-900 dark:bg-gray-700"}),(0,s.jsx)(_(),{href:"#".concat(e.id),scroll:!1,children:(0,s.jsx)("div",{className:(0,V.Z)("mb-1 cursor-pointer font-sans text-xs leading-none transition hover:scale-105",{"text-primary font-bold":i},{"text-gray-400 dark:text-gray-500 font-normal":!i}),children:e.title})})]},e.id)}))})})})}),(0,s.jsx)(k.E.div,{animate:a,variants:F,children:(0,s.jsx)(Z.Z,{className:"mb-5",children:(0,s.jsxs)("div",{className:"m-5",children:[(0,s.jsx)("div",{className:"text-lg font-bold text-primary",children:"Tips"}
1),(0,s.jsx)("div",{className:"text-justify text-xs",children:l})]})})}),(0,s.jsx)(x.Z,{onClick:i((function(e){return n(e,!1)})),fullWidth:!0,variant:"outlined",sx:{mb:3},disabled:!(0,v.Q)(t),children:"Save"}),(0,s.jsx)(x.Z,{variant:"contained",fullWidth:!0,disabled:!(0,v.Q)(t),onClick:i((function(e){return n(e,!0)})),children:(0,s.jsx)("span",{className:"text-xs leading-6",children:"Sync to Lazada"})})]});return(0,s.jsxs)("div",{className:"col-span-2",children:[!u&&(0,s.jsx)(T,{offsetTop:70,offsetBottom:100,children:m}),u&&(0,s.jsx)(T,{offsetTop:10,offsetBottom:100,children:m})]})},L=n(34888),R=n(35907);var W=function(e){var t=(0,L.uj)(),n=t.productDetails,i=t.productVariantDetails,r=t.offerDetails,o=t.receivedOfferDetails,a=(0,I.Z)({threshold:600,disableHysteresis:!0}),l=(0,s.jsx)("div",{className:"mb-5",children:(0,s.jsx)(p.ZP,{item:!0,xs:12,className:"mb-5",children:(0,s.jsx)(R.Z,{productDetails:n,productVariantDetails:i,offerDetails:r,receivedOfferDetails:o})})});return(0,s.jsxs)(s.Fragment,{children:[!a&&(0,s.jsx)(T,{offsetTop:70,offsetBottom:100,className:"z-[100]",children:l}),a&&(0,s.jsx)(T,{offsetTop:10,offsetBottom:100,className:"z-[100]",children:l})]})},A=n(5952),M=n(1427),q=n(29630),G=n(6328),K=n(43557),X=n(32978),H=n(55343),U=n(32631),Y=n(22180),J=n(72916),Q=n(23926),$=n(65820),ee=n(29815),te=n(35966),ne=n(23378),ie=n(67836),re=n(70754),oe=function(e,t){var n=function(t){return t.uId===e.pId};return e.pId&&t.find(n)?(0,ee.Z)(oe(t.find(n),t)).concat([e]):[e]};function ae(e){var t=e.label,n=e.onChange,i=e.value,l=e.error,u=e.openSelection,d=e.closeSelection,c=(0,K.Fm)().categories,v=(0,j.useState)(""),f=v[0],m=v[1],p=(0,K.Fm)().setTreeLayerState,h=(0,j.useCallback)((function(e){if(!(0,g.isNil)(c)){var t=oe(e,c).map((function(e){return e.uId}));p([X.dz].concat((0,ee.Z)(t)))}}),[p,c]);return(0,s.jsx)(te.Z,{id:"system-category-autocomplete",open:!1,disableCloseOnSelect:!0,multiple:!0,value:i||[],onChange:function(e,t){(0,g.isArray)(t)&&(0,g.isEmpty)(t)?n(null):n(t)},onOpen:function(){return u()},onClose:function(){return d()},isOptionEqualToValue:function(e,t){return e.uId===t.uId},onKeyDown:function(e){if("Enter"===e.key){if(e.preventDefault(),e.stopPropagation(),!f||(0,g.isNil)(c))return;if(f.length<=2)return;var t=c.filter((function(e){if(!0===e.disabled)return!1;var t=e.title.toLowerCase().replace(/\s/g,""),n=f.toLowerCase().replace(/\s/g,"");return!!t.includes(n)}));if(1===t.length){var i,r=(0,ee.Z)(t),o=(0,g.uniqBy)(r,"uId"),a=null===o||void 0===o||null===(i=o[0])||void 0===i?void 0:i.uId;n(a?+a:null),d()}else if(t.length>1){var l,s=(0,ee.Z)(t),u=(0,g.uniqBy)(s,"uId"),v=null===u||void 0===u||null===(l=u[0])||void 0===l?void 0:l.uId;n(v?+v:null),d()}}},getOptionLabel:function(e){var t=null===c||void 0===c?void 0:c.find((function(t){return t.uId===e.uId}));return(null===t||void 0===t?void 0:t.name)||""},options:null!==c&&void 0!==c?c:[],loading:false,inputValue:f,onInputChange:function(e,t){m(t)},renderTags:function(e,t){return e.map((function(e,n){var i=t({index:n}),o=i.key,l=(0,a.Z)(i,["key"]);return(0,s.jsx)(ne.Z,(0,r.Z)({onClick:function(){return h(e)},variant:"outlined",label:"".concat(e.title),size:"small"},l),o)}))},renderInput:function(e){return(0,s.jsx)(ie.Z,(0,o.Z)((0,r.Z)({},e),{label:t,error:l,placeholder:"Search and tap ENTER",size:"small",InputProps:(0,o.Z)((0,r.Z)({},e.InputProps),{endAdornment:(0,s.jsxs)("div",{className:"flex items-center gap-1 ".concat((null===i||void 0===i?void 0:i.length)>0?"mr-0":"mr-5"),children:[null,e.InputProps.endAdornment]})})}))}})}var le=function(e,t){if((0,g.isNil)(t)||(0,g.isNil)(e))return[];if((0,g.isArray)(e))return t.filter((function(t){return e.some((function(e){return e.toString()===t.uId}))}));var n=t.find((function(t){return t.uId===e.toString()}));return n?[n]:[]},se=function(e){var t=e.multiple,n=void 0===t||t,i=e.onChange,r=e.value,o=e.label,a=(0,K.Fm)().categories,l=(0,j.useMemo)((function(){return le(r,a)}),[r,a]),u=(0,j.useRef)(null),d=(0,j.useCallback)((function(){var e=u.current;if(e){var t=e.getBoundingClientRect().top+window.pageYOffset-80;window.scrollTo({top:t-70,behavior:"smooth"})}}
1),[u]),c=(0,j.useState)(!1),v=c[0],f=c[1],p=(0,j.useCallback)((function(){d(),f(!0)}),[d]),h=(0,j.useCallback)((function(){f(!1)}),[]),b=(0,j.useCallback)((function(e){var t=le(r,a);if(n){if(null===t||void 0===t?void 0:t.some((function(t){return t.uId===e}))){var o=null===t||void 0===t?void 0:t.filter((function(t){return t.uId!==e})),l=null===o||void 0===o?void 0:o.map((function(e){return+e.uId}));i(null!==l&&void 0!==l?l:[])}else{var s=null===a||void 0===a?void 0:a.find((function(t){return t.uId===e}));if(void 0===s)return;var u=null===t||void 0===t?void 0:t.concat(s),d=null===u||void 0===u?void 0:u.map((function(e){return+e.uId}));i(null!==d&&void 0!==d?d:[])}}else{var c=null===a||void 0===a?void 0:a.find((function(t){return t.uId===e}));if(void 0===c)return;if((0,g.isNil)(c.uId))return;var v=+c.uId;i(v)}h()}),[r,n,a]);return(0,s.jsx)(Q.Z,{onClickAway:h,children:(0,s.jsxs)("div",{ref:u,children:[(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(ae,{closeSelection:h,openSelection:p,error:!1,value:l,label:o,onChange:i})}),(0,s.jsx)($.M,{children:v&&(0,s.jsx)(k.E.div,{animate:"enter",className:"fallback",initial:"initial",variants:Y.I,children:(0,s.jsx)(m.Z,{className:"rounded-lg ring-1 ring-slate-400/50",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(J.Z,{onSelect:b,selectedValues:l}),(0,s.jsx)("div",{className:"absolute -top-2 right-5",children:(0,s.jsx)(x.Z,{onClick:h,variant:"outlined",size:"small",color:"error",children:"Close"})})]})})})})]})})};var ue=function(e){var t,n=e.methods,i=e.name,a=e.label,l=e.defaultValue,u=e.defaultValues,d=e.multiple,c=e.flatCategories,v=(e.treeSelectProps,e.controllerProps),f=e.formControlProps,m=void 0===f?G.f:f,p=n.control,h=(0,b.cl)({control:p}).errors,x=(0,g.get)(h,i),j=l||(0,g.get)(u,i),y=(0,G.V)(i,a);return(0,s.jsxs)(H.Z,(0,o.Z)((0,r.Z)({fullWidth:!0},m),{className:"relative",children:[(0,s.jsx)(b.Qr,(0,r.Z)({name:i,control:p,defaultValue:j,rules:{required:!0},render:function(e){var t=e.field,n=t.value,i=t.onChange;return(0,s.jsx)(K.LD,{mode:X.gS.SELECT,categories:c,children:(0,s.jsx)(se,{value:n,onChange:i,multiple:d,label:y})})}},v)),x&&(0,s.jsx)(U.Z,{sx:{color:"error.main"},id:"".concat(i,"-helper"),children:null===(t=(0,g.get)(x,"message"))||void 0===t?void 0:t.toString()})]}))},de=function(e){var t=e.name,n=e.defaultValue,i=e.label,r=e.defaultValues,o=e.controllerProps,a=e.formControlProps,l=e.treeSelectProps,u=e.multiple,d=e.flatCategories,c=(0,b.Gc)();return(0,s.jsx)(ue,{name:t,label:i,defaultValue:n,defaultValues:r,controllerProps:o,formControlProps:a,methods:c,treeSelectProps:l,multiple:u,flatCategories:d})},ce=n(44165),ve=function(e){var t=e.children,n=e.gridProps;return(0,s.jsx)(p.ZP,(0,o.Z)((0,r.Z)({item:!0,xs:12},n),{children:(0,s.jsx)(Z.Z,{className:"border hover:border-primary",children:(0,s.jsx)(m.Z,{children:(0,s.jsx)(p.ZP,{onKeyDown:ce.H,container:!0,spacing:6,sx:{pt:2},children:t})})})}))},fe=function(e){var t=e.title,n=e.subtitle;return(0,s.jsxs)(p.ZP,{item:!0,xs:12,children:[(0,s.jsx)("div",{className:"text-lg font-bold",children:t}),(0,s.jsx)("div",{className:"text-sm text-slate-400",children:n})]})};var me=function(e){var t,n=e.hidden,i=(0,D.rl)(),r=i.defaultValues,o=i.flatCategories,a=i.handleSwapFormTips,l=(0,b.Gc)();return(0,s.jsxs)(ve,{gridProps:{hidden:n,id:null===(t=y.SZ[0])||void 0===t?void 0:t.id},children:[(0,s.jsx)(fe,{title:"Basic Information"}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(q.Z,{variant:"body2",sx:{fontWeight:600},children:"1. General Information"})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:12,children:(0,s.jsx)(M.Z,{name:"name",defaultValues:r,textFieldProps:{InputProps:{onFocus:function(e){return a(e,"name")},onBlur:a}}})}),(0,s.jsx)(A.Z,{name:"productVariantId",defaultValues:r,methods:l}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:12,children:(0,s.jsx)("div",{className:"max-w-[calc(100vw-375px-11rem)]",children:(0,s.jsx)(de,{name:"primary_category",label:"Primary Category",defaultValues:r,flatCategories:o,multiple:!1})})})]})},pe=n(44656),he=n(13267);var xe=function(e){var t,n=e.hidden,i=(0,D.rl)(),r=i.defaultValues,o=i.handleSwapFormTips,a=(0,b.Gc)(),l=a.control,u=(a.getValues,a.setValue,(0,b.qo)({control:l,name:y.II.models}));return(0,b.qo)({control:l,name:"productVariantId"}),(0,b.qo)({control:l,name:"depoBalance"}),null===u||void 0===u||u.length,(0,s.jsxs)(ve,{gridProps:{hidden:n,id:null===(t=y.SZ[4])||void 0===t?void 0:t.id},children:[(0,s.jsx)(fe,{title:"Dimensions & Logistics",subtitle:"Input the accurate package dimension in centimeter to avoid incorrect shipping fee charges."}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(q.Z,{variant:"body2",sx:{fontWeight:600},children:"5. Weight & Dimensions"})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:3,children:(0,s.jsx)(pe.Z,{name:"package_length",label:he.$i,defaultValues:r,textFieldInputProps:{onBlur:o,onFocus:function(e){return o(e,"package_length")}}})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:3,children:(0,s.jsx)(pe.Z,{name:"package_width",label:he.D0,defaultValues:r,textFieldInputProps:{onBlur:o,onFocus:function(e){return o(e,"package_length")}}})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:3,children:(0,s.jsx)(pe.Z,{name:"package_height",label:he.u5,defaultValues:r,textFieldInputProps:{onBlur:o,onFocus:function(e){return o(e,"package_length")}}})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:3,children:(0,s.jsx)(pe.Z,{name:"package_weight",label:he.Ai,defaultValues:r,textFieldInputProps:{onBlur:o,onFocus:function(e){return o(e,"package_weight")}}})})]})},ge=n(67302),je=n(76417),be=n(85037);var ye=function(e){var t,n=e.hidden,i=(0,L.uj)(),r=i.allProductImages,o=i.allDescriptions,a=(0,D.rl)(),l=a.defaultValues,u=a.handleSwapFormTips,d=a.storeId,c=(0,b.Gc)().control;return(0,b.qo)({control:c,name:y.II.models}),(0,s.jsxs)(ve,{gridProps:{hidden:n,id:null===(t=y.SZ[3])||void 0===t?void 0:t.id},children:[(0,s.jsx)(fe,{title:"Product Description",subtitle:"Write something to provide useful information about the product"}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(je.Z,{name:"short_description",defaultValues:l,label:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"flex items-center",children:"Short Description"}),(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(be.Z,{allDescriptions:o,descriptionFieldName:"short_description"})},0)]}),richTextEditorProps:{onBlur:u,onFocus:function(e){return u(e,"description")}}})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(je.Z,{name:"description",defaultValues:l,label:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"flex items-center",children:"Description"}),(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(be.Z,{allDescriptions:o,descriptionFieldName:"description"})},0)]}),richTextEditorProps:{onBlur:u,onFocus:function(e){return u(e,"description")}}})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(ge.Z,{name:"images",defaultValues:l,ePlatformStoreId:d,imageUploaderProps:{numOfFiles:20,allImages:r}})})]})},Ie=n(56302),Ze=n(48810),Ve=n(89886),ke=n(79506),we=n(23741),_e=n(60445);function Pe(e){e.label;var t=e.onChange,n=e.value,i=(e.error,e.multiple,e.defaultValues),l=e.selectedBrandId,u=(0,D.rl)(),d=u.storeId,c=u.handleSwapFormTips,v=(0,j.use
1State)(!1),m=v[0],p=v[1],h=(0,j.useState)(""),x=h[0],b=h[1],y=(0,j.useState)(!1),I=y[0],Z=y[1],V=(0,j.useState)(""),k=V[0],w=V[1],_=(0,_e.C3)({fetchPolicy:"cache-first",variables:{ePlatformStoreId:d,getAdvanceBrandInput:{topN:100,keyword:k}},skip:!d||!I}),P=_.loading,S=_.data,N=_.refetch,C=(0,j.useMemo)((function(){var e;return null!==(e=null===S||void 0===S?void 0:S.getLazadaBrands)&&void 0!==e?e:[]}),[S]);(0,j.useEffect)((function(){m&&P&&(0,f.JT)("Please wait until the brand list is fully initialized.",{icon:"\ud83d\udd0d"}),m&&!P&&0===C.length&&((0,f.JT)("No brand found. Refetching...",{icon:"\ud83d\ude22"}),N())}),[m,P,C.length,N]),(0,j.useEffect)((function(){if(!(null===i||void 0===i?void 0:i.brand_id)&&C.length>0&&(0,g.isNil)(l)){var e=C[0];e&&t(e.brand_id)}}),[i,C,l,t]),(0,j.useEffect)((function(){setTimeout((function(){Z(!0)}),1e3)}),[]);var E,O=(0,j.useMemo)((function(){return(0,g.debounce)(w,1e3)}),[]);return(0,j.useEffect)((function(){return(0,g.isString)(x)&&O(x),function(){return O.cancel()}}),[x,O]),(0,s.jsx)(te.Z,{id:"lazada-brand-autocomplete",disableCloseOnSelect:!1,multiple:!1,open:m,onOpen:function(){return p(!0)},onClose:function(){return p(!1)},loading:P,options:C,autoHighlight:!0,getOptionLabel:function(e){return e.name},value:null!==(E=C.find((function(e){return e.brand_id===n})))&&void 0!==E?E:null,onChange:function(e,n){t(null===n||void 0===n?void 0:n.brand_id)},onBlur:c,onFocus:function(e){return c(e,"brand_id")},size:"small",filterOptions:function(e){return e},renderInput:function(e){var t=e.InputProps,n=e.inputProps,i=(0,a.Z)(e,["InputProps","inputProps"]);return(0,s.jsx)(ie.Z,(0,o.Z)((0,r.Z)({},i),{label:"Search for a Brand",onChange:function(e){""===e.target.value&&null===e.target.value||b(e.target.value)},inputProps:(0,o.Z)((0,r.Z)({},n),{name:"password",autoComplete:"off",type:"text",size:"small"}),InputProps:(0,o.Z)((0,r.Z)({},t),{endAdornment:(0,s.jsxs)(s.Fragment,{children:[P?(0,s.jsx)(re.Z,{color:"inherit",size:20}):null,t.endAdornment]})})}))}})}var Se=function(e){var t,n=e.methods,i=e.name,o=e.label,a=e.defaultValue,l=e.defaultValues,u=e.controllerProps,d=e.multiple,c=void 0!==d&&d,v=n.control,f=(0,b.cl)({control:v}).errors,m=(0,g.get)(f,i),p=a||(0,g.get)(l,i),h=(0,b.qo)({control:v,name:i});return(0,s.jsxs)("div",{children:[(0,s.jsx)(b.Qr,(0,r.Z)({name:i,control:v,defaultValue:p,render:function(e){var t=e.field,n=t.value,i=t.onChange;return(0,s.jsx)(Pe,{value:n,label:o,onChange:i,error:Boolean(m),multiple:c,defaultValues:l,selectedBrandId:h})}},u)),m&&(0,s.jsx)(U.Z,{sx:{color:"error.main"},id:"stepper-linear-personal-country-helper",children:null===(t=(0,g.get)(m,"message"))||void 0===t?void 0:t.toString()})]})},Ne=n(828),Ce=n(82225),Ee=n(96277),Oe=n(93221),Te=n(83782);var De=function(e){var t=e.productVariantId,n=e.PREFIX,i=(0,D.rl)(),r=i.storeId,o=i.currency,a=(0,L.uj)().storeDetails,l=(0,b.Gc)(),u=l.control,d=l.setValue,c=(0,b.qo)({control:u,name:"package_weight"}),v=(0,Ne.Z)((0,Te.T)({name:"costCalcList",PREFIX:n}),2),f=(v[0],v[1]);return(0,s.jsx)(Ce.cz,{refId:r,ePlatformStore:a,defaultFilters:{refType:Ee.apv.EPlatformStore,refId:r},children:(0,s.jsx)(Oe.Z,{productVariantId:t,itemWeight:c?Number(c):void 0,onConfirmPrice:function(e){var t=e.price,i=e.costCalcList;d("".concat(n?"".concat(n,"."):"","price"),"".concat(t)),f(i)},currency:o})})},Fe=n(17575),Be=function(e){var t,n=e.name,i=(0,D.rl)().lazadaInputDetails.findIndex((function(e){return e.name===n})),r=((0,b.bc)({name:"extraAttributes.".concat(i,".fieldName"),defaultValue:n}),(0,b.bc)({name:"extraAttributes.".concat(i,".value"),defaultValue:null})),o=r.field,a=o.value,l=o.onChange;r.fieldState,r.formState;return[(0,j.useMemo)((function(){return null!==(t=null===a||void 0===a?void 0:a.toString())&&void 0!==t?t:null}),[a]),(0,j.useCallback)((function(e){l(e)}),[l])]};var ze=function(e){var t=e.options,n=e.label,i=e.name,a=e.isRequired,l=(0,Ne.Z)(Be({name:i}),2),u=l[0],d=l[1],c=function(e){var n=null===t||void 0===t?void 0:t.find((function(t){return t.id===e}));return null!==n&&void 0!==n?n:null}(u);return(0,s.jsx)("div",{children:(0,s.jsx)(te.Z,{id:"lazada-text-attribute-input-".concat(i),options:null!==t&&void 0!==t?t:[],getOptionLabel:function(e){return e.name},renderInput:function(e){return(0,s.jsx)(ie.Z,(0,o.Z)((0,r.Z)({},e),{size:"small",label:(0,s.jsx)(Fe.Z,{title:"".concat(i," ( Multi Select )"),placement:"top",children:(0,s.jsx)("div",{children:a?(0,s.jsx)(we.Z,{label:n}):n})})}))},value:c,onChange:function(e,t){var n;d(null!==(n=null===t||void 0===t?void 0:t.id)&&void 0!==n?n:null)}})})};var Le=function(e){var t=e.options,n=e.label,i=e.name,a=e.isRequired,l=(0,Ne.Z)(Be({name:i}),2),u=l[0],d=l[1],c=function(e){var n=null===t||void 0===t?void 0:t.find((function(t){return t.name===e}));return null!==n&&void 0!==n?n:null}(u);return(0,s.jsx)("div",{children:(0,s.jsx)(te.Z,{id:"lazada-text-attribute-input-".concat(i),options:null!==t&&void 0!==t?t:[],getOptionLabel:function(e){return e.name},renderInput:function(e){return(0,s.jsx)(ie.Z,(0,o.Z)((0,r.Z)({},e),{size:"small",label:(0,s.jsx)(Fe.Z,{title:"".concat(i," ( Single Select )"),placement:"top",children:(0,s.jsx)("div",{children:a?(0,s.jsx)(we.Z,{label:n}):n})})}))},value:c,onChange:function(e,t){var n;d(null!==(n=null===t||void 0===t?void 0:t.name)&&void 0!==n?n:null)}})})};var Re=function(e){var t,n=e.options,i=e.label,a=e.name,l=e.isRequired,u=(0,Ne.Z)(Be({name:a}),2),d=u[0],c=u[1];return(0,s.jsx)("div",{children:(0,s.jsx)(te.Z,{id:"lazada-text-attribute-input-".concat(a),freeSolo:!0,options:null!==(t=null===n||void 0===n?void 0:n.map((function(e){return e.name})))&&void 0!==t?t:[],renderInput:function(e){return(0,s.jsx)(ie.Z,(0,o.Z)((0,r.Z)({},e),{size:"small",label:(0,s.jsx)(Fe.Z,{title:"".concat(a," ( Text )"),placement:"top",children:(0,s.jsx)("div",{children:l?(0,s.jsx)(we.Z,{label:i}):i})})}))},inputValue:null!==d&&void 0!==d?d:"",onInputChange:function(e,t){c(t||null)}})})},We=function(e){var t=e.inputDetails,n=(t.id,t.name,t.advanced),i=t.input_type,r=t.is_mandatory,o=t.is_sale_prop,a=t.attribute_type;t.label,t.options;return(0,s.jsxs)("div",{className:"text-3xs opacity-50",children:[(0,s.jsx)("span",{children:i}),(0,s.jsx)("span",{className:"mx-1",children:"|"}),(0,s.jsx)("span",{children:a}),(0,s.jsx)("span",{className:"mx-1",children:"|"}),(0,s.jsx)("span",{children:0!==r?"Required":"Optional"}),(0,s.jsx)("span",{className:"mx-1",children:"|"}),(0,s.jsx)("span",{children:0!==o?"Sale":"Non-Sale"}),(0,s.jsx)("span",{className:"mx-1",children:"|"}),(0,s.jsx)("span",{children:"1"===n.is_key_prop?"Key":"Non-Key"})]})},Ae=function(e){var t=e.inputDetails,n=e.children;return(0,s.jsxs)("div",{children:[n,(0,s.jsx)(We,{inputDetails:t})]})};var Me=function(e){var t=e.inputDetails,n=(t.id,t.name),i=(t.advanced,t.input_type),r=t.is_mandatory,o=(t.is_sale_prop,t.attribute_type,t.label),a=t.options,l=0!==r;
1switch(i){case"text":case"enumInput":case"multiEnumInput":case"numeric":return(0,s.jsx)(Ae,{inputDetails:t,children:(0,s.jsx)(Re,{options:null!==a&&void 0!==a?a:[],label:o,name:n,isRequired:l})});case"singleSelect":return(0,s.jsx)(Ae,{inputDetails:t,children:(0,s.jsx)(Le,{options:null!==a&&void 0!==a?a:[],label:o,name:n,isRequired:l})});case"multiSelect":return(0,s.jsx)(Ae,{inputDetails:t,children:(0,s.jsx)(ze,{options:null!==a&&void 0!==a?a:[],label:o,name:n,isRequired:l})});default:return(0,s.jsx)(Ae,{inputDetails:t,children:(0,s.jsxs)("div",{children:[t.name," Not Implemented"]})})}};var qe=function(e){var t=(0,D.rl)(),n=t.lazadaInputDetails,i=t.defaultValues,r=(0,b.Gc)(),o=r.setValue;return r.getValues,(0,j.useEffect)((function(){!function(){var e=i.extraAttributes,t=n.map((function(t){var n,i,r=t.name,o=null!==(i=null===(n=null===e||void 0===e?void 0:e.find((function(e){return e.fieldName===r})))||void 0===n?void 0:n.value)&&void 0!==i?i:null;return{fieldName:r,value:o}}));o("extraAttributes",t)}()}),[n]),(0,s.jsx)(s.Fragment,{children:n.map((function(e){return(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(Me,{inputDetails:e})},e.id)}))})};var Ge=function(e){var t,n=e.hidden,i=(0,D.rl)(),r=i.defaultValues,o=i.currency,a=i.handleSwapFormTips,l=(0,b.Gc)(),u=l.control,d=(l.formState.errors,(0,b.qo)({control:u,name:y.II.models})),c=(0,b.qo)({control:u,name:"productVariantId"}),v=(0,b.qo)({control:u,name:"depoBalance"}),f=!!(null===d||void 0===d?void 0:d.length);return(0,s.jsxs)(ve,{gridProps:{hidden:n,id:null===(t=y.SZ[1])||void 0===t?void 0:t.id},children:[(0,s.jsx)(fe,{title:"Product Specification",subtitle:"Add more attribute to boost the searchability"}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(q.Z,{variant:"body2",sx:{fontWeight:600},children:"2. Other Information"})}),f&&(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(h.Z,{severity:"info",children:"Please configure price & sku at variation level."})}),(0,s.jsx)(p.ZP,{item:!0,xs:4,children:(0,s.jsx)(Se,{name:"brand_id",label:"Brand",defaultValues:r,methods:l})}),(0,s.jsx)(p.ZP,{item:!0,xs:4,children:(0,s.jsx)(M.Z,{label:f?"Parent SKU":"SKU",name:"sellerSku",defaultValues:r,textFieldProps:{fullWidth:!0}})}),!f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsxs)("div",{className:"flex flex-row",children:[(0,s.jsx)(pe.Z,{name:"price",textFieldProps:{autoFocus:!1,fullWidth:!0,placeholder:"",label:(0,s.jsx)(we.Z,{label:"Price"}),variant:"outlined",InputProps:{onBlur:a,onFocus:function(e){return a(e,"price")},sx:{paddingRight:"0px !important"},endAdornment:(0,s.jsx)(Ie.Z,{name:"",label:null,defaultValue:o,selectProps:{disabled:!0}})}},defaultValues:r}),(0,s.jsx)(De,{productVariantId:c})]})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(Ze.Z,{textFieldProps:{size:"small"},label:"Date on Sale (from)",name:"special_from_date",defaultValues:r})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(Ze.Z,{textFieldProps:{size:"small"},name:"special_to_date",label:"Date on Sale (to)",defaultValues:r})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(pe.Z,{name:"special_price",textFieldProps:{fullWidth:!0,placeholder:"",label:"Special Price",variant:"outlined",InputProps:{sx:{paddingRight:"0px !important"},onBlur:a,onFocus:function(e){return a(e,"special_price")},endAdornment:(0,s.jsx)(Ie.Z,{name:"",label:null,defaultValue:o,selectProps:{disabled:!0}})}},defaultValues:r})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(ke.Zu,{methods:l,name:"fromWarehouse",defaultValues:r,enableAutofillWarehouse:!0,label:"Warehouse"})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(M.Z,{label:"Package Content",name:"package_content",defaultValues:r,textFieldProps:{fullWidth:!0}})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(Ve.Z,{name:"depoBalance",label:"Deposit / Balance",options:(0,g.map)(he.oi,(function(e){return{value:e,label:e}})),defaultValues:r,selectProps:{displayEmpty:!0,renderValue:function(e){return""!==e?"".concat(e):"N/A"}}})}),v===he.oi.Deposit&&(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(pe.Z,{name:"depoFullPrice",textFieldProps:{fullWidth:!0,placeholder:"",label:(0,s.jsx)(we.Z,{label:"Full Price"}),variant:"outlined",InputProps:{sx:{paddingRight:"0px !important"},endAdornment:(0,s.jsx)(Ie.Z,{name:"",label:null,defaultValue:o,selectProps:{disabled:!0}})}},defaultValues:r})})]}),(0,s.jsx)(qe,{})]})},Ke=n(44373),Xe=n(79540),He=n(89479),Ue=n(66549),Ye=n(35069),Je=n(75097),Qe=n(33251),$e=n(94805),et=n(20986),tt=function(e){return[{headerName:"Actions",field:"actions",minWidth:150,renderCell:function(e){var t=e.row;(0,b.U2)(t,"type");return(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"mx-2 flex flex-wrap gap-2"})})}},{headerName:"Product Variants",field:"productVariants",minWidth:500,flex:2,renderCell:function(t){var n=t.row;return(0,s.jsx)("div",{className:"w-full",onClick:He.UW,children:(0,s.jsx)(Ye.Z,{product:n,select:e})})}}]},nt=function(e){var t=e.label,n=e.selectProductVariant,i=e.nameOrSkuOrBarcode,r=(0,j.use
1State)(!1),o=r[0],a=r[1],l={nameOrSkuOrBarcode:i},u=function(){a(!1)};return(0,s.jsx)($e.Z,{isOpen:o,setIsOpen:a,dialogProps:{open:o,onClose:function(){return u()},maxWidth:"xl"},button:(0,s.jsxs)(x.Z,{variant:"outlined",color:t?"info":"error",size:"small",onClick:function(){a(!0)},children:[(0,s.jsx)("span",{className:"".concat(t?"text-blue-400":"text-red-400"," line-clamp-2"),children:"".concat(t||"Select")}),!t&&(0,s.jsx)(et.sG,{id:"click-me",className:"!text-red-500"})]}),title:"Select a product variant",description:"".concat(i),children:(0,s.jsx)(Qe.X,{newColumns:tt((function(e,t){n(e,t),u()})),children:(0,s.jsx)(Ue.GW,{defaultFilters:l,children:(0,s.jsx)(Je.Z,{})})})})},it=function(e){var t,n=(0,L.uj)().productVariantDetails,i=(0,b.Gc)(),r=(i.getValues,i.setValue),o=(0,i.watch)("prodVarInfo");return(0,s.jsx)("div",{children:(0,s.jsx)(nt,{label:o?"<".concat(null===o||void 0===o?void 0:o.sku,"> ").concat(null===o||void 0===o?void 0:o.name):"",nameOrSkuOrBarcode:null!==(t=null===n||void 0===n?void 0:n.sku)&&void 0!==t?t:void 0,selectProductVariant:function(e,t){var n=t.name,i=t.sku,o={name:null!==n&&void 0!==n?n:"",sku:null!==i&&void 0!==i?i:""};r("productVariantId",e),r("prodVarInfo",o)}})})},rt=n(38382),ot=n(89289),at=n(90896),lt=n(86777),st=n(90244),ut=n(93978),dt=n(69417),ct=n(5605),vt=n(39807),ft=n(61977),mt=n(95520),pt=n(84196),ht=n(74098),xt=n(80562),gt=n(43963);var jt=function(e){var t=e.defaultValues,n=e.PREFIX,i=(0,j.useState)(null),r=i[0],o=i[1],a=Boolean(r),l=a?"configure-stock-info-popover":void 0,u=(0,b.Gc)().control,d=(0,b.qo)({control:u,name:"".concat(null!==n&&void 0!==n?n:"","shareStock")}),c=(0,b.qo)({control:u,name:"".concat(null!==n&&void 0!==n?n:"","autoReload")}),v=(0,b.qo)({control:u,name:"".concat(null!==n&&void 0!==n?n:"","customStock")}),f=null;return(0,g.isNil)(v)?d?f="O":c&&(f="A"):f="C",(0,s.jsxs)("div",{children:[(0,s.jsx)(Fe.Z,{title:"Stock Config",children:(0,s.jsx)(xt.Z,{color:"info",size:"small",sx:{m:2},onClick:function(e){o(e.currentTarget)},children:(0,s.jsx)(pt.g,{variant:"standard",invisible:!f,badgeContent:(0,s.jsx)(Fe.Z,{title:f?mt.Q[f]:null,children:(0,s.jsx)("span",{children:f})}),color:"C"===f?"info":"success",anchorOrigin:{vertical:"top",horizontal:"right"},children:(0,s.jsx)(ht.vq,{})})})}),(0,s.jsx)(gt.ZP,{id:l,open:a,anchorEl:r,onClose:function(){o(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,s.jsx)("div",{className:"mx-5 my-2",children:(0,s.jsx)(Xe.Z,{defaultValues:t,PREFIX:n})})})]})},bt=n(37106),yt=function(e){var t=e.defaultValues,n=e.PREFIX,i=(0,D.rl)(),r=i.currency;i.storeId;return(0,s.jsx)("div",{children:(0,s.jsxs)(p.ZP,{container:!0,spacing:3,sx:{p:2},children:[(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)("div",{className:"px-1 font-bold underline",children:"Sales Config"})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(pe.Z,{name:"".concat(n,".special_price"),textFieldProps:{fullWidth:!0,placeholder:"",label:"Special Price",variant:"outlined",InputProps:{sx:{paddingRight:"0px !important"},endAdornment:(0,s.jsx)(Ie.Z,{name:"",label:null,defaultValue:r,selectProps:{disabled:!0}})}},defaultValues:t})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(Ze.Z,{textFieldProps:{size:"small"},label:"Date on Sale (from)",name:"".concat(n,".special_from_date"),defaultValues:t})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sm:4,children:(0,s.jsx)(Ze.Z,{textFieldProps:{size:"small"},name:"".concat(n,".special_to_date"),label:"Date on Sale (to)",defaultValues:t})})]})})},It=function(e){var t=e.defaultValues,n=e.PREFIX,i=(0,j.useState)(null),r=i[0],o=i[1],a=Boolean(r),l=a?"lazada-special-price-popover":void 0;return(0,s.jsxs)("div",{children:[(0,s.jsx)(Fe.Z,{title:"Sales Config",children:(0,s.jsx)(xt.Z,{color:"success",size:"small",sx:{m:2},onClick:function(e){o(e.currentTarget)},children:(0,s.jsx)(bt.UdJ,{className:"text-2xl"})})}),(0,s.jsx)(gt.ZP,{id:l,open:a,anchorEl:r,onClose:function(){o(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,s.jsx)("div",{className:"mx-3 my-2",children:(0,s.jsx)(yt,{defaultValues:t,PREFIX:n})})})]})},Zt=function(e){var t,n=(0,L.uj)().productVariantDetails,i=(0,D.rl)(),r=i.currency,o=i.defaultValues,a=(0,b.Gc)(),l=a.control,u=(a.getValues,a.setValue),d=a.watch,c=((0,b.qo)({name:"sellerSku",control:l}),(0,b.Dq)({control:l,name:y.II.models,keyName:"uid"}).fields),v=!!c.length,f=(0,ft.m)(v);if(!v)return null;var m=c[0],p="100px";return(0,s.jsx)("div",{className:"h-full max-w-[61vw] overflow-auto 2xl:max-w-[67vw]",children:(0,s.jsx)("div",{className:"flex justify-between",children:(0,s.jsx)(lt.Z,{ref:f,children:(0,s.jsxs)(st.Z,{size:"small",children:[(0,s.jsx)(ut.Z,{children:(0,s.jsxs)(dt.Z,{children:[(0,s.jsx)(ct.Z,{width:p,children:"Variant"}),null===m||void 0===m||null===(t=m.variations)||void 0===t?void 0:t.map((function(e){return(0,s.jsx)(ct.Z,{width:"5%",children:e.name},e.name)})),(0,s.jsx)(ct.Z,{width:"17%",children:"Price"}),(0,s.jsx)(ct.Z,{width:"17%",children:"Sku/Image"}),(0,s.jsx)(ct.Z,{width:"17%",children:"Deposit / Balance"}),(0,s.jsx)(ct.Z,{width:"17%",children:"Warehouse"}),(0,s.jsx)(ct.Z,{width:"5%",children:"Stock"})]})}),(0,s.jsx)(vt.Z,{children:null===c||void 0===c?void 0:c.map((function(e,t){var i,l,c="".concat(y.II.models,".").concat(t),v=d("".concat(c,".prodVarInfo")),f=d("".concat(c,".productVariantId")),m=d("".concat(c,".depoBalance"));return(0,s.jsxs)(dt.Z,{children:[(0,s.jsx)(ct.Z,{width:p,children:(0,s.jsx)(nt,{label:v?"<".concat(null===v||void 0===v?void 0:v.sku,"> ").concat(null===v||void 0===v?void 0:v.name):"",nameOrSkuOrBarcode:null!==(l=null===n||void 0===n?void 0:n.sku)&&void 0!==l?l:void 0,selectProductVariant:function(e,t){var n="".concat(c,".productVariantId"),i="".concat(c,".prodVarInfo"),r=(0,b.U2)(t,"name"),o=(0,b.U2)(t,"sku"),a={name:null!==r&&void 0!==r?r:"",sku:null!==o&&void 0!==o?o:""};u(n,e),u(i,a)}})}),null===e||void 0===e||null===(i=e.variations)||void 0===i?void 0:i.map((function(e){return(0,s.jsx)(ct.Z,{width:"5%",children:e.value},e.name)})),(0,s.jsx)(ct.Z,{width:"17%",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(pe.Z,{name:"".concat(c,".price"),textFieldProps:{fullWidth:!0,placeholder:"",label:"Price",variant:"outlined",InputProps:{sx:{paddingRight:"0px !important"},endAdornment:(0,s.jsx)(Ie.Z,{name:"",label:null,defaultValue:r,selectProps:{disabled:!0}})}},defaultValues:o}),(0,s.jsx)(It,{defaultValues:o,PREFIX:c}),(0,s.jsx)(De,{productVariantId:f,PREFIX:c})]})}),(0,s.jsx)(ct.Z,{width:"17%",children:(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)("div",{className:"min-w-[8rem]",children:(0,s.jsx)(M.Z,{label:"sku",name:"".concat(c,".sellerSku"),defaultValues:o,textFieldProps:{fullWidth:!0}})})})}),(0,s.jsxs)(ct.Z,{width:"17%",children:[(0,s.jsx)(Ve.Z,{name:"".concat(c,".depoBalance"),label:"Depo / Bal",options:(0,g.map)(he.oi,(function(e){return{value:e,label:e}})),defaultValues:o,selectProps:{displayEmpty:!0,renderValue:function(e){return""!==e?"".concat(e):"N/A"}}}),m===he.oi.Deposit&&(0,s.jsx)(pe.Z,{name:"".concat(c,".depoFullPrice"),textFieldProps:{fullWidth:!0,placeholder:"",label:(0,s.jsx)(we.Z,{label:"Full Price"}),variant:"outlined",InputProps:{sx:{paddingRight:"0px !important"},endAdornment:(0,s.jsx)(Ie.Z,{name:"",label:null,defaultValue:r,selectProps:{disabled:!0}})}},defaultValues:o})]}),(0,s.jsx)(ct.Z,{width:"17%",children:(0,s.jsx)("div",{className:"min-w-[9rem]",children:(0,s.jsx)(ke.Zu,{methods:a,name:"".concat(c,".fromWarehouse"),defaultValues:o,enableAutofillWarehouse:!0,label:"Warehouse"})})}),(0,s.jsxs)(ct.Z,{width:"5%",children:[(0,s.jsx)(jt,{defaultValues:o,PREFIX:"".concat(c,".")}),(0,s.jsx)(at.Z,{productVariantId:f})]})]},null===e||void 0===e?void 0:e.uid)}))})]})})})})},Vt=n(14924),kt=n(19248),wt=function(e){var t,n=e.PREFIX,i=(0,D.rl)().defaultValues,r=null!==(t=(0,g.get)(i,"".concat(n,".imageUrls")))&&void 0!==t?t:[];return(0,s.jsx)("div",{children:(0,s.jsxs)(p.ZP,{container:!0,spacing:3,sx:{p:2},children:[(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)("div",{className:"px-1 font-bold underline",children:"Model Images"})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(ge.Z,{name:"".concat(n,".imageUrls"),defaultValues:i,defaultValue:r})})]})})}
1,_t=function(e){var t=e.PREFIX,n=(0,j.useState)(null),i=n[0],r=n[1],o=Boolean(i),a=o?"lazada-model-image-popover":void 0;return(0,s.jsxs)("div",{children:[(0,s.jsx)(Fe.Z,{title:"Images",children:(0,s.jsx)(xt.Z,{color:"success",size:"small",sx:{m:2},onClick:function(e){r(e.currentTarget)},children:(0,s.jsx)(kt.ZK,{className:""})})}),(0,s.jsx)(gt.ZP,{id:a,open:o,anchorEl:i,onClose:function(){r(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,s.jsx)("div",{className:"mx-3 my-2",children:(0,s.jsx)(wt,{PREFIX:t})})})]})},Pt=function(e){return!!(null===e||void 0===e?void 0:e.length)&&new Set(e).size!==e.length},St=function(e){var t=e.keyIndex,n=e.removeTierVarKey,i=e.onValueChange,a=e.triggerLoading,l=e.loadingRef,u=(0,D.rl)().defaultValues,d=(0,b.Gc)(),c="".concat(y.II.variations,".").concat(t,".").concat(y.II.variationOptions),v=d.control,m=d.getValues,p=d.setValue,h=(d.watch,(0,b.Dq)({control:v,name:c,keyName:"uid"})),j=h.fields,I=h.remove,Z=h.append;return(0,s.jsxs)("div",{className:"ml-5 flex w-3/5 flex-col gap-5",children:[j.map((function(e,d){var v="".concat(c,".").concat(d);return(0,s.jsxs)("div",{className:"flex flex-row",children:[(0,s.jsx)(M.Z,{name:"".concat(v,".").concat(y.II.variationOptionsOption),defaultValue:e[y.II.variationOptionsOption]||"",textFieldProps:{size:"small",onInput:i,onKeyDown:function(e){a(),"Enter"===e.key&&e.preventDefault()}},label:"Value"}),(0,s.jsx)(_t,{PREFIX:v}),(0,s.jsx)(x.Z,{onClick:function(){return function(e){var i,a,s,d,c,v,h;if(l.current)(0,f.JT)("Please wait...");else{var x=m(),j=Nt(x),b=j.tierVarList,Z=j.model_list,V=null===(i=(0,g.get)(b,"[".concat(t,"].").concat(y.II.variationOptions)))||void 0===i?void 0:i.length,k=b.length;if(Pt(null===b||void 0===b?void 0:b.map((function(e){return e.name}))))(0,f.JT)("Please enter unique key.");else if(Pt(null===b||void 0===b||null===(a=b[t])||void 0===a||null===(s=a.values)||void 0===s?void 0:s.map((function(e){return e.value}))))(0,f.JT)("Please enter unique key.");else{if(k<=1&&V<=1&&Nt(u).tierVarList.length)return void(0,f._N)("You cannot switch to no variation.");var w,_=null===b||void 0===b||null===(d=b[t])||void 0===d?void 0:d.name,P=null===b||void 0===b||null===(c=b[t])||void 0===c||null===(v=c.values)||void 0===v||null===(h=v[e])||void 0===h?void 0:h.value,S=[];if(V>1?(S=Z.filter((function(e){var t;return!(null!==(t=e.variations)&&void 0!==t?t:[]).some((function(e){var t,n=(0,g.pick)(e,[y.II.modelVariantKey,y.II.modelVariantValue]);return(0,g.isEqual)(n,(t={},(0,Vt.Z)(t,y.II.modelVariantKey,_),(0,Vt.Z)(t,y.II.modelVariantValue,P),t))}))})),I(e)):1===V&&(S=(S=Z.map((function(e){var t,n=(null!==(t=e.variations)&&void 0!==t?t:[]).filter((function(e){var t,n=(0,g.pick)(e,[y.II.modelVariantKey,y.II.modelVariantValue]);return!(0,g.isEqual)(n,(t={},(0,Vt.Z)(t,y.II.modelVariantKey,_),(0,Vt.Z)(t,y.II.modelVariantValue,P),t))}));return(0,o.Z)((0,r.Z)({},e),(0,Vt.Z)({},y.II.modelVariants,n))}))).filter((function(e){var t;return((null===e||void 0===e||null===(t=e.variations)||void 0===t?void 0:t.length)||0)>0})),I(e),n(t)),k<=1&&V<=1)null===u||void 0===u||null===(w=u[y.II.models])||void 0===w||w.length,p(y.II.models,[],{shouldDirty:!0});else p(y.II.models,S,{shouldDirty:!0})}}}(d)},type:"button",variant:"text",sx:{mx:3},color:"error",children:(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsx)(et.pJ,{className:"stroke-current text-base"})})})]},e.uid)})),(0,s.jsx)("div",{children:(0,s.jsx)(x.Z,{size:"small",onClick:function(e){!function(){var e,n;if(l.current)(0,f.JT)("Please wait...");else{var i=m(),a=Nt(i),s=a.tierVarList,u=a.model_list;if(Pt(null===s||void 0===s||null===(e=s[t])||void 0===e?void 0:e.values.map((function(e){return e.value}))))(0,f.JT)("Please enter unique values.");else{var d=(0,g.cloneDeep)(s),c=null===(n=d[t])||void 0===n?void 0:n[y.II.variationOptions];if(c)if(c.some((function(e){return!e[y.II.variationOptionsOption]})))(0,f.JT)("Please key in the value above.");else{c.push((0,Vt.Z)({},y.II.variationOptionsOption,""));var v=(0,rt.aD)({tierVarList:d,tierVarValuesName:y.II.variationOptions,tierVarValuesValueName:y.II.variationOptionsOption,tierVarKeyName:y.II.variationName,modelVariantsName:y.II.modelVariants,modelVariantsKeyName:y.II.modelVariantKey,modelVariantsValueName:y.II.modelVariantValue}).map((function(e){var t;return u.find((function(t){return(0,g.isEqual)(t.variations,e.variations)}))||(0,o.Z)((0,r.Z)({productVariantId:"",sellerSku:"",autoReload:!1,shareStock:!1,price:"0"},y.uX),{variations:null!==(t=e.variations)&&void 0!==t?t:[],fromWarehouse:null})}));p(y.II.models,v,{shouldDirty:!0}),Z((0,Vt.Z)({},y.II.variationOptionsOption,""))}else(0,f._N)("Missing Tier Variation")}}}()},variant:"outlined",type:"button",children:"+ Add value"})})]})},Nt=function(e){return{tierVarList:(0,g.get)(e,y.II.variations)||[],model_list:(0,g.get)(e,y.II.models)||[]}},Ct=function(e){var t=(0,D.rl)(),n=t.defaultValues,i=t.listingMode,a=(0,j.useRef)(!1),l=(0,j.useCallback)((function(){a.current=!0,setTimeout((function(){a.current=!1}),1e3)}),[a]),u=(0,b.Gc)(),d=u.control,c=u.getValues,v=u.setValue,m=(0,b.Dq)({control:d,name:y.II.variations,keyName:"uid"}),p=m.fields,h=m.remove,I=p.filter((function(e){return!!e})).length>
10,Z=(0,g.debounce)((function(){var e=c(),t=Nt(e),n=t.tierVarList,i=t.model_list,a=(0,rt.aD)({tierVarList:n,tierVarValuesName:y.II.variationOptions,tierVarValuesValueName:y.II.variationOptionsOption,tierVarKeyName:y.II.variationName,modelVariantsName:y.II.modelVariants,modelVariantsKeyName:y.II.modelVariantKey,modelVariantsValueName:y.II.modelVariantValue}).map((function(e,t){var n,a,l,s,u,d,c,v,f,m,p,h,x=i[t];return(0,o.Z)((0,r.Z)({},x),{productVariantId:null===x||void 0===x?void 0:x.productVariantId,sellerSku:null!==(n=null===x||void 0===x?void 0:x.sellerSku)&&void 0!==n?n:"",autoReload:null!==(a=null===x||void 0===x?void 0:x.autoReload)&&void 0!==a&&a,shareStock:null!==(l=null===x||void 0===x?void 0:x.shareStock)&&void 0!==l&&l,price:null!==(s=null===x||void 0===x?void 0:x.price)&&void 0!==s?s:"0",fulfillableStock:null===(u=null===x||void 0===x?void 0:x.fulfillableStock)||void 0===u||u,usedStock:null===(d=null===x||void 0===x?void 0:x.usedStock)||void 0===d||d,inCartStock:null===(c=null===x||void 0===x?void 0:x.inCartStock)||void 0===c||c,damagedStock:null===(v=null===x||void 0===x?void 0:x.damagedStock)||void 0===v||v,dropshipStock:null===(f=null===x||void 0===x?void 0:x.dropshipStock)||void 0===f||f,incomingStock:null===(m=null===x||void 0===x?void 0:x.incomingStock)||void 0===m||m,confirmedIncomingStock:null===(p=null===x||void 0===x?void 0:x.confirmedIncomingStock)||void 0===p||p,variations:null!==(h=e.variations)&&void 0!==h?h:[],fromWarehouse:null})}));v(y.II.models,a,{shouldDirty:!0})}),1e3);return(0,s.jsx)("div",{className:"flex items-center gap-5",children:(0,s.jsxs)("div",{className:I?"w-full":"",children:[(0,s.jsx)("ul",{className:"mb-0",children:p.map((function(e,t){return(0,s.jsxs)("li",{className:"mb-5 flex flex-wrap",children:[(0,s.jsx)("div",{className:"w-60",children:(0,s.jsx)(M.Z,{name:"tierVarList.".concat(t,".name"),defaultValues:n,defaultValue:e.name||"",textFieldProps:{size:"small",fullWidth:!1,onInput:Z,onKeyDown:function(e){l(),"Enter"===e.key&&e.preventDefault()}},label:"Variation Key Name"})}),(0,s.jsx)(St,{keyIndex:t,removeTierVarKey:h,onValueChange:Z,triggerLoading:l,loadingRef:a,defaultValues:n})]},e.uid)}))}),(0,s.jsx)(x.Z,{size:"small",variant:"outlined",onClick:function(){var e=c(),t=Nt(e),a=t.tierVarList,l=t.model_list;if(null===a||void 0===a?void 0:a.some((function(e){return!e.name})))(0,f.JT)("Please fill in the key above.");else{var s;if(i===ot.ZR.Update)if(!(null===(s=n[y.II.variations])||void 0===s?void 0:s.length))return void(0,f._N)("You cannot add more variations to a single variation listing.");var u=null===a||void 0===a?void 0:a.concat([{name:"",values:[{value:""}]}]);v(y.II.variations,u,{shouldDirty:!0});var d=[];if(I)d=l.map((function(e){var t,n;return(0,o.Z)((0,r.Z)((0,o.Z)((0,r.Z)({},e),{price:null!==(n=null===e||void 0===e?void 0:e.price)&&void 0!==n?n:"0"}),y.uX),{variations:null===e||void 0===e||null===(t=e.variations)||void 0===t?void 0:t.concat([{name:"",value:""}])})}));else{var m,p,h,x,g,j,b,Z,V=null===l||void 0===l?void 0:l[0];d=[(0,o.Z)((0,r.Z)({},null!==V&&void 0!==V?V:{}),{productVariantId:"",sellerSku:"",autoReload:!1,shareStock:!1,fulfillableStock:null===(m=null===V||void 0===V?void 0:V.fulfillableStock)||void 0===m||m,usedStock:null===(p=null===V||void 0===V?void 0:V.usedStock)||void 0===p||p,inCartStock:null===(h=null===V||void 0===V?void 0:V.inCartStock)||void 0===h||h,damagedStock:null===(x=null===V||void 0===V?void 0:V.damagedStock)||void 0===x||x,dropshipStock:null===(g=null===V||void 0===V?void 0:V.dropshipStock)||void 0===g||g,incomingStock:null===(j=null===V||void 0===V?void 0:V.incomingStock)||void 0===j||j,confirmedIncomingStock:null===(b=null===V||void 0===V?void 0:V.confirmedIncomingStock)||void 0===b||b,price:null!==(Z=null===V||void 0===V?void 0:V.price)&&void 0!==Z?Z:"0",variations:[{name:"",value:""}],fromWarehouse:null})]}v(y.II.models,d,{shouldDirty:!0})}},fullWidth:!I,type:"button",children:I?"+ Add key":"Enable multi variations"}),(0,s.jsx)("div",{className:"border-t",children:(0,s.jsx)(Zt,{})})]})})};var Et=function(e){var t,n,i=e.hidden,r=(0,D.rl)().defaultValues,o=(0,b.Gc)().control,a=(0,b.qo)({control:o,name:y.II.models}),l=!!(null===a||void 0===a?void 0:a.length),u=r.productVariantId,d=null!==(n=r[y.II.variations])&&void 0!==n?n:[];return(0,s.jsxs)(ve,{gridProps:{hidden:i,id:null===(t=y.SZ[2])||void 0===t?void 0:t.id},children:[(0,s.jsx)(fe,{title:"Price, Stock & Variants",subtitle:"Add variants when the product have different versions, such as color and size"}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(q.Z,{variant:"body2",sx:{fontWeight:600},children:"3. Stock"})}),l?(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(h.Z,{severity:"info",children:"Please configure custom stock & stock config at variation level."})}):(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(Xe.Z,{defaultValues:r})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(Ke.Z,{})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(q.Z,{variant:"body2",sx:{fontWeight:600},children:"4. Variations"})}),!u&&!d.length&&(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(it,{})}),(0,s.jsx)(p.ZP,{item:!0,xs:12,children:(0,s.jsx)(Ct,{})})]})},Ot=n(12161),Tt=function(e){var t,n=e.onSubmit,I=(e.listingMode,(0,D.rl)()),Z=I.triggerGetLazadaCategoryAttributes,V=I.defaultValues,k=(0,j.use
1State)(!1),w=k[0],_=k[1],P=(0,b.cI)({defaultValues:V,resolver:(0,c.X)(y.B1)}),S=function(){var e=(0,i.Z)((function(e){var t,i,s,u,d,c,v,m,p,h,x,j,b,y,I,Z,V,k,w,_,P=arguments;return(0,l.__generator)(this,(function(l){switch(l.label){case 0:return t=P.length>1&&void 0!==P[1]&&P[1],i=e.images,s=e.primary_category,e.prodVarInfo,u=e.skus,d=e.package_height,c=e.package_length,v=e.package_weight,m=e.package_width,p=e.tierVarList,h=e.brand_id,x=e.fromWarehouse,j=e.extraAttributes,b=e.customStock,y=(0,a.Z)(e,["images","primary_category","prodVarInfo","skus","package_height","package_length","package_weight","package_width","tierVarList","brand_id","fromWarehouse","extraAttributes","customStock"]),I=function(e){if(void 0!==e)return null===e?null:Math.max(0,e)},(0,g.isNil)(s)?((0,f._N)("Please select a category"),[2]):(0,g.isNil)(h)?((0,f._N)("Please select a brand"),[2]):(k=null!==(V=(0,g.map)(u,(function(e){e.prodVarInfo;var t=e.fromWarehouse,n=e.customStock,i=(0,a.Z)(e,["prodVarInfo","fromWarehouse","customStock"]);return(0,o.Z)((0,r.Z)({},i),{customStock:I(n),package_height:e.package_height||d,package_length:e.package_length||c,package_weight:e.package_weight||v,package_width:e.package_width||m,fromWarehouseId:(null===t||void 0===t?void 0:t.value)||void 0})})),Z=V,V)&&void 0!==Z?Z:[],w=(0,Ot.bv)(j),_=(0,o.Z)((0,r.Z)({},y),{customStock:I(b),brand_id:h,extraAttributes:w,primary_category:+s,images:null!==i&&void 0!==i?i:[],fromWarehouseId:(null===x||void 0===x?void 0:x.value)||void 0,package_height:d,package_length:c,package_weight:v,package_width:m,tierVarList:(0,g.map)(p,(function(e){return{name:e.name,values:e.values.map((function(e){var t,n;return{imageUrls:null===(t=e.imageUrls)||void 0===t?void 0:t.map((function(e){return e.content})),value:null!==(n=e.value)&&void 0!==n?n:""}}))}})),skus:k}),[4,n(_,t)]);case 1:return l.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),N=P.control,C=P.handleSubmit,E=P.reset,O=P.formState,T=O.isSubmitting,F=O.errors,B=P.watch,L=(P.getValues,P.setValue,B("primary_category")),R=((0,g.get)(V,"productVariantId"),t=(0,g.get)(V,y.II.variations),(0,b.qo)({control:N,name:"productVariantId"}),(0,b.qo)({control:N,name:y.II.models}));(0,b.qo)({control:N,name:"depoBalance"}),null===R||void 0===R||R.length;(0,j.useEffect)((function(){V&&E(V)}),[V,E]),(0,j.useEffect)((function(){if(R){var e=R.some((function(e){return!e.productVariantId}));_(!!e)}else _(!1)}),[R]),(0,j.useEffect)((function(){L&&Z(L)}),[L,Z]);var A=!L;return(0,s.jsxs)("div",{className:"grid grid-cols-12 gap-5",children:[(0,s.jsxs)("div",{className:"col-span-10",children:[(0,s.jsx)(d.Z,{open:T}),(0,s.jsxs)(u.e,{methods:P,onSubmit:C((function(e){return S(e,!1)})),defaultValues:V,children:[(0,s.jsx)(W,{}),(0,s.jsxs)("div",{className:"grid gap-5",children:[(0,s.jsx)(me,{}),(0,s.jsx)(Ge,{hidden:A}),(0,s.jsx)(Et,{hidden:A}),(0,s.jsx)(ye,{hidden:A}),(0,s.jsx)(xe,{hidden:A}),(0,s.jsxs)(m.Z,{children:[!L&&(0,s.jsx)("div",{className:"py-8"}),(0,s.jsx)(p.ZP,{item:!0,xs:12,sx:{pt:function(e){return"".concat(e.spacing(7)," !important")}},children:w&&(0,s.jsxs)(h.Z,{className:"mb-4",severity:"warning",children:["You have not ",(0,s.jsx)("strong",{children:"selected"})," a product variant for one of the variations!"]})}),(0,s.jsxs)(p.ZP,{hidden:!0,item:!0,xs:12,sx:{pt:function(e){return"".concat(e.spacing(7)," !important")}},children:[w&&(0,s.jsxs)(h.Z,{className:"mb-4",severity:"warning",children:["You have not ",(0,s.jsx)("strong",{children:"selected"})," a product variant for one of the variations!"]}),(0,s.jsx)(x.Z,{type:"submit",variant:"outlined",sx:{mr:2},disabled:!(0,v.Q)(F),children:"Save"}),(0,s.jsx)(x.Z,{variant:"contained",sx:{mr:2},disabled:!(0,v.Q)(F),onClick:C((function(e){return S(e,!0)})),children:"Save & Sync to Lazada"})]})]})]})]})]}),(0,s.jsx)(z,{errors:F,_onSubmit:S,handleSubmit:C})]})}},12161:function(e,t,n){"use strict";n.d(t,{bv:function(){return m},d1:function(){return f}});var i=n(14924),r=n(26042),o=n(69396),a=n(79978),l=n(38382),s=n(25543),u=n(78648),d=n(96277),c=n(96486),v=n(2014),f=function(e){var t,n=e.productType,f=e.productTierVars,m=e.productVariants,p=[],h=[];if(n===d.kvN.Variation)p=null!==(t=null===f||void 0===f?void 0:f.map((function(e){var t=e.name,n=e.options;return{name:t,values:null===n||void 0===n?void 0:n.map((function(e){var n=function(e,t,n){if(!e)return[];var i,r=e.find((function(e){return e.details.variants.some((function(e){var i=e.key,r=e.value;return(0,c.isEqual)({key:i,value:r},{key:t,value:n})}
1))}));return null!==(i=null===r||void 0===r?void 0:r.details.images)&&void 0!==i?i:[]}(m,t,e);return{value:e,imageUrls:n}}))}})))&&void 0!==t?t:[],h=function(e,t){var n=e.map((function(e){var t;return t={},(0,i.Z)(t,u.wu.variationName,e.name),(0,i.Z)(t,u.wu.variationOptions,e.options.map((function(e){return(0,i.Z)({},u.wu.variationOptionsOption,e)}))),t}));return(0,l.aD)({tierVarList:n,tierVarValuesName:u.wu.variationOptions,tierVarValuesValueName:u.wu.variationOptionsOption,tierVarKeyName:u.wu.variationName,modelVariantsName:u.wu.modelVariants,modelVariantsKeyName:u.wu.modelVariantKey,modelVariantsValueName:u.wu.modelVariantValue}).map((function(e){return t.find((function(t){return(0,s.n)(t,e)}))||(0,o.Z)((0,r.Z)({},a.a0),{details:(0,r.Z)({},a.a0.details,e)})})).map((function(e,t){var n,i=e.sku,o=e.id,a=e.name,l=e.details,s=null!==l&&void 0!==l?l:{},u=s.variants,d=void 0===u?[]:u,c=s.retailPrice,f="".concat(null!==(n=null===c||void 0===c?void 0:c.amount)&&void 0!==n?n:""),m=null===d||void 0===d?void 0:d.map((function(e){return{name:null===e||void 0===e?void 0:e.key,value:null===e||void 0===e?void 0:e.value}}));return(0,r.Z)({productVariantId:null!==o&&void 0!==o?o:"",sellerSku:null!==i&&void 0!==i?i:"",price:f,prodVarInfo:{name:null!==a&&void 0!==a?a:"",sku:null!==i&&void 0!==i?i:""},fromWarehouse:null,variations:m},v.uX)}))}(f,null!==m&&void 0!==m?m:[]);else if(n===d.kvN.Carton){var x,g=(0,c.sortBy)(m,"name"),j=[d.GeV.CartonBox,d.GeV.CartonSet,d.GeV.Normal],b=(0,c.sortBy)(g,(function(e){return j.indexOf(e.type)}));p=[{name:"models",values:b.map((function(e){return{value:null!==(x=e.name)&&void 0!==x?x:""}}))}];(0,l.aD)({tierVarList:p,tierVarValuesName:v.II.variationOptions,tierVarValuesValueName:v.II.variationOptionsOption,tierVarKeyName:v.II.variationName,modelVariantsName:v.II.modelVariants,modelVariantsKeyName:v.II.modelVariantKey,modelVariantsValueName:v.II.modelVariantValue}).map((function(e,t){var n,i,a,l=b[t];return(0,o.Z)((0,r.Z)({},l),{id:null!==(i=null===l||void 0===l?void 0:l.id)&&void 0!==i?i:"",details:(0,r.Z)((0,o.Z)((0,r.Z)({},null===l||void 0===l?void 0:l.details),{images:null!==(a=null===l||void 0===l||null===(n=l.details)||void 0===n?void 0:n.images)&&void 0!==a?a:[]}),e)})}));h=[]}return{tierVarList:p,modelList:h}},m=function(e){return e.filter((function(e){return null!==e.value}))}},76417:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var i=n(85893),r=n(87536),o=n(26042),a=n(69396),l=(n(77664),n(5152)),s=n.n(l)()((function(){return Promise.all([n.e(5077),n.e(8329)]).then(n.bind(n,68329)).then((function(e){return e.default}))}),{loadableGenerated:{webpack:function(){return[68329]}},ssr:!1}),u=function(e){var t=e.label,n=e.value,r=void 0===n?"":n,o=e.setValue,a=e.error,l=e.richTextEditorProps,u=e.transformOutputHandler;return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"px-2 text-xs font-bold",children:t}),(0,i.jsx)(s,{value:r,onValueChange:o,error:a,richTextEditorProps:l,transformOutputHandler:u})]})},d=n(55343),c=n(32631),v=n(96486),f=n(6328);var m=function(e){var t,n=e.methods,l=e.name,s=e.label,m=e.defaultValue,p=e.defaultValues,h=e.rules,x=e.richTextEditorProps,g=e.controllerProps,j=e.formControlProps,b=void 0===j?f.f:j,y=e.transformOutputHandler,I=n.control,Z=(0,r.cl)({control:I}).errors,V=(0,v.get)(Z,l),k=m||(0,v.get)(p,l),w=(0,f.V)(l,s);return(0,i.jsxs)(d.Z,(0,a.Z)((0,o.Z)({},b),{children:[(0,i.jsx)(r.Qr,(0,o.Z)({name:l,control:I,defaultValue:k,rules:h,render:function(e){var t=e.field,n=t.value,r=t.onChange;t.onBlur;return(0,i.jsx)(u,{value:n||"",setValue:function(e){return r(e)},error:Boolean(V),label:w,richTextEditorProps:x,transformOutputHandler:y})}},g)),V&&(0,i.jsx)(c.Z,{sx:{color:"error.main"},children:null===(t=V.message)||void 0===t?void 0:t.toString()})]}))},p=function(e){var t=e.name,n=e.defaultValue,o=e.label,a=e.rules,l=e.defaultValues,s=e.controllerProps,u=e.formControlProps,d=e.richTextEditorProps,c=e.transformOutputHandler,v=(0,r.Gc)();return(0,i.jsx)(m,{name:t,label:o,rules:a,defaultValue:n,defaultValues:l,controllerProps:s,formControlProps:u,richTextEditorProps:d,methods:v,transformOutputHandler:c})}},61977:function(e,t,n){"use strict";n.d(t,{m:function(){return r}});var i=n(67294),r=function(e){var t=(0,i.useRef)(null);return(0,i.useEffect)((function(){var n=t.current;if(n&&e){var i=function(e){if(0!==e.deltaY&&!(n.scrollWidth<=n.clientWidth)){var t=n.scrollLeft+n.clientWidth>=n.scrollWidth,i=0===n.scrollLeft;t&&e.deltaY>10||i&&e.deltaY<-10||(e.preventDefault(),n.scrollLeft+=e.deltaY)}};return n.addEventListener("wheel",i,{passive:!1}),function(){return n.removeEventListener("wheel",i)}}return function(){}}),[e]),t}},648:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return y}});var i=n(85893),r=n(34888),o=n(47568),a=n(828),l=n(29815),s=n(70655),u=n(96277),d=n(60445),c=n(89289),v=n(43085),f=n(96486),m=n(11163),p=n(67294),h=n(2014),x=n(96735),g=n(37563),j=n(12161),b=function(e){var t,n,b,y=(0,r.uj)(),I=y.productVariantDetails,Z=y.productDetails,V=y.storeDetails,k=(0,m.useRouter)(),w=k.query,_=w.productVariantId,P=w.ePlatformStoreId,S=w.currency,N=w.mode,C=null!==(t=null===_||void 0===_?void 0:_.toString())&&void 0!==t?t:"",E=null!==(n=null===P||void 0===P?void 0:P.toString())&&void 0!==n?n:"",O=null!==(b=null===S||void 0===S?void 0:S.toString())&&void 0!==b?b:"",T=N===c.MW.Single?c.MW.Single:c.MW.Multiple,D=(0,a.Z)((0,d.A2)(),1
1)[0],F=function(){var e=(0,o.Z)((function(e){var t,n,i,r,o,a=arguments;return(0,s.__generator)(this,(function(l){switch(l.label){case 0:return t=a.length>1&&void 0!==a[1]&&a[1],[4,D({variables:{createLazadaProductInput:e,ePlatformStoreId:E,listToLazada:t}})];case 1:return i=l.sent(),(null===(r=i.data)||void 0===r||null===(n=r.createLazadaItem)||void 0===n?void 0:n.id)&&((0,v.x9)("Listing created successfully"),(o=r.createLazadaItem.itemUrl)&&window.open(o,"_blank"),k.push("/apps/product/all-product")),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),B=(0,p.useMemo)((function(){var e,t,n,i,r,o,a=null!==(i=(0,f.get)(Z,"type"))&&void 0!==i?i:u.kvN.Normal,s=null!==(r=null===V||void 0===V?void 0:V.shopId)&&void 0!==r?r:"";if(T===c.MW.Single){var d,v,m,p,x,g,b,y,k=null!==(x=null===I||void 0===I?void 0:I.name)&&void 0!==x?x:"",w=null!==(g=null===I||void 0===I?void 0:I.details.images)&&void 0!==g?g:[],_=null===I||void 0===I?void 0:I.actualImage,P=null!==(b=null===I||void 0===I?void 0:I.sku)&&void 0!==b?b:"",S=null===I||void 0===I?void 0:I.details.weightDimension,N=null!==(y=null===(d=null===Z||void 0===Z?void 0:Z.details.descriptions)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.description)&&void 0!==y?y:"",E={sellerSku:"".concat(P,"-").concat(s),name:k,description:N,short_description:null===(m=null===Z||void 0===Z?void 0:Z.details.descriptions)||void 0===m||null===(p=m[1])||void 0===p?void 0:p.description,images:_?[_].concat((0,l.Z)(w)):w,fromWarehouse:null,primary_category:10100827,productVariantId:C,package_height:(null===S||void 0===S?void 0:S.height)?"".concat(S.height):void 0,package_length:(null===S||void 0===S?void 0:S.length)?"".concat(S.length):void 0,package_width:(null===S||void 0===S?void 0:S.width)?"".concat(S.width):void 0,package_weight:(null===S||void 0===S?void 0:S.weight)?"".concat(S.weight):void 0};return(0,f.merge)({},h.O$,E)}var O,D,F,B,z,L=null!==(o=null===Z||void 0===Z?void 0:Z.name)&&void 0!==o?o:"",R=null!==(O=null===Z||void 0===Z?void 0:Z.details.images)&&void 0!==O?O:[],W=null!==(D=null===Z||void 0===Z||null===(e=Z.details)||void 0===e||null===(t=e.descriptions)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.description)&&void 0!==D?D:"",A=null===I||void 0===I?void 0:I.actualImage,M=null!==(F=null===I||void 0===I?void 0:I.sku)&&void 0!==F?F:"",q=null!==(B=null===Z||void 0===Z?void 0:Z.details.variations)&&void 0!==B?B:[],G=null!==(z=null===Z||void 0===Z?void 0:Z.productVariants)&&void 0!==z?z:[],K=(0,j.d1)({productType:a,productTierVars:q,productVariants:G}),X=K.tierVarList,H=K.modelList,U={sellerSku:"".concat(M,"-").concat(s),name:L,description:W,images:A?[A].concat((0,l.Z)(R)):R,productVariantId:C,tierVarList:X,skus:H,fromWarehouse:null};return(0,f.merge)({},h.O$,U)}),[I,Z,null===V||void 0===V?void 0:V.shopId,T,C]);return(0,i.jsx)(x.FD,{defaultValues:B,ePlatformStoreId:E,currency:O,listingMode:c.ZR.Create,children:(0,i.jsx)(g.Z,{onSubmit:F,listingMode:T})})},y=function(){return(0,i.jsx)(r.aX,{children:(0,i.jsx)(b,{})})}},77664:function(){},91033:function(e,t,n){"use strict";var i=function(){if("undefined"!==typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var r=i[n];e.call(t,r[1],r[0])}},t}()}(),r="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,o="undefined"!==typeof n.g&&n.g.Math===Math?n.g:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")(),a="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(o):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var l=["top","right","bottom","left","width","height","size","weight"],s="undefined"!==typeof MutationObserver,u=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,i=!1,r=0;function o(){n&&(n=!1,e()),i&&s()}function l(){a(o)}function s(){var e=Date.now();if(n){if(e-r<2)return;i=!0}else n=!0,i=!1,setTimeout(l,t);r=e}return s}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}
vendor: 4,675 bytes, line 1
1));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;l.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),d=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},c=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||o},v=g(0,0,0,0);function f(e){return parseFloat(e)||0}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+f(e["border-"+n+"-width"])}),0)}function p(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return v;var i=c(e).getComputedStyle(e),r=function(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var r=i[n],o=e["padding-"+r];t[r]=f(o)}return t}(i),o=r.left+r.right,a=r.top+r.bottom,l=f(i.width),s=f(i.height);if("border-box"===i.boxSizing&&(Math.round(l+o)!==t&&(l-=m(i,"left","right")+o),Math.round(s+a)!==n&&(s-=m(i,"top","bottom")+a)),!function(e){return e===c(e).document.documentElement}(e)){var u=Math.round(l+o)-t,d=Math.round(s+a)-n;1!==Math.abs(u)&&(l-=u),1!==Math.abs(d)&&(s-=d)}return g(r.left,r.top,l,s)}var h="undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof c(e).SVGGraphicsElement}:function(e){return e instanceof c(e).SVGElement&&"function"===typeof e.getBBox};function x(e){return r?h(e)?function(e){var t=e.getBBox();return g(0,0,t.width,t.height)}(e):p(e):v}function g(e,t,n,i){return{x:e,y:t,width:n,height:i}}var j=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=g(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=x(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),b=function(e,t){var n=function(e){var t=e.x,n=e.y,i=e.width,r=e.height,o="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return d(a,{x:t,y:n,width:i,height:r,top:n,right:t+i,bottom:r+n,left:t}),a}(t);d(this,{target:e,contentRect:n})},y=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new i,"function"!==typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof c(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new j(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof c(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new b(e.target,e.broadcastRect())}
1));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),I="undefined"!==typeof WeakMap?new WeakMap:new i,Z=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),i=new y(t,n,this);I.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){Z.prototype[e]=function(){var t;return(t=I.get(this))[e].apply(t,arguments)}}));var V="undefined"!==typeof o.ResizeObserver?o.ResizeObserver:Z;t.Z=V}},function(e){e.O(0,[2876,630,4980,7536,1524,4231,5428,1718,5836,5734,3747,1717,2268,9591,2512,1090,7247,5780,1280,2020,8507,3021,1115,7384,4738,5686,5646,9714,2068,6778,1039,4503,6446,2180,7297,309,7545,9329,9721,1197,7302,3105,3977,5757,1744,9774,2888,179],(function(){return t=7472,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

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.