import{B as Z}from"./bigcommerce-CxXMhKtn.js";import{w as ee}from"./wix-CAmUxDmY.js";import{g as we,a as Se,r as Ie,s as De,b as Ve,d as Ue,e as Ee,f as te,h as $e,i as Ne}from"./shop-B60azvAa.js";import{_ as Pe}from"./confirmationPopUp.vue_vue_type_script_setup_true_lang-DIvgkEO4.js";import{D as Te}from"./deleteDialog-BYsrA0c0.js";import{E as Ae}from"./editStoreName-BRS74KF5.js";import{d as Be,a as ze,s as We,b as Oe,r as a,q as je,f as c,g as k,h as s,i as n,G as T,w as r,F as oe,C as Qe,j as i,x,y as se,V as B,t as d,l as p,k as _,D as v,m as h,I as ne,aa as le,A as b,J as re,_ as qe}from"./index-N7CMQwFv.js";import{S as ie,W as ae,E as de}from"./woo-sVdUHmJL.js";import{M as z}from"./my-store-CPdwnZBZ.js";import{d as W}from"./dayjs.min-C4-AB8Gr.js";import Ge from"./connectShop-BVtxdsAj.js";import Le from"./copyProductsToStores-BaqpQZDU.js";import{V as Re}from"./VCol-xRADuXqd.js";import{V as y}from"./VTooltip-Ap2rzsdn.js";import{V as Fe}from"./VRow-CGgRlzLk.js";import{V as ce}from"./VDataTable-UguPFD5B.js";import"./VRadioGroup-Bk91gCKJ.js";import"./VSpacer-DhS9qmnu.js";/* empty css              */import"./myImg-B3XMH9SK.js";import"./AppDateTimePicker.vue_vue_type_style_index_0_lang-DxkjJlWf.js";import"./myProduct-BNmFFulZ.js";import"./VStepper-BmhzrFkQ.js";import"./VSheet-BUpJdv3I.js";import"./VAutocomplete-B-jGSTKg.js";import"./VSelect-CAAOHY78.js";import"./VList-BYq4u0VJ.js";import"./VMenu-Dbaxs5uG.js";import"./VChip-iaVLrPY0.js";import"./VSlideGroup-BGEgBoXK.js";import"./filter-D7iDI7IV.js";import"./VInfiniteScroll-CqDQ5FMk.js";import"./VPagination-CN_An-w0.js";import"./VTable-JZ8Hgj7V.js";const Ye={class:"d-flex align-start"},Me={class:"d-flex mt-7 flex-wrap"},Je={class:"d-flex align-center position-relative"},Xe={class:"ml-5"},He={class:"store-platform-name"},Ke={class:"store-platform-text mt-1"},Ze={class:"store-platform-describe mt-5"},et={class:"mb-5 store-platform-btn"},tt={key:0,class:"position-absolute cursor-pointer",style:{top:"10px",right:"10px"}},ot={class:"d-flex align-center pt-5 pb-5 my-store-table-box"},st={style:{width:"36px"}},nt={class:"ml-5"},lt={class:"ml-5"},rt={class:"my-store-title"},it=["onClick"],at={style:{"font-weight":"500"}},dt={style:{"font-weight":"500"}},ct={key:0},ut={class:"text-center"},pt={key:0,style:{"max-width":"250px"},class:"text-center my-store-text2 text-decoration-underline cursor-pointer d-inline-block text-truncate"},ft=["href"],ht={class:"d-flex flex-wrap justify-center"},mt={class:"d-flex align-center pt-5 pb-5 my-store-table-box"},vt={style:{width:"36px"}},yt={class:"ml-2"},kt={class:"d-flex align-center"},xt={class:"my-store-title ml-3"},_t={class:"mt-2"},bt=["onClick"],gt={class:"d-flex mt-2"},Ct={style:{"font-weight":"500"}},wt={class:"ml-3",style:{"font-weight":"500"}},St={key:0},It={key:0,style:{"max-width":"200px"},class:"text-center my-store-text2 text-decoration-underline cursor-pointer text-truncate d-inline-block"},Dt=["href"],Vt={class:"d-flex flex-wrap justify-center mt-3"},Ut={class:"d-flex justify-center mt-2"},Et=Be({__name:"index",setup($t){const A=ze(),V=We(),ue=Oe(),pe=a([{id:2,name:"Shopify",link:"adsfasdfadfasdfadsf",describe:"Ecommerce platform with everything you need to sale online.",type:"",text:"Platform",logo:ie},{id:3,name:"Etsy",link:"adsfasdfadfasdfadsf",describe:"A creative marketplace with over 80 million active buyers worldwide.",type:"",text:"Marketplace",logo:de},{id:4,name:"WooCommerce",link:"adsfasdfadfasdfadsf",describe:"The simplest way to monetizeblogs and websites built on WordPress.",type:"",text:"Open source platform",logo:ae},{id:5,name:"WIX",link:"adsfasdfadfasdfadsf",describe:"Wix offers a flexible platform and convenient store setup methods, giving you complete control over your store design.",type:"",text:"Platform",logo:ee},{id:6,name:"BigCommerce",link:"adsfasdfadfasdfadsf",describe:"BigCommerce is a scalable cloud e-commerce platform enabling businesses to build, manage, and grow online stores with tools and integrations.",type:"",text:"Platform",logo:Z},{id:1,name:"Genreal",link:"adsfasdfadfasdfadsf",describe:"A store that is not bound to anythird-party platform.",type:"",text:"",logo:z}]),fe=a(!1),C=a([]),m=a(0),g=()=>{we().then(o=>{C.value=o.data.records,C.value.forEach(async t=>{t.link="",t.type===5&&(t.link=await Ce(t.shopId)),t.type===2&&(fe.value=!0),F.query.copyId&&ye()}),m.value=A.getUserBaseInfo.currentShop.shopId})};g();const he=[{title:"Store Info",key:"storeInfo",width:"400"},{title:"Order Quantity",key:"orderQuantity"},{title:"Product Quantity",key:"productQuantity"},{title:"Remark",key:"remark",width:"300"},{title:"Connect",key:"connect",width:"400"},{title:"Actions",key:"actions"}],O=o=>{if(o===1)return ie;if(o===2)return z;if(o===3)return ae;if(o===4)return z;if(o===5)return de;if(o===6)return ee;if(o===7)return Z},U=o=>{o.type!==2&&window.open(o.url,"_blank")},j=o=>{Se({shopId:o.shopId}).then(t=>{m.value=o.shopId,ue.go(0)})},Q=o=>{H.value=o.shopId,N.value=!0},E=a(!1),q=a(null),me=o=>{Ie({shopId:q.value}).then(t=>{V.changeSnackbar({color:"#7367f0",location:"top",variant:"elevated",text:"Delete Successfully !",visible:!0}),g()})},G=o=>{E.value=!0,q.value=o},u=a(!1),L=a(null),w=a(1),R=o=>{L.value=o.shopId,w.value=1,u.value=!0},ve=(o,t)=>{t===1&&De({shopId:L.value,shopName:o}).then(e=>{V.changeSnackbar({color:"#7367f0",location:"top",variant:"elevated",text:"Setting Successful !",visible:!0}),u.value=!1,g()}),t===2&&Ve({shopId:null,shopifyDomainName:o}).then(e=>{window.open(e.data.redirectUrl,"_blank"),u.value=!1}),t===3&&Ue({shopId:null,url:o}).then(e=>{window.open(e.data.redirectUrl,"_blank"),u.value=!1}),t===-1&&Ee({shopName:o}).then(e=>{V.changeSnackbar({color:"#7367f0",location:"top",variant:"elevated",text:"Created shop successful !",visible:!0}),u.value=!1,g()})},F=je(),S=a(!1),Y=a(0),ye=()=>{S.value=!0,Y.value=F.query.copyId},M=a(null),J=o=>{S.value=!0,M.value=o},ke=o=>{if(o.id===3){te({callbackUrl:"https://www.artshiney.com/etsy/install"}).then(e=>{window.open(e.data,"_blank")});return}if(o.id===2&&(w.value=2,u.value=!0),o.id===4&&(w.value=3,u.value=!0),o.id===1&&(w.value=-1,u.value=!0),o.id===5){$e({shopId:null}).then(t=>{window.open(t.data,"_blank")});return}o.id===6&&window.open("https://login.bigcommerce.com/app/54073dj993takl6nj801agaf4gt54pz/install","newwindow","width=900,height=450,toolbar=no,scrollbars=yes")},$=a(!1),I=a(1),X=o=>{I.value=o.type,K.value=o.shopId,D.value=!0,$.value=!0},N=a(!1),H=a(null),D=a(!1),K=a(null),xe=o=>{if(!o){$.value=!1;return}Ne({shopId:K.value}).then(t=>{V.changeSnackbar({color:"#7367f0",location:"top",variant:"elevated",text:"Disconnect shop successful !",visible:!0}),$.value=!1,D.value=!1,g()}).catch(t=>{$.value=!1})},_e=()=>{g()},be=[{title:"Store Info",key:"storeInfo"}],ge=a(W().startOf("day").valueOf()),P=(o,t)=>{const e=W(parseInt(ge.value));return W(o).diff(e,"day")},Ce=async o=>{const t={shopId:o,callbackUrl:"https://www.artshiney.com/etsy/install"},e=a(null);return await te(t).then(l=>{e.value=l.data}),e.value};return(o,t)=>(c(),k(oe,null,[s("div",Ye,[n(T,{icon:"custom-checkbox-circle-fill mr-5",color:"#FFBC00"}),t[7]||(t[7]=s("div",{class:"my-store-top-text",style:{"max-width":"837px"}}," After linking to the store, you can quickly synchronize the products on the shelves with one click. The real-time order status and parcel tracking number will be automatically synchronized. ",-1))]),s("div",Me,[n(Fe,null,{default:r(()=>[(c(!0),k(oe,null,Qe(i(pe),(e,l)=>(c(),x(Re,{md:"4",sm:"6",xs:"12",lg:"4",xl:"3",xxl:"2",key:l},{default:r(()=>[n(se,{class:"pa-5 store-platform-card position-relative mr-3",height:"310"},{default:r(()=>[s("div",Je,[s("div",null,[n(B,{src:e.logo,width:"100",rounded:e.id===6?"":"circle"},null,8,["src","rounded"])]),s("div",Xe,[s("div",He,d(e.name),1),s("div",Ke,d(e.text),1)]),t[8]||(t[8]=s("div",null,null,-1))]),s("div",Ze,d(e.describe),1),s("div",et,[n(p,{variant:"outlined",color:"#000000",height:"42px",block:"",onClick:f=>ke(e)},{default:r(()=>t[9]||(t[9]=[_(" Create ")])),_:2,__:[9]},1032,["onClick"])]),e.id===3?(c(),k("div",tt,[n(y,{text:`The term 'Etsy' is a trademark of Etsy, Inc. This application uses the Etsy API but is not endorsed or
                certified by Etsy, Inc.`},{activator:r(({props:f})=>[n(T,v({ref_for:!0},f,{icon:"custom-question-line",color:"#999999"}),null,16)]),_:1})])):h("",!0)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),n(se,{class:"mt-5"},{default:r(()=>[n(ne,{class:"pa-0 mobile-data-box"},{default:r(()=>[n(ce,{"items-per-page":-1,headers:he,items:i(C),"disable-sort":"","hide-default-footer":"","hide-default-header":""},{"item.storeInfo":r(({item:e})=>[s("div",ot,[s("div",st,[n(le,{modelValue:i(m),"onUpdate:modelValue":[t[0]||(t[0]=l=>b(m)?m.value=l:null),l=>j(e)],value:e.shopId},null,8,["modelValue","value","onUpdate:modelValue"])]),s("div",nt,[n(B,{src:O(e.type),width:"54",rounded:e.type===7?"":"circle"},null,8,["src","rounded"])]),s("div",lt,[s("div",rt,[_(d(e.name)+" ",1),n(y,{text:"Change Store Name"},{activator:r(({props:l})=>[n(T,v(l,{icon:"custom-edit-line ml-2 cursor-pointer",size:"18",color:"#6D788D",onClick:f=>R(e)}),null,16,["onClick"])]),_:2},1024)]),s("div",{class:re(["my-store-text",e.url?"my-store-text2 cursor-pointer text-decoration-underline":""]),onClick:l=>U(e)},d(e.url?e.url:"Unconnected store"),11,it)])])]),"item.orderQuantity":r(({item:e})=>[s("div",at,"Order "+d(e.orderNum),1)]),"item.productQuantity":r(({item:e})=>[s("div",dt,"Product "+d(e.productNum),1)]),"item.remark":r(({item:e})=>[e.type==5?(c(),k("div",ct,[s("div",ut," Authorization validity period: "+d(P(e.authExpireAt))+" days ",1),P(e.authExpireAt)<=45?(c(),k("div",pt,[s("a",{class:"my-store-text3",href:e.link,target:"_blank",rel:"noopener noreferrer"},d(e.link),9,ft)])):h("",!0)])):h("",!0)]),"item.connect":r(({item:e})=>[s("div",ht,[e.isConnect?e.isConnect&&e.type!==2?(c(),x(p,{key:1,variant:"outlined",color:"#6D788D",height:"42px",onClick:l=>U(e)},{default:r(()=>t[11]||(t[11]=[_(" View online store ")])),_:2,__:[11]},1032,["onClick"])):h("",!0):(c(),x(p,{key:0,variant:"flat",color:"#000000",height:"42px",onClick:l=>Q(e)},{default:r(()=>t[10]||(t[10]=[_(" Connect ")])),_:2,__:[10]},1032,["onClick"]))])]),"item.actions":r(({item:e})=>[n(y,{text:"Disconnect"},{activator:r(({props:l})=>[e.isConnect&&e.type!==2?(c(),x(p,v({key:0,icon:"custom-link-unlink",variant:"text",color:"#6D788D"},l,{onClick:f=>X(e)}),null,16,["onClick"])):h("",!0)]),_:2},1024),n(y,{text:"Copy the store's products to this store"},{activator:r(({props:l})=>[n(p,v({icon:"custom-file-copy-line",variant:"text",color:"#6D788D"},l,{disabled:e.shopId===i(A).getUserBaseInfo.currentShop.shopId,onClick:f=>J(e.shopId)}),null,16,["disabled","onClick"])]),_:2},1024),n(y,{text:"Delete"},{activator:r(({props:l})=>[n(p,v({icon:"custom-delete-bin-line",variant:"text",color:"#6D788D"},l,{onClick:f=>G(e.shopId)}),null,16,["onClick"])]),_:2},1024)]),_:1},8,["items"])]),_:1}),n(ne,{class:"pa-0 mobile-data-box2"},{default:r(()=>[n(ce,{"items-per-page":-1,headers:be,items:i(C),"disable-sort":"","hide-default-footer":"","hide-default-header":""},{"item.storeInfo":r(({item:e})=>[s("div",mt,[s("div",vt,[n(le,{modelValue:i(m),"onUpdate:modelValue":[t[1]||(t[1]=l=>b(m)?m.value=l:null),l=>j(e)],value:e.shopId},null,8,["modelValue","value","onUpdate:modelValue"])]),s("div",yt,[s("div",kt,[s("div",null,[n(B,{src:O(e.type),width:"54",rounded:"circle"},null,8,["src"])]),s("div",xt,[_(d(e.name)+" ",1),n(T,{icon:"custom-edit-line ml-2 cursor-pointer",size:"18",color:"#6D788D",onClick:l=>R(e)},null,8,["onClick"])])]),s("div",_t,[s("div",{class:re(["my-store-text",e.url?"my-store-text2 cursor-pointer text-decoration-underline":""]),onClick:l=>U(e)},d(e.url?e.url:"Unconnected store"),11,bt)]),s("div",gt,[s("div",Ct,"Order "+d(e.orderNum),1),s("div",wt,"Product "+d(e.productNum),1)]),e.type==5?(c(),k("div",St,[s("div",null," Authorization validity period: "+d(P(e.authExpireAt))+" days ",1),P(e.authExpireAt)<=45?(c(),k("div",It,[s("a",{class:"my-store-text3",href:e.link,target:"_blank",rel:"noopener noreferrer"},d(e.link),9,Dt)])):h("",!0)])):h("",!0),s("div",Vt,[e.isConnect?e.isConnect&&e.type!==2?(c(),x(p,{key:1,variant:"outlined",color:"#6D788D",height:"42px",onClick:l=>U(e)},{default:r(()=>t[13]||(t[13]=[_(" View online store ")])),_:2,__:[13]},1032,["onClick"])):h("",!0):(c(),x(p,{key:0,variant:"flat",color:"#000000",height:"42px",onClick:l=>Q(e)},{default:r(()=>t[12]||(t[12]=[_(" Connect ")])),_:2,__:[12]},1032,["onClick"]))]),s("div",Ut,[n(y,{text:"Disconnect"},{activator:r(({props:l})=>[e.isConnect&&e.type!==2?(c(),x(p,v({key:0,icon:"custom-link-unlink",variant:"text",color:"#6D788D"},l,{onClick:f=>X(e)}),null,16,["onClick"])):h("",!0)]),_:2},1024),n(y,{text:"Copy"},{activator:r(({props:l})=>[n(p,v({icon:"custom-file-copy-line",variant:"text",color:"#6D788D"},l,{disabled:e.shopId===i(A).getUserBaseInfo.currentShop.shopId,onClick:f=>J(e.shopId)}),null,16,["disabled","onClick"])]),_:2},1024),n(y,{text:"Delete"},{activator:r(({props:l})=>[n(p,v({icon:"custom-delete-bin-line",variant:"text",color:"#6D788D"},l,{onClick:f=>G(e.shopId)}),null,16,["onClick"])]),_:2},1024)])])])]),_:1},8,["items"])]),_:1})]),_:1}),n(Le,{"copy-product-visible":i(S),"onUpdate:copyProductVisible":t[2]||(t[2]=e=>b(S)?S.value=e:null),"product-copy-id":i(Y),"out-side-store-id":i(M),"store-data":i(C),"onChange:confirmAddProduct":_e},null,8,["copy-product-visible","product-copy-id","out-side-store-id","store-data"]),n(Te,{"open-or-close-delete-dialog-visible":i(E),"onUpdate:openOrCloseDeleteDialogVisible":t[3]||(t[3]=e=>b(E)?E.value=e:null),deleteTitle:"Delete Store","delete-text":"Are you sure you want delete?","onChange:confirmDelete":me},null,8,["open-or-close-delete-dialog-visible"]),n(Ae,{"edit-input-dialog-visible":i(u),"onUpdate:editInputDialogVisible":t[4]||(t[4]=e=>b(u)?u.value=e:null),type:i(w),"onChange:confirmEdit":ve},null,8,["edit-input-dialog-visible","type"]),n(Ge,{"connect-shop-visible":i(N),"onUpdate:connectShopVisible":t[5]||(t[5]=e=>b(N)?N.value=e:null),"shop-id":i(H)},null,8,["connect-shop-visible","shop-id"]),n(Pe,{"confirm-pop-up-visible":i(D),"onUpdate:confirmPopUpVisible":t[6]||(t[6]=e=>b(D)?D.value=e:null),title:"Disconnect Your Store?",content:`ArtShiney account won’t receive incoming orders for published products in your store. You won’t be able to update products in your store from your ${i(I)===1?"Shopify":i(I)===2?"General Store":i(I)===3?"WooCommerce":i(I)===5?"Etsy":""} account.`,"onUpdate:confirm":xe},null,8,["confirm-pop-up-visible","content"])],64))}}),fo=qe(Et,[["__scopeId","data-v-5e134d23"]]);export{fo as default};