dns-worker 1.0.2-3.3 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/static/assets/{AccountView-BvRvODjN.js → AccountView-yBM8r7xk.js} +3 -3
- package/static/assets/{AnalyticsView-DQ7hDChh.js → AnalyticsView-CW9l8krm.js} +2 -2
- package/static/assets/{AuthView-Bwv6hbdi.js → AuthView-BpLHhuif.js} +1 -1
- package/static/assets/{DestinationMap-BEQNbcb-.js → DestinationMap-DUZnyLyb.js} +1 -1
- package/static/assets/{FilteringView-BWD3e-DS.js → FilteringView-BvOw_liH.js} +1 -1
- package/static/assets/{LogsView-kQy7qTGd.js → LogsView-CYxZaJPW.js} +3 -3
- package/static/assets/{QRCodeCanvas-X07w5x_G.js → QRCodeCanvas-vzXe_hzQ.js} +2 -2
- package/static/assets/{RulesView-3d5hga0L.js → RulesView-CbToiqT1.js} +1 -1
- package/static/assets/{SettingsView-B9D0kPUF.js → SettingsView-mSkxdlrh.js} +1 -1
- package/static/assets/{SetupView-D7d-Gsdr.js → SetupView-Dzbc8NmG.js} +1 -1
- package/static/assets/{SwipeableDrawer-B-MfxTWM.js → SwipeableDrawer-CzMJdF3W.js} +1 -1
- package/static/assets/{TrendChart-B20w7SzD.js → TrendChart-Dl9UU7gA.js} +1 -1
- package/static/assets/browser-BskSZoIg.js +1 -0
- package/static/assets/date-WF-_cJDs.js +1 -0
- package/static/assets/{index-7FKlsF79.js → index-DLmOvLdX.js} +5 -5
- package/static/assets/{services-fIMx5oSx.js → services-C-uSOjyn.js} +1 -1
- package/static/assets/{vendor-react-Kt98jRfM.js → vendor-react-DifRgRH3.js} +1 -1
- package/static/assets/{vendor-ui-core-BpucEp_q.js → vendor-ui-core-CCxBtqRD.js} +1 -1
- package/static/assets/{vendor-utils-CfYGGC23.js → vendor-utils-D17P9mkD.js} +1 -1
- package/static/index.html +4 -4
- package/static/sw.js +1 -1
- package/static/assets/browser-icErLjuM.js +0 -1
- package/static/assets/date-C4b8kvr-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-C4Xdq4VV.js";import{A as t,B as n,C as r,Ct as i,E as a,F as o,G as s,I as c,J as l,K as u,M as d,P as f,R as p,U as m,Xt as h,at as g,ct as _,it as v,rt as y,tt as b,w as x,wt as S,z as C}from"./vendor-react-Kt98jRfM.js";import{S as w,b as T}from"./vendor-icons-other-Bme3ywH9.js";import{A as E,B as D,C as O,F as k,L as A,M as j,N as M,O as N,P,R as F,S as I,T as L,V as R,a as z,d as B,f as V,i as H,n as U,o as W,r as G,v as K,z as q}from"./vendor-ui-core-BpucEp_q.js";import{_t as J,t as Y,vt as X}from"./vendor-utils-CfYGGC23.js";import{C as ee,I as te,L as ne,Q as re,R as ie,T as ae,V as oe,Xt as se,Y as ce,ct as le,et as ue,i as de,j as fe,st as pe,z as me}from"./index-7FKlsF79.js";import{t as he}from"./SwipeableDrawer-B-MfxTWM.js";var Z=e(w(),1);const ge=e=>{let t={},n={CN:{label:e(`common.mainlandChina`,`Mainland China`),countries:[`CN`]}},r=e=>{if(!e)return null;try{let t=e.trim();t=t.replace(/^"""|"""$/g,``).replace(/^"|"$/g,``).replace(/^'|'$/g,``).trim();let n=JSON.parse(t);return Array.isArray(n)?n:null}catch(t){return console.warn(`Failed to parse region env value:`,e,t),null}},i={CN:void 0};Object.entries(i).forEach(([e,i])=>{let a=r(i);a&&(t[e]={label:n[e]?.label||e,countries:n[e]?.countries||[],ips:a})});try{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};Object.keys(e).forEach(a=>{if(a.startsWith(`IP_REGION_`)&&!i[a.replace(`IP_REGION_`,``)]){let i=a.replace(`IP_REGION_`,``),o=r(e[a]);o&&(t[i]={label:n[i]?.label||i,countries:n[i]?.countries||[],ips:o})}})}catch{}return t};var Q=e(T(),1);const _e=({isMobile:e,selectedRegion:t,setSelectedRegion:n,allRegions:r})=>{let{t:i}=h();return(0,Q.jsxs)(`div`,{className:`flex flex-col md:flex-row justify-between items-start gap-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(E,{className:`font-bold text-gray-900 dark:text-white`,children:i(`setup.title`)}),(0,Q.jsx)(`p`,{className:`bp6-text-muted`,children:i(`setup.subtitle`)})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col items-end gap-2 w-full md:w-auto`,children:[(0,Q.jsxs)(`span`,{className:`text-[10px] font-bold uppercase opacity-50 flex items-center gap-1`,children:[(0,Q.jsx)(m,{size:10}),` `,i(`setup.regionOptimization`)]}),(0,Q.jsx)(O,{minimal:!0,fill:e,children:Object.keys(r).map(r=>(0,Q.jsx)(M,{active:t===r,onClick:()=>n(r),text:e?r.split(`_`)[0]:r.replace(`_`,` `),small:!0},r))})]})]})},ve=({isVerifying:e,verifyResult:n,handleVerify:r,isMobile:i,clientInfo:a,showIp:o,setShowIp:s,showLocation:c,setShowLocation:u,traceInfo:d})=>{let{t:p}=h(),[m,g]=(0,Z.useState)(!1);return(0,Q.jsx)(W,{title:p(`setup.verifyConnection`),icon:(0,Q.jsx)(S,{size:16}),children:(0,Q.jsx)(z,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col space-y-6`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col md:flex-row items-center justify-between bg-gray-50 dark:bg-gray-800/50 p-6 rounded-xl border border-gray-100 dark:border-gray-800 gap-6`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col md:flex-row items-center gap-4 text-center md:text-left`,children:[(0,Q.jsx)(`div`,{className:`p-3 rounded-full ${n?.success?`bg-green-100 text-green-600`:n?`bg-red-100 text-red-600`:`bg-blue-100 text-blue-600`}`,children:e?(0,Q.jsx)(P,{size:24}):n?.success?(0,Q.jsx)(t,{size:24}):(0,Q.jsx)(f,{size:24})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`font-bold text-lg`,children:e?p(`setup.verifying`):n?.success?p(`setup.connected`):p(`setup.notConnected`)}),(0,Q.jsx)(`div`,{className:`text-sm opacity-60`,children:n?.success?n.profileMatch?p(`setup.profileMatch`):p(`setup.profileMismatch`):p(`setup.verifyHint`)})]})]}),(0,Q.jsx)(M,{size:`large`,intent:n?.success?R.SUCCESS:R.PRIMARY,icon:`refresh`,text:p(`setup.refreshStatus`),onClick:r,loading:e,fill:i})]}),a&&(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 ${d?`sm:grid-cols-2 md:grid-cols-3`:`md:grid-cols-2`}`,children:[(0,Q.jsxs)(`div`,{className:`bg-white dark:bg-gray-900 p-4 rounded-lg border border-gray-100 dark:border-gray-800 shadow-sm flex items-start gap-3`,children:[(0,Q.jsx)(b,{size:18,className:`text-blue-500 mt-1`}),(0,Q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase font-bold opacity-40`,children:p(`setup.egressIp`)}),(0,Q.jsx)(`button`,{onClick:()=>s(!o),className:`text-gray-400 hover:text-blue-500 transition-colors`,children:o?(0,Q.jsx)(y,{size:16}):(0,Q.jsx)(v,{size:16})})]}),(0,Q.jsx)(`div`,{className:`font-mono font-bold text-blue-600 dark:text-blue-400 truncate`,children:(0,Q.jsx)(`span`,{className:X(`transition-[filter] duration-200 inline-block`,!o&&`filter blur-[6px] select-none`),children:a.ip})})]})]}),(0,Q.jsxs)(`div`,{className:`bg-white dark:bg-gray-900 p-4 rounded-lg border border-gray-100 dark:border-gray-800 shadow-sm flex items-start gap-3`,children:[(0,Q.jsx)(l,{size:18,className:`text-red-500 mt-1`}),(0,Q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase font-bold opacity-40`,children:p(`setup.currentLocation`)}),(0,Q.jsx)(`button`,{onClick:()=>u(!c),className:`text-gray-400 hover:text-red-500 transition-colors`,children:c?(0,Q.jsx)(y,{size:16}):(0,Q.jsx)(v,{size:16})})]}),(0,Q.jsx)(`div`,{className:`font-bold truncate`,children:(0,Q.jsxs)(`span`,{className:X(`transition-[filter] duration-200 inline-block`,!c&&`filter blur-[6px] select-none`),children:[a.city,`, `,a.region?`${a.region}, `:``,a.country]})})]})]}),d&&(0,Q.jsx)(L,{isOpen:m,onInteraction:e=>g(e),placement:`bottom`,content:(0,Q.jsxs)(`div`,{className:`p-4 max-w-sm max-h-60 overflow-auto font-mono text-xs bg-white dark:bg-gray-900 border border-gray-100 dark:border-gray-800 shadow-lg rounded-lg`,children:[(0,Q.jsx)(`div`,{className:`font-bold border-b border-gray-100 dark:border-gray-800 pb-2 mb-2`,children:`/cdn-cgi/trace`}),(0,Q.jsx)(`pre`,{className:`whitespace-pre-wrap`,children:d.raw})]}),children:(0,Q.jsxs)(`div`,{className:`bg-white dark:bg-gray-900 p-4 rounded-lg border border-gray-100 dark:border-gray-800 shadow-sm flex items-start gap-3 cursor-pointer select-none`,onDoubleClick:()=>g(!0),children:[(0,Q.jsx)(f,{size:18,className:`text-purple-500 mt-1`}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase font-bold opacity-40`,children:p(`setup.edgeServer`)}),(0,Q.jsx)(`div`,{className:`font-bold truncate`,children:d.colo})]})]})})]})]})})})},$=({step:e,className:t,size:n=144})=>{let r=e===1?47:50,i=e===1?45.5:45;return(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:J(`absolute -top-7 -left-7 pointer-events-none select-none z-0`,`text-blue-600/[0.08] dark:text-blue-400/[0.12]`,`transition-all duration-500 ease-out`,`blur-none group-hover:blur-md group-hover:opacity-0`,t),style:{width:n,height:n},children:(0,Q.jsxs)(`svg`,{viewBox:`0 0 100 100`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`w-full h-full`,children:[(0,Q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`46`,stroke:`currentColor`,strokeWidth:`4`}),(0,Q.jsx)(`text`,{x:r,y:i,textAnchor:`middle`,dominantBaseline:`central`,fill:`currentColor`,fontSize:`80`,fontWeight:`900`,fontFamily:`'Helvetica Neue', Helvetica, Arial, sans-serif`,children:e})]})})},ye=({accessPoints:e,selectedApId:t,onSelectAp:n,accessPointName:r,onManageAccessPoints:i,isMobile:a})=>{let{t:o}=h();return(0,Q.jsxs)(W,{title:o(`setup.accessPointsCardTitle`,`接入点`),icon:(0,Q.jsx)(u,{size:16}),className:`group relative overflow-hidden [&_.bp6-section-header]:relative [&_.bp6-section-header]:z-10 [&_.bp6-section-card]:relative [&_.bp6-section-card]:z-10`,children:[(0,Q.jsx)($,{step:1}),(0,Q.jsx)(z,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 w-full sm:w-auto`,children:[(0,Q.jsx)(`span`,{className:`text-xs opacity-50 font-medium`,children:o(`setup.selectAccessPointToConfigure`)}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.length>0?(0,Q.jsx)(B,{value:t||``,onChange:e=>n(e.target.value),options:e.map(e=>({label:e.name,value:e.id})),className:`font-semibold text-gray-900 dark:text-gray-100`}):(0,Q.jsx)(`div`,{className:`font-semibold text-gray-900 dark:text-gray-100 flex items-center gap-2`,children:r||o(`setup.defaultAccessPointName`,`设备-1`)}),e.length>0&&(0,Q.jsx)(G,{minimal:!0,round:!0,intent:R.PRIMARY,className:`text-xs`,children:e.length})]})]}),(0,Q.jsx)(M,{variant:`outlined`,intent:R.NONE,icon:(0,Q.jsx)(d,{size:14}),text:o(`setup.manageAccessPoints`,`管理接入点`),onClick:i,fill:a,className:`shrink-0`})]})})]})},be=({dohUrl:e,copyToClipboard:t,isMobile:n})=>{let{t:r}=h();return(0,Q.jsxs)(W,{title:r(`setup.accessPointTitle`,`Access DoH URL`),icon:`globe`,className:`group relative overflow-hidden [&_.bp6-section-header]:relative [&_.bp6-section-header]:z-10 [&_.bp6-section-card]:relative [&_.bp6-section-card]:z-10`,rightElement:(0,Q.jsx)(L,{placement:`bottom-end`,usePortal:!0,content:(0,Q.jsxs)(`div`,{className:`p-4 max-w-sm`,children:[(0,Q.jsx)(j,{children:r(`setup.whatIsDoh`)}),(0,Q.jsx)(`p`,{className:`text-sm mb-2`,children:r(`setup.dohDesc`)}),(0,Q.jsxs)(`ul`,{className:`list-disc list-inside text-sm opacity-80 mb-3 space-y-1`,children:[(0,Q.jsx)(`li`,{children:r(`setup.dohBenefit1`)}),(0,Q.jsx)(`li`,{children:r(`setup.dohBenefit2`)})]}),(0,Q.jsx)(`div`,{className:`text-xs border-t border-gray-100 dark:border-gray-700 pt-2`,children:(0,Q.jsxs)(`a`,{href:`https://en.wikipedia.org/wiki/DNS_over_HTTPS`,target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-1 text-blue-500 hover:underline`,children:[(0,Q.jsx)(g,{size:10}),` `,r(`setup.learnMore`)]})})]}),children:(0,Q.jsx)(M,{icon:`help`,variant:`minimal`,intent:R.NONE})}),children:[(0,Q.jsx)($,{step:2}),(0,Q.jsx)(z,{children:(0,Q.jsxs)(`div`,{className:`w-full bg-gray-100 dark:bg-gray-800 p-3 rounded-lg border border-gray-200 dark:border-gray-700 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-blue-600 dark:text-blue-400 break-all text-xs sm:text-sm`,children:e}),(0,Q.jsx)(M,{intent:R.PRIMARY,icon:`duplicate`,text:r(`setup.copyUrl`),fill:n,onClick:()=>t(e),className:`shrink-0`})]})})]})};function xe(e){let t=e.trim();try{return new URL(t.startsWith(`http://`)||t.startsWith(`https://`)?t:`https://${t}`).hostname||t}catch{return t.replace(/^https?:\/\//,``).split(`/`)[0].split(`:`)[0]||t}}function Se(e,t){let n=(e||``).trim(),r=(t||``).trim();if(!r&&n.includes(`(`)&&n.endsWith(`)`)){let e=n.match(/^(.+?)\s*\((.+?)\)$/);e&&(n=e[1].trim(),r=e[2].trim())}let i=n&&n!==`DNS Worker`?n:``,a=r&&r!==`DNS Worker`?r:``;return i&&a?i.toLowerCase()===a.toLowerCase()?i:`${i} - ${a}`:i||a||``}function Ce(e,t,n,r){let i,a,o,s;typeof e==`object`?(i=e.profileKey,a=e.profileName,o=e.accessPointName,s=e.origin):(i=e,a=t,s=n||``,o=r);let c=s.trim(),l=xe(c),u=`${c}/${i}`,d=Se(a,o),f=crypto.randomUUID(),p=crypto.randomUUID(),m=d?`DNS Worker - ${l} (${d})`:`DNS Worker (${l})`,h=d?`DNS Worker DoH - ${l} (${d})`:`DNS Worker DoH - ${l}`,g=d?`DNS Worker DoH configuration profile for ${d} via ${l}`:`DNS Worker DoH configuration profile via ${l}`,_=d?`Configures encrypted DNS over HTTPS (DoH) for ${d} via ${l}`:`Configures encrypted DNS over HTTPS (DoH) via ${l}`;return Y({PayloadContent:[{DNSSettings:{DNSProtocol:`HTTPS`,ServerHTTPVersion:3,ServerURL:u},OnDemandRules:[{Action:`Connect`,InterfaceTypeMatch:`WiFi`},{Action:`Connect`,InterfaceTypeMatch:`Cellular`},{Action:`Disconnect`}],PayloadDescription:_,PayloadDisplayName:h,PayloadIdentifier:`com.apple.dnsSettings.managed.${f}`,PayloadName:h,PayloadType:`com.apple.dnsSettings.managed`,PayloadUUID:f,PayloadVersion:1}],PayloadDescription:g,PayloadDisplayName:m,PayloadIdentifier:`com.dnsworker.profile.${i}`,PayloadName:m,PayloadRemovalDisallowed:!1,PayloadType:`Configuration`,PayloadUUID:p,PayloadVersion:1},{indent:` `})}const we=({isMobile:e,copyToClipboard:t,profileKey:n,profileName:r,accessPointName:o,allRegions:l,selectedRegion:u,currentIps:d})=>{let{t:f}=h();return(0,Q.jsxs)(`div`,{className:`group relative overflow-hidden rounded-xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm`,children:[(0,Q.jsx)($,{step:3}),(0,Q.jsxs)(U,{id:`setup-tabs`,renderActiveTabPanelOnly:!0,vertical:!e,size:`large`,className:J(`p-4 md:p-6 setup-tabs-container relative z-10 bg-transparent`,e&&[`[&_.bp6-tab-list]:overflow-x-auto!`,`[&_.bp6-tab-list]:flex-nowrap!`,`[&_.bp6-tab-list]:pb-1`,`[&_.bp6-tab-list]:scrollbar-none`,`[&_.bp6-tab-list]:[-ms-overflow-style:none]`,`[&_.bp6-tab-list::-webkit-scrollbar]:hidden`,`[&_.bp6-tab]:shrink-0`]),children:[(0,Q.jsx)(H,{id:`browsers`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(b,{size:16,className:`inline mr-2`}),f(`setup.browsers`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.browserTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.browserSteps`)}),(0,Q.jsx)(`p`,{className:`text-[10px] opacity-50 cursor-pointer`,onClick:()=>t(`chrome://settings/security`),children:f(`setup.browserTips`,`or copy this URL to the address bar: `)+`chrome://settings/security`})]})}),(0,Q.jsx)(H,{id:`apple`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(i,{size:16,className:`inline mr-2`}),f(`setup.apple`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.appleTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.appleDesc`)}),(0,Q.jsx)(`p`,{className:`text-[10px] opacity-50 text-center`,children:f(`setup.appleWarning`)}),(0,Q.jsxs)(`div`,{className:`p-6 bg-gray-50 dark:bg-gray-800 rounded-xl border border-dashed border-gray-300 dark:border-gray-700 flex flex-col items-center justify-center`,children:[(0,Q.jsx)(k,{icon:`document`,size:40,className:`opacity-20 mb-4`}),(0,Q.jsx)(M,{intent:R.PRIMARY,text:f(`setup.downloadConfig`),icon:`download`,onClick:()=>{let e=Ce({profileKey:n,profileName:r,accessPointName:o,origin:window.location.origin}),t=new Blob([e],{type:`application/x-apple-aspen-config`}),i=URL.createObjectURL(t),a=document.createElement(`a`);a.href=i;let s=Se(r,o),c=xe(window.location.origin);a.download=`dns_worker-${(s||c).replace(/[^a-zA-Z0-9_\-\u4e00-\u9fa5]/g,`_`).replace(/_+/g,`_`).replace(/^_|_$/g,``)}-${n}.mobileconfig`,a.click(),URL.revokeObjectURL(i)}})]}),(0,Q.jsx)(`p`,{className:`text-[10px] opacity-50 mt-4! text-center`,children:f(`setup.appleInstallHint`)})]})}),(0,Q.jsx)(H,{id:`windows`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(s,{size:16,className:`inline mr-2`}),f(`setup.windows`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.windowsTitle`,{region:l[u]?.label||f(`setup.otherRegion`)})}),(0,Q.jsxs)(`ol`,{className:`list-decimal list-inside space-y-4 text-sm leading-relaxed`,children:[(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`a`,{href:`ms-settings:network-status`,children:f(`setup.windowsStep0`)})}),(0,Q.jsx)(`li`,{children:f(`setup.windowsStep1`)}),(0,Q.jsxs)(`li`,{children:[f(`setup.windowsStep2`),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:d.map(n=>(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(G,{minimal:!0,interactive:!0,onClick:()=>t(n.ip),icon:`duplicate`,className:`font-mono`,children:n.ip}),!e&&(0,Q.jsx)(`span`,{className:`text-[9px] opacity-40 ml-1`,children:n.area})]},n.ip))})]}),(0,Q.jsx)(`li`,{children:f(`setup.windowsStep3`)}),(0,Q.jsx)(`li`,{children:f(`setup.windowsStep4`)})]})]})}),(0,Q.jsx)(H,{id:`linux`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(x,{size:16,className:`inline mr-2`}),f(`setup.linux`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.linuxTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.linuxDesc`)}),(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-bold mb-2`,children:f(`setup.linuxStep1`)}),(0,Q.jsxs)(`div`,{className:`relative group`,children:[(0,Q.jsx)(`pre`,{className:`bg-gray-100 dark:bg-gray-800 p-4 rounded-lg overflow-x-auto text-xs font-mono border border-gray-200 dark:border-gray-700`,children:(0,Q.jsx)(`code`,{children:`curl -sL "${window.location.origin}/setup.sh?key=${n}&origin=${window.location.origin}" | sudo bash`})}),(0,Q.jsx)(M,{className:`absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity`,icon:`duplicate`,minimal:!0,small:!0,onClick:()=>{t(`curl -sL "${window.location.origin}/setup.sh?key=${n}&origin=${window.location.origin}" | sudo bash`)}})]})]}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(`p`,{className:`text-sm font-bold`,children:f(`setup.linuxStep2`)})})]})}),(0,Q.jsx)(H,{id:`routeros`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(c,{size:16,className:`inline mr-2`}),f(`setup.routeros`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.routerosTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.routerosDesc`)}),(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-bold mb-2`,children:f(`setup.routerosStep1`)}),(0,Q.jsxs)(`div`,{className:`relative group`,children:[(0,Q.jsx)(`pre`,{className:`bg-gray-100 dark:bg-gray-800 p-4 rounded-lg overflow-x-auto text-xs font-mono border border-gray-200 dark:border-gray-700`,children:(0,Q.jsx)(`code`,{children:`/ip dns set use-doh-server="${window.location.origin}/${n}" verify-doh-cert=yes`})}),(0,Q.jsx)(M,{className:`absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity`,icon:`duplicate`,minimal:!0,small:!0,onClick:()=>{t(`/ip dns set use-doh-server="${window.location.origin}/${n}" verify-doh-cert=yes`)}})]})]}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.routerosNote`)}),(0,Q.jsxs)(`a`,{href:`https://help.mikrotik.com/docs/spaces/ROS/pages/37748767/DNS`,target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-1 text-xs text-blue-500 hover:underline`,children:[(0,Q.jsx)(g,{size:10}),` `,f(`setup.routerosDocs`)]})]})}),(0,Q.jsx)(H,{id:`android`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(a,{size:16,className:`inline mr-2`}),f(`setup.android`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.androidTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.androidDesc`)}),(0,Q.jsxs)(`div`,{className:`p-4 bg-gray-50 dark:bg-gray-800/60 rounded-xl border border-gray-200 dark:border-gray-700 space-y-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-semibold text-gray-700 dark:text-gray-300`,children:f(`setup.androidDotTitle`,`私有 DNS (DoT - Serverfull 模式)`)}),(0,Q.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:f(`setup.androidDotDesc`,`设置 > 网络和互联网 > 私有 DNS > 提供商主机名:`)}),(0,Q.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Q.jsx)(G,{minimal:!0,interactive:!0,onClick:()=>t(`${n}.${window.location.hostname}`),icon:`duplicate`,className:`font-mono text-sm py-1 px-3`,intent:R.PRIMARY,children:`${n}.${window.location.hostname}`})})]}),(0,Q.jsx)(I,{intent:R.PRIMARY,icon:`info-sign`,className:`text-xs`,children:f(`setup.androidWarning`)})]})})]})]})};function Te({profileId:e,accessPoints:t,onRefresh:n,toasterRef:r}){let{t:i}=h(),[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(null),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(null),[O,k]=(0,Z.useState)(!1),[A,j]=(0,Z.useState)(``);return{isAddDialogOpen:a,setIsAddDialogOpen:o,newApName:s,setNewApName:c,isAdding:l,renameApId:d,setRenameApId:f,renameApName:p,setRenameApName:m,isRenaming:g,rotatingApId:v,deletingApId:b,newApNameFocused:S,setNewApNameFocused:C,renameApNameFocused:w,setRenameApNameFocused:T,rotateConfirmApId:E,setRotateConfirmApId:D,isSearchOpen:O,setIsSearchOpen:k,searchQuery:A,setSearchQuery:j,filteredAccessPoints:t.filter(e=>e.name.toLowerCase().includes(A.toLowerCase())||e.token.toLowerCase().includes(A.toLowerCase())),isValidApName:e=>de.test(e),handleAdd:async()=>{let a=s.trim();if(a){if(t.some(e=>e.name.toLowerCase()===a.toLowerCase())){r.current?.show({message:i(`setup.accessPointNameExists`,`Access Point name already exists`),intent:R.DANGER});return}u(!0);try{await oe(e,a),r.current?.show({message:i(`setup.accessPointCreated`),intent:R.SUCCESS}),o(!1),c(``),n()}catch(e){let t=e.message||`Failed to create access point`,n=t;if(t.startsWith(`Access point limit exceeded`)){let e=t.match(/\(max (\d+)\)/),r=e?e[1]:`100`;n=i(`setup.accessPointLimitExceeded`,{max:r,defaultValue:`Access Point limit exceeded (max ${r})`})}r.current?.show({message:n,intent:R.DANGER})}finally{u(!1)}}},handleRename:async()=>{let a=p.trim();if(!(!a||!d)){if(t.some(e=>e.id!==d&&e.name.toLowerCase()===a.toLowerCase())){r.current?.show({message:i(`setup.accessPointNameExists`,`Access Point name already exists`),intent:R.DANGER});return}_(!0);try{await pe(e,d,a),r.current?.show({message:i(`setup.accessPointRenamed`),intent:R.SUCCESS}),f(null),n()}catch(e){r.current?.show({message:e.message||`Failed to rename access point`,intent:R.DANGER})}finally{_(!1)}}},handleRotate:async t=>{y(t);try{await le(e,t),r.current?.show({message:i(`setup.tokenRotated`),intent:R.SUCCESS}),n()}catch(e){console.error(e)}finally{y(null)}},handleDelete:async t=>{if(confirm(i(`setup.deleteAccessPointConfirm`))){x(t);try{await ce(e,t),r.current?.show({message:i(`setup.accessPointDeleted`),intent:R.SUCCESS}),n()}catch(e){console.error(e)}finally{x(null)}}}}}const Ee=({isOpen:e,onClose:t,newApName:n,setNewApName:r,newApNameFocused:i,setNewApNameFocused:a,handleAdd:o,isAdding:s,isValidApName:c})=>{let{t:l}=h();return(0,Q.jsxs)(N,{isOpen:e,onClose:t,title:l(`setup.addAccessPoint`),children:[(0,Q.jsx)(`div`,{className:A,children:(0,Q.jsx)(K,{content:l(`setup.accessPointNameFormatTip`,`1-30 characters, letters, numbers, hyphens and underscores allowed`),isOpen:i,position:D.TOP,intent:R.PRIMARY,className:`w-full`,children:(0,Q.jsx)(`div`,{className:`w-full block`,children:(0,Q.jsx)(V,{autoFocus:!0,large:!0,placeholder:l(`setup.accessPointName`),value:n,onChange:e=>r(e.target.value),onFocus:()=>a(!0),onBlur:()=>a(!1)})})})}),(0,Q.jsx)(`div`,{className:F,children:(0,Q.jsxs)(`div`,{className:q,children:[(0,Q.jsx)(M,{onClick:t,children:l(`common.cancel`,`Cancel`)}),(0,Q.jsx)(M,{intent:R.PRIMARY,onClick:o,loading:s,disabled:!c(n),children:l(`common.create`)})]})})]})},De=({isOpen:e,onClose:t,renameApName:n,setRenameApName:r,renameApNameFocused:i,setRenameApNameFocused:a,handleRename:o,isRenaming:s,isValidApName:c})=>{let{t:l}=h();return(0,Q.jsxs)(N,{isOpen:e,onClose:t,title:l(`setup.renameAccessPoint`),children:[(0,Q.jsx)(`div`,{className:A,children:(0,Q.jsx)(K,{content:l(`setup.accessPointNameFormatTip`,`1-30 characters, letters, numbers, hyphens and underscores allowed`),isOpen:i,position:D.TOP,intent:R.PRIMARY,className:`w-full`,children:(0,Q.jsx)(`div`,{className:`w-full block`,children:(0,Q.jsx)(V,{autoFocus:!0,large:!0,placeholder:l(`setup.accessPointName`),value:n,onChange:e=>r(e.target.value),onFocus:()=>a(!0),onBlur:()=>a(!1)})})})}),(0,Q.jsx)(`div`,{className:F,children:(0,Q.jsxs)(`div`,{className:q,children:[(0,Q.jsx)(M,{onClick:t,children:l(`common.cancel`,`Cancel`)}),(0,Q.jsx)(M,{intent:R.PRIMARY,onClick:o,loading:s,disabled:!c(n),children:l(`common.save`)})]})})]})},Oe=({ap:e,totalApCount:t,toasterRef:i,onRenameTrigger:a,rotateConfirmApId:o,setRotateConfirmApId:s,rotatingApId:c,handleRotate:l,deletingApId:d,handleDelete:f})=>{let{t:m}=h();return(0,Q.jsx)(W,{title:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(u,{size:16}),(0,Q.jsx)(`span`,{children:e.name})]}),className:`shadow-none! rounded-lg!`,children:(0,Q.jsxs)(z,{children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex justify-between items-start gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-xs opacity-50 mt-1`,children:`DoH URL`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-mono bg-blue-50 text-blue-600 dark:bg-blue-900/20 dark:text-blue-400 px-2 py-1 rounded cursor-pointer hover:bg-blue-100 dark:hover:bg-blue-900/40 transition-colors break-all`,onClick:()=>{navigator.clipboard.writeText(`${window.location.origin}/${e.token}`),i.current?.show({message:m(`setup.copied`),intent:R.SUCCESS})},title:m(`setup.copyUrl`),children:[(0,Q.jsx)(`span`,{className:`select-all`,children:`${window.location.origin}/${e.token}`}),(0,Q.jsx)(_,{size:14,className:`shrink-0`})]})]}),(0,Q.jsxs)(`div`,{className:`flex justify-between items-start gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-xs opacity-50 mt-1`,children:m(`setup.accessPointToken`)}),(0,Q.jsx)(`span`,{className:`text-sm font-mono bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded select-all break-all`,children:e.token})]}),(0,Q.jsxs)(`div`,{className:`flex justify-between items-start gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-xs opacity-50 mt-1`,children:`Created`}),(0,Q.jsx)(`span`,{className:`text-sm`,children:ee(new Date(e.created_at*1e3))})]})]}),(0,Q.jsxs)(`div`,{className:`mt-4 flex gap-2 flex-wrap`,children:[(0,Q.jsx)(M,{small:!0,icon:(0,Q.jsx)(n,{size:14}),text:m(`setup.renameAccessPoint`),onClick:()=>a(e.id,e.name)}),(0,Q.jsx)(L,{isOpen:o===e.id,onInteraction:e=>{e||s(null)},content:(0,Q.jsxs)(`div`,{className:`p-4 space-y-3 dark:bg-gray-800 dark:text-white max-w-xs`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-semibold leading-relaxed`,children:m(`setup.rotateTokenConfirmDesc`,`Rotating the key will immediately disconnect devices using the old key. Are you sure you want to continue?`)}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(M,{small:!0,minimal:!0,text:m(`common.cancel`,`Cancel`),onClick:()=>s(null)}),(0,Q.jsx)(M,{small:!0,intent:R.DANGER,text:m(`common.confirm`,`Confirm`),onClick:()=>{s(null),l(e.id)}})]})]}),placement:`top`,children:(0,Q.jsx)(M,{small:!0,icon:(0,Q.jsx)(p,{size:14}),text:m(`setup.rotateToken`),loading:c===e.id,onClick:()=>s(e.id)})}),(0,Q.jsx)(M,{small:!0,intent:R.DANGER,icon:(0,Q.jsx)(r,{size:14}),text:m(`setup.deleteAccessPoint`),loading:d===e.id,onClick:()=>f(e.id),disabled:t<=1,title:t<=1?`Cannot delete the only access point`:void 0})]})]})})},ke=({isOpen:e,onClose:t,profileId:n,isMobile:r,accessPoints:i,loading:a,onRefresh:s,toasterRef:c})=>{let{t:l}=h(),{isAddDialogOpen:u,setIsAddDialogOpen:d,newApName:f,setNewApName:p,isAdding:m,renameApId:g,setRenameApId:_,renameApName:v,setRenameApName:y,isRenaming:b,rotatingApId:x,deletingApId:S,newApNameFocused:w,setNewApNameFocused:T,renameApNameFocused:E,setRenameApNameFocused:D,rotateConfirmApId:O,setRotateConfirmApId:k,isSearchOpen:A,setIsSearchOpen:j,searchQuery:N,setSearchQuery:F,filteredAccessPoints:I,isValidApName:L,handleAdd:z,handleRename:B,handleRotate:H,handleDelete:U}=Te({profileId:n,accessPoints:i,onRefresh:s,toasterRef:c});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(he,{isOpen:e,onClose:t,title:A?(0,Q.jsx)(V,{leftIcon:`search`,placeholder:l(`setup.searchAccessPoints`,`Search...`),value:N,onChange:e=>F(e.target.value),rightElement:(0,Q.jsx)(M,{icon:`cross`,minimal:!0,onClick:()=>{j(!1),F(``)}}),autoFocus:!0}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:l(`setup.manageAccessPoints`)}),(0,Q.jsx)(M,{icon:(0,Q.jsx)(o,{size:14}),minimal:!0,onClick:()=>j(!0),className:`opacity-50 hover:opacity-100`})]}),icon:`diagram-tree`,size:r?`100%`:`450px`,children:[(0,Q.jsx)(M,{fill:!0,intent:R.PRIMARY,icon:(0,Q.jsx)(C,{size:16}),text:l(`setup.addAccessPoint`),onClick:()=>d(!0),large:!0}),a?(0,Q.jsx)(`div`,{className:`flex justify-center p-8`,children:(0,Q.jsx)(P,{})}):(0,Q.jsx)(`div`,{className:`space-y-4 mt-4`,children:I.map(e=>(0,Q.jsx)(Oe,{ap:e,totalApCount:i.length,toasterRef:c,onRenameTrigger:(e,t)=>{_(e),y(t)},rotateConfirmApId:O,setRotateConfirmApId:k,rotatingApId:x,handleRotate:H,deletingApId:S,handleDelete:U},e.id))})]}),(0,Q.jsx)(Ee,{isOpen:u,onClose:()=>{d(!1),p(``)},newApName:f,setNewApName:p,newApNameFocused:w,setNewApNameFocused:T,handleAdd:z,isAdding:m,isValidApName:L}),(0,Q.jsx)(De,{isOpen:!!g,onClose:()=>_(null),renameApName:v,setRenameApName:y,renameApNameFocused:E,setRenameApNameFocused:D,handleRename:B,isRenaming:b,isValidApName:L})]})},Ae=({profileId:e,profileKey:t,profileName:n,toasterRef:r})=>{let i=se(),{t:a,i18n:o}=h(),s=(0,Z.useMemo)(()=>ge(a),[o.language,a]),[c,l]=(0,Z.useState)([]),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),[m,g]=(0,Z.useState)(null),_=async()=>{d(!0);try{l(await re(e))}catch(e){console.error(e)}finally{d(!1)}};(0,Z.useEffect)(()=>{_()},[e]);let[v,y]=(0,Z.useState)(n||``);(0,Z.useEffect)(()=>{n?y(n):e&&ue(e).then(e=>{e?.name&&y(e.name)}).catch(()=>{})},[e,n]);let b=(0,Z.useMemo)(()=>c.length===0?null:c.find(e=>e.id===m)||c[0],[c,m]),x=b?b.token:t,S=b?b.name:void 0,C=`${window.location.origin}/${x}`,[w,T]=(0,Z.useState)(null),[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(null),[A,j]=(0,Z.useState)(null),[M,N]=(0,Z.useState)(`CN`),[P,F]=(0,Z.useState)(!1),[I,L]=(0,Z.useState)(!1),[z,B]=(0,Z.useState)(null),[V,H]=(0,Z.useState)({}),[U,W]=(0,Z.useState)(null),G={label:a(`setup.otherRegion`),ips:[],countries:[]},K=(0,Z.useMemo)(()=>({...s,...V,Other:G}),[s,V,G]),q=e=>{navigator.clipboard.writeText(e),r?.current?.show({message:a(`setup.copied`),intent:R.SUCCESS})},J=async e=>{let t=async(t,n,r)=>{try{let i=await me(t,e,n);if(i.Answer&&i.Answer.length>0){let e=i.Answer.find(e=>e.type===r);if(e?.data)return e.data}}catch(r){console.warn(`Client-side DNS query failed for ${e} (${n}) via ${t}:`,r)}return null},n=[`cloudflare-dns.com`,`1.1.1.1`],r=null;for(let e of n)if(r=await t(e,`A`,1),r)break;r&&k(r);let i=null;for(let e of n)if(i=await t(e,`AAAA`,28),i)break;i&&j(i)},Y=async()=>{D(!0),W(null);try{let[t,n,r]=await Promise.all([fe(),te(),ie()]);T(t),B(r),t.timezone&&t.timezone!==`UNKNOWN`&&ae(t.timezone);let i=t.substituteDomain||`pages.dev`;try{let e=await ne();e.ip&&k(e.ip),e.ipv6&&j(e.ipv6),(!e.ip||!e.ipv6)&&J(i)}catch(e){console.warn(`Backend substitute lookup failed, falling back to client-side DNS lookup`,e),J(i)}if(n){let e={};for(let[t,r]of Object.entries(n))e[t]={label:s[t]?.label||t,countries:s[t]?.countries||[],ips:r};H(e)}if(t.country){let e=!1;for(let[n,r]of Object.entries(s))if(r.countries.includes(t.country)){N(n),e=!0;break}e||N(`Other`)}W({success:!!t.connectedProfileId,profileMatch:t.connectedProfileId===e})}catch(e){console.error(`Verification failed`,e)}finally{D(!1)}};(0,Z.useEffect)(()=>{Y()},[e]);let X=(0,Z.useMemo)(()=>{let e=[...(K[M]||G).ips],t=w?.substituteDomain||`pages.dev`;return A&&e.unshift({ip:A,area:a(`setup.dynamicFromDomainV6`,{domain:t})}),O&&e.unshift({ip:O,area:a(`setup.dynamicFromDomain`,{domain:t})}),e},[M,K,O,A,w,a,G]);return(0,Q.jsxs)(`div`,{className:`mx-auto space-y-8 pb-24 ${i?`p-1`:`px-8 max-w-5xl`}`,children:[(0,Q.jsx)(_e,{isMobile:i,selectedRegion:M,setSelectedRegion:N,allRegions:K}),(0,Q.jsx)(ve,{isVerifying:E,verifyResult:U,handleVerify:Y,isMobile:i,clientInfo:w,showIp:P,setShowIp:F,showLocation:I,setShowLocation:L,traceInfo:z}),(0,Q.jsx)(ye,{accessPoints:c,selectedApId:b?.id||null,onSelectAp:g,accessPointName:S,onManageAccessPoints:()=>p(!0),isMobile:i}),(0,Q.jsx)(be,{dohUrl:C,copyToClipboard:q,isMobile:i}),(0,Q.jsx)(we,{isMobile:i,copyToClipboard:q,profileKey:x,profileName:v||void 0,accessPointName:S,allRegions:K,selectedRegion:M,currentIps:X}),(0,Q.jsx)(ke,{isOpen:f,onClose:()=>p(!1),profileId:e,isMobile:i,accessPoints:c,loading:u,onRefresh:_,toasterRef:r})]})};export{Ae as SetupView};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-C4Xdq4VV.js";import{A as t,B as n,C as r,Ct as i,E as a,F as o,G as s,I as c,J as l,K as u,N as d,P as f,R as p,U as m,Xt as h,at as g,ct as _,it as v,rt as y,tt as b,w as x,wt as S,z as C}from"./vendor-react-DifRgRH3.js";import{S as w,b as T}from"./vendor-icons-other-Bme3ywH9.js";import{A as E,B as D,C as O,F as k,L as A,M as j,N as M,O as N,P,R as F,S as I,T as L,V as R,a as z,d as B,f as V,i as H,n as U,o as W,r as G,v as K,z as q}from"./vendor-ui-core-CCxBtqRD.js";import{_t as J,t as Y,vt as X}from"./vendor-utils-D17P9mkD.js";import{C as ee,I as te,L as ne,Q as re,R as ie,T as ae,V as oe,Xt as se,Y as ce,ct as le,et as ue,i as de,j as fe,st as pe,z as me}from"./index-DLmOvLdX.js";import{t as he}from"./SwipeableDrawer-CzMJdF3W.js";var Z=e(w(),1);const ge=e=>{let t={},n={CN:{label:e(`common.mainlandChina`,`Mainland China`),countries:[`CN`]}},r=e=>{if(!e)return null;try{let t=e.trim();t=t.replace(/^"""|"""$/g,``).replace(/^"|"$/g,``).replace(/^'|'$/g,``).trim();let n=JSON.parse(t);return Array.isArray(n)?n:null}catch(t){return console.warn(`Failed to parse region env value:`,e,t),null}},i={CN:void 0};Object.entries(i).forEach(([e,i])=>{let a=r(i);a&&(t[e]={label:n[e]?.label||e,countries:n[e]?.countries||[],ips:a})});try{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};Object.keys(e).forEach(a=>{if(a.startsWith(`IP_REGION_`)&&!i[a.replace(`IP_REGION_`,``)]){let i=a.replace(`IP_REGION_`,``),o=r(e[a]);o&&(t[i]={label:n[i]?.label||i,countries:n[i]?.countries||[],ips:o})}})}catch{}return t};var Q=e(T(),1);const _e=({isMobile:e,selectedRegion:t,setSelectedRegion:n,allRegions:r})=>{let{t:i}=h();return(0,Q.jsxs)(`div`,{className:`flex flex-col md:flex-row justify-between items-start gap-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(E,{className:`font-bold text-gray-900 dark:text-white`,children:i(`setup.title`)}),(0,Q.jsx)(`p`,{className:`bp6-text-muted`,children:i(`setup.subtitle`)})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col items-end gap-2 w-full md:w-auto`,children:[(0,Q.jsxs)(`span`,{className:`text-[10px] font-bold uppercase opacity-50 flex items-center gap-1`,children:[(0,Q.jsx)(m,{size:10}),` `,i(`setup.regionOptimization`)]}),(0,Q.jsx)(O,{minimal:!0,fill:e,children:Object.keys(r).map(r=>(0,Q.jsx)(M,{active:t===r,onClick:()=>n(r),text:e?r.split(`_`)[0]:r.replace(`_`,` `),small:!0},r))})]})]})},ve=({isVerifying:e,verifyResult:n,handleVerify:r,isMobile:i,clientInfo:a,showIp:o,setShowIp:s,showLocation:c,setShowLocation:u,traceInfo:d})=>{let{t:p}=h(),[m,g]=(0,Z.useState)(!1);return(0,Q.jsx)(W,{title:p(`setup.verifyConnection`),icon:(0,Q.jsx)(S,{size:16}),children:(0,Q.jsx)(z,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col space-y-6`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col md:flex-row items-center justify-between bg-gray-50 dark:bg-gray-800/50 p-6 rounded-xl border border-gray-100 dark:border-gray-800 gap-6`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col md:flex-row items-center gap-4 text-center md:text-left`,children:[(0,Q.jsx)(`div`,{className:`p-3 rounded-full ${n?.success?`bg-green-100 text-green-600`:n?`bg-red-100 text-red-600`:`bg-blue-100 text-blue-600`}`,children:e?(0,Q.jsx)(P,{size:24}):n?.success?(0,Q.jsx)(t,{size:24}):(0,Q.jsx)(f,{size:24})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`font-bold text-lg`,children:e?p(`setup.verifying`):n?.success?p(`setup.connected`):p(`setup.notConnected`)}),(0,Q.jsx)(`div`,{className:`text-sm opacity-60`,children:n?.success?n.profileMatch?p(`setup.profileMatch`):p(`setup.profileMismatch`):p(`setup.verifyHint`)})]})]}),(0,Q.jsx)(M,{size:`large`,intent:n?.success?R.SUCCESS:R.PRIMARY,icon:`refresh`,text:p(`setup.refreshStatus`),onClick:r,loading:e,fill:i})]}),a&&(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 ${d?`sm:grid-cols-2 md:grid-cols-3`:`md:grid-cols-2`}`,children:[(0,Q.jsxs)(`div`,{className:`bg-white dark:bg-gray-900 p-4 rounded-lg border border-gray-100 dark:border-gray-800 shadow-sm flex items-start gap-3`,children:[(0,Q.jsx)(b,{size:18,className:`text-blue-500 mt-1`}),(0,Q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase font-bold opacity-40`,children:p(`setup.egressIp`)}),(0,Q.jsx)(`button`,{onClick:()=>s(!o),className:`text-gray-400 hover:text-blue-500 transition-colors`,children:o?(0,Q.jsx)(y,{size:16}):(0,Q.jsx)(v,{size:16})})]}),(0,Q.jsx)(`div`,{className:`font-mono font-bold text-blue-600 dark:text-blue-400 truncate`,children:(0,Q.jsx)(`span`,{className:X(`transition-[filter] duration-200 inline-block`,!o&&`filter blur-[6px] select-none`),children:a.ip})})]})]}),(0,Q.jsxs)(`div`,{className:`bg-white dark:bg-gray-900 p-4 rounded-lg border border-gray-100 dark:border-gray-800 shadow-sm flex items-start gap-3`,children:[(0,Q.jsx)(l,{size:18,className:`text-red-500 mt-1`}),(0,Q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase font-bold opacity-40`,children:p(`setup.currentLocation`)}),(0,Q.jsx)(`button`,{onClick:()=>u(!c),className:`text-gray-400 hover:text-red-500 transition-colors`,children:c?(0,Q.jsx)(y,{size:16}):(0,Q.jsx)(v,{size:16})})]}),(0,Q.jsx)(`div`,{className:`font-bold truncate`,children:(0,Q.jsxs)(`span`,{className:X(`transition-[filter] duration-200 inline-block`,!c&&`filter blur-[6px] select-none`),children:[a.city,`, `,a.region?`${a.region}, `:``,a.country]})})]})]}),d&&(0,Q.jsx)(L,{isOpen:m,onInteraction:e=>g(e),placement:`bottom`,content:(0,Q.jsxs)(`div`,{className:`p-4 max-w-sm max-h-60 overflow-auto font-mono text-xs bg-white dark:bg-gray-900 border border-gray-100 dark:border-gray-800 shadow-lg rounded-lg`,children:[(0,Q.jsx)(`div`,{className:`font-bold border-b border-gray-100 dark:border-gray-800 pb-2 mb-2`,children:`/cdn-cgi/trace`}),(0,Q.jsx)(`pre`,{className:`whitespace-pre-wrap`,children:d.raw})]}),children:(0,Q.jsxs)(`div`,{className:`bg-white dark:bg-gray-900 p-4 rounded-lg border border-gray-100 dark:border-gray-800 shadow-sm flex items-start gap-3 cursor-pointer select-none`,onDoubleClick:()=>g(!0),children:[(0,Q.jsx)(f,{size:18,className:`text-purple-500 mt-1`}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase font-bold opacity-40`,children:p(`setup.edgeServer`)}),(0,Q.jsx)(`div`,{className:`font-bold truncate`,children:d.colo})]})]})})]})]})})})},$=({step:e,className:t,size:n=144})=>{let r=e===1?47:50,i=e===1?45.5:45;return(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:J(`absolute -top-7 -left-7 pointer-events-none select-none z-0`,`text-blue-600/[0.08] dark:text-blue-400/[0.12]`,`transition-all duration-500 ease-out`,`blur-none group-hover:blur-md group-hover:opacity-0`,t),style:{width:n,height:n},children:(0,Q.jsxs)(`svg`,{viewBox:`0 0 100 100`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`w-full h-full`,children:[(0,Q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`46`,stroke:`currentColor`,strokeWidth:`4`}),(0,Q.jsx)(`text`,{x:r,y:i,textAnchor:`middle`,dominantBaseline:`central`,fill:`currentColor`,fontSize:`80`,fontWeight:`900`,fontFamily:`'Helvetica Neue', Helvetica, Arial, sans-serif`,children:e})]})})},ye=({accessPoints:e,selectedApId:t,onSelectAp:n,accessPointName:r,onManageAccessPoints:i,isMobile:a})=>{let{t:o}=h();return(0,Q.jsxs)(W,{title:o(`setup.accessPointsCardTitle`,`接入点`),icon:(0,Q.jsx)(u,{size:16}),className:`group relative overflow-hidden [&_.bp6-section-header]:relative [&_.bp6-section-header]:z-10 [&_.bp6-section-card]:relative [&_.bp6-section-card]:z-10`,children:[(0,Q.jsx)($,{step:1}),(0,Q.jsx)(z,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 w-full sm:w-auto`,children:[(0,Q.jsx)(`span`,{className:`text-xs opacity-50 font-medium`,children:o(`setup.selectAccessPointToConfigure`)}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.length>0?(0,Q.jsx)(B,{value:t||``,onChange:e=>n(e.target.value),options:e.map(e=>({label:e.name,value:e.id})),className:`font-semibold text-gray-900 dark:text-gray-100`}):(0,Q.jsx)(`div`,{className:`font-semibold text-gray-900 dark:text-gray-100 flex items-center gap-2`,children:r||o(`setup.defaultAccessPointName`,`设备-1`)}),e.length>0&&(0,Q.jsx)(G,{minimal:!0,round:!0,intent:R.PRIMARY,className:`text-xs`,children:e.length})]})]}),(0,Q.jsx)(M,{variant:`outlined`,intent:R.NONE,icon:(0,Q.jsx)(d,{size:14}),text:o(`setup.manageAccessPoints`,`管理接入点`),onClick:i,fill:a,className:`shrink-0`})]})})]})},be=({dohUrl:e,copyToClipboard:t,isMobile:n})=>{let{t:r}=h();return(0,Q.jsxs)(W,{title:r(`setup.accessPointTitle`,`Access DoH URL`),icon:`globe`,className:`group relative overflow-hidden [&_.bp6-section-header]:relative [&_.bp6-section-header]:z-10 [&_.bp6-section-card]:relative [&_.bp6-section-card]:z-10`,rightElement:(0,Q.jsx)(L,{placement:`bottom-end`,usePortal:!0,content:(0,Q.jsxs)(`div`,{className:`p-4 max-w-sm`,children:[(0,Q.jsx)(j,{children:r(`setup.whatIsDoh`)}),(0,Q.jsx)(`p`,{className:`text-sm mb-2`,children:r(`setup.dohDesc`)}),(0,Q.jsxs)(`ul`,{className:`list-disc list-inside text-sm opacity-80 mb-3 space-y-1`,children:[(0,Q.jsx)(`li`,{children:r(`setup.dohBenefit1`)}),(0,Q.jsx)(`li`,{children:r(`setup.dohBenefit2`)})]}),(0,Q.jsx)(`div`,{className:`text-xs border-t border-gray-100 dark:border-gray-700 pt-2`,children:(0,Q.jsxs)(`a`,{href:`https://en.wikipedia.org/wiki/DNS_over_HTTPS`,target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-1 text-blue-500 hover:underline`,children:[(0,Q.jsx)(g,{size:10}),` `,r(`setup.learnMore`)]})})]}),children:(0,Q.jsx)(M,{icon:`help`,variant:`minimal`,intent:R.NONE})}),children:[(0,Q.jsx)($,{step:2}),(0,Q.jsx)(z,{children:(0,Q.jsxs)(`div`,{className:`w-full bg-gray-100 dark:bg-gray-800 p-3 rounded-lg border border-gray-200 dark:border-gray-700 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-blue-600 dark:text-blue-400 break-all text-xs sm:text-sm`,children:e}),(0,Q.jsx)(M,{intent:R.PRIMARY,icon:`duplicate`,text:r(`setup.copyUrl`),fill:n,onClick:()=>t(e),className:`shrink-0`})]})})]})};function xe(e){let t=e.trim();try{return new URL(t.startsWith(`http://`)||t.startsWith(`https://`)?t:`https://${t}`).hostname||t}catch{return t.replace(/^https?:\/\//,``).split(`/`)[0].split(`:`)[0]||t}}function Se(e,t){let n=(e||``).trim(),r=(t||``).trim();if(!r&&n.includes(`(`)&&n.endsWith(`)`)){let e=n.match(/^(.+?)\s*\((.+?)\)$/);e&&(n=e[1].trim(),r=e[2].trim())}let i=n&&n!==`DNS Worker`?n:``,a=r&&r!==`DNS Worker`?r:``;return i&&a?i.toLowerCase()===a.toLowerCase()?i:`${i} - ${a}`:i||a||``}function Ce(e,t,n,r){let i,a,o,s;typeof e==`object`?(i=e.profileKey,a=e.profileName,o=e.accessPointName,s=e.origin):(i=e,a=t,s=n||``,o=r);let c=s.trim(),l=xe(c),u=`${c}/${i}`,d=Se(a,o),f=crypto.randomUUID(),p=crypto.randomUUID(),m=d?`DNS Worker - ${l} (${d})`:`DNS Worker (${l})`,h=d?`DNS Worker DoH - ${l} (${d})`:`DNS Worker DoH - ${l}`,g=d?`DNS Worker DoH configuration profile for ${d} via ${l}`:`DNS Worker DoH configuration profile via ${l}`,_=d?`Configures encrypted DNS over HTTPS (DoH) for ${d} via ${l}`:`Configures encrypted DNS over HTTPS (DoH) via ${l}`;return Y({PayloadContent:[{DNSSettings:{DNSProtocol:`HTTPS`,ServerHTTPVersion:3,ServerURL:u},OnDemandRules:[{Action:`Connect`,InterfaceTypeMatch:`WiFi`},{Action:`Connect`,InterfaceTypeMatch:`Cellular`},{Action:`Disconnect`}],PayloadDescription:_,PayloadDisplayName:h,PayloadIdentifier:`com.apple.dnsSettings.managed.${f}`,PayloadName:h,PayloadType:`com.apple.dnsSettings.managed`,PayloadUUID:f,PayloadVersion:1}],PayloadDescription:g,PayloadDisplayName:m,PayloadIdentifier:`com.dnsworker.profile.${i}`,PayloadName:m,PayloadRemovalDisallowed:!1,PayloadType:`Configuration`,PayloadUUID:p,PayloadVersion:1},{indent:` `})}const we=({isMobile:e,copyToClipboard:t,profileKey:n,profileName:r,accessPointName:o,allRegions:l,selectedRegion:u,currentIps:d})=>{let{t:f}=h();return(0,Q.jsxs)(`div`,{className:`group relative overflow-hidden rounded-xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm`,children:[(0,Q.jsx)($,{step:3}),(0,Q.jsxs)(U,{id:`setup-tabs`,renderActiveTabPanelOnly:!0,vertical:!e,size:`large`,className:J(`p-4 md:p-6 setup-tabs-container relative z-10 bg-transparent`,e&&[`[&_.bp6-tab-list]:overflow-x-auto!`,`[&_.bp6-tab-list]:flex-nowrap!`,`[&_.bp6-tab-list]:pb-1`,`[&_.bp6-tab-list]:scrollbar-none`,`[&_.bp6-tab-list]:[-ms-overflow-style:none]`,`[&_.bp6-tab-list::-webkit-scrollbar]:hidden`,`[&_.bp6-tab]:shrink-0`]),children:[(0,Q.jsx)(H,{id:`browsers`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(b,{size:16,className:`inline mr-2`}),f(`setup.browsers`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.browserTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.browserSteps`)}),(0,Q.jsx)(`p`,{className:`text-[10px] opacity-50 cursor-pointer`,onClick:()=>t(`chrome://settings/security`),children:f(`setup.browserTips`,`or copy this URL to the address bar: `)+`chrome://settings/security`})]})}),(0,Q.jsx)(H,{id:`apple`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(i,{size:16,className:`inline mr-2`}),f(`setup.apple`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.appleTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.appleDesc`)}),(0,Q.jsx)(`p`,{className:`text-[10px] opacity-50 text-center`,children:f(`setup.appleWarning`)}),(0,Q.jsxs)(`div`,{className:`p-6 bg-gray-50 dark:bg-gray-800 rounded-xl border border-dashed border-gray-300 dark:border-gray-700 flex flex-col items-center justify-center`,children:[(0,Q.jsx)(k,{icon:`document`,size:40,className:`opacity-20 mb-4`}),(0,Q.jsx)(M,{intent:R.PRIMARY,text:f(`setup.downloadConfig`),icon:`download`,onClick:()=>{let e=Ce({profileKey:n,profileName:r,accessPointName:o,origin:window.location.origin}),t=new Blob([e],{type:`application/x-apple-aspen-config`}),i=URL.createObjectURL(t),a=document.createElement(`a`);a.href=i;let s=Se(r,o),c=xe(window.location.origin);a.download=`dns_worker-${(s||c).replace(/[^a-zA-Z0-9_\-\u4e00-\u9fa5]/g,`_`).replace(/_+/g,`_`).replace(/^_|_$/g,``)}-${n}.mobileconfig`,a.click(),URL.revokeObjectURL(i)}})]}),(0,Q.jsx)(`p`,{className:`text-[10px] opacity-50 mt-4! text-center`,children:f(`setup.appleInstallHint`)})]})}),(0,Q.jsx)(H,{id:`windows`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(s,{size:16,className:`inline mr-2`}),f(`setup.windows`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.windowsTitle`,{region:l[u]?.label||f(`setup.otherRegion`)})}),(0,Q.jsxs)(`ol`,{className:`list-decimal list-inside space-y-4 text-sm leading-relaxed`,children:[(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`a`,{href:`ms-settings:network-status`,children:f(`setup.windowsStep0`)})}),(0,Q.jsx)(`li`,{children:f(`setup.windowsStep1`)}),(0,Q.jsxs)(`li`,{children:[f(`setup.windowsStep2`),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:d.map(n=>(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(G,{minimal:!0,interactive:!0,onClick:()=>t(n.ip),icon:`duplicate`,className:`font-mono`,children:n.ip}),!e&&(0,Q.jsx)(`span`,{className:`text-[9px] opacity-40 ml-1`,children:n.area})]},n.ip))})]}),(0,Q.jsx)(`li`,{children:f(`setup.windowsStep3`)}),(0,Q.jsx)(`li`,{children:f(`setup.windowsStep4`)})]})]})}),(0,Q.jsx)(H,{id:`linux`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(x,{size:16,className:`inline mr-2`}),f(`setup.linux`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.linuxTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.linuxDesc`)}),(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-bold mb-2`,children:f(`setup.linuxStep1`)}),(0,Q.jsxs)(`div`,{className:`relative group`,children:[(0,Q.jsx)(`pre`,{className:`bg-gray-100 dark:bg-gray-800 p-4 rounded-lg overflow-x-auto text-xs font-mono border border-gray-200 dark:border-gray-700`,children:(0,Q.jsx)(`code`,{children:`curl -sL "${window.location.origin}/setup.sh?key=${n}&origin=${window.location.origin}" | sudo bash`})}),(0,Q.jsx)(M,{className:`absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity`,icon:`duplicate`,minimal:!0,small:!0,onClick:()=>{t(`curl -sL "${window.location.origin}/setup.sh?key=${n}&origin=${window.location.origin}" | sudo bash`)}})]})]}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(`p`,{className:`text-sm font-bold`,children:f(`setup.linuxStep2`)})})]})}),(0,Q.jsx)(H,{id:`routeros`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(c,{size:16,className:`inline mr-2`}),f(`setup.routeros`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.routerosTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.routerosDesc`)}),(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-bold mb-2`,children:f(`setup.routerosStep1`)}),(0,Q.jsxs)(`div`,{className:`relative group`,children:[(0,Q.jsx)(`pre`,{className:`bg-gray-100 dark:bg-gray-800 p-4 rounded-lg overflow-x-auto text-xs font-mono border border-gray-200 dark:border-gray-700`,children:(0,Q.jsx)(`code`,{children:`/ip dns set use-doh-server="${window.location.origin}/${n}" verify-doh-cert=yes`})}),(0,Q.jsx)(M,{className:`absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity`,icon:`duplicate`,minimal:!0,small:!0,onClick:()=>{t(`/ip dns set use-doh-server="${window.location.origin}/${n}" verify-doh-cert=yes`)}})]})]}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.routerosNote`)}),(0,Q.jsxs)(`a`,{href:`https://help.mikrotik.com/docs/spaces/ROS/pages/37748767/DNS`,target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-1 text-xs text-blue-500 hover:underline`,children:[(0,Q.jsx)(g,{size:10}),` `,f(`setup.routerosDocs`)]})]})}),(0,Q.jsx)(H,{id:`android`,title:(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(a,{size:16,className:`inline mr-2`}),f(`setup.android`)]}),panel:(0,Q.jsxs)(`div`,{className:`space-y-4 md:ml-4 mt-4 md:mt-0`,children:[(0,Q.jsx)(j,{className:`font-bold`,children:f(`setup.androidTitle`)}),(0,Q.jsx)(`p`,{className:`text-sm`,children:f(`setup.androidDesc`)}),(0,Q.jsxs)(`div`,{className:`p-4 bg-gray-50 dark:bg-gray-800/60 rounded-xl border border-gray-200 dark:border-gray-700 space-y-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-semibold text-gray-700 dark:text-gray-300`,children:f(`setup.androidDotTitle`,`私有 DNS (DoT - Serverfull 模式)`)}),(0,Q.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:f(`setup.androidDotDesc`,`设置 > 网络和互联网 > 私有 DNS > 提供商主机名:`)}),(0,Q.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Q.jsx)(G,{minimal:!0,interactive:!0,onClick:()=>t(`${n}.${window.location.hostname}`),icon:`duplicate`,className:`font-mono text-sm py-1 px-3`,intent:R.PRIMARY,children:`${n}.${window.location.hostname}`})})]}),(0,Q.jsx)(I,{intent:R.PRIMARY,icon:`info-sign`,className:`text-xs`,children:f(`setup.androidWarning`)})]})})]})]})};function Te({profileId:e,accessPoints:t,onRefresh:n,toasterRef:r}){let{t:i}=h(),[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(null),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(null),[O,k]=(0,Z.useState)(!1),[A,j]=(0,Z.useState)(``);return{isAddDialogOpen:a,setIsAddDialogOpen:o,newApName:s,setNewApName:c,isAdding:l,renameApId:d,setRenameApId:f,renameApName:p,setRenameApName:m,isRenaming:g,rotatingApId:v,deletingApId:b,newApNameFocused:S,setNewApNameFocused:C,renameApNameFocused:w,setRenameApNameFocused:T,rotateConfirmApId:E,setRotateConfirmApId:D,isSearchOpen:O,setIsSearchOpen:k,searchQuery:A,setSearchQuery:j,filteredAccessPoints:t.filter(e=>e.name.toLowerCase().includes(A.toLowerCase())||e.token.toLowerCase().includes(A.toLowerCase())),isValidApName:e=>de.test(e),handleAdd:async()=>{let a=s.trim();if(a){if(t.some(e=>e.name.toLowerCase()===a.toLowerCase())){r.current?.show({message:i(`setup.accessPointNameExists`,`Access Point name already exists`),intent:R.DANGER});return}u(!0);try{await oe(e,a),r.current?.show({message:i(`setup.accessPointCreated`),intent:R.SUCCESS}),o(!1),c(``),n()}catch(e){let t=e.message||`Failed to create access point`,n=t;if(t.startsWith(`Access point limit exceeded`)){let e=t.match(/\(max (\d+)\)/),r=e?e[1]:`100`;n=i(`setup.accessPointLimitExceeded`,{max:r,defaultValue:`Access Point limit exceeded (max ${r})`})}r.current?.show({message:n,intent:R.DANGER})}finally{u(!1)}}},handleRename:async()=>{let a=p.trim();if(!(!a||!d)){if(t.some(e=>e.id!==d&&e.name.toLowerCase()===a.toLowerCase())){r.current?.show({message:i(`setup.accessPointNameExists`,`Access Point name already exists`),intent:R.DANGER});return}_(!0);try{await pe(e,d,a),r.current?.show({message:i(`setup.accessPointRenamed`),intent:R.SUCCESS}),f(null),n()}catch(e){r.current?.show({message:e.message||`Failed to rename access point`,intent:R.DANGER})}finally{_(!1)}}},handleRotate:async t=>{y(t);try{await le(e,t),r.current?.show({message:i(`setup.tokenRotated`),intent:R.SUCCESS}),n()}catch(e){console.error(e)}finally{y(null)}},handleDelete:async t=>{if(confirm(i(`setup.deleteAccessPointConfirm`))){x(t);try{await ce(e,t),r.current?.show({message:i(`setup.accessPointDeleted`),intent:R.SUCCESS}),n()}catch(e){console.error(e)}finally{x(null)}}}}}const Ee=({isOpen:e,onClose:t,newApName:n,setNewApName:r,newApNameFocused:i,setNewApNameFocused:a,handleAdd:o,isAdding:s,isValidApName:c})=>{let{t:l}=h();return(0,Q.jsxs)(N,{isOpen:e,onClose:t,title:l(`setup.addAccessPoint`),children:[(0,Q.jsx)(`div`,{className:A,children:(0,Q.jsx)(K,{content:l(`setup.accessPointNameFormatTip`,`1-30 characters, letters, numbers, hyphens and underscores allowed`),isOpen:i,position:D.TOP,intent:R.PRIMARY,className:`w-full`,children:(0,Q.jsx)(`div`,{className:`w-full block`,children:(0,Q.jsx)(V,{autoFocus:!0,large:!0,placeholder:l(`setup.accessPointName`),value:n,onChange:e=>r(e.target.value),onFocus:()=>a(!0),onBlur:()=>a(!1)})})})}),(0,Q.jsx)(`div`,{className:F,children:(0,Q.jsxs)(`div`,{className:q,children:[(0,Q.jsx)(M,{onClick:t,children:l(`common.cancel`,`Cancel`)}),(0,Q.jsx)(M,{intent:R.PRIMARY,onClick:o,loading:s,disabled:!c(n),children:l(`common.create`)})]})})]})},De=({isOpen:e,onClose:t,renameApName:n,setRenameApName:r,renameApNameFocused:i,setRenameApNameFocused:a,handleRename:o,isRenaming:s,isValidApName:c})=>{let{t:l}=h();return(0,Q.jsxs)(N,{isOpen:e,onClose:t,title:l(`setup.renameAccessPoint`),children:[(0,Q.jsx)(`div`,{className:A,children:(0,Q.jsx)(K,{content:l(`setup.accessPointNameFormatTip`,`1-30 characters, letters, numbers, hyphens and underscores allowed`),isOpen:i,position:D.TOP,intent:R.PRIMARY,className:`w-full`,children:(0,Q.jsx)(`div`,{className:`w-full block`,children:(0,Q.jsx)(V,{autoFocus:!0,large:!0,placeholder:l(`setup.accessPointName`),value:n,onChange:e=>r(e.target.value),onFocus:()=>a(!0),onBlur:()=>a(!1)})})})}),(0,Q.jsx)(`div`,{className:F,children:(0,Q.jsxs)(`div`,{className:q,children:[(0,Q.jsx)(M,{onClick:t,children:l(`common.cancel`,`Cancel`)}),(0,Q.jsx)(M,{intent:R.PRIMARY,onClick:o,loading:s,disabled:!c(n),children:l(`common.save`)})]})})]})},Oe=({ap:e,totalApCount:t,toasterRef:i,onRenameTrigger:a,rotateConfirmApId:o,setRotateConfirmApId:s,rotatingApId:c,handleRotate:l,deletingApId:d,handleDelete:f})=>{let{t:m}=h();return(0,Q.jsx)(W,{title:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(u,{size:16}),(0,Q.jsx)(`span`,{children:e.name})]}),className:`shadow-none! rounded-lg!`,children:(0,Q.jsxs)(z,{children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex justify-between items-start gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-xs opacity-50 mt-1`,children:`DoH URL`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-mono bg-blue-50 text-blue-600 dark:bg-blue-900/20 dark:text-blue-400 px-2 py-1 rounded cursor-pointer hover:bg-blue-100 dark:hover:bg-blue-900/40 transition-colors break-all`,onClick:()=>{navigator.clipboard.writeText(`${window.location.origin}/${e.token}`),i.current?.show({message:m(`setup.copied`),intent:R.SUCCESS})},title:m(`setup.copyUrl`),children:[(0,Q.jsx)(`span`,{className:`select-all`,children:`${window.location.origin}/${e.token}`}),(0,Q.jsx)(_,{size:14,className:`shrink-0`})]})]}),(0,Q.jsxs)(`div`,{className:`flex justify-between items-start gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-xs opacity-50 mt-1`,children:m(`setup.accessPointToken`)}),(0,Q.jsx)(`span`,{className:`text-sm font-mono bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded select-all break-all`,children:e.token})]}),(0,Q.jsxs)(`div`,{className:`flex justify-between items-start gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-xs opacity-50 mt-1`,children:`Created`}),(0,Q.jsx)(`span`,{className:`text-sm`,children:ee(new Date(e.created_at*1e3))})]})]}),(0,Q.jsxs)(`div`,{className:`mt-4 flex gap-2 flex-wrap`,children:[(0,Q.jsx)(M,{small:!0,icon:(0,Q.jsx)(n,{size:14}),text:m(`setup.renameAccessPoint`),onClick:()=>a(e.id,e.name)}),(0,Q.jsx)(L,{isOpen:o===e.id,onInteraction:e=>{e||s(null)},content:(0,Q.jsxs)(`div`,{className:`p-4 space-y-3 dark:bg-gray-800 dark:text-white max-w-xs`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-semibold leading-relaxed`,children:m(`setup.rotateTokenConfirmDesc`,`Rotating the key will immediately disconnect devices using the old key. Are you sure you want to continue?`)}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(M,{small:!0,minimal:!0,text:m(`common.cancel`,`Cancel`),onClick:()=>s(null)}),(0,Q.jsx)(M,{small:!0,intent:R.DANGER,text:m(`common.confirm`,`Confirm`),onClick:()=>{s(null),l(e.id)}})]})]}),placement:`top`,children:(0,Q.jsx)(M,{small:!0,icon:(0,Q.jsx)(p,{size:14}),text:m(`setup.rotateToken`),loading:c===e.id,onClick:()=>s(e.id)})}),(0,Q.jsx)(M,{small:!0,intent:R.DANGER,icon:(0,Q.jsx)(r,{size:14}),text:m(`setup.deleteAccessPoint`),loading:d===e.id,onClick:()=>f(e.id),disabled:t<=1,title:t<=1?`Cannot delete the only access point`:void 0})]})]})})},ke=({isOpen:e,onClose:t,profileId:n,isMobile:r,accessPoints:i,loading:a,onRefresh:s,toasterRef:c})=>{let{t:l}=h(),{isAddDialogOpen:u,setIsAddDialogOpen:d,newApName:f,setNewApName:p,isAdding:m,renameApId:g,setRenameApId:_,renameApName:v,setRenameApName:y,isRenaming:b,rotatingApId:x,deletingApId:S,newApNameFocused:w,setNewApNameFocused:T,renameApNameFocused:E,setRenameApNameFocused:D,rotateConfirmApId:O,setRotateConfirmApId:k,isSearchOpen:A,setIsSearchOpen:j,searchQuery:N,setSearchQuery:F,filteredAccessPoints:I,isValidApName:L,handleAdd:z,handleRename:B,handleRotate:H,handleDelete:U}=Te({profileId:n,accessPoints:i,onRefresh:s,toasterRef:c});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(he,{isOpen:e,onClose:t,title:A?(0,Q.jsx)(V,{leftIcon:`search`,placeholder:l(`setup.searchAccessPoints`,`Search...`),value:N,onChange:e=>F(e.target.value),rightElement:(0,Q.jsx)(M,{icon:`cross`,minimal:!0,onClick:()=>{j(!1),F(``)}}),autoFocus:!0}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:l(`setup.manageAccessPoints`)}),(0,Q.jsx)(M,{icon:(0,Q.jsx)(o,{size:14}),minimal:!0,onClick:()=>j(!0),className:`opacity-50 hover:opacity-100`})]}),icon:`diagram-tree`,size:r?`100%`:`450px`,children:[(0,Q.jsx)(M,{fill:!0,intent:R.PRIMARY,icon:(0,Q.jsx)(C,{size:16}),text:l(`setup.addAccessPoint`),onClick:()=>d(!0),large:!0}),a?(0,Q.jsx)(`div`,{className:`flex justify-center p-8`,children:(0,Q.jsx)(P,{})}):(0,Q.jsx)(`div`,{className:`space-y-4 mt-4`,children:I.map(e=>(0,Q.jsx)(Oe,{ap:e,totalApCount:i.length,toasterRef:c,onRenameTrigger:(e,t)=>{_(e),y(t)},rotateConfirmApId:O,setRotateConfirmApId:k,rotatingApId:x,handleRotate:H,deletingApId:S,handleDelete:U},e.id))})]}),(0,Q.jsx)(Ee,{isOpen:u,onClose:()=>{d(!1),p(``)},newApName:f,setNewApName:p,newApNameFocused:w,setNewApNameFocused:T,handleAdd:z,isAdding:m,isValidApName:L}),(0,Q.jsx)(De,{isOpen:!!g,onClose:()=>_(null),renameApName:v,setRenameApName:y,renameApNameFocused:E,setRenameApNameFocused:D,handleRename:B,isRenaming:b,isValidApName:L})]})},Ae=({profileId:e,profileKey:t,profileName:n,toasterRef:r})=>{let i=se(),{t:a,i18n:o}=h(),s=(0,Z.useMemo)(()=>ge(a),[o.language,a]),[c,l]=(0,Z.useState)([]),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),[m,g]=(0,Z.useState)(null),_=async()=>{d(!0);try{l(await re(e))}catch(e){console.error(e)}finally{d(!1)}};(0,Z.useEffect)(()=>{_()},[e]);let[v,y]=(0,Z.useState)(n||``);(0,Z.useEffect)(()=>{n?y(n):e&&ue(e).then(e=>{e?.name&&y(e.name)}).catch(()=>{})},[e,n]);let b=(0,Z.useMemo)(()=>c.length===0?null:c.find(e=>e.id===m)||c[0],[c,m]),x=b?b.token:t,S=b?b.name:void 0,C=`${window.location.origin}/${x}`,[w,T]=(0,Z.useState)(null),[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(null),[A,j]=(0,Z.useState)(null),[M,N]=(0,Z.useState)(`CN`),[P,F]=(0,Z.useState)(!1),[I,L]=(0,Z.useState)(!1),[z,B]=(0,Z.useState)(null),[V,H]=(0,Z.useState)({}),[U,W]=(0,Z.useState)(null),G={label:a(`setup.otherRegion`),ips:[],countries:[]},K=(0,Z.useMemo)(()=>({...s,...V,Other:G}),[s,V,G]),q=e=>{navigator.clipboard.writeText(e),r?.current?.show({message:a(`setup.copied`),intent:R.SUCCESS})},J=async e=>{let t=async(t,n,r)=>{try{let i=await me(t,e,n);if(i.Answer&&i.Answer.length>0){let e=i.Answer.find(e=>e.type===r);if(e?.data)return e.data}}catch(r){console.warn(`Client-side DNS query failed for ${e} (${n}) via ${t}:`,r)}return null},n=[`cloudflare-dns.com`,`1.1.1.1`],r=null;for(let e of n)if(r=await t(e,`A`,1),r)break;r&&k(r);let i=null;for(let e of n)if(i=await t(e,`AAAA`,28),i)break;i&&j(i)},Y=async()=>{D(!0),W(null);try{let[t,n,r]=await Promise.all([fe(),te(),ie()]);T(t),B(r),t.timezone&&t.timezone!==`UNKNOWN`&&ae(t.timezone);let i=t.substituteDomain||`pages.dev`;try{let e=await ne();e.ip&&k(e.ip),e.ipv6&&j(e.ipv6),(!e.ip||!e.ipv6)&&J(i)}catch(e){console.warn(`Backend substitute lookup failed, falling back to client-side DNS lookup`,e),J(i)}if(n){let e={};for(let[t,r]of Object.entries(n))e[t]={label:s[t]?.label||t,countries:s[t]?.countries||[],ips:r};H(e)}if(t.country){let e=!1;for(let[n,r]of Object.entries(s))if(r.countries.includes(t.country)){N(n),e=!0;break}e||N(`Other`)}W({success:!!t.connectedProfileId,profileMatch:t.connectedProfileId===e})}catch(e){console.error(`Verification failed`,e)}finally{D(!1)}};(0,Z.useEffect)(()=>{Y()},[e]);let X=(0,Z.useMemo)(()=>{let e=[...(K[M]||G).ips],t=w?.substituteDomain||`pages.dev`;return A&&e.unshift({ip:A,area:a(`setup.dynamicFromDomainV6`,{domain:t})}),O&&e.unshift({ip:O,area:a(`setup.dynamicFromDomain`,{domain:t})}),e},[M,K,O,A,w,a,G]);return(0,Q.jsxs)(`div`,{className:`mx-auto space-y-8 pb-24 ${i?`p-1`:`px-8 max-w-5xl`}`,children:[(0,Q.jsx)(_e,{isMobile:i,selectedRegion:M,setSelectedRegion:N,allRegions:K}),(0,Q.jsx)(ve,{isVerifying:E,verifyResult:U,handleVerify:Y,isMobile:i,clientInfo:w,showIp:P,setShowIp:F,showLocation:I,setShowLocation:L,traceInfo:z}),(0,Q.jsx)(ye,{accessPoints:c,selectedApId:b?.id||null,onSelectAp:g,accessPointName:S,onManageAccessPoints:()=>p(!0),isMobile:i}),(0,Q.jsx)(be,{dohUrl:C,copyToClipboard:q,isMobile:i}),(0,Q.jsx)(we,{isMobile:i,copyToClipboard:q,profileKey:x,profileName:v||void 0,accessPointName:S,allRegions:K,selectedRegion:M,currentIps:X}),(0,Q.jsx)(ke,{isOpen:f,onClose:()=>p(!1),profileId:e,isMobile:i,accessPoints:c,loading:u,onRefresh:_,toasterRef:r})]})};export{Ae as SetupView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-C4Xdq4VV.js";import{S as t,b as n}from"./vendor-icons-other-Bme3ywH9.js";import{B as r,g as i}from"./vendor-ui-core-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-C4Xdq4VV.js";import{S as t,b as n}from"./vendor-icons-other-Bme3ywH9.js";import{B as r,g as i}from"./vendor-ui-core-CCxBtqRD.js";var a=e(t(),1),o=e(n(),1);const s=({isOpen:e,onClose:t,title:n,icon:s,size:c,className:l,children:u,...d})=>{let f=(0,a.useRef)(null),p=e=>{let t=e.touches[0];f.current={x:t.clientX,y:t.clientY}},m=e=>{if(!f.current)return;let n=e.touches[0],r=n.clientX-f.current.x,i=n.clientY-f.current.y;r>80&&Math.abs(r)>Math.abs(i)*1.5&&(t(),f.current=null)},h=()=>{f.current=null},g=`dark:bg-gray-900 dark:text-white shadow-none! bg-transparent! bg-bulletin! backdrop-blur-sm! ${l||``}`;return(0,o.jsx)(i,{isOpen:e,onClose:t,title:n,icon:s,position:r.RIGHT,size:c,className:g,...d,children:(0,o.jsx)(`div`,{className:`p-6 space-y-4 overflow-y-auto h-full pb-safe`,onTouchStart:p,onTouchMove:m,onTouchEnd:h,children:u})})};export{s as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-C4Xdq4VV.js";import{en as n,n as r,t as i}from"./vendor-react-Kt98jRfM.js";import{S as a,b as o}from"./vendor-icons-other-Bme3ywH9.js";import{$ as s,A as c,B as l,C as u,D as d,E as f,F as p,G as m,H as h,I as g,J as _,K as v,L as y,M as b,N as x,O as S,P as C,Q as w,R as T,S as E,T as D,U as ee,V as O,W as k,X as A,Y as te,Z as ne,_ as re,_t as j,a as ie,at as ae,b as oe,c as se,ct as ce,d as le,dt as ue,et as de,f as fe,ft as pe,g as me,h as he,ht as ge,i as _e,it as ve,j as ye,k as be,l as xe,lt as Se,m as Ce,mt as we,n as Te,nt as Ee,o as De,ot as Oe,p as ke,pt as Ae,q as je,r as Me,rt as Ne,s as Pe,st as Fe,tt as Ie,u as Le,ut as Re,v as ze,w as Be,x as Ve,y as He,z as M}from"./vendor-utils-CfYGGC23.js";import{C as Ue}from"./index-7FKlsF79.js";var We=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function Ge(e){return typeof e==`string`?We.includes(e):!1}var N=e(a()),Ke=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function qe(e){return typeof e==`string`?Ke.has(e):!1}function Je(e){return typeof e==`string`&&e.startsWith(`data-`)}function Ye(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(qe(n)||Je(n))&&(t[n]=e[n]);return t}function Xe(e){if(e==null)return null;if((0,N.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return Ye(t)}return typeof e==`object`&&!Array.isArray(e)?Ye(e):null}function Ze(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(qe(n)||Je(n)||Ge(n))&&(t[n]=e[n]);return t}function Qe(e){return e==null?null:(0,N.isValidElement)(e)?Ze(e.props):typeof e==`object`&&!Array.isArray(e)?Ze(e):null}var $e=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},et.apply(null,arguments)}function tt(e,t){if(e==null)return{};var n,r,i=nt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rt=(0,N.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=tt(e,$e),d=a||{width:r,height:i,x:0,y:0},f=j(`recharts-surface`,o);return N.createElement(`svg`,et({},Ze(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),N.createElement(`title`,null,c),N.createElement(`desc`,null,l),n)}),it=[`children`,`className`];function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},at.apply(null,arguments)}function ot(e,t){if(e==null)return{};var n,r,i=st(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function st(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ct=N.forwardRef((e,t)=>{var n=e.children,r=e.className,i=ot(e,it),a=j(`recharts-layer`,r);return N.createElement(`g`,at({className:a},Ze(i),{ref:t}),n)}),lt=4;function ut(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:lt),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function P(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+ut(i)+n},``)}var dt=e=>e===0?0:e>0?1:-1,ft=e=>typeof e==`number`&&e!=+e,pt=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,F=e=>(typeof e==`number`||e instanceof Number)&&!ft(e),mt=e=>F(e)||typeof e==`string`,ht=0,gt=e=>{var t=++ht;return`${e||``}${t}`},_t=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!F(e)&&typeof e!=`string`)return n;var i;if(pt(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return ft(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},vt=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function yt(e,t,n){return F(e)&&F(t)?ut(e+n*(t-e)):t}function bt(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):ge(e,t))===n)}var I=e=>e==null,xt=e=>I(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function St(e){return e!=null}function Ct(){}function wt(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function Tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Et(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Tt(Object(n),!0).forEach(function(t){Dt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Dt(e,t,n){return(t=Ot(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ot(e){var t=kt(e,`string`);return typeof t==`symbol`?t:t+``}function kt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var At=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=wt(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var ee={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(ee.height=Math.max(E.y+E.height-(l+u),0),ee.width=f),ee}if(n===`left`){var O={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(O.width=Math.max(O.x-E.x,0),O.height=u),O}if(n===`right`){var k={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(E.x+E.width-k.x,0),k.height=u),k}var A=o&&E?{width:g,height:u}:{};return n===`insideLeft`?Et({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},A):n===`insideRight`?Et({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},A):n===`insideTop`?Et({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},A):n===`insideBottom`?Et({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},A):n===`insideTopLeft`?Et({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},A):n===`insideTopRight`?Et({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},A):n===`insideBottomLeft`?Et({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},A):n===`insideBottomRight`?Et({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},A):n&&typeof n==`object`&&(F(n.x)||pt(n.x))&&(F(n.y)||pt(n.y))?Et({x:c+_t(n.x,g),y:l+_t(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},A):Et({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},A)},jt=[`top`,`left`,`right`,`bottom`];function Mt(e){return e==null?!1:typeof e==`object`?!0:jt.includes(e)}var Nt=(0,N.createContext)(null),Pt=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Ft=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,N.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{Ge(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},It=(e,t,n)=>r=>(e(t,n,r),null),Lt=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];Ge(i)&&typeof a==`function`&&(r||={},r[i]=It(a,t,n))}),r};function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Rt(Object(n),!0).forEach(function(t){Bt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Bt(e,t,n){return(t=Vt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vt(e){var t=Ht(e,`string`);return typeof t==`symbol`?t:t+``}function Ht(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ut(e,t){var n=zt({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function Wt(e,t,n){return t===!0?je(e,n):typeof t==`function`?je(e,t):e}var Gt=(0,N.createContext)(null),Kt=v(),qt=e=>e,L=()=>{var e=(0,N.useContext)(Gt);return e?e.store.dispatch:qt},Jt=()=>{},Yt=()=>Jt,Xt=(e,t)=>e===t;function R(e){var t=(0,N.useContext)(Gt),n=(0,N.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:Jt,[t,e]);return(0,Kt.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Yt,t?t.store.getState:Jt,t?t.store.getState:Jt,n,Xt)}var Zt=e=>e.legend.settings,Qt=e=>e.legend.size;m([e=>e.legend.payload,Zt],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?k(r,n):r});function $t(e,t){return an(e)||rn(e,t)||tn(e,t)||en()}function en(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1
|
+
import{i as e,n as t}from"./rolldown-runtime-C4Xdq4VV.js";import{en as n,n as r,t as i}from"./vendor-react-DifRgRH3.js";import{S as a,b as o}from"./vendor-icons-other-Bme3ywH9.js";import{$ as s,A as c,B as l,C as u,D as d,E as f,F as p,G as m,H as h,I as g,J as _,K as v,L as y,M as b,N as x,O as S,P as C,Q as w,R as T,S as E,T as D,U as ee,V as O,W as k,X as A,Y as te,Z as ne,_ as re,_t as j,a as ie,at as ae,b as oe,c as se,ct as ce,d as le,dt as ue,et as de,f as fe,ft as pe,g as me,h as he,ht as ge,i as _e,it as ve,j as ye,k as be,l as xe,lt as Se,m as Ce,mt as we,n as Te,nt as Ee,o as De,ot as Oe,p as ke,pt as Ae,q as je,r as Me,rt as Ne,s as Pe,st as Fe,tt as Ie,u as Le,ut as Re,v as ze,w as Be,x as Ve,y as He,z as M}from"./vendor-utils-D17P9mkD.js";import{C as Ue}from"./index-DLmOvLdX.js";var We=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function Ge(e){return typeof e==`string`?We.includes(e):!1}var N=e(a()),Ke=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function qe(e){return typeof e==`string`?Ke.has(e):!1}function Je(e){return typeof e==`string`&&e.startsWith(`data-`)}function Ye(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(qe(n)||Je(n))&&(t[n]=e[n]);return t}function Xe(e){if(e==null)return null;if((0,N.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return Ye(t)}return typeof e==`object`&&!Array.isArray(e)?Ye(e):null}function Ze(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(qe(n)||Je(n)||Ge(n))&&(t[n]=e[n]);return t}function Qe(e){return e==null?null:(0,N.isValidElement)(e)?Ze(e.props):typeof e==`object`&&!Array.isArray(e)?Ze(e):null}var $e=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},et.apply(null,arguments)}function tt(e,t){if(e==null)return{};var n,r,i=nt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rt=(0,N.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=tt(e,$e),d=a||{width:r,height:i,x:0,y:0},f=j(`recharts-surface`,o);return N.createElement(`svg`,et({},Ze(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),N.createElement(`title`,null,c),N.createElement(`desc`,null,l),n)}),it=[`children`,`className`];function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},at.apply(null,arguments)}function ot(e,t){if(e==null)return{};var n,r,i=st(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function st(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ct=N.forwardRef((e,t)=>{var n=e.children,r=e.className,i=ot(e,it),a=j(`recharts-layer`,r);return N.createElement(`g`,at({className:a},Ze(i),{ref:t}),n)}),lt=4;function ut(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:lt),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function P(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+ut(i)+n},``)}var dt=e=>e===0?0:e>0?1:-1,ft=e=>typeof e==`number`&&e!=+e,pt=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,F=e=>(typeof e==`number`||e instanceof Number)&&!ft(e),mt=e=>F(e)||typeof e==`string`,ht=0,gt=e=>{var t=++ht;return`${e||``}${t}`},_t=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!F(e)&&typeof e!=`string`)return n;var i;if(pt(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return ft(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},vt=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function yt(e,t,n){return F(e)&&F(t)?ut(e+n*(t-e)):t}function bt(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):ge(e,t))===n)}var I=e=>e==null,xt=e=>I(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function St(e){return e!=null}function Ct(){}function wt(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function Tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Et(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Tt(Object(n),!0).forEach(function(t){Dt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Dt(e,t,n){return(t=Ot(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ot(e){var t=kt(e,`string`);return typeof t==`symbol`?t:t+``}function kt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var At=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=wt(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var ee={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(ee.height=Math.max(E.y+E.height-(l+u),0),ee.width=f),ee}if(n===`left`){var O={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(O.width=Math.max(O.x-E.x,0),O.height=u),O}if(n===`right`){var k={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(E.x+E.width-k.x,0),k.height=u),k}var A=o&&E?{width:g,height:u}:{};return n===`insideLeft`?Et({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},A):n===`insideRight`?Et({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},A):n===`insideTop`?Et({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},A):n===`insideBottom`?Et({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},A):n===`insideTopLeft`?Et({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},A):n===`insideTopRight`?Et({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},A):n===`insideBottomLeft`?Et({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},A):n===`insideBottomRight`?Et({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},A):n&&typeof n==`object`&&(F(n.x)||pt(n.x))&&(F(n.y)||pt(n.y))?Et({x:c+_t(n.x,g),y:l+_t(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},A):Et({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},A)},jt=[`top`,`left`,`right`,`bottom`];function Mt(e){return e==null?!1:typeof e==`object`?!0:jt.includes(e)}var Nt=(0,N.createContext)(null),Pt=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Ft=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,N.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{Ge(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},It=(e,t,n)=>r=>(e(t,n,r),null),Lt=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];Ge(i)&&typeof a==`function`&&(r||={},r[i]=It(a,t,n))}),r};function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Rt(Object(n),!0).forEach(function(t){Bt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Bt(e,t,n){return(t=Vt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vt(e){var t=Ht(e,`string`);return typeof t==`symbol`?t:t+``}function Ht(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ut(e,t){var n=zt({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function Wt(e,t,n){return t===!0?je(e,n):typeof t==`function`?je(e,t):e}var Gt=(0,N.createContext)(null),Kt=v(),qt=e=>e,L=()=>{var e=(0,N.useContext)(Gt);return e?e.store.dispatch:qt},Jt=()=>{},Yt=()=>Jt,Xt=(e,t)=>e===t;function R(e){var t=(0,N.useContext)(Gt),n=(0,N.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:Jt,[t,e]);return(0,Kt.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Yt,t?t.store.getState:Jt,t?t.store.getState:Jt,n,Xt)}var Zt=e=>e.legend.settings,Qt=e=>e.legend.size;m([e=>e.legend.payload,Zt],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?k(r,n):r});function $t(e,t){return an(e)||rn(e,t)||tn(e,t)||en()}function en(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tn(e,t){if(e){if(typeof e==`string`)return nn(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nn(e,t):void 0}}function nn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rn(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function an(e){if(Array.isArray(e))return e}var on=1;function sn(e,t){return Math.abs(e.height-t.height)>on||Math.abs(e.left-t.left)>on||Math.abs(e.top-t.top)>on||Math.abs(e.width-t.width)>on}function cn(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function ln(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=$t((0,N.useState)({height:0,left:0,top:0,width:0}),2),n=t[0],r=t[1],i=(0,N.useRef)(null),a=(0,N.useRef)(n);a.current=n;var o=(0,N.useCallback)(e=>{if(i.current!=null&&(i.current.disconnect(),i.current=null),e!=null){var t=cn(e);if(sn(t,a.current)&&r(t),typeof ResizeObserver<`u`){var n=new ResizeObserver(()=>{var t=cn(e);sn(t,a.current)&&r(t)});n.observe(e),i.current=n}}},[...e]);return(0,N.useEffect)(()=>()=>{var e;(e=i.current)==null||e.disconnect()},[]),[n,o]}var un=M({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),dn=un.actions,fn=dn.setMargin,pn=dn.setLayout,mn=dn.setChartSize,hn=dn.setScale,gn=un.reducer;function _n(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function z(e){return Number.isFinite(e)}function vn(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yn(Object(n),!0).forEach(function(t){xn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xn(e,t,n){return(t=Sn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sn(e){var t=Cn(e,`string`);return typeof t==`symbol`?t:t+``}function Cn(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function B(e,t,n){return I(e)||I(t)?n:mt(t)?ge(e,t,n):typeof t==`function`?t(e):n}var wn=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout,c=t.position,l=t.offset,u=l===void 0?0:l;if(c!=null){if(Mt(c)){if(c===`top`&&F(e.top))return bn(bn({},e),{},{top:e.top+(i||0)+u});if(c===`bottom`&&F(e.bottom))return bn(bn({},e),{},{bottom:e.bottom+(i||0)+u});if(c===`left`&&F(e.left))return bn(bn({},e),{},{left:e.left+(r||0)+u});if(c===`right`&&F(e.right))return bn(bn({},e),{},{right:e.right+(r||0)+u})}return e}if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&F(e[a]))return bn(bn({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&F(e[o]))return bn(bn({},e),{},{[o]:e[o]+(i||0)})}return e},Tn=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,En=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},Dn=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,o=e.scale,s=e.realScaleType,c=e.isCategorical,l=e.categoricalDomain,u=e.tickCount,d=e.ticks,f=e.niceTicks,p=e.axisType;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?dt(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return z(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(St):c&&l?l.map((e,t)=>{var n=o.map(e);return z(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(St):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return z(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(St):o.domain().map((e,t)=>{var n=o.map(e);return z(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(St)},On={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=ft(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:A,none:s,silhouette:te,wiggle:_,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=ft(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},kn=(e,t,n)=>{var r=On[n]??s,i=ne().keys(t).value((e,t)=>Number(B(e,t,0))).order(w).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=B(e[i],t[r],0);Array.isArray(a)&&a.length===2&&F(a[0])&&F(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function An(e){return e==null?void 0:String(e)}function jn(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!I(i[t.dataKey])){var s=bt(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=B(i,I(o)?t.dataKey:o),l=t.scale.map(c);return F(l)?l:null}var Mn=e=>{var t=e.flat(2).filter(F);return[Math.min(...t),Math.max(...t)]},Nn=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Pn=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return Nn(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=Mn(_n(r,t,n));return!z(i[0])||!z(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},Fn=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,In=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ln=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=k(t,e=>e.coordinate),a=[],o=0,s=1,c=i.length;s<c;s++){var l=(i[s]?.coordinate||0)-(i[s-1]?.coordinate||0);a.push(l),o=Math.max(l,o)}var u=o*1e-4,d=1/0;for(var f of a)f>u&&(d=Math.min(f,d));return d===1/0?0:d}return n?void 0:0};function Rn(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return bn(bn({},t),{},{dataKey:n,payload:r,value:i,name:a})}function zn(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var Bn=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},Vn=(e,t)=>t===`centric`?e.angle:e.radius,Hn=e=>e.layout.width,Un=e=>e.layout.height,Wn=e=>e.layout.scale,Gn=e=>e.layout.margin,Kn=m(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),qn=m(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Jn=`data-recharts-item-index`;function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yn(Object(n),!0).forEach(function(t){Zn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zn(e,t,n){return(t=Qn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qn(e){var t=$n(e,`string`);return typeof t==`symbol`?t:t+``}function $n(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var er=e=>e.brush.height;function tr(e){return qn(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function nr(e){return qn(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function rr(e){return Kn(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}function ir(e){return Kn(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}var V=m([Hn,Un,Gn,er,tr,nr,rr,ir,Zt,Qt],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=Xn(Xn({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=wn(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return Xn(Xn({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),ar=m(V,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),or=m(Hn,Un,(e,t)=>({x:0,y:0,width:e,height:t})),sr=(0,N.createContext)(null),cr=()=>(0,N.useContext)(sr)!=null,lr=e=>e.brush,ur=m([lr,V,Gn],(e,t,n)=>({height:e.height,x:F(e.x)?e.x:t.left,y:F(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:F(e.width)?e.width:t.width})),dr=!0,fr=function(e,t){var n=[...arguments].slice(2);if(dr&&typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},pr={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},mr=(e,t,n)=>{var r=n.width,i=r===void 0?pr.width:r,a=n.height,o=a===void 0?pr.height:a,s=n.aspect,c=n.maxHeight,l=pt(i)?e:Number(i),u=pt(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},hr={width:0,height:0,overflow:`visible`},gr={width:0,overflowX:`visible`},_r={height:0,overflowY:`visible`},vr={},yr=e=>{var t=e.width,n=e.height,r=pt(t),i=pt(n);return r&&i?hr:r?gr:i?_r:vr};function br(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=pr.width,a=pr.height):i===void 0?i=r&&r>0?void 0:pr.width:a===void 0&&(a=r&&r>0?void 0:pr.height),{width:i,height:a}}var xr=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function Sr(){return Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sr.apply(null,arguments)}function Cr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Cr(Object(n),!0).forEach(function(t){Tr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tr(e,t,n){return(t=Er(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Er(e){var t=Dr(e,`string`);return typeof t==`symbol`?t:t+``}function Dr(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Or(e,t){return Nr(e)||Mr(e,t)||Ar(e,t)||kr()}function kr(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ar(e,t){if(e){if(typeof e==`string`)return jr(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jr(e,t):void 0}}function jr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Mr(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Nr(e){if(Array.isArray(e))return e}function Pr(e,t){if(e==null)return{};var n,r,i=Fr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ir=(0,N.createContext)(pr.initialDimension);function Lr(e){return vn(e.width)&&vn(e.height)}function Rr(e){var t=e.children,n=e.width,r=e.height,i=(0,N.useMemo)(()=>({width:n,height:r}),[n,r]);return Lr(i)?N.createElement(Ir.Provider,{value:i},t):null}var zr=()=>(0,N.useContext)(Ir),Br=(0,N.forwardRef)((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?pr.initialDimension:r,a=e.width,o=e.height,s=e.minWidth,c=s===void 0?pr.minWidth:s,l=e.minHeight,u=e.maxHeight,d=e.children,f=e.debounce,p=f===void 0?pr.debounce:f,m=e.id,h=e.className,g=e.onResize,_=e.style,v=_===void 0?{}:_,y=Pr(e,xr),b=(0,N.useRef)(null),x=(0,N.useRef)();x.current=g,(0,N.useImperativeHandle)(t,()=>b.current);var S=Or((0,N.useState)({containerWidth:i.width,containerHeight:i.height}),2),w=S[0],T=S[1],E=(0,N.useCallback)((e,t)=>{T(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,N.useEffect)(()=>{if(b.current==null||typeof ResizeObserver>`u`)return Ct;var e=e=>{var t,n=e[0];if(n!=null){var r=n.contentRect,i=r.width,a=r.height;E(i,a),(t=x.current)==null||t.call(x,i,a)}};p>0&&(e=C(e,p,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=b.current.getBoundingClientRect(),r=n.width,i=n.height;return E(r,i),t.observe(b.current),()=>{t.disconnect()}},[E,p]);var D=w.containerWidth,ee=w.containerHeight;fr(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var O=mr(D,ee,{width:a,height:o,aspect:n,maxHeight:u}),k=O.calculatedWidth,A=O.calculatedHeight;return fr(D<0||ee<0||k!=null&&k>0||A!=null&&A>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
4
4
|
please check the style of container, or the props width(%s) and height(%s),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gt as e}from"./vendor-utils-D17P9mkD.js";export default e();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,T as t,w as n}from"./index-DLmOvLdX.js";export{n as setSystemLocale,t as setSystemTimeZone};
|