zen-gitsync 2.18.3 → 2.18.4

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.
Files changed (45) hide show
  1. package/README.md +6 -6
  2. package/package.json +3 -2
  3. package/src/cli/ai/modelSetup.js +120 -7
  4. package/src/cli/ai/modelSetup.test.js +157 -0
  5. package/src/ui/public/assets/{AgentView-juB5wmpE.js → AgentView-0eP_Qb7Z.js} +1 -1
  6. package/src/ui/public/assets/{AppVersionBadge-BDi3TXTG.js → AppVersionBadge-sYoxE7hr.js} +2 -2
  7. package/src/ui/public/assets/{BranchSelector-B8hW4D64.js → BranchSelector-BJyAmmrt.js} +1 -1
  8. package/src/ui/public/assets/{CommitForm-epNRsZc3.js → CommitForm-DY6P1_B2.js} +1 -1
  9. package/src/ui/public/assets/{CommonDialog-CTbNV8Wg.js → CommonDialog-9td95UkD.js} +1 -1
  10. package/src/ui/public/assets/{CopySessionButton-DEFGS3YY.js → CopySessionButton-De46dtzF.js} +1 -1
  11. package/src/ui/public/assets/EditorView-B2uGxtRE.js +1 -0
  12. package/src/ui/public/assets/{EditorView-Cf9u2vkM.css → EditorView-C4eN80vi.css} +1 -1
  13. package/src/ui/public/assets/{FlowExecutionViewer-BEip7kmz.js → FlowExecutionViewer-BhgFKaIR.js} +1 -1
  14. package/src/ui/public/assets/{FlowOrchestrationWorkspace-Bsszwf6-.js → FlowOrchestrationWorkspace-DQpWyRai.js} +1 -1
  15. package/src/ui/public/assets/{LogList-EfGFN896.js → LogList-uk1cDDEM.js} +1 -1
  16. package/src/ui/public/assets/{MindmapView-BM81SZBC.js → MindmapView-Cjk4g62c.js} +1 -1
  17. package/src/ui/public/assets/{MonitorView-D6yTQA3g.js → MonitorView-BzjrUh7I.js} +1 -1
  18. package/src/ui/public/assets/{ProjectStartupButton-DFgM7Pgz.js → ProjectStartupButton-C0nPW6ku.js} +1 -1
  19. package/src/ui/public/assets/{RecentDirectoriesChat-CeAb-DSk.js → RecentDirectoriesChat-DN7CtUV6.js} +1 -1
  20. package/src/ui/public/assets/{RemoteManagerDialog-C7pqRpzl.js → RemoteManagerDialog-5JJITbBA.js} +1 -1
  21. package/src/ui/public/assets/{RemoteRepoCard-BZcV9S8Z.js → RemoteRepoCard-BAksLs0D.js} +1 -1
  22. package/src/ui/public/assets/{SourceMapView-Bo7xTfCi.js → SourceMapView-IGoZ_15F.js} +1 -1
  23. package/src/ui/public/assets/{SvgIcon-_bACg8fN.js → SvgIcon-BPexLObf.js} +1 -1
  24. package/src/ui/public/assets/{UserInputNode-Cfzi_G75.js → UserInputNode-Bi7sIefa.js} +1 -1
  25. package/src/ui/public/assets/{WorkbenchView-Ifx4f8MG.js → WorkbenchView-CMsyIBYe.js} +2 -2
  26. package/src/ui/public/assets/{WorkbenchView-5tjrtuRX.css → WorkbenchView-PaqqcDj9.css} +1 -1
  27. package/src/ui/public/assets/{_plugin-vue_export-helper-BXpA-5RR.js → _plugin-vue_export-helper-BO6qa5C3.js} +5 -5
  28. package/src/ui/public/assets/{agentConversations-vfZW1S6H.js → agentConversations-mDAcOgXq.js} +1 -1
  29. package/src/ui/public/assets/{configStore-BpKN8VOg.js → configStore-D_CFFOs9.js} +1 -1
  30. package/src/ui/public/assets/{dagre-56EqSb7a.js → dagre-Cnlh8k5K.js} +3 -3
  31. package/src/ui/public/assets/{element-plus-DAeQkmsV.js → element-plus-CNJIhPSG.js} +1 -1
  32. package/src/ui/public/assets/{flow-mindmap-DSMXo-RP.js → flow-mindmap-DdKeBM_G.js} +1 -1
  33. package/src/ui/public/assets/index-BsHc5Rxd.js +57 -0
  34. package/src/ui/public/assets/index-CUvENjYd.css +1 -0
  35. package/src/ui/public/assets/{monaco-iQW4tGZA.js → monaco-Cs1I4pfm.js} +1 -1
  36. package/src/ui/public/assets/{office-docx-CX5czsEV.js → office-docx-DmRJb9rE.js} +1 -1
  37. package/src/ui/public/assets/{office-excel-D4925wfu.js → office-excel-DavLx3AP.js} +1 -1
  38. package/src/ui/public/assets/{office-pptx-92XfuytY.js → office-pptx-DYg4i8gh.js} +1 -1
  39. package/src/ui/public/assets/{vendor-DpIR4Sxg.css → vendor-B3_-csNx.css} +1 -1
  40. package/src/ui/public/assets/{vendor-ytAMhfHM.js → vendor-Dtqsc1If.js} +4 -4
  41. package/src/ui/public/assets/{vue-flow-COq_ygQX.js → vue-flow-3t3hqiSq.js} +1 -1
  42. package/src/ui/public/index.html +13 -13
  43. package/src/ui/public/assets/EditorView-BFAjQLzT.js +0 -1
  44. package/src/ui/public/assets/index-DDofdm66.js +0 -57
  45. package/src/ui/public/assets/index-DnNE9KX8.css +0 -1
