import{k as B,j as c,t as D,m as g,n as p,p as e,q as w,i as H,v as R,A as x,x as T,s as F}from"./web.Os7kOAdY.js";import{g as C,t as G}from"./i18n-runtime._BAkvU05.js";var J=x('<div class=panel style=display:flex;flex-direction:column;gap:14px><div class=tool-actions><button class="tool-btn is-primary"></button></div><!$><!/><!$><!/><p class=tool-hint>'),K=x("<span class=tool-error>× <!$><!/>"),O=x("<dl class=tool-kv><dt>IP</dt><dd style=font-family:ui-monospace,monospace></dd><dt></dt><dd></dd><dt>ISP</dt><dd></dd><dt></dt><dd>");function V(){const[j,f]=c(C(),{equals:!1}),d=t=>G(t,j());D(()=>{const t=l=>{const a=l.detail?.locale;a&&f(a)};window.addEventListener("taitan:locale-change",t),f(C()),F(()=>window.removeEventListener("taitan:locale-change",t))});const[n,k]=c(null),[u,m]=c(!1),[b,v]=c(""),L=async()=>{m(!0),v("");try{const l=await(await fetch("https://ipapi.co/json/")).json();k(l)}catch{v("查询失败，可能是网络受限或被广告屏蔽拦截")}finally{m(!1)}};return(()=>{var t=g(J),l=t.firstChild,a=l.firstChild,I=l.nextSibling,[S,P]=p(I.nextSibling),q=S.nextSibling,[y,M]=p(q.nextSibling),N=y.nextSibling;return a.$$click=L,e(a,()=>u()?"查询中...":"查询我的 IP"),e(t,(()=>{var $=w(()=>!!b());return()=>$()&&(()=>{var i=g(K),_=i.firstChild,s=_.nextSibling,[o,r]=p(s.nextSibling);return e(i,b,o,r),i})()})(),S,P),e(t,(()=>{var $=w(()=>!!n());return()=>$()&&(()=>{var i=g(O),_=i.firstChild,s=_.nextSibling,o=s.nextSibling,r=o.nextSibling,z=r.nextSibling,h=z.nextSibling,E=h.nextSibling,A=E.nextSibling;return e(s,()=>n().ip||"--"),e(o,()=>d("位置")),e(r,()=>[n().city,n().region,n().country_name].filter(Boolean).join(" · ")||"--"),e(h,()=>n().org||"--"),e(E,()=>d("时区")),e(A,()=>n().timezone||"--"),i})()})(),y,M),e(N,()=>d("数据来自 ipapi.co；本工具不在服务端记录任何信息。")),H(()=>T(a,"disabled",u())),R(),t})()}B(["click"]);export{V as default};
