import{d as O,a0 as A,X as w,j as k,l as r,o as g,a as E,J as u,w as i,b as n,N as C,u as d,a9 as I,m as M,c as U,M as B,v,B as s,Z as V,$ as G,_ as R}from"./__uno-CXIo0o6Y.js";import{d as z,s as h}from"./popup-B_kmDADr.js";import"./modulepreload-polyfill-B5Qt9EMX.js";const f=(a,c)=>{for(let l=0;l<c.length;l++){const e=c[l];if(e.value===a)return e.label;if(e.children&&e.children.length>0){const t=f(a,e.children);if(t)return e.label+" / "+t}}},b=Object.freeze([{value:"NA",label:"北美地区",children:[{label:"美国",value:"US"},{label:"加拿大",value:"CA"},{label:"墨西哥",value:"MX"},{label:"巴西",value:"BR"}]},{value:"EU",label:"欧洲地区",children:[{label:"西班牙",value:"ES"},{label:"英国",value:"UK"},{label:"法国",value:"FR"},{label:"德国",value:"DE"},{label:"意大利",value:"IT"},{label:"土耳其",value:"TR"},{label:"荷兰",value:"NL"},{label:"瑞典",value:"SE"},{label:"波兰",value:"PL"},{label:"比利时",value:"BE"},{label:"爱尔兰",value:"IE"}]},{label:"日本",value:"JP"},{label:"澳大利亚",value:"AU"},{label:"印度",value:"IN"},{label:"新加坡",value:"SG"},{label:"阿联酋",value:"AE"},{label:"沙特阿拉伯",value:"SA"}]),p=a=>(V("data-v-fd281f88"),a=a(),G(),a),T=p(()=>n("div",null,"适用：单站点锁定，只运行该站点执行记录",-1)),$=p(()=>n("div",{class:"u-color-#ff5c5c"},"注意事项：",-1)),P=p(()=>n("div",null,"请将当前亚马逊后台页面登录到目标锁定站点，否则任务不执行",-1)),j="lk-amz-country",J=O({__name:"index",setup(a){const c=A().platform(w.Amazon),l=k("");let e=k("");const t=z();(async()=>{const{lockMarket:o=""}=await v.storage.local.get("lockMarket");l.value=o,e.value=o})();const x=()=>{if(!l.value){s.GjMessage.error("请选择需要锁定的站点");return}if(e.value===l.value){s.GjMessage.error("选择锁定的站点与当前锁定站点一致，无需重复设置");return}const o=f(l.value,b);s.GjModal.info({hideCancel:!1,title:"锁定站点",content:`确定锁定执行站点为：${o}`,onOk:async()=>{await v.storage.local.set({lockMarket:l.value}),h({fn:"Users.lockOnLineSite",type:"one",lockMarket:l.value,beforeLockMarket:e.value}),t.replace("/detection")}})},y=()=>{if(!e.value){s.GjMessage.error("当前未锁定站点，无需解除锁定");return}const o=f(e.value,b);s.GjModal.info({hideCancel:!1,title:"解除锁定",content:`确定解除现锁定站点：${o}`,onOk:async()=>{await v.storage.local.remove("lockMarket"),c.info(`解除锁定站点：${e.value}`),h({fn:"Users.lockOnLineSite",type:"all",lockMarket:e.value,beforeLockMarket:e.value}),t.replace("/detection")}})};return(o,_)=>{const S=r("gj-alert"),N=r("gj-cascader"),m=r("gj-button");return g(),E("div",{class:C(j)},[u(S,{class:"u-mb-20px"},{default:i(()=>[T,$,P]),_:1}),n("div",{class:C(`${j}-text0`)},"设置执行的站点",2),u(N,{modelValue:d(l),"onUpdate:modelValue":_[0]||(_[0]=L=>I(l)?l.value=L:null),options:d(b),placeholder:"请选择","allow-clear":"",class:"u-mb-32px"},null,8,["modelValue","options"]),n("div",null,[u(m,{type:"primary",long:"",class:"u-mb-16px",onClick:x},{default:i(()=>[M("保存")]),_:1}),d(e)?(g(),U(m,{key:0,type:"plain",long:"",onClick:y},{default:i(()=>[M("解除锁定")]),_:1})):B("",!0)])])}}}),F=R(J,[["__scopeId","data-v-fd281f88"]]);export{F as default};
