import{c as ie,b as ee,s as P,_ as re,a as fe}from"./storeApi-CK4jcdxX.js";import{_ as Re}from"./TitleBreadcrumb.vue_vue_type_style_index_0_lang-BxraGGjs.js";import{_ as Ee}from"./warn-C4Q7ewaQ.js";import{I as W,k as u,X as R,o as m,A as _,a as e,w as t,e as p,t as N,ax as j,ae as B,af as Y,b as n,U as oe,N as w,bb as te,s as $,$ as ve,d as U,ak as z,ay as le,F as E,B as K,c as ce,aB as O,f as _e,V as ge,ag as de,ah as ue,Q as pe,R as J,M as H,bc as ye,bd as we,Z as ne,l as Te,x as T,bf as Ae,G,u as Me,am as Pe,aW as Le,aX as q,aY as Be}from"./index-CW_ph8U7.js";import{_ as X}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as ze}from"./wenhao-C-cdfRm0.js";import{s as me}from"./shopTypeEnum-5xzXy4lw.js";const Oe="/assets/shop-BXZKNfLY.png",We="/assets/woo-DcdpDhMG.png",je={class:"d-flex align-center"},Ye={class:"text-center mt-4"},Fe=["src"],Ge=["src"],He=["src"],Je=["src"],Xe={class:"text-center mt-4"},Qe={class:"mt-3 text-center"},Ze={class:"btns mt-5"},qe=W({__name:"ConnectShopDialog",emits:["reflash"],setup(C,{expose:D,emit:x}){let s=u(!1);u(!1);const r=u(!1),i=u(""),a=R({}),l=R({color:"",msg:"",isShow:!1});function I(b){a.value=b,s.value=!0}const v=()=>{i.value="",s.value=!1};function k(){r.value=!0;const b=P();a.value.type==1&&a.value.shopId?b.shopifyUrlGet({shopifyDomainName:i.value,shopId:a.value.shopId}).then(o=>{o.code==200?(r.value=!1,window.open(o.data.redirectUrl)):(r.value=!1,l.isShow=!0,l.color="error",l.msg=o.msg)}).catch(o=>{}):a.value.type==1&&!a.value.shopId&&b.shopifyUrlGet({shopifyDomainName:i.value}).then(o=>{o.code==200?(r.value=!1,window.open(o.data.redirectUrl)):(r.value=!1,l.isShow=!0,l.color="error",l.msg=o.msg)}).catch(o=>{console.log("cath...",o),l.isShow=!0,l.color="error",l.msg=o.msg}),a.value.type==3&&a.value.shopId&&b.woocommerceUrlGet({url:i.value,shopId:a.value.shopId}).then(o=>{o.code==200?(r.value=!1,window.open(o.data.redirectUrl)):(r.value=!1,l.isShow=!0,l.color="error",l.msg=o.msg)}).catch(o=>{console.log("cath...",o)}),a.value.type==3&&!a.value.shopId&&b.woocommerceUrlGet({url:i.value}).then(o=>{console.log("success",o),o.code==200?(r.value=!1,window.open(o.data.redirectUrl)):(r.value=!1,l.isShow=!0,l.color="error",l.msg=o.msg)}).catch(o=>{console.log("cath...",o)})}return D({openDialog:I,closeDialog:v}),(b,o)=>(m(),_(E,null,[e(j,{modelValue:l.isShow,"onUpdate:modelValue":o[0]||(o[0]=c=>l.isShow=c),color:l.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[p(N(l.msg),1)]),_:1},8,["modelValue","color"]),e(le,{modelValue:w(s),"onUpdate:modelValue":o[2]||(o[2]=c=>z(s)?s.value=c:s=c),"max-width":575},{default:t(()=>[e(B,null,{default:t(()=>[e(Y,{style:{padding:"24px"}},{default:t(()=>[n("h3",je,[p("Let's Connect your Store! "),e(oe,{src:w(te),width:32,height:32,class:"close",onClick:v},null,8,["src"])]),n("div",Ye,[a.value.type==1||!a.value.type?(m(),_("img",{key:0,src:w(Oe),style:{width:"87px",height:"87px"}},null,8,Fe)):$("",!0),a.value.type==2?(m(),_("img",{key:1,src:w(ie),style:{width:"87px",height:"87px"}},null,8,Ge)):$("",!0),a.value.type==3?(m(),_("img",{key:2,src:w(We),style:{width:"87px",height:"87px"}},null,8,He)):$("",!0),a.value.type==5?(m(),_("img",{key:3,src:w(ee),style:{width:"87px",height:"87px"}},null,8,Je)):$("",!0)]),n("h4",Xe,"Connect "+N(a.value.type==1?"Shopify":"WooCommerce"),1),n("p",Qe,"Add your "+N(a.value.type==1?"Shopify":"WooCommerce")+" store URL to connect with JetPrint ",1),e(ve,{class:"mt-3",modelValue:i.value,"onUpdate:modelValue":o[1]||(o[1]=c=>i.value=c),label:a.value.type==1?"e.g.my-shop.myshopify.com":"https://www.examplestore.com",density:"comfortable",variant:"outlined",color:"primary","hide-details":"auto"},null,8,["modelValue","label"]),n("div",Ze,[e(U,{color:"lightprimary",onClick:v},{default:t(()=>[p("Cancel")]),_:1}),e(U,{class:"ml-4",color:"btnBlue",loading:r.value,disabled:r.value,onClick:k},{default:t(()=>[p("Connect")]),_:1},8,["loading","disabled"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),xe=X(qe,[["__scopeId","data-v-efb5d258"]]),Ke=C=>(de("data-v-9692faf5"),C=C(),ue(),C),eo={class:"d-flex align-center ga-4"},oo=["src"],to={class:"text-h3 font-weight-medium"},lo={key:0,class:"position-relative",style:{"margin-left":"-10px",top:"2px"}},so=Ke(()=>n("img",{src:Ee,style:{width:"18px",height:"18px"},alt:""},null,-1)),ao={style:{"min-height":"150px"}},no=W({__name:"ConnectStore",setup(C){let D=R([{name:"Shopify",type:1,icon:re,desc:["Allow to push products to stores","Allow your consumers to upload text and images","No limitations"]},{name:"Etsy",type:5,icon:ee,desc:["Allow to push products to stores","Allow to push personalization features","Products can only be pushed attaching with 10 pictures and 13 tags"]}]);const x=u(null);let s=u(!1);function r(i){if(i.type==1)window.open("https://apps.shopify.com/jetprint-fulfillment");else if(i.type==3)x.value&&x.value.openDialog(i);else{s.value=!0;var a={};a.shopId=i.shopId||"";let l=window.location.href.split("?")[0];l=="https://dashboard.jetprintapp.com/app/integrations"?l="https://dashboard.jetprintapp.com/app":l="https://dashboard.jetprintapp.com",a.callbackUrl=l+"/etsy/installs",P().getEtsyConnectUrl(a).then(v=>{s.value=!1,window.open(v.data)})}}return(i,a)=>(m(),_(E,null,[e(ge,null,{default:t(()=>[(m(!0),_(E,null,K(w(D),(l,I)=>(m(),ce(_e,{cols:"12",lg:"6",md:"6",sm:"6",key:I},{default:t(()=>[e(B,{variant:"outlined",class:"bg-gray100"},{default:t(()=>[e(Y,{style:{padding:"24px"}},{default:t(()=>[n("div",eo,[n("img",{src:l.icon,style:{width:"48px",height:"48px"},alt:""},null,8,oo),n("span",to,N(l.name),1),I==2?(m(),_("div",lo,[e(O,{"max-width":"334px",activator:"parent",location:"top"},{default:t(()=>[p("The term 'Etsy' is a trademark of Etsy, Inc. This application uses the Etsy API but is not endorsed or certified by Etsy, Inc.")]),_:1}),so])):$("",!0)]),n("ul",ao,[(m(!0),_(E,null,K(l.desc,(v,k)=>(m(),_("li",{style:{"font-size":"14px"},class:"mt-3",key:I},N(v),1))),128))]),e(U,{class:"mt-3 font-weight-medium connent-btn",block:"",variant:"outlined",height:"44",loading:I==2&&w(s),color:"primary",onClick:v=>r(l)},{default:t(()=>[p("Connect")]),_:2},1032,["loading","onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1}),e(xe,{ref_key:"refConnectShopDialog",ref:x},null,512)],64))}}),io=X(no,[["__scopeId","data-v-9692faf5"]]),ro={class:"d-flex align-center"},co={class:"btns"},uo=W({__name:"ResetNameDialog",emits:["reflash"],setup(C,{expose:D,emit:x}){let s=u(!1);const r=u(""),i=R({}),a=u(!1),l=pe(),I=J(()=>(console.log("computed...",l.merchantInfoMutations.currentShop),l.merchantInfoMutations.currentShop));J(()=>(console.log("computed...",l.merchantInfoMutations.currentShop),l.merchantInfoMutations.allShops));const v=x;let k=u(!1);const b=g=>{console.log("openDialog...",g),r.value=g.name,i.value=g,s.value=!0},o=()=>{s.value=!1};function c(){console.log(I.value),k.value=!0;const g=P(),S={shopId:i.value.shopId,shopName:r.value};g.setShopName(S).then(h=>{l.SET_MERCHANT_INFO_MUTATIONS(),k.value=!1,a.value=!0,o(),v("reflash")})}return D({openDialog:b,closeDialog:o}),(g,S)=>(m(),_(E,null,[e(j,{modelValue:a.value,"onUpdate:modelValue":S[0]||(S[0]=h=>a.value=h),color:"success",timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[p("Successfully")]),_:1},8,["modelValue"]),e(le,{modelValue:w(s),"onUpdate:modelValue":S[3]||(S[3]=h=>z(s)?s.value=h:s=h),"max-width":575},{default:t(()=>[e(B,null,{default:t(()=>[e(Y,{style:{padding:"24px"}},{default:t(()=>[n("h3",ro,[p("Store Setup "),e(oe,{src:w(te),width:32,height:32,class:"close",onClick:S[1]||(S[1]=h=>z(s)?s.value=!1:s=!1)},null,8,["src"])]),e(H,{class:"mt-6"}),e(ve,{modelValue:r.value,"onUpdate:modelValue":S[2]||(S[2]=h=>r.value=h),label:"Store Name",class:"mt-4 mb-6","hide-details":"auto",variant:"outlined",color:"primary"},null,8,["modelValue"]),n("div",co,[e(U,{class:"",color:"lightprimary",onClick:o},{default:t(()=>[p("Cancel")]),_:1}),e(U,{class:"ml-4",color:"btnBlue",loading:w(k),onClick:c},{default:t(()=>[p("Confirm")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),po=X(uo,[["__scopeId","data-v-d7c45310"]]),ho=C=>(de("data-v-5cd7fada"),C=C(),ue(),C),mo={class:"d-flex align-center"},fo=ho(()=>n("div",{class:"d-flex warn-con"},[n("div",{class:"warn pr-3 pt-1"},[n("img",{src:ze,alt:""})]),n("div",{class:"desc",style:{"line-height":"20px"}}," Due to sales channel limitations some sales channel specific product details like product description text formating and tags might be lost in copy process. ")],-1)),vo={key:0,class:"d-flex pa-3 ps-0"},_o={class:""},go={class:""},yo={class:"font-weight-medium",style:{"font-size":"16px"}},wo={class:"text-medium-emphasis text-subtitle-2"},xo={class:"ml-auto"},So={key:0,src:re,style:{width:"48px",height:"48px"},alt:""},bo={key:1,src:ie,style:{width:"48px",height:"48px"},alt:""},Io={key:2,src:fe,style:{width:"48px",height:"48px"},alt:""},Co={key:3,src:ee,style:{width:"48px",height:"48px"},alt:""},ko={class:"btns"},Vo=W({__name:"CopyProductDialog",emits:["reflash"],setup(C,{expose:D,emit:x}){let s=u(!1);u(""),R({});const r=R([]);u(!1);const i=u(""),a=u(!1),l=R({color:"success",msg:"Your products are being duplicated in the background. You can continue using your account.",isShow:!1});let I=u(""),v=u("");const k=P();function b(){a.value=!0;const g={formStoreId:v.value,toStoreId:i.value};k.productAllBatch(g).then(S=>{a.value=!1,l.isShow=!0,c()})}function o(g,S,h){s.value=!0,I.value=g,v.value=S,r.value=h}const c=()=>{s.value=!1};return D({openDialog:o,closeDialog:c}),(g,S)=>(m(),_(E,null,[e(j,{modelValue:l.isShow,"onUpdate:modelValue":S[0]||(S[0]=h=>l.isShow=h),color:l.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[p(N(l.msg),1)]),_:1},8,["modelValue","color"]),e(le,{modelValue:w(s),"onUpdate:modelValue":S[3]||(S[3]=h=>z(s)?s.value=h:s=h),"max-width":575},{default:t(()=>[e(B,null,{default:t(()=>[e(Y,{style:{"padding-top":"24px"}},{default:t(()=>[n("h3",mo,[p("Copy "+N(w(I))+" products to … ",1),e(oe,{src:w(te),width:32,height:32,class:"close",onClick:S[1]||(S[1]=h=>z(s)?s.value=!1:s=!1)},null,8,["src"])]),e(H,{class:"mt-4 mb-5"}),fo,e(H,{class:"mt-5"}),e(ye,{class:"scroll",modelValue:i.value,"onUpdate:modelValue":S[2]||(S[2]=h=>i.value=h)},{default:t(()=>[(m(!0),_(E,null,K(r.value,(h,F)=>(m(),_("div",{key:F},[w(v)!=h.shopId?(m(),_("div",vo,[n("div",_o,[e(we,{color:"secondary",value:h.shopId,disabled:w(v)==h.shopId},null,8,["value","disabled"])]),n("div",go,[n("p",yo,N(h.name),1),n("p",wo,N(h.url?h.url:"No Sales Channel"),1)]),n("div",xo,[h.type==1?(m(),_("img",So)):$("",!0),h.type==2||h.type==4?(m(),_("img",bo)):$("",!0),h.type==3?(m(),_("img",Io)):$("",!0),h.type==5?(m(),_("img",Co)):$("",!0)])])):$("",!0),e(H)]))),128))]),_:1},8,["modelValue"]),n("div",ko,[e(U,{class:"mt-4",color:"lightprimary",onClick:c},{default:t(()=>[p("Cancel")]),_:1}),e(U,{class:"mt-4 ml-4",color:"btnBlue",loading:a.value,disabled:a.value,onClick:b},{default:t(()=>[p("Confirm")]),_:1},8,["loading","disabled"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),$o=X(Vo,[["__scopeId","data-v-5cd7fada"]]),Do=C=>(de("data-v-dd55ad18"),C=C(),ue(),C),Uo={class:"d-flex align-center"},No=Do(()=>n("p",{class:"mt-4",style:{"line-height":"20px"}},"JetPrint 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 JetPrint account. ",-1)),Ro={class:"btns"},Eo=W({__name:"DisconnectDialog",emits:["reflash"],setup(C,{expose:D,emit:x}){let s=u(!1);const r=u(!1),i=u(!1),a=u(""),l=x;function I(b){a.value=b,s.value=!0}const v=()=>{s.value=!1};function k(){i.value=!0,P().disconnect({shopId:a.value}).then(o=>{i.value=!1,v(),l("reflash",a.value)})}return D({openDialog:I,closeDialog:v}),(b,o)=>(m(),_(E,null,[e(j,{modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=c=>r.value=c),color:"success",timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[p("Successfully")]),_:1},8,["modelValue"]),e(le,{modelValue:w(s),"onUpdate:modelValue":o[2]||(o[2]=c=>z(s)?s.value=c:s=c),"max-width":575},{default:t(()=>[e(B,null,{default:t(()=>[e(Y,{style:{"padding-top":"24px"}},{default:t(()=>[n("h3",Uo,[p("Disconnect Your Store? "),e(oe,{src:w(te),width:32,height:32,class:"close",onClick:o[1]||(o[1]=c=>z(s)?s.value=!1:s=!1)},null,8,["src"])]),e(H,{class:"mt-4"}),No,n("div",Ro,[e(U,{class:"mt-4",color:"lightprimary",onClick:v},{default:t(()=>[p("Cancel")]),_:1}),e(U,{class:"mt-4 ml-4",color:"btnBlue",loading:i.value,disabled:i.value,onClick:k},{default:t(()=>[p("Confirm")]),_:1},8,["loading","disabled"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}}),To=X(Eo,[["__scopeId","data-v-dd55ad18"]]),Ao={class:"",style:{position:"absolute",opacity:"0"}},Mo={class:"d-flex align-center"},Po={class:"ml-4 font-weight-medium",style:{color:"#252525"}},Lo={style:{width:"50%"},class:"text-medium-emphasis"},Bo={class:"font-weight-medium",style:{color:"#252525"}},zo={style:{width:"50%"},class:"text-medium-emphasis"},Oo={class:"font-weight-medium",style:{color:"#252525"}},Wo={__name:"StoreList",props:{type:String},setup(C){const D=C,x=pe(),s=u(null),r=u([]),i=u([]),a=P();let l=R({});const I=R({color:"",msg:"",isShow:!1}),v=R({color:"",msg:"",isShow:!1}),k=R({title:"",message:""});let b=u(!1);const o=J(()=>(s.value=x.merchantInfoMutations.currentShop.shopId,x.merchantInfoMutations.currentShop));ne(()=>D.type,(d,y)=>{let V=[];i.value.length>0&&(i.value.forEach((M,Z)=>{d!=""?M.type==d&&V.push(M):V.push(M)}),r.value=V),console.log(`message prop changed from ${y} to ${d}`)});const c=J(()=>(console.log("computed...",x.merchantInfoMutations),x.merchantInfoMutations.login));function g(){if(c.value){const d={};d.type=D.type,a.shopList(d).then(y=>{r.value=y.data.records,i.value=y.data.records})}}Te(()=>{g()});function S(d){g(),h(d)}function h(d){r.value.forEach(y=>{if(d==y.shopId){const V={name:y.name,shopId:y.shopId,shopType:y.type};x.SET_MERCHANT_SHOP(V)}})}let F=u(null);function Se(d,y){F.value&&F.value.openDialog(d,y,r.value)}let se=u(null);function be(d){se.value&&se.value.openDialog(d)}const ae=u(null),Ie=d=>{ae.value&&ae.value.openDialog(d)},Q=u(null);function Ce(d){Q.value&&(l.value=d,k.title="Remove Store from JetPrint?",k.message="When clicked the Confirm button, this store will be closed after 1 second.",Q.value.openDialog())}function ke(){console.log("hanldeItem...",l.value.shopId),a.removeStore({shopId:l.value.shopId}).then(d=>{Q.value.closeDialog(),v.isShow=!0,v.msg="Remove Store Success",v.color="success",x.SET_MERCHANT_INFO_MUTATIONS(),g()})}function Ve(d){if(d.indexOf("http")===0)window.open(d);else{const y="https://"+d;window.open(y)}}const he=u(null);function $e(d){if(b.value=!0,d.type==me.SHOPIFY.value)window.open("https://apps.shopify.com/jetprint-fulfillment"),b.value=!1;else if(d.type==me.ETSY.value){var y={};y.shopId=d.shopId||"";let V=window.location.href.split("?")[0];V=="https://dashboard.jetprintapp.com/app/integrations"?V="https://dashboard.jetprintapp.com/app":V="https://dashboard.jetprintapp.com",y.callbackUrl=V+"/etsy/installs",P().getEtsyConnectUrl(y).then(Z=>{b.value=!1,window.open(Z.data)})}else he.value.openDialog(d.id),b.value=!1}let A=u("");return A.value=window.innerWidth,window.addEventListener("resize",function(d){A.value=window.innerWidth}),s.value=o.value.shopId,ne(()=>s.value,d=>{a.shopChange({shopId:d}).then(y=>{r.value.forEach(V=>{if(V.shopId==d){let M={name:V.name,shopId:V.shopId,shopType:V.type};x.SET_MERCHANT_SHOP(M)}})})}),(d,y)=>{const V=G("PencilMinusIcon"),M=G("CopyIcon"),Z=G("UnlinkIcon"),De=G("TrashIcon"),Ue=G("BuildingStoreIcon");return m(),_(E,null,[n("div",Ao,N(o.value),1),e(j,{modelValue:I.isShow,"onUpdate:modelValue":y[0]||(y[0]=f=>I.isShow=f),color:I.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[p(N(I.msg),1)]),_:1},8,["modelValue","color"]),e(ye,{modelValue:s.value,"onUpdate:modelValue":y[2]||(y[2]=f=>s.value=f)},{default:t(()=>[(m(!0),_(E,null,K(r.value,(f,Ne)=>(m(),_("div",{class:"text-grey-lighten-3 d-flex flex-wrap align-center",style:{"border-bottom":"1px solid #E3E8EF","padding-top":"24px","padding-bottom":"24px"},key:Ne},[n("div",{style:T((w(A)<=375,"width: 50px"))},[e(we,{color:"secondary",rounded:"","hide-details":"",value:f.shopId,modelValue:s.value,"onUpdate:modelValue":y[1]||(y[1]=L=>s.value=L)},null,8,["value","modelValue"])],4),n("div",{style:T(w(A)<=775?"width: 80%":"width: 35%")},[n("div",Mo,[f.type==1?(m(),_("img",{key:0,src:re,style:T([{opacity:f.isConnect?1:.3},{width:"46px",height:"46px"}])},null,4)):$("",!0),f.type==2||f.type==4?(m(),_("img",{key:1,src:ie,style:T([{opacity:f.isConnect?1:.3},{width:"46px",height:"46px"}])},null,4)):$("",!0),f.type==3?(m(),_("img",{key:2,src:fe,style:T([{opacity:f.isConnect?1:.3},{width:"46px",height:"46px"}])},null,4)):$("",!0),f.type==5?(m(),_("img",{key:3,src:ee,style:T([{opacity:f.isConnect?1:.3},{width:"46px",height:"46px"}])},null,4)):$("",!0),n("span",Po,N(f.name),1),e(U,{icon:"",color:"#252525",variant:"text",onClick:L=>Ie(f)},{default:t(()=>[e(O,{activator:"parent",location:"top"},{default:t(()=>[p("Store Name")]),_:1}),e(V,{size:"20","stroke-width":"1.25"})]),_:2},1032,["onClick"])])],4),n("div",{class:"d-flex",style:T(w(A)<=775?"width: 100%;margin-top: 20px":"width: 30%")},[n("div",Lo,[p("Orders: "),n("span",Bo,N(f.orderNum),1)]),n("div",zo,[p("Products: "),n("span",Oo,N(f.productNum),1)])],4),n("div",{style:T(w(A)<=375?"width: 100%;":"width: 10%")},[f.isConnect?$("",!0):(m(),ce(U,{key:0,color:"primary",loading:w(b),rounded:"",onClick:L=>$e(f),style:T(w(A)<=375?"margin-top: 20px":"")},{default:t(()=>[p(" Connect ")]),_:2},1032,["loading","onClick","style"]))],4),n("div",{class:"d-flex",style:T(w(A)<900?"width: 100%;margin-top: 20px;":"width: 20%")},[n("div",null,[e(O,{activator:"parent",location:"top"},{default:t(()=>[p("Copy Poducts")]),_:1}),e(U,{icon:"",color:"#252525",variant:"text",disabled:r.value.length<=1||f.productNum===0,onClick:L=>Se(f.productNum,f.shopId)},{default:t(()=>[e(M,{size:"20","stroke-width":"1.25"})]),_:2},1032,["disabled","onClick"])]),n("div",null,[e(O,{activator:"parent",location:"top"},{default:t(()=>[p("Disconnect")]),_:1}),e(U,{icon:"",color:"#252525",variant:"text",disabled:!f.isConnect||f.type==2,onClick:L=>be(f.shopId)},{default:t(()=>[e(Z,{size:"20","stroke-width":"1.25"})]),_:2},1032,["disabled","onClick"])]),n("div",null,[e(O,{activator:"parent",location:"top"},{default:t(()=>[p("Remove Store")]),_:1}),e(U,{icon:"",color:"#252525",variant:"text",disabled:f.type==2,onClick:L=>Ce(f)},{default:t(()=>[e(De,{size:"20","stroke-width":"1.25"})]),_:2},1032,["disabled","onClick"])]),n("div",null,[e(O,{activator:"parent",location:"top"},{default:t(()=>[p("Visit Store")]),_:1}),e(U,{icon:"",color:"#252525",variant:"text",disabled:!f.url,onClick:L=>Ve(f.url)},{default:t(()=>[e(Ue,{size:"20","stroke-width":"1.25"})]),_:2},1032,["disabled","onClick"])])],4)]))),128))]),_:1},8,["modelValue"]),e(po,{ref_key:"refResetName",ref:ae,onReflash:g},null,512),e($o,{ref_key:"refCopyProduct",ref:F,onReflash:g},null,512),e(To,{ref_key:"refDisconnect",ref:se,onReflash:S},null,512),e(Ae,{ref_key:"refDelProduct",ref:Q,title:k.title,message:k.message,onReflash:ke},null,8,["title","message"]),e(xe,{ref_key:"refConnectShopDialog",ref:he,onReflash:g},null,512)],64)}}},jo=Wo,Yo={class:"pa-5"},qo=W({__name:"Index",setup(C){const D=pe(),x=u("tab-profile"),s=R([{title:"Integrations",disabled:!0,href:"#"}]),r=u(1),i=R({color:"",msg:"",isShow:!1});ne(()=>x.value,(o,c)=>{o=="tab-myStore"&&(r.value=""),o=="tab-myStore"&&(r.value=""),o=="tab-myStore"&&(r.value=""),o=="tab-myStore"&&(r.value="")});const a=J(()=>(console.log("computed...",D.merchantInfoMutations),D.merchantInfoMutations.login));function l(o){var c=new RegExp("(^|&)"+o+"=([^&]*)(&|$)","i"),g=window.location.search.substr(1).match(c);return g!=null?unescape(g[2]):null}const I=P();var v=l("code"),k=l("state"),b=l("error");return console.log("code...",v),console.log("state...",k),console.log("error...",b),v&&v!=null&&(Me().query,I.submitEtsyConnect({code:v,state:k}).then(c=>{c.code==200?(i.color="success",i.msg="connect etsy shop success!",i.isShow=!0):(i.color="error",i.msg=c.msg,i.isShow=!0)})),(o,c)=>(m(),_(E,null,[e(j,{modelValue:i.isShow,"onUpdate:modelValue":c[0]||(c[0]=g=>i.isShow=g),color:i.color,timeout:3e3,variant:"flat",rounded:"md",location:"top"},{default:t(()=>[p(N(i.msg),1)]),_:1},8,["modelValue","color"]),e(Re,{title:"Integrations",breadcrumbs:s},null,8,["breadcrumbs"]),e(B,{variant:"flat",class:"px-4 py-3"},{default:t(()=>[e(Pe,{class:"text-subtitle-6 font-weight-medium pb-5"},{default:t(()=>[p("Let's connect your store!")]),_:1}),e(Y,null,{default:t(()=>[e(io,{class:"mt-3"})]),_:1})]),_:1}),a.value?(m(),ce(B,{key:0,variant:"flat",class:"px-4 py-3 mt-4"},{default:t(()=>[e(ge,null,{default:t(()=>[e(_e,{cols:"12"},{default:t(()=>[e(Le,{modelValue:x.value,"onUpdate:modelValue":c[1]||(c[1]=g=>x.value=g),"selected-class":"integrationsactivedTab"},{default:t(()=>[e(q,{value:""},{default:t(()=>[p("My Store")]),_:1}),e(q,{value:"1"},{default:t(()=>[p("Shopify")]),_:1}),e(q,{value:"3"},{default:t(()=>[p("Woocommerce")]),_:1}),e(q,{value:"5"},{default:t(()=>[p("Etsy")]),_:1})]),_:1},8,["modelValue"]),n("div",Yo,[e(Be,{modelValue:x.value,"onUpdate:modelValue":c[2]||(c[2]=g=>x.value=g)},{default:t(()=>[e(jo,{type:x.value},null,8,["type"])]),_:1},8,["modelValue"])])]),_:1})]),_:1})]),_:1})):$("",!0)],64))}});export{qo as default};