PageSourceSearch

https://www.checkget.com/_next/static/chunks/pages/dashboard/e-commerce/product/new-d053381706b2b901.js

js checkget.com collected 2026-09-24 12:29:31 UTC 8,082 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4134],{66242:function(e,s,n){"use strict";n.d(s,{Z:function(){return v}});var r=n(87462),i=n(63366),a=n(67294),t=n(86010),o=n(94780),l=n(90948),c=n(71657),d=n(90629),u=n(1588),m=n(34867);function h(e){return(0,m.Z)("MuiCard",e)}(0,u.Z)("MuiCard",["root"]);var p=n(85893);const x=["className","raised"],g=(0,l.ZP)(d.Z,{name:"MuiCard",slot:"Root",overridesResolver:(e,s)=>s.root})((()=>({overflow:"hidden"})));var v=a.forwardRef((function(e,s){const n=(0,c.Z)({props:e,name:"MuiCard"}),{className:a,raised:l=!1}=n,d=(0,i.Z)(n,x),u=(0,r.Z)({},n,{raised:l}),m=(e=>{const{classes:s}=e;return(0,o.Z)({root:["root"]},h,s)})(u);return(0,p.jsx)(g,(0,r.Z)({className:(0,t.Z)(m.root,a),elevation:l?8:void 0,ref:s,ownerState:u},d))}))},54895:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/e-commerce/product/new",function(){return n(89127)}])},70442:function(e,s,n){"use strict";n.d(s,{Z:function(){return m}});var r=n(85893),i=n(87357),a=n(26447),t=n(15861),o=n(12963),l=n(23795),c=n(41664),d=n.n(c);function u(e){let{link:s,activeLast:n,disabled:a}=e;const{name:t,href:o,icon:c}=s,u={typography:"body2",alignItems:"center",color:"text.primary",display:"inline-flex",...a&&!n&&{cursor:"default",pointerEvents:"none",color:"text.disabled"}},m=(0,r.jsxs)(r.Fragment,{children:[c&&(0,r.jsx)(i.Z,{component:"span",sx:{mr:1,display:"inherit","& svg":{width:20,height:20}},children:c}),t]});return o?(0,r.jsx)(l.Z,{component:d(),href:o,sx:u,children:m}):(0,r.jsxs)(i.Z,{sx:u,children:[" ",m," "]})}function m(e){let{links:s,action:n,heading:c,moreLink:d,activeLast:m,sx:p,...x}=e;const g=s[s.length-1].name;return(0,r.jsxs)(i.Z,{sx:{mb:5,...p},children:[(0,r.jsxs)(a.Z,{direction:"row",alignItems:"center",children:[(0,r.jsxs)(i.Z,{sx:{flexGrow:1},children:[c&&(0,r.jsx)(t.Z,{variant:"h4",gutterBottom:!0,children:c}),!!s.length&&(0,r.jsx)(o.Z,{separator:(0,r.jsx)(h,{}),...x,children:s.map((e=>(0,r.jsx)(u,{link:e,activeLast:m,disabled:e.name===g},e.name||"")))})]}),n&&(0,r.jsxs)(i.Z,{sx:{flexShrink:0},children:[" ",n," "]})]}),!!d&&(0,r.jsx)(i.Z,{sx:{mt:2},children:d.map((e=>(0,r.jsx)(l.Z,{noWrap:!0,href:e,variant:"body2",target:"_blank",rel:"noopener",sx:{display:"table"},children:e},e)))})]})}function h(){return(0,r.jsx)(i.Z,{component:"span",sx:{width:4,height:4,borderRadius:"50%",bgcolor:"text.disabled"}})}},89127:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return m}});var r=n(85893),i=n(9008),a=n.n(i),t=n(53156),o=n(96259),l=n(8242),c=n(89108),d=n(70442),u=n(287);function m(){const{themeStretch:e}=(0,c.K$)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a(),{children:(0,r.jsx)("title",{children:" Ecommerce: Create a new product | Minimal UI"})}),(0,r.jsxs)(t.Z,{maxWidth:!e&&"lg",children:[(0,r.jsx)(d.Z,{heading:"Create a new product",links:[{name:"Dashboard",href:o.vB.root},{name:"E-Commerce",href:o.vB.eCommerce.root},{name:"New product"}]}),(0,r.jsx)(u.Z,{})]})]})}m.getLayout=e=>(0,r.jsx)(l.Z,{children:e})},287:function(e,s,n){"use strict";n.d(s,{Z:function(){return y}});var r=n(85893),i=n(16310),a=n(67294),t=n(11163),o=n(87536),l=n(47533),c=n(31812),d=n(86886),u=n(66242),m=n(26447),h=n(15861),p=n(87109),x=n(87357),g=n(96259),v=n(93229),j=n(1677);const Z=[{label:"Men",value:"Men"},{label:"Women",value:"Women"},{label:"Kids",value:"Kids"}],b=[{group:"Clothing",classify:["Shirts","T-shirts","Jeans","Leather"]},{group:"Tailored",classify:["Suits","Blazers","Trousers","Waistcoats"]},{group:"Accessories",classify:["Shoes","Backpacks and bags","Bracelets","Face masks"]}],f=["Toy Story 3","Logan","Full Metal Jacket","Dangal","The Sting","2001: A Space Odyssey","Singin' in the Rain","Toy Story","Bicycle Thieves","The Kid","Inglourious Basterds","Snatch","3 Idiots"];function y(e){let{isEdit:s,currentProduct:n}=e;const{push:y}=(0,t.useRouter)(),{enqueueSnackbar:S}=(0,v.Ds)(),k=i.Ry().shape({name:i.Z_().required("Name is required"),images:i.IX().min(1,"Images is required"),tags:i.IX().min(2,"Must have at least 2 tags"),price:i.Rx().moreThan(0,"Price should not be $0.00"),description:i.Z_().required("Description is required")}),P=(0,a.useMemo)((()=>({name:(null===n||void 0===n?void 0:n.name)||"",description:(null===n||void 0===n?void 0:n.description)||"",images:(null===n||void 0===n?void 0:n.images)||[],code:(null===n||void 0===n?void 0:n.code)||"",sku:(null===n||void 0===n?void 0:n.sku)||"",price:(null===n||void 0===n?void 0:n.price)||0,priceSale:(null===n||void 0===n?void 0:n.priceSale)||0,tags:(null===n||void 0===n?void 0:n.tags)||[f[0]],inStock:!0,taxes:!0,gender:(null===n||void 0===n?void 0:n.gender)||Z[2].value,category:(null===n||void 0===n?void 0:n.category)||b[0].classify[1]})),[n]),w=(0,o.cI)({resolver:(0,l.X)(k),defaultValues:P}),{reset:C,watch:_,setValue:I,handleSubmit:N,formState:{isSubmitting:T}}=w,L=_();(0,a.useEffect)((()=>{s&&n&&C(P),s||C(P)}),[s,n]);const R=(0,a.useCallback)((e=>{const s=L.images||[],n=e.map((e=>Object.assign(e,{preview:URL.createObjectURL(e)})));I("images",[...s,...n],{shouldValidate:!0})}),[I,L.images]);return(0,r.jsx)(j.ZP,{methods:w,onSubmit:N((async e=>{try{await new Promise((e=>setTimeout(e,500))),C(),S(s?"Update success!":"Create success!"),y(g.vB.eCommerce.list),console.log("DATA",e)}catch(n){console.error(n)}})),children:(0,r.jsxs)(d.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(d.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(u.Z,{sx:{p:3},children:(0,r.jsxs)(m.Z,{spacing:3,children:[(0,r.jsx)(j.au,{name:"name",label:"Product Name"}),(0,r.jsxs)(m.Z,{spacing:1,children:[(0,r.jsx)(h.Z,{variant:"subtitle2",sx:{color:"text.secondary"},children:"Description"}),(0,r.jsx)(j.LM,{simple:!0,name:"description"})]}),(0,r.jsxs)(m.Z,{spacing:1,children:[(0,r.jsx)(h.Z,{variant:"subtitle2",sx:{color:"text.secondary"},children:"Images"}),(0,r.jsx)(j.rd,{multiple:!0,thumbnail:!0,name:"images",maxSize:3145728,onDrop:R,onRemove:e=>{var s;const n=L.images&&(null===(s=L.images)||void 0===s?void 0:s.filter((s=>s!==e)));I("images",n)},onRemoveAll:()=>{I("images",[])},onUpload:()=>console.log("ON UPLOAD")})]})]})})}),(0,r.jsx)(d.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(m.Z,{spacing:3,children:[(0,r.jsxs)(u.Z,{sx:{p:3},children:[(0,r.jsx)(j._e,{name:"inStock",label:"In stock"}),(0,r.jsxs)(m.Z,{spacing:3,mt:2,children:[(0,r.jsx)(j.au,{name:"code",label:"Product Code"}),(0,r.jsx)(j.au,{name:"sku",label:"Product SKU"}),(0,r.jsxs)(m.Z,{spacing:1,children:[(0,r.jsx)(h.Z,{variant:"subtitle2",sx:{color:"text.secondary"},children:"Gender"}),(0,r.jsx)(j.km,{row:!0,spacing:4,name:"gender",options:Z})]}),(0,r.jsxs)(j.Cc,{native:!0,name:"category",label:"Category",children:[(0,r.jsx)("option",{value:""}),b.map((e=>(0,r.jsx)("optgroup",{label:e.group,children:e.classify.map((e=>(0,r.jsx)("option",{value:e,children:e},e)))},e.group)))]}),(0,r.jsx)(j.Fl,{name:"tags",label:"Tags",multiple:!0,freeSolo:!0,options:f.map((e=>e)),ChipProps:{size:"small"}})]})]}),(0,r.jsxs)(u.Z,{sx:{p:3},children:[(0,r.jsxs)(m.Z,{spacing:3,mb:2,children:[(0,r.jsx)(j.au,{name:"price",label:"Regular Price",placeholder:"0.00",onChange:e=>I("price",Number(e.target.value),{shouldValidate:!0}),InputLabelProps:{shrink:!0},InputProps:{startAdornment:(0,r.jsx)(p.Z,{position:"start",children:(0,r.jsx)(x.Z,{component:"span",sx:{color:"text.disabled"},children:"$"})}),type:"number"}}),(0,r.jsx)(j.au,{name:"priceSale",label:"Sale Price",placeholder:"0.00",onChange:e=>I("priceSale",Number(e.target.value)),InputLabelProps:{shrink:!0},InputProps:{startAdornment:(0,r.jsx)(p.Z,{position:"start",children:(0,r.jsx)(x.Z,{component:"span",sx:{color:"text.disabled"},children:"$"})}),type:"number"}})]}),(0,r.jsx)(j._e,{name:"taxes",label:"Price includes taxes"})]}),(0,r.jsx)(c.Z,{type:"submit",variant:"contained",size:"large",loading:T,children:s?"Save Changes":"Create Product"})]})})]})})}}},function(e){e.O(0,[1664,3461,4564,2679,8618,5464,7417,8360,4386,135,568,7423,2077,7918,4084,6628,4782,1812,6886,7964,5099,8159,141,9485,3178,1677,5983,8242,9774,2888,179],(function(){return s=54895,e(e.s=s);var s}));var s=e.O();_N_E=s}]);

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.