@@ -1,4 +1,4 @@
1
- import{$n as e,Bn as t,Cr as n,Dn as r,En as i,Fn as a,Gn as o,Hn as s,In as c,Jn as l,Jr as u,Kn as d,Kr as f,Ln as p,Mn as m,Nn as h,Nr as g,On as _,Qn as v,Sr as y,Tn as b,Tr as x,Un as S,Vn as C,Xn as w,Yn as T,Zn as E,Zr as D,_r as O,ar as k,bn as A,br as j,dr as M,er as N,fr as P,gr as F,hr as I,ir as L,kn as R,lr as z,mr as B,nr as V,or as H,qr as ee,sr as U,tr as W,ur as te,vr as ne,wn as G,wr as K,yr as q,zn as re}from"./element-plus-DAeQkmsV.js";P(),re(),g();function ie(e){return M()?(F(e),!0):!1}function ae(e){return typeof e==`function`?e():x(e)}var oe=typeof window<`u`&&typeof document<`u`,se=e=>e!==void 0,ce=Object.prototype.toString,le=e=>ce.call(e)===`[object Object]`,ue=()=>{};function de(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var fe=e=>e();function pe(e=fe){let t=q(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:ne(t),pause:n,resume:r,eventFilter:(...n)=>{t.value&&e(...n)}}}function me(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function he(e,t,n={}){let{eventFilter:r=fe,...i}=n;return k(e,de(r,t),i)}function ge(e,t,n={}){let{eventFilter:r,...i}=n,{eventFilter:a,pause:o,resume:s,isActive:c}=pe(r);return{stop:he(e,t,{...i,eventFilter:a}),pause:o,resume:s,isActive:c}}function _e(e,t={}){if(!B(e))return n(e);let r=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let n in e.value)r[n]=z(()=>({get(){return e.value[n]},set(r){if(ae(t.replaceRef)??!0){if(Array.isArray(e.value)){let t=[...e.value];t[n]=r,e.value=t}else{let t={...e.value,[n]:r};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}}else e.value[n]=r}}));return r}function ve(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=k(e,e=>{n(e)!==t&&(s?.(),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(me(a,o).then(()=>ae(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!B(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=k([e,r],([e,r])=>{t!==(e===r)&&(l?.(),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(me(s,c).then(()=>ae(e)).finally(()=>(l?.(),ae(e)))),Promise.race(u)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function o(e){return r(void 0,e)}function s(e){return n(Number.isNaN,e)}function c(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(ae(e))},t)}function l(e){return u(1,e)}function u(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(ae(e))?{toMatch:n,toContains:c,changed:l,changedTimes:u,get not(){return ve(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:l,changedTimes:u,get not(){return ve(e,!t)}}}function ye(e){return ve(e)}function be(e){let t=ae(e);return t?.$el??t}var xe=oe?window:void 0;function Se(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=xe):[t,n,r,i]=e,!t)return ue;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=k(()=>[be(t),ae(i)],([e,t])=>{if(o(),!e)return;let i=le(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return ie(l),l}function Ce(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function we(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=xe,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=Ce(t);return Se(i,a,e=>{e.repeat&&ae(s)||c(e)&&n(e)},o)}function Te(e){return JSON.parse(JSON.stringify(e))}function Ee(e,t,n,r={}){let{clone:i=!1,passive:a=!1,eventName:o,deep:s=!1,defaultValue:l,shouldEmit:u}=r,d=c(),f=n||d?.emit||(d?.$emit)?.bind(d)||(d?.proxy?.$emit)?.bind(d?.proxy),p=o;t||=`modelValue`,p||=`update:${t.toString()}`;let m=e=>i?typeof i==`function`?i(e):Te(e):e,h=()=>se(e[t])?m(e[t]):l,g=e=>{u?u(e)&&f(p,e):f(p,e)};if(a){let n=h(),r=q(n),i=!1;return k(()=>e[t],e=>{i||(i=!0,r.value=m(e),S(()=>i=!1))}),k(r,n=>{!i&&(n!==e[t]||s)&&g(n)},{deep:s}),r}return G({get(){return h()},set(e){g(e)}})}var De={value:()=>{}};function Oe(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new ke(n)}function ke(e){this._=e}function Ae(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}ke.prototype=Oe.prototype={constructor:ke,on:function(e,t){var n=this._,r=Ae(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=je(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Me(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Me(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ke(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function je(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Me(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=De,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ne=`http://www.w3.org/1999/xhtml`,Pe={svg:`http://www.w3.org/2000/svg`,xhtml:Ne,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Fe(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Pe.hasOwnProperty(t)?{space:Pe[t],local:e}:e}function Ie(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ne&&t.documentElement.namespaceURI===Ne?t.createElement(e):t.createElementNS(n,e)}}function Le(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Re(e){var t=Fe(e);return(t.local?Le:Ie)(t)}function ze(){}function Be(e){return e==null?ze:function(){return this.querySelector(e)}}function Ve(e){typeof e!=`function`&&(e=Be(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new An(r,this._parents)}function He(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ue(){return[]}function We(e){return e==null?Ue:function(){return this.querySelectorAll(e)}}function Ge(e){return function(){return He(e.apply(this,arguments))}}function Ke(e){e=typeof e==`function`?Ge(e):We(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new An(r,i)}function qe(e){return function(){return this.matches(e)}}function Je(e){return function(t){return t.matches(e)}}var Ye=Array.prototype.find;function Xe(e){return function(){return Ye.call(this.children,e)}}function Ze(){return this.firstElementChild}function Qe(e){return this.select(e==null?Ze:Xe(typeof e==`function`?e:Je(e)))}var $e=Array.prototype.filter;function et(){return Array.from(this.children)}function tt(e){return function(){return $e.call(this.children,e)}}function nt(e){return this.selectAll(e==null?et:tt(typeof e==`function`?e:Je(e)))}function rt(e){typeof e!=`function`&&(e=qe(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new An(r,this._parents)}function it(e){return Array(e.length)}function at(){return new An(this._enter||this._groups.map(it),this._parents)}function ot(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ot.prototype={constructor:ot,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function st(e){return function(){return e}}function ct(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new ot(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function lt(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new ot(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function ut(e){return e.__data__}function dt(e,t){if(!arguments.length)return Array.from(this,ut);var n=t?lt:ct,r=this._parents,i=this._groups;typeof e!=`function`&&(e=st(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=ft(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new An(o,r),o._enter=s,o._exit=c,o}function ft(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function pt(){return new An(this._exit||this._groups.map(it),this._parents)}function mt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function ht(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new An(s,this._parents)}function gt(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function _t(e){e||=vt;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new An(i,this._parents).order()}function vt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function yt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function bt(){return Array.from(this)}function xt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function St(){let e=0;for(let t of this)++e;return e}function Ct(){return!this.node()}function wt(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Tt(e){return function(){this.removeAttribute(e)}}function Et(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dt(e,t){return function(){this.setAttribute(e,t)}}function Ot(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function kt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function At(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function jt(e,t){var n=Fe(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Et:Tt:typeof t==`function`?n.local?At:kt:n.local?Ot:Dt)(n,t))}function Mt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Nt(e){return function(){this.style.removeProperty(e)}}function Pt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ft(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function It(e,t,n){return arguments.length>1?this.each((t==null?Nt:typeof t==`function`?Ft:Pt)(e,t,n??``)):Lt(this.node(),e)}function Lt(e,t){return e.style.getPropertyValue(t)||Mt(e).getComputedStyle(e,null).getPropertyValue(t)}function Rt(e){return function(){delete this[e]}}function zt(e,t){return function(){this[e]=t}}function Bt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Vt(e,t){return arguments.length>1?this.each((t==null?Rt:typeof t==`function`?Bt:zt)(e,t)):this.node()[e]}function Ht(e){return e.trim().split(/^|\s+/)}function Ut(e){return e.classList||new Wt(e)}function Wt(e){this._node=e,this._names=Ht(e.getAttribute(`class`)||``)}Wt.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Gt(e,t){for(var n=Ut(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Kt(e,t){for(var n=Ut(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function qt(e){return function(){Gt(this,e)}}function Jt(e){return function(){Kt(this,e)}}function Yt(e,t){return function(){(t.apply(this,arguments)?Gt:Kt)(this,e)}}function Xt(e,t){var n=Ht(e+``);if(arguments.length<2){for(var r=Ut(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Yt:t?qt:Jt)(n,t))}function Zt(){this.textContent=``}function Qt(e){return function(){this.textContent=e}}function $t(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function en(e){return arguments.length?this.each(e==null?Zt:(typeof e==`function`?$t:Qt)(e)):this.node().textContent}function tn(){this.innerHTML=``}function nn(e){return function(){this.innerHTML=e}}function rn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function an(e){return arguments.length?this.each(e==null?tn:(typeof e==`function`?rn:nn)(e)):this.node().innerHTML}function on(){this.nextSibling&&this.parentNode.appendChild(this)}function sn(){return this.each(on)}function cn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ln(){return this.each(cn)}function un(e){var t=typeof e==`function`?e:Re(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dn(){return null}function fn(e,t){var n=typeof e==`function`?e:Re(e),r=t==null?dn:typeof t==`function`?t:Be(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function pn(){var e=this.parentNode;e&&e.removeChild(this)}function mn(){return this.each(pn)}function hn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _n(e){return this.select(e?gn:hn)}function vn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function yn(e){return function(t){e.call(this,t,this.__data__)}}function bn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function xn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Sn(e,t,n){return function(){var r=this.__on,i,a=yn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Cn(e,t,n){var r=bn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Sn:xn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function wn(e,t,n){var r=Mt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Tn(e,t){return function(){return wn(this,e,t)}}function En(e,t){return function(){return wn(this,e,t.apply(this,arguments))}}function Dn(e,t){return this.each((typeof t==`function`?En:Tn)(e,t))}function*On(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var kn=[null];function An(e,t){this._groups=e,this._parents=t}function jn(){return new An([[document.documentElement]],kn)}function Mn(){return this}An.prototype=jn.prototype={constructor:An,select:Ve,selectAll:Ke,selectChild:Qe,selectChildren:nt,filter:rt,data:dt,enter:at,exit:pt,join:mt,merge:ht,selection:Mn,order:gt,sort:_t,call:yt,nodes:bt,node:xt,size:St,empty:Ct,each:wt,attr:jt,style:It,property:Vt,classed:Xt,text:en,html:an,raise:sn,lower:ln,append:un,insert:fn,remove:mn,clone:_n,datum:vn,on:Cn,dispatch:Dn,[Symbol.iterator]:On};function Nn(e){return typeof e==`string`?new An([[document.querySelector(e)]],[document.documentElement]):new An([[e]],kn)}function Pn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Fn(e,t){if(e=Pn(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var In={passive:!1},Ln={capture:!0,passive:!1};function Rn(e){e.stopImmediatePropagation()}function zn(e){e.preventDefault(),e.stopImmediatePropagation()}function Bn(e){var t=e.document.documentElement,n=Nn(e).on(`dragstart.drag`,zn,Ln);`onselectstart`in t?n.on(`selectstart.drag`,zn,Ln):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Vn(e,t){var n=e.document.documentElement,r=Nn(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,zn,Ln),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Hn=e=>()=>e;function Un(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Un.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Wn(e){return!e.ctrlKey&&!e.button}function Gn(){return this.parentNode}function Kn(e,t){return t??{x:e.x,y:e.y}}function qn(){return navigator.maxTouchPoints||`ontouchstart`in this}function Jn(){var e=Wn,t=Gn,n=Kn,r=qn,i={},a=Oe(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,In).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(Nn(n.view).on(`mousemove.drag`,m,Ln).on(`mouseup.drag`,h,Ln),Bn(n.view),Rn(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(zn(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Nn(e.view).on(`mousemove.drag mouseup.drag`,null),Vn(e.view,l),zn(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Rn(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(zn(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Rn(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Fn(l||r,t),p,m,h;if((h=n.call(e,new Un(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Fn(l||a,t),_=o}u.call(r,e,new Un(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Hn(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Hn(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Hn(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Hn(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Yn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Xn(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Zn(){}var Qn=.7,$n=1/Qn,er=`\\s*([+-]?\\d+)\\s*`,tr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,nr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,rr=/^#([0-9a-f]{3,8})$/,ir=RegExp(`^rgb\\(${er},${er},${er}\\)$`),ar=RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`),or=RegExp(`^rgba\\(${er},${er},${er},${tr}\\)$`),sr=RegExp(`^rgba\\(${nr},${nr},${nr},${tr}\\)$`),cr=RegExp(`^hsl\\(${tr},${nr},${nr}\\)$`),lr=RegExp(`^hsla\\(${tr},${nr},${nr},${tr}\\)$`),ur={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Yn(Zn,hr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dr,formatHex:dr,formatHex8:fr,formatHsl:pr,formatRgb:mr,toString:mr});function dr(){return this.rgb().formatHex()}function fr(){return this.rgb().formatHex8()}function pr(){return Or(this).formatHsl()}function mr(){return this.rgb().formatRgb()}function hr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=rr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?gr(t):n===3?new br(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_r(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_r(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ir.exec(e))?new br(t[1],t[2],t[3],1):(t=ar.exec(e))?new br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=or.exec(e))?_r(t[1],t[2],t[3],t[4]):(t=sr.exec(e))?_r(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cr.exec(e))?Dr(t[1],t[2]/100,t[3]/100,1):(t=lr.exec(e))?Dr(t[1],t[2]/100,t[3]/100,t[4]):ur.hasOwnProperty(e)?gr(ur[e]):e===`transparent`?new br(NaN,NaN,NaN,0):null}function gr(e){return new br(e>>16&255,e>>8&255,e&255,1)}function _r(e,t,n,r){return r<=0&&(e=t=n=NaN),new br(e,t,n,r)}function vr(e){return e instanceof Zn||(e=hr(e)),e?(e=e.rgb(),new br(e.r,e.g,e.b,e.opacity)):new br}function yr(e,t,n,r){return arguments.length===1?vr(e):new br(e,t,n,r??1)}function br(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Yn(br,yr,Xn(Zn,{brighter(e){return e=e==null?$n:$n**+e,new br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qn:Qn**+e,new br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new br(Tr(this.r),Tr(this.g),Tr(this.b),wr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xr,formatHex:xr,formatHex8:Sr,formatRgb:Cr,toString:Cr}));function xr(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}`}function Sr(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}${Er((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cr(){let e=wr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Tr(this.r)}, ${Tr(this.g)}, ${Tr(this.b)}${e===1?`)`:`, ${e})`}`}function wr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Er(e){return e=Tr(e),(e<16?`0`:``)+e.toString(16)}function Dr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ar(e,t,n,r)}function Or(e){if(e instanceof Ar)return new Ar(e.h,e.s,e.l,e.opacity);if(e instanceof Zn||(e=hr(e)),!e)return new Ar;if(e instanceof Ar)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Ar(o,s,c,e.opacity)}function kr(e,t,n,r){return arguments.length===1?Or(e):new Ar(e,t,n,r??1)}function Ar(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Yn(Ar,kr,Xn(Zn,{brighter(e){return e=e==null?$n:$n**+e,new Ar(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qn:Qn**+e,new Ar(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new br(Nr(e>=240?e-240:e+120,i,r),Nr(e,i,r),Nr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ar(jr(this.h),Mr(this.s),Mr(this.l),wr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=wr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${jr(this.h)}, ${Mr(this.s)*100}%, ${Mr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function jr(e){return e=(e||0)%360,e<0?e+360:e}function Mr(e){return Math.max(0,Math.min(1,e||0))}function Nr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Pr=e=>()=>e;function Fr(e,t){return function(n){return e+n*t}}function Ir(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Lr(e){return(e=+e)==1?Rr:function(t,n){return n-t?Ir(t,n,e):Pr(isNaN(t)?n:t)}}function Rr(e,t){var n=t-e;return n?Fr(e,n):Pr(isNaN(e)?t:e)}var zr=function e(t){var n=Lr(t);function r(e,t){var r=n((e=yr(e)).r,(t=yr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Rr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1);function Br(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Vr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hr(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=Zr(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Ur(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Wr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Gr(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Zr(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Kr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qr=new RegExp(Kr.source,`g`);function Jr(e){return function(){return e}}function Yr(e){return function(t){return e(t)+``}}function Xr(e,t){var n=Kr.lastIndex=qr.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Kr.exec(e))&&(i=qr.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Wr(r,i)})),n=qr.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Yr(c[0].x):Jr(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Zr(e,t){var n=typeof t,r;return t==null||n===`boolean`?Pr(t):(n===`number`?Wr:n===`string`?(r=hr(t))?(t=r,zr):Xr:t instanceof hr?zr:t instanceof Date?Ur:Vr(t)?Br:Array.isArray(t)?Hr:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Gr:Wr)(e,t)}var Qr=180/Math.PI,$r={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ei(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Qr,skewX:Math.atan(c)*Qr,scaleX:o,scaleY:s}}var ti;function ni(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?$r:ei(t.a,t.b,t.c,t.d,t.e,t.f)}function ri(e){return e==null||(ti||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ti.setAttribute(`transform`,e),!(e=ti.transform.baseVal.consolidate()))?$r:(e=e.matrix,ei(e.a,e.b,e.c,e.d,e.e,e.f))}function ii(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Wr(e,i)},{i:c-2,x:Wr(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Wr(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Wr(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Wr(e,n)},{i:s-2,x:Wr(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var ai=ii(ni,`px, `,`px)`,`deg)`),oi=ii(ri,`, `,`)`,`)`),si=1e-12;function ci(e){return((e=Math.exp(e))+1/e)/2}function li(e){return((e=Math.exp(e))-1/e)/2}function ui(e){return((e=Math.exp(2*e))-1)/(e+1)}var di=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<si)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=ci(y),c=s/(n*g)*(i*ui(t*r+y)-li(y));return[a+c*d,o+c*f,s*i/ci(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),fi=0,pi=0,mi=0,hi=1e3,gi,_i,vi=0,yi=0,bi=0,xi=typeof performance==`object`&&performance.now?performance:Date,Si=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ci(){return yi||=(Si(wi),xi.now()+bi)}function wi(){yi=0}function Ti(){this._call=this._time=this._next=null}Ti.prototype=Ei.prototype={constructor:Ti,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ci():+n)+(t==null?0:+t),!this._next&&_i!==this&&(_i?_i._next=this:gi=this,_i=this),this._call=e,this._time=n,ji()},stop:function(){this._call&&(this._call=null,this._time=1/0,ji())}};function Ei(e,t,n){var r=new Ti;return r.restart(e,t,n),r}function Di(){Ci(),++fi;for(var e=gi,t;e;)(t=yi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fi}function Oi(){yi=(vi=xi.now())+bi,fi=pi=0;try{Di()}finally{fi=0,Ai(),yi=0}}function ki(){var e=xi.now(),t=e-vi;t>hi&&(bi-=t,vi=e)}function Ai(){for(var e,t=gi,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:gi=n);_i=e,ji(r)}function ji(e){fi||(pi&&=clearTimeout(pi),e-yi>24?(e<1/0&&(pi=setTimeout(Oi,e-xi.now()-bi)),mi&&=clearInterval(mi)):(mi||=(vi=xi.now(),setInterval(ki,hi)),fi=1,Si(Oi)))}function Mi(e,t,n){var r=new Ti;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Ni=Oe(`start`,`end`,`cancel`,`interrupt`),Pi=[],Fi=0,Ii=1,Li=2,Ri=3,zi=4,Bi=5,Vi=6;function Hi(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Ki(e,n,{name:t,index:r,group:i,on:Ni,tween:Pi,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Fi})}function Ui(e,t){var n=Gi(e,t);if(n.state>Fi)throw Error(`too late; already scheduled`);return n}function Wi(e,t){var n=Gi(e,t);if(n.state>Ri)throw Error(`too late; already running`);return n}function Gi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Ki(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Ei(a,0,n.time);function a(e){n.state=Ii,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Ii)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===Ri)return Mi(o);f.state===zi?(f.state=Vi,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=Vi,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Mi(function(){n.state===Ri&&(n.state=zi,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=Li,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===Li){for(n.state=Ri,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=Bi,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===Bi&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=Vi,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function qi(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Li&&r.state<Bi,r.state=Vi,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Ji(e){return this.each(function(){qi(this,e)})}function Yi(e,t){var n,r;return function(){var i=Wi(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Xi(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Wi(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Zi(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Gi(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Yi:Xi)(n,e,t))}function Qi(e,t,n){var r=e._id;return e.each(function(){var e=Wi(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Gi(e,r).value[t]}}function $i(e,t){var n;return(typeof t==`number`?Wr:t instanceof hr?zr:(n=hr(t))?(t=n,zr):Xr)(e,t)}function ea(e){return function(){this.removeAttribute(e)}}function ta(e){return function(){this.removeAttributeNS(e.space,e.local)}}function na(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function ra(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ia(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function aa(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function oa(e,t){var n=Fe(e),r=n===`transform`?oi:$i;return this.attrTween(e,typeof t==`function`?(n.local?aa:ia)(n,r,Qi(this,`attr.`+e,t)):t==null?(n.local?ta:ea)(n):(n.local?ra:na)(n,r,t))}function sa(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ca(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function la(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ca(e,i)),n}return i._value=t,i}function ua(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&sa(e,i)),n}return i._value=t,i}function da(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Fe(e);return this.tween(n,(r.local?la:ua)(r,t))}function fa(e,t){return function(){Ui(this,e).delay=+t.apply(this,arguments)}}function pa(e,t){return t=+t,function(){Ui(this,e).delay=t}}function ma(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?fa:pa)(t,e)):Gi(this.node(),t).delay}function ha(e,t){return function(){Wi(this,e).duration=+t.apply(this,arguments)}}function ga(e,t){return t=+t,function(){Wi(this,e).duration=t}}function _a(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ha:ga)(t,e)):Gi(this.node(),t).duration}function va(e,t){if(typeof t!=`function`)throw Error();return function(){Wi(this,e).ease=t}}function ya(e){var t=this._id;return arguments.length?this.each(va(t,e)):Gi(this.node(),t).ease}function ba(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Wi(this,e).ease=n}}function xa(e){if(typeof e!=`function`)throw Error();return this.each(ba(this._id,e))}function Sa(e){typeof e!=`function`&&(e=qe(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Za(r,this._parents,this._name,this._id)}function Ca(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Za(o,this._parents,this._name,this._id)}function wa(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Ta(e,t,n){var r,i,a=wa(t)?Ui:Wi;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ea(e,t){var n=this._id;return arguments.length<2?Gi(this.node(),n).on.on(e):this.each(Ta(n,e,t))}function Da(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Oa(){return this.on(`end.remove`,Da(this._id))}function ka(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Be(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Hi(l[f],t,n,f,l,Gi(u,n)));return new Za(a,this._parents,t,n)}function Aa(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=We(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Gi(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Hi(p,t,n,h,f,m);a.push(f),o.push(u)}return new Za(a,o,t,n)}var ja=jn.prototype.constructor;function Ma(){return new ja(this._groups,this._parents)}function Na(e,t){var n,r,i;return function(){var a=Lt(this,e),o=(this.style.removeProperty(e),Lt(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Pa(e){return function(){this.style.removeProperty(e)}}function Fa(e,t,n){var r,i=n+``,a;return function(){var o=Lt(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Ia(e,t,n){var r,i,a;return function(){var o=Lt(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Lt(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function La(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Wi(this,e),l=c.on,u=c.value[a]==null?s||=Pa(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Ra(e,t,n){var r=(e+=``)==`transform`?ai:$i;return t==null?this.styleTween(e,Na(e,r)).on(`end.style.`+e,Pa(e)):typeof t==`function`?this.styleTween(e,Ia(e,r,Qi(this,`style.`+e,t))).each(La(this._id,e)):this.styleTween(e,Fa(e,r,t),n).on(`end.style.`+e,null)}function za(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Ba(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&za(e,a,n)),r}return a._value=t,a}function Va(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Ba(e,t,n??``))}function Ha(e){return function(){this.textContent=e}}function Ua(e){return function(){var t=e(this);this.textContent=t??``}}function Wa(e){return this.tween(`text`,typeof e==`function`?Ua(Qi(this,`text`,e)):Ha(e==null?``:e+``))}function Ga(e){return function(t){this.textContent=e.call(this,t)}}function Ka(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Ga(r)),t}return r._value=e,r}function qa(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Ka(e))}function Ja(){for(var e=this._name,t=this._id,n=Qa(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Gi(c,t);Hi(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Za(r,this._parents,e,n)}function Ya(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Wi(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Xa=0;function Za(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Qa(){return++Xa}var $a=jn.prototype;Za.prototype={constructor:Za,select:ka,selectAll:Aa,selectChild:$a.selectChild,selectChildren:$a.selectChildren,filter:Sa,merge:Ca,selection:Ma,transition:Ja,call:$a.call,nodes:$a.nodes,node:$a.node,size:$a.size,empty:$a.empty,each:$a.each,on:Ea,attr:oa,attrTween:da,style:Ra,styleTween:Va,text:Wa,textTween:qa,remove:Oa,tween:Zi,delay:ma,duration:_a,ease:ya,easeVarying:xa,end:Ya,[Symbol.iterator]:$a[Symbol.iterator]};function eo(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var to={time:null,delay:0,duration:250,ease:eo};function no(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ro(e){var t,n;e instanceof Za?(t=e._id,e=e._name):(t=Qa(),(n=to).time=Ci(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Hi(c,e,t,l,o,n||no(c,t));return new Za(r,this._parents,e,t)}jn.prototype.interrupt=Ji,jn.prototype.transition=ro;var io=e=>()=>e;function ao(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function oo(e,t,n){this.k=e,this.x=t,this.y=n}oo.prototype={constructor:oo,scale:function(e){return e===1?this:new oo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new oo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var so=new oo(1,0,0);oo.prototype;function co(e){e.stopImmediatePropagation()}function lo(e){e.preventDefault(),e.stopImmediatePropagation()}function uo(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function fo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function po(){return this.__zoom||so}function mo(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ho(){return navigator.maxTouchPoints||`ontouchstart`in this}function go(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function _o(){var e=uo,t=fo,n=go,r=mo,i=ho,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=di,l=Oe(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,po).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,po),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(so.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new oo(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new oo(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new oo(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Nn(this.that).datum();l.call(e,this.that,new ao(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Fn(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],qi(this),s.start();lo(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Nn(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Fn(t,i),l=t.clientX,u=t.clientY;Bn(t.view),co(t),a.mouse=[c,this.__zoom.invert(c)],qi(this),a.start();function d(e){if(lo(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Fn(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Vn(e.view,a.moved),lo(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Fn(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);lo(r),s>0?Nn(this).transition().duration(s).call(x,d,c,r):Nn(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(co(t),s=0;s<i;++s)c=r[s],l=Fn(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),qi(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(lo(e),s=0;s<a;++s)c=i[s],l=Fn(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(co(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Fn(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Nn(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:io(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:io(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:io(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:io([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var J=(e=>(e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`,e))(J||{}),vo=(e=>(e.Partial=`partial`,e.Full=`full`,e))(vo||{}),yo=(e=>(e.Bezier=`default`,e.SimpleBezier=`simple-bezier`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e))(yo||{}),bo=(e=>(e.Strict=`strict`,e.Loose=`loose`,e))(bo||{}),xo=(e=>(e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`,e))(xo||{}),So=(e=>(e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e))(So||{}),Co=(e=>(e.TopLeft=`top-left`,e.TopCenter=`top-center`,e.TopRight=`top-right`,e.BottomLeft=`bottom-left`,e.BottomCenter=`bottom-center`,e.BottomRight=`bottom-right`,e))(Co||{}),wo=[`INPUT`,`SELECT`,`TEXTAREA`],To=typeof document<`u`?document:null;function Eo(e){let t=e.composedPath?.call(e)?.[0]||e.target,n=typeof t?.hasAttribute==`function`&&t.hasAttribute(`contenteditable`),r=typeof t?.closest==`function`?t.closest(`.nokey`):null;return wo.includes(t?.nodeName)||n||!!r}function Do(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Oo(e,t,n,r){let i=t.replace(`+`,`
1
+ import{$n as e,Bn as t,Cr as n,Dn as r,En as i,Fn as a,Gn as o,Hn as s,In as c,Jn as l,Jr as u,Kn as d,Kr as f,Ln as p,Mn as m,Nn as h,Nr as g,On as _,Qn as v,Sr as y,Tn as b,Tr as x,Un as S,Vn as C,Xn as w,Yn as T,Zn as E,Zr as D,_r as O,ar as k,bn as A,br as j,dr as M,er as N,fr as P,gr as F,hr as I,ir as L,kn as R,lr as z,mr as B,nr as V,or as H,qr as ee,sr as U,tr as W,ur as te,vr as ne,wn as G,wr as K,yr as q,zn as re}from"./element-plus-CNJIhPSG.js";P(),re(),g();function ie(e){return M()?(F(e),!0):!1}function ae(e){return typeof e==`function`?e():x(e)}var oe=typeof window<`u`&&typeof document<`u`,se=e=>e!==void 0,ce=Object.prototype.toString,le=e=>ce.call(e)===`[object Object]`,ue=()=>{};function de(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var fe=e=>e();function pe(e=fe){let t=q(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:ne(t),pause:n,resume:r,eventFilter:(...n)=>{t.value&&e(...n)}}}function me(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function he(e,t,n={}){let{eventFilter:r=fe,...i}=n;return k(e,de(r,t),i)}function ge(e,t,n={}){let{eventFilter:r,...i}=n,{eventFilter:a,pause:o,resume:s,isActive:c}=pe(r);return{stop:he(e,t,{...i,eventFilter:a}),pause:o,resume:s,isActive:c}}function _e(e,t={}){if(!B(e))return n(e);let r=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let n in e.value)r[n]=z(()=>({get(){return e.value[n]},set(r){if(ae(t.replaceRef)??!0){if(Array.isArray(e.value)){let t=[...e.value];t[n]=r,e.value=t}else{let t={...e.value,[n]:r};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}}else e.value[n]=r}}));return r}function ve(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=k(e,e=>{n(e)!==t&&(s?.(),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(me(a,o).then(()=>ae(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!B(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=k([e,r],([e,r])=>{t!==(e===r)&&(l?.(),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(me(s,c).then(()=>ae(e)).finally(()=>(l?.(),ae(e)))),Promise.race(u)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function o(e){return r(void 0,e)}function s(e){return n(Number.isNaN,e)}function c(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(ae(e))},t)}function l(e){return u(1,e)}function u(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(ae(e))?{toMatch:n,toContains:c,changed:l,changedTimes:u,get not(){return ve(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:l,changedTimes:u,get not(){return ve(e,!t)}}}function ye(e){return ve(e)}function be(e){let t=ae(e);return t?.$el??t}var xe=oe?window:void 0;function Se(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=xe):[t,n,r,i]=e,!t)return ue;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=k(()=>[be(t),ae(i)],([e,t])=>{if(o(),!e)return;let i=le(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return ie(l),l}function Ce(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function we(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=xe,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=Ce(t);return Se(i,a,e=>{e.repeat&&ae(s)||c(e)&&n(e)},o)}function Te(e){return JSON.parse(JSON.stringify(e))}function Ee(e,t,n,r={}){let{clone:i=!1,passive:a=!1,eventName:o,deep:s=!1,defaultValue:l,shouldEmit:u}=r,d=c(),f=n||d?.emit||(d?.$emit)?.bind(d)||(d?.proxy?.$emit)?.bind(d?.proxy),p=o;t||=`modelValue`,p||=`update:${t.toString()}`;let m=e=>i?typeof i==`function`?i(e):Te(e):e,h=()=>se(e[t])?m(e[t]):l,g=e=>{u?u(e)&&f(p,e):f(p,e)};if(a){let n=h(),r=q(n),i=!1;return k(()=>e[t],e=>{i||(i=!0,r.value=m(e),S(()=>i=!1))}),k(r,n=>{!i&&(n!==e[t]||s)&&g(n)},{deep:s}),r}return G({get(){return h()},set(e){g(e)}})}var De={value:()=>{}};function Oe(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new ke(n)}function ke(e){this._=e}function Ae(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}ke.prototype=Oe.prototype={constructor:ke,on:function(e,t){var n=this._,r=Ae(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=je(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Me(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Me(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ke(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function je(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Me(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=De,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ne=`http://www.w3.org/1999/xhtml`,Pe={svg:`http://www.w3.org/2000/svg`,xhtml:Ne,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Fe(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Pe.hasOwnProperty(t)?{space:Pe[t],local:e}:e}function Ie(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ne&&t.documentElement.namespaceURI===Ne?t.createElement(e):t.createElementNS(n,e)}}function Le(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Re(e){var t=Fe(e);return(t.local?Le:Ie)(t)}function ze(){}function Be(e){return e==null?ze:function(){return this.querySelector(e)}}function Ve(e){typeof e!=`function`&&(e=Be(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new An(r,this._parents)}function He(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ue(){return[]}function We(e){return e==null?Ue:function(){return this.querySelectorAll(e)}}function Ge(e){return function(){return He(e.apply(this,arguments))}}function Ke(e){e=typeof e==`function`?Ge(e):We(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new An(r,i)}function qe(e){return function(){return this.matches(e)}}function Je(e){return function(t){return t.matches(e)}}var Ye=Array.prototype.find;function Xe(e){return function(){return Ye.call(this.children,e)}}function Ze(){return this.firstElementChild}function Qe(e){return this.select(e==null?Ze:Xe(typeof e==`function`?e:Je(e)))}var $e=Array.prototype.filter;function et(){return Array.from(this.children)}function tt(e){return function(){return $e.call(this.children,e)}}function nt(e){return this.selectAll(e==null?et:tt(typeof e==`function`?e:Je(e)))}function rt(e){typeof e!=`function`&&(e=qe(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new An(r,this._parents)}function it(e){return Array(e.length)}function at(){return new An(this._enter||this._groups.map(it),this._parents)}function ot(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ot.prototype={constructor:ot,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function st(e){return function(){return e}}function ct(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new ot(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function lt(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new ot(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function ut(e){return e.__data__}function dt(e,t){if(!arguments.length)return Array.from(this,ut);var n=t?lt:ct,r=this._parents,i=this._groups;typeof e!=`function`&&(e=st(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=ft(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new An(o,r),o._enter=s,o._exit=c,o}function ft(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function pt(){return new An(this._exit||this._groups.map(it),this._parents)}function mt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function ht(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new An(s,this._parents)}function gt(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function _t(e){e||=vt;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new An(i,this._parents).order()}function vt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function yt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function bt(){return Array.from(this)}function xt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function St(){let e=0;for(let t of this)++e;return e}function Ct(){return!this.node()}function wt(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Tt(e){return function(){this.removeAttribute(e)}}function Et(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dt(e,t){return function(){this.setAttribute(e,t)}}function Ot(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function kt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function At(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function jt(e,t){var n=Fe(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Et:Tt:typeof t==`function`?n.local?At:kt:n.local?Ot:Dt)(n,t))}function Mt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Nt(e){return function(){this.style.removeProperty(e)}}function Pt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ft(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function It(e,t,n){return arguments.length>1?this.each((t==null?Nt:typeof t==`function`?Ft:Pt)(e,t,n??``)):Lt(this.node(),e)}function Lt(e,t){return e.style.getPropertyValue(t)||Mt(e).getComputedStyle(e,null).getPropertyValue(t)}function Rt(e){return function(){delete this[e]}}function zt(e,t){return function(){this[e]=t}}function Bt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Vt(e,t){return arguments.length>1?this.each((t==null?Rt:typeof t==`function`?Bt:zt)(e,t)):this.node()[e]}function Ht(e){return e.trim().split(/^|\s+/)}function Ut(e){return e.classList||new Wt(e)}function Wt(e){this._node=e,this._names=Ht(e.getAttribute(`class`)||``)}Wt.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Gt(e,t){for(var n=Ut(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Kt(e,t){for(var n=Ut(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function qt(e){return function(){Gt(this,e)}}function Jt(e){return function(){Kt(this,e)}}function Yt(e,t){return function(){(t.apply(this,arguments)?Gt:Kt)(this,e)}}function Xt(e,t){var n=Ht(e+``);if(arguments.length<2){for(var r=Ut(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Yt:t?qt:Jt)(n,t))}function Zt(){this.textContent=``}function Qt(e){return function(){this.textContent=e}}function $t(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function en(e){return arguments.length?this.each(e==null?Zt:(typeof e==`function`?$t:Qt)(e)):this.node().textContent}function tn(){this.innerHTML=``}function nn(e){return function(){this.innerHTML=e}}function rn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function an(e){return arguments.length?this.each(e==null?tn:(typeof e==`function`?rn:nn)(e)):this.node().innerHTML}function on(){this.nextSibling&&this.parentNode.appendChild(this)}function sn(){return this.each(on)}function cn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ln(){return this.each(cn)}function un(e){var t=typeof e==`function`?e:Re(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dn(){return null}function fn(e,t){var n=typeof e==`function`?e:Re(e),r=t==null?dn:typeof t==`function`?t:Be(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function pn(){var e=this.parentNode;e&&e.removeChild(this)}function mn(){return this.each(pn)}function hn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _n(e){return this.select(e?gn:hn)}function vn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function yn(e){return function(t){e.call(this,t,this.__data__)}}function bn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function xn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Sn(e,t,n){return function(){var r=this.__on,i,a=yn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Cn(e,t,n){var r=bn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Sn:xn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function wn(e,t,n){var r=Mt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Tn(e,t){return function(){return wn(this,e,t)}}function En(e,t){return function(){return wn(this,e,t.apply(this,arguments))}}function Dn(e,t){return this.each((typeof t==`function`?En:Tn)(e,t))}function*On(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var kn=[null];function An(e,t){this._groups=e,this._parents=t}function jn(){return new An([[document.documentElement]],kn)}function Mn(){return this}An.prototype=jn.prototype={constructor:An,select:Ve,selectAll:Ke,selectChild:Qe,selectChildren:nt,filter:rt,data:dt,enter:at,exit:pt,join:mt,merge:ht,selection:Mn,order:gt,sort:_t,call:yt,nodes:bt,node:xt,size:St,empty:Ct,each:wt,attr:jt,style:It,property:Vt,classed:Xt,text:en,html:an,raise:sn,lower:ln,append:un,insert:fn,remove:mn,clone:_n,datum:vn,on:Cn,dispatch:Dn,[Symbol.iterator]:On};function Nn(e){return typeof e==`string`?new An([[document.querySelector(e)]],[document.documentElement]):new An([[e]],kn)}function Pn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Fn(e,t){if(e=Pn(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var In={passive:!1},Ln={capture:!0,passive:!1};function Rn(e){e.stopImmediatePropagation()}function zn(e){e.preventDefault(),e.stopImmediatePropagation()}function Bn(e){var t=e.document.documentElement,n=Nn(e).on(`dragstart.drag`,zn,Ln);`onselectstart`in t?n.on(`selectstart.drag`,zn,Ln):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Vn(e,t){var n=e.document.documentElement,r=Nn(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,zn,Ln),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Hn=e=>()=>e;function Un(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Un.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Wn(e){return!e.ctrlKey&&!e.button}function Gn(){return this.parentNode}function Kn(e,t){return t??{x:e.x,y:e.y}}function qn(){return navigator.maxTouchPoints||`ontouchstart`in this}function Jn(){var e=Wn,t=Gn,n=Kn,r=qn,i={},a=Oe(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,In).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(Nn(n.view).on(`mousemove.drag`,m,Ln).on(`mouseup.drag`,h,Ln),Bn(n.view),Rn(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(zn(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Nn(e.view).on(`mousemove.drag mouseup.drag`,null),Vn(e.view,l),zn(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Rn(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(zn(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Rn(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Fn(l||r,t),p,m,h;if((h=n.call(e,new Un(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Fn(l||a,t),_=o}u.call(r,e,new Un(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Hn(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Hn(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Hn(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Hn(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Yn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Xn(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Zn(){}var Qn=.7,$n=1/Qn,er=`\\s*([+-]?\\d+)\\s*`,tr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,nr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,rr=/^#([0-9a-f]{3,8})$/,ir=RegExp(`^rgb\\(${er},${er},${er}\\)$`),ar=RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`),or=RegExp(`^rgba\\(${er},${er},${er},${tr}\\)$`),sr=RegExp(`^rgba\\(${nr},${nr},${nr},${tr}\\)$`),cr=RegExp(`^hsl\\(${tr},${nr},${nr}\\)$`),lr=RegExp(`^hsla\\(${tr},${nr},${nr},${tr}\\)$`),ur={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Yn(Zn,hr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dr,formatHex:dr,formatHex8:fr,formatHsl:pr,formatRgb:mr,toString:mr});function dr(){return this.rgb().formatHex()}function fr(){return this.rgb().formatHex8()}function pr(){return Or(this).formatHsl()}function mr(){return this.rgb().formatRgb()}function hr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=rr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?gr(t):n===3?new br(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_r(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_r(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ir.exec(e))?new br(t[1],t[2],t[3],1):(t=ar.exec(e))?new br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=or.exec(e))?_r(t[1],t[2],t[3],t[4]):(t=sr.exec(e))?_r(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cr.exec(e))?Dr(t[1],t[2]/100,t[3]/100,1):(t=lr.exec(e))?Dr(t[1],t[2]/100,t[3]/100,t[4]):ur.hasOwnProperty(e)?gr(ur[e]):e===`transparent`?new br(NaN,NaN,NaN,0):null}function gr(e){return new br(e>>16&255,e>>8&255,e&255,1)}function _r(e,t,n,r){return r<=0&&(e=t=n=NaN),new br(e,t,n,r)}function vr(e){return e instanceof Zn||(e=hr(e)),e?(e=e.rgb(),new br(e.r,e.g,e.b,e.opacity)):new br}function yr(e,t,n,r){return arguments.length===1?vr(e):new br(e,t,n,r??1)}function br(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Yn(br,yr,Xn(Zn,{brighter(e){return e=e==null?$n:$n**+e,new br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qn:Qn**+e,new br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new br(Tr(this.r),Tr(this.g),Tr(this.b),wr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xr,formatHex:xr,formatHex8:Sr,formatRgb:Cr,toString:Cr}));function xr(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}`}function Sr(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}${Er((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cr(){let e=wr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Tr(this.r)}, ${Tr(this.g)}, ${Tr(this.b)}${e===1?`)`:`, ${e})`}`}function wr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Er(e){return e=Tr(e),(e<16?`0`:``)+e.toString(16)}function Dr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ar(e,t,n,r)}function Or(e){if(e instanceof Ar)return new Ar(e.h,e.s,e.l,e.opacity);if(e instanceof Zn||(e=hr(e)),!e)return new Ar;if(e instanceof Ar)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Ar(o,s,c,e.opacity)}function kr(e,t,n,r){return arguments.length===1?Or(e):new Ar(e,t,n,r??1)}function Ar(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Yn(Ar,kr,Xn(Zn,{brighter(e){return e=e==null?$n:$n**+e,new Ar(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qn:Qn**+e,new Ar(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new br(Nr(e>=240?e-240:e+120,i,r),Nr(e,i,r),Nr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ar(jr(this.h),Mr(this.s),Mr(this.l),wr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=wr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${jr(this.h)}, ${Mr(this.s)*100}%, ${Mr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function jr(e){return e=(e||0)%360,e<0?e+360:e}function Mr(e){return Math.max(0,Math.min(1,e||0))}function Nr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Pr=e=>()=>e;function Fr(e,t){return function(n){return e+n*t}}function Ir(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Lr(e){return(e=+e)==1?Rr:function(t,n){return n-t?Ir(t,n,e):Pr(isNaN(t)?n:t)}}function Rr(e,t){var n=t-e;return n?Fr(e,n):Pr(isNaN(e)?t:e)}var zr=function e(t){var n=Lr(t);function r(e,t){var r=n((e=yr(e)).r,(t=yr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Rr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1);function Br(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Vr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hr(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=Zr(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Ur(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Wr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Gr(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Zr(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Kr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qr=new RegExp(Kr.source,`g`);function Jr(e){return function(){return e}}function Yr(e){return function(t){return e(t)+``}}function Xr(e,t){var n=Kr.lastIndex=qr.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Kr.exec(e))&&(i=qr.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Wr(r,i)})),n=qr.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Yr(c[0].x):Jr(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Zr(e,t){var n=typeof t,r;return t==null||n===`boolean`?Pr(t):(n===`number`?Wr:n===`string`?(r=hr(t))?(t=r,zr):Xr:t instanceof hr?zr:t instanceof Date?Ur:Vr(t)?Br:Array.isArray(t)?Hr:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Gr:Wr)(e,t)}var Qr=180/Math.PI,$r={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ei(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Qr,skewX:Math.atan(c)*Qr,scaleX:o,scaleY:s}}var ti;function ni(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?$r:ei(t.a,t.b,t.c,t.d,t.e,t.f)}function ri(e){return e==null||(ti||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ti.setAttribute(`transform`,e),!(e=ti.transform.baseVal.consolidate()))?$r:(e=e.matrix,ei(e.a,e.b,e.c,e.d,e.e,e.f))}function ii(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Wr(e,i)},{i:c-2,x:Wr(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Wr(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Wr(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Wr(e,n)},{i:s-2,x:Wr(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var ai=ii(ni,`px, `,`px)`,`deg)`),oi=ii(ri,`, `,`)`,`)`),si=1e-12;function ci(e){return((e=Math.exp(e))+1/e)/2}function li(e){return((e=Math.exp(e))-1/e)/2}function ui(e){return((e=Math.exp(2*e))-1)/(e+1)}var di=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<si)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=ci(y),c=s/(n*g)*(i*ui(t*r+y)-li(y));return[a+c*d,o+c*f,s*i/ci(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),fi=0,pi=0,mi=0,hi=1e3,gi,_i,vi=0,yi=0,bi=0,xi=typeof performance==`object`&&performance.now?performance:Date,Si=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ci(){return yi||=(Si(wi),xi.now()+bi)}function wi(){yi=0}function Ti(){this._call=this._time=this._next=null}Ti.prototype=Ei.prototype={constructor:Ti,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ci():+n)+(t==null?0:+t),!this._next&&_i!==this&&(_i?_i._next=this:gi=this,_i=this),this._call=e,this._time=n,ji()},stop:function(){this._call&&(this._call=null,this._time=1/0,ji())}};function Ei(e,t,n){var r=new Ti;return r.restart(e,t,n),r}function Di(){Ci(),++fi;for(var e=gi,t;e;)(t=yi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fi}function Oi(){yi=(vi=xi.now())+bi,fi=pi=0;try{Di()}finally{fi=0,Ai(),yi=0}}function ki(){var e=xi.now(),t=e-vi;t>hi&&(bi-=t,vi=e)}function Ai(){for(var e,t=gi,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:gi=n);_i=e,ji(r)}function ji(e){fi||(pi&&=clearTimeout(pi),e-yi>24?(e<1/0&&(pi=setTimeout(Oi,e-xi.now()-bi)),mi&&=clearInterval(mi)):(mi||=(vi=xi.now(),setInterval(ki,hi)),fi=1,Si(Oi)))}function Mi(e,t,n){var r=new Ti;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Ni=Oe(`start`,`end`,`cancel`,`interrupt`),Pi=[],Fi=0,Ii=1,Li=2,Ri=3,zi=4,Bi=5,Vi=6;function Hi(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Ki(e,n,{name:t,index:r,group:i,on:Ni,tween:Pi,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Fi})}function Ui(e,t){var n=Gi(e,t);if(n.state>Fi)throw Error(`too late; already scheduled`);return n}function Wi(e,t){var n=Gi(e,t);if(n.state>Ri)throw Error(`too late; already running`);return n}function Gi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Ki(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Ei(a,0,n.time);function a(e){n.state=Ii,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Ii)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===Ri)return Mi(o);f.state===zi?(f.state=Vi,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=Vi,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Mi(function(){n.state===Ri&&(n.state=zi,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=Li,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===Li){for(n.state=Ri,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=Bi,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===Bi&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=Vi,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function qi(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Li&&r.state<Bi,r.state=Vi,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Ji(e){return this.each(function(){qi(this,e)})}function Yi(e,t){var n,r;return function(){var i=Wi(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Xi(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Wi(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Zi(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Gi(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Yi:Xi)(n,e,t))}function Qi(e,t,n){var r=e._id;return e.each(function(){var e=Wi(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Gi(e,r).value[t]}}function $i(e,t){var n;return(typeof t==`number`?Wr:t instanceof hr?zr:(n=hr(t))?(t=n,zr):Xr)(e,t)}function ea(e){return function(){this.removeAttribute(e)}}function ta(e){return function(){this.removeAttributeNS(e.space,e.local)}}function na(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function ra(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ia(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function aa(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function oa(e,t){var n=Fe(e),r=n===`transform`?oi:$i;return this.attrTween(e,typeof t==`function`?(n.local?aa:ia)(n,r,Qi(this,`attr.`+e,t)):t==null?(n.local?ta:ea)(n):(n.local?ra:na)(n,r,t))}function sa(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ca(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function la(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ca(e,i)),n}return i._value=t,i}function ua(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&sa(e,i)),n}return i._value=t,i}function da(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Fe(e);return this.tween(n,(r.local?la:ua)(r,t))}function fa(e,t){return function(){Ui(this,e).delay=+t.apply(this,arguments)}}function pa(e,t){return t=+t,function(){Ui(this,e).delay=t}}function ma(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?fa:pa)(t,e)):Gi(this.node(),t).delay}function ha(e,t){return function(){Wi(this,e).duration=+t.apply(this,arguments)}}function ga(e,t){return t=+t,function(){Wi(this,e).duration=t}}function _a(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ha:ga)(t,e)):Gi(this.node(),t).duration}function va(e,t){if(typeof t!=`function`)throw Error();return function(){Wi(this,e).ease=t}}function ya(e){var t=this._id;return arguments.length?this.each(va(t,e)):Gi(this.node(),t).ease}function ba(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Wi(this,e).ease=n}}function xa(e){if(typeof e!=`function`)throw Error();return this.each(ba(this._id,e))}function Sa(e){typeof e!=`function`&&(e=qe(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Za(r,this._parents,this._name,this._id)}function Ca(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Za(o,this._parents,this._name,this._id)}function wa(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Ta(e,t,n){var r,i,a=wa(t)?Ui:Wi;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ea(e,t){var n=this._id;return arguments.length<2?Gi(this.node(),n).on.on(e):this.each(Ta(n,e,t))}function Da(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Oa(){return this.on(`end.remove`,Da(this._id))}function ka(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Be(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Hi(l[f],t,n,f,l,Gi(u,n)));return new Za(a,this._parents,t,n)}function Aa(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=We(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Gi(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Hi(p,t,n,h,f,m);a.push(f),o.push(u)}return new Za(a,o,t,n)}var ja=jn.prototype.constructor;function Ma(){return new ja(this._groups,this._parents)}function Na(e,t){var n,r,i;return function(){var a=Lt(this,e),o=(this.style.removeProperty(e),Lt(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Pa(e){return function(){this.style.removeProperty(e)}}function Fa(e,t,n){var r,i=n+``,a;return function(){var o=Lt(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Ia(e,t,n){var r,i,a;return function(){var o=Lt(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Lt(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function La(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Wi(this,e),l=c.on,u=c.value[a]==null?s||=Pa(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Ra(e,t,n){var r=(e+=``)==`transform`?ai:$i;return t==null?this.styleTween(e,Na(e,r)).on(`end.style.`+e,Pa(e)):typeof t==`function`?this.styleTween(e,Ia(e,r,Qi(this,`style.`+e,t))).each(La(this._id,e)):this.styleTween(e,Fa(e,r,t),n).on(`end.style.`+e,null)}function za(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Ba(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&za(e,a,n)),r}return a._value=t,a}function Va(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Ba(e,t,n??``))}function Ha(e){return function(){this.textContent=e}}function Ua(e){return function(){var t=e(this);this.textContent=t??``}}function Wa(e){return this.tween(`text`,typeof e==`function`?Ua(Qi(this,`text`,e)):Ha(e==null?``:e+``))}function Ga(e){return function(t){this.textContent=e.call(this,t)}}function Ka(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Ga(r)),t}return r._value=e,r}function qa(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Ka(e))}function Ja(){for(var e=this._name,t=this._id,n=Qa(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Gi(c,t);Hi(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Za(r,this._parents,e,n)}function Ya(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Wi(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Xa=0;function Za(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Qa(){return++Xa}var $a=jn.prototype;Za.prototype={constructor:Za,select:ka,selectAll:Aa,selectChild:$a.selectChild,selectChildren:$a.selectChildren,filter:Sa,merge:Ca,selection:Ma,transition:Ja,call:$a.call,nodes:$a.nodes,node:$a.node,size:$a.size,empty:$a.empty,each:$a.each,on:Ea,attr:oa,attrTween:da,style:Ra,styleTween:Va,text:Wa,textTween:qa,remove:Oa,tween:Zi,delay:ma,duration:_a,ease:ya,easeVarying:xa,end:Ya,[Symbol.iterator]:$a[Symbol.iterator]};function eo(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var to={time:null,delay:0,duration:250,ease:eo};function no(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ro(e){var t,n;e instanceof Za?(t=e._id,e=e._name):(t=Qa(),(n=to).time=Ci(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Hi(c,e,t,l,o,n||no(c,t));return new Za(r,this._parents,e,t)}jn.prototype.interrupt=Ji,jn.prototype.transition=ro;var io=e=>()=>e;function ao(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function oo(e,t,n){this.k=e,this.x=t,this.y=n}oo.prototype={constructor:oo,scale:function(e){return e===1?this:new oo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new oo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var so=new oo(1,0,0);oo.prototype;function co(e){e.stopImmediatePropagation()}function lo(e){e.preventDefault(),e.stopImmediatePropagation()}function uo(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function fo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function po(){return this.__zoom||so}function mo(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ho(){return navigator.maxTouchPoints||`ontouchstart`in this}function go(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function _o(){var e=uo,t=fo,n=go,r=mo,i=ho,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=di,l=Oe(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,po).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,po),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(so.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new oo(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new oo(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new oo(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Nn(this.that).datum();l.call(e,this.that,new ao(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Fn(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],qi(this),s.start();lo(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Nn(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Fn(t,i),l=t.clientX,u=t.clientY;Bn(t.view),co(t),a.mouse=[c,this.__zoom.invert(c)],qi(this),a.start();function d(e){if(lo(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Fn(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Vn(e.view,a.moved),lo(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Fn(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);lo(r),s>0?Nn(this).transition().duration(s).call(x,d,c,r):Nn(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(co(t),s=0;s<i;++s)c=r[s],l=Fn(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),qi(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(lo(e),s=0;s<a;++s)c=i[s],l=Fn(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(co(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Fn(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Nn(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:io(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:io(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:io(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:io([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var J=(e=>(e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`,e))(J||{}),vo=(e=>(e.Partial=`partial`,e.Full=`full`,e))(vo||{}),yo=(e=>(e.Bezier=`default`,e.SimpleBezier=`simple-bezier`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e))(yo||{}),bo=(e=>(e.Strict=`strict`,e.Loose=`loose`,e))(bo||{}),xo=(e=>(e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`,e))(xo||{}),So=(e=>(e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e))(So||{}),Co=(e=>(e.TopLeft=`top-left`,e.TopCenter=`top-center`,e.TopRight=`top-right`,e.BottomLeft=`bottom-left`,e.BottomCenter=`bottom-center`,e.BottomRight=`bottom-right`,e))(Co||{}),wo=[`INPUT`,`SELECT`,`TEXTAREA`],To=typeof document<`u`?document:null;function Eo(e){let t=e.composedPath?.call(e)?.[0]||e.target,n=typeof t?.hasAttribute==`function`&&t.hasAttribute(`contenteditable`),r=typeof t?.closest==`function`?t.closest(`.nokey`):null;return wo.includes(t?.nodeName)||n||!!r}function Do(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Oo(e,t,n,r){let i=t.replace(`+`,`
2
2
  `).replace(`
3
3
 
4
4
  `,`
@@ -10,27 +10,27 @@
10
10
  <meta name="theme-color" content="#141820" media="(prefers-color-scheme: dark)" />
11
11
  <title>Zen GitSync</title>
12
12
  <!-- 字体改为自托管(@font-face 见 src/main.css),不再依赖 Google Fonts 外链 -->
13
- <script type="module" crossorigin src="/assets/index-DDofdm66.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-BsHc5Rxd.js"></script>
14
14
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C0FnF6B9.js">
15
- <link rel="modulepreload" crossorigin href="/assets/dagre-56EqSb7a.js">
16
- <link rel="modulepreload" crossorigin href="/assets/element-plus-DAeQkmsV.js">
17
- <link rel="modulepreload" crossorigin href="/assets/vendor-ytAMhfHM.js">
18
- <link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-BXpA-5RR.js">
19
- <link rel="modulepreload" crossorigin href="/assets/SvgIcon-_bACg8fN.js">
15
+ <link rel="modulepreload" crossorigin href="/assets/dagre-Cnlh8k5K.js">
16
+ <link rel="modulepreload" crossorigin href="/assets/element-plus-CNJIhPSG.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/vendor-Dtqsc1If.js">
18
+ <link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-BO6qa5C3.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/SvgIcon-BPexLObf.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/socket-io-TBtw0msS.js">
21
- <link rel="modulepreload" crossorigin href="/assets/configStore-BpKN8VOg.js">
22
- <link rel="modulepreload" crossorigin href="/assets/monaco-iQW4tGZA.js">
23
- <link rel="modulepreload" crossorigin href="/assets/flow-mindmap-DSMXo-RP.js">
24
- <link rel="modulepreload" crossorigin href="/assets/CommonDialog-CTbNV8Wg.js">
25
- <link rel="modulepreload" crossorigin href="/assets/vue-flow-COq_ygQX.js">
21
+ <link rel="modulepreload" crossorigin href="/assets/configStore-D_CFFOs9.js">
22
+ <link rel="modulepreload" crossorigin href="/assets/monaco-Cs1I4pfm.js">
23
+ <link rel="modulepreload" crossorigin href="/assets/flow-mindmap-DdKeBM_G.js">
24
+ <link rel="modulepreload" crossorigin href="/assets/CommonDialog-9td95UkD.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/vue-flow-3t3hqiSq.js">
26
26
  <link rel="stylesheet" crossorigin href="/assets/element-plus-D-6gla1z.css">
27
- <link rel="stylesheet" crossorigin href="/assets/vendor-DpIR4Sxg.css">
27
+ <link rel="stylesheet" crossorigin href="/assets/vendor-B3_-csNx.css">
28
28
  <link rel="stylesheet" crossorigin href="/assets/SvgIcon-BQ6bR7l0.css">
29
29
  <link rel="stylesheet" crossorigin href="/assets/monaco-B2lPvkrc.css">
30
30
  <link rel="stylesheet" crossorigin href="/assets/flow-mindmap-DqCKZUlr.css">
31
31
  <link rel="stylesheet" crossorigin href="/assets/CommonDialog-Bzi5ISqT.css">
32
32
  <link rel="stylesheet" crossorigin href="/assets/vue-flow-CavUTEzp.css">
33
- <link rel="stylesheet" crossorigin href="/assets/index-DnNE9KX8.css">
33
+ <link rel="stylesheet" crossorigin href="/assets/index-CUvENjYd.css">
34
34
  </head>
35
35
  <body>
36
36
  <div id="app"></div>
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-C0FnF6B9.js";import{Dn as e,En as t,Fn as n,Jn as r,Jr as i,Kn as a,Kr as o,Mn as s,Nn as c,Nr as ee,On as l,Qn as te,Sn as ne,Tn as u,Tr as d,Un as f,W as p,Xn as m,Zr as h,_n as re,ar as g,bn as _,br as ie,cr as v,fr as y,gn as b,i as x,jn as ae,ln as S,r as oe,sr as se,vn as ce,wn as C,yn as le,yr as w,zn as T}from"./element-plus-DAeQkmsV.js";import{i as ue,n as E,o as de}from"./vendor-ytAMhfHM.js";import{n as D,t as O}from"./_plugin-vue_export-helper-BXpA-5RR.js";import{t as fe}from"./SvgIcon-_bACg8fN.js";import{t as pe}from"./configStore-BpKN8VOg.js";import{a as me,c as he,i as ge,n as _e,o as ve,r as ye,s as be}from"./monaco-iQW4tGZA.js";import{n as xe,r as Se}from"./flow-mindmap-DSMXo-RP.js";import{A as Ce,F as we,I as Te,L as Ee,M as De,N as Oe,P as ke,d as Ae,i as je,j as Me,k as Ne}from"./index-DDofdm66.js";import{a as Pe,c as Fe,i as Ie,l as Le,n as Re,o as ze,p as Be,r as Ve,s as k,t as A,u as He}from"./agentConversations-vfZW1S6H.js";import{c as Ue,s as We,t as Ge}from"./CopySessionButton-DEFGS3YY.js";function Ke(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`javascript`,vue:`html`,html:`html`,htm:`html`,css:`css`,scss:`scss`,less:`less`,json:`json`,jsonc:`json`,md:`markdown`,markdown:`markdown`,yaml:`yaml`,yml:`yaml`,toml:`ini`,xml:`xml`,svg:`xml`,sh:`shell`,bash:`shell`,zsh:`shell`,fish:`shell`,ps1:`powershell`,py:`python`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,rb:`ruby`,php:`php`,c:`c`,cpp:`cpp`,h:`cpp`,cs:`csharp`,sql:`sql`,graphql:`graphql`,gql:`graphql`,txt:`plaintext`,log:`plaintext`,ini:`ini`,env:`ini`,gitignore:`ini`,dockerfile:`dockerfile`}[e.toLowerCase()]??`plaintext`}T(),y();var qe={class:`mindmap-preview`},Je={class:`mindmap-preview-canvas`},Ye=O(n({__name:`MindmapPreview`,props:{content:{}},setup(e){let t=e,n=C(()=>Se(t.content||``,`未命名文档`));return(e,t)=>(m(),l(`div`,qe,[t[0]||=u(`div`,{class:`mindmap-preview-header`},[u(`span`,{class:`mindmap-preview-title`},`整篇导图`),u(`span`,{class:`mindmap-preview-hint`},`基于整篇 Markdown 自动生成 · 阅读模式`)],-1),u(`div`,Je,[c(d(xe),{data:n.value,"preview-mode":``},null,8,[`data`])])]))}}),[[`__scopeId`,`data-v-d2fe328b`]]);T(),y(),ee(),S();var Xe={class:`agent-panel-header`},Ze=[`title`,`aria-label`],Qe={class:`agent-panel-title`},j={key:1,class:`agent-panel-title`},M=[`title`,`aria-label`],N=[`title`],$e={class:`agent-panel-convs`},et=[`data-theme`],tt=[`title`],nt={class:`agent-context-att-name`},rt=[`title`,`aria-label`],it=O(n({__name:`EditorAgentPanel`,props:{activeFilePath:{},activeFileName:{},active:{type:Boolean}},emits:[`close`],setup(n,{emit:i}){let s=n,ee=i,{theme:te}=ke(),p=C(()=>te.value===`dark`?`dark`:`light`),{sessions:ie,sessionsLoading:y,currentSessionId:b,messages:x,isStreaming:S,pendingQuestion:oe,answeringQuestion:se,isSessionGenerating:ce,currentEngine:le,pendingEngine:T,isEngineLocked:O,pickEngine:fe,loadSessions:pe,loadSession:me,deleteSession:he,renameSession:ge,newSession:_e,sendMessage:ve,retryTurn:ye,answerQuestion:be,stop:xe,inputContextUsage:Se,queuedMessages:Ce,queuePaused:we,removeQueuedMessage:Te,flushQueued:Ee}=He(),De=C(()=>O.value?le.value:T.value);function Oe(e){O.value||fe(e)}let Ae=C(()=>Fe(ie.value,ce)),je=Pe(),Me=ze(),Ne=k(),Ke=C(()=>Ae.value.find(e=>e.id===b.value)?.title||``),qe=w(null),Je=w(null),Ye=w(null),it=w(null),at=w(null),{width:ot,narrow:P}=Ue(at),F=w(`chat`),I=w(null),st=w(!1),L=null,ct=C(()=>!!s.activeFileName&&!st.value);function lt(e){return Array.from(e.children).find(e=>e.classList?.contains(`acu-input-attachments`))??null}function ut(){let e=Je.value?.$el;if(!e)return;let t=e.querySelector(`.agent-context-slot`);if(!ct.value){if(!t)return;I.value=null,f(()=>t.remove());return}let n=I.value&&e.contains(I.value)?I.value:t;n||(n=document.createElement(`div`),n.className=`agent-context-slot`);let r=lt(e),i=r??e;n.parentElement!==i&&i.insertBefore(n,r?r.firstChild:e.firstChild),I.value=n}function dt(e=!0){qe.value?.scrollToBottom(e)}async function ft(e){let t=st.value?void 0:s.activeFilePath||void 0;await ve(e.text,e.files,{openFilePath:t}),await f(),dt()}function pt(e){me(e),F.value=`chat`}function mt(){_e(),F.value=`chat`}g(()=>x.value.length,()=>{f(()=>dt(!1))});function ht(){let e=it.value;!e||typeof MutationObserver>`u`||(L?.disconnect(),L=new MutationObserver(()=>ut()),L.observe(e,{childList:!0,subtree:!0}))}return g(()=>s.active,e=>{e&&(F.value=`chat`,pe().catch(()=>{}),f(()=>{ut(),dt(!1)}))}),g(P,e=>{e||(F.value=`chat`)}),g(()=>s.activeFilePath,()=>{st.value=!1}),g(ct,e=>{e&&f(ut)}),r(()=>{pe().catch(()=>{}),f(()=>{ut(),ht()})}),a(()=>{L?.disconnect(),L=null,I.value=null}),(r,i)=>(m(),l(`div`,{ref_key:`rootRef`,ref:at,class:`editor-agent-panel`},[u(`div`,Xe,[d(P)&&F.value===`list`?(m(),l(_,{key:0},[u(`button`,{class:`agent-panel-icon-btn agent-panel-back-btn`,title:d(D)(`@EDITOR:返回对话`),"aria-label":d(D)(`@EDITOR:返回对话`),onClick:i[0]||=e=>F.value=`chat`},[...i[4]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),u(`polyline`,{points:`12 19 5 12 12 5`})],-1)]],8,Ze),u(`span`,Qe,h(d(D)(`@EDITOR:会话列表`)),1)],64)):(m(),l(`span`,j,h(d(D)(`@EDITOR:g ai 对话`)),1)),i[7]||=u(`div`,{class:`agent-panel-spacer`},null,-1),!d(P)||F.value===`chat`?(m(),t(We,{key:2,class:`agent-panel-engine`,engine:De.value,locked:d(O),onSelect:Oe},null,8,[`engine`,`locked`])):e(``,!0),!d(P)||F.value===`chat`?(m(),t(Ge,{key:3,class:`agent-panel-copy`,messages:d(x),title:Ke.value,engine:d(Be)(De.value)},null,8,[`messages`,`title`,`engine`])):e(``,!0),d(P)&&F.value===`chat`?(m(),l(`button`,{key:4,class:`agent-panel-icon-btn agent-panel-list-btn`,title:d(D)(`@EDITOR:会话列表`),"aria-label":d(D)(`@EDITOR:会话列表`),onClick:i[1]||=e=>F.value=`list`},[...i[5]||=[ae(`<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-d1b2759e><line x1="8" y1="6" x2="21" y2="6" data-v-d1b2759e></line><line x1="8" y1="12" x2="21" y2="12" data-v-d1b2759e></line><line x1="8" y1="18" x2="21" y2="18" data-v-d1b2759e></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-d1b2759e></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-d1b2759e></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-d1b2759e></line></svg>`,1)]],8,M)):e(``,!0),u(`button`,{class:`agent-panel-icon-btn`,title:d(D)(`@EDITOR:关闭对话`),onClick:i[2]||=e=>ee(`close`)},[...i[6]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[u(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),u(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,N)]),u(`div`,{class:o([`agent-panel-body`,{"is-wide":!d(P)}])},[v(u(`div`,$e,[c(d(de),{"show-search":!0,items:Ae.value,"active-id":d(b),loading:d(y),labels:d(je),onSelect:pt,onNew:mt,onRename:d(ge),onDelete:d(he)},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])],512),[[re,!d(P)||F.value===`list`]]),v(u(`div`,{ref_key:`chatHostRef`,ref:Ye,class:`agent-panel-chat`},[c(d(ue),{ref_key:`chatRef`,ref:qe,"show-input":!1,messages:d(x),"assistant-name":d(Re),"assistant-avatar":d(A),theme:p.value,question:d(oe),"question-submitting":d(se),"question-labels":d(Me),"plan-config":{labels:{title:d(D)(`@AGENT:计划`),raw:d(D)(`@AGENT:原始参数`)}},"message-rail-config":d(Ie),"message-meta-config":d(Ve),onAnswer:d(be),onRetry:d(ye)},null,8,[`messages`,`assistant-name`,`assistant-avatar`,`theme`,`question`,`question-submitting`,`question-labels`,`plan-config`,`message-rail-config`,`message-meta-config`,`onAnswer`,`onRetry`])],512),[[re,!d(P)||F.value===`chat`]]),d(ot)>0?(m(),l(`div`,{key:0,ref_key:`composerRef`,ref:it,class:`agent-panel-composer acu-root`,"data-theme":p.value},[c(d(E),{ref_key:`inputRef`,ref:Je,generating:d(S),"allow-queue":!0,queued:d(Ce),"queue-paused":d(we),"queue-labels":d(Ne),placeholder:d(S)?d(D)(`@AGENT:生成中,发送后会排队,等本轮跑完自动接上…`):d(D)(`@AGENT:输入消息,Enter 发送`),"upload-config":{accept:d(Le)},"context-usage":d(Se),onSend:ft,onStop:d(xe),onUnqueue:d(Te),onFlushQueued:d(Ee)},null,8,[`generating`,`queued`,`queue-paused`,`queue-labels`,`placeholder`,`upload-config`,`context-usage`,`onStop`,`onUnqueue`,`onFlushQueued`]),I.value?(m(),t(ne,{key:0,to:I.value},[ct.value?(m(),l(`div`,{key:0,class:`agent-context-att`,title:n.activeFilePath||``},[i[9]||=u(`svg`,{class:`agent-context-att-icon`,viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[u(`path`,{d:`M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z`}),u(`polyline`,{points:`14 3 14 8 19 8`})],-1),u(`span`,nt,h(n.activeFileName),1),u(`button`,{type:`button`,class:`agent-context-att-remove`,title:d(D)(`@EDITOR:不引用当前文档`),"aria-label":d(D)(`@EDITOR:不引用当前文档`),onClick:i[3]||=e=>st.value=!0},[...i[8]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"aria-hidden":`true`},[u(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),u(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,rt)],8,tt)):e(``,!0)],8,[`to`])):e(``,!0)],8,et)):e(``,!0)],2)],512))}}),[[`__scopeId`,`data-v-d1b2759e`]]);T(),y(),ee(),S();var at={class:`sidebar-header`},ot={class:`sidebar-title`},P={class:`sidebar-actions`},F={class:`sidebar-search`},I=[`placeholder`,`title`],st=[`title`,`aria-label`],L={key:0,class:`sidebar-tree`},ct={key:1,class:`tree-arrow-spacer`},lt={class:`tree-icon mit-icon`,"aria-hidden":`true`},ut=[`xlink:href`],dt=[`onClick`,`onContextmenu`],ft={key:1,class:`tree-arrow-spacer`},pt={key:2,class:`tree-icon mit-icon`,"aria-hidden":`true`},mt=[`xlink:href`],ht={key:3,class:`tree-icon mit-icon`,"aria-hidden":`true`},gt=[`xlink:href`],_t=[`title`],vt={key:0,class:`tree-name-hit`},yt={key:4,class:`tree-loading`},bt={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--color-warning-dark)`}},xt={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--text-meta)`}},St=[`placeholder`],Ct={key:0,class:`tree-node tree-inline-input-row`,style:{paddingLeft:`12px`}},wt={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--color-warning-dark)`}},Tt={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--text-meta)`}},Et=[`placeholder`],Dt={key:1,class:`tree-empty`},Ot={key:1,class:`sidebar-loading`},kt={class:`editor-main`},At={key:0,class:`editor-tabs`},jt=[`onClick`,`title`],Mt={class:`tab-name`},Nt={key:0,class:`tab-dirty-dot`},Pt=[`onClick`],Ft=[`title`],It=[`disabled`,`title`],Lt=[`title`],Rt={class:`editor-body`},zt={key:0,class:`image-tab-placeholder`},Bt={viewBox:`0 0 24 24`,width:`56`,height:`56`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{opacity:`.35`}},Vt={class:`image-tab-placeholder-title`},Ht={class:`image-tab-placeholder-hint`},Ut={class:`preview-header`},Wt={class:`preview-title`},Gt={class:`preview-ext-badge`},Kt=[`title`],qt={class:`preview-body`},Jt=[`sandbox`,`srcdoc`],Yt=6e4,Xt=3e4,Zt=O(n({__name:`EditorView`,props:{pendingFilePath:{}},setup(n){self.MonacoEnvironment={getWorker(e,t){return t===`json`?new be:t===`css`||t===`scss`||t===`less`?new ve:t===`html`||t===`handlebars`||t===`razor`?new me:t===`typescript`||t===`javascript`?new ge:new he}};let ee=n,y=pe(),S=Ae(),T=w([]),ue=w(!1),E=w(``),de=w(``),O=null;function xe(){E.value=``,de.value=``,O&&=(clearTimeout(O),null)}g(E,e=>{O&&clearTimeout(O),O=setTimeout(()=>{de.value=e,O=null},180)}),a(()=>{O&&clearTimeout(O),Fe(),hn()});let Se=null;function Pe(){Fe(),y.ui.fileTreeAutoRefresh&&(Se=setInterval(()=>{document.hidden||y.currentDirectory&&(E.value.trim()||k())},Yt))}function Fe(){Se&&=(clearInterval(Se),null)}g(()=>y.currentDirectory,async()=>{if(Zt=!1,Pe(),await Le(),j.value.some(e=>e.isDirty)){Zt=!0;return}j.value=[],M.value=null,rn(),await en()}),g(()=>y.ui.fileTreeAutoRefresh,()=>{Pe()});async function Ie(e,t=0){let n=await(await fetch(`/api/browse_directory?path=${encodeURIComponent(e)}`)).json();return n.success?n.items.map(e=>({...e,depth:t,expanded:!1,loading:!1,children:(e.type,void 0)})):[]}async function Le(){let e=y.currentDirectory;if(e){ue.value=!0;try{T.value=await Ie(e,0)}finally{ue.value=!1}}}function Re(e,t=new Set){for(let n of e)n.type===`directory`&&n.expanded&&(t.add(n.path),n.children&&Re(n.children,t));return t}function ze(e,t=0){return(e||[]).map(e=>{let n={name:e.name,path:e.path,type:e.type,depth:t,expanded:!1,loading:!1};return n.type===`directory`&&Array.isArray(e.children)&&(n.children=ze(e.children,t+1),n.expanded=!0),n})}async function Be(e){let t=y.currentDirectory;if(!t)return null;try{let n=await(await fetch(`/api/browse_directory_tree`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t,expand:e})})).json().catch(()=>null);return!n?.success||!Array.isArray(n.items)?null:ze(n.items,0)}catch{return null}}function Ve(e,t){let n=new Map(e.map(e=>[e.path,e])),r=e.length!==t.length;if(!r){for(let n=0;n<t.length;n++)if(e[n].path!==t[n].path){r=!0;break}}for(let e=0;e<t.length;e++){let i=t[e],a=n.get(i.path);a&&(t[e]=a,a.name!==i.name&&(a.name=i.name,r=!0),a.type===`directory`&&a.expanded&&Array.isArray(i.children)&&(Array.isArray(a.children)?Ve(a.children,i.children)&&(a.children=i.children,r=!0):(a.children=i.children,r=!0)))}return r}async function k(e={}){if(!y.currentDirectory)return;let t=await Be([...Re(T.value)]);if(!t){e.notifyOnError&&x.error(D(`@EDITOR:刷新失败`));return}if(T.value.length===0){T.value=t;return}Ve(T.value,t)&&(T.value=t)}async function A(e){if(e.type===`directory`){if(e.expanded)e.expanded=!1;else{if(!e.children){e.loading=!0;try{e.children=await Ie(e.path,e.depth+1)}finally{e.loading=!1}}e.expanded=!0}}}function He(e){let t=[];for(let n of e)t.push(n),n.type===`directory`&&n.expanded&&n.children&&t.push(...He(n.children));return t}let Ue=C(()=>de.value.trim().toLowerCase());function We(e,t){if(!t)return e;let n=[];for(let r of e){let e=r.children?We(r.children,t):[],i=r.name.toLowerCase().includes(t);r.type===`directory`?(i||e.length>0)&&(r.expanded=!0,r.children!==void 0&&(r.children=e),n.push(r)):i&&n.push(r)}return n}let Ge=C(()=>We(T.value,Ue.value)),qe=C(()=>Ue.value.length>0&&Ge.value.length===0);function Je(e){let t=de.value.trim();if(!t)return[{text:e,hit:!1}];let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0,o=n.indexOf(r,a);for(;o!==-1;)o>a&&i.push({text:e.slice(a,o),hit:!1}),i.push({text:e.slice(o,o+r.length),hit:!0}),a=o+r.length,o=n.indexOf(r,a);return a<e.length&&i.push({text:e.slice(a),hit:!1}),i}let Xe=w(null);function Ze(){let e=Xe.value;e&&(e.focus(),e.select())}function Qe(){E.value?(xe(),Xe.value?.focus()):(Xe.value?.blur(),R.value?.focus())}let j=w([]),M=w(null),N=w(null);async function $e(e){if(N.value=e,e.type!==`file`){A(e);return}let t=j.value.find(t=>t.path===e.path);if(console.log(`[debug-open-in-editor] EditorView openFile existing tab check:`,{path:e.path,found:!!t,tabsCount:j.value.length}),t){M.value=e.path,f(()=>B());return}let n=e.name.split(`.`).pop()||``;if(Qn.has(n.toLowerCase())){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`plaintext`,diskMtimeMs:null};j.value.push(t),M.value=e.path,J.value=!0;return}if(we(e.name)){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`office`,diskMtimeMs:null};j.value.push(t),M.value=e.path,Y.value=!1,J.value=!0;return}try{let t=await fetch(`/api/editor/file?path=${encodeURIComponent(e.path)}`),r=await t.json();if(console.log(`[debug-open-in-editor] EditorView fetch /api/editor/file response:`,{path:e.path,status:t.status,data:r}),!r.success){x.error(`${D(`@EDITOR:打开文件失败: `)}${r.error}`);return}let i=Ke(n),a=z.get(e.path);a&&!a.isDisposed()&&a.setValue(r.content);let o={path:e.path,name:e.name,content:r.content,originalContent:r.content,isDirty:!1,language:i,diskMtimeMs:typeof r.mtimeMs==`number`?r.mtimeMs:null};console.log(`[debug-open-in-editor] EditorView pushing tab:`,{path:o.path,name:o.name,contentLen:o.content.length,lang:o.language}),j.value.push(o),M.value=e.path,console.log(`[debug-open-in-editor] EditorView tabs after push:`,j.value.length,`activeTabPath=`,M.value)}catch(e){console.log(`[debug-open-in-editor] EditorView fetch threw:`,e),x.error(`${D(`@EDITOR:打开文件失败: `)}${e.message}`)}}g(()=>ee.pendingFilePath,async e=>{if(console.log(`[debug-open-in-editor] EditorView watcher fired, filePath=`,e),!e)return;await f();let t=e.split(/[\\/]/).pop()||e;console.log(`[debug-open-in-editor] EditorView calling openFile, name=`,t,`path=`,e),await $e({name:t,path:e,type:`file`,depth:0}),console.log(`[debug-open-in-editor] EditorView openFile returned`)},{immediate:!0});function et(e,t){t.stopPropagation();let n=j.value.findIndex(t=>t.path===e);n!==-1&&(!j.value[n].isDirty||confirm(D(`@EDITOR:文件未保存,确认关闭?`)))&&(j.value.splice(n,1),M.value===e&&(M.value=j.value[Math.min(n,j.value.length-1)]?.path??null))}let tt=()=>j.value.find(e=>e.path===M.value)??null,nt=C(()=>({expandedDirs:[...Re(T.value)],tabs:j.value.map(e=>e.path),activeTab:M.value})),rt=!1,Zt=!1;function Qt(){Zt&&!rt&&y.isUiLoaded&&y.saveEditorWorkspace(nt.value)}g(nt,()=>Qt());async function $t(e){if(j.value.some(t=>t.path===e))return;let t=e.split(/[\\/]/).pop()||e,n=(t.split(`.`).pop()||``).toLowerCase();if(Qn.has(n)){j.value.push({path:e,name:t,content:``,originalContent:``,isDirty:!1,language:`plaintext`,diskMtimeMs:null});return}if(we(t)){j.value.push({path:e,name:t,content:``,originalContent:``,isDirty:!1,language:`office`,diskMtimeMs:null});return}try{let r=await(await fetch(`/api/editor/file?path=${encodeURIComponent(e)}`)).json();if(!r.success)return;let i=z.get(e);i&&!i.isDisposed()&&R.value?.getModel()!==i&&(i.dispose(),z.delete(e)),j.value.push({path:e,name:t,content:r.content,originalContent:r.content,isDirty:!1,language:Ke(n),diskMtimeMs:typeof r.mtimeMs==`number`?r.mtimeMs:null})}catch{}}async function en(){try{for(let e=0;e<100&&!y.isUiLoaded;e++)await new Promise(e=>setTimeout(e,50));if(!y.isUiLoaded)return;H.value=y.ui.editorSidebarWidth;let e=y.getEditorWorkspace();if(!e)return;rt=!0;try{if(e.expandedDirs.length>0){let t=await Be(e.expandedDirs);t&&(T.value=t)}for(let t of e.tabs)await $t(t);if(!ee.pendingFilePath&&e.activeTab&&j.value.some(t=>t.path===e.activeTab)){M.value=e.activeTab;let t=tt(),n=(t?.name.split(`.`).pop()||``).toLowerCase();t&&(Qn.has(n)||we(t.name))&&(J.value=!0)}}finally{rt=!1}}finally{Zt=!0,Qt()}}let tn=w(null),R=ie(null),z=new Map;function nn(e){let t=z.get(e.path);return(!t||t.isDisposed())&&(t=ye.createModel(e.content,e.language,_e.file(e.path)),z.set(e.path,t)),t}function rn(){R.value?.setModel(null);for(let e of z.values())e.isDisposed()||e.dispose();z.clear()}function an(){if(!tn.value)return;let e=document.documentElement.getAttribute(`data-theme`)===`dark`;R.value=ye.create(tn.value,{theme:e?`vs-dark`:`vs`,fontSize:13,lineHeight:20,fontFamily:`'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace`,minimap:{enabled:!0},scrollBeyondLastLine:!1,renderWhitespace:`selection`,automaticLayout:!0,tabSize:2,wordWrap:`off`,smoothScrolling:!0,cursorBlinking:`smooth`,padding:{top:8,bottom:8},editContext:!1}),R.value.onDidChangeModelContent(()=>{let e=tt();if(!e)return;let t=R.value.getValue();e.content=t,e.isDirty=t!==e.originalContent}),R.value.onDidBlurEditorText(()=>{y.ui.editorAutoSave&&tt()?.isDirty&&vn(!1),requestAnimationFrame(()=>{if(!V.value||V.value.offsetParent===null)return;let e=document.activeElement;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable||e.classList?.contains(`native-edit-context`)||e.classList?.contains(`monaco-editor`))||B()})})}g(M,e=>{if(!R.value||!e)return;let t=j.value.find(t=>t.path===e);if(!t)return;let n=nn(t);R.value.setModel(n),f(()=>B()),dn(e)});function B(){if(!R.value)return;R.value.focus();let e=document.querySelector(`.monaco-editor .native-edit-context`);e&&document.activeElement!==e&&requestAnimationFrame(()=>e.focus?.())}let on=0,sn=new Map;async function cn(e){try{let t=await(await fetch(`/api/editor/file?path=${encodeURIComponent(e)}&meta=1`)).json();return!t?.success||typeof t.mtimeMs!=`number`?null:{mtimeMs:t.mtimeMs}}catch{return null}}async function ln(e){try{let t=await(await fetch(`/api/editor/file?path=${encodeURIComponent(e)}`)).json();return t?.success?{content:t.content,mtimeMs:typeof t.mtimeMs==`number`?t.mtimeMs:null}:null}catch{return null}}function un(e,t,n){e.content=t,e.originalContent=t,e.isDirty=!1,e.diskMtimeMs=n;let r=z.get(e.path);if(!r||r.isDisposed())return;let i=R.value;if(!i||i.getModel()!==r){r.setValue(t);return}let a=i.saveViewState();r.pushEditOperations([],[{range:r.getFullModelRange(),text:t}],()=>null),i.restoreViewState(a)}async function dn(e){if(!e)return;let t=j.value.find(t=>t.path===e);if(!t||t.diskMtimeMs===null)return;let n=++on,r=await cn(e);if(n!==on||j.value.find(t=>t.path===e)!==t||!r||r.mtimeMs===t.diskMtimeMs)return;if(t.isDirty){if(sn.get(e)===r.mtimeMs)return;sn.set(e,r.mtimeMs);try{await oe.confirm(D(`@EDITOR:这个文件在磁盘上已被改动,你这边也有未保存的编辑。重新加载会丢弃你的改动。`),D(`@EDITOR:文件已被外部改动`),{confirmButtonText:D(`@EDITOR:重新加载`),cancelButtonText:D(`@EDITOR:保留我的`),type:`warning`})}catch{return}if(t.isDirty)return}let i=await ln(e);i&&j.value.find(t=>t.path===e)===t&&un(t,i.content,i.mtimeMs)}function fn(){document.hidden||dn(M.value)}let pn=null;function mn(){hn(),pn=setInterval(()=>{document.hidden||dn(M.value)},Xt)}function hn(){pn&&=(clearInterval(pn),null)}g(()=>j.value.filter(e=>e.isDirty).length,e=>{S.setDirtyCount(e)},{immediate:!0}),a(()=>S.setDirtyCount(0)),ke(()=>{let e=document.documentElement.getAttribute(`data-theme`)===`dark`;ye.setTheme(e?`vs-dark`:`vs`)});let gn=null;function _n(){if(gn||!V.value)return;let e=[V.value],t=V.value.parentElement;for(;t;){if(t.classList.contains(`view-pane`)||t.classList.contains(`editor-pane`)){e.push(t);break}t=t.parentElement}gn=new MutationObserver(()=>{V.value&&V.value.offsetParent!==null&&M.value&&R.value&&(dn(M.value),requestAnimationFrame(()=>{let e=document.activeElement;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable||e.classList?.contains(`native-edit-context`)||e.classList?.contains(`monaco-editor`))||B()}))});let n=gn;e.forEach(e=>n.observe(e,{attributes:!0,attributeFilter:[`style`,`class`,`hidden`]}))}r(async()=>{an(),await Le(),await en(),_n(),Pe(),window.addEventListener(`focus`,fn),document.addEventListener(`visibilitychange`,fn),mn(),M.value&&f(()=>B())}),a(()=>{gn?.disconnect(),gn=null,window.removeEventListener(`focus`,fn),document.removeEventListener(`visibilitychange`,fn),R.value?.dispose(),z.forEach(e=>e.dispose()),z.clear()});async function vn(e=!1){let t=tt();if(t)try{let n=await(await fetch(`/api/editor/file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t.path,content:t.content})})).json();if(!n.success){x.error(`${D(`@EDITOR:保存失败: `)}${n.error}`);return}t.originalContent=t.content,t.isDirty=!1,typeof n.mtimeMs==`number`&&(t.diskMtimeMs=n.mtimeMs),e||x.success(D(`@EDITOR:已保存`))}catch(e){x.error(`${D(`@EDITOR:保存失败: `)}${e.message}`)}}function yn(e){let t=e.ctrlKey||e.metaKey;if(t&&e.key.toLowerCase()===`f`){e.preventDefault(),Ze();return}t&&e.key===`s`&&(e.preventDefault(),vn())}r(()=>window.addEventListener(`keydown`,yn)),a(()=>window.removeEventListener(`keydown`,yn));let V=w(null),H=w(y.ui.editorSidebarWidth),bn=!1,xn=0,Sn=0;function Cn(e){bn=!0,xn=e.clientX,Sn=H.value,document.addEventListener(`mousemove`,wn),document.addEventListener(`mouseup`,Tn),e.preventDefault()}function wn(e){if(!bn)return;let t=e.clientX-xn;H.value=Math.max(140,Math.min(400,Sn+t))}function Tn(){bn=!1,document.removeEventListener(`mousemove`,wn),document.removeEventListener(`mouseup`,Tn),H.value!==y.ui.editorSidebarWidth&&y.setEditorSidebarWidth(H.value)}function En(e){return e.type===`directory`?Ee(e.name):Te(e.name)}let U=w(null),W=w(null),G=w(null),Dn=w(null);function On(){let e=N.value;return e?e.type===`directory`?{parentPath:e.path,afterNode:e,depth:e.depth+1}:{parentPath:e.path.includes(`/`)||e.path.includes(`\\`)?e.path.replace(/[\\/][^\\/]+$/,``):y.currentDirectory??``,afterNode:e,depth:e.depth}:{parentPath:y.currentDirectory??``,afterNode:null,depth:0}}async function kn(){let e=On();N.value?.type===`directory`&&!N.value.expanded&&await A(N.value),U.value={...e,kind:`file`,value:``},await f(),G.value?.focus()}async function An(){let e=On();N.value?.type===`directory`&&!N.value.expanded&&await A(N.value),U.value={...e,kind:`directory`,value:``},await f(),G.value?.focus()}function jn(){U.value=null}async function Mn(){let e=U.value;if(!e||!e.value.trim()){U.value=null;return}let t=e.value.trim(),n=e.parentPath.replace(/[/\\]$/,``)+`/`+t;if(e.kind===`file`){let e=await(await fetch(`/api/editor/file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n})})).json();if(!e.success){x.error(e.error);return}x.success(D(`@EDITOR:创建成功`))}else{let e=await(await fetch(`/api/editor/directory`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n})})).json();if(!e.success){x.error(e.error);return}x.success(D(`@EDITOR:创建成功`))}U.value=null,await k()}function Nn(e){e.key===`Enter`&&(e.preventDefault(),Mn()),e.key===`Escape`&&(e.preventDefault(),jn())}let K=w(null),Pn=w(null);function Fn(e,t){e.preventDefault(),K.value={x:e.clientX,y:e.clientY,node:t}}function q(){K.value=null}async function In(){let e=K.value?.node;q(),e&&(N.value=e),e?.type===`directory`&&!e.expanded&&await A(e);let t=On();U.value={...t,kind:`file`,value:``},await f(),G.value?.focus()}async function Ln(){let e=K.value?.node;q(),e&&(N.value=e),e?.type===`directory`&&!e.expanded&&await A(e);let t=On();U.value={...t,kind:`directory`,value:``},await f(),G.value?.focus()}async function Rn(){let e=K.value?.node;q(),e&&(W.value={node:e,value:e.name},await f(),Dn.value?.focus(),Dn.value?.select())}async function zn(){let e=W.value;if(!e||!e.value.trim()||e.value.trim()===e.node.name){W.value=null;return}let t=e.value.trim(),n=e.node.path.replace(/[\\/][^\\/]+$/,``).replace(/[/\\]$/,``)+`/`+t,r=await(await fetch(`/api/editor/rename`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({oldPath:e.node.path,newPath:n})})).json();if(!r.success){x.error(r.error);return}let i=j.value.find(t=>t.path===e.node.path);i&&(i.path=n,i.name=t,M.value===e.node.path&&(M.value=n)),W.value=null,await k()}function Bn(e){e.key===`Enter`&&(e.preventDefault(),zn()),e.key===`Escape`&&(e.preventDefault(),W.value=null)}async function Vn(){let e=K.value?.node;if(q(),!e)return;let t=e.type===`directory`?D(`@EDITOR:文件夹`):D(`@EDITOR:文件`);if(!confirm(`${D(`@EDITOR:确认删除`)} ${t} "${e.name}"?`))return;let n=await(await fetch(`/api/editor/entry?path=${encodeURIComponent(e.path)}`,{method:`DELETE`})).json();if(!n.success){x.error(n.error);return}let r=j.value.findIndex(t=>t.path===e.path);r!==-1&&(j.value.splice(r,1),M.value===e.path&&(M.value=j.value[Math.max(0,r-1)]?.path??null)),x.success(D(`@EDITOR:已删除`)),await k()}async function Hn(){let e=K.value?.node;if(q(),e)try{let t=await(await fetch(`/api/editor/reveal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||x.error(t.error)}catch(e){x.error(e?.message||String(e))}}function Un(e){let t=y.currentDirectory;if(!t)return e;let n=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``),r=n(t),i=n(e);return i===r?`.`:i.startsWith(r+`/`)?i.slice(r.length+1):i}async function Wn(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}async function Gn(){let e=K.value?.node;q(),e&&(await Wn(e.path)?x.success(D(`@EDITOR:已复制到剪贴板`)):x.error(D(`@EDITOR:复制失败`)))}async function Kn(){let e=K.value?.node;q(),e&&(await Wn(Un(e.path))?x.success(D(`@EDITOR:已复制到剪贴板`)):x.error(D(`@EDITOR:复制失败`)))}async function qn(){let e=K.value?.node;if(q(),e)try{let t=await(await fetch(`/api/editor/open-in-vscode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||x.error(t.error||D(`@EDITOR:VSCode 未安装`))}catch(e){x.error(e?.message||String(e))}}let Jn=new Set([`html`,`htm`]),Yn=C(()=>{let e=K.value?.node;if(!e||e.type!==`file`)return!1;let t=e.name.slice(e.name.lastIndexOf(`.`)+1).toLowerCase();return Jn.has(t)});async function Xn(){let e=K.value?.node;if(q(),e)try{let t=await(await fetch(`/api/editor/open-in-browser`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||x.error(t.error||D(`@EDITOR:浏览器打开失败`))}catch(e){x.error(e?.message||String(e))}}r(()=>document.addEventListener(`click`,q)),a(()=>document.removeEventListener(`click`,q));let Zn=new Set([`md`,`html`,`htm`,`svg`]),Qn=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`ico`,`bmp`]),J=w(!1),Y=w(!1),X=w(!1),$n=w(!1),er=w(0),Z=C(()=>j.value.find(e=>e.path===M.value)??null),tr=C(()=>Z.value?.language===`plaintext`&&Z.value?.content===``),nr=C(()=>Z.value?.language===`office`),Q=C(()=>(Z.value?.name??``).split(`.`).pop()?.toLowerCase()??``),rr=C(()=>Zn.has(Q.value)||Qn.has(Q.value)||we(Q.value)),ir=C(()=>((Z.value?.content??``).match(/^#{1,6}\s+/gm)||[]).length),$=C(()=>Q.value===`md`&&ir.value>0);g(M,()=>{J.value&&!rr.value&&(J.value=!1),Y.value&&!$.value&&(Y.value=!1)});function ar(){rr.value&&(J.value||(Y.value=!1,X.value=!1),J.value=!J.value)}function or(){$.value&&(Y.value||(J.value=!1,X.value=!1),Y.value=!Y.value)}function sr(){X.value||(J.value=!1,Y.value=!1),X.value=!X.value,$n.value=!0}let cr=C(()=>{let e=Z.value;if(!e)return``;let t=Q.value,n=document.documentElement.getAttribute(`data-theme`)===`light`?`#ffffff`:`#0d1117`;return t===`html`||t===`htm`?Ce(e.content):t===`svg`?`<!DOCTYPE html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:${n};display:flex;align-items:center;justify-content:center;min-height:100vh;}svg{max-width:100%;max-height:90vh;}</style></head><body>${e.content}</body></html>`:``}),lr=!1,ur=0,dr=0;function fr(e){lr=!0,ur=e.clientX,dr=er.value,document.addEventListener(`mousemove`,pr),document.addEventListener(`mouseup`,mr),e.preventDefault()}function pr(e){if(!lr)return;let t=e.clientX-ur;er.value=Math.max(200,Math.min(900,dr+t))}function mr(){lr=!1,document.removeEventListener(`mousemove`,pr),document.removeEventListener(`mouseup`,mr)}return(n,r)=>(m(),l(_,null,[u(`div`,{class:`editor-view`,ref_key:`containerRef`,ref:V},[u(`div`,{class:`editor-sidebar`,style:i({width:H.value+`px`})},[u(`div`,at,[u(`span`,ot,h(d(D)(`@EDITOR:资源管理器`)),1),u(`div`,P,[c(d(p),{content:d(D)(`@EDITOR:新建文件`),placement:`bottom`,"show-after":300},{default:se(()=>[u(`button`,{class:`sidebar-action-btn`,onClick:kn},[...r[11]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),u(`polyline`,{points:`14 2 14 8 20 8`}),u(`line`,{x1:`12`,y1:`13`,x2:`12`,y2:`19`}),u(`line`,{x1:`9`,y1:`16`,x2:`15`,y2:`16`})],-1)]])]),_:1},8,[`content`]),c(d(p),{content:d(D)(`@EDITOR:新建文件夹`),placement:`bottom`,"show-after":300},{default:se(()=>[u(`button`,{class:`sidebar-action-btn`,onClick:An},[...r[12]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}),u(`line`,{x1:`12`,y1:`11`,x2:`12`,y2:`17`}),u(`line`,{x1:`9`,y1:`14`,x2:`15`,y2:`14`})],-1)]])]),_:1},8,[`content`]),c(d(p),{content:d(D)(`@EDITOR:刷新`),placement:`bottom`,"show-after":300},{default:se(()=>[u(`button`,{class:`sidebar-action-btn`,onClick:r[0]||=e=>k({notifyOnError:!0})},[...r[13]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`polyline`,{points:`1 4 1 10 7 10`}),u(`polyline`,{points:`23 20 23 14 17 14`}),u(`path`,{d:`M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15`})],-1)]])]),_:1},8,[`content`])])]),u(`div`,F,[r[15]||=u(`svg`,{class:`sidebar-search-icon`,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[u(`circle`,{cx:`11`,cy:`11`,r:`7`}),u(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})],-1),v(u(`input`,{ref_key:`searchInputRef`,ref:Xe,"onUpdate:modelValue":r[1]||=e=>E.value=e,type:`text`,class:`sidebar-search-input`,placeholder:d(D)(`@EDITOR:搜索文件...`),title:d(D)(`@EDITOR:搜索文件...`),spellcheck:`false`,autocomplete:`off`,onKeydown:ce(Qe,[`escape`])},null,40,I),[[b,E.value]]),E.value?(m(),l(`button`,{key:0,class:`sidebar-search-clear`,title:d(D)(`@EDITOR:清除搜索`),"aria-label":d(D)(`@EDITOR:清除搜索`),onClick:xe},[...r[14]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[u(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),u(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,st)):e(``,!0)]),ue.value?(m(),l(`div`,Ot,[...r[24]||=[u(`span`,{class:`spin-icon`},null,-1)]])):(m(),l(`div`,L,[(m(!0),l(_,null,te(He(Ge.value),t=>(m(),l(_,{key:t.path},[W.value&&W.value.node.path===t.path?(m(),l(`div`,{key:0,class:`tree-node tree-inline-input-row`,style:i({paddingLeft:12+t.depth*14+`px`})},[t.type===`directory`?(m(),l(`span`,{key:0,class:o([`tree-arrow`,{expanded:t.expanded}])},[...r[16]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(m(),l(`span`,ct)),(m(),l(`svg`,lt,[u(`use`,{"xlink:href":`#${En(t)}`},null,8,ut)])),v(u(`input`,{ref_for:!0,ref_key:`renameInputRef`,ref:Dn,"onUpdate:modelValue":r[2]||=e=>W.value.value=e,onKeydown:Bn,onBlur:zn,onClick:r[3]||=le(()=>{},[`stop`])},null,544),[[b,W.value.value]])],4)):(m(),l(`div`,{key:1,class:o([`tree-node`,{"tree-node--dir":t.type===`directory`,"tree-node--file":t.type===`file`,"tree-node--active":M.value===t.path,"tree-node--selected":N.value?.path===t.path&&M.value!==t.path}]),style:i({paddingLeft:12+t.depth*14+`px`}),onClick:e=>$e(t),onContextmenu:e=>Fn(e,t)},[t.type===`directory`?(m(),l(`span`,{key:0,class:o([`tree-arrow`,{expanded:t.expanded}])},[...r[17]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(m(),l(`span`,ft)),t.type===`directory`?(m(),l(`svg`,pt,[u(`use`,{"xlink:href":`#${En(t)}`},null,8,mt)])):(m(),l(`svg`,ht,[u(`use`,{"xlink:href":`#${En(t)}`},null,8,gt)])),u(`span`,{class:`tree-name`,title:t.path},[(m(!0),l(_,null,te(Je(t.name),(e,t)=>(m(),l(_,{key:t},[e.hit?(m(),l(`span`,vt,h(e.text),1)):(m(),l(_,{key:1},[s(h(e.text),1)],64))],64))),128))],8,_t),t.loading?(m(),l(`span`,yt)):e(``,!0)],46,dt)),U.value&&U.value.afterNode?.path===t.path?(m(),l(`div`,{key:2,class:`tree-node tree-inline-input-row`,style:i({paddingLeft:12+U.value.depth*14+`px`})},[r[20]||=u(`span`,{class:`tree-arrow-spacer`},null,-1),U.value.kind===`directory`?(m(),l(`svg`,bt,[...r[18]||=[u(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`},null,-1)]])):(m(),l(`svg`,xt,[...r[19]||=[u(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),u(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),v(u(`input`,{ref_for:!0,ref_key:`inlineInputRef`,ref:G,class:`tree-inline-input`,"onUpdate:modelValue":r[4]||=e=>U.value.value=e,placeholder:U.value.kind===`file`?d(D)(`@EDITOR:输入文件名`):d(D)(`@EDITOR:输入文件夹名`),onKeydown:Nn,onBlur:jn,onClick:r[5]||=le(()=>{},[`stop`])},null,40,St),[[b,U.value.value]])],4)):e(``,!0)],64))),128)),U.value&&U.value.afterNode===null?(m(),l(`div`,Ct,[r[23]||=u(`span`,{class:`tree-arrow-spacer`},null,-1),U.value.kind===`directory`?(m(),l(`svg`,wt,[...r[21]||=[u(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`},null,-1)]])):(m(),l(`svg`,Tt,[...r[22]||=[u(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),u(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),v(u(`input`,{ref_key:`inlineInputRef`,ref:G,class:`tree-inline-input`,"onUpdate:modelValue":r[6]||=e=>U.value.value=e,placeholder:U.value.kind===`file`?d(D)(`@EDITOR:输入文件名`):d(D)(`@EDITOR:输入文件夹名`),onKeydown:Nn,onBlur:jn,onClick:r[7]||=le(()=>{},[`stop`])},null,40,Et),[[b,U.value.value]])])):e(``,!0),!U.value&&(qe.value||T.value.length===0)?(m(),l(`div`,Dt,h(qe.value?d(D)(`@EDITOR:未找到匹配文件`):d(D)(`@EDITOR:暂无文件`)),1)):e(``,!0)]))],4),u(`div`,{class:`editor-resizer`,onMousedown:Cn},null,32),u(`div`,kt,[j.value.length>0?(m(),l(`div`,At,[(m(!0),l(_,null,te(j.value,t=>(m(),l(`div`,{key:t.path,class:o([`editor-tab`,{active:M.value===t.path,dirty:t.isDirty}]),onClick:e=>M.value=t.path,title:t.path},[u(`span`,Mt,h(t.name),1),t.isDirty?(m(),l(`span`,Nt)):e(``,!0),u(`button`,{class:`tab-close`,onClick:e=>et(t.path,e)},[...r[25]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[u(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),u(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Pt)],10,jt))),128)),r[29]||=u(`div`,{class:`editor-tabs-spacer`},null,-1),rr.value?(m(),l(`button`,{key:0,class:o([`preview-toggle-btn`,{active:J.value}]),title:J.value?d(D)(`@EDITOR:关闭预览`):d(D)(`@EDITOR:打开预览`),onClick:ar},[r[26]||=u(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z`}),u(`circle`,{cx:`12`,cy:`12`,r:`3`})],-1),u(`span`,null,h(d(D)(`@EDITOR:预览`)),1)],10,Ft)):e(``,!0),$.value?(m(),l(`button`,{key:1,class:o([`preview-toggle-btn mindmap-toggle-btn`,{active:Y.value,disabled:!$.value}]),disabled:!$.value,title:$.value?Y.value?d(D)(`@EDITOR:关闭思维导图`):d(D)(`@EDITOR:打开思维导图`):d(D)(`@EDITOR:需要至少一个 # 标题`),onClick:or},[r[27]||=ae(`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-c65c2d3f><circle cx="12" cy="12" r="2" data-v-c65c2d3f></circle><circle cx="5" cy="6" r="1.6" data-v-c65c2d3f></circle><circle cx="19" cy="6" r="1.6" data-v-c65c2d3f></circle><circle cx="5" cy="18" r="1.6" data-v-c65c2d3f></circle><circle cx="19" cy="18" r="1.6" data-v-c65c2d3f></circle><line x1="11" y1="11" x2="6.4" y2="7" data-v-c65c2d3f></line><line x1="13" y1="11" x2="17.6" y2="7" data-v-c65c2d3f></line><line x1="11" y1="13" x2="6.4" y2="17" data-v-c65c2d3f></line><line x1="13" y1="13" x2="17.6" y2="17" data-v-c65c2d3f></line></svg>`,1),u(`span`,null,h(d(D)(`@EDITOR:思维导图`)),1)],10,It)):e(``,!0),u(`button`,{class:o([`preview-toggle-btn agent-toggle-btn`,{active:X.value}]),title:X.value?d(D)(`@EDITOR:关闭 g ai 对话`):d(D)(`@EDITOR:打开 g ai 对话`),onClick:sr},[r[28]||=u(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M12 3l1.9 4.6L18.5 9.5l-4.6 1.9L12 16l-1.9-4.6L5.5 9.5l4.6-1.9z`}),u(`path`,{d:`M18 16.5l.9 2.1 2.1.9-2.1.9-.9 2.1-.9-2.1-2.1-.9 2.1-.9z`})],-1),u(`span`,null,h(d(D)(`@EDITOR:g ai 对话`)),1)],10,Lt)])):e(``,!0),j.value.length===0?(m(),t(je,{key:1,class:`editor-empty`,title:d(D)(`@EDITOR:从左侧选择文件打开`),hint:d(D)(`@EDITOR:Ctrl+S 保存`)},{icon:se(()=>[...r[30]||=[u(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),u(`polyline`,{points:`14 2 14 8 20 8`})],-1)]]),_:1},8,[`title`,`hint`])):e(``,!0),u(`div`,Rt,[u(`div`,{class:o([`monaco-container`,{hidden:j.value.length===0||tr.value||nr.value}]),ref_key:`editorContainerRef`,ref:tn},null,2),tr.value&&j.value.length>0&&!J.value&&!Y.value?(m(),l(`div`,zt,[(m(),l(`svg`,Bt,[...r[31]||=[u(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`},null,-1),u(`circle`,{cx:`9`,cy:`9`,r:`2`},null,-1),u(`path`,{d:`m21 15-5-5L5 21`},null,-1)]])),u(`p`,Vt,h(Z.value?.name),1),u(`p`,Ht,h(d(D)(`@EDITOR:这是图片文件,已在右侧预览面板中打开`)),1)])):e(``,!0),(J.value||Y.value||X.value)&&j.value.length>0?(m(),l(`div`,{key:1,class:`preview-resizer`,onMousedown:fr},null,32)):e(``,!0),$n.value?v((m(),t(it,{key:2,active:X.value&&j.value.length>0,"active-file-path":M.value,"active-file-name":Z.value?.name??``,style:i({flexBasis:er.value+`px`}),onClose:r[8]||=e=>X.value=!1},null,8,[`active`,`active-file-path`,`active-file-name`,`style`])),[[re,X.value&&j.value.length>0]]):e(``,!0),(J.value||Y.value)&&j.value.length>0?(m(),l(`div`,{key:3,class:`preview-panel`,style:i({flexBasis:er.value+`px`})},[u(`div`,Ut,[u(`span`,Wt,h(Y.value?d(D)(`@EDITOR:思维导图`):d(D)(`@EDITOR:预览`)),1),u(`span`,Gt,h(Q.value.toUpperCase()),1),r[33]||=u(`div`,{class:`preview-header-spacer`},null,-1),u(`button`,{class:`preview-close-btn`,title:Y.value?d(D)(`@EDITOR:关闭思维导图`):d(D)(`@EDITOR:关闭预览`),onClick:r[9]||=e=>Y.value?Y.value=!1:J.value=!1},[...r[32]||=[u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[u(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),u(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Kt)]),u(`div`,qt,[Y.value&&Q.value===`md`&&Z.value?(m(),t(Ye,{key:0,content:Z.value.content,class:`preview-mindmap`},null,8,[`content`])):J.value&&Q.value===`md`&&Z.value?(m(),t(De,{key:Z.value.path,content:Z.value.content,class:`preview-markdown`},null,8,[`content`])):J.value&&[`html`,`htm`,`svg`].includes(Q.value)?(m(),l(`iframe`,{key:2,class:`preview-iframe`,sandbox:d(Ne),srcdoc:cr.value},null,8,Jt)):J.value&&d(Qn).has(Q.value)&&Z.value?(m(),t(Oe,{key:3,"file-path":Z.value.path,"file-name":Z.value.name},null,8,[`file-path`,`file-name`])):J.value&&nr.value&&Z.value?(m(),t(Me,{key:4,"file-path":Z.value.path},null,8,[`file-path`])):e(``,!0)])],4)):e(``,!0)])])],512),(m(),t(ne,{to:`body`},[K.value?(m(),l(`div`,{key:0,ref_key:`ctxMenuRef`,ref:Pn,class:`ctx-menu`,style:i({left:K.value.x+`px`,top:K.value.y+`px`}),onClick:r[10]||=le(()=>{},[`stop`])},[u(`button`,{class:`ctx-menu-item`,onClick:In},[r[34]||=u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),u(`polyline`,{points:`14 2 14 8 20 8`}),u(`line`,{x1:`12`,y1:`13`,x2:`12`,y2:`19`}),u(`line`,{x1:`9`,y1:`16`,x2:`15`,y2:`16`})],-1),s(` `+h(d(D)(`@EDITOR:新建文件`)),1)]),u(`button`,{class:`ctx-menu-item`,onClick:Ln},[r[35]||=u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}),u(`line`,{x1:`12`,y1:`11`,x2:`12`,y2:`17`}),u(`line`,{x1:`9`,y1:`14`,x2:`15`,y2:`14`})],-1),s(` `+h(d(D)(`@EDITOR:新建文件夹`)),1)]),r[42]||=u(`div`,{class:`ctx-menu-sep`},null,-1),u(`button`,{class:`ctx-menu-item`,onClick:Gn},[r[36]||=u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),u(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})],-1),s(` `+h(d(D)(`@EDITOR:复制绝对路径`)),1)]),u(`button`,{class:`ctx-menu-item`,onClick:Kn},[r[37]||=u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}),u(`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`})],-1),s(` `+h(d(D)(`@EDITOR:复制相对路径`)),1)]),r[43]||=u(`div`,{class:`ctx-menu-sep`},null,-1),Yn.value?(m(),l(`button`,{key:0,class:`ctx-menu-item`,onClick:Xn},[r[38]||=u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`circle`,{cx:`12`,cy:`12`,r:`9`}),u(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),u(`path`,{d:`M12 3a13 13 0 0 1 3.5 9 13 13 0 0 1-3.5 9 13 13 0 0 1-3.5-9A13 13 0 0 1 12 3z`})],-1),s(` `+h(d(D)(`@EDITOR:在浏览器中打开`)),1)])):e(``,!0),u(`button`,{class:`ctx-menu-item`,onClick:Hn},[r[39]||=u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}),u(`path`,{d:`M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2`})],-1),s(` `+h(d(D)(`@EDITOR:在资源管理器中打开`)),1)]),u(`button`,{class:`ctx-menu-item`,onClick:qn},[c(fe,{"icon-class":`vscode`,"class-name":`ctx-menu-icon`}),s(` `+h(d(D)(`@EDITOR:在 VSCode 中打开`)),1)]),u(`button`,{class:`ctx-menu-item`,onClick:Rn},[r[40]||=u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),u(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`})],-1),s(` `+h(d(D)(`@EDITOR:重命名`)),1)]),u(`button`,{class:`ctx-menu-item ctx-menu-item--danger`,onClick:Vn},[r[41]||=u(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[u(`polyline`,{points:`3 6 5 6 21 6`}),u(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),u(`path`,{d:`M10 11v6`}),u(`path`,{d:`M14 11v6`}),u(`path`,{d:`M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2`})],-1),s(` `+h(d(D)(`@EDITOR:删除`)),1)])],4)):e(``,!0)]))],64))}}),[[`__scopeId`,`data-v-c65c2d3f`]]);export{Zt as default};