PageSourceSearch

https://cdn2.listingmirror.com/bundles/BulkImport-h8D_sORu.js

js listingmirror.com collected 2026-09-24 20:59:05 UTC 14,851 bytes, 2 lines download raw bytes

1import{r as e,J as l,K as a,o as t,w as s,e as n,h as u,$ as o,O as r,Q as i,a2 as c,aA as d,Z as v,W as p,V as m,a1 as h,ac as f,Y as g,M as b,N as k,c as y,U as T}from"./vendor-core-B_XRYw1x.js";import{_,C as x,d as C,a0 as w,j as A,b as E,k as I,v as S}from"./app-5vdzLte1.js";import{a as D,S as N}from"./SearchUtility-yW8_Ys-A.js";import{C as O}from"./CategoryPicker-DjjYsyI7.js";import{P as U}from"./PageHeader--L6KjXar.js";import{C as R}from"./CopyToClipboard-wwSW4yh-.js";import"./vendor-datetime-BsgW3Zgl.js";import"./vendor-charts-D0gtSNZr.js";import"./TagSelector-D9h5JO9s.js";const M={class:"container base"},P={class:"d-flex flex-column content-block"},F={class:"d-flex flex-row"},G={class:"m-3 col-xs-12 col-md-4"},L={class:"form-group"},K=["value"],j={key:0,class:"m-3 col-xs-12 col-md-4"},q={class:"form-group"},V=["value"],W={key:0,class:"d-flex flex-row"},Z={class:"m-3 col-xs-12 col-md-4"},z={class:"form-group"},$={key:1,class:"d-flex flex-row"},Q={class:"m-3 col-xs-12 col-md-4"},Y={class:"form-group"},B=["value"],H={class:"d-flex flex-row justify-content-center"},J={class:"m-3"},X=["disabled"],ee={key:2,class:"d-flex flex-column"},le={class:"m-3"},ae={key:3,class:"flex-row"},te={class:"flex-row p-2"},se={key:4,class:"flex-row"},ne={class:"alert alert-danger alert-dismissible fade show d-flex align-items-start m-2",role:"alert"},ue={class:"flex-grow-1"},oe={key:5,class:"flex-row"},re={class:"flex-row p-2"},ie={class:"progress m-4"},ce=["aria-valuenow"],de={key:6,class:"d-flex flex-row flex-grow-1 table-responsive p-2"},ve={class:"table table-sm table-striped table-hover"},pe=["src","alt","title"],me=["title"],he=["src"],fe={class:"text-nowrap"},ge={key:0,class:"bi bi-check text-success"},be={key:1,class:"bi bi-dash"},ke={key:0,class:"d-flex content-block flex-row"},ye={class:"table-responsive p-2"},Te={class:"table table-striped"},_e={key:0,class:"bi bi-check text-success",title:"Complete"},xe={key:1,class:"bi bi-clock text-warning",title:"In Progress"},Ce=["href"],we={key:1,class:"d-flex content-block flex-row"},Ae={class:"table-responsive p-2"},Ee={class:"table table-striped"},Ie={key:0,class:"bi bi-check text-success",title:"Complete"},Se={key:1,class:"text-danger text-nowrap"},De={key:2,class:"bi bi-clock text-warning",title:"In Progress"},Ne=["href"],Oe={key:1,class:"text-danger"},Ue=_({__name:"BulkImport",setup(_){const Ue=x(),Re=D(),Me=b(),Pe=e(""),Fe=e([]),Ge=e(""),Le=e([]),Ke=e([]),je=e(""),qe=e(null),Ve=e(null),We=e(null),Ze=e(null),ze=e(null),$e=l([]),Qe=l([]),Ye=l([]),Be=a(()=>[w.AMAZON_ADD_OFFERS.value,w.AMAZON_EDIT_OFFERS.value,w.MARKET_LISTING_ADD.value,w.MARKET_LISTING_CORE_EDIT.value,w.CATEGORY_SPECIFIC.value,w.MISSING_CATEGORY_SPECIFIC.value,w.EDIT_IMAGES.value,w.MARKET_LISTING_COMPLETE_EDIT.value,w.WALMART_ADD_OFFERS.value,w.UNTRACKED_LISTINGS.value].includes(Pe.value)),He=a(()=>Pe.value===w.VENDOR_CATALOG.value),Je=a(()=>{if(![w.MARKET_LISTING_ADD.value,w.MARKET_LISTING_COMPLETE_EDIT.value].includes(Pe.value)||!Ge.value)return!1;const e=Le.value.find(e=>e.pk===Ge.value);return!!e&&e.hasCategorySpecifics}),Xe=a(()=>{const e=[w.COMPONENT_QUANTITY.value,w.COMPONENT_LOCATION.value,w.TRACKING_DATA.value,w.EDIT_COMPONENT.value,w.MARKET_LISTING_ADD.value,w.UNTRACKED_LISTINGS.value,w.AMAZON_ADD_OFFERS.value,w.WALMART_ADD_OFFERS.value];return Pe.value&&!e.includes(Pe.value)}),el=a(()=>Le.value&&Pe.value?Pe.value===w.AMAZON_ADD_OFFERS.value||Pe.value===w.AMAZON_EDIT_OFFERS.value?Le.value.filter(e=>e.channel.value===A.AMAZON.value):Pe.value===w.WALMART_ADD_OFFERS.value?Le.value.filter(e=>e.channel.value===A.WALMART.value):Le.value:Le.value),ll=a(()=>!Pe.value||(!(!Be.value||Ge.value)||!(!Je.value||qe.value))),al=a(()=>{if(!Ge.value)return null;const e=Le.value.find(e=>e.pk===Ge.value);return e?e.channel.value:null}),tl=a(()=>{if(!Ge.value)return 0;const e=Le.value.find(e=>e.pk===Ge.value);return e?e.siteId:0}),sl=a(()=>null===Ze.value||0===Ze.value.lineCount?0:Math.min(Math.round((Ze.value.updates+Ze.value.errors)/Ze.value.lineCount*100),100));function nl(){Ge.value="",qe.value=null,je.value="",vl()}function ul(){qe.value=null,vl()}function ol(){vl()}function rl(){if(ll.value)return Ue.errorToast("Please complete the form before downloading");const e={formChoice:Pe.value,format:"xlsx",integrationConfig:""!==Ge.value?Ge.value:null,category_id:null!==qe.value?qe.value:null,vendor:""!==je.value?je.value:null,searchQuery:Me.query};return C("/listing/bulk-download-template/",{method:"POST",data:e}).then(e=>(console.log("We got back template download",e),We.value=parseInt(e),setTimeout(il,5e3)))}function il(){return console.log("Checking template download..."),C(`/listing/check-bulk-download-request/?bulk_download_request_id=${We.value}`,{method:"GET"}).then(e=>e.isComplete?(We.value=null,Ue.successToast("Template ready!"),window.location=e.fullUrl,cl()):(console.log("Not done yet, check again in 5"),setTimeout(il,5e3)))}function cl(){return C("/listing/bulk-download-history/",{method:"GET"}).then(e=>{$e.value=e||[]}
1).catch(e=>{console.log("Download history endpoint error:",e),$e.value=[]})}function dl(){return C("/listing/bulk-upload-history/",{method:"GET"}).then(e=>{Qe.value=e||[]}).catch(e=>{console.log("Upload history endpoint error:",e),Qe.value=[]})}function vl(){if(!Pe.value)return Ye.value=[],Promise.resolve();const e=new URLSearchParams;Me.query.search&&e.append("search",Me.query.search),Ge.value&&e.append("integration_id",Ge.value),je.value&&e.append("vendor_id",je.value),Pe.value&&e.append("template_choice",Pe.value);const l="/listing/report-preview/"+(e.toString()?"?"+e.toString():"");return C(l,{method:"GET"}).then(e=>{Ye.value=e.preview||[]}).catch(e=>{console.log("Template preview error:",e),Ye.value=[]})}return t(()=>{Le.value=Ue.getIntegrationConfigs;const e=[];return e.push(C("/listing/bulk-form-choices/",{method:"GET"}).then(e=>{Fe.value=e||[]})),e.push(cl()),e.push(dl()),e.push(C("/inventory/vendors/",{method:"GET"}).then(e=>{Ke.value=e||[]}).catch(e=>{console.log("Vendor loading error:",e),Ke.value=[]})),Promise.all(e).then(()=>vl())}),s(()=>Me.query,e=>{Re.saveQueryToLocalStorage(e),vl()}),(e,l)=>{const a=k("easy-spinner");return y(),n("div",M,[u(U,{title:"Import / Export"},{actions:o(()=>[i("label",{class:T(["btn btn-outline-primary",{disabled:null!=We.value||null!=Ze.value}])},[l[6]||(l[6]=r("\n          Upload Template\n          ",-1)),i("input",{id:"hideFileInput",type:"file",class:"auto-upload",name:"file",style:{display:"none"},accept:".xlsx",onChange:l[0]||(l[0]=e=>function(e){const l=new FormData,a=e.target;let t=0;l.append("file",a.files[0]);const s={bulk_download_request_id:0,format:"xlsx"};return Object.keys(s).forEach(e=>{l.append(e,s[e])}),ze.value=null,C("/listing/bulk-upload-template/",{method:"POST",setContentType:!1,formData:l}).then(e=>(Ze.value=e,a.value="",setTimeout(n,5e3)));function n(){return C(`/listing/check-bulk-upload-request/?bulk_upload_request_id=${Ze.value}`,{method:"GET"}).then(e=>(t=0,e.isComplete?(Ue.successToast(`Upload complete, with ${e.updates} updates and ${e.errors} errors.`),Ze.value=null,dl()):e.isFailed?u(e.errorMessage):setTimeout(n,5e3))).catch(()=>(t+=1,t>=5?u("We lost track of this upload. Reload the page and check Previous Uploads for its status."):setTimeout(n,5e3)))}function u(e){return ze.value=e||"This upload failed. Check Previous Uploads below, or contact support if it keeps happening.",Ze.value=null,dl()}}(e))},null,32)],2)]),_:1}),l[83]||(l[83]=r()),i("div",P,[i("div",F,[i("div",G,[i("div",L,[l[7]||(l[7]=i("label",{for:"templateChoice",class:"form-label"},"Template Choice",-1)),l[8]||(l[8]=r()),c(i("select",{id:"templateChoice","onUpdate:modelValue":l[1]||(l[1]=e=>Pe.value=e),class:"form-select",onChange:nl},[(y(!0),n(v,null,p(Fe.value,e=>(y(),n("option",{key:e.value,value:e.value},h(e.label),9,K))),128))],544),[[d,Pe.value]])])]),l[13]||(l[13]=r()),Be.value?(y(),n("div",j,[i("div",q,[l[11]||(l[11]=i("label",{for:"integration",class:"form-label"},"Integration",-1)),l[12]||(l[12]=r()),c(i("select",{id:"integration","onUpdate:modelValue":l[2]||(l[2]=e=>Ge.value=e),class:"form-select",onChange:ul},[l[9]||(l[9]=i("option",{value:""},"Select Integration",-1)),l[10]||(l[10]=r()),(y(!0),n(v,null,p(el.value,e=>(y(),n("option",{key:e.pk,value:e.pk},h(e.storeName)+" ("+h(e.channel.label)+")\n              ",9,V))),128))],544),[[d,Ge.value]])])])):m("",!0)]),l[55]||(l[55]=r()),Je.value?(y(),n("div",W,[i("div",Z,[i("div",z,[l[14]||(l[14]=i("label",{for:"category",class:"form-label"},"Category",-1)),l[15]||(l[15]=r()),l[16]||(l[16]=i("div",{class:"help-text"},"Select a category for your template",-1)),l[17]||(l[17]=r()),u(O,{ref_key:"categoryPicker",ref:Ve,"initial-category-id":qe.value,"channel-id":al.value,"site-id":tl.value,"extra-params":Ge.value?{integration_config_id:Ge.value}:{},onUpdate:l[3]||(l[3]=e=>qe.value=e)},null,8,["initial-category-id","channel-id","site-id","extra-params"])])])])):m("",!0),l[56]||(l[56]=r()),He.value?(y(),n("div",$,[i("div",Q,[i("div",Y,[l[20]||(l[20]=i("label",{for:"vendor",class:"form-label"},"Vendor",-1)),l[21]||(l[21]=r()),c(i("select",{id:"vendor","onUpdate:modelValue":l[4]||(l[4]=e=>je.value=e),class:"form-select",onChange:ol},[l[18]||(l[18]=i("option",{value:""},"Select Vendor",-1)),l[19]||(l[19]=r()),(y(!0),n(v,null,p(Ke.value,e=>(y(),n("option",{key:e.id,value:e.id},h(e.displayName),9,B))),128))],544),[[d,je.value]])])])])):m("",!0),l[57]||(l[57]=r()),i("div",H,[i("div",J,[i("button",{type:"button",disabled:ll.value||null!=We.value||null!=Ze.value,class:"btn btn-primary",onClick:rl},"\n            Download Template\n          ",8,X)])]),l[58]||(l[58]=r()),Xe.value?(y(),n("div",ee,[i("div",le,[l[22]||(l[22]=i("h4",null,"Filter Download",-1)),l[23]||(l[23]=r()),u(N)])])):m("",!0),l[59]||(l[59]=r()),We.value?(y(),n("div",ae,[i("div",te,[i("h3",null,[u(a,{size:24}),l[24]||(l[24]=r("\n            Generating template in progress...\n          ",-1))])]),l[25]||(l[25]=r()),l[26]||(l[26]=i("div",{class:"flex-row p-2"},"Either stay here to automatically download the template, or check back later to download it",-1))])):m("",!0),l[60]||(l[60]=r()),null!==ze.value?(y(),n("div",se,[i("div",ne,[l[29]||(l[29]=i("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),l[30]||(l[30]=r()),i("div",ue,[l[27]||(l[27]=i("strong",null,"Upload failed.",-1)),l[28]||(l[28]=r()),i("div",null,h(ze.value),1)]),l[31]||(l[31]=r()),i("button",{type:"button",class:"btn-close","aria-label":"Dismiss upload error",onClick:l[5]||(l[5]=e=>ze.value=null)})])])):m("",!0),l[61]||(l[61]=r()),null!==Ze.value?(y(),n("div",oe,[i("div",re,[i("h3",null,[u(a,{size:24}),l[32]||(l[32]=r("\n            Processing upload...\n          ",-1))])]),l[33]||(l[33]=r()),l[34]||(l[34]=i("div",{class:"flex-row p-2"},"Either stay here for status updates, or check back later for results.",-1)),l[35]||(l[35]=r()),i("div",ie,[i("div",{class:"progress-bar",role:"progressbar",title:"Upload progress",style:f("width:"+sl.value+"%"),"aria-valuenow":sl.value,"aria-valuemin":"
10","aria-valuemax":"100"},null,12,ce)])])):m("",!0),l[62]||(l[62]=r()),!We.value&&null===Ze.value&&Ye.value.length>0&&Xe.value?(y(),n("div",de,[i("table",ve,[i("thead",null,[i("tr",null,[l[39]||(l[39]=i("th",null,"Preview",-1)),l[40]||(l[40]=r()),l[41]||(l[41]=i("th",null,"SKU",-1)),l[42]||(l[42]=r()),l[43]||(l[43]=i("th",null,"Title",-1)),l[44]||(l[44]=r()),l[45]||(l[45]=i("th",null,"ASIN",-1)),l[46]||(l[46]=r()),l[47]||(l[47]=i("th",null,"UPC",-1)),l[48]||(l[48]=r()),(y(!0),n(v,null,p(g(Ue).getIntegrationConfigs,e=>(y(),n("th",{key:e.pk,class:"channel-column p-2 text-center"},[i("img",{class:"me-1 config-img",src:g(E)("img/buttonlogo/"+e.channel.label+".png"),alt:e.channel,title:e.channel.label+" - "+e.storeName},null,8,pe),l[36]||(l[36]=r()),l[37]||(l[37]=i("br",null,null,-1)),l[38]||(l[38]=r()),i("span",{title:e.storeName},h(e.storeName),9,me)]))),128))])]),l[54]||(l[54]=r()),i("tbody",null,[(y(!0),n(v,null,p(Ye.value,e=>{return y(),n("tr",{key:e.listing_id},[i("td",null,[i("img",{src:(a=e.listing_image_uuid,S(Ue.getBusinessId,a)),class:"detail-image crop-image",alt:"product image"},null,8,he)]),l[49]||(l[49]=r()),i("td",fe,[r(h(e.sku)+" ",1),u(R,{text:e.sku,name:"SKU"},null,8,["text"])]),l[50]||(l[50]=r()),i("td",null,h(e.variation_title),1),l[51]||(l[51]=r()),i("td",null,h(e.asin),1),l[52]||(l[52]=r()),i("td",null,h(e.upc),1),l[53]||(l[53]=r()),(y(!0),n(v,null,p(g(Ue).getIntegrationConfigs,l=>(y(),n("td",{key:l.pk,class:"text-center"},[e["exists_"+l.pk]?(y(),n("i",ge)):(y(),n("i",be))]))),128))]);var a}),128))])])])):m("",!0)]),l[84]||(l[84]=r()),$e.value.length>0?(y(),n("div",ke,[i("div",ye,[l[70]||(l[70]=i("h4",null,"Previous Downloads",-1)),l[71]||(l[71]=r()),i("table",Te,[l[68]||(l[68]=i("thead",null,[i("tr",null,[i("th",null,"Started"),r(),i("th",null,"Status"),r(),i("th",null,"Template Type"),r(),i("th",null,"Line Count"),r(),i("th",null,"User"),r(),i("th",null,"Link")])],-1)),l[69]||(l[69]=r()),i("tbody",null,[(y(!0),n(v,null,p($e.value,e=>(y(),n("tr",{key:e.pk,class:"flex-row"},[i("td",null,h(g(I)(e.createdAt,g(Ue).getUser.timezone)),1),l[63]||(l[63]=r()),i("td",null,[e.isComplete?(y(),n("i",_e)):(y(),n("i",xe))]),l[64]||(l[64]=r()),i("td",null,h(e.formChoice),1),l[65]||(l[65]=r()),i("td",null,h(e.lineCount),1),l[66]||(l[66]=r()),i("td",null,h(e.apiKeyLabel||e.userEmail),1),l[67]||(l[67]=r()),i("td",null,[e.isComplete?(y(),n("a",{key:0,target:"_new",href:e.fullUrl},"Download",8,Ce)):m("",!0)])]))),128))])])])])):m("",!0),l[85]||(l[85]=r()),Qe.value.length>0?(y(),n("div",we,[i("div",Ae,[l[81]||(l[81]=i("h4",null,"Previous Uploads",-1)),l[82]||(l[82]=r()),i("table",Ee,[l[79]||(l[79]=i("thead",null,[i("tr",null,[i("th",null,"Started"),r(),i("th",null,"Status"),r(),i("th",null,"Template Type"),r(),i("th",null,"Updates"),r(),i("th",null,"Errors"),r(),i("th",null,"User"),r(),i("th",null,"Result")])],-1)),l[80]||(l[80]=r()),i("tbody",null,[(y(!0),n(v,null,p(Qe.value,e=>(y(),n("tr",{key:e.pk,class:"flex-row"},[i("td",null,h(g(I)(e.createdAt,g(Ue).getUser.timezone)),1),l[73]||(l[73]=r()),i("td",null,[e.isComplete?(y(),n("i",Ie)):e.isFailed?(y(),n("span",Se,[l[72]||(l[72]=i("i",{class:"bi bi-x-circle-fill"},null,-1)),r(" "+h(e.status),1)])):(y(),n("i",De))]),l[74]||(l[74]=r()),i("td",null,h(e.formChoice),1),l[75]||(l[75]=r()),i("td",null,h(e.updates),1),l[76]||(l[76]=r()),i("td",null,h(e.errors),1),l[77]||(l[77]=r()),i("td",null,h(e.apiKeyLabel||e.userEmail),1),l[78]||(l[78]=r()),i("td",null,[e.isComplete&&e.fullUrl?(y(),n("a",{key:0,target:"_new",href:e.fullUrl},"View Result",8,Ne)):e.isFailed?(y(),n("span",Oe,h(e.errorMessage),1)):m("",!0)])]))),128))])])])])):m("",!0)])}}},[["__scopeId","data-v-1cca6850"]]);export{Ue as default};
2//# sourceMappingURL=https://storage.cloud.google.com/listing-mirror-sourcemaps/BulkImport-h8D_sORu.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.