1import{j as e,b as O,r as c,L as x}from"./emotion-element-f0de968e.browser.esm-DAcAn3jx.js";import{D as U}from"./Download-CukHS6ED.js";import{c as C,B as r,T as o}from"./Box-CdsPgKjk.js";import{D as $}from"./DeleteSweep-Bogkfd0r.js";import{M as E}from"./ItemNotFound-ryDCeKGA.js";import{u as y,s as B,aH as H,o as Q,h as V,b8 as Y,b9 as G,ba as K}from"./api-KZNW2Ket.js";import{P as N}from"./PagingControls-DTElKLL1.js";import{p as Z}from"./parseFileSize-k5H6-IPF.js";import{D as q}from"./DeleteInventoryButton-DhQVMosd.js";import{u as J,B as g}from"./Button-KVxmVPcQ.js";import{u as X,F as ee,S as te,M as m}from"./index-DkVogYJF.js";import{C as b}from"./Card-QqbP_w_-.js";import{I as oe}from"./TextField-BKbREhBK.js";import{D as re}from"./Divider-DJxQQ4t0.js";import"./imageUtils-Bv75Hoxq.js";import"./Snackbar-BLmOveHA.js";import"./Favorite-V6xGmSVP.js";import"./LocationOn-DM2UKiY4.js";import"./Price-CnfREIyP.js";import"./useId-BOtalUON.js";import"./moment-BLMuvzoS.js";import"./appPaths-B9EFiJhW.js";import"./IconButton-C4bln0zo.js";import"./Edit-DQtX7EYK.js";import"./DialogTitle-BztL3sGR.js";import"./Tooltip-BamK8vw1.js";import"./FormControlLabel-gDZUzoP6.js";import"./Checkbox-BQKglEA7.js";import"./DefaultButton-EB8kJvev.js";import"./Chip-BmmJUiHy.js";import"./LocalizationProvider-DSrdV9YK.js";import"./useThemeProps-DVgs-USV.js";import"./getThemeProps-B4ZF914Q.js";import"./Drawer-D9kGXRYg.js";import"./index.esm-CUxG0IsZ.js";import"./ArrowRight-B4QKvvAX.js";import"./ArrowBack-DlRO-7OJ.js";const ne=C(e.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"})),se=C(e.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"})),Ze=()=>{var D,z;const n=J(),d=y(B);let{storeId:s}=O();s||(s=(D=d==null?void 0:d.role)==null?void 0:D.store);const u=y(H),f=y(Q),j=X(n.breakpoints.down("tablet")),{data:p,isLoading:L,isError:W,isSuccess:M}=V({storeId:s},{skip:!s||!u||f}),{isLoading:ie,isSuccess:v,data:i}=Y({storeId:s},{skip:!s||!u||f}),w=c.useMemo(()=>v&&(i==null?void 0:i.status)==="connected"||(i==null?void 0:i.status)==="active",[i,v]),[S,I]=c.useState(1),[k,A]=c.useState(Number(localStorage.getItem("submitInventoryPageLimit")??10)),{data:l,isLoading:le,isError:ae,isSuccess:ce}=G({storeId:s,page:S,limit:k},{skip:!s||!u||!w}),[T,xe]=K(),[de,pe]=c.useState(!1),_=c.useMemo(()=>{var t;return((t=l==null?void 0:l.dataLoads)==null?void 0:t.docs)||[]},[l]),P=t=>{T({storeId:d.role.store,inventoryDataloadId:t}).unwrap().then(a=>{const R=new Blob([a.data],{type:"text/json"}),F=window.URL.createObjectURL(R),h=document.createElement("a");h.href=F,h.download=a.filename,h.click()})};if(L)return e.jsx("div",{children:"Loading..."});if(W)return e.jsx("div",{children:"Error..."});if(!f&&!w)return e.jsxs(r,{sx:{p:4,pt:j?8:4,backgroundColor:n.palette.background.parchment,color:n.palette.text.primary},children:[e.jsx(o,{variant:"h2",sx:{fontSize:"24px"},children:"Please connect to Stripe before submitting inventory"}),e.jsxs(o,{variant:"body1",sx:{my:2,fontSize:"12px"},children:["You can do so from your"," ",e.jsx(x,{to:"/admin/stores/my-store",children:"Manage Store Page"})]})]});if(M&&p)return e.jsxs(r,{sx:{p:4,pt:j?8:4,backgroundColor:n.palette.background.parchment,color:n.palette.text.primary},children:[e.jsxs(r,{sx:{display:"flex"},children:[e.jsx(x,{to:`/admin/dashboard/${s}`,style:{textDecoration:"none"},children:e.jsx(o,{color:"text.secondary",sx:{fontWeight:600,"&:hover":{textDecoration:"underline"}},children:"Admin"})}),"/",e.jsx(x,{to:"/admin/inventory/view",style:{textDecoration:"none"},children:e.jsx(o,{color:"text.secondary",sx:{fontWeight:600,"&:hover":{textDecoration:"underline"}},children:"Inventory"})}),"/",e.jsx(o,{color:"text.secondary",sx:{fontWeight:600},children:"Submit"})]}),e.jsxs(r,{sx:{p:4},children:[e.jsx(o,{variant:"h2",sx:{fontSize:"24px"},children:"Automated Inventory Integrations"}),e.jsx(o,{variant:"body1",sx:{my:2,fontSize:"16px"},children:"To add inventory this way, please follow the link below to get connected to one of our supported Point of Sale Systems."}),e.jsxs(b,{sx:{backgroundColor:"#313131",color:"white",p:4,m:2,mb:8,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1},children:[e.jsx(ne,{color:"warning",sx:{fontSize:"2rem"}}),e.jsx(o,{variant:"body1",children:"Link your inventory here with your store's inventory in Tuneportals and/or any POS or inventory system"}),e.jsx(x,{to:"/admin/inventory/integrations",style:{marginTop:"10px"},children:e.jsx(g,{variant:"contained",color:"warning",size:"small",sx:{textTransform:"none",fontSize:"14px",fontWeight:700,borderRadius:"20px",color:"#313131",p:"3px 10px"},children:"Link Inventory"})})]}),e.jsx(o,{variant:"h2",children:"Manual Inventory Upload"}),e.jsx(o,{variant:"body1",sx:{my:1},children:"To add inventory this way, please use our process to upload a .csv, .xls, .xlsx, or .json file with your store's inventory. Only UPCs from RSD's historical catalog will be accepted (for now)."}),e.jsxs(b,{sx:{backgroundColor:"#313131",color:"white",p:4,m:2,mb:8,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1},children:[e.jsx(se,{color:"warning",sx:{fontSize:"2rem"}}),e.jsx(o,{variant:"body1",children:"Our step-by-step process will guide you through everything we need to make sure we add to your inventory correctly."}),e.jsx(x,{to:`/admin/inventory/submit/${s}/file`,style:{marginTop:"10px"},children:e.jsx(g,{variant:"contained",color:"warning",size:"small",sx:{textTransform:"none",fontSize:"14px",fontWeight:700,borderRadius:"20px",color:"#313131",p:"3px 10px"},children:"Upload inventory"})})]}),e.jsx(o,{variant:"h2",sx:{my:1},children:"Past Inventory File Uploads"}),e.jsx(o,{variant:"body1",sx:{my:1},children:"All past inventory uploads will be listed here. You can view the status of each upload, and download the file you uploaded."}),e.jsxs(r,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"2fr 4fr
11fr 1fr 1fr 1fr 2fr"},columnGap:1,rowGap:0,textAlign:"center"},children:[e.jsx(r,{sx:{backgroundColor:"#313131",color:"white",p:1,pl:2,mb:1,display:"flex",alignItems:"center"},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",fontFamily:"Oswald",fontSize:"16px",fontWeight:500},children:"Uploaded"})}),e.jsx(r,{sx:{backgroundColor:"#313131",color:"white",p:1,mb:1,display:"flex",alignItems:"center"},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",pl:"4ch",fontFamily:"Oswald",fontSize:"16px",fontWeight:500},children:"Info"})}),e.jsx(r,{sx:{backgroundColor:"#313131",color:"white",p:1,mb:1,display:"flex",alignItems:"center"},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",fontFamily:"Oswald",fontSize:"16px",fontWeight:500},children:"Total SKUs"})}),e.jsx(r,{sx:{backgroundColor:"#313131",color:"white",p:1,mb:1,display:"flex",alignItems:"center"},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",fontFamily:"Oswald",fontSize:"16px",fontWeight:500},children:"Successful"})}),e.jsx(r,{sx:{backgroundColor:"#313131",color:"white",p:1,mb:1,display:"flex",alignItems:"center"},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",fontFamily:"Oswald",fontSize:"16px",fontWeight:500},children:"Warnings"})}),e.jsx(r,{sx:{backgroundColor:"#313131",color:"white",p:1,mb:1,display:"flex",alignItems:"center"},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",fontFamily:"Oswald",fontSize:"16px",fontWeight:500},children:"Errors"})}),e.jsx(r,{sx:{backgroundColor:"#313131",color:"white",p:1,mb:1,display:"flex",alignItems:"center"}}),l&&_.map(t=>[e.jsx(r,{sx:{pr:1,pl:2,py:2,backgroundColor:n.palette.background.paper,mb:1,display:"flex",flexDirection:"row",alignItems:"center"},children:e.jsx(o,{variant:"body1",sx:{fontWeight:700},children:t.createdAt?e.jsx(E,{format:"MM/DD/YY",children:t.createdAt}):"unknown"})},`date-${t._id}`),e.jsxs(r,{sx:{px:1,py:2,display:"flex",flexDirection:"row",alignItems:"center",gap:1,backgroundColor:n.palette.background.paper,mb:1},children:[e.jsx(o,{color:"text.secondary",sx:{fontSize:"14px",fontWeight:400},children:t.size?Z(t.size):""}),e.jsx(o,{variant:"body1",sx:{fontSize:"14px",fontWeight:600},children:t.originalName||""})]},`info-${t._id}`),e.jsx(r,{sx:{px:1,py:2,backgroundColor:n.palette.background.paper,display:"flex",flexDirection:"row",alignItems:"center",mb:1},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",fontSize:"14px",fontWeight:500},children:t.summary?t.summary.successful_rows+t.summary.failed_rows:"unknown"})},`total-${t._id}`),e.jsx(r,{sx:{px:1,py:2,backgroundColor:n.palette.background.paper,display:"flex",flexDirection:"row",alignItems:"center",mb:1},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",fontSize:"14px",fontWeight:500},children:t.summary?t.summary.successful_rows:"unknown"})},`success-${t._id}`),e.jsx(r,{sx:{px:1,py:2,backgroundColor:n.palette.background.paper,display:"flex",flexDirection:"row",alignItems:"center",mb:1},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",fontSize:"14px",fontWeight:500},children:t.summary?t.summary.success_warning_rows+t.summary.failed_warning_rows:"unknown"})},`warning-${t._id}`),e.jsx(r,{sx:{px:1,py:2,backgroundColor:n.palette.background.paper,display:"flex",flexDirection:"row",alignItems:"center",mb:1},children:e.jsx(o,{variant:"body1",sx:{textAlign:"left",fontSize:"14px",fontWeight:500},children:t.summary?t.summary.failed_rows:"unknown"})},`error-${t._id}`),e.jsx(r,{sx:{px:1,py:2,backgroundColor:n.palette.background.paper,mb:1,display:"flex",alignItems:"center"},children:e.jsxs(g,{variant:"outlined",color:"warning",size:"small",sx:{textTransform:"none",fontSize:"14px",fontWeight:600,p:"3px 10px"},onClick:()=>{P(t._id)},children:["Download Full Report"," ",e.jsx(U,{sx:{ml:1,fontSize:"14px"}})]})},`download-${t._id}`)])]}),e.jsxs(r,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(N,{page:S,setPage:I,totalPages:(z=p==null?void 0:p.stores)==null?void 0:z.totalPages}),e.jsxs(ee,{sx:{my:1},variant:"standard",children:[e.jsx(oe,{id:"limit-label",size:"small",variant:"standard",children:"Limit"}),e.jsxs(te,{labelId:"limit-label",id:"limit-select",label:"Limit",size:"small",value:k,onChange:t=>{t.preventDefault();const a=Number(t.target.value);I(1),localStorage.setItem("submitInventoryPageLimit",String(a)),A(a)},sx:{minWidth:"100px"},children:[e.jsx(m,{value:10,children:"10"}),e.jsx(m,{value:20,children:"20"}),e.jsx(m,{value:50,children:"50"}),e.jsx(m,{value:100,children:"100"})]})]})]}),e.jsx(o,{sx:{mt:4},children:"The Danger Zone"}),e.jsx(re,{sx:{my:1}}),e.jsxs(b,{sx:{backgroundColor:"#313131",color:"white",p:4,m:2,mb:8,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1},children:[e.jsx($,{color:"error",sx:{fontSize:"2rem"}}),e.jsx(o,{variant:"body1",sx:{textAlign:"center"},children:"Delete your entire inventory from RSD MRKT. This will also delete manually set prices, custom descriptions, and other custom product data."}),e.jsx(q,{storeId:s,message:"This will delete your entire inventory from RSD MRKT."})]})]})]})};export{Ze as default};
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.