import{_ as e,a as t}from"./public.js?v=1764233927359";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764233927359";import{bU as r,o as l}from"./page_layout.js?v=1764233927359";import{s,d as i}from"./index38.js?v=1764233927359";import{k as n,P as o,r as u,R as c,V as p,W as d,a3 as m,S as _,U as f,ak as v,a4 as x,F as j,u as g}from"./vue.js?v=1764233927359";import{dR as b,dV as k}from"./naive.js?v=1764233927359";import"./common.js?v=1764233927359";import"./__commonjsHelpers__.js?v=1764233927359";import"./index.js?v=1764233927359";import"./index132.js?v=1764233927359";import"./index99.js?v=1764233927359";import"./index104.js?v=1764233927359";const S={class:"p-20px"},h={class:"w-460px"};const y=n({__name:"index",props:{url:{default:""},mirrors:{default:()=>({})}},emits:["refresh"],setup(n,{expose:y,emit:w}){const D=n,$=w,{t:C}=o(),O=r(),P=u(null),U=u([]),R=({option:e})=>d(j,null,[e.title?"".concat(e.value,"(").concat(e.title,")"):e.label]),V=e=>{P.value=e},B=async()=>{await $("refresh",e=>{F(e)})},F=e=>{U.value=Object.entries(e).map(([e,t])=>({label:()=>{let a;return d("div",{class:"flex items-center justify-between w-full"},[d("span",{class:"mr-16px"},["".concat(e,"(").concat(t,")")]),d(l,{type:"error",onClick:t=>{t.stopPropagation(),(async e=>{await i({registry_mirrors_address:e}),await B()})(e)}},(r=a=C("Public.Btn.Del"),"function"==typeof r||"[object Object]"===Object.prototype.toString.call(r)&&!g(r)?a:{default:()=>[a]}))]);var r},title:t,value:e})),U.value.push({label:C("Docker.Setting.url.index_5"),value:""})};(()=>{const{url:e,mirrors:t}=D;e&&(P.value=e),F(t)})();return y({onConfirm:({hide:e})=>(t({title:C("Docker.Setting.url.confirmTitle"),content:C("Docker.Setting.url.confirmContent"),onConfirm:async({hide:t})=>{await s({registry_mirrors_address:P.value?P.value:""}),O.getSetting(),$("refresh"),t(),e()}}),!1)}),(t,r)=>{const l=k,s=b,i=a,n=e;return p(),c("div",S,[d(i,null,{default:m(()=>[d(s,{label:t.$t("Docker.Setting.index_7"),"show-feedback":!1},{default:m(()=>[_("div",h,[d(l,{value:f(P),"onUpdate:value":r[0]||(r[0]=e=>v(P)?P.value=e:null),filterable:!0,options:f(U),"consistent-menu-width":!1,"render-tag":R,placeholder:t.$t("Docker.Setting.url.index_1"),onSearch:V},null,8,["value","options","placeholder"])])]),_:1},8,["label"])]),_:1}),d(n,{class:"mt-24px"},{default:m(()=>[_("li",null,x(t.$t("Docker.Setting.url.index_2")),1),_("li",null,x(t.$t("Docker.Setting.url.index_3")),1),_("li",null,x(t.$t("Docker.Setting.url.index_4")),1)]),_:1})])}}});export{y as default};
