@medemagroup/bgc-viewer-components 0.3.0 → 0.3.7
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.
|
@@ -1,50 +1,34 @@
|
|
|
1
|
-
(function(Xe,Jt){typeof exports=="object"&&typeof module<"u"?Jt(exports,require("d3")):typeof define=="function"&&define.amd?define(["exports","d3"],Jt):(Xe=typeof globalThis<"u"?globalThis:Xe||self,Jt(Xe.BGCViewerComponents={},Xe.d3))})(this,function(Xe,Jt){"use strict";function ll(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const be=ll(Jt);/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* @license MIT
|
|
9
|
-
**/let Ne;class _l{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Ne,!t&&Ne&&(this.index=(Ne.scopes||(Ne.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Ne;try{return Ne=this,t()}finally{Ne=n}}}on(){++this._on===1&&(this.prevScope=Ne,Ne=this)}off(){this._on>0&&--this._on===0&&(Ne=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function wl(){return Ne}let me;const As=new WeakSet;class Mr{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ne&&Ne.active&&Ne.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,As.has(this)&&(As.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Dr(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Hr(this),Nr(this);const t=me,n=Ye;me=this,Ye=!0;try{return this.fn()}finally{jr(this),me=t,Ye=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ps(t);this.deps=this.depsTail=void 0,Hr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?As.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Os(this)&&this.run()}get dirty(){return Os(this)}}let Ir=0,Zt,en;function Dr(e,t=!1){if(e.flags|=8,t){e.next=en,en=e;return}e.next=Zt,Zt=e}function ks(){Ir++}function Rs(){if(--Ir>0)return;if(en){let t=en;for(en=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Zt;){let t=Zt;for(Zt=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Nr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function jr(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Ps(s),vl(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Os(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Br(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Br(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===tn)||(e.globalVersion=tn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Os(e))))return;e.flags|=2;const t=e.dep,n=me,s=Ye;me=e,Ye=!0;try{Nr(e);const r=e.fn(e._value);(t.version===0||yt(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{me=n,Ye=s,jr(e),e.flags&=-3}}function Ps(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Ps(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function vl(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ye=!0;const $r=[];function st(){$r.push(Ye),Ye=!1}function rt(){const e=$r.pop();Ye=e===void 0?!0:e}function Hr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=me;me=void 0;try{t()}finally{me=n}}}let tn=0;class xl{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ls{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!me||!Ye||me===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==me)n=this.activeLink=new xl(me,this),me.deps?(n.prevDep=me.depsTail,me.depsTail.nextDep=n,me.depsTail=n):me.deps=me.depsTail=n,Ur(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=me.depsTail,n.nextDep=void 0,me.depsTail.nextDep=n,me.depsTail=n,me.deps===n&&(me.deps=s)}return n}trigger(t){this.version++,tn++,this.notify(t)}notify(t){ks();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Rs()}}}function Ur(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Ur(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Fs=new WeakMap,Tt=Symbol(""),Ms=Symbol(""),nn=Symbol("");function Re(e,t,n){if(Ye&&me){let s=Fs.get(e);s||Fs.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Ls),r.map=s,r.key=n),r.track()}}function dt(e,t,n,s,r,i){const o=Fs.get(e);if(!o){tn++;return}const l=a=>{a&&a.trigger()};if(ks(),t==="clear")o.forEach(l);else{const a=z(e),u=a&&xs(n);if(a&&n==="length"){const c=Number(s);o.forEach((f,h)=>{(h==="length"||h===nn||!nt(h)&&h>=c)&&l(f)})}else switch((n!==void 0||o.has(void 0))&&l(o.get(n)),u&&l(o.get(nn)),t){case"add":a?u&&l(o.get("length")):(l(o.get(Tt)),It(e)&&l(o.get(Ms)));break;case"delete":a||(l(o.get(Tt)),It(e)&&l(o.get(Ms)));break;case"set":It(e)&&l(o.get(Tt));break}}Rs()}function Nt(e){const t=re(e);return t===e?t:(Re(t,"iterate",nn),Ge(e)?t:t.map(Ce))}function Dn(e){return Re(e=re(e),"iterate",nn),e}const Sl={__proto__:null,[Symbol.iterator](){return Is(this,Symbol.iterator,Ce)},concat(...e){return Nt(this).concat(...e.map(t=>z(t)?Nt(t):t))},entries(){return Is(this,"entries",e=>(e[1]=Ce(e[1]),e))},every(e,t){return ht(this,"every",e,t,void 0,arguments)},filter(e,t){return ht(this,"filter",e,t,n=>n.map(Ce),arguments)},find(e,t){return ht(this,"find",e,t,Ce,arguments)},findIndex(e,t){return ht(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ht(this,"findLast",e,t,Ce,arguments)},findLastIndex(e,t){return ht(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ht(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ds(this,"includes",e)},indexOf(...e){return Ds(this,"indexOf",e)},join(e){return Nt(this).join(e)},lastIndexOf(...e){return Ds(this,"lastIndexOf",e)},map(e,t){return ht(this,"map",e,t,void 0,arguments)},pop(){return sn(this,"pop")},push(...e){return sn(this,"push",e)},reduce(e,...t){return qr(this,"reduce",e,t)},reduceRight(e,...t){return qr(this,"reduceRight",e,t)},shift(){return sn(this,"shift")},some(e,t){return ht(this,"some",e,t,void 0,arguments)},splice(...e){return sn(this,"splice",e)},toReversed(){return Nt(this).toReversed()},toSorted(e){return Nt(this).toSorted(e)},toSpliced(...e){return Nt(this).toSpliced(...e)},unshift(...e){return sn(this,"unshift",e)},values(){return Is(this,"values",Ce)}};function Is(e,t,n){const s=Dn(e),r=s[t]();return s!==e&&!Ge(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.value&&(i.value=n(i.value)),i}),r}const Cl=Array.prototype;function ht(e,t,n,s,r,i){const o=Dn(e),l=o!==e&&!Ge(e),a=o[t];if(a!==Cl[t]){const f=a.apply(e,i);return l?Ce(f):f}let u=n;o!==e&&(l?u=function(f,h){return n.call(this,Ce(f),h,e)}:n.length>2&&(u=function(f,h){return n.call(this,f,h,e)}));const c=a.call(o,u,s);return l&&r?r(c):c}function qr(e,t,n,s){const r=Dn(e);let i=n;return r!==e&&(Ge(e)?n.length>3&&(i=function(o,l,a){return n.call(this,o,l,a,e)}):i=function(o,l,a){return n.call(this,o,Ce(l),a,e)}),r[t](i,...s)}function Ds(e,t,n){const s=re(e);Re(s,"iterate",nn);const r=s[t](...n);return(r===-1||r===!1)&&Bs(n[0])?(n[0]=re(n[0]),s[t](...n)):r}function sn(e,t,n=[]){st(),ks();const s=re(e)[t].apply(e,n);return Rs(),rt(),s}const Tl=_s("__proto__,__v_isRef,__isVue"),Vr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(nt));function El(e){nt(e)||(e=String(e));const t=re(this);return Re(t,"has",e),t.hasOwnProperty(e)}class zr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Yr:Xr:i?Jr:Gr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=z(t);if(!r){let a;if(o&&(a=Sl[n]))return a;if(n==="hasOwnProperty")return El}const l=Reflect.get(t,n,Te(t)?t:s);return(nt(n)?Vr.has(n):Tl(n))||(r||Re(t,"get",n),i)?l:Te(l)?o&&xs(n)?l:l.value:ge(l)?r?Qr(l):js(l):l}}class Wr extends zr{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];if(!this._isShallow){const a=bt(i);if(!Ge(s)&&!bt(s)&&(i=re(i),s=re(s)),!z(t)&&Te(i)&&!Te(s))return a?!1:(i.value=s,!0)}const o=z(t)&&xs(n)?Number(n)<t.length:le(t,n),l=Reflect.set(t,n,s,Te(t)?t:r);return t===re(r)&&(o?yt(s,i)&&dt(t,"set",n,s):dt(t,"add",n,s)),l}deleteProperty(t,n){const s=le(t,n);t[n];const r=Reflect.deleteProperty(t,n);return r&&s&&dt(t,"delete",n,void 0),r}has(t,n){const s=Reflect.has(t,n);return(!nt(n)||!Vr.has(n))&&Re(t,"has",n),s}ownKeys(t){return Re(t,"iterate",z(t)?"length":Tt),Reflect.ownKeys(t)}}class Kr extends zr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Al=new Wr,kl=new Kr,Rl=new Wr(!0),Ol=new Kr(!0),Ns=e=>e,Nn=e=>Reflect.getPrototypeOf(e);function Pl(e,t,n){return function(...s){const r=this.__v_raw,i=re(r),o=It(i),l=e==="entries"||e===Symbol.iterator&&o,a=e==="keys"&&o,u=r[e](...s),c=n?Ns:t?Hn:Ce;return!t&&Re(i,"iterate",a?Ms:Tt),{next(){const{value:f,done:h}=u.next();return h?{value:f,done:h}:{value:l?[c(f[0]),c(f[1])]:c(f),done:h}},[Symbol.iterator](){return this}}}}function jn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ll(e,t){const n={get(r){const i=this.__v_raw,o=re(i),l=re(r);e||(yt(r,l)&&Re(o,"get",r),Re(o,"get",l));const{has:a}=Nn(o),u=t?Ns:e?Hn:Ce;if(a.call(o,r))return u(i.get(r));if(a.call(o,l))return u(i.get(l));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&Re(re(r),"iterate",Tt),Reflect.get(r,"size",r)},has(r){const i=this.__v_raw,o=re(i),l=re(r);return e||(yt(r,l)&&Re(o,"has",r),Re(o,"has",l)),r===l?i.has(r):i.has(r)||i.has(l)},forEach(r,i){const o=this,l=o.__v_raw,a=re(l),u=t?Ns:e?Hn:Ce;return!e&&Re(a,"iterate",Tt),l.forEach((c,f)=>r.call(i,u(c),u(f),o))}};return xe(n,e?{add:jn("add"),set:jn("set"),delete:jn("delete"),clear:jn("clear")}:{add(r){!t&&!Ge(r)&&!bt(r)&&(r=re(r));const i=re(this);return Nn(i).has.call(i,r)||(i.add(r),dt(i,"add",r,r)),this},set(r,i){!t&&!Ge(i)&&!bt(i)&&(i=re(i));const o=re(this),{has:l,get:a}=Nn(o);let u=l.call(o,r);u||(r=re(r),u=l.call(o,r));const c=a.call(o,r);return o.set(r,i),u?yt(i,c)&&dt(o,"set",r,i):dt(o,"add",r,i),this},delete(r){const i=re(this),{has:o,get:l}=Nn(i);let a=o.call(i,r);a||(r=re(r),a=o.call(i,r)),l&&l.call(i,r);const u=i.delete(r);return a&&dt(i,"delete",r,void 0),u},clear(){const r=re(this),i=r.size!==0,o=r.clear();return i&&dt(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Pl(r,e,t)}),n}function Bn(e,t){const n=Ll(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(le(n,r)&&r in s?n:s,r,i)}const Fl={get:Bn(!1,!1)},Ml={get:Bn(!1,!0)},Il={get:Bn(!0,!1)},Dl={get:Bn(!0,!0)},Gr=new WeakMap,Jr=new WeakMap,Xr=new WeakMap,Yr=new WeakMap;function Nl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function jl(e){return e.__v_skip||!Object.isExtensible(e)?0:Nl(ul(e))}function js(e){return bt(e)?e:$n(e,!1,Al,Fl,Gr)}function Bl(e){return $n(e,!1,Rl,Ml,Jr)}function Qr(e){return $n(e,!0,kl,Il,Xr)}function Zd(e){return $n(e,!0,Ol,Dl,Yr)}function $n(e,t,n,s,r){if(!ge(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=jl(e);if(i===0)return e;const o=r.get(e);if(o)return o;const l=new Proxy(e,i===2?s:n);return r.set(e,l),l}function jt(e){return bt(e)?jt(e.__v_raw):!!(e&&e.__v_isReactive)}function bt(e){return!!(e&&e.__v_isReadonly)}function Ge(e){return!!(e&&e.__v_isShallow)}function Bs(e){return e?!!e.__v_raw:!1}function re(e){const t=e&&e.__v_raw;return t?re(t):e}function $l(e){return!le(e,"__v_skip")&&Object.isExtensible(e)&&Cs(e,"__v_skip",!0),e}const Ce=e=>ge(e)?js(e):e,Hn=e=>ge(e)?Qr(e):e;function Te(e){return e?e.__v_isRef===!0:!1}function de(e){return Hl(e,!1)}function Hl(e,t){return Te(e)?e:new Ul(e,t)}class Ul{constructor(t,n){this.dep=new Ls,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:re(t),this._value=n?t:Ce(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Ge(t)||bt(t);t=s?t:re(t),yt(t,n)&&(this._rawValue=t,this._value=s?t:Ce(t),this.dep.trigger())}}function Zr(e){return Te(e)?e.value:e}const ql={get:(e,t,n)=>t==="__v_raw"?e:Zr(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return Te(r)&&!Te(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function ei(e){return jt(e)?e:new Proxy(e,ql)}class Vl{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ls(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=tn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&me!==this)return Dr(this,!0),!0}get value(){const t=this.dep.track();return Br(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function zl(e,t,n=!1){let s,r;return X(e)?s=e:(s=e.get,r=e.set),new Vl(s,r,n)}const Un={},qn=new WeakMap;let Et;function Wl(e,t=!1,n=Et){if(n){let s=qn.get(n);s||qn.set(n,s=[]),s.push(e)}}function Kl(e,t,n=pe){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:l,call:a}=n,u=j=>r?j:Ge(j)||r===!1||r===0?pt(j,1):pt(j);let c,f,h,g,b=!1,v=!1;if(Te(e)?(f=()=>e.value,b=Ge(e)):jt(e)?(f=()=>u(e),b=!0):z(e)?(v=!0,b=e.some(j=>jt(j)||Ge(j)),f=()=>e.map(j=>{if(Te(j))return j.value;if(jt(j))return u(j);if(X(j))return a?a(j,2):j()})):X(e)?t?f=a?()=>a(e,2):e:f=()=>{if(h){st();try{h()}finally{rt()}}const j=Et;Et=c;try{return a?a(e,3,[g]):e(g)}finally{Et=j}}:f=tt,t&&r){const j=f,K=r===!0?1/0:r;f=()=>pt(j(),K)}const A=wl(),$=()=>{c.stop(),A&&A.active&&vs(A.effects,c)};if(i&&t){const j=t;t=(...K)=>{j(...K),$()}}let H=v?new Array(e.length).fill(Un):Un;const W=j=>{if(!(!(c.flags&1)||!c.dirty&&!j))if(t){const K=c.run();if(r||b||(v?K.some((ae,he)=>yt(ae,H[he])):yt(K,H))){h&&h();const ae=Et;Et=c;try{const he=[K,H===Un?void 0:v&&H[0]===Un?[]:H,g];H=K,a?a(t,3,he):t(...he)}finally{Et=ae}}}else c.run()};return l&&l(W),c=new Mr(f),c.scheduler=o?()=>o(W,!1):W,g=j=>Wl(j,!1,c),h=c.onStop=()=>{const j=qn.get(c);if(j){if(a)a(j,4);else for(const K of j)K();qn.delete(c)}},t?s?W(!0):H=c.run():o?o(W.bind(null,!0),!0):c.run(),$.pause=c.pause.bind(c),$.resume=c.resume.bind(c),$.stop=$,$}function pt(e,t=1/0,n){if(t<=0||!ge(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,Te(e))pt(e.value,t,n);else if(z(e))for(let s=0;s<e.length;s++)pt(e[s],t,n);else if(Dt(e)||It(e))e.forEach(s=>{pt(s,t,n)});else if(On(e)){for(const s in e)pt(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&pt(e[s],t,n)}return e}/**
|
|
10
|
-
* @vue/runtime-core v3.5.18
|
|
11
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
-
* @license MIT
|
|
13
|
-
**/const rn=[];let $s=!1;function eh(e,...t){if($s)return;$s=!0,st();const n=rn.length?rn[rn.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=Gl();if(s)Bt(s,n,11,[e+t.map(i=>{var o,l;return(l=(o=i.toString)==null?void 0:o.call(i))!=null?l:JSON.stringify(i)}).join(""),n&&n.proxy,r.map(({vnode:i})=>`at <${Ji(n,i.type)}>`).join(`
|
|
14
|
-
`),r]);else{const i=[`[Vue warn]: ${e}`,...t];r.length&&i.push(`
|
|
15
|
-
`,...Jl(r)),console.warn(...i)}rt(),$s=!1}function Gl(){let e=rn[rn.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const s=e.component&&e.component.parent;e=s&&s.vnode}return t}function Jl(e){const t=[];return e.forEach((n,s)=>{t.push(...s===0?[]:[`
|
|
16
|
-
`],...Xl(n))}),t}function Xl({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${Ji(e.component,e.type,s)}`,i=">"+n;return e.props?[r,...Yl(e.props),i]:[r+i]}function Yl(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...ti(s,e[s]))}),n.length>3&&t.push(" ..."),t}function ti(e,t,n){return _e(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Te(t)?(t=ti(e,re(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):X(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=re(t),n?t:[`${e}=`,t])}function Bt(e,t,n,s){try{return s?e(...s):e()}catch(r){Vn(r,t,n)}}function it(e,t,n,s){if(X(e)){const r=Bt(e,t,n,s);return r&&Er(r)&&r.catch(i=>{Vn(i,t,n)}),r}if(z(e)){const r=[];for(let i=0;i<e.length;i++)r.push(it(e[i],t,n,s));return r}}function Vn(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||pe;if(t){let l=t.parent;const a=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,a,u)===!1)return}l=l.parent}if(i){st(),Bt(i,null,10,[e,a,u]),rt();return}}Ql(e,n,r,s,o)}function Ql(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}const Me=[];let ot=-1;const $t=[];let _t=null,Ht=0;const ni=Promise.resolve();let zn=null;function Wn(e){const t=zn||ni;return e?t.then(this?e.bind(this):e):t}function Zl(e){let t=ot+1,n=Me.length;for(;t<n;){const s=t+n>>>1,r=Me[s],i=on(r);i<e||i===e&&r.flags&2?t=s+1:n=s}return t}function Hs(e){if(!(e.flags&1)){const t=on(e),n=Me[Me.length-1];!n||!(e.flags&2)&&t>=on(n)?Me.push(e):Me.splice(Zl(t),0,e),e.flags|=1,si()}}function si(){zn||(zn=ni.then(oi))}function ea(e){z(e)?$t.push(...e):_t&&e.id===-1?_t.splice(Ht+1,0,e):e.flags&1||($t.push(e),e.flags|=1),si()}function ri(e,t,n=ot+1){for(;n<Me.length;n++){const s=Me[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Me.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function ii(e){if($t.length){const t=[...new Set($t)].sort((n,s)=>on(n)-on(s));if($t.length=0,_t){_t.push(...t);return}for(_t=t,Ht=0;Ht<_t.length;Ht++){const n=_t[Ht];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}_t=null,Ht=0}}const on=e=>e.id==null?e.flags&2?-1:1/0:e.id;function oi(e){try{for(ot=0;ot<Me.length;ot++){const t=Me[ot];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Bt(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ot<Me.length;ot++){const t=Me[ot];t&&(t.flags&=-2)}ot=-1,Me.length=0,ii(),zn=null,(Me.length||$t.length)&&oi()}}let He=null,li=null;function Kn(e){const t=He;return He=e,li=e&&e.type.__scopeId||null,t}function ta(e,t=He,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&Hi(-1);const i=Kn(t);let o;try{o=e(...r)}finally{Kn(i),s._d&&Hi(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Us(e,t){if(He===null)return e;const n=ns(He),s=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[i,o,l,a=pe]=t[r];i&&(X(i)&&(i={mounted:i,updated:i}),i.deep&&pt(o),s.push({dir:i,instance:n,value:o,oldValue:void 0,arg:l,modifiers:a}))}return e}function At(e,t,n,s){const r=e.dirs,i=t&&t.dirs;for(let o=0;o<r.length;o++){const l=r[o];i&&(l.oldValue=i[o].value);let a=l.dir[s];a&&(st(),it(a,n,8,[e.el,l,e,t]),rt())}}const na=Symbol("_vte"),sa=e=>e.__isTeleport;function qs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,qs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function ra(e,t){return X(e)?xe({name:e.name},t,{setup:e}):e}function ai(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ln(e,t,n,s,r=!1){if(z(e)){e.forEach((b,v)=>ln(b,t&&(z(t)?t[v]:t),n,s,r));return}if(an(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ln(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?ns(s.component):s.el,o=r?null:i,{i:l,r:a}=e,u=t&&t.r,c=l.refs===pe?l.refs={}:l.refs,f=l.setupState,h=re(f),g=f===pe?()=>!1:b=>le(h,b);if(u!=null&&u!==a&&(_e(u)?(c[u]=null,g(u)&&(f[u]=null)):Te(u)&&(u.value=null)),X(a))Bt(a,l,12,[o,c]);else{const b=_e(a),v=Te(a);if(b||v){const A=()=>{if(e.f){const $=b?g(a)?f[a]:c[a]:a.value;r?z($)&&vs($,i):z($)?$.includes(i)||$.push(i):b?(c[a]=[i],g(a)&&(f[a]=c[a])):(a.value=[i],e.k&&(c[e.k]=a.value))}else b?(c[a]=o,g(a)&&(f[a]=o)):v&&(a.value=o,e.k&&(c[e.k]=o))};o?(A.id=-1,Ue(A,n)):A()}}}Mn().requestIdleCallback,Mn().cancelIdleCallback;const an=e=>!!e.type.__asyncLoader,ci=e=>e.type.__isKeepAlive;function ia(e,t){ui(e,"a",t)}function oa(e,t){ui(e,"da",t)}function ui(e,t,n=Oe){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Gn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)ci(r.parent.vnode)&&la(s,t,n,r),r=r.parent}}function la(e,t,n,s){const r=Gn(t,e,s,!0);zs(()=>{vs(s[t],r)},n)}function Gn(e,t,n=Oe,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{st();const l=gn(n),a=it(t,n,e,o);return l(),rt(),a});return s?r.unshift(i):r.push(i),i}}const gt=e=>(t,n=Oe)=>{(!mn||e==="sp")&&Gn(e,(...s)=>t(...s),n)},aa=gt("bm"),Vs=gt("m"),ca=gt("bu"),ua=gt("u"),fa=gt("bum"),zs=gt("um"),da=gt("sp"),ha=gt("rtg"),pa=gt("rtc");function ga(e,t=Oe){Gn("ec",e,t)}const fi="components";function cn(e,t){return pi(fi,e,!0,t)||e}const di=Symbol.for("v-ndc");function hi(e){return _e(e)?pi(fi,e,!1)||e:e||di}function pi(e,t,n=!0,s=!1){const r=He||Oe;if(r){const i=r.type;{const l=Gi(i,!1);if(l&&(l===t||l===Fe(t)||l===Ln(Fe(t))))return i}const o=gi(r[e]||i[e],t)||gi(r.appContext[e],t);return!o&&s?i:o}}function gi(e,t){return e&&(e[t]||e[Fe(t)]||e[Ln(Fe(t))])}function Qe(e,t,n,s){let r;const i=n,o=z(e);if(o||_e(e)){const l=o&&jt(e);let a=!1,u=!1;l&&(a=!Ge(e),u=bt(e),e=Dn(e)),r=new Array(e.length);for(let c=0,f=e.length;c<f;c++)r[c]=t(a?u?Hn(Ce(e[c])):Ce(e[c]):e[c],c,void 0,i)}else if(typeof e=="number"){r=new Array(e);for(let l=0;l<e;l++)r[l]=t(l+1,l,void 0,i)}else if(ge(e))if(e[Symbol.iterator])r=Array.from(e,(l,a)=>t(l,a,void 0,i));else{const l=Object.keys(e);r=new Array(l.length);for(let a=0,u=l.length;a<u;a++){const c=l[a];r[a]=t(e[c],c,a,i)}}else r=[];return r}const Ws=e=>e?zi(e)?ns(e):Ws(e.parent):null,un=xe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ws(e.parent),$root:e=>Ws(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>_i(e),$forceUpdate:e=>e.f||(e.f=()=>{Hs(e.update)}),$nextTick:e=>e.n||(e.n=Wn.bind(e.proxy)),$watch:e=>Na.bind(e)}),Ks=(e,t)=>e!==pe&&!e.__isScriptSetup&&le(e,t),ma={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:a}=e;let u;if(t[0]!=="$"){const g=o[t];if(g!==void 0)switch(g){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(Ks(s,t))return o[t]=1,s[t];if(r!==pe&&le(r,t))return o[t]=2,r[t];if((u=e.propsOptions[0])&&le(u,t))return o[t]=3,i[t];if(n!==pe&&le(n,t))return o[t]=4,n[t];Gs&&(o[t]=0)}}const c=un[t];let f,h;if(c)return t==="$attrs"&&Re(e.attrs,"get",""),c(e);if((f=l.__cssModules)&&(f=f[t]))return f;if(n!==pe&&le(n,t))return o[t]=4,n[t];if(h=a.config.globalProperties,le(h,t))return h[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return Ks(r,t)?(r[t]=n,!0):s!==pe&&le(s,t)?(s[t]=n,!0):le(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let l;return!!n[o]||e!==pe&&le(e,o)||Ks(t,o)||(l=i[0])&&le(l,o)||le(s,o)||le(un,o)||le(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:le(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function mi(e){return z(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Gs=!0;function ya(e){const t=_i(e),n=e.proxy,s=e.ctx;Gs=!1,t.beforeCreate&&yi(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:a,inject:u,created:c,beforeMount:f,mounted:h,beforeUpdate:g,updated:b,activated:v,deactivated:A,beforeDestroy:$,beforeUnmount:H,destroyed:W,unmounted:j,render:K,renderTracked:ae,renderTriggered:he,errorCaptured:Se,serverPrefetch:R,expose:C,inheritAttrs:L,components:J,directives:se,filters:ce}=t;if(u&&ba(u,s,null),o)for(const Q in o){const Z=o[Q];X(Z)&&(s[Q]=Z.bind(n))}if(r){const Q=r.call(n,n);ge(Q)&&(e.data=js(Q))}if(Gs=!0,i)for(const Q in i){const Z=i[Q],m=X(Z)?Z.bind(n,n):X(Z.get)?Z.get.bind(n,n):tt,w=!X(Z)&&X(Z.set)?Z.set.bind(n):tt,D=je({get:m,set:w});Object.defineProperty(s,Q,{enumerable:!0,configurable:!0,get:()=>D.value,set:M=>D.value=M})}if(l)for(const Q in l)bi(l[Q],s,n,Q);if(a){const Q=X(a)?a.call(n):a;Reflect.ownKeys(Q).forEach(Z=>{Ca(Z,Q[Z])})}c&&yi(c,e,"c");function ee(Q,Z){z(Z)?Z.forEach(m=>Q(m.bind(n))):Z&&Q(Z.bind(n))}if(ee(aa,f),ee(Vs,h),ee(ca,g),ee(ua,b),ee(ia,v),ee(oa,A),ee(ga,Se),ee(pa,ae),ee(ha,he),ee(fa,H),ee(zs,j),ee(da,R),z(C))if(C.length){const Q=e.exposed||(e.exposed={});C.forEach(Z=>{Object.defineProperty(Q,Z,{get:()=>n[Z],set:m=>n[Z]=m,enumerable:!0})})}else e.exposed||(e.exposed={});K&&e.render===tt&&(e.render=K),L!=null&&(e.inheritAttrs=L),J&&(e.components=J),se&&(e.directives=se),R&&ai(e)}function ba(e,t,n=tt){z(e)&&(e=Js(e));for(const s in e){const r=e[s];let i;ge(r)?"default"in r?i=Xn(r.from||s,r.default,!0):i=Xn(r.from||s):i=Xn(r),Te(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function yi(e,t,n){it(z(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function bi(e,t,n,s){let r=s.includes(".")?Di(n,s):()=>n[s];if(_e(e)){const i=t[e];X(i)&&Je(r,i)}else if(X(e))Je(r,e.bind(n));else if(ge(e))if(z(e))e.forEach(i=>bi(i,t,n,s));else{const i=X(e.handler)?e.handler.bind(n):t[e.handler];X(i)&&Je(r,i,e)}}function _i(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let a;return l?a=l:!r.length&&!n&&!s?a=t:(a={},r.length&&r.forEach(u=>Jn(a,u,o,!0)),Jn(a,t,o)),ge(t)&&i.set(t,a),a}function Jn(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&Jn(e,i,n,!0),r&&r.forEach(o=>Jn(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=_a[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const _a={data:wi,props:vi,emits:vi,methods:fn,computed:fn,beforeCreate:Ie,created:Ie,beforeMount:Ie,mounted:Ie,beforeUpdate:Ie,updated:Ie,beforeDestroy:Ie,beforeUnmount:Ie,destroyed:Ie,unmounted:Ie,activated:Ie,deactivated:Ie,errorCaptured:Ie,serverPrefetch:Ie,components:fn,directives:fn,watch:va,provide:wi,inject:wa};function wi(e,t){return t?e?function(){return xe(X(e)?e.call(this,this):e,X(t)?t.call(this,this):t)}:t:e}function wa(e,t){return fn(Js(e),Js(t))}function Js(e){if(z(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ie(e,t){return e?[...new Set([].concat(e,t))]:t}function fn(e,t){return e?xe(Object.create(null),e,t):t}function vi(e,t){return e?z(e)&&z(t)?[...new Set([...e,...t])]:xe(Object.create(null),mi(e),mi(t??{})):t}function va(e,t){if(!e)return t;if(!t)return e;const n=xe(Object.create(null),e);for(const s in t)n[s]=Ie(e[s],t[s]);return n}function xi(){return{app:null,config:{isNativeTag:al,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let xa=0;function Sa(e,t){return function(s,r=null){X(s)||(s=xe({},s)),r!=null&&!ge(r)&&(r=null);const i=xi(),o=new WeakSet,l=[];let a=!1;const u=i.app={_uid:xa++,_component:s,_props:r,_container:null,_context:i,_instance:null,version:oc,get config(){return i.config},set config(c){},use(c,...f){return o.has(c)||(c&&X(c.install)?(o.add(c),c.install(u,...f)):X(c)&&(o.add(c),c(u,...f))),u},mixin(c){return i.mixins.includes(c)||i.mixins.push(c),u},component(c,f){return f?(i.components[c]=f,u):i.components[c]},directive(c,f){return f?(i.directives[c]=f,u):i.directives[c]},mount(c,f,h){if(!a){const g=u._ceVNode||Ee(s,r);return g.appContext=i,h===!0?h="svg":h===!1&&(h=void 0),e(g,c,h),a=!0,u._container=c,c.__vue_app__=u,ns(g.component)}},onUnmount(c){l.push(c)},unmount(){a&&(it(l,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return i.provides[c]=f,u},runWithContext(c){const f=Ut;Ut=u;try{return c()}finally{Ut=f}}};return u}}let Ut=null;function Ca(e,t){if(Oe){let n=Oe.provides;const s=Oe.parent&&Oe.parent.provides;s===n&&(n=Oe.provides=Object.create(s)),n[e]=t}}function Xn(e,t,n=!1){const s=Qa();if(s||Ut){let r=Ut?Ut._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&X(t)?t.call(s&&s.proxy):t}}const Si={},Ci=()=>Object.create(Si),Ti=e=>Object.getPrototypeOf(e)===Si;function Ta(e,t,n,s=!1){const r={},i=Ci();e.propsDefaults=Object.create(null),Ei(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:Bl(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function Ea(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=re(r),[a]=e.propsOptions;let u=!1;if((s||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let h=c[f];if(Yn(e.emitsOptions,h))continue;const g=t[h];if(a)if(le(i,h))g!==i[h]&&(i[h]=g,u=!0);else{const b=Fe(h);r[b]=Xs(a,l,b,g,e,!1)}else g!==i[h]&&(i[h]=g,u=!0)}}}else{Ei(e,t,r,i)&&(u=!0);let c;for(const f in l)(!t||!le(t,f)&&((c=Ke(f))===f||!le(t,c)))&&(a?n&&(n[f]!==void 0||n[c]!==void 0)&&(r[f]=Xs(a,l,f,void 0,e,!0)):delete r[f]);if(i!==l)for(const f in i)(!t||!le(t,f))&&(delete i[f],u=!0)}u&&dt(e.attrs,"set","")}function Ei(e,t,n,s){const[r,i]=e.propsOptions;let o=!1,l;if(t)for(let a in t){if(Yt(a))continue;const u=t[a];let c;r&&le(r,c=Fe(a))?!i||!i.includes(c)?n[c]=u:(l||(l={}))[c]=u:Yn(e.emitsOptions,a)||(!(a in s)||u!==s[a])&&(s[a]=u,o=!0)}if(i){const a=re(n),u=l||pe;for(let c=0;c<i.length;c++){const f=i[c];n[f]=Xs(r,a,f,u[f],e,!le(u,f))}}return o}function Xs(e,t,n,s,r,i){const o=e[n];if(o!=null){const l=le(o,"default");if(l&&s===void 0){const a=o.default;if(o.type!==Function&&!o.skipFactory&&X(a)){const{propsDefaults:u}=r;if(n in u)s=u[n];else{const c=gn(r);s=u[n]=a.call(null,t),c()}}else s=a;r.ce&&r.ce._setProp(n,s)}o[0]&&(i&&!l?s=!1:o[1]&&(s===""||s===Ke(n))&&(s=!0))}return s}const Aa=new WeakMap;function Ai(e,t,n=!1){const s=n?Aa:t.propsCache,r=s.get(e);if(r)return r;const i=e.props,o={},l=[];let a=!1;if(!X(e)){const c=f=>{a=!0;const[h,g]=Ai(f,t,!0);xe(o,h),g&&l.push(...g)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!i&&!a)return ge(e)&&s.set(e,Mt),Mt;if(z(i))for(let c=0;c<i.length;c++){const f=Fe(i[c]);ki(f)&&(o[f]=pe)}else if(i)for(const c in i){const f=Fe(c);if(ki(f)){const h=i[c],g=o[f]=z(h)||X(h)?{type:h}:xe({},h),b=g.type;let v=!1,A=!0;if(z(b))for(let $=0;$<b.length;++$){const H=b[$],W=X(H)&&H.name;if(W==="Boolean"){v=!0;break}else W==="String"&&(A=!1)}else v=X(b)&&b.name==="Boolean";g[0]=v,g[1]=A,(v||le(g,"default"))&&l.push(f)}}const u=[o,l];return ge(e)&&s.set(e,u),u}function ki(e){return e[0]!=="$"&&!Yt(e)}const Ys=e=>e==="_"||e==="__"||e==="_ctx"||e==="$stable",Qs=e=>z(e)?e.map(lt):[lt(e)],ka=(e,t,n)=>{if(t._n)return t;const s=ta((...r)=>Qs(t(...r)),n);return s._c=!1,s},Ri=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Ys(r))continue;const i=e[r];if(X(i))t[r]=ka(r,i,s);else if(i!=null){const o=Qs(i);t[r]=()=>o}}},Oi=(e,t)=>{const n=Qs(t);e.slots.default=()=>n},Pi=(e,t,n)=>{for(const s in t)(n||!Ys(s))&&(e[s]=t[s])},Ra=(e,t,n)=>{const s=e.slots=Ci();if(e.vnode.shapeFlag&32){const r=t.__;r&&Cs(s,"__",r,!0);const i=t._;i?(Pi(s,t,n),n&&Cs(s,"_",i,!0)):Ri(t,s)}else t&&Oi(e,t)},Oa=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=pe;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:Pi(r,t,n):(i=!t.$stable,Ri(t,r)),o=t}else t&&(Oi(e,t),o={default:1});if(i)for(const l in r)!Ys(l)&&o[l]==null&&delete r[l]},Ue=Va;function Pa(e){return La(e)}function La(e,t){const n=Mn();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:a,setText:u,setElementText:c,parentNode:f,nextSibling:h,setScopeId:g=tt,insertStaticContent:b}=e,v=(d,p,_,T=null,x=null,S=null,F=void 0,O=null,k=!!p.dynamicChildren)=>{if(d===p)return;d&&!pn(d,p)&&(T=ut(d),M(d,x,S,!0),d=null),p.patchFlag===-2&&(k=!1,p.dynamicChildren=null);const{type:E,ref:V,shapeFlag:I}=p;switch(E){case Qn:A(d,p,_,T);break;case wt:$(d,p,_,T);break;case er:d==null&&H(p,_,T,F);break;case we:J(d,p,_,T,x,S,F,O,k);break;default:I&1?K(d,p,_,T,x,S,F,O,k):I&6?se(d,p,_,T,x,S,F,O,k):(I&64||I&128)&&E.process(d,p,_,T,x,S,F,O,k,St)}V!=null&&x?ln(V,d&&d.ref,S,p||d,!p):V==null&&d&&d.ref!=null&&ln(d.ref,null,S,d,!0)},A=(d,p,_,T)=>{if(d==null)s(p.el=l(p.children),_,T);else{const x=p.el=d.el;p.children!==d.children&&u(x,p.children)}},$=(d,p,_,T)=>{d==null?s(p.el=a(p.children||""),_,T):p.el=d.el},H=(d,p,_,T)=>{[d.el,d.anchor]=b(d.children,p,_,T,d.el,d.anchor)},W=({el:d,anchor:p},_,T)=>{let x;for(;d&&d!==p;)x=h(d),s(d,_,T),d=x;s(p,_,T)},j=({el:d,anchor:p})=>{let _;for(;d&&d!==p;)_=h(d),r(d),d=_;r(p)},K=(d,p,_,T,x,S,F,O,k)=>{p.type==="svg"?F="svg":p.type==="math"&&(F="mathml"),d==null?ae(p,_,T,x,S,F,O,k):R(d,p,x,S,F,O,k)},ae=(d,p,_,T,x,S,F,O)=>{let k,E;const{props:V,shapeFlag:I,transition:q,dirs:G}=d;if(k=d.el=o(d.type,S,V&&V.is,V),I&8?c(k,d.children):I&16&&Se(d.children,k,null,T,x,Zs(d,S),F,O),G&&At(d,null,T,"created"),he(k,d,d.scopeId,F,T),V){for(const fe in V)fe!=="value"&&!Yt(fe)&&i(k,fe,null,V[fe],S,T);"value"in V&&i(k,"value",null,V.value,S),(E=V.onVnodeBeforeMount)&&at(E,T,d)}G&&At(d,null,T,"beforeMount");const ne=Fa(x,q);ne&&q.beforeEnter(k),s(k,p,_),((E=V&&V.onVnodeMounted)||ne||G)&&Ue(()=>{E&&at(E,T,d),ne&&q.enter(k),G&&At(d,null,T,"mounted")},x)},he=(d,p,_,T,x)=>{if(_&&g(d,_),T)for(let S=0;S<T.length;S++)g(d,T[S]);if(x){let S=x.subTree;if(p===S||$i(S.type)&&(S.ssContent===p||S.ssFallback===p)){const F=x.vnode;he(d,F,F.scopeId,F.slotScopeIds,x.parent)}}},Se=(d,p,_,T,x,S,F,O,k=0)=>{for(let E=k;E<d.length;E++){const V=d[E]=O?xt(d[E]):lt(d[E]);v(null,V,p,_,T,x,S,F,O)}},R=(d,p,_,T,x,S,F)=>{const O=p.el=d.el;let{patchFlag:k,dynamicChildren:E,dirs:V}=p;k|=d.patchFlag&16;const I=d.props||pe,q=p.props||pe;let G;if(_&&kt(_,!1),(G=q.onVnodeBeforeUpdate)&&at(G,_,p,d),V&&At(p,d,_,"beforeUpdate"),_&&kt(_,!0),(I.innerHTML&&q.innerHTML==null||I.textContent&&q.textContent==null)&&c(O,""),E?C(d.dynamicChildren,E,O,_,T,Zs(p,x),S):F||Z(d,p,O,null,_,T,Zs(p,x),S,!1),k>0){if(k&16)L(O,I,q,_,x);else if(k&2&&I.class!==q.class&&i(O,"class",null,q.class,x),k&4&&i(O,"style",I.style,q.style,x),k&8){const ne=p.dynamicProps;for(let fe=0;fe<ne.length;fe++){const oe=ne[fe],Ae=I[oe],ke=q[oe];(ke!==Ae||oe==="value")&&i(O,oe,Ae,ke,x,_)}}k&1&&d.children!==p.children&&c(O,p.children)}else!F&&E==null&&L(O,I,q,_,x);((G=q.onVnodeUpdated)||V)&&Ue(()=>{G&&at(G,_,p,d),V&&At(p,d,_,"updated")},T)},C=(d,p,_,T,x,S,F)=>{for(let O=0;O<p.length;O++){const k=d[O],E=p[O],V=k.el&&(k.type===we||!pn(k,E)||k.shapeFlag&198)?f(k.el):_;v(k,E,V,null,T,x,S,F,!0)}},L=(d,p,_,T,x)=>{if(p!==_){if(p!==pe)for(const S in p)!Yt(S)&&!(S in _)&&i(d,S,p[S],null,x,T);for(const S in _){if(Yt(S))continue;const F=_[S],O=p[S];F!==O&&S!=="value"&&i(d,S,O,F,x,T)}"value"in _&&i(d,"value",p.value,_.value,x)}},J=(d,p,_,T,x,S,F,O,k)=>{const E=p.el=d?d.el:l(""),V=p.anchor=d?d.anchor:l("");let{patchFlag:I,dynamicChildren:q,slotScopeIds:G}=p;G&&(O=O?O.concat(G):G),d==null?(s(E,_,T),s(V,_,T),Se(p.children||[],_,V,x,S,F,O,k)):I>0&&I&64&&q&&d.dynamicChildren?(C(d.dynamicChildren,q,_,x,S,F,O),(p.key!=null||x&&p===x.subTree)&&Li(d,p,!0)):Z(d,p,_,V,x,S,F,O,k)},se=(d,p,_,T,x,S,F,O,k)=>{p.slotScopeIds=O,d==null?p.shapeFlag&512?x.ctx.activate(p,_,T,F,k):ce(p,_,T,x,S,F,k):ie(d,p,k)},ce=(d,p,_,T,x,S,F)=>{const O=d.component=Ya(d,T,x);if(ci(d)&&(O.ctx.renderer=St),Za(O,!1,F),O.asyncDep){if(x&&x.registerDep(O,ee,F),!d.el){const k=O.subTree=Ee(wt);$(null,k,p,_),d.placeholder=k.el}}else ee(O,d,p,_,x,S,F)},ie=(d,p,_)=>{const T=p.component=d.component;if(Ua(d,p,_))if(T.asyncDep&&!T.asyncResolved){Q(T,p,_);return}else T.next=p,T.update();else p.el=d.el,T.vnode=p},ee=(d,p,_,T,x,S,F)=>{const O=()=>{if(d.isMounted){let{next:I,bu:q,u:G,parent:ne,vnode:fe}=d;{const We=Fi(d);if(We){I&&(I.el=fe.el,Q(d,I,F)),We.asyncDep.then(()=>{d.isUnmounted||O()});return}}let oe=I,Ae;kt(d,!1),I?(I.el=fe.el,Q(d,I,F)):I=fe,q&&Fn(q),(Ae=I.props&&I.props.onVnodeBeforeUpdate)&&at(Ae,ne,I,fe),kt(d,!0);const ke=ji(d),ze=d.subTree;d.subTree=ke,v(ze,ke,f(ze.el),ut(ze),d,x,S),I.el=ke.el,oe===null&&qa(d,ke.el),G&&Ue(G,x),(Ae=I.props&&I.props.onVnodeUpdated)&&Ue(()=>at(Ae,ne,I,fe),x)}else{let I;const{el:q,props:G}=p,{bm:ne,m:fe,parent:oe,root:Ae,type:ke}=d,ze=an(p);kt(d,!1),ne&&Fn(ne),!ze&&(I=G&&G.onVnodeBeforeMount)&&at(I,oe,p),kt(d,!0);{Ae.ce&&Ae.ce._def.shadowRoot!==!1&&Ae.ce._injectChildStyle(ke);const We=d.subTree=ji(d);v(null,We,_,T,d,x,S),p.el=We.el}if(fe&&Ue(fe,x),!ze&&(I=G&&G.onVnodeMounted)){const We=p;Ue(()=>at(I,oe,We),x)}(p.shapeFlag&256||oe&&an(oe.vnode)&&oe.vnode.shapeFlag&256)&&d.a&&Ue(d.a,x),d.isMounted=!0,p=_=T=null}};d.scope.on();const k=d.effect=new Mr(O);d.scope.off();const E=d.update=k.run.bind(k),V=d.job=k.runIfDirty.bind(k);V.i=d,V.id=d.uid,k.scheduler=()=>Hs(V),kt(d,!0),E()},Q=(d,p,_)=>{p.component=d;const T=d.vnode.props;d.vnode=p,d.next=null,Ea(d,p.props,T,_),Oa(d,p.children,_),st(),ri(d),rt()},Z=(d,p,_,T,x,S,F,O,k=!1)=>{const E=d&&d.children,V=d?d.shapeFlag:0,I=p.children,{patchFlag:q,shapeFlag:G}=p;if(q>0){if(q&128){w(E,I,_,T,x,S,F,O,k);return}else if(q&256){m(E,I,_,T,x,S,F,O,k);return}}G&8?(V&16&&et(E,x,S),I!==E&&c(_,I)):V&16?G&16?w(E,I,_,T,x,S,F,O,k):et(E,x,S,!0):(V&8&&c(_,""),G&16&&Se(I,_,T,x,S,F,O,k))},m=(d,p,_,T,x,S,F,O,k)=>{d=d||Mt,p=p||Mt;const E=d.length,V=p.length,I=Math.min(E,V);let q;for(q=0;q<I;q++){const G=p[q]=k?xt(p[q]):lt(p[q]);v(d[q],G,_,null,x,S,F,O,k)}E>V?et(d,x,S,!0,!1,I):Se(p,_,T,x,S,F,O,k,I)},w=(d,p,_,T,x,S,F,O,k)=>{let E=0;const V=p.length;let I=d.length-1,q=V-1;for(;E<=I&&E<=q;){const G=d[E],ne=p[E]=k?xt(p[E]):lt(p[E]);if(pn(G,ne))v(G,ne,_,null,x,S,F,O,k);else break;E++}for(;E<=I&&E<=q;){const G=d[I],ne=p[q]=k?xt(p[q]):lt(p[q]);if(pn(G,ne))v(G,ne,_,null,x,S,F,O,k);else break;I--,q--}if(E>I){if(E<=q){const G=q+1,ne=G<V?p[G].el:T;for(;E<=q;)v(null,p[E]=k?xt(p[E]):lt(p[E]),_,ne,x,S,F,O,k),E++}}else if(E>q)for(;E<=I;)M(d[E],x,S,!0),E++;else{const G=E,ne=E,fe=new Map;for(E=ne;E<=q;E++){const Le=p[E]=k?xt(p[E]):lt(p[E]);Le.key!=null&&fe.set(Le.key,E)}let oe,Ae=0;const ke=q-ne+1;let ze=!1,We=0;const ft=new Array(ke);for(E=0;E<ke;E++)ft[E]=0;for(E=G;E<=I;E++){const Le=d[E];if(Ae>=ke){M(Le,x,S,!0);continue}let De;if(Le.key!=null)De=fe.get(Le.key);else for(oe=ne;oe<=q;oe++)if(ft[oe-ne]===0&&pn(Le,p[oe])){De=oe;break}De===void 0?M(Le,x,S,!0):(ft[De-ne]=E+1,De>=We?We=De:ze=!0,v(Le,p[De],_,null,x,S,F,O,k),Ae++)}const An=ze?Ma(ft):Mt;for(oe=An.length-1,E=ke-1;E>=0;E--){const Le=ne+E,De=p[Le],xr=p[Le+1],kn=Le+1<V?xr.el||xr.placeholder:T;ft[E]===0?v(null,De,_,kn,x,S,F,O,k):ze&&(oe<0||E!==An[oe]?D(De,_,kn,2):oe--)}}},D=(d,p,_,T,x=null)=>{const{el:S,type:F,transition:O,children:k,shapeFlag:E}=d;if(E&6){D(d.component.subTree,p,_,T);return}if(E&128){d.suspense.move(p,_,T);return}if(E&64){F.move(d,p,_,St);return}if(F===we){s(S,p,_);for(let I=0;I<k.length;I++)D(k[I],p,_,T);s(d.anchor,p,_);return}if(F===er){W(d,p,_);return}if(T!==2&&E&1&&O)if(T===0)O.beforeEnter(S),s(S,p,_),Ue(()=>O.enter(S),x);else{const{leave:I,delayLeave:q,afterLeave:G}=O,ne=()=>{d.ctx.isUnmounted?r(S):s(S,p,_)},fe=()=>{I(S,()=>{ne(),G&&G()})};q?q(S,ne,fe):fe()}else s(S,p,_)},M=(d,p,_,T=!1,x=!1)=>{const{type:S,props:F,ref:O,children:k,dynamicChildren:E,shapeFlag:V,patchFlag:I,dirs:q,cacheIndex:G}=d;if(I===-2&&(x=!1),O!=null&&(st(),ln(O,null,_,d,!0),rt()),G!=null&&(p.renderCache[G]=void 0),V&256){p.ctx.deactivate(d);return}const ne=V&1&&q,fe=!an(d);let oe;if(fe&&(oe=F&&F.onVnodeBeforeUnmount)&&at(oe,p,d),V&6)Ve(d.component,_,T);else{if(V&128){d.suspense.unmount(_,T);return}ne&&At(d,null,p,"beforeUnmount"),V&64?d.type.remove(d,p,_,St,T):E&&!E.hasOnce&&(S!==we||I>0&&I&64)?et(E,p,_,!1,!0):(S===we&&I&384||!x&&V&16)&&et(k,p,_),T&&U(d)}(fe&&(oe=F&&F.onVnodeUnmounted)||ne)&&Ue(()=>{oe&&at(oe,p,d),ne&&At(d,null,p,"unmounted")},_)},U=d=>{const{type:p,el:_,anchor:T,transition:x}=d;if(p===we){ue(_,T);return}if(p===er){j(d);return}const S=()=>{r(_),x&&!x.persisted&&x.afterLeave&&x.afterLeave()};if(d.shapeFlag&1&&x&&!x.persisted){const{leave:F,delayLeave:O}=x,k=()=>F(_,S);O?O(d.el,S,k):k()}else S()},ue=(d,p)=>{let _;for(;d!==p;)_=h(d),r(d),d=_;r(p)},Ve=(d,p,_)=>{const{bum:T,scope:x,job:S,subTree:F,um:O,m:k,a:E,parent:V,slots:{__:I}}=d;Mi(k),Mi(E),T&&Fn(T),V&&z(I)&&I.forEach(q=>{V.renderCache[q]=void 0}),x.stop(),S&&(S.flags|=8,M(F,d,p,_)),O&&Ue(O,p),Ue(()=>{d.isUnmounted=!0},p),p&&p.pendingBranch&&!p.isUnmounted&&d.asyncDep&&!d.asyncResolved&&d.suspenseId===p.pendingId&&(p.deps--,p.deps===0&&p.resolve())},et=(d,p,_,T=!1,x=!1,S=0)=>{for(let F=S;F<d.length;F++)M(d[F],p,_,T,x)},ut=d=>{if(d.shapeFlag&6)return ut(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const p=h(d.anchor||d.el),_=p&&p[na];return _?h(_):p};let Gt=!1;const En=(d,p,_)=>{d==null?p._vnode&&M(p._vnode,null,null,!0):v(p._vnode||null,d,p,null,null,null,_),p._vnode=d,Gt||(Gt=!0,ri(),ii(),Gt=!1)},St={p:v,um:M,m:D,r:U,mt:ce,mc:Se,pc:Z,pbc:C,n:ut,o:e};return{render:En,hydrate:void 0,createApp:Sa(En)}}function Zs({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function kt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Fa(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Li(e,t,n=!1){const s=e.children,r=t.children;if(z(s)&&z(r))for(let i=0;i<s.length;i++){const o=s[i];let l=r[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=r[i]=xt(r[i]),l.el=o.el),!n&&l.patchFlag!==-2&&Li(o,l)),l.type===Qn&&(l.el=o.el),l.type===wt&&!l.el&&(l.el=o.el)}}function Ma(e){const t=e.slice(),n=[0];let s,r,i,o,l;const a=e.length;for(s=0;s<a;s++){const u=e[s];if(u!==0){if(r=n[n.length-1],e[r]<u){t[s]=r,n.push(s);continue}for(i=0,o=n.length-1;i<o;)l=i+o>>1,e[n[l]]<u?i=l+1:o=l;u<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function Fi(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Fi(t)}function Mi(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const Ia=Symbol.for("v-scx"),Da=()=>Xn(Ia);function Je(e,t,n){return Ii(e,t,n)}function Ii(e,t,n=pe){const{immediate:s,deep:r,flush:i,once:o}=n,l=xe({},n),a=t&&s||!t&&i!=="post";let u;if(mn){if(i==="sync"){const g=Da();u=g.__watcherHandles||(g.__watcherHandles=[])}else if(!a){const g=()=>{};return g.stop=tt,g.resume=tt,g.pause=tt,g}}const c=Oe;l.call=(g,b,v)=>it(g,c,b,v);let f=!1;i==="post"?l.scheduler=g=>{Ue(g,c&&c.suspense)}:i!=="sync"&&(f=!0,l.scheduler=(g,b)=>{b?g():Hs(g)}),l.augmentJob=g=>{t&&(g.flags|=4),f&&(g.flags|=2,c&&(g.id=c.uid,g.i=c))};const h=Kl(e,t,l);return mn&&(u?u.push(h):a&&h()),h}function Na(e,t,n){const s=this.proxy,r=_e(e)?e.includes(".")?Di(s,e):()=>s[e]:e.bind(s,s);let i;X(t)?i=t:(i=t.handler,n=t);const o=gn(this),l=Ii(r,i.bind(s),n);return o(),l}function Di(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r<n.length&&s;r++)s=s[n[r]];return s}}const ja=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Fe(t)}Modifiers`]||e[`${Ke(t)}Modifiers`];function Ba(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||pe;let r=n;const i=t.startsWith("update:"),o=i&&ja(s,t.slice(7));o&&(o.trim&&(r=n.map(c=>_e(c)?c.trim():c)),o.number&&(r=n.map(kr)));let l,a=s[l=Ss(t)]||s[l=Ss(Fe(t))];!a&&i&&(a=s[l=Ss(Ke(t))]),a&&it(a,e,6,r);const u=s[l+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,it(u,e,6,r)}}function Ni(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!X(e)){const a=u=>{const c=Ni(u,t,!0);c&&(l=!0,xe(o,c))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(ge(e)&&s.set(e,null),null):(z(i)?i.forEach(a=>o[a]=null):xe(o,i),ge(e)&&s.set(e,o),o)}function Yn(e,t){return!e||!Rn(t)?!1:(t=t.slice(2).replace(/Once$/,""),le(e,t[0].toLowerCase()+t.slice(1))||le(e,Ke(t))||le(e,t))}function th(){}function ji(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:a,render:u,renderCache:c,props:f,data:h,setupState:g,ctx:b,inheritAttrs:v}=e,A=Kn(e);let $,H;try{if(n.shapeFlag&4){const j=r||s,K=j;$=lt(u.call(K,j,c,f,g,h,b)),H=l}else{const j=t;$=lt(j.length>1?j(f,{attrs:l,slots:o,emit:a}):j(f,null)),H=t.props?l:$a(l)}}catch(j){dn.length=0,Vn(j,e,1),$=Ee(wt)}let W=$;if(H&&v!==!1){const j=Object.keys(H),{shapeFlag:K}=W;j.length&&K&7&&(i&&j.some(ws)&&(H=Ha(H,i)),W=Vt(W,H,!1,!0))}return n.dirs&&(W=Vt(W,null,!1,!0),W.dirs=W.dirs?W.dirs.concat(n.dirs):n.dirs),n.transition&&qs(W,n.transition),$=W,Kn(A),$}const $a=e=>{let t;for(const n in e)(n==="class"||n==="style"||Rn(n))&&((t||(t={}))[n]=e[n]);return t},Ha=(e,t)=>{const n={};for(const s in e)(!ws(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Ua(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Bi(s,o,u):!!o;if(a&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const h=c[f];if(o[h]!==s[h]&&!Yn(u,h))return!0}}}else return(r||l)&&(!l||!l.$stable)?!0:s===o?!1:s?o?Bi(s,o,u):!0:!!o;return!1}function Bi(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let r=0;r<s.length;r++){const i=s[r];if(t[i]!==e[i]&&!Yn(n,i))return!0}return!1}function qa({vnode:e,parent:t},n){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.el=e.el),s===e)(e=t.vnode).el=n,t=t.parent;else break}}const $i=e=>e.__isSuspense;function Va(e,t){t&&t.pendingBranch?z(e)?t.effects.push(...e):t.effects.push(e):ea(e)}const we=Symbol.for("v-fgt"),Qn=Symbol.for("v-txt"),wt=Symbol.for("v-cmt"),er=Symbol.for("v-stc"),dn=[];let qe=null;function N(e=!1){dn.push(qe=e?null:[])}function za(){dn.pop(),qe=dn[dn.length-1]||null}let hn=1;function Hi(e,t=!1){hn+=e,e<0&&qe&&t&&(qe.hasOnce=!0)}function Ui(e){return e.dynamicChildren=hn>0?qe||Mt:null,za(),hn>0&&qe&&qe.push(e),e}function B(e,t,n,s,r,i){return Ui(P(e,t,n,s,r,i,!0))}function qt(e,t,n,s,r){return Ui(Ee(e,t,n,s,r,!0))}function Zn(e){return e?e.__v_isVNode===!0:!1}function pn(e,t){return e.type===t.type&&e.key===t.key}const qi=({key:e})=>e??null,es=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?_e(e)||Te(e)||X(e)?{i:He,r:e,k:t,f:!!n}:e:null);function P(e,t=null,n=null,s=0,r=null,i=e===we?0:1,o=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&qi(t),ref:t&&es(t),scopeId:li,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:He};return l?(tr(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=_e(n)?8:16),hn>0&&!o&&qe&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&qe.push(a),a}const Ee=Wa;function Wa(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===di)&&(e=wt),Zn(e)){const l=Vt(e,t,!0);return n&&tr(l,n),hn>0&&!i&&qe&&(l.shapeFlag&6?qe[qe.indexOf(e)]=l:qe.push(l)),l.patchFlag=-2,l}if(ic(e)&&(e=e.__vccOpts),t){t=Ka(t);let{class:l,style:a}=t;l&&!_e(l)&&(t.class=Ct(l)),ge(a)&&(Bs(a)&&!z(a)&&(a=xe({},a)),t.style=In(a))}const o=_e(e)?1:$i(e)?128:sa(e)?64:ge(e)?4:X(e)?2:0;return P(e,t,n,s,r,o,i,!0)}function Ka(e){return e?Bs(e)||Ti(e)?xe({},e):e:null}function Vt(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:a}=e,u=t?Ga(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&qi(u),ref:t&&t.ref?n&&i?z(i)?i.concat(es(t)):[i,es(t)]:es(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==we?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vt(e.ssContent),ssFallback:e.ssFallback&&Vt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&qs(c,a.clone(c)),c}function vt(e=" ",t=0){return Ee(Qn,null,e,t)}function ye(e="",t=!1){return t?(N(),qt(wt,null,e)):Ee(wt,null,e)}function lt(e){return e==null||typeof e=="boolean"?Ee(wt):z(e)?Ee(we,null,e.slice()):Zn(e)?xt(e):Ee(Qn,null,String(e))}function xt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function tr(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(z(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),tr(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Ti(t)?t._ctx=He:r===3&&He&&(He.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else X(t)?(t={default:t,_ctx:He},n=32):(t=String(t),s&64?(n=16,t=[vt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ga(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=Ct([t.class,s.class]));else if(r==="style")t.style=In([t.style,s.style]);else if(Rn(r)){const i=t[r],o=s[r];o&&i!==o&&!(z(i)&&i.includes(o))&&(t[r]=i?[].concat(i,o):o)}else r!==""&&(t[r]=s[r])}return t}function at(e,t,n,s=null){it(e,t,7,[n,s])}const Ja=xi();let Xa=0;function Ya(e,t,n){const s=e.type,r=(t?t.appContext:e.appContext)||Ja,i={uid:Xa++,vnode:e,type:s,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new _l(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ai(s,r),emitsOptions:Ni(s,r),emit:null,emitted:null,propsDefaults:pe,inheritAttrs:s.inheritAttrs,ctx:pe,data:pe,props:pe,attrs:pe,slots:pe,refs:pe,setupState:pe,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=Ba.bind(null,i),e.ce&&e.ce(i),i}let Oe=null;const Qa=()=>Oe||He;let ts,nr;{const e=Mn(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};ts=t("__VUE_INSTANCE_SETTERS__",n=>Oe=n),nr=t("__VUE_SSR_SETTERS__",n=>mn=n)}const gn=e=>{const t=Oe;return ts(e),e.scope.on(),()=>{e.scope.off(),ts(t)}},Vi=()=>{Oe&&Oe.scope.off(),ts(null)};function zi(e){return e.vnode.shapeFlag&4}let mn=!1;function Za(e,t=!1,n=!1){t&&nr(t);const{props:s,children:r}=e.vnode,i=zi(e);Ta(e,s,i,t),Ra(e,r,n||t);const o=i?ec(e,t):void 0;return t&&nr(!1),o}function ec(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ma);const{setup:s}=n;if(s){st();const r=e.setupContext=s.length>1?nc(e):null,i=gn(e),o=Bt(s,e,0,[e.props,r]),l=Er(o);if(rt(),i(),(l||e.sp)&&!an(e)&&ai(e),l){if(o.then(Vi,Vi),t)return o.then(a=>{Wi(e,a)}).catch(a=>{Vn(a,e,0)});e.asyncDep=o}else Wi(e,o)}else Ki(e)}function Wi(e,t,n){X(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ge(t)&&(e.setupState=ei(t)),Ki(e)}function Ki(e,t,n){const s=e.type;e.render||(e.render=s.render||tt);{const r=gn(e);st();try{ya(e)}finally{rt(),r()}}}const tc={get(e,t){return Re(e,"get",""),e[t]}};function nc(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,tc),slots:e.slots,emit:e.emit,expose:t}}function ns(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ei($l(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in un)return un[n](e)},has(t,n){return n in t||n in un}})):e.proxy}const sc=/(?:^|[-_])(\w)/g,rc=e=>e.replace(sc,t=>t.toUpperCase()).replace(/[-_]/g,"");function Gi(e,t=!0){return X(e)?e.displayName||e.name:e.name||t&&e.__name}function Ji(e,t,n=!1){let s=Gi(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e&&e.parent){const r=i=>{for(const o in i)if(i[o]===t)return o};s=r(e.components||e.parent.type.components)||r(e.appContext.components)}return s?rc(s):n?"App":"Anonymous"}function ic(e){return X(e)&&"__vccOpts"in e}const je=(e,t)=>zl(e,t,mn);function yn(e,t,n){const s=arguments.length;return s===2?ge(t)&&!z(t)?Zn(t)?Ee(e,null,[t]):Ee(e,t):Ee(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Zn(n)&&(n=[n]),Ee(e,t,n))}const oc="3.5.18";/**
|
|
17
|
-
* @vue/runtime-dom v3.5.18
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let sr;const Xi=typeof window<"u"&&window.trustedTypes;if(Xi)try{sr=Xi.createPolicy("vue",{createHTML:e=>e})}catch{}const Yi=sr?e=>sr.createHTML(e):e=>e,lc="http://www.w3.org/2000/svg",ac="http://www.w3.org/1998/Math/MathML",mt=typeof document<"u"?document:null,Qi=mt&&mt.createElement("template"),cc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?mt.createElementNS(lc,e):t==="mathml"?mt.createElementNS(ac,e):n?mt.createElement(e,{is:n}):mt.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>mt.createTextNode(e),createComment:e=>mt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>mt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{Qi.innerHTML=Yi(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Qi.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},uc=Symbol("_vtc");function fc(e,t,n){const s=e[uc];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ss=Symbol("_vod"),Zi=Symbol("_vsh"),dc={beforeMount(e,{value:t},{transition:n}){e[ss]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):bn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),bn(e,!0),s.enter(e)):s.leave(e,()=>{bn(e,!1)}):bn(e,t))},beforeUnmount(e,{value:t}){bn(e,t)}};function bn(e,t){e.style.display=t?e[ss]:"none",e[Zi]=!t}const hc=Symbol(""),pc=/(^|;)\s*display\s*:/;function gc(e,t,n){const s=e.style,r=_e(n);let i=!1;if(n&&!r){if(t)if(_e(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&rs(s,l,"")}else for(const o in t)n[o]==null&&rs(s,o,"");for(const o in n)o==="display"&&(i=!0),rs(s,o,n[o])}else if(r){if(t!==n){const o=s[hc];o&&(n+=";"+o),s.cssText=n,i=pc.test(n)}}else t&&e.removeAttribute("style");ss in e&&(e[ss]=i?s.display:"",e[Zi]&&(s.display="none"))}const eo=/\s*!important$/;function rs(e,t,n){if(z(n))n.forEach(s=>rs(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=mc(e,t);eo.test(n)?e.setProperty(Ke(s),n.replace(eo,""),"important"):e[s]=n}}const to=["Webkit","Moz","ms"],rr={};function mc(e,t){const n=rr[t];if(n)return n;let s=Fe(t);if(s!=="filter"&&s in e)return rr[t]=s;s=Ln(s);for(let r=0;r<to.length;r++){const i=to[r]+s;if(i in e)return rr[t]=i}return t}const no="http://www.w3.org/1999/xlink";function so(e,t,n,s,r,i=yl(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(no,t.slice(6,t.length)):e.setAttributeNS(no,t,n):n==null||i&&!Pr(n)?e.removeAttribute(t):e.setAttribute(t,i?"":nt(n)?String(n):n)}function ro(e,t,n,s,r){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Yi(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Pr(n):n==null&&l==="string"?(n="",o=!0):l==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(r||t)}function ir(e,t,n,s){e.addEventListener(t,n,s)}function yc(e,t,n,s){e.removeEventListener(t,n,s)}const io=Symbol("_vei");function bc(e,t,n,s,r=null){const i=e[io]||(e[io]={}),o=i[t];if(s&&o)o.value=s;else{const[l,a]=_c(t);if(s){const u=i[t]=xc(s,r);ir(e,l,u,a)}else o&&(yc(e,l,o,a),i[t]=void 0)}}const oo=/(?:Once|Passive|Capture)$/;function _c(e){let t;if(oo.test(e)){t={};let s;for(;s=e.match(oo);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ke(e.slice(2)),t]}let or=0;const wc=Promise.resolve(),vc=()=>or||(wc.then(()=>or=0),or=Date.now());function xc(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;it(Sc(s,n.value),t,5,[s])};return n.value=e,n.attached=vc(),n}function Sc(e,t){if(z(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const lo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Cc=(e,t,n,s,r,i)=>{const o=r==="svg";t==="class"?fc(e,s,o):t==="style"?gc(e,n,s):Rn(t)?ws(t)||bc(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Tc(e,t,s,o))?(ro(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&so(e,t,s,o,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!_e(s))?ro(e,Fe(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),so(e,t,s,o))};function Tc(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&lo(t)&&X(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return lo(t)&&_e(n)?!1:t in e}const ao={};/*! #__NO_SIDE_EFFECTS__ */function co(e,t,n){const s=ra(e,t);On(s)&&xe(s,t);class r extends lr{constructor(o){super(s,o,n)}}return r.def=s,r}const Ec=typeof HTMLElement<"u"?HTMLElement:class{};class lr extends Ec{constructor(t,n={},s=yo){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&s!==yo?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof lr){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,Wn(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(s=>{for(const r of s)this._setAttr(r.attributeName)}),this._ob.observe(this,{attributes:!0});const t=(s,r=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:o}=s;let l;if(i&&!z(i))for(const a in i){const u=i[a];(u===Number||u&&u.type===Number)&&(a in this._props&&(this._props[a]=Rr(this._props[a])),(l||(l=Object.create(null)))[Fe(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(o),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)le(this,s)||Object.defineProperty(this,s,{get:()=>Zr(n[s])})}_resolveProps(t){const{props:n}=t,s=z(n)?n:Object.keys(n||{});for(const r of Object.keys(this))r[0]!=="_"&&s.includes(r)&&this._setProp(r,this[r]);for(const r of s.map(Fe))Object.defineProperty(this,r,{get(){return this._getProp(r)},set(i){this._setProp(r,i,!0,!0)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):ao;const r=Fe(t);n&&this._numberProps&&this._numberProps[r]&&(s=Rr(s)),this._setProp(r,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,r=!1){if(n!==this._props[t]&&(n===ao?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),r&&this._instance&&this._update(),s)){const i=this._ob;i&&i.disconnect(),n===!0?this.setAttribute(Ke(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Ke(t),n+""):n||this.removeAttribute(Ke(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),Lc(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=Ee(this._def,xe(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const r=(i,o)=>{this.dispatchEvent(new CustomEvent(i,On(o[0])?xe({detail:o},o[0]):{detail:o}))};s.emit=(i,...o)=>{r(i,o),Ke(i)!==i&&r(Ke(i),o)},this._setParent()}),n}_applyStyles(t,n){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce;for(let r=t.length-1;r>=0;r--){const i=document.createElement("style");s&&i.setAttribute("nonce",s),i.textContent=t[r],this.shadowRoot.prepend(i)}}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=(this._teleportTarget||this).querySelectorAll("slot"),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const r=t[s],i=r.getAttribute("name")||"default",o=this._slots[i],l=r.parentNode;if(o)for(const a of o){if(n&&a.nodeType===1){const u=n+"-s",c=document.createTreeWalker(a,1);a.setAttribute(u,"");let f;for(;f=c.nextNode();)f.setAttribute(u,"")}l.insertBefore(a,r)}else for(;r.firstChild;)l.insertBefore(r.firstChild,r);l.removeChild(r)}}_injectChildStyle(t){this._applyStyles(t.styles,t)}_removeChildStyle(t){}}const is=e=>{const t=e.props["onUpdate:modelValue"]||!1;return z(t)?n=>Fn(t,n):t},zt=Symbol("_assign"),Ac={deep:!0,created(e,t,n){e[zt]=is(n),ir(e,"change",()=>{const s=e._modelValue,r=_n(e),i=e.checked,o=e[zt];if(z(s)){const l=Ts(s,r),a=l!==-1;if(i&&!a)o(s.concat(r));else if(!i&&a){const u=[...s];u.splice(l,1),o(u)}}else if(Dt(s)){const l=new Set(s);i?l.add(r):l.delete(r),o(l)}else o(ho(e,i))})},mounted:uo,beforeUpdate(e,t,n){e[zt]=is(n),uo(e,t,n)}};function uo(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(z(t))r=Ts(t,s.props.value)>-1;else if(Dt(t))r=t.has(s.props.value);else{if(t===n)return;r=Qt(t,ho(e,!0))}e.checked!==r&&(e.checked=r)}const kc={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=Dt(t);ir(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?kr(_n(o)):_n(o));e[zt](e.multiple?r?new Set(i):i:i[0]),e._assigning=!0,Wn(()=>{e._assigning=!1})}),e[zt]=is(s)},mounted(e,{value:t}){fo(e,t)},beforeUpdate(e,t,n){e[zt]=is(n)},updated(e,{value:t}){e._assigning||fo(e,t)}};function fo(e,t){const n=e.multiple,s=z(t);if(!(n&&!s&&!Dt(t))){for(let r=0,i=e.options.length;r<i;r++){const o=e.options[r],l=_n(o);if(n)if(s){const a=typeof l;a==="string"||a==="number"?o.selected=t.some(u=>String(u)===String(l)):o.selected=Ts(t,l)>-1}else o.selected=t.has(l);else if(Qt(_n(o),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function _n(e){return"_value"in e?e._value:e.value}function ho(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Rc=["ctrl","shift","alt","meta"],Oc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Rc.some(n=>e[`${n}Key`]&&!t.includes(n))},po=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(r,...i)=>{for(let o=0;o<t.length;o++){const l=Oc[t[o]];if(l&&l(r,t))return}return e(r,...i)})},Pc=xe({patchProp:Cc},cc);let go;function mo(){return go||(go=Pa(Pc))}const Lc=(...e)=>{mo().render(...e)},yo=(...e)=>{const t=mo().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Mc(s);if(!r)return;const i=t._component;!X(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,Fc(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t};function Fc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Mc(e){return _e(e)?document.querySelector(e):e}function Ic(e){const t=document.body||document.documentElement;let n=null;const s=c=>{n=c};document.addEventListener("mousemove",s),window.getComputedStyle(e.containerElement).position==="static"&&be.select(e.containerElement).style("position","relative");const i=be.select(e.containerElement).append("div").attr("class","track-viewer-menu-button").attr("aria-label","Track viewer options menu").attr("role","button").attr("tabindex","0").style("position","absolute").style("top","8px").style("right","8px").style("width","32px").style("height","32px").style("background","white").style("border","1px solid #ccc").style("border-radius","4px").style("cursor","pointer").style("display","flex").style("align-items","center").style("justify-content","center").style("z-index","100").style("box-shadow","0 2px 4px rgba(0,0,0,0.1)").style("opacity","0").style("transition","opacity 0.2s").style("pointer-events","none").html("⋮").style("font-size","20px").style("line-height","1").style("user-select","none"),o=be.select(t).append("div").attr("class","track-viewer-context-menu").style("position","absolute").style("background","white").style("border","1px solid #ccc").style("border-radius","4px").style("box-shadow","0 2px 8px rgba(0,0,0,0.15)").style("padding","4px 0").style("min-width","200px").style("display","none").style("z-index","1001"),l=[{label:"Save as SVG",action:e.onSaveSVG},{label:"Save as PNG",action:e.onSavePNG},{type:"separator"},{label:"Show track labels",action:e.onToggleTrackLabels,checkbox:!0,checked:e.getShowTrackLabels},{label:"Show all annotation labels",action:e.onToggleAllAnnotationLabels,checkbox:!0,checked:e.getShowAllAnnotationLabels}];l.forEach(c=>{if(c.type==="separator")o.append("div").style("height","1px").style("background","#e0e0e0").style("margin","4px 0");else{const f=o.append("div").attr("class","track-viewer-menu-item").style("padding","8px 16px").style("cursor","pointer").style("user-select","none").style("display","flex").style("align-items","center").style("gap","8px").on("mouseenter",function(){be.select(this).style("background","#f5f5f5")}).on("mouseleave",function(){be.select(this).style("background","transparent")}).on("click",()=>{typeof c.action=="function"&&c.action(),u()});if(c.checkbox){const h=f.append("span").attr("class","menu-checkbox").style("width","16px").style("height","16px").style("border","1px solid #999").style("border-radius","3px").style("display","inline-flex").style("align-items","center").style("justify-content","center").style("flex-shrink","0");c.checkboxElement=h,c.checked&&c.checked()&&h.html("✓").style("background","#2196F3").style("color","white").style("border-color","#2196F3")}f.append("span").text(c.label)}}),be.select(e.containerElement).on("mouseenter",()=>{i.style("opacity","1").style("pointer-events","all")}).on("mouseleave",()=>{o.style("display")==="none"&&i.style("opacity","0").style("pointer-events","none")});function a(){const c=i.node().getBoundingClientRect(),f=window.pageYOffset||document.documentElement.scrollTop,h=window.pageXOffset||document.documentElement.scrollLeft;o.style("display","block").style("top",`${c.bottom+f+4}px`).style("left",`${c.right+h-200}px`)}function u(){o.style("display","none");const c=e.containerElement.getBoundingClientRect();if(n){const f=n.clientX,h=n.clientY;f>=c.left&&f<=c.right&&h>=c.top&&h<=c.bottom||i.style("opacity","0").style("pointer-events","none")}}return i.on("click",c=>{c.stopPropagation(),o.style("display")==="none"?a():u()}),be.select(t).on("click.trackviewer-context",()=>{u()}),{destroy(){document.removeEventListener("mousemove",s),be.select(e.containerElement).on("mouseenter",null).on("mouseleave",null),be.select(t).on("click.trackviewer-context",null),o.remove(),i.remove()},updateCheckbox(c,f){const h=l.find(g=>g.label===c);h&&h.checkboxElement&&(f?h.checkboxElement.html("✓").style("background","#2196F3").style("color","white").style("border-color","#2196F3"):h.checkboxElement.html("").style("background","white").style("border-color","#999"))},toggle(){o.style("display")==="none"?a():u()}}}const Ft=class Ft{constructor(t){this.data={tracks:[],annotations:[],primitives:[]},this.showAllAnnotationLabels=!1,this.isDragging=!1,this.isResponsiveWidth=t.width===void 0;const n=typeof t.container=="string"?document.querySelector(t.container):t.container;if(!n)throw new Error("Container element not found");this.containerElement=n;const s=this.isResponsiveWidth?this.calculateResponsiveWidth():t.width||800,r=t.showTrackLabels!==!1?60:10,i=t.margin||{top:20,right:10,bottom:20,left:r};this.config={container:t.container,width:s,height:t.height||300,margin:i,trackHeight:t.trackHeight||30,domain:t.domain||[0,100],zoomExtent:t.zoomExtent||[.5,20],showTrackLabels:t.showTrackLabels!==void 0?t.showTrackLabels:!0,onAnnotationClick:t.onAnnotationClick||(()=>{}),onAnnotationHover:t.onAnnotationHover||(()=>{}),onBackgroundClick:t.onBackgroundClick||(()=>{})},this.originalLeftMargin=this.config.margin.left,this.showTrackLabels=this.config.showTrackLabels,this.showTrackLabels||(this.config.margin.left=this.originalLeftMargin),this.currentTransform=be.zoomIdentity,this.initialize(),this.isResponsiveWidth&&this.setupAutoResize()}calculateResponsiveWidth(){const t=this.containerElement.clientWidth||800;return Math.max(600,t-40)}setupAutoResize(){let t;this.resizeObserver=new ResizeObserver(n=>{clearTimeout(t),t=setTimeout(()=>{this.resize()},100)}),this.resizeObserver.observe(this.containerElement)}initialize(){const t=typeof this.config.container=="string"?document.querySelector(this.config.container):this.config.container;if(!t)throw new Error("Container element not found");const n=document.body||document.documentElement;this.tooltip=be.select(n).append("div").attr("class","track-viewer-tooltip").style("position","absolute").style("background","white").style("border","1px solid #ccc").style("padding","4px 8px").style("pointer-events","none").style("display","none").style("z-index","1000"),this.svg=be.select(t).append("svg").attr("width",this.config.width).attr("height",this.config.height),this.chart=this.svg.append("g").attr("transform",`translate(${this.config.margin.left},${this.config.margin.top})`);const s=this.config.width-this.config.margin.left-this.config.margin.right;this.clipId=`clip-${Math.random().toString(36).substring(2,11)}`,this.svg.append("defs").append("clipPath").attr("id",this.clipId).append("rect").attr("x",0).attr("y",-Ft.LABEL_PADDING).attr("width",s).attr("height","100%"),this.xAxisGroup=this.chart.append("g").attr("class","x-axis"),this.clippedChart=this.chart.append("g").attr("clip-path",`url(#${this.clipId})`),this.x=be.scaleLinear().domain(this.config.domain).range([0,this.config.width-this.config.margin.left-this.config.margin.right]),this.initializeZoom(),this.createContextMenu()}initializeZoom(){const t=this.config.width-this.config.margin.left-this.config.margin.right,n=this.config.height-this.config.margin.top-this.config.margin.bottom;this.zoom=be.zoom().scaleExtent(this.config.zoomExtent).translateExtent([[0,0],[t,n]]).extent([[0,0],[t,n]]).filter(s=>(s.type==="mousedown"&&s.button===0&&(this.isDragging=!0),s.type==="mouseup"&&(this.isDragging=!1),!s.ctrlKey&&!s.button)).on("zoom",s=>{this.currentTransform=s.transform,this.drawTracks()}).on("start",s=>{s.sourceEvent&&s.sourceEvent.type==="mousedown"&&(this.clippedChart.select(".chart-background").style("cursor","grabbing"),this.svg.style("cursor","grabbing"))}).on("end",()=>{this.isDragging=!1,this.clippedChart.select(".chart-background").style("cursor","grab"),this.svg.style("cursor","")}),this.svg.call(this.zoom),this.clippedChart.insert("rect",":first-child").attr("class","chart-background").attr("width",t).attr("height",n).attr("y",-Ft.LABEL_PADDING).style("fill","transparent").style("pointer-events","all").style("cursor","grab").on("click",()=>{this.config.onBackgroundClick()})}createContextMenu(){this.contextMenuController=Ic({containerElement:this.containerElement,onSaveSVG:()=>this.saveAsSVG(),onSavePNG:()=>this.saveAsPNG(),getShowTrackLabels:()=>this.showTrackLabels,getShowAllAnnotationLabels:()=>this.showAllAnnotationLabels,onToggleTrackLabels:()=>this.toggleTrackLabels(),onToggleAllAnnotationLabels:()=>this.toggleAllAnnotationLabels()})}saveAsSVG(){const t=this.svg.node();if(!t)return;const n=t.cloneNode(!0),s=this.getInlineStyles(n),r=document.createElementNS("http://www.w3.org/2000/svg","style");r.textContent=s,n.insertBefore(r,n.firstChild),be.select(n).selectAll("[data-styled]").attr("data-styled",null);const o=new XMLSerializer().serializeToString(n),l=new Blob([o],{type:"image/svg+xml"}),a=URL.createObjectURL(l),u=document.createElement("a");u.href=a,u.download="track-viewer.svg",u.click(),URL.revokeObjectURL(a)}saveAsPNG(){const t=this.svg.node();if(!t)return;const n=t.cloneNode(!0),s=this.getInlineStyles(n),r=document.createElementNS("http://www.w3.org/2000/svg","style");r.textContent=s,n.insertBefore(r,n.firstChild),be.select(n).selectAll("[data-styled]").attr("data-styled",null);const o=new XMLSerializer().serializeToString(n),l=20,a=document.createElement("canvas"),u=a.getContext("2d");if(!u)return;const c=2;a.width=(this.config.width+l*2)*c,a.height=(this.config.height+l*2)*c,u.scale(c,c);const f=new Image,h=new Blob([o],{type:"image/svg+xml"}),g=URL.createObjectURL(h);f.onload=()=>{u.fillStyle="white",u.fillRect(0,0,this.config.width+l*2,this.config.height+l*2),u.drawImage(f,l,l),URL.revokeObjectURL(g),a.toBlob(b=>{if(b){const v=URL.createObjectURL(b),A=document.createElement("a");A.href=v,A.download="track-viewer.png",A.click(),URL.revokeObjectURL(v)}})},f.src=g}getInlineStyles(t=this.svg.node()){const n=Array.from(document.styleSheets),s=[];n.forEach(i=>{try{const o=i.cssRules||i.rules;o&&Array.from(o).forEach(l=>{if(l.selectorText){const a=l.selectorText;(a.includes(".track")||a.includes(".annotation")||a.includes(".axis")||a.includes(".primitive")||a.includes("svg")||a.includes("text")||a.includes("rect")||a.includes("path")||a.includes("circle")||a.includes("line")||a.includes("polygon"))&&s.push(l.cssText)}})}catch{}});const r=be.select(t);return r.selectAll(".track-label").each(function(){const i=this,o=window.getComputedStyle(i);i.hasAttribute("data-styled")||(i.setAttribute("data-styled","true"),i.setAttribute("style",`font-family: ${o.fontFamily}; font-size: ${o.fontSize}; fill: ${o.fill||"currentColor"};`))}),r.selectAll(".annotation, .primitive").each(function(){const i=this,o=window.getComputedStyle(i),l=i.getAttribute("data-label");if(l&&!i.querySelector("title")){const u=document.createElementNS("http://www.w3.org/2000/svg","title");u.textContent=l,i.insertBefore(u,i.firstChild),i.removeAttribute("data-label")}i.querySelectorAll("path, rect, circle, line, polygon, ellipse").forEach(u=>{const c=u,f=window.getComputedStyle(c);if(!c.hasAttribute("data-styled")){c.setAttribute("data-styled","true");const h=[],g=f.fill,b=o.fill;if(g&&g!=="none"&&g!=="rgb(0, 0, 0)"?h.push(`fill: ${g}`):b&&b!=="none"&&b!=="rgb(0, 0, 0)"&&h.push(`fill: ${b}`),f.stroke&&f.stroke!=="none"&&h.push(`stroke: ${f.stroke}`),f.strokeWidth&&h.push(`stroke-width: ${f.strokeWidth}`),f.opacity&&f.opacity!=="1"&&h.push(`opacity: ${f.opacity}`),h.length>0){const v=c.getAttribute("style")||"";c.setAttribute("style",v+" "+h.join("; ")+";")}}})}),s.join(`
|
|
21
|
-
`)}toggleTrackLabels(){var n;if(this.showTrackLabels=!this.showTrackLabels,this.chart.select(".track-labels-container").style("display",this.showTrackLabels?"":"none"),this.showTrackLabels)this.updateMarginAndLayout();else{this.config.margin.left=this.originalLeftMargin,this.chart.attr("transform",`translate(${this.config.margin.left},${this.config.margin.top})`),this.x.range([0,this.config.width-this.config.margin.left-this.config.margin.right]);const s=this.config.width-this.config.margin.left-this.config.margin.right;this.svg.select("clipPath rect").attr("width",s),this.clippedChart.select(".chart-background").attr("width",s),this.drawTracks()}(n=this.contextMenuController)==null||n.updateCheckbox("Show track labels",this.showTrackLabels)}toggleAllAnnotationLabels(){var n;this.showAllAnnotationLabels=!this.showAllAnnotationLabels;const t=this.showAllAnnotationLabels;this.clippedChart.selectAll(".annotation-labels-layer .annotation-label-group").each(function(){const s=be.select(this),i=s.select(".annotation-label").attr("data-show-label");i==="never"?s.style("display","none"):i==="always"?s.style("display",""):s.style("display",t?"":"none")}),(n=this.contextMenuController)==null||n.updateCheckbox("Show all annotation labels",this.showAllAnnotationLabels)}getTrackHeight(t){return t.height||this.config.trackHeight}getTotalTracksHeight(){return this.data.tracks.reduce((t,n)=>t+this.getTrackHeight(n),0)}getTrackYPosition(t){let n=0;for(let s=0;s<t;s++)n+=this.getTrackHeight(this.data.tracks[s]);return n}updateHeight(){const t=this.getTotalTracksHeight()+this.config.margin.top+this.config.margin.bottom;this.config.height=t,this.svg.attr("height",t);const n=this.getTotalTracksHeight();this.xAxisGroup.attr("transform",`translate(0, ${n})`),this.svg.select("clipPath rect").attr("height",n+Ft.LABEL_PADDING),this.clippedChart.select(".chart-background").attr("height",n+Ft.LABEL_PADDING)}createTrackGroups(){this.trackGroups=this.clippedChart.selectAll(".track").data(this.data.tracks,n=>n.id).join("g").attr("id",n=>n.id).attr("class","track").attr("transform",(n,s)=>`translate(0, ${this.getTrackYPosition(s)})`);let t=this.chart.select(".track-labels-container");t.empty()&&(t=this.chart.append("g").attr("class","track-labels-container")),t.style("display",this.showTrackLabels?"":"none"),this.labelGroups=t.selectAll(".track-label-group").data(this.data.tracks,n=>n.id).join("g").attr("id",n=>`${n.id}-label`).attr("class","track-label-group").attr("transform",(n,s)=>`translate(0, ${this.getTrackYPosition(s)})`),this.labelGroups.selectAll(".track-label").data(n=>[n]).join("text").attr("class","track-label").attr("x",-10).attr("y",n=>this.getTrackHeight(n)/2).attr("dy","0.35em").attr("text-anchor","end").text(n=>n.label)}drawTracks(){const t=this.currentTransform.rescaleX(this.x);if(this.xAxisGroup.call(be.axisBottom(t)),this.xAxisGroup.selectAll("text").attr("class","axis-label"),!this.trackGroups)return;const n=[];this.trackGroups.each((s,r,i)=>{const o=be.select(i[r]),l=this.getTrackYPosition(r),a=this.data.annotations.filter(g=>g.trackId===s.id),c=[...(this.data.primitives||[]).filter(g=>g.trackId===s.id).map(g=>({type:"primitive",data:g})),...a.map(g=>({type:"annotation",data:g}))],f=o.selectAll("g.element").data(c,g=>g.data.id).join(g=>g.append("g"),g=>g,g=>g.remove()).attr("id",g=>g.data.id).attr("class",g=>g.type==="primitive"?`element ${g.type} ${g.data.type} ${g.data.class}`:`element ${g.type} ${g.data.type} ${g.data.classes.join(" ")}`),h=this;f.each(function(g){const b=be.select(this);b.selectAll("*").remove(),g.type==="primitive"?h.renderPrimitive(b,g.data,t,s):h.renderAnnotation(b,g.data,t,s,n,l)})}),this.renderAllLabels(n,t)}renderAnnotation(t,n,s,r,i,o=0){const l=s(n.start),a=Math.max(1,s(n.end)-s(n.start)),u=this.getTrackHeight(r),c=n.heightFraction!==void 0?u*n.heightFraction:u/2,f=u-(n.fy!==void 0?n.fy*u:u/2);let h;switch(n.type){case"arrow":h=this.renderArrow(t,l,f,a,c,n.direction);break;case"circle":h=this.renderCircle(t,l,f,c);break;case"triangle":h=this.renderTriangle(t,l,f,c);break;case"pin":h=this.renderPin(t,l,f,c);break;case"box":default:h=this.renderBox(t,l,f,a,c,n.corner_radius||0);break}t.attr("data-label",n.label),h.attr("data-annotation-id",n.id).style("cursor","pointer").style("pointer-events","all"),n.fill&&h.style("fill",n.fill),n.stroke&&h.style("stroke",n.stroke),n.opacity!==void 0&&h.style("opacity",n.opacity),h.on("mouseover",g=>{this.isDragging||(h.classed("hovered",!0),this.clippedChart.selectAll(`.annotation-label-group[data-annotation-id="${n.id}"]`).style("display","block").select(".annotation-label-background").style("display",""),n.tooltip!==void 0&&this.showTooltip(g,n,r),this.config.onAnnotationHover(n,r,g))}).on("mouseout",()=>{h.classed("hovered",!1);const g=this.showAllAnnotationLabels;this.clippedChart.selectAll(`.annotation-label-group[data-annotation-id="${n.id}"]`).each(function(){const b=be.select(this),A=b.select(".annotation-label").attr("data-show-label");A==="hover"&&g?b.style("display",""):A==="hover"?b.style("display","none"):b.style("display",""),b.select(".annotation-label-background").style("display","none")}),this.hideTooltip()}).on("click",()=>{this.config.onAnnotationClick(n,r)}),i&&n.label&&n.showLabel!=="never"&&i.push({annotation:n,trackData:r,x:l,y:f,width:a,height:c,trackY:o})}renderPrimitive(t,n,s,r){const i=this.getTrackHeight(r);let o;switch(n.type){case"horizontal-line":o=this.renderHorizontalLine(t,n,s,i);break;case"background":o=this.renderBackground(t,n,s,i);break;default:return}o.attr("class",`primitive ${n.class}`),n.stroke?o.style("stroke",n.stroke):n.type==="horizontal-line"&&o.style("stroke","currentColor"),n.fill?o.style("fill",n.fill):n.type==="background"&&o.style("fill","none"),n.opacity!==void 0&&o.style("opacity",n.opacity)}renderHorizontalLine(t,n,s,r){const i=s.range();let o,l;n.start!==void 0&&n.end!==void 0?(o=s(n.start),l=s(n.end)):n.start!==void 0&&n.end===void 0?(o=s(n.start),l=i[1]):n.start===void 0&&n.end!==void 0?(o=i[0],l=s(n.end)):(o=i[0],l=i[1]);const a=r-(n.fy!==void 0?n.fy*r:r/2),u=Math.round(a)+.5;return t.append("line").attr("x1",o).attr("x2",l).attr("y1",u).attr("y2",u).style("stroke-width",1).style("shape-rendering","crispEdges")}renderBackground(t,n,s,r){const i=s.range();let o,l;return n.start!==void 0&&n.end!==void 0?(o=s(n.start),l=s(n.end)):n.start!==void 0&&n.end===void 0?(o=s(n.start),l=i[1]):n.start===void 0&&n.end!==void 0?(o=i[0],l=s(n.end)):(o=i[0],l=i[1]),t.append("rect").attr("x",o).attr("y",0).attr("width",l-o).attr("height",r)}renderBox(t,n,s,r,i,o=0){return t.append("rect").attr("x",n).attr("y",s-i/2).attr("width",r).attr("height",i).attr("rx",o).attr("ry",o)}renderArrow(t,n,s,r,i,o){const l=Math.min(r*.2,i*.5,8),a=r-l;let u;const c=s-i/2,f=s+i/2;if(o==="right")u=`
|
|
22
|
-
M ${n} ${c}
|
|
23
|
-
L ${n+a} ${c}
|
|
24
|
-
L ${n+r} ${s}
|
|
25
|
-
L ${n+a} ${f}
|
|
26
|
-
L ${n} ${f}
|
|
1
|
+
(function(oe,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("d3")):typeof define=="function"&&define.amd?define(["exports","vue","d3"],i):(oe=typeof globalThis<"u"?globalThis:oe||self,i(oe.BGCViewerComponents={},oe.Vue,oe.d3))})(this,function(oe,i,Vn){"use strict";function Mn(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const z=Mn(Vn);function jn(n){const e=document.body||document.documentElement;let t=null;const r=d=>{t=d};document.addEventListener("mousemove",r),window.getComputedStyle(n.containerElement).position==="static"&&z.select(n.containerElement).style("position","relative");const a=z.select(n.containerElement).append("div").attr("class","track-viewer-menu-button").attr("aria-label","Track viewer options menu").attr("role","button").attr("tabindex","0").style("position","absolute").style("top","8px").style("right","8px").style("width","32px").style("height","32px").style("background","white").style("border","1px solid #ccc").style("border-radius","4px").style("cursor","pointer").style("display","flex").style("align-items","center").style("justify-content","center").style("z-index","100").style("box-shadow","0 2px 4px rgba(0,0,0,0.1)").style("opacity","0").style("transition","opacity 0.2s").style("pointer-events","none").html("⋮").style("font-size","20px").style("line-height","1").style("user-select","none"),s=z.select(e).append("div").attr("class","track-viewer-context-menu").style("position","absolute").style("background","white").style("border","1px solid #ccc").style("border-radius","4px").style("box-shadow","0 2px 8px rgba(0,0,0,0.15)").style("padding","4px 0").style("min-width","200px").style("display","none").style("z-index","1001"),l=[{label:"Save as SVG",action:n.onSaveSVG},{label:"Save as PNG",action:n.onSavePNG},{type:"separator"},{label:"Show track labels",action:n.onToggleTrackLabels,checkbox:!0,checked:n.getShowTrackLabels},{label:"Show all annotation labels",action:n.onToggleAllAnnotationLabels,checkbox:!0,checked:n.getShowAllAnnotationLabels}];l.forEach(d=>{if(d.type==="separator")s.append("div").style("height","1px").style("background","#e0e0e0").style("margin","4px 0");else{const h=s.append("div").attr("class","track-viewer-menu-item").style("padding","8px 16px").style("cursor","pointer").style("user-select","none").style("display","flex").style("align-items","center").style("gap","8px").on("mouseenter",function(){z.select(this).style("background","#f5f5f5")}).on("mouseleave",function(){z.select(this).style("background","transparent")}).on("click",()=>{typeof d.action=="function"&&d.action(),f()});if(d.checkbox){const p=h.append("span").attr("class","menu-checkbox").style("width","16px").style("height","16px").style("border","1px solid #999").style("border-radius","3px").style("display","inline-flex").style("align-items","center").style("justify-content","center").style("flex-shrink","0");d.checkboxElement=p,d.checked&&d.checked()&&p.html("✓").style("background","#2196F3").style("color","white").style("border-color","#2196F3")}h.append("span").text(d.label)}}),z.select(n.containerElement).on("mouseenter",()=>{a.style("opacity","1").style("pointer-events","all")}).on("mouseleave",()=>{s.style("display")==="none"&&a.style("opacity","0").style("pointer-events","none")});function c(){const d=a.node().getBoundingClientRect(),h=window.pageYOffset||document.documentElement.scrollTop,p=window.pageXOffset||document.documentElement.scrollLeft;s.style("display","block").style("top",`${d.bottom+h+4}px`).style("left",`${d.right+p-200}px`)}function f(){s.style("display","none");const d=n.containerElement.getBoundingClientRect();if(t){const h=t.clientX,p=t.clientY;h>=d.left&&h<=d.right&&p>=d.top&&p<=d.bottom||a.style("opacity","0").style("pointer-events","none")}}return a.on("click",d=>{d.stopPropagation(),s.style("display")==="none"?c():f()}),z.select(e).on("click.trackviewer-context",()=>{f()}),{destroy(){document.removeEventListener("mousemove",r),z.select(n.containerElement).on("mouseenter",null).on("mouseleave",null),z.select(e).on("click.trackviewer-context",null),s.remove(),a.remove()},updateCheckbox(d,h){const p=l.find(m=>m.label===d);p&&p.checkboxElement&&(h?p.checkboxElement.html("✓").style("background","#2196F3").style("color","white").style("border-color","#2196F3"):p.checkboxElement.html("").style("background","white").style("border-color","#999"))},toggle(){s.style("display")==="none"?c():f()}}}const Ee=class Ee{constructor(e){this.data={tracks:[],annotations:[],primitives:[]},this.showAllAnnotationLabels=!1,this.isDragging=!1,this.isResponsiveWidth=e.width===void 0;const t=typeof e.container=="string"?document.querySelector(e.container):e.container;if(!t)throw new Error("Container element not found");this.containerElement=t;const r=this.isResponsiveWidth?this.calculateResponsiveWidth():e.width||800,o=e.showTrackLabels!==!1?60:10,a=e.margin||{top:20,right:10,bottom:20,left:o};this.config={container:e.container,width:r,height:e.height||300,margin:a,trackHeight:e.trackHeight||30,domain:e.domain||[0,100],zoomExtent:e.zoomExtent||[.5,20],showTrackLabels:e.showTrackLabels!==void 0?e.showTrackLabels:!0,onAnnotationClick:e.onAnnotationClick||(()=>{}),onAnnotationHover:e.onAnnotationHover||(()=>{}),onBackgroundClick:e.onBackgroundClick||(()=>{}),onDomainChange:e.onDomainChange||(()=>{})},this.originalLeftMargin=this.config.margin.left,this.showTrackLabels=this.config.showTrackLabels,this.showTrackLabels||(this.config.margin.left=this.originalLeftMargin),this.currentTransform=z.zoomIdentity,this.initialize(),this.isResponsiveWidth&&this.setupAutoResize()}calculateResponsiveWidth(){const e=this.containerElement.clientWidth||800;return Math.max(600,e-40)}setupAutoResize(){let e;this.resizeObserver=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{this.resize()},100)}),this.resizeObserver.observe(this.containerElement)}initialize(){const e=typeof this.config.container=="string"?document.querySelector(this.config.container):this.config.container;if(!e)throw new Error("Container element not found");const t=document.body||document.documentElement;this.tooltip=z.select(t).append("div").attr("class","track-viewer-tooltip").style("position","absolute").style("background","white").style("border","1px solid #ccc").style("padding","4px 8px").style("pointer-events","none").style("display","none").style("z-index","1000"),this.svg=z.select(e).append("svg").attr("width",this.config.width).attr("height",this.config.height),this.chart=this.svg.append("g").attr("transform",`translate(${this.config.margin.left},${this.config.margin.top})`);const r=this.config.width-this.config.margin.left-this.config.margin.right;this.clipId=`clip-${Math.random().toString(36).substring(2,11)}`,this.svg.append("defs").append("clipPath").attr("id",this.clipId).append("rect").attr("x",0).attr("y",-Ee.LABEL_PADDING).attr("width",r).attr("height","100%"),this.xAxisGroup=this.chart.append("g").attr("class","x-axis"),this.clippedChart=this.chart.append("g").attr("clip-path",`url(#${this.clipId})`),this.x=z.scaleLinear().domain(this.config.domain).range([0,this.config.width-this.config.margin.left-this.config.margin.right]),this.initializeZoom(),this.createContextMenu()}initializeZoom(){const e=this.config.width-this.config.margin.left-this.config.margin.right,t=this.config.height-this.config.margin.top-this.config.margin.bottom;this.zoom=z.zoom().scaleExtent(this.config.zoomExtent).translateExtent([[0,0],[e,t]]).extent([[0,0],[e,t]]).filter(r=>(r.type==="mousedown"&&r.button===0&&(this.isDragging=!0),r.type==="mouseup"&&(this.isDragging=!1),!r.ctrlKey&&!r.button)).on("zoom",r=>{this.currentTransform=r.transform,this.drawTracks();const o=this.getCurrentDomain();this.config.onDomainChange(o)}).on("start",r=>{r.sourceEvent&&r.sourceEvent.type==="mousedown"&&(this.clippedChart.select(".chart-background").style("cursor","grabbing"),this.svg.style("cursor","grabbing"))}).on("end",()=>{this.isDragging=!1,this.clippedChart.select(".chart-background").style("cursor","grab"),this.svg.style("cursor","")}),this.svg.call(this.zoom),this.clippedChart.insert("rect",":first-child").attr("class","chart-background").attr("width",e).attr("height",t).attr("y",-Ee.LABEL_PADDING).style("fill","transparent").style("pointer-events","all").style("cursor","grab").on("click",()=>{this.config.onBackgroundClick()})}createContextMenu(){this.contextMenuController=jn({containerElement:this.containerElement,onSaveSVG:()=>this.saveAsSVG(),onSavePNG:()=>this.saveAsPNG(),getShowTrackLabels:()=>this.showTrackLabels,getShowAllAnnotationLabels:()=>this.showAllAnnotationLabels,onToggleTrackLabels:()=>this.toggleTrackLabels(),onToggleAllAnnotationLabels:()=>this.toggleAllAnnotationLabels()})}saveAsSVG(){const e=this.svg.node();if(!e)return;const t=e.cloneNode(!0),r=this.getInlineStyles(t),o=document.createElementNS("http://www.w3.org/2000/svg","style");o.textContent=r,t.insertBefore(o,t.firstChild),z.select(t).selectAll("[data-styled]").attr("data-styled",null);const s=new XMLSerializer().serializeToString(t),l=new Blob([s],{type:"image/svg+xml"}),c=URL.createObjectURL(l),f=document.createElement("a");f.href=c,f.download="track-viewer.svg",f.click(),URL.revokeObjectURL(c)}saveAsPNG(){const e=this.svg.node();if(!e)return;const t=e.cloneNode(!0),r=this.getInlineStyles(t),o=document.createElementNS("http://www.w3.org/2000/svg","style");o.textContent=r,t.insertBefore(o,t.firstChild),z.select(t).selectAll("[data-styled]").attr("data-styled",null);const s=new XMLSerializer().serializeToString(t),l=20,c=document.createElement("canvas"),f=c.getContext("2d");if(!f)return;const d=2;c.width=(this.config.width+l*2)*d,c.height=(this.config.height+l*2)*d,f.scale(d,d);const h=new Image,p=new Blob([s],{type:"image/svg+xml"}),m=URL.createObjectURL(p);h.onload=()=>{f.fillStyle="white",f.fillRect(0,0,this.config.width+l*2,this.config.height+l*2),f.drawImage(h,l,l),URL.revokeObjectURL(m),c.toBlob(E=>{if(E){const O=URL.createObjectURL(E),I=document.createElement("a");I.href=O,I.download="track-viewer.png",I.click(),URL.revokeObjectURL(O)}})},h.src=m}getInlineStyles(e=this.svg.node()){const t=Array.from(document.styleSheets),r=[];t.forEach(a=>{try{const s=a.cssRules||a.rules;s&&Array.from(s).forEach(l=>{if(l.selectorText){const c=l.selectorText;(c.includes(".track")||c.includes(".annotation")||c.includes(".axis")||c.includes(".primitive")||c.includes("svg")||c.includes("text")||c.includes("rect")||c.includes("path")||c.includes("circle")||c.includes("line")||c.includes("polygon"))&&r.push(l.cssText)}})}catch{}});const o=z.select(e);return o.selectAll(".track-label").each(function(){const a=this,s=window.getComputedStyle(a);a.hasAttribute("data-styled")||(a.setAttribute("data-styled","true"),a.setAttribute("style",`font-family: ${s.fontFamily}; font-size: ${s.fontSize}; fill: ${s.fill||"currentColor"};`))}),o.selectAll(".annotation, .primitive").each(function(){const a=this,s=window.getComputedStyle(a),l=a.getAttribute("data-label");if(l&&!a.querySelector("title")){const f=document.createElementNS("http://www.w3.org/2000/svg","title");f.textContent=l,a.insertBefore(f,a.firstChild),a.removeAttribute("data-label")}a.querySelectorAll("path, rect, circle, line, polygon, ellipse").forEach(f=>{const d=f,h=window.getComputedStyle(d);if(!d.hasAttribute("data-styled")){d.setAttribute("data-styled","true");const p=[],m=h.fill,E=s.fill;if(m&&m!=="none"&&m!=="rgb(0, 0, 0)"?p.push(`fill: ${m}`):E&&E!=="none"&&E!=="rgb(0, 0, 0)"&&p.push(`fill: ${E}`),h.stroke&&h.stroke!=="none"&&p.push(`stroke: ${h.stroke}`),h.strokeWidth&&p.push(`stroke-width: ${h.strokeWidth}`),h.opacity&&h.opacity!=="1"&&p.push(`opacity: ${h.opacity}`),p.length>0){const O=d.getAttribute("style")||"";d.setAttribute("style",O+" "+p.join("; ")+";")}}})}),r.join(`
|
|
2
|
+
`)}toggleTrackLabels(){var t;if(this.showTrackLabels=!this.showTrackLabels,this.chart.select(".track-labels-container").style("display",this.showTrackLabels?"":"none"),this.showTrackLabels)this.updateMarginAndLayout();else{this.config.margin.left=this.originalLeftMargin,this.chart.attr("transform",`translate(${this.config.margin.left},${this.config.margin.top})`),this.x.range([0,this.config.width-this.config.margin.left-this.config.margin.right]);const r=this.config.width-this.config.margin.left-this.config.margin.right;this.svg.select("clipPath rect").attr("width",r),this.clippedChart.select(".chart-background").attr("width",r),this.drawTracks()}(t=this.contextMenuController)==null||t.updateCheckbox("Show track labels",this.showTrackLabels)}toggleAllAnnotationLabels(){var t;this.showAllAnnotationLabels=!this.showAllAnnotationLabels;const e=this.showAllAnnotationLabels;this.clippedChart.selectAll(".annotation-labels-layer .annotation-label-group").each(function(){const r=z.select(this),a=r.select(".annotation-label").attr("data-show-label");a==="never"?r.style("display","none"):a==="always"?r.style("display",""):r.style("display",e?"":"none")}),(t=this.contextMenuController)==null||t.updateCheckbox("Show all annotation labels",this.showAllAnnotationLabels)}getTrackHeight(e){return e.height||this.config.trackHeight}getTotalTracksHeight(){return this.data.tracks.reduce((e,t)=>e+this.getTrackHeight(t),0)}getTrackYPosition(e){let t=0;for(let r=0;r<e;r++)t+=this.getTrackHeight(this.data.tracks[r]);return t}updateHeight(){const e=this.getTotalTracksHeight()+this.config.margin.top+this.config.margin.bottom;this.config.height=e,this.svg.attr("height",e);const t=this.getTotalTracksHeight();this.xAxisGroup.attr("transform",`translate(0, ${t})`),this.svg.select("clipPath rect").attr("height",t+Ee.LABEL_PADDING),this.clippedChart.select(".chart-background").attr("height",t+Ee.LABEL_PADDING)}createTrackGroups(){this.trackGroups=this.clippedChart.selectAll(".track").data(this.data.tracks,t=>t.id).join("g").attr("id",t=>t.id).attr("class","track").attr("transform",(t,r)=>`translate(0, ${this.getTrackYPosition(r)})`);let e=this.chart.select(".track-labels-container");e.empty()&&(e=this.chart.append("g").attr("class","track-labels-container")),e.style("display",this.showTrackLabels?"":"none"),this.labelGroups=e.selectAll(".track-label-group").data(this.data.tracks,t=>t.id).join("g").attr("id",t=>`${t.id}-label`).attr("class","track-label-group").attr("transform",(t,r)=>`translate(0, ${this.getTrackYPosition(r)})`),this.labelGroups.selectAll(".track-label").data(t=>[t]).join("text").attr("class","track-label").attr("x",-10).attr("y",t=>this.getTrackHeight(t)/2).attr("dy","0.35em").attr("text-anchor","end").text(t=>t.label)}drawTracks(){const e=this.currentTransform.rescaleX(this.x);if(this.xAxisGroup.call(z.axisBottom(e)),this.xAxisGroup.selectAll("text").attr("class","axis-label"),!this.trackGroups)return;const t=[];this.trackGroups.each((r,o,a)=>{const s=z.select(a[o]),l=this.getTrackYPosition(o),c=this.data.annotations.filter(m=>m.trackId===r.id),d=[...(this.data.primitives||[]).filter(m=>m.trackId===r.id).map(m=>({type:"primitive",data:m})),...c.map(m=>({type:"annotation",data:m}))],h=s.selectAll("g.element").data(d,m=>m.data.id).join(m=>m.append("g"),m=>m,m=>m.remove()).attr("id",m=>m.data.id).attr("class",m=>m.type==="primitive"?`element ${m.type} ${m.data.type} ${m.data.class}`:`element ${m.type} ${m.data.type} ${m.data.classes.join(" ")}`),p=this;h.each(function(m){const E=z.select(this);E.selectAll("*").remove(),m.type==="primitive"?p.renderPrimitive(E,m.data,e,r):p.renderAnnotation(E,m.data,e,r,t,l)})}),this.renderAllLabels(t,e)}renderAnnotation(e,t,r,o,a,s=0){const l=r(t.start),c=Math.max(1,r(t.end)-r(t.start)),f=this.getTrackHeight(o),d=t.heightFraction!==void 0?f*t.heightFraction:f/2,h=f-(t.fy!==void 0?t.fy*f:f/2);let p;switch(t.type){case"arrow":p=this.renderArrow(e,l,h,c,d,t.direction);break;case"circle":p=this.renderCircle(e,l,h,d);break;case"triangle":p=this.renderTriangle(e,l,h,d);break;case"pin":p=this.renderPin(e,l,h,d);break;case"box":default:p=this.renderBox(e,l,h,c,d,t.corner_radius||0);break}e.attr("data-label",t.label),p.attr("data-annotation-id",t.id).style("cursor","pointer").style("pointer-events","all"),t.fill&&p.style("fill",t.fill),t.stroke&&p.style("stroke",t.stroke),t.opacity!==void 0&&p.style("opacity",t.opacity),p.on("mouseover",m=>{this.isDragging||(p.classed("hovered",!0),this.clippedChart.selectAll(`.annotation-label-group[data-annotation-id="${t.id}"]`).style("display","block").select(".annotation-label-background").style("display",""),t.tooltip!==void 0&&this.showTooltip(m,t,o),this.config.onAnnotationHover(t,o,m))}).on("mouseout",()=>{p.classed("hovered",!1);const m=this.showAllAnnotationLabels;this.clippedChart.selectAll(`.annotation-label-group[data-annotation-id="${t.id}"]`).each(function(){const E=z.select(this),I=E.select(".annotation-label").attr("data-show-label");I==="hover"&&m?E.style("display",""):I==="hover"?E.style("display","none"):E.style("display",""),E.select(".annotation-label-background").style("display","none")}),this.hideTooltip()}).on("click",()=>{this.config.onAnnotationClick(t,o)}),a&&t.label&&t.showLabel!=="never"&&a.push({annotation:t,trackData:o,x:l,y:h,width:c,height:d,trackY:s})}renderPrimitive(e,t,r,o){const a=this.getTrackHeight(o);let s;switch(t.type){case"horizontal-line":s=this.renderHorizontalLine(e,t,r,a);break;case"background":s=this.renderBackground(e,t,r,a);break;default:return}s.attr("class",`primitive ${t.class}`),t.stroke?s.style("stroke",t.stroke):t.type==="horizontal-line"&&s.style("stroke","currentColor"),t.fill?s.style("fill",t.fill):t.type==="background"&&s.style("fill","none"),t.opacity!==void 0&&s.style("opacity",t.opacity)}renderHorizontalLine(e,t,r,o){const a=r.range();let s,l;t.start!==void 0&&t.end!==void 0?(s=r(t.start),l=r(t.end)):t.start!==void 0&&t.end===void 0?(s=r(t.start),l=a[1]):t.start===void 0&&t.end!==void 0?(s=a[0],l=r(t.end)):(s=a[0],l=a[1]);const c=o-(t.fy!==void 0?t.fy*o:o/2),f=Math.round(c)+.5;return e.append("line").attr("x1",s).attr("x2",l).attr("y1",f).attr("y2",f).style("stroke-width",1).style("shape-rendering","crispEdges")}renderBackground(e,t,r,o){const a=r.range();let s,l;return t.start!==void 0&&t.end!==void 0?(s=r(t.start),l=r(t.end)):t.start!==void 0&&t.end===void 0?(s=r(t.start),l=a[1]):t.start===void 0&&t.end!==void 0?(s=a[0],l=r(t.end)):(s=a[0],l=a[1]),e.append("rect").attr("x",s).attr("y",0).attr("width",l-s).attr("height",o)}renderBox(e,t,r,o,a,s=0){return e.append("rect").attr("x",t).attr("y",r-a/2).attr("width",o).attr("height",a).attr("rx",s).attr("ry",s)}renderArrow(e,t,r,o,a,s){const l=Math.min(o*.2,a*.5,8),c=o-l;let f;const d=r-a/2,h=r+a/2;if(s==="right")f=`
|
|
3
|
+
M ${t} ${d}
|
|
4
|
+
L ${t+c} ${d}
|
|
5
|
+
L ${t+o} ${r}
|
|
6
|
+
L ${t+c} ${h}
|
|
7
|
+
L ${t} ${h}
|
|
27
8
|
Z
|
|
28
|
-
`;else if(
|
|
29
|
-
M ${
|
|
30
|
-
L ${
|
|
31
|
-
L ${
|
|
32
|
-
L ${
|
|
33
|
-
L ${
|
|
9
|
+
`;else if(s==="left")f=`
|
|
10
|
+
M ${t} ${r}
|
|
11
|
+
L ${t+l} ${d}
|
|
12
|
+
L ${t+o} ${d}
|
|
13
|
+
L ${t+o} ${h}
|
|
14
|
+
L ${t+l} ${h}
|
|
34
15
|
Z
|
|
35
|
-
`;else{const
|
|
36
|
-
M ${
|
|
37
|
-
L ${
|
|
38
|
-
L ${
|
|
39
|
-
L ${
|
|
40
|
-
L ${
|
|
41
|
-
L ${
|
|
16
|
+
`;else{const p=Math.min(o*.1,a*.3,4);f=`
|
|
17
|
+
M ${t+p} ${d}
|
|
18
|
+
L ${t+o-p} ${d}
|
|
19
|
+
L ${t+o} ${r}
|
|
20
|
+
L ${t+o-p} ${h}
|
|
21
|
+
L ${t+p} ${h}
|
|
22
|
+
L ${t} ${r}
|
|
42
23
|
Z
|
|
43
|
-
`}return t.append("path").attr("d",u)}renderCircle(t,n,s,r){return t.append("circle").attr("cx",n).attr("cy",s).attr("r",r/2).attr("class","annotation-marker")}renderTriangle(t,n,s,r=.5){const i=r*.8,o=[[n-i/2,s+r],[n,s],[n+i/2,s+r]].map(l=>l.join(",")).join(" ");return t.append("polygon").attr("points",o).attr("class","annotation-triangle")}renderPin(t,n,s,r){const i=t.append("g").attr("class","annotation-pin");return i.append("line").attr("x1",n).attr("y1",s).attr("x2",n).attr("y2",s-r).attr("stroke","black").attr("class","annotation-pin-line"),i.append("circle").attr("cx",n).attr("cy",s-r).attr("r",3).attr("class","annotation-pin-head"),i}renderAnnotationLabel(t,n,s,r,i,o){const l=n.showLabel||"hover";if(!n.label)return;const a=n.labelPosition||"above";let u,c,f="middle";n.type==="circle"||n.type==="triangle"||n.type==="pin"?(u=s,a==="above"?n.type==="pin"?c=r-o-8:c=r-o/2-2:c=r):(u=s+i/2,a==="above"?c=r-o/2-8:c=r);const h=t.append("text").attr("x",u).attr("y",c).attr("dy","0.35em").attr("text-anchor",f).attr("class","annotation-label").attr("data-annotation-id",n.id).attr("data-show-label",l).style("fill","currentColor").text(n.label);if(l==="hover"){const g=h.node();if(g&&typeof g.getBBox=="function")try{const b=g.getBBox(),v=0;t.insert("rect","text").attr("x",b.x-v).attr("y",b.y-v).attr("width",b.width+v*2).attr("height",b.height+v*2).attr("rx",2).attr("ry",2).attr("class","annotation-label-background").style("fill","white").style("opacity","0.8").style("display","none")}catch{}}l==="always"?t.style("display",""):l==="never"?t.style("display","none"):t.style("display",this.showAllAnnotationLabels?"":"none")}renderAllLabels(t,n){let s=this.clippedChart.select(".annotation-labels-layer");s.empty()&&(s=this.clippedChart.append("g").attr("class","annotation-labels-layer"));const r=s.selectAll(".annotation-label-group").data(t,o=>o.annotation.id).join(o=>o.append("g"),o=>o,o=>o.remove()).attr("class",o=>`annotation-label-group ${o.annotation.classes.join(" ")}`).attr("data-annotation-id",o=>o.annotation.id).attr("transform",o=>`translate(0, ${o.trackY})`).style("pointer-events","none"),i=this;r.each(function(o){const l=be.select(this);l.selectAll("*").remove(),i.renderAnnotationLabel(l,o.annotation,o.x,o.y,o.width,o.height)})}showTooltip(t,n,s){const r=n.tooltip!==void 0?n.tooltip:`<strong>${n.label}</strong><br/>Start: ${n.start}<br/>End: ${n.end}<br/>Track: ${s.label}`;this.tooltip.style("display","block").style("left",`${t.pageX+10}px`).style("top",`${t.pageY-10}px`).html(r)}hideTooltip(){this.tooltip.style("display","none")}calculateRequiredLeftMargin(){if(!this.showTrackLabels)return this.originalLeftMargin;if(this.data.tracks.length===0)return this.originalLeftMargin;const t=this.svg.append("text").attr("class","track-label").style("visibility","hidden");let n=0;return this.data.tracks.forEach(r=>{t.text(r.label);const i=t.node();if(i&&typeof i.getBBox=="function")try{const o=i.getBBox();n=Math.max(n,o.width)}catch{n=Math.max(n,r.label.length*8)}else n=Math.max(n,r.label.length*8)}),t.remove(),Math.max(this.originalLeftMargin,n+20)}updateMarginAndLayout(){const t=this.calculateRequiredLeftMargin();if(Math.abs(this.config.margin.left-t)>5){this.config.margin.left=t,this.chart.attr("transform",`translate(${this.config.margin.left},${this.config.margin.top})`),this.x.range([0,this.config.width-this.config.margin.left-this.config.margin.right]);const n=this.config.width-this.config.margin.left-this.config.margin.right;this.svg.select("clipPath rect").attr("width",n),this.clippedChart.select(".chart-background").attr("width",n)}}setData(t){this.data={tracks:t.tracks,annotations:t.annotations,primitives:t.primitives||[]},this.updateMarginAndLayout(),this.updateHeight(),this.createTrackGroups(),this.drawTracks()}addTrack(t,n,s){this.data.tracks.push(t),n&&this.data.annotations.push(...n),s&&(this.data.primitives||(this.data.primitives=[]),this.data.primitives.push(...s)),this.updateMarginAndLayout(),this.updateHeight(),this.createTrackGroups(),this.drawTracks()}removeTrack(t){this.data.tracks=this.data.tracks.filter(n=>n.id!==t),this.data.annotations=this.data.annotations.filter(n=>n.trackId!==t),this.data.primitives=(this.data.primitives||[]).filter(n=>n.trackId!==t),this.updateMarginAndLayout(),this.updateHeight(),this.createTrackGroups(),this.drawTracks()}addAnnotation(t){this.data.annotations.push(t),this.drawTracks()}removeAnnotation(t){this.data.annotations=this.data.annotations.filter(n=>n.id!==t),this.drawTracks()}addPrimitive(t){this.data.primitives||(this.data.primitives=[]),this.data.primitives.push(t),this.drawTracks()}removePrimitive(t){this.data.primitives&&(this.data.primitives=this.data.primitives.filter(n=>n.id!==t),this.drawTracks())}updateDomain(t){this.config.domain=t,this.x.domain(t),this.drawTracks()}zoomTo(t,n){const r=(this.config.width-this.config.margin.left-this.config.margin.right)/(this.x(n)-this.x(t)),i=-this.x(t)*r,o=be.zoomIdentity.translate(i,0).scale(r);this.svg.transition().duration(750).call(this.zoom.transform,o)}resetZoom(){this.svg.transition().duration(750).call(this.zoom.transform,be.zoomIdentity)}destroy(){var t;this.resizeObserver&&this.resizeObserver.disconnect(),(t=this.contextMenuController)==null||t.destroy(),this.tooltip.remove(),this.svg.remove()}getConfig(){return{...this.config}}getData(){return{tracks:[...this.data.tracks],annotations:[...this.data.annotations],primitives:this.data.primitives?[...this.data.primitives]:[]}}resize(){if(!this.isResponsiveWidth)return;const t=this.calculateResponsiveWidth();if(Math.abs(this.config.width-t)>10){this.config.width=t,this.svg.attr("width",t),this.x.range([0,t-this.config.margin.left-this.config.margin.right]);const n=t-this.config.margin.left-this.config.margin.right;this.svg.select("clipPath rect").attr("width",n),this.clippedChart.select(".chart-background").attr("width",n);const s=this.config.height-this.config.margin.top-this.config.margin.bottom;this.zoom.translateExtent([[0,0],[n,s]]).extent([[0,0],[n,s]]),this.drawTracks()}}};Ft.LABEL_PADDING=24;let os=Ft;const Rt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Dc={name:"SimpleTable",props:{rows:{type:Array,required:!0,validator:e=>e.every(t=>Array.isArray(t))}},setup(e){const t=de(null),n=de("asc"),s=je(()=>e.rows[0]||[]),r=je(()=>e.rows.slice(1)),i=l=>{t.value===l?n.value==="asc"?n.value="desc":(t.value=null,n.value="asc"):(t.value=l,n.value="asc")},o=je(()=>t.value===null?r.value:[...r.value].sort((l,a)=>{const u=l[t.value],c=a[t.value];if(u===""||u===null||u===void 0)return 1;if(c===""||c===null||c===void 0)return-1;const f=parseFloat(String(u).replace(/[%,]/g,"")),h=parseFloat(String(c).replace(/[%,]/g,""));let g=0;return!isNaN(f)&&!isNaN(h)?g=f-h:g=String(u).localeCompare(String(c)),n.value==="asc"?g:-g}));return{headers:s,sortColumn:t,sortDirection:n,sortedDataRows:o,toggleSort:i}}},Nc={class:"simple-table"},jc=["onClick"],Bc={key:0,class:"sort-indicator"};function $c(e,t,n,s,r,i){return N(),B("table",Nc,[P("thead",null,[P("tr",null,[(N(!0),B(we,null,Qe(s.headers,(o,l)=>(N(),B("th",{key:l,onClick:a=>s.toggleSort(l),class:Ct({sortable:!0,sorted:s.sortColumn===l,"sort-asc":s.sortColumn===l&&s.sortDirection==="asc","sort-desc":s.sortColumn===l&&s.sortDirection==="desc"})},[vt(te(o)+" ",1),s.sortColumn===l?(N(),B("span",Bc,te(s.sortDirection==="asc"?"▲":"▼"),1)):ye("",!0)],10,jc))),128))])]),P("tbody",null,[(N(!0),B(we,null,Qe(s.sortedDataRows,(o,l)=>(N(),B("tr",{key:l},[(N(!0),B(we,null,Qe(o,(a,u)=>(N(),B("td",{key:u},te(a),1))),128))]))),128))])])}const ar=Rt(Dc,[["render",$c],["__scopeId","data-v-3dcf836d"]]),Hc={name:"SortableTable",props:{headers:{type:Array,required:!0},rows:{type:Array,required:!0},initialSortColumn:{type:Number,default:null},initialSortDirection:{type:String,default:"asc",validator:e=>["asc","desc"].includes(e)}},setup(e){const t=de(e.initialSortColumn),n=de(e.initialSortDirection),s=i=>{t.value===i?n.value==="asc"?n.value="desc":(t.value=null,n.value="asc"):(t.value=i,n.value="asc")},r=je(()=>t.value===null?e.rows:[...e.rows].sort((i,o)=>{var b,v;const l=i[t.value],a=o[t.value],u=typeof l=="object"&&l!==null?l.children||((b=l.props)==null?void 0:b.children)||"":l,c=typeof a=="object"&&a!==null?a.children||((v=a.props)==null?void 0:v.children)||"":a;if(u===""||u===null||u===void 0)return 1;if(c===""||c===null||c===void 0)return-1;const f=parseFloat(String(u).replace(/[%,]/g,"")),h=parseFloat(String(c).replace(/[%,]/g,""));let g=0;return!isNaN(f)&&!isNaN(h)?g=f-h:g=String(u).localeCompare(String(c)),n.value==="asc"?g:-g}));return{sortColumn:t,sortDirection:n,sortedRows:r,toggleSort:s}}},Uc={class:"sortable-table"},qc=["onClick"],Vc={key:0,class:"sort-indicator"};function zc(e,t,n,s,r,i){return N(),B("table",Uc,[P("thead",null,[P("tr",null,[(N(!0),B(we,null,Qe(n.headers,(o,l)=>(N(),B("th",{key:l,onClick:a=>s.toggleSort(l),class:Ct({sortable:!0,sorted:s.sortColumn===l,"sort-asc":s.sortColumn===l&&s.sortDirection==="asc","sort-desc":s.sortColumn===l&&s.sortDirection==="desc"})},[vt(te(o.label)+" ",1),s.sortColumn===l?(N(),B("span",Vc,te(s.sortDirection==="asc"?"▲":"▼"),1)):ye("",!0)],10,qc))),128))])]),P("tbody",null,[(N(!0),B(we,null,Qe(s.sortedRows,(o,l)=>(N(),B("tr",{key:l},[(N(!0),B(we,null,Qe(o,(a,u)=>{var c;return N(),B("td",{key:u,class:Ct((c=n.headers[u])==null?void 0:c.cellClass)},[typeof a=="object"&&a!==null?(N(),qt(hi(a),{key:0})):(N(),B(we,{key:1},[vt(te(a),1)],64))],2)}),128))]))),128))])])}const Wc={name:"FeatureDetails",components:{SimpleTable:ar,SortableTable:Rt(Hc,[["render",zc],["__scopeId","data-v-b8895c87"]])},props:{feature:{type:Object,default:null},allFeatures:{type:Array,default:()=>[]},dataProvider:{type:Object,default:null},recordInfo:{type:Object,default:null},regionNumber:{type:String,default:"1"}},emits:["close"],setup(e){const t=de([]),n=de(!1),s=de(null),r=async()=>{var C,L,J;if(t.value=[],n.value=!1,s.value=null,!e.feature||e.feature.type!=="CDS"||!e.dataProvider||!e.recordInfo)return;const R=(L=(C=e.feature.qualifiers)==null?void 0:C.locus_tag)==null?void 0:L[0];if(R){n.value=!0;try{const se=await e.dataProvider.getMiBIGEntries(e.recordInfo.recordId,R,e.regionNumber);t.value=se.entries||[]}catch(se){((J=se.response)==null?void 0:J.status)===404?t.value=[]:(console.error("Error fetching MiBIG entries:",se),s.value="Failed to load MiBIG entries")}finally{n.value=!1}}};Je(()=>e.feature,()=>{r()},{immediate:!0});const i=je(()=>{var C,L,J,se;if(!e.feature||e.feature.type!=="CDS")return[];if(!e.allFeatures||e.allFeatures.length===0)return[];const R=((L=(C=e.feature.qualifiers)==null?void 0:C.locus_tag)==null?void 0:L[0])||((se=(J=e.feature.qualifiers)==null?void 0:J.gene)==null?void 0:se[0]);return R?e.allFeatures.filter(ce=>{var ie,ee,Q,Z;return ce.type==="PFAM_domain"&&(((ee=(ie=ce.qualifiers)==null?void 0:ie.locus_tag)==null?void 0:ee[0])===R||((Z=(Q=ce.qualifiers)==null?void 0:Q.gene)==null?void 0:Z[0])===R)}).map(ce=>{var ie,ee,Q,Z,m,w,D,M,U,ue,Ve,et,ut;return{id:((Q=(ee=(ie=ce.qualifiers)==null?void 0:ie.db_xref)==null?void 0:ee[0])==null?void 0:Q.replace("PFAM:",""))||((D=(w=(m=(Z=ce.qualifiers)==null?void 0:Z.inference)==null?void 0:m[0])==null?void 0:w.match(/PFAM:([^,\s]+)/))==null?void 0:D[1])||"Unknown",description:((U=(M=ce.qualifiers)==null?void 0:M.description)==null?void 0:U[0])||"",location:l(ce.qualifiers),score:((Ve=(ue=ce.qualifiers)==null?void 0:ue.score)==null?void 0:Ve[0])||"",evalue:((ut=(et=ce.qualifiers)==null?void 0:et.evalue)==null?void 0:ut[0])||""}}):[]}),o=je(()=>{if(!e.feature)return[];const R=[],C=e.feature.qualifiers||{};return C.go_function&&R.push(...C.go_function),C.go_process&&R.push(...C.go_process),C.go_component&&R.push(...C.go_component),R}),l=R=>{var J,se;if(!R)return"";const C=(J=R.protein_start)==null?void 0:J[0],L=(se=R.protein_end)==null?void 0:se[0];return C&&L?`[${C}:${L}]`:""},a=R=>{if(!R)return"";const C=R.match(/\[<?(\d+):>?(\d+)\](?:\(([+-])\))?/);if(!C)return R;const L=parseInt(C[1]),J=parseInt(C[2]),se=C[3]||"",ce=J-L;return`${L.toLocaleString()} - ${J.toLocaleString()}${se?", "+se:""} (total: ${ce.toLocaleString()} nt)`},u=()=>{var ce,ie,ee,Q,Z,m;if(!e.feature)return"";const R=e.feature.qualifiers||{},C=((ce=R.locus_tag)==null?void 0:ce[0])||"",L=((ie=R.product)==null?void 0:ie[0])||"",J=((ee=R.gene)==null?void 0:ee[0])||"",se=((Q=R.description)==null?void 0:Q[0])||"";if(e.feature.type==="CDS"){if(C&&L)return`${C} - ${L}`;if(C)return C;if(J)return J;if(L)return L}if(e.feature.type==="PFAM_domain"){const w=((m=(Z=R.db_xref)==null?void 0:Z[0])==null?void 0:m.replace("PFAM:",""))||"PFAM domain";return se?`${w} - ${se}`:w}return se||L||e.feature.type||"Feature Details"},c=R=>R.split("_").map((L,J)=>J===0?L.charAt(0).toUpperCase()+L.slice(1):L).join(" "),f=R=>Array.isArray(R)?R.join(", "):R,h=()=>{if(!e.feature||!e.feature.qualifiers)return!1;const R=["locus_tag","protein_id","gene","product","gene_kind","translation","nucleotide","go_function","go_process","go_component"];return Object.keys(e.feature.qualifiers).filter(L=>!R.includes(L)).length>0},g=()=>{if(!e.feature||!e.feature.qualifiers)return{};const R=["locus_tag","protein_id","gene","product","gene_kind","translation","nucleotide","go_function","go_process","go_component"],C={};return Object.keys(e.feature.qualifiers).forEach(L=>{R.includes(L)||(C[L]=e.feature.qualifiers[L])}),C},b=R=>{if(!R)return"";const C=[];for(let L=0;L<R.length;L+=60)C.push(R.slice(L,L+60));return C.join(`
|
|
44
|
-
`)},v=async(R,C)=>{try{await navigator.clipboard.writeText(R),alert(`${C} sequence copied to clipboard!`)}catch(L){console.error("Failed to copy to clipboard:",L),alert("Failed to copy to clipboard")}},A=(R,C)=>({NRPS_PKS:$,sec_met_domain:H}[R]||W)(C),$=R=>{const C=R.map(ie=>{const ee=ie.split(/\.\s+/);if(ee.length===0)return{domain:ie};const Z={domain:ee[0].replace(/^Domain:\s*/,"").trim()};return ee.slice(1).forEach(m=>{const w=m.indexOf(":");if(w>-1){const D=m.substring(0,w).trim(),M=m.substring(w+1).trim();Z[D]=M}}),Z}),L=C[0]||{},J=Object.keys(L).filter(ie=>ie!=="domain"),ce=[["",...J],...C.map(ie=>{const ee=[ie.domain||""];return J.forEach(Q=>{ee.push(ie[Q]||"")}),ee})];return yn(ar,{rows:ce})},H=R=>{const C=R.map(ie=>{const ee=ie.match(/^([^(]+)\s*\(([^)]+)\)/);if(!ee)return{name:ie};const Q=ee[1].trim(),Z=ee[2],m={name:Q};return Z.split(/,\s*/).forEach(D=>{const M=D.indexOf(":");if(M>-1){const U=D.substring(0,M).trim(),ue=D.substring(M+1).trim();m[U]=ue}}),m}),L=C[0]||{},J=Object.keys(L).filter(ie=>ie!=="name"),ce=[["",...J],...C.map(ie=>{const ee=[ie.name||""];return J.forEach(Q=>{ee.push(ie[Q]||"")}),ee})];return yn(ar,{rows:ce})},W=R=>{const C=R.map((L,J)=>yn("li",{key:J},L));return yn("ul",{class:"qualifier-list"},C)},j=R=>typeof R=="number"?R.toExponential(2):R,K=[{label:"Domain",cellClass:"pfam-id"},{label:"Description",cellClass:"pfam-description"},{label:"Location",cellClass:"pfam-location"},{label:"Score",cellClass:"pfam-score"},{label:"E-value",cellClass:"pfam-evalue"}],ae=je(()=>i.value.map(R=>[R.id,R.description,R.location,R.score,R.evalue])),he=[{label:"MIBiG Protein",cellClass:"mibig-protein"},{label:"Description",cellClass:"mibig-description"},{label:"MIBiG Cluster",cellClass:"mibig-cluster"},{label:"Product",cellClass:"mibig-product"},{label:"% ID",cellClass:"mibig-percent"},{label:"BLAST Score",cellClass:"mibig-score"},{label:"% Coverage",cellClass:"mibig-percent"},{label:"E-value",cellClass:"mibig-evalue"}],Se=je(()=>t.value.map(R=>[R.mibig_protein,R.description,yn("a",{href:`https://mibig.secondarymetabolites.org/go/${R.mibig_cluster}`,target:"_blank",rel:"noopener noreferrer"},R.mibig_cluster),R.mibig_product,`${parseFloat(R.percent_identity).toFixed(1)}%`,parseFloat(R.blast_score).toFixed(1),`${parseFloat(R.percent_coverage).toFixed(1)}%`,j(R.evalue)]));return{pfamDomains:i,goTerms:o,mibigEntries:t,mibigLoading:n,mibigError:s,formatLocation:a,getFeatureTitle:u,formatQualifierKey:c,formatQualifierValue:f,hasAdditionalQualifiers:h,getAdditionalQualifiers:g,formatSequence:b,copyToClipboard:v,renderQualifierValue:A,formatEvalue:j,pfamTableHeaders:K,pfamTableRows:ae,mibigTableHeaders:he,mibigTableRows:Se}}},Kc={key:0,class:"feature-details"},Gc={class:"feature-content"},Jc={class:"feature-header"},Xc={class:"info-section"},Yc={key:0,class:"info-row"},Qc={class:"info-value"},Zc={key:1,class:"info-row"},eu={class:"info-value"},tu={key:2,class:"info-row"},nu={class:"info-value"},su={key:3,class:"info-row"},ru={class:"info-value"},iu={key:4,class:"info-row"},ou={class:"info-value"},lu={key:5,class:"info-row"},au={class:"info-value"},cu={class:"info-label"},uu={class:"info-value"},fu={key:0,class:"expandable-list"},du={class:"expanded-content"},hu={key:6,class:"info-row"},pu={class:"info-value"},gu={class:"expandable-list"},mu={class:"expanded-content"},yu={key:7,class:"info-row"},bu={class:"info-value"},_u={class:"expandable-list"},wu={class:"expanded-content"},vu={key:8,class:"info-row"},xu={class:"info-value"},Su={class:"expandable-list"},Cu={class:"expanded-content"},Tu={class:"go-term-list"},Eu={key:0,class:"info-section sequences"},Au={key:0,class:"info-row"},ku={class:"info-value"},Ru={class:"expandable-list"},Ou={class:"expanded-content"},Pu={class:"sequence-text"},Lu={key:1,class:"sequence-block"},Fu={class:"sequence-header"},Mu={class:"sequence-text"},Iu={key:1,class:"no-selection"};function Du(e,t,n,s,r,i){var l,a,u,c,f,h,g,b,v,A,$,H,W,j;const o=cn("SortableTable");return n.feature?(N(),B("div",Kc,[P("div",Gc,[P("div",Jc,[P("h3",null,te(n.feature.type),1)]),P("div",Xc,[(a=(l=n.feature.qualifiers)==null?void 0:l.locus_tag)!=null&&a[0]?(N(),B("div",Yc,[t[2]||(t[2]=P("span",{class:"info-label"},"Locus tag",-1)),P("span",Qc,te(n.feature.qualifiers.locus_tag[0]),1)])):ye("",!0),(c=(u=n.feature.qualifiers)==null?void 0:u.protein_id)!=null&&c[0]?(N(),B("div",Zc,[t[3]||(t[3]=P("span",{class:"info-label"},"Protein ID",-1)),P("span",eu,te(n.feature.qualifiers.protein_id[0]),1)])):ye("",!0),(h=(f=n.feature.qualifiers)==null?void 0:f.gene)!=null&&h[0]?(N(),B("div",tu,[t[4]||(t[4]=P("span",{class:"info-label"},"Gene",-1)),P("span",nu,te(n.feature.qualifiers.gene[0]),1)])):ye("",!0),(b=(g=n.feature.qualifiers)==null?void 0:g.product)!=null&&b[0]?(N(),B("div",su,[t[5]||(t[5]=P("span",{class:"info-label"},"Product",-1)),P("span",ru,te(n.feature.qualifiers.product[0]),1)])):ye("",!0),n.feature.location?(N(),B("div",iu,[t[6]||(t[6]=P("span",{class:"info-label"},"Location",-1)),P("span",ou,te(s.formatLocation(n.feature.location)),1)])):ye("",!0),(A=(v=n.feature.qualifiers)==null?void 0:v.gene_kind)!=null&&A[0]?(N(),B("div",lu,[t[7]||(t[7]=P("span",{class:"info-label"},"Gene kind",-1)),P("span",au,te(n.feature.qualifiers.gene_kind[0]),1)])):ye("",!0),(N(!0),B(we,null,Qe(s.getAdditionalQualifiers(),(K,ae)=>(N(),B("div",{key:ae,class:"info-row"},[P("span",cu,te(s.formatQualifierKey(ae)),1),P("span",uu,[Array.isArray(K)&&K.length>1?(N(),B("details",fu,[P("summary",null,te(K.length)+" items",1),P("div",du,[(N(),qt(hi(s.renderQualifierValue(ae,K))))])])):(N(),B(we,{key:1},[vt(te(s.formatQualifierValue(K)),1)],64))])]))),128)),s.pfamDomains.length>0?(N(),B("div",hu,[t[8]||(t[8]=P("span",{class:"info-label"},"Pfam hits",-1)),P("span",pu,[P("details",gu,[P("summary",null,te(s.pfamDomains.length)+" items",1),P("div",mu,[Ee(o,{headers:s.pfamTableHeaders,rows:s.pfamTableRows},null,8,["headers","rows"])])])])])):ye("",!0),n.feature.type==="CDS"&&s.mibigEntries.length>0?(N(),B("div",yu,[t[9]||(t[9]=P("span",{class:"info-label"},"MiBIG hits",-1)),P("span",bu,[P("details",_u,[P("summary",null,te(s.mibigEntries.length)+" items",1),P("div",wu,[Ee(o,{headers:s.mibigTableHeaders,rows:s.mibigTableRows},null,8,["headers","rows"])])])])])):ye("",!0),s.goTerms.length>0?(N(),B("div",vu,[t[10]||(t[10]=P("span",{class:"info-label"},"GO terms",-1)),P("span",xu,[P("details",Su,[P("summary",null,te(s.goTerms.length)+" items",1),P("div",Cu,[P("ul",Tu,[(N(!0),B(we,null,Qe(s.goTerms,(K,ae)=>(N(),B("li",{key:ae,class:"go-term"},te(K),1))),128))])])])])])):ye("",!0)]),n.feature.type==="CDS"?(N(),B("div",Eu,[(H=($=n.feature.qualifiers)==null?void 0:$.translation)!=null&&H[0]?(N(),B("div",Au,[t[12]||(t[12]=P("span",{class:"info-label"},"AA sequence",-1)),P("span",ku,[P("details",Ru,[P("summary",null,[t[11]||(t[11]=vt(" Show sequence ",-1)),P("button",{onClick:t[0]||(t[0]=po(K=>s.copyToClipboard(n.feature.qualifiers.translation[0],"amino acid"),["stop"])),class:"copy-button copy-button-inline"}," Copy to clipboard ")]),P("div",Ou,[P("pre",Pu,te(s.formatSequence(n.feature.qualifiers.translation[0])),1)])])])])):ye("",!0),(j=(W=n.feature.qualifiers)==null?void 0:W.nucleotide)!=null&&j[0]?(N(),B("div",Lu,[P("div",Fu,[t[13]||(t[13]=P("span",{class:"sequence-label"},"Nucleotide sequence",-1)),P("button",{onClick:t[1]||(t[1]=K=>s.copyToClipboard(n.feature.qualifiers.nucleotide[0],"nucleotide")),class:"copy-button"}," Copy to clipboard ")]),P("pre",Mu,te(s.formatSequence(n.feature.qualifiers.nucleotide[0])),1)])):ye("",!0)])):ye("",!0)])])):(N(),B("div",Iu,t[14]||(t[14]=[P("p",null,"Click on a feature to view details",-1)])))}const Nu=Rt(Wc,[["render",Du],["__scopeId","data-v-76c471aa"]]),ju={name:"SimpleDetails",props:{data:{type:Object,default:null},elementType:{type:String,default:""}},setup(e){const t=je(()=>{if(!e.data)return{};const i={},o=["_elementType"];return Object.keys(e.data).forEach(l=>{o.includes(l)||(i[l]=e.data[l])}),i}),n=je(()=>{if(!e.data)return[];const i=["_elementType"];return Object.keys(e.data).filter(o=>!i.includes(o))});return{displayData:t,displayKeys:n,formatLabel:i=>{const o=i.replace(/_/g," ").replace(/([A-Z])/g," $1").split(" ").filter(l=>l.length>0);return o.length===0?"":o[0].charAt(0).toUpperCase()+o[0].slice(1).toLowerCase()+(o.length>1?" "+o.slice(1).map(l=>l.toLowerCase()).join(" "):"")},formatValue:(i,o)=>o==null?"N/A":typeof o=="number"?i.toLowerCase().includes("evalue")&&o<.01?o.toExponential(2):i.toLowerCase().includes("score")||i.toLowerCase().includes("bitscore")?o.toFixed(1):i.toLowerCase().includes("percent")||i.toLowerCase().includes("identity")||i.toLowerCase().includes("coverage")?`${o.toFixed(1)}%`:o.toLocaleString():Array.isArray(o)?o.length===0?"None":o.length===1?String(o[0]):o.join(", "):typeof o=="boolean"?o?"Yes":"No":typeof o=="object"?JSON.stringify(o,null,2):String(o)}}},Bu={key:0,class:"simple-details"},$u={key:0,class:"details-header"},Hu={class:"details-content"},Uu={class:"info-section"},qu={class:"info-label"},Vu={class:"info-value"},zu={key:1,class:"no-selection"};function Wu(e,t,n,s,r,i){return n.data?(N(),B("div",Bu,[n.elementType?(N(),B("div",$u,[P("h3",null,te(n.elementType),1)])):ye("",!0),P("div",Hu,[P("div",Uu,[(N(!0),B(we,null,Qe(s.displayKeys,o=>(N(),B("div",{key:o,class:"info-row"},[P("span",qu,te(s.formatLabel(o)),1),P("span",Vu,te(s.formatValue(o,s.displayData[o])),1)]))),128))])])])):(N(),B("div",zu,t[0]||(t[0]=[P("p",null,"Click on an element to view details",-1)])))}const Ku={name:"RegionViewerComponent",components:{FeatureDetails:Nu,SimpleDetails:Rt(ju,[["render",Wu],["__scopeId","data-v-6d8f9976"]])},props:{recordInfo:{type:Object,default:null},regions:{type:Array,default:()=>[]},features:{type:Array,default:()=>[]},regionBoundaries:{type:Object,default:null},pfamColorMap:{type:Object,default:()=>({})},selectedRegionId:{type:String,default:""},dataProvider:{type:Object,default:null},tfbsHits:{type:Array,default:()=>[]},ttaCodons:{type:Array,default:()=>[]},resistanceFeatures:{type:Array,default:()=>[]}},emits:["region-changed","annotation-clicked","annotation-hovered","error"],setup(e,{emit:t,expose:n}){const s=de(null),r=de(""),i=de(!1),o=de(""),l=de([]),a=de([]),u=de(!1),c=je(()=>{if(!r.value||!e.regions.length)return"1";const m=e.regions.find(w=>w.id===r.value);return m?String(m.region_number):"1"});let f=null,h={};const g=de(null),b=je(()=>{var m;return((m=g.value)==null?void 0:m.data)||null});Je(()=>e.features,()=>{e.features&&e.features.length>0&&v()}),Je(()=>e.tfbsHits,()=>{e.features&&e.features.length>0&&v()}),Je(()=>e.ttaCodons,()=>{e.features&&e.features.length>0&&v()}),Je(()=>e.resistanceFeatures,()=>{e.features&&e.features.length>0&&v()}),Je(()=>e.selectedRegionId,m=>{r.value=m},{immediate:!0}),Vs(()=>{document.addEventListener("click",se),e.features&&e.features.length>0&&v()}),zs(()=>{document.removeEventListener("click",se),f&&(f.destroy(),f=null)});const v=async()=>{try{if(o.value="",!e.features||e.features.length===0){console.warn("No features provided");return}console.log("Building viewer with",e.features.length,"features"),g.value=null,ae(),console.log("Built tracks:",Object.keys(h));const m=Object.values(h).map(w=>({id:w.id,label:w.label,annotationCount:w.annotations.length}));C(m),l.value=m,e.regionBoundaries?a.value=m.filter(w=>["CDS"].includes(w.id)||w.id.includes("protocluster")||w.id.includes("PFAM_domain")||w.id.includes("cand_cluster")).map(w=>w.id):a.value=m.map(w=>w.id),console.log("Available tracks:",l.value),console.log("Selected tracks:",a.value),await Wn(),console.log("Initializing viewer..."),$(),he(),console.log("Viewer initialized and updated")}catch(m){console.error("Error in rebuildViewer:",m),o.value=`Failed to build viewer: ${m.message}`,t("error",m)}},A=()=>{t("region-changed",r.value)},$=()=>{if(f&&f.destroy(),!s.value)return;let m,w,D;if(e.regionBoundaries)m=e.regionBoundaries.start,w=e.regionBoundaries.end,D=(w-m)*.02,console.log("Using region boundaries:",m,"-",w);else{console.log("Calculating boundaries from",e.features.length,"features");const M=e.features.filter(U=>U.location).map(U=>{const ue=U.location.match(/\[<?(\d+):>?(\d+)\]/);return ue?[parseInt(ue[1]),parseInt(ue[2])]:null}).filter(Boolean).flat();console.log("Extracted positions:",M.slice(0,10),M.length>10?`... (${M.length} total)`:""),M.length===0?(console.warn("No valid positions found, using default domain"),m=0,w=1e3):(m=Math.min(...M),w=Math.max(...M)),D=(w-m)*.02,console.log("Calculated domain:",m-D,"to",w+D)}console.log("Creating TrackViewer..."),f=new os({container:s.value,height:400,domain:[m-D,w+D],trackHeight:40,showTrackLabels:!1,onAnnotationClick:(M,U)=>{console.log("Clicked annotation:",M,"on track:",U),ce(M),t("annotation-clicked",{annotation:M,track:U})},onAnnotationHover:(M,U,ue)=>{t("annotation-hovered",{annotation:M,track:U,event:ue})},onBackgroundClick:()=>{g.value=null,Q(),he()}}),console.log("TrackViewer created successfully")},H=(m,w,D)=>{h[m]||(h[m]={id:m,label:w,height:D,annotations:[],primitives:[]},m==="CDS"&&h[m].primitives.push({id:"cds-baseline",trackId:m,type:"horizontal-line",class:"cds-baseline",fy:.5,stroke:"black",opacity:1}))},W=m=>{if(!m)return null;const w=m.match(/\[<?(\d+):>?(\d+)\](?:\(([+-])\))?/);if(!w)return null;const D=w[3]||null;return{start:parseInt(w[1]),end:parseInt(w[2]),strand:D,direction:D==="+"?"right":D==="-"?"left":"none"}},j=m=>m.toLowerCase().replace("_"," "),K=m=>m.toLowerCase().replace(/[^a-z0-9]+/g,"-"),ae=()=>{if(h={},e.features.forEach(m=>{var ue,Ve,et,ut,Gt,En,St,vr,d,p,_,T,x,S,F,O,k,E,V,I,q,G,ne,fe,oe,Ae,ke,ze,We;if(!m.location)return;const w=W(m.location);if(!w){console.warn("Failed to parse location for feature:",m.type,m.location);return}const D=[];D.push(Se(m.type));let M,U;switch(m.type){case"cand_cluster":if((((Ve=(ue=m.qualifiers)==null?void 0:ue.protoclusters)==null?void 0:Ve.length)||1)<2)break;const ft=((ut=(et=m.qualifiers)==null?void 0:et.candidate_cluster_number)==null?void 0:ut[0])||"unknown",An=((En=(Gt=m.qualifiers)==null?void 0:Gt.kind)==null?void 0:En[0])||"unknown";M=`cand_cluster-${ft}`,U=`Candidate Cluster ${ft}`,D.push(`candidate-${K(An)}`),H(M,U),h[M].annotations.push({id:`${m.type}-${ft}`,trackId:M,type:"box",heightFraction:.4,classes:D,label:`CC ${ft}: ${j(An)}`,labelPosition:"center",showLabel:"always",start:w.start,end:w.end,data:m});break;case"PFAM_domain":M=m.type,U=m.type,H(M,U);const Le=((d=(vr=(St=m.qualifiers)==null?void 0:St.db_xref)==null?void 0:vr[0])==null?void 0:d.replace("PFAM:",""))||((x=(T=(_=(p=m.qualifiers)==null?void 0:p.inference)==null?void 0:_[0])==null?void 0:T.match(/PFAM:([^,\s]+)/))==null?void 0:x[1])||((k=(O=(F=(S=m.qualifiers)==null?void 0:S.note)==null?void 0:F[0])==null?void 0:O.match(/PF\d+/))==null?void 0:k[0]),[De,xr]=Le?Le.split("."):["",""],kn=De&&e.pfamColorMap[De]?e.pfamColorMap[De]:null,Kd=((V=(E=m.qualifiers)==null?void 0:E.description)==null?void 0:V[0])||"",Gd=`${De} ${Kd}`.trim(),Jd={id:`${m.type}-${w.start}-${w.end}`,trackId:M,type:"box",classes:D,label:Gd||"unknown",start:w.start,end:w.end,fill:kn,stroke:kn,data:m};h[M].annotations.push(Jd);break;case"CDS":M=m.type,U=m.type,D.push(`gene-type-${((q=(I=m.qualifiers)==null?void 0:I.gene_kind)==null?void 0:q[0])||"other"}`),H(M,U),h[M].annotations.push({id:`${m.type}-${w.start}-${w.end}`,trackId:M,type:"arrow",classes:D,label:R(m),start:w.start,end:w.end,direction:w.direction,stroke:"black",data:m});break;case"protocluster":const bs=((ne=(G=m.qualifiers)==null?void 0:G.protocluster_number)==null?void 0:ne[0])||"unknown",Xd=((oe=(fe=m.qualifiers)==null?void 0:fe.category)==null?void 0:oe[0])||"unknown",Yd=((ke=(Ae=m.qualifiers)==null?void 0:Ae.product)==null?void 0:ke[0])||"unknown";D.push(Xd),D.push(Yd);const Sr=W(((We=(ze=m.qualifiers)==null?void 0:ze.core_location)==null?void 0:We[0])||null);M=`protocluster-track-${bs}`,U=`Protocluster track ${bs}`;for(let Cr of Object.keys(h)){if(!Cr.startsWith("protocluster-track-"))continue;if(!h[Cr].annotations.some(il=>!(w.end<il.start||w.start>il.end))){M=Cr;break}}H(M,U),h[M].annotations.push({id:`${m.type}-${bs}`,trackId:M,type:"box",heightFraction:.3,classes:D,start:w.start,end:w.end,stroke:"none",opacity:.5,data:m}),Sr&&h[M].annotations.push({id:`${m.type}-${bs}-core`,trackId:M,type:"box",heightFraction:.35,classes:[...D,"proto-core"],label:R(m),showLabel:"always",start:Sr.start,end:Sr.end,stroke:"black",data:m});break;default:M=m.type,U=m.type,H(M,U),h[M].annotations.push({id:`${m.type}-${w.start}-${w.end}`,trackId:M,type:"box",classes:D,label:R(m),start:w.start,end:w.end,data:m});break}}),e.tfbsHits&&e.tfbsHits.length>0){const m="CDS";H(m,m),e.tfbsHits.forEach((w,D)=>{w.confidence!=="strong"&&w.confidence!=="medium"||h[m].annotations.push({id:`tfbs-${D}-${w.start}`,trackId:m,type:"pin",classes:["tfbs-hit",`tfbs-${w.confidence}`],label:w.name,labelPosition:"above",showLabel:"hover",start:w.start,end:w.start,fy:.5,heightFraction:.5,opacity:.8,data:{...w,_elementType:"Binding Site"}})})}if(e.ttaCodons&&e.ttaCodons.length>0){const m="CDS";H(m,m),e.ttaCodons.forEach((w,D)=>{h[m].annotations.push({id:`tta-${D}-${w.start}`,trackId:m,type:"triangle",classes:["tta-codon"],showLabel:"none",start:w.start,end:w.start,fy:.2,heightFraction:.4,opacity:.9,data:{...w,_elementType:"TTA Codon"}})})}if(e.resistanceFeatures&&e.resistanceFeatures.length>0){const m="CDS";H(m,m);const w={};e.features.forEach(D=>{var M,U;if(D.type==="CDS"&&((U=(M=D.qualifiers)==null?void 0:M.locus_tag)!=null&&U[0])){const ue=D.qualifiers.locus_tag[0],Ve=W(D.location);Ve&&(w[ue]=Ve)}}),e.resistanceFeatures.forEach((D,M)=>{const U=D.locus_tag,ue=w[U];console.log("Mapping resistance feature",D.reference_id,"to locus tag",U,"with location",ue),ue&&h[m].annotations.push({id:`resistance-${M}-${U}`,trackId:m,type:"box",classes:["resistance"],showLabel:"never",start:ue.start,end:ue.end,fy:.1,heightFraction:.2,fill:"#BBB",data:{...D,_elementType:"Resistance"}})})}},he=()=>{if(!f||!Object.keys(h).length)return;const m=[];l.value.forEach(U=>{a.value.includes(U.id)&&h[U.id]&&m.push(h[U.id])});const w=m.map(U=>({id:U.id,label:U.label,height:U.height||void 0})),D=m.flatMap(U=>U.annotations),M=m.flatMap(U=>U.primitives);f.setData({tracks:w,annotations:D,primitives:M})},Se=m=>`feature-${m.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,R=m=>{var D,M,U,ue,Ve;const w=m.qualifiers||{};return(D=w.locus_tag)!=null&&D[0]?w.locus_tag[0]:(M=w.gene)!=null&&M[0]?w.gene[0]:(U=w.product)!=null&&U[0]?w.product[0]:(ue=w.description)!=null&&ue[0]?w.description[0]:(Ve=w.db_xref)!=null&&Ve[0]?w.db_xref[0]:m.type||"Feature"},C=m=>{const w=D=>D.startsWith("cand_cluster")?1:D.startsWith("protocluster")?2:D.startsWith("CDS")?3:D.startsWith("PFAM_domain")?4:5;return m.sort((D,M)=>{const U=w(D.id),ue=w(M.id);return U!==ue?U-ue:D.id.localeCompare(M.id)})},L=()=>{u.value=!u.value},J=m=>{m.target.checked?a.value=[...l.value.map(w=>w.id)]:a.value=[],he()},se=m=>{m.target.closest(".multi-select-dropdown")||(u.value=!1)},ce=(m,w)=>{if(g.value=m,m.id.endsWith("-core")){const D=h[m.trackId],M=m.id.replace("-core","");if(D){const U=D.annotations.find(ue=>ue.id===M);U&&(g.value=U)}}Q(),he()},ie=()=>{g.value=null},ee=m=>{if(!g.value)return!0;if(m.id.endsWith("-core")){const w=h[m.trackId],D=m.id.replace("-core","");if(w){const M=w.annotations.find(U=>U.id===D);if(M)return M.start>=g.value.start&&M.end<=g.value.end}return!1}return m.start>=g.value.start&&m.end<=g.value.end},Q=()=>{Object.values(h).forEach(m=>{m.id!=="CDS"&&m.id!=="PFAM_domain"||(m.annotations.forEach(w=>{const D=ee(w);w._originalOpacity===void 0&&(w._originalOpacity=w.opacity!==void 0?w.opacity:1),D?w.opacity=w._originalOpacity:w.opacity=w._originalOpacity*.5}),m.id==="CDS"&&m.primitives&&m.primitives.forEach(w=>{w.id==="cds-baseline"&&(w._originalOpacity===void 0&&(w._originalOpacity=w.opacity!==void 0?w.opacity:1),g.value?w.opacity=w._originalOpacity*.1:w.opacity=w._originalOpacity)}))})};return n({clearViewer:()=>{r.value="",g.value=null,h={},l.value=[],a.value=[],o.value="",s.value&&(s.value.innerHTML=""),f=null},rebuildViewer:v}),{viewerContainer:s,selectedRegion:r,loading:i,error:o,availableTracks:l,selectedTracks:a,dropdownOpen:u,selectedElement:b,currentRegionNumber:c,onRegionChange:A,updateViewer:he,toggleDropdown:L,toggleSelectAll:J,clearSelectedElement:ie}}},Gu={class:"region-viewer-wrapper"},Ju={key:0,class:"controls"},Xu=["value"],Yu={key:1,class:"no-regions-message"},Qu={key:2,class:"feature-controls"},Zu={class:"multi-select-container"},ef={class:"selected-display"},tf={key:0},nf={key:1},sf={key:2},rf={class:"select-all-option"},of=["checked","indeterminate"],lf=["value"],af={key:1,class:"current-record-info"},cf={class:"file-metadata"},uf={ref:"viewerContainer",class:"viewer-container"},ff={key:2,class:"loading"},df={key:3,class:"error"},hf={key:4,class:"feature-details-container"};function pf(e,t,n,s,r,i){var a,u,c,f;const o=cn("FeatureDetails"),l=cn("SimpleDetails");return N(),B("div",Gu,[n.recordInfo?(N(),B("div",Ju,[n.regions.length>0?Us((N(),B("select",{key:0,"onUpdate:modelValue":t[0]||(t[0]=h=>s.selectedRegion=h),onChange:t[1]||(t[1]=(...h)=>s.onRegionChange&&s.onRegionChange(...h)),class:"region-select"},[t[7]||(t[7]=P("option",{value:""},"Show all features",-1)),(N(!0),B(we,null,Qe(n.regions,h=>(N(),B("option",{key:h.id,value:h.id}," Region "+te(h.region_number)+" - "+te(h.product.join(", ")),9,Xu))),128))],544)),[[kc,s.selectedRegion]]):ye("",!0),n.regions.length===0&&!s.loading?(N(),B("div",Yu," No regions found - showing all features for this record ")):ye("",!0),s.availableTracks.length>0?(N(),B("div",Qu,[P("div",Zu,[P("div",{class:Ct(["multi-select-dropdown",{open:s.dropdownOpen}]),onClick:t[6]||(t[6]=(...h)=>s.toggleDropdown&&s.toggleDropdown(...h))},[P("div",ef,[s.selectedTracks.length===s.availableTracks.length?(N(),B("span",tf," All tracks ("+te(s.selectedTracks.length)+") ",1)):s.selectedTracks.length===0?(N(),B("span",nf," No tracks selected ")):(N(),B("span",sf,te(s.selectedTracks.length)+" tracks selected ",1)),t[8]||(t[8]=P("span",{class:"dropdown-arrow"},"▼",-1))]),s.dropdownOpen?(N(),B("div",{key:0,class:"dropdown-options",onClick:t[5]||(t[5]=po(()=>{},["stop"]))},[P("div",rf,[P("label",null,[P("input",{type:"checkbox",checked:s.selectedTracks.length===s.availableTracks.length,indeterminate:s.selectedTracks.length>0&&s.selectedTracks.length<s.availableTracks.length,onChange:t[2]||(t[2]=(...h)=>s.toggleSelectAll&&s.toggleSelectAll(...h))},null,40,of),t[9]||(t[9]=vt(" Select All ",-1))])]),t[10]||(t[10]=P("div",{class:"option-separator"},null,-1)),(N(!0),B(we,null,Qe(s.availableTracks,h=>(N(),B("div",{key:h.id,class:"dropdown-option"},[P("label",null,[Us(P("input",{type:"checkbox",value:h.id,"onUpdate:modelValue":t[3]||(t[3]=g=>s.selectedTracks=g),onChange:t[4]||(t[4]=(...g)=>s.updateViewer&&s.updateViewer(...g))},null,40,lf),[[Ac,s.selectedTracks]]),vt(" "+te(h.label)+" ("+te(h.annotationCount)+") ",1)])]))),128))])):ye("",!0)],2)])])):ye("",!0)])):ye("",!0),n.recordInfo?(N(),B("div",af,[P("span",null,"Current Record: "+te(n.recordInfo.recordId)+" - "+te((u=(a=n.recordInfo)==null?void 0:a.recordInfo)==null?void 0:u.description),1),P("div",cf,"File: "+te(n.recordInfo.filename)+", version "+te(((c=n.recordInfo.fileMetadata)==null?void 0:c.version)||"unknown")+", input "+te(((f=n.recordInfo.fileMetadata)==null?void 0:f.input_file)||"unknown"),1)])):ye("",!0),Us(P("div",uf,null,512),[[dc,n.recordInfo]]),s.loading?(N(),B("div",ff," Loading region data... ")):ye("",!0),s.error?(N(),B("div",df,te(s.error),1)):ye("",!0),n.recordInfo?(N(),B("div",hf,[s.selectedElement&&s.selectedElement.type&&s.selectedElement.qualifiers?(N(),qt(o,{key:0,feature:s.selectedElement,"all-features":n.features,"data-provider":n.dataProvider,"record-info":n.recordInfo,"region-number":s.currentRegionNumber,onClose:s.clearSelectedElement},null,8,["feature","all-features","data-provider","record-info","region-number","onClose"])):s.selectedElement?(N(),qt(l,{key:1,data:s.selectedElement,"element-type":s.selectedElement._elementType},null,8,["data","element-type"])):ye("",!0)])):ye("",!0)])}const bo=Rt(Ku,[["render",pf],["__scopeId","data-v-8fefd372"]]),gf={name:"LoadingSpinner",props:{color:{type:String,default:"#1976d2"}},setup(e){return{customStyle:je(()=>({borderColor:e.color,borderTopColor:"transparent"}))}}};function mf(e,t,n,s,r,i){return N(),B("div",{class:"loading-spinner",style:In(s.customStyle)},null,4)}const yf={name:"RegionViewerContainer",components:{RegionViewer:bo,LoadingSpinner:Rt(gf,[["render",mf],["__scopeId","data-v-04186386"]])},props:{dataProvider:{type:Object,default:null},recordId:{type:String,default:""},recordData:{type:Object,default:null},initialRegionId:{type:String,default:""}},emits:["region-changed","annotation-clicked","error"],setup(e,{emit:t}){const n=de(null),s=de(null),r=de([]),i=de([]),o=de(null),l=de({}),a=de([]),u=de([]),c=de([]),f=de(""),h=de(!1),g=de(""),b=de(0),v=()=>{s.value=null,r.value=[],i.value=[],o.value=null,a.value=[],u.value=[],c.value=[],f.value=""},A=async()=>{if(n.value)try{l.value=await n.value.getPfamColorMap(),console.log("Loaded PFAM colors for",Object.keys(l.value).length,"domains")}catch(C){console.warn("Failed to load PFAM color mapping:",C.message)}},$=async(C,L)=>{if(n.value)try{const J=L.replace("region_",""),se=await n.value.getTFBSHits(C,J);a.value=se.hits||[],console.log("Loaded",a.value.length,"TFBS binding sites for region",J)}catch(J){console.warn("Failed to load TFBS hits:",J.message),a.value=[]}},H=async C=>{if(n.value)try{const L=await n.value.getTTACodons(C);u.value=L.codons||[],console.log("Loaded",u.value.length,"TTA codons for record",C)}catch(L){console.warn("Failed to load TTA codons:",L.message),u.value=[]}},W=async C=>{if(n.value)try{const L=await n.value.getResistanceFeatures(C);c.value=L.features||[],console.log("Loaded",c.value.length,"resistance features for record",C)}catch(L){console.warn("Failed to load resistance features:",L.message),c.value=[]}},j=async C=>{var J;const L=++b.value;v(),h.value=!0,g.value="";try{if(!n.value)throw new Error("No data provider available");const se=((J=e.recordData)==null?void 0:J.entryId)||C,ce=await n.value.loadEntry(se);if(L!==b.value){console.log("Ignoring stale load request for",C);return}s.value={recordId:ce.recordId,filename:ce.filename,fileMetadata:ce.fileMetadata,recordInfo:ce.recordInfo};const ie=await n.value.getRegions(s.value.recordId);if(L!==b.value){console.log("Ignoring stale load request for",C);return}if(r.value=ie.regions||[],o.value=ie.boundaries||null,await H(s.value.recordId),L!==b.value){console.log("Ignoring stale load request for",C);return}if(await W(s.value.recordId),L!==b.value){console.log("Ignoring stale load request for",C);return}if(r.value&&r.value.length>0?(f.value=r.value[0].id,await K(s.value.recordId,f.value)):await ae(s.value.recordId),L!==b.value){console.log("Ignoring stale load request for",C);return}h.value=!1}catch(se){L===b.value&&(console.error("Error loading record:",se),g.value=`Failed to load record: ${se.message}`,t("error",g.value),h.value=!1)}},K=async(C,L)=>{try{const J=await n.value.getRegionFeatures(C,L);i.value=J.features||[],o.value=J.region_boundaries||null,await $(C,L)}catch(J){console.error("Error loading region features:",J),g.value=`Failed to load region features: ${J.message}`,t("error",g.value)}},ae=async C=>{try{const L=await n.value.getRecordFeatures(C);i.value=L.features||[],o.value=null,a.value=[]}catch(L){console.error("Error loading features:",L),g.value=`Failed to load features: ${L.message}`,t("error",g.value)}},he=async C=>{f.value=C,C?await K(s.value.recordId,C):await ae(s.value.recordId),t("region-changed",C)},Se=C=>{t("annotation-clicked",C)},R=C=>{t("error",C)};return Vs(async()=>{if(!e.dataProvider){g.value="No data provider specified. Please set the dataProvider property.",t("error",g.value);return}n.value=e.dataProvider,await A()}),Je(()=>e.recordId,async(C,L)=>{C&&n.value?await j(C):!C&&L!==void 0&&v()},{immediate:!0}),Je(()=>e.dataProvider,C=>{C&&(n.value=C,A())}),Je(()=>e.initialRegionId,C=>{C&&r.value.length>0&&(f.value=C,s.value&&K(s.value.recordId,C))}),{recordInfo:s,regions:r,features:i,regionBoundaries:o,pfamColorMap:l,tfbsHits:a,ttaCodons:u,resistanceFeatures:c,selectedRegionId:f,loading:h,error:g,handleRegionChanged:he,handleAnnotationClicked:Se,handleError:R}}},bf={class:"region-viewer-container"},_f={key:0,class:"loading-container"};function wf(e,t,n,s,r,i){const o=cn("LoadingSpinner"),l=cn("RegionViewer");return N(),B("div",bf,[s.loading?(N(),B("div",_f,[Ee(o,{color:"#1976d2",style:{width:"48px",height:"48px","border-width":"4px"}}),t[0]||(t[0]=P("p",{class:"loading-text"},"Loading record data...",-1))])):s.recordInfo?(N(),qt(l,{key:1,"record-info":s.recordInfo,regions:s.regions,features:s.features,"region-boundaries":s.regionBoundaries,"pfam-color-map":s.pfamColorMap,"selected-region-id":s.selectedRegionId,"data-provider":n.dataProvider,"tfbs-hits":s.tfbsHits,"tta-codons":s.ttaCodons,"resistance-features":s.resistanceFeatures,onRegionChanged:s.handleRegionChanged,onAnnotationClicked:s.handleAnnotationClicked,onError:s.handleError},null,8,["record-info","regions","features","region-boundaries","pfam-color-map","selected-region-id","data-provider","tfbs-hits","tta-codons","resistance-features","onRegionChanged","onAnnotationClicked","onError"])):ye("",!0)])}const vf=Rt(yf,[["render",wf],["__scopeId","data-v-def37caf"]]);function _o(e,t){return function(){return e.apply(t,arguments)}}const{toString:xf}=Object.prototype,{getPrototypeOf:cr}=Object,{iterator:ls,toStringTag:wo}=Symbol,as=(e=>t=>{const n=xf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ze=e=>(e=e.toLowerCase(),t=>as(t)===e),cs=e=>t=>typeof t===e,{isArray:Wt}=Array,wn=cs("undefined");function vn(e){return e!==null&&!wn(e)&&e.constructor!==null&&!wn(e.constructor)&&Be(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const vo=Ze("ArrayBuffer");function Sf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&vo(e.buffer),t}const Cf=cs("string"),Be=cs("function"),xo=cs("number"),xn=e=>e!==null&&typeof e=="object",Tf=e=>e===!0||e===!1,us=e=>{if(as(e)!=="object")return!1;const t=cr(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(wo in e)&&!(ls in e)},Ef=e=>{if(!xn(e)||vn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Af=Ze("Date"),kf=Ze("File"),Rf=Ze("Blob"),Of=Ze("FileList"),Pf=e=>xn(e)&&Be(e.pipe),Lf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Be(e.append)&&((t=as(e))==="formdata"||t==="object"&&Be(e.toString)&&e.toString()==="[object FormData]"))},Ff=Ze("URLSearchParams"),[Mf,If,Df,Nf]=["ReadableStream","Request","Response","Headers"].map(Ze),jf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),Wt(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{if(vn(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let l;for(s=0;s<o;s++)l=i[s],t.call(null,e[l],l,e)}}function So(e,t){if(vn(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,r;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const Ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Co=e=>!wn(e)&&e!==Ot;function ur(){const{caseless:e}=Co(this)&&this||{},t={},n=(s,r)=>{const i=e&&So(t,r)||r;us(t[i])&&us(s)?t[i]=ur(t[i],s):us(s)?t[i]=ur({},s):Wt(s)?t[i]=s.slice():t[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Sn(arguments[s],n);return t}const Bf=(e,t,n,{allOwnKeys:s}={})=>(Sn(t,(r,i)=>{n&&Be(r)?e[i]=_o(r,n):e[i]=r},{allOwnKeys:s}),e),$f=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Hf=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Uf=(e,t,n,s)=>{let r,i,o;const l={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)o=r[i],(!s||s(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&cr(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},qf=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},Vf=e=>{if(!e)return null;if(Wt(e))return e;let t=e.length;if(!xo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},zf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&cr(Uint8Array)),Wf=(e,t)=>{const s=(e&&e[ls]).call(e);let r;for(;(r=s.next())&&!r.done;){const i=r.value;t.call(e,i[0],i[1])}},Kf=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},Gf=Ze("HTMLFormElement"),Jf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),To=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Xf=Ze("RegExp"),Eo=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Sn(n,(r,i)=>{let o;(o=t(r,i,e))!==!1&&(s[i]=o||r)}),Object.defineProperties(e,s)},Yf=e=>{Eo(e,(t,n)=>{if(Be(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(Be(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Qf=(e,t)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return Wt(e)?s(e):s(String(e).split(t)),n},Zf=()=>{},ed=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function td(e){return!!(e&&Be(e.append)&&e[wo]==="FormData"&&e[ls])}const nd=e=>{const t=new Array(10),n=(s,r)=>{if(xn(s)){if(t.indexOf(s)>=0)return;if(vn(s))return s;if(!("toJSON"in s)){t[r]=s;const i=Wt(s)?[]:{};return Sn(s,(o,l)=>{const a=n(o,r+1);!wn(a)&&(i[l]=a)}),t[r]=void 0,i}}return s};return n(e,0)},sd=Ze("AsyncFunction"),rd=e=>e&&(xn(e)||Be(e))&&Be(e.then)&&Be(e.catch),Ao=((e,t)=>e?setImmediate:t?((n,s)=>(Ot.addEventListener("message",({source:r,data:i})=>{r===Ot&&i===n&&s.length&&s.shift()()},!1),r=>{s.push(r),Ot.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Be(Ot.postMessage)),id=typeof queueMicrotask<"u"?queueMicrotask.bind(Ot):typeof process<"u"&&process.nextTick||Ao,y={isArray:Wt,isArrayBuffer:vo,isBuffer:vn,isFormData:Lf,isArrayBufferView:Sf,isString:Cf,isNumber:xo,isBoolean:Tf,isObject:xn,isPlainObject:us,isEmptyObject:Ef,isReadableStream:Mf,isRequest:If,isResponse:Df,isHeaders:Nf,isUndefined:wn,isDate:Af,isFile:kf,isBlob:Rf,isRegExp:Xf,isFunction:Be,isStream:Pf,isURLSearchParams:Ff,isTypedArray:zf,isFileList:Of,forEach:Sn,merge:ur,extend:Bf,trim:jf,stripBOM:$f,inherits:Hf,toFlatObject:Uf,kindOf:as,kindOfTest:Ze,endsWith:qf,toArray:Vf,forEachEntry:Wf,matchAll:Kf,isHTMLForm:Gf,hasOwnProperty:To,hasOwnProp:To,reduceDescriptors:Eo,freezeMethods:Yf,toObjectSet:Qf,toCamelCase:Jf,noop:Zf,toFiniteNumber:ed,findKey:So,global:Ot,isContextDefined:Co,isSpecCompliantForm:td,toJSONObject:nd,isAsyncFn:sd,isThenable:rd,setImmediate:Ao,asap:id,isIterable:e=>e!=null&&Be(e[ls])};function Y(e,t,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}y.inherits(Y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:y.toJSONObject(this.config),code:this.code,status:this.status}}});const ko=Y.prototype,Ro={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ro[e]={value:e}}),Object.defineProperties(Y,Ro),Object.defineProperty(ko,"isAxiosError",{value:!0}),Y.from=(e,t,n,s,r,i)=>{const o=Object.create(ko);return y.toFlatObject(e,o,function(a){return a!==Error.prototype},l=>l!=="isAxiosError"),Y.call(o,e.message,t,n,s,r),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const od=null;function fr(e){return y.isPlainObject(e)||y.isArray(e)}function Oo(e){return y.endsWith(e,"[]")?e.slice(0,-2):e}function Po(e,t,n){return e?e.concat(t).map(function(r,i){return r=Oo(r),!n&&i?"["+r+"]":r}).join(n?".":""):t}function ld(e){return y.isArray(e)&&!e.some(fr)}const ad=y.toFlatObject(y,{},null,function(t){return/^is[A-Z]/.test(t)});function fs(e,t,n){if(!y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,A){return!y.isUndefined(A[v])});const s=n.metaTokens,r=n.visitor||c,i=n.dots,o=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(t);if(!y.isFunction(r))throw new TypeError("visitor must be a function");function u(b){if(b===null)return"";if(y.isDate(b))return b.toISOString();if(y.isBoolean(b))return b.toString();if(!a&&y.isBlob(b))throw new Y("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(b)||y.isTypedArray(b)?a&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function c(b,v,A){let $=b;if(b&&!A&&typeof b=="object"){if(y.endsWith(v,"{}"))v=s?v:v.slice(0,-2),b=JSON.stringify(b);else if(y.isArray(b)&&ld(b)||(y.isFileList(b)||y.endsWith(v,"[]"))&&($=y.toArray(b)))return v=Oo(v),$.forEach(function(W,j){!(y.isUndefined(W)||W===null)&&t.append(o===!0?Po([v],j,i):o===null?v:v+"[]",u(W))}),!1}return fr(b)?!0:(t.append(Po(A,v,i),u(b)),!1)}const f=[],h=Object.assign(ad,{defaultVisitor:c,convertValue:u,isVisitable:fr});function g(b,v){if(!y.isUndefined(b)){if(f.indexOf(b)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(b),y.forEach(b,function($,H){(!(y.isUndefined($)||$===null)&&r.call(t,$,y.isString(H)?H.trim():H,v,h))===!0&&g($,v?v.concat(H):[H])}),f.pop()}}if(!y.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Lo(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function dr(e,t){this._pairs=[],e&&fs(e,this,t)}const Fo=dr.prototype;Fo.append=function(t,n){this._pairs.push([t,n])},Fo.toString=function(t){const n=t?function(s){return t.call(this,s,Lo)}:Lo;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function cd(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Mo(e,t,n){if(!t)return e;const s=n&&n.encode||cd;y.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let i;if(r?i=r(t,n):i=y.isURLSearchParams(t)?t.toString():new dr(t,n).toString(s),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Io{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){y.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Do={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ud={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:dr,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},hr=typeof window<"u"&&typeof document<"u",pr=typeof navigator=="object"&&navigator||void 0,fd=hr&&(!pr||["ReactNative","NativeScript","NS"].indexOf(pr.product)<0),dd=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hd=hr&&window.location.href||"http://localhost",Pe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:hr,hasStandardBrowserEnv:fd,hasStandardBrowserWebWorkerEnv:dd,navigator:pr,origin:hd},Symbol.toStringTag,{value:"Module"})),...ud};function pd(e,t){return fs(e,new Pe.classes.URLSearchParams,{visitor:function(n,s,r,i){return Pe.isNode&&y.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function gd(e){return y.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function md(e){const t={},n=Object.keys(e);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],t[i]=e[i];return t}function No(e){function t(n,s,r,i){let o=n[i++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),a=i>=n.length;return o=!o&&y.isArray(r)?r.length:o,a?(y.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!l):((!r[o]||!y.isObject(r[o]))&&(r[o]=[]),t(n,s,r[o],i)&&y.isArray(r[o])&&(r[o]=md(r[o])),!l)}if(y.isFormData(e)&&y.isFunction(e.entries)){const n={};return y.forEachEntry(e,(s,r)=>{t(gd(s),r,n,0)}),n}return null}function yd(e,t,n){if(y.isString(e))try{return(t||JSON.parse)(e),y.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const Cn={transitional:Do,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=y.isObject(t);if(i&&y.isHTMLForm(t)&&(t=new FormData(t)),y.isFormData(t))return r?JSON.stringify(No(t)):t;if(y.isArrayBuffer(t)||y.isBuffer(t)||y.isStream(t)||y.isFile(t)||y.isBlob(t)||y.isReadableStream(t))return t;if(y.isArrayBufferView(t))return t.buffer;if(y.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return pd(t,this.formSerializer).toString();if((l=y.isFileList(t))||s.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return fs(l?{"files[]":t}:t,a&&new a,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),yd(t)):t}],transformResponse:[function(t){const n=this.transitional||Cn.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(y.isResponse(t)||y.isReadableStream(t))return t;if(t&&y.isString(t)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?Y.from(l,Y.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pe.classes.FormData,Blob:Pe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],e=>{Cn.headers[e]={}});const bd=y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_d=e=>{const t={};let n,s,r;return e&&e.split(`
|
|
45
|
-
`).forEach(function(
|
|
46
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[jo]=this[jo]={accessors:{}}).accessors,r=this.prototype;function i(o){const l=Tn(o);s[l]||(Sd(r,o),s[l]=!0)}return y.isArray(t)?t.forEach(i):i(t),this}};$e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),y.reduceDescriptors($e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),y.freezeMethods($e);function mr(e,t){const n=this||Cn,s=t||n,r=$e.from(s.headers);let i=s.data;return y.forEach(e,function(l){i=l.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function Bo(e){return!!(e&&e.__CANCEL__)}function Kt(e,t,n){Y.call(this,e??"canceled",Y.ERR_CANCELED,t,n),this.name="CanceledError"}y.inherits(Kt,Y,{__CANCEL__:!0});function $o(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new Y("Request failed with status code "+n.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Cd(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Td(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,i=0,o;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),c=s[i];o||(o=u),n[r]=a,s[r]=u;let f=i,h=0;for(;f!==r;)h+=n[f++],f=f%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),u-o<t)return;const g=c&&u-c;return g?Math.round(h*1e3/g):void 0}}function Ed(e,t){let n=0,s=1e3/t,r,i;const o=(u,c=Date.now())=>{n=c,r=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const c=Date.now(),f=c-n;f>=s?o(u,c):(r=u,i||(i=setTimeout(()=>{i=null,o(r)},s-f)))},()=>r&&o(r)]}const hs=(e,t,n=3)=>{let s=0;const r=Td(50,250);return Ed(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,a=o-s,u=r(a),c=o<=l;s=o;const f={loaded:o,total:l,progress:l?o/l:void 0,bytes:a,rate:u||void 0,estimated:u&&l&&c?(l-o)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},Ho=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Uo=e=>(...t)=>y.asap(()=>e(...t)),Ad=Pe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Pe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Pe.origin),Pe.navigator&&/(msie|trident)/i.test(Pe.navigator.userAgent)):()=>!0,kd=Pe.hasStandardBrowserEnv?{write(e,t,n,s,r,i){const o=[e+"="+encodeURIComponent(t)];y.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),y.isString(s)&&o.push("path="+s),y.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Rd(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Od(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function qo(e,t,n){let s=!Rd(t);return e&&(s||n==!1)?Od(e,t):t}const Vo=e=>e instanceof $e?{...e}:e;function Pt(e,t){t=t||{};const n={};function s(u,c,f,h){return y.isPlainObject(u)&&y.isPlainObject(c)?y.merge.call({caseless:h},u,c):y.isPlainObject(c)?y.merge({},c):y.isArray(c)?c.slice():c}function r(u,c,f,h){if(y.isUndefined(c)){if(!y.isUndefined(u))return s(void 0,u,f,h)}else return s(u,c,f,h)}function i(u,c){if(!y.isUndefined(c))return s(void 0,c)}function o(u,c){if(y.isUndefined(c)){if(!y.isUndefined(u))return s(void 0,u)}else return s(void 0,c)}function l(u,c,f){if(f in t)return s(u,c);if(f in e)return s(void 0,u)}const a={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,c,f)=>r(Vo(u),Vo(c),f,!0)};return y.forEach(Object.keys({...e,...t}),function(c){const f=a[c]||r,h=f(e[c],t[c],c);y.isUndefined(h)&&f!==l||(n[c]=h)}),n}const zo=e=>{const t=Pt({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:l}=t;t.headers=o=$e.from(o),t.url=Mo(qo(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let a;if(y.isFormData(n)){if(Pe.hasStandardBrowserEnv||Pe.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((a=o.getContentType())!==!1){const[u,...c]=a?a.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...c].join("; "))}}if(Pe.hasStandardBrowserEnv&&(s&&y.isFunction(s)&&(s=s(t)),s||s!==!1&&Ad(t.url))){const u=r&&i&&kd.read(i);u&&o.set(r,u)}return t},Pd=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const r=zo(e);let i=r.data;const o=$e.from(r.headers).normalize();let{responseType:l,onUploadProgress:a,onDownloadProgress:u}=r,c,f,h,g,b;function v(){g&&g(),b&&b(),r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let A=new XMLHttpRequest;A.open(r.method.toUpperCase(),r.url,!0),A.timeout=r.timeout;function $(){if(!A)return;const W=$e.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),K={data:!l||l==="text"||l==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:W,config:e,request:A};$o(function(he){n(he),v()},function(he){s(he),v()},K),A=null}"onloadend"in A?A.onloadend=$:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout($)},A.onabort=function(){A&&(s(new Y("Request aborted",Y.ECONNABORTED,e,A)),A=null)},A.onerror=function(){s(new Y("Network Error",Y.ERR_NETWORK,e,A)),A=null},A.ontimeout=function(){let j=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const K=r.transitional||Do;r.timeoutErrorMessage&&(j=r.timeoutErrorMessage),s(new Y(j,K.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,e,A)),A=null},i===void 0&&o.setContentType(null),"setRequestHeader"in A&&y.forEach(o.toJSON(),function(j,K){A.setRequestHeader(K,j)}),y.isUndefined(r.withCredentials)||(A.withCredentials=!!r.withCredentials),l&&l!=="json"&&(A.responseType=r.responseType),u&&([h,b]=hs(u,!0),A.addEventListener("progress",h)),a&&A.upload&&([f,g]=hs(a),A.upload.addEventListener("progress",f),A.upload.addEventListener("loadend",g)),(r.cancelToken||r.signal)&&(c=W=>{A&&(s(!W||W.type?new Kt(null,e,A):W),A.abort(),A=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));const H=Cd(r.url);if(H&&Pe.protocols.indexOf(H)===-1){s(new Y("Unsupported protocol "+H+":",Y.ERR_BAD_REQUEST,e));return}A.send(i||null)})},Ld=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,r;const i=function(u){if(!r){r=!0,l();const c=u instanceof Error?u:this.reason;s.abort(c instanceof Y?c:new Kt(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,i(new Y(`timeout ${t} of ms exceeded`,Y.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:a}=s;return a.unsubscribe=()=>y.asap(l),a}},Fd=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,r;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},Md=async function*(e,t){for await(const n of Id(e))yield*Fd(n,t)},Id=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},Wo=(e,t,n,s)=>{const r=Md(e,t);let i=0,o,l=a=>{o||(o=!0,s&&s(a))};return new ReadableStream({async pull(a){try{const{done:u,value:c}=await r.next();if(u){l(),a.close();return}let f=c.byteLength;if(n){let h=i+=f;n(h)}a.enqueue(new Uint8Array(c))}catch(u){throw l(u),u}},cancel(a){return l(a),r.return()}},{highWaterMark:2})},ps=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ko=ps&&typeof ReadableStream=="function",Dd=ps&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Go=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Nd=Ko&&Go(()=>{let e=!1;const t=new Request(Pe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Jo=64*1024,yr=Ko&&Go(()=>y.isReadableStream(new Response("").body)),gs={stream:yr&&(e=>e.body)};ps&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!gs[t]&&(gs[t]=y.isFunction(e[t])?n=>n[t]():(n,s)=>{throw new Y(`Response type '${t}' is not supported`,Y.ERR_NOT_SUPPORT,s)})})})(new Response);const jd=async e=>{if(e==null)return 0;if(y.isBlob(e))return e.size;if(y.isSpecCompliantForm(e))return(await new Request(Pe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(y.isArrayBufferView(e)||y.isArrayBuffer(e))return e.byteLength;if(y.isURLSearchParams(e)&&(e=e+""),y.isString(e))return(await Dd(e)).byteLength},Bd=async(e,t)=>{const n=y.toFiniteNumber(e.getContentLength());return n??jd(t)},br={http:od,xhr:Pd,fetch:ps&&(async e=>{let{url:t,method:n,data:s,signal:r,cancelToken:i,timeout:o,onDownloadProgress:l,onUploadProgress:a,responseType:u,headers:c,withCredentials:f="same-origin",fetchOptions:h}=zo(e);u=u?(u+"").toLowerCase():"text";let g=Ld([r,i&&i.toAbortSignal()],o),b;const v=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let A;try{if(a&&Nd&&n!=="get"&&n!=="head"&&(A=await Bd(c,s))!==0){let K=new Request(t,{method:"POST",body:s,duplex:"half"}),ae;if(y.isFormData(s)&&(ae=K.headers.get("content-type"))&&c.setContentType(ae),K.body){const[he,Se]=Ho(A,hs(Uo(a)));s=Wo(K.body,Jo,he,Se)}}y.isString(f)||(f=f?"include":"omit");const $="credentials"in Request.prototype;b=new Request(t,{...h,signal:g,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:s,duplex:"half",credentials:$?f:void 0});let H=await fetch(b,h);const W=yr&&(u==="stream"||u==="response");if(yr&&(l||W&&v)){const K={};["status","statusText","headers"].forEach(R=>{K[R]=H[R]});const ae=y.toFiniteNumber(H.headers.get("content-length")),[he,Se]=l&&Ho(ae,hs(Uo(l),!0))||[];H=new Response(Wo(H.body,Jo,he,()=>{Se&&Se(),v&&v()}),K)}u=u||"text";let j=await gs[y.findKey(gs,u)||"text"](H,e);return!W&&v&&v(),await new Promise((K,ae)=>{$o(K,ae,{data:j,headers:$e.from(H.headers),status:H.status,statusText:H.statusText,config:e,request:b})})}catch($){throw v&&v(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new Y("Network Error",Y.ERR_NETWORK,e,b),{cause:$.cause||$}):Y.from($,$&&$.code,e,b)}})};y.forEach(br,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xo=e=>`- ${e}`,$d=e=>y.isFunction(e)||e===null||e===!1,Yo={getAdapter:e=>{e=y.isArray(e)?e:[e];const{length:t}=e;let n,s;const r={};for(let i=0;i<t;i++){n=e[i];let o;if(s=n,!$d(n)&&(s=br[(o=String(n)).toLowerCase()],s===void 0))throw new Y(`Unknown adapter '${o}'`);if(s)break;r[o||"#"+i]=s}if(!s){const i=Object.entries(r).map(([l,a])=>`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
47
|
-
`+
|
|
48
|
-
`):" "+
|
|
49
|
-
|
|
50
|
-
`),
|
|
24
|
+
`}return e.append("path").attr("d",f)}renderCircle(e,t,r,o){return e.append("circle").attr("cx",t).attr("cy",r).attr("r",o/2).attr("class","annotation-marker")}renderTriangle(e,t,r,o=.5){const a=o*.8,s=[[t-a/2,r+o],[t,r],[t+a/2,r+o]].map(l=>l.join(",")).join(" ");return e.append("polygon").attr("points",s).attr("class","annotation-triangle")}renderPin(e,t,r,o){const a=e.append("g").attr("class","annotation-pin");return a.append("line").attr("x1",t).attr("y1",r).attr("x2",t).attr("y2",r-o).attr("stroke","black").attr("class","annotation-pin-line"),a.append("circle").attr("cx",t).attr("cy",r-o).attr("r",3).attr("class","annotation-pin-head"),a}renderAnnotationLabel(e,t,r,o,a,s){const l=t.showLabel||"hover";if(!t.label)return;const c=t.labelPosition||"above";let f,d,h="middle";t.type==="circle"||t.type==="triangle"||t.type==="pin"?(f=r,c==="above"?t.type==="pin"?d=o-s-8:d=o-s/2-2:d=o):(f=r+a/2,c==="above"?d=o-s/2-8:d=o);const p=e.append("text").attr("x",f).attr("y",d).attr("dy","0.35em").attr("text-anchor",h).attr("class","annotation-label").attr("data-annotation-id",t.id).attr("data-show-label",l).style("fill","currentColor").text(t.label);if(l==="hover"){const m=p.node();if(m&&typeof m.getBBox=="function")try{const E=m.getBBox(),O=0;e.insert("rect","text").attr("x",E.x-O).attr("y",E.y-O).attr("width",E.width+O*2).attr("height",E.height+O*2).attr("rx",2).attr("ry",2).attr("class","annotation-label-background").style("fill","white").style("opacity","0.8").style("display","none")}catch{}}l==="always"?e.style("display",""):l==="never"?e.style("display","none"):e.style("display",this.showAllAnnotationLabels?"":"none")}renderAllLabels(e,t){let r=this.clippedChart.select(".annotation-labels-layer");r.empty()&&(r=this.clippedChart.append("g").attr("class","annotation-labels-layer"));const o=r.selectAll(".annotation-label-group").data(e,s=>s.annotation.id).join(s=>s.append("g"),s=>s,s=>s.remove()).attr("class",s=>`annotation-label-group ${s.annotation.classes.join(" ")}`).attr("data-annotation-id",s=>s.annotation.id).attr("transform",s=>`translate(0, ${s.trackY})`).style("pointer-events","none"),a=this;o.each(function(s){const l=z.select(this);l.selectAll("*").remove(),a.renderAnnotationLabel(l,s.annotation,s.x,s.y,s.width,s.height)})}showTooltip(e,t,r){const o=t.tooltip!==void 0?t.tooltip:`<strong>${t.label}</strong><br/>Start: ${t.start}<br/>End: ${t.end}<br/>Track: ${r.label}`;this.tooltip.style("display","block").style("left",`${e.pageX+10}px`).style("top",`${e.pageY-10}px`).html(o)}hideTooltip(){this.tooltip.style("display","none")}calculateRequiredLeftMargin(){if(!this.showTrackLabels)return this.originalLeftMargin;if(this.data.tracks.length===0)return this.originalLeftMargin;const e=this.svg.append("text").attr("class","track-label").style("visibility","hidden");let t=0;return this.data.tracks.forEach(o=>{e.text(o.label);const a=e.node();if(a&&typeof a.getBBox=="function")try{const s=a.getBBox();t=Math.max(t,s.width)}catch{t=Math.max(t,o.label.length*8)}else t=Math.max(t,o.label.length*8)}),e.remove(),Math.max(this.originalLeftMargin,t+20)}updateMarginAndLayout(){const e=this.calculateRequiredLeftMargin();if(Math.abs(this.config.margin.left-e)>5){this.config.margin.left=e,this.chart.attr("transform",`translate(${this.config.margin.left},${this.config.margin.top})`),this.x.range([0,this.config.width-this.config.margin.left-this.config.margin.right]);const t=this.config.width-this.config.margin.left-this.config.margin.right;this.svg.select("clipPath rect").attr("width",t),this.clippedChart.select(".chart-background").attr("width",t)}}setData(e){this.data={tracks:e.tracks,annotations:e.annotations,primitives:e.primitives||[]},this.updateMarginAndLayout(),this.updateHeight(),this.createTrackGroups(),this.drawTracks()}addTrack(e,t,r){this.data.tracks.push(e),t&&this.data.annotations.push(...t),r&&(this.data.primitives||(this.data.primitives=[]),this.data.primitives.push(...r)),this.updateMarginAndLayout(),this.updateHeight(),this.createTrackGroups(),this.drawTracks()}removeTrack(e){this.data.tracks=this.data.tracks.filter(t=>t.id!==e),this.data.annotations=this.data.annotations.filter(t=>t.trackId!==e),this.data.primitives=(this.data.primitives||[]).filter(t=>t.trackId!==e),this.updateMarginAndLayout(),this.updateHeight(),this.createTrackGroups(),this.drawTracks()}addAnnotation(e){this.data.annotations.push(e),this.drawTracks()}removeAnnotation(e){this.data.annotations=this.data.annotations.filter(t=>t.id!==e),this.drawTracks()}addPrimitive(e){this.data.primitives||(this.data.primitives=[]),this.data.primitives.push(e),this.drawTracks()}removePrimitive(e){this.data.primitives&&(this.data.primitives=this.data.primitives.filter(t=>t.id!==e),this.drawTracks())}updateDomain(e){this.config.domain=e,this.x.domain(e),this.drawTracks()}zoomTo(e,t){const o=(this.config.width-this.config.margin.left-this.config.margin.right)/(this.x(t)-this.x(e)),a=-this.x(e)*o,s=z.zoomIdentity.translate(a,0).scale(o);this.svg.transition().duration(750).call(this.zoom.transform,s)}resetZoom(){this.svg.transition().duration(750).call(this.zoom.transform,z.zoomIdentity)}destroy(){var e;this.resizeObserver&&this.resizeObserver.disconnect(),(e=this.contextMenuController)==null||e.destroy(),this.tooltip.remove(),this.svg.remove()}getConfig(){return{...this.config}}getData(){return{tracks:[...this.data.tracks],annotations:[...this.data.annotations],primitives:this.data.primitives?[...this.data.primitives]:[]}}getCurrentDomain(){const e=this.currentTransform.rescaleX(this.x),t=e.range();return[e.invert(t[0]),e.invert(t[1])]}resize(){if(!this.isResponsiveWidth)return;const e=this.calculateResponsiveWidth();if(Math.abs(this.config.width-e)>10){this.config.width=e,this.svg.attr("width",e),this.x.range([0,e-this.config.margin.left-this.config.margin.right]);const t=e-this.config.margin.left-this.config.margin.right;this.svg.select("clipPath rect").attr("width",t),this.clippedChart.select(".chart-background").attr("width",t);const r=this.config.height-this.config.margin.top-this.config.margin.bottom;this.zoom.translateExtent([[0,0],[t,r]]).extent([[0,0],[t,r]]),this.drawTracks()}}};Ee.LABEL_PADDING=24;let qe=Ee;const pe=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},Un={name:"SimpleTable",props:{rows:{type:Array,required:!0,validator:n=>n.every(e=>Array.isArray(e))}},setup(n){const e=i.ref(null),t=i.ref("asc"),r=i.computed(()=>n.rows[0]||[]),o=i.computed(()=>n.rows.slice(1)),a=l=>{e.value===l?t.value==="asc"?t.value="desc":(e.value=null,t.value="asc"):(e.value=l,t.value="asc")},s=i.computed(()=>e.value===null?o.value:[...o.value].sort((l,c)=>{const f=l[e.value],d=c[e.value];if(f===""||f===null||f===void 0)return 1;if(d===""||d===null||d===void 0)return-1;const h=parseFloat(String(f).replace(/[%,]/g,"")),p=parseFloat(String(d).replace(/[%,]/g,""));let m=0;return!isNaN(h)&&!isNaN(p)?m=h-p:m=String(f).localeCompare(String(d)),t.value==="asc"?m:-m}));return{headers:r,sortColumn:e,sortDirection:t,sortedDataRows:s,toggleSort:a}}},qn={class:"simple-table"},$n=["onClick"],Hn={key:0,class:"sort-indicator"};function zn(n,e,t,r,o,a){return i.openBlock(),i.createElementBlock("table",qn,[i.createElementVNode("thead",null,[i.createElementVNode("tr",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.headers,(s,l)=>(i.openBlock(),i.createElementBlock("th",{key:l,onClick:c=>r.toggleSort(l),class:i.normalizeClass({sortable:!0,sorted:r.sortColumn===l,"sort-asc":r.sortColumn===l&&r.sortDirection==="asc","sort-desc":r.sortColumn===l&&r.sortDirection==="desc"})},[i.createTextVNode(i.toDisplayString(s)+" ",1),r.sortColumn===l?(i.openBlock(),i.createElementBlock("span",Hn,i.toDisplayString(r.sortDirection==="asc"?"▲":"▼"),1)):i.createCommentVNode("",!0)],10,$n))),128))])]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.sortedDataRows,(s,l)=>(i.openBlock(),i.createElementBlock("tr",{key:l},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s,(c,f)=>(i.openBlock(),i.createElementBlock("td",{key:f},i.toDisplayString(c),1))),128))]))),128))])])}const et=pe(Un,[["render",zn],["__scopeId","data-v-3dcf836d"]]),vn={name:"SortableTable",props:{headers:{type:Array,required:!0},rows:{type:Array,required:!0},initialSortColumn:{type:Number,default:null},initialSortDirection:{type:String,default:"asc",validator:n=>["asc","desc"].includes(n)}},setup(n){const e=i.ref(n.initialSortColumn),t=i.ref(n.initialSortDirection),r=a=>{e.value===a?t.value==="asc"?t.value="desc":(e.value=null,t.value="asc"):(e.value=a,t.value="asc")},o=i.computed(()=>e.value===null?n.rows:[...n.rows].sort((a,s)=>{var E,O;const l=a[e.value],c=s[e.value],f=typeof l=="object"&&l!==null?l.children||((E=l.props)==null?void 0:E.children)||"":l,d=typeof c=="object"&&c!==null?c.children||((O=c.props)==null?void 0:O.children)||"":c;if(f===""||f===null||f===void 0)return 1;if(d===""||d===null||d===void 0)return-1;const h=parseFloat(String(f).replace(/[%,]/g,"")),p=parseFloat(String(d).replace(/[%,]/g,""));let m=0;return!isNaN(h)&&!isNaN(p)?m=h-p:m=String(f).localeCompare(String(d)),t.value==="asc"?m:-m}));return{sortColumn:e,sortDirection:t,sortedRows:o,toggleSort:r}}},Wn={class:"sortable-table"},Gn=["onClick"],Jn={key:0,class:"sort-indicator"};function Kn(n,e,t,r,o,a){return i.openBlock(),i.createElementBlock("table",Wn,[i.createElementVNode("thead",null,[i.createElementVNode("tr",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.headers,(s,l)=>(i.openBlock(),i.createElementBlock("th",{key:l,onClick:c=>r.toggleSort(l),class:i.normalizeClass({sortable:!0,sorted:r.sortColumn===l,"sort-asc":r.sortColumn===l&&r.sortDirection==="asc","sort-desc":r.sortColumn===l&&r.sortDirection==="desc"})},[i.createTextVNode(i.toDisplayString(s.label)+" ",1),r.sortColumn===l?(i.openBlock(),i.createElementBlock("span",Jn,i.toDisplayString(r.sortDirection==="asc"?"▲":"▼"),1)):i.createCommentVNode("",!0)],10,Gn))),128))])]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.sortedRows,(s,l)=>(i.openBlock(),i.createElementBlock("tr",{key:l},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s,(c,f)=>{var d;return i.openBlock(),i.createElementBlock("td",{key:f,class:i.normalizeClass((d=t.headers[f])==null?void 0:d.cellClass)},[typeof c=="object"&&c!==null?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(c),{key:0})):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(c),1)],64))],2)}),128))]))),128))])])}const Xn={name:"FeatureDetails",components:{SimpleTable:et,SortableTable:pe(vn,[["render",Kn],["__scopeId","data-v-b8895c87"]])},props:{feature:{type:Object,default:null},allFeatures:{type:Array,default:()=>[]},dataProvider:{type:Object,default:null},recordInfo:{type:Object,default:null},regionNumber:{type:String,default:"1"}},emits:["close"],setup(n){const e=i.ref([]),t=i.ref(!1),r=i.ref(null),o=async()=>{var w,_,L;if(e.value=[],t.value=!1,r.value=null,!n.feature||n.feature.type!=="CDS"||!n.dataProvider||!n.recordInfo)return;const R=(_=(w=n.feature.qualifiers)==null?void 0:w.locus_tag)==null?void 0:_[0];if(R){t.value=!0;try{const V=await n.dataProvider.getMiBIGEntries(n.recordInfo.recordId,R,n.regionNumber);e.value=V.entries||[]}catch(V){((L=V.response)==null?void 0:L.status)===404?e.value=[]:(console.error("Error fetching MiBIG entries:",V),r.value="Failed to load MiBIG entries")}finally{t.value=!1}}};i.watch(()=>n.feature,()=>{o()},{immediate:!0});const a=i.computed(()=>{var w,_,L,V;if(!n.feature||n.feature.type!=="CDS")return[];if(!n.allFeatures||n.allFeatures.length===0)return[];const R=((_=(w=n.feature.qualifiers)==null?void 0:w.locus_tag)==null?void 0:_[0])||((V=(L=n.feature.qualifiers)==null?void 0:L.gene)==null?void 0:V[0]);return R?n.allFeatures.filter(F=>{var M,U,H,K;return F.type==="PFAM_domain"&&(((U=(M=F.qualifiers)==null?void 0:M.locus_tag)==null?void 0:U[0])===R||((K=(H=F.qualifiers)==null?void 0:H.gene)==null?void 0:K[0])===R)}).map(F=>{var M,U,H,K,te,ne,W,$,g,y,S,A,k;return{id:((H=(U=(M=F.qualifiers)==null?void 0:M.db_xref)==null?void 0:U[0])==null?void 0:H.replace("PFAM:",""))||((W=(ne=(te=(K=F.qualifiers)==null?void 0:K.inference)==null?void 0:te[0])==null?void 0:ne.match(/PFAM:([^,\s]+)/))==null?void 0:W[1])||"Unknown",description:((g=($=F.qualifiers)==null?void 0:$.description)==null?void 0:g[0])||"",location:l(F.qualifiers),score:((S=(y=F.qualifiers)==null?void 0:y.score)==null?void 0:S[0])||"",evalue:((k=(A=F.qualifiers)==null?void 0:A.evalue)==null?void 0:k[0])||""}}):[]}),s=i.computed(()=>{if(!n.feature)return[];const R=[],w=n.feature.qualifiers||{};return w.go_function&&R.push(...w.go_function),w.go_process&&R.push(...w.go_process),w.go_component&&R.push(...w.go_component),R}),l=R=>{var L,V;if(!R)return"";const w=(L=R.protein_start)==null?void 0:L[0],_=(V=R.protein_end)==null?void 0:V[0];return w&&_?`[${w}:${_}]`:""},c=R=>{if(!R)return"";const w=R.match(/\[<?(\d+):>?(\d+)\](?:\(([+-])\))?/);if(!w)return R;const _=parseInt(w[1]),L=parseInt(w[2]),V=w[3]||"",F=L-_;return`${_.toLocaleString()} - ${L.toLocaleString()}${V?", "+V:""} (total: ${F.toLocaleString()} nt)`},f=()=>{var F,M,U,H,K,te;if(!n.feature)return"";const R=n.feature.qualifiers||{},w=((F=R.locus_tag)==null?void 0:F[0])||"",_=((M=R.product)==null?void 0:M[0])||"",L=((U=R.gene)==null?void 0:U[0])||"",V=((H=R.description)==null?void 0:H[0])||"";if(n.feature.type==="CDS"){if(w&&_)return`${w} - ${_}`;if(w)return w;if(L)return L;if(_)return _}if(n.feature.type==="PFAM_domain"){const ne=((te=(K=R.db_xref)==null?void 0:K[0])==null?void 0:te.replace("PFAM:",""))||"PFAM domain";return V?`${ne} - ${V}`:ne}return V||_||n.feature.type||"Feature Details"},d=R=>R.split("_").map((_,L)=>L===0?_.charAt(0).toUpperCase()+_.slice(1):_).join(" "),h=R=>Array.isArray(R)?R.join(", "):R,p=()=>{if(!n.feature||!n.feature.qualifiers)return!1;const R=["locus_tag","protein_id","gene","product","gene_kind","translation","nucleotide","go_function","go_process","go_component"];return Object.keys(n.feature.qualifiers).filter(_=>!R.includes(_)).length>0},m=()=>{if(!n.feature||!n.feature.qualifiers)return{};const R=["locus_tag","protein_id","gene","product","gene_kind","translation","nucleotide","go_function","go_process","go_component"],w={};return Object.keys(n.feature.qualifiers).forEach(_=>{R.includes(_)||(w[_]=n.feature.qualifiers[_])}),w},E=R=>{if(!R)return"";const w=[];for(let _=0;_<R.length;_+=60)w.push(R.slice(_,_+60));return w.join(`
|
|
25
|
+
`)},O=async(R,w)=>{try{await navigator.clipboard.writeText(R),alert(`${w} sequence copied to clipboard!`)}catch(_){console.error("Failed to copy to clipboard:",_),alert("Failed to copy to clipboard")}},I=(R,w)=>({NRPS_PKS:b,sec_met_domain:T}[R]||N)(w),b=R=>{const w=R.map(M=>{const U=M.split(/\.\s+/);if(U.length===0)return{domain:M};const K={domain:U[0].replace(/^Domain:\s*/,"").trim()};return U.slice(1).forEach(te=>{const ne=te.indexOf(":");if(ne>-1){const W=te.substring(0,ne).trim(),$=te.substring(ne+1).trim();K[W]=$}}),K}),_=w[0]||{},L=Object.keys(_).filter(M=>M!=="domain"),F=[["",...L],...w.map(M=>{const U=[M.domain||""];return L.forEach(H=>{U.push(M[H]||"")}),U})];return i.h(et,{rows:F})},T=R=>{const w=R.map(M=>{const U=M.match(/^([^(]+)\s*\(([^)]+)\)/);if(!U)return{name:M};const H=U[1].trim(),K=U[2],te={name:H};return K.split(/,\s*/).forEach(W=>{const $=W.indexOf(":");if($>-1){const g=W.substring(0,$).trim(),y=W.substring($+1).trim();te[g]=y}}),te}),_=w[0]||{},L=Object.keys(_).filter(M=>M!=="name"),F=[["",...L],...w.map(M=>{const U=[M.name||""];return L.forEach(H=>{U.push(M[H]||"")}),U})];return i.h(et,{rows:F})},N=R=>{const w=R.map((_,L)=>i.h("li",{key:L},_));return i.h("ul",{class:"qualifier-list"},w)},x=R=>typeof R=="number"?R.toExponential(2):R,D=[{label:"Domain",cellClass:"pfam-id"},{label:"Description",cellClass:"pfam-description"},{label:"Location",cellClass:"pfam-location"},{label:"Score",cellClass:"pfam-score"},{label:"E-value",cellClass:"pfam-evalue"}],j=i.computed(()=>a.value.map(R=>[R.id,R.description,R.location,R.score,R.evalue])),q=[{label:"MIBiG Protein",cellClass:"mibig-protein"},{label:"Description",cellClass:"mibig-description"},{label:"MIBiG Cluster",cellClass:"mibig-cluster"},{label:"Product",cellClass:"mibig-product"},{label:"% ID",cellClass:"mibig-percent"},{label:"BLAST Score",cellClass:"mibig-score"},{label:"% Coverage",cellClass:"mibig-percent"},{label:"E-value",cellClass:"mibig-evalue"}],ee=i.computed(()=>e.value.map(R=>[R.mibig_protein,R.description,i.h("a",{href:`https://mibig.secondarymetabolites.org/go/${R.mibig_cluster}`,target:"_blank",rel:"noopener noreferrer"},R.mibig_cluster),R.mibig_product,`${parseFloat(R.percent_identity).toFixed(1)}%`,parseFloat(R.blast_score).toFixed(1),`${parseFloat(R.percent_coverage).toFixed(1)}%`,x(R.evalue)]));return{pfamDomains:a,goTerms:s,mibigEntries:e,mibigLoading:t,mibigError:r,formatLocation:c,getFeatureTitle:f,formatQualifierKey:d,formatQualifierValue:h,hasAdditionalQualifiers:p,getAdditionalQualifiers:m,formatSequence:E,copyToClipboard:O,renderQualifierValue:I,formatEvalue:x,pfamTableHeaders:D,pfamTableRows:j,mibigTableHeaders:q,mibigTableRows:ee}}},Qn={key:0,class:"feature-details"},Yn={class:"feature-content"},Zn={class:"feature-header"},er={class:"info-section"},tr={key:0,class:"info-row"},nr={class:"info-value"},rr={key:1,class:"info-row"},or={class:"info-value"},sr={key:2,class:"info-row"},ir={class:"info-value"},ar={key:3,class:"info-row"},lr={class:"info-value"},cr={key:4,class:"info-row"},dr={class:"info-value"},ur={key:5,class:"info-row"},fr={class:"info-value"},hr={class:"info-label"},pr={class:"info-value"},mr={key:0,class:"expandable-list"},gr={class:"expanded-content"},yr={key:6,class:"info-row"},br={class:"info-value"},wr={class:"expandable-list"},Er={class:"expanded-content"},kr={key:7,class:"info-row"},_r={class:"info-value"},Sr={class:"expandable-list"},Rr={class:"expanded-content"},Cr={key:8,class:"info-row"},Ar={class:"info-value"},Tr={class:"expandable-list"},xr={class:"expanded-content"},Or={class:"go-term-list"},Nr={key:0,class:"info-section sequences"},Lr={key:0,class:"info-row"},Br={class:"info-value"},Pr={class:"expandable-list"},Dr={class:"expanded-content"},Fr={class:"sequence-text"},Ir={key:1,class:"sequence-block"},Vr={class:"sequence-header"},Mr={class:"sequence-text"},jr={key:1,class:"no-selection"};function Ur(n,e,t,r,o,a){var l,c,f,d,h,p,m,E,O,I,b,T,N,x;const s=i.resolveComponent("SortableTable");return t.feature?(i.openBlock(),i.createElementBlock("div",Qn,[i.createElementVNode("div",Yn,[i.createElementVNode("div",Zn,[i.createElementVNode("h3",null,i.toDisplayString(t.feature.type),1)]),i.createElementVNode("div",er,[(c=(l=t.feature.qualifiers)==null?void 0:l.locus_tag)!=null&&c[0]?(i.openBlock(),i.createElementBlock("div",tr,[e[2]||(e[2]=i.createElementVNode("span",{class:"info-label"},"Locus tag",-1)),i.createElementVNode("span",nr,i.toDisplayString(t.feature.qualifiers.locus_tag[0]),1)])):i.createCommentVNode("",!0),(d=(f=t.feature.qualifiers)==null?void 0:f.protein_id)!=null&&d[0]?(i.openBlock(),i.createElementBlock("div",rr,[e[3]||(e[3]=i.createElementVNode("span",{class:"info-label"},"Protein ID",-1)),i.createElementVNode("span",or,i.toDisplayString(t.feature.qualifiers.protein_id[0]),1)])):i.createCommentVNode("",!0),(p=(h=t.feature.qualifiers)==null?void 0:h.gene)!=null&&p[0]?(i.openBlock(),i.createElementBlock("div",sr,[e[4]||(e[4]=i.createElementVNode("span",{class:"info-label"},"Gene",-1)),i.createElementVNode("span",ir,i.toDisplayString(t.feature.qualifiers.gene[0]),1)])):i.createCommentVNode("",!0),(E=(m=t.feature.qualifiers)==null?void 0:m.product)!=null&&E[0]?(i.openBlock(),i.createElementBlock("div",ar,[e[5]||(e[5]=i.createElementVNode("span",{class:"info-label"},"Product",-1)),i.createElementVNode("span",lr,i.toDisplayString(t.feature.qualifiers.product[0]),1)])):i.createCommentVNode("",!0),t.feature.location?(i.openBlock(),i.createElementBlock("div",cr,[e[6]||(e[6]=i.createElementVNode("span",{class:"info-label"},"Location",-1)),i.createElementVNode("span",dr,i.toDisplayString(r.formatLocation(t.feature.location)),1)])):i.createCommentVNode("",!0),(I=(O=t.feature.qualifiers)==null?void 0:O.gene_kind)!=null&&I[0]?(i.openBlock(),i.createElementBlock("div",ur,[e[7]||(e[7]=i.createElementVNode("span",{class:"info-label"},"Gene kind",-1)),i.createElementVNode("span",fr,i.toDisplayString(t.feature.qualifiers.gene_kind[0]),1)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.getAdditionalQualifiers(),(D,j)=>(i.openBlock(),i.createElementBlock("div",{key:j,class:"info-row"},[i.createElementVNode("span",hr,i.toDisplayString(r.formatQualifierKey(j)),1),i.createElementVNode("span",pr,[Array.isArray(D)&&D.length>1?(i.openBlock(),i.createElementBlock("details",mr,[i.createElementVNode("summary",null,i.toDisplayString(D.length)+" items",1),i.createElementVNode("div",gr,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.renderQualifierValue(j,D))))])])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(r.formatQualifierValue(D)),1)],64))])]))),128)),r.pfamDomains.length>0?(i.openBlock(),i.createElementBlock("div",yr,[e[8]||(e[8]=i.createElementVNode("span",{class:"info-label"},"Pfam hits",-1)),i.createElementVNode("span",br,[i.createElementVNode("details",wr,[i.createElementVNode("summary",null,i.toDisplayString(r.pfamDomains.length)+" items",1),i.createElementVNode("div",Er,[i.createVNode(s,{headers:r.pfamTableHeaders,rows:r.pfamTableRows},null,8,["headers","rows"])])])])])):i.createCommentVNode("",!0),t.feature.type==="CDS"&&r.mibigEntries.length>0?(i.openBlock(),i.createElementBlock("div",kr,[e[9]||(e[9]=i.createElementVNode("span",{class:"info-label"},"MiBIG hits",-1)),i.createElementVNode("span",_r,[i.createElementVNode("details",Sr,[i.createElementVNode("summary",null,i.toDisplayString(r.mibigEntries.length)+" items",1),i.createElementVNode("div",Rr,[i.createVNode(s,{headers:r.mibigTableHeaders,rows:r.mibigTableRows},null,8,["headers","rows"])])])])])):i.createCommentVNode("",!0),r.goTerms.length>0?(i.openBlock(),i.createElementBlock("div",Cr,[e[10]||(e[10]=i.createElementVNode("span",{class:"info-label"},"GO terms",-1)),i.createElementVNode("span",Ar,[i.createElementVNode("details",Tr,[i.createElementVNode("summary",null,i.toDisplayString(r.goTerms.length)+" items",1),i.createElementVNode("div",xr,[i.createElementVNode("ul",Or,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.goTerms,(D,j)=>(i.openBlock(),i.createElementBlock("li",{key:j,class:"go-term"},i.toDisplayString(D),1))),128))])])])])])):i.createCommentVNode("",!0)]),t.feature.type==="CDS"?(i.openBlock(),i.createElementBlock("div",Nr,[(T=(b=t.feature.qualifiers)==null?void 0:b.translation)!=null&&T[0]?(i.openBlock(),i.createElementBlock("div",Lr,[e[12]||(e[12]=i.createElementVNode("span",{class:"info-label"},"AA sequence",-1)),i.createElementVNode("span",Br,[i.createElementVNode("details",Pr,[i.createElementVNode("summary",null,[e[11]||(e[11]=i.createTextVNode(" Show sequence ",-1)),i.createElementVNode("button",{onClick:e[0]||(e[0]=i.withModifiers(D=>r.copyToClipboard(t.feature.qualifiers.translation[0],"amino acid"),["stop"])),class:"copy-button copy-button-inline"}," Copy to clipboard ")]),i.createElementVNode("div",Dr,[i.createElementVNode("pre",Fr,i.toDisplayString(r.formatSequence(t.feature.qualifiers.translation[0])),1)])])])])):i.createCommentVNode("",!0),(x=(N=t.feature.qualifiers)==null?void 0:N.nucleotide)!=null&&x[0]?(i.openBlock(),i.createElementBlock("div",Ir,[i.createElementVNode("div",Vr,[e[13]||(e[13]=i.createElementVNode("span",{class:"sequence-label"},"Nucleotide sequence",-1)),i.createElementVNode("button",{onClick:e[1]||(e[1]=D=>r.copyToClipboard(t.feature.qualifiers.nucleotide[0],"nucleotide")),class:"copy-button"}," Copy to clipboard ")]),i.createElementVNode("pre",Mr,i.toDisplayString(r.formatSequence(t.feature.qualifiers.nucleotide[0])),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])):(i.openBlock(),i.createElementBlock("div",jr,[...e[14]||(e[14]=[i.createElementVNode("p",null,"Click on a feature to view details",-1)])]))}const qr=pe(Xn,[["render",Ur],["__scopeId","data-v-76c471aa"]]),$r={name:"SimpleDetails",props:{data:{type:Object,default:null},elementType:{type:String,default:""}},setup(n){const e=i.computed(()=>{if(!n.data)return{};const a={},s=["_elementType"];return Object.keys(n.data).forEach(l=>{s.includes(l)||(a[l]=n.data[l])}),a}),t=i.computed(()=>{if(!n.data)return[];const a=["_elementType"];return Object.keys(n.data).filter(s=>!a.includes(s))});return{displayData:e,displayKeys:t,formatLabel:a=>{const s=a.replace(/_/g," ").replace(/([A-Z])/g," $1").split(" ").filter(l=>l.length>0);return s.length===0?"":s[0].charAt(0).toUpperCase()+s[0].slice(1).toLowerCase()+(s.length>1?" "+s.slice(1).map(l=>l.toLowerCase()).join(" "):"")},formatValue:(a,s)=>s==null?"N/A":typeof s=="number"?a.toLowerCase().includes("evalue")&&s<.01?s.toExponential(2):a.toLowerCase().includes("score")||a.toLowerCase().includes("bitscore")?s.toFixed(1):a.toLowerCase().includes("percent")||a.toLowerCase().includes("identity")||a.toLowerCase().includes("coverage")?`${s.toFixed(1)}%`:s.toLocaleString():Array.isArray(s)?s.length===0?"None":s.length===1?String(s[0]):s.join(", "):typeof s=="boolean"?s?"Yes":"No":typeof s=="object"?JSON.stringify(s,null,2):String(s)}}},Hr={key:0,class:"simple-details"},zr={key:0,class:"details-header"},vr={class:"details-content"},Wr={class:"info-section"},Gr={class:"info-label"},Jr={class:"info-value"},Kr={key:1,class:"no-selection"};function Xr(n,e,t,r,o,a){return t.data?(i.openBlock(),i.createElementBlock("div",Hr,[t.elementType?(i.openBlock(),i.createElementBlock("div",zr,[i.createElementVNode("h3",null,i.toDisplayString(t.elementType),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",vr,[i.createElementVNode("div",Wr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.displayKeys,s=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"info-row"},[i.createElementVNode("span",Gr,i.toDisplayString(r.formatLabel(s)),1),i.createElementVNode("span",Jr,i.toDisplayString(r.formatValue(s,r.displayData[s])),1)]))),128))])])])):(i.openBlock(),i.createElementBlock("div",Kr,[...e[0]||(e[0]=[i.createElementVNode("p",null,"Click on an element to view details",-1)])]))}const Qr={name:"RegionViewerComponent",components:{FeatureDetails:qr,SimpleDetails:pe($r,[["render",Xr],["__scopeId","data-v-6d8f9976"]])},props:{recordInfo:{type:Object,default:null},regions:{type:Array,default:()=>[]},features:{type:Array,default:()=>[]},regionBoundaries:{type:Object,default:null},pfamColorMap:{type:Object,default:()=>({})},selectedRegionId:{type:String,default:""},dataProvider:{type:Object,default:null},tfbsHits:{type:Array,default:()=>[]},ttaCodons:{type:Array,default:()=>[]},resistanceFeatures:{type:Array,default:()=>[]}},emits:["region-changed","annotation-clicked","annotation-hovered","error"],setup(n,{emit:e,expose:t}){const r=i.ref(null),o=i.ref(""),a=i.ref(!1),s=i.ref(""),l=i.ref([]),c=i.ref([]),f=i.ref(!1),d=i.ref(null),h=i.computed(()=>{if(!o.value||!n.regions.length)return"1";const g=n.regions.find(y=>y.id===o.value);return g?String(g.region_number):"1"});let p=null,m={};const E=i.ref(null),O=500,I=i.computed(()=>{var g;return((g=E.value)==null?void 0:g.data)||null});i.watch(()=>n.features,()=>{n.features&&n.features.length>0&&b()}),i.watch(()=>n.tfbsHits,()=>{n.features&&n.features.length>0&&b()}),i.watch(()=>n.ttaCodons,()=>{n.features&&n.features.length>0&&b()}),i.watch(()=>n.resistanceFeatures,()=>{n.features&&n.features.length>0&&b()}),i.watch(()=>n.selectedRegionId,g=>{o.value=g},{immediate:!0}),i.onMounted(()=>{document.addEventListener("click",H),n.features&&n.features.length>0&&b()}),i.onUnmounted(()=>{document.removeEventListener("click",H),p&&(p.destroy(),p=null)});const b=async()=>{try{if(s.value="",!n.features||n.features.length===0){console.warn("No features provided");return}console.log("Building viewer with",n.features.length,"features"),E.value=null,ee(),console.log("Built tracks:",Object.keys(m)),R(),d.value&&w(d.value);const g=Object.values(m).map(S=>{var A;return{id:S.id,label:S.label,annotationCount:((A=S._originalAnnotations)==null?void 0:A.length)||S.annotations.length}});F(g),l.value=g;const y=g.filter(S=>["CDS"].includes(S.id)||S.id.includes("protocluster")||S.id.includes("PFAM_domain")||S.id.includes("cand_cluster")).map(S=>S.id);c.value=y.length>0?y:g.map(S=>S.id),console.log("Available tracks:",l.value),console.log("Selected tracks:",c.value),await i.nextTick(),console.log("Initializing viewer..."),N(),p&&(d.value=p.getCurrentDomain(),w(d.value)),_(),console.log("Viewer initialized and updated")}catch(g){console.error("Error in rebuildViewer:",g),s.value=`Failed to build viewer: ${g.message}`,e("error",g)}},T=()=>{e("region-changed",o.value)},N=()=>{if(p&&p.destroy(),!r.value)return;let g,y,S;if(n.regionBoundaries)g=n.regionBoundaries.start,y=n.regionBoundaries.end,S=(y-g)*.02,console.log("Using region boundaries:",g,"-",y);else{console.log("Calculating boundaries from",n.features.length,"features");const A=n.features.filter(k=>k.location).map(k=>{const P=k.location.match(/\[<?(\d+):>?(\d+)\]/);return P?[parseInt(P[1]),parseInt(P[2])]:null}).filter(Boolean).flat();console.log("Extracted positions:",A.slice(0,10),A.length>10?`... (${A.length} total)`:""),A.length===0?(console.warn("No valid positions found, using default domain"),g=0,y=1e3):(g=Math.min(...A),y=Math.max(...A)),S=(y-g)*.02,console.log("Calculated domain:",g-S,"to",y+S)}console.log("Creating TrackViewer..."),p=new qe({container:r.value,height:400,domain:[g-S,y+S],trackHeight:40,zoomExtent:[.1,1e3],showTrackLabels:!1,onAnnotationClick:(A,k)=>{console.log("Clicked annotation:",A,"on track:",k),K(A),e("annotation-clicked",{annotation:A,track:k})},onAnnotationHover:(A,k,P)=>{e("annotation-hovered",{annotation:A,track:k,event:P})},onBackgroundClick:()=>{E.value=null,W(),_()},onDomainChange:A=>{d.value=A,w(A),W(),_()}}),console.log("TrackViewer created successfully")},x=(g,y,S)=>{m[g]||(m[g]={id:g,label:y,height:S,annotations:[],primitives:[]},g==="CDS"&&m[g].primitives.push({id:"cds-baseline",trackId:g,type:"horizontal-line",class:"cds-baseline",fy:.5,stroke:"black",opacity:1}))},D=g=>{if(!g)return null;const y=g.match(/\[<?(\d+):>?(\d+)\](?:\(([+-])\))?/);if(!y)return null;const S=y[3]||null;return{start:parseInt(y[1]),end:parseInt(y[2]),strand:S,direction:S==="+"?"right":S==="-"?"left":"none"}},j=g=>g.toLowerCase().replace("_"," "),q=g=>g.toLowerCase().replace(/[^a-z0-9]+/g,"-"),ee=()=>{if(m={},n.features.forEach(g=>{var P,G,de,Ce,J,ie,ae,Me,Ae,le,B,X,ce,ue,je,Ye,he,En,kn,_n,Sn,Rn,Cn,An,Tn,xn,On,Nn,Ln;if(!g.location)return;const y=D(g.location);if(!y){console.warn("Failed to parse location for feature:",g.type,g.location);return}const S=[];S.push(L(g.type));let A,k;switch(g.type){case"cand_cluster":if((((G=(P=g.qualifiers)==null?void 0:P.protoclusters)==null?void 0:G.length)||1)<2)break;const Te=((Ce=(de=g.qualifiers)==null?void 0:de.candidate_cluster_number)==null?void 0:Ce[0])||"unknown",Bn=((ie=(J=g.qualifiers)==null?void 0:J.kind)==null?void 0:ie[0])||"unknown";A=`cand_cluster-track-${Te!=="unknown"?String(Te).padStart(3,"0"):Te}`,k=`Candidate Cluster track ${Te}`,S.push(`candidate-${q(Bn)}`);for(let ke of Object.keys(m)){if(!ke.startsWith("cand_cluster-track-"))continue;if(!m[ke].annotations.some(Ue=>!(y.end<Ue.start||y.start>Ue.end))){A=ke;break}}x(A,k),m[A].annotations.push({id:`${g.type}-${Te}`,trackId:A,type:"box",heightFraction:.4,classes:S,label:`CC ${Te}: ${j(Bn)}`,labelPosition:"center",showLabel:"always",start:y.start,end:y.end,data:g});break;case"PFAM_domain":A=g.type,k=g.type,x(A,k);const Pn=((Ae=(Me=(ae=g.qualifiers)==null?void 0:ae.db_xref)==null?void 0:Me[0])==null?void 0:Ae.replace("PFAM:",""))||((ce=(X=(B=(le=g.qualifiers)==null?void 0:le.inference)==null?void 0:B[0])==null?void 0:X.match(/PFAM:([^,\s]+)/))==null?void 0:ce[1])||((he=(Ye=(je=(ue=g.qualifiers)==null?void 0:ue.note)==null?void 0:je[0])==null?void 0:Ye.match(/PF\d+/))==null?void 0:he[0]),[Ze,ha]=Pn?Pn.split("."):["",""],Dn=Ze&&n.pfamColorMap[Ze]?n.pfamColorMap[Ze]:null,Pi=((kn=(En=g.qualifiers)==null?void 0:En.description)==null?void 0:kn[0])||"",Di=`${Ze} ${Pi}`.trim(),Fi={id:`${g.type}-${y.start}-${y.end}`,trackId:A,type:"box",classes:S,label:Di||"unknown",start:y.start,end:y.end,fill:Dn,stroke:Dn,data:g};m[A].annotations.push(Fi);break;case"CDS":A=g.type,k=g.type,S.push(`gene-type-${((Sn=(_n=g.qualifiers)==null?void 0:_n.gene_kind)==null?void 0:Sn[0])||"other"}`),x(A,k),m[A].annotations.push({id:`${g.type}-${y.start}-${y.end}`,trackId:A,type:"arrow",classes:S,label:V(g),start:y.start,end:y.end,direction:y.direction,stroke:"black",data:g});break;case"protocluster":const xe=((Cn=(Rn=g.qualifiers)==null?void 0:Rn.protocluster_number)==null?void 0:Cn[0])||"unknown",Ii=((Tn=(An=g.qualifiers)==null?void 0:An.category)==null?void 0:Tn[0])||"unknown",Vi=((On=(xn=g.qualifiers)==null?void 0:xn.product)==null?void 0:On[0])||"unknown";S.push(Ii),S.push(Vi);const bt=D(((Ln=(Nn=g.qualifiers)==null?void 0:Nn.core_location)==null?void 0:Ln[0])||null);A=`protocluster-track-${xe!=="unknown"?String(xe).padStart(3,"0"):xe}`,k=`Protocluster track ${xe}`;for(let ke of Object.keys(m)){if(!ke.startsWith("protocluster-track-"))continue;if(!m[ke].annotations.some(Ue=>!(y.end<Ue.start||y.start>Ue.end))){A=ke;break}}x(A,k),m[A].annotations.push({id:`${g.type}-${xe}`,trackId:A,type:"box",heightFraction:.3,classes:S,start:y.start,end:y.end,stroke:"none",opacity:.5,data:g}),bt&&m[A].annotations.push({id:`${g.type}-${xe}-core`,trackId:A,type:"box",heightFraction:.35,classes:[...S,"proto-core"],label:V(g),showLabel:"always",start:bt.start,end:bt.end,stroke:"black",data:g});break;default:A=g.type,k=g.type,x(A,k),m[A].annotations.push({id:`${g.type}-${y.start}-${y.end}`,trackId:A,type:"box",classes:S,label:V(g),start:y.start,end:y.end,data:g});break}}),n.tfbsHits&&n.tfbsHits.length>0){const g="CDS";x(g,g),n.tfbsHits.forEach((y,S)=>{y.confidence!=="strong"&&y.confidence!=="medium"||m[g].annotations.push({id:`tfbs-${S}-${y.start}`,trackId:g,type:"pin",classes:["tfbs-hit",`tfbs-${y.confidence}`],label:y.name,labelPosition:"above",showLabel:"hover",start:y.start,end:y.start,fy:.5,heightFraction:.5,opacity:.8,data:{...y,_elementType:"Binding Site"}})})}if(n.ttaCodons&&n.ttaCodons.length>0){const g="CDS";x(g,g),n.ttaCodons.forEach((y,S)=>{m[g].annotations.push({id:`tta-${S}-${y.start}`,trackId:g,type:"triangle",classes:["tta-codon"],showLabel:"none",start:y.start,end:y.start,fy:.2,heightFraction:.4,opacity:.9,data:{...y,_elementType:"TTA Codon"}})})}if(n.resistanceFeatures&&n.resistanceFeatures.length>0){const g="CDS";x(g,g);const y={};n.features.forEach(S=>{var A,k;if(S.type==="CDS"&&((k=(A=S.qualifiers)==null?void 0:A.locus_tag)!=null&&k[0])){const P=S.qualifiers.locus_tag[0],G=D(S.location);G&&(y[P]=G)}}),n.resistanceFeatures.forEach((S,A)=>{const k=S.locus_tag,P=y[k];console.log("Mapping resistance feature",S.reference_id,"to locus tag",k,"with location",P),P&&m[g].annotations.push({id:`resistance-${A}-${k}`,trackId:g,type:"box",classes:["resistance"],showLabel:"never",start:P.start,end:P.end,fy:.1,heightFraction:.2,fill:"#BBB",data:{...S,_elementType:"Resistance"}})})}},R=()=>{Object.keys(m).forEach(g=>{const y=m[g];y.annotations.length>O&&(y._originalAnnotations=y.annotations)})},w=g=>{const[y,S]=g,A=(S-y)*.1;Object.keys(m).forEach(k=>{const P=m[k];if(!P._originalAnnotations)return;const G=P._originalAnnotations.filter(de=>de.end>=y-A&&de.start<=S+A);if(G.length>O){const de=Math.min(...G.flatMap(J=>[J.start,J.end])),Ce=Math.max(...G.flatMap(J=>[J.start,J.end]));P.annotations=[{id:`${k}-placeholder`,trackId:k,type:"box",classes:["track-placeholder"],label:`${P.label}: zoom in further to see ${G.length.toLocaleString()} features`,labelPosition:"center",showLabel:"always",start:de,end:Ce,fill:"#cccccc",stroke:"#999999",opacity:.6,heightFraction:.8,data:{_elementType:"Placeholder",count:G.length,message:"This viewport has too many features to display. Zoom in further to see details."}}]}else P.annotations=G})},_=()=>{if(!p||!Object.keys(m).length)return;const g=[];l.value.forEach(k=>{c.value.includes(k.id)&&m[k.id]&&g.push(m[k.id])});const y=g.map(k=>({id:k.id,label:k.label,height:k.height||void 0})),S=g.flatMap(k=>k.annotations),A=g.flatMap(k=>k.primitives);p.setData({tracks:y,annotations:S,primitives:A})},L=g=>`feature-${g.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,V=g=>{var S,A,k,P,G;const y=g.qualifiers||{};return(S=y.locus_tag)!=null&&S[0]?y.locus_tag[0]:(A=y.gene)!=null&&A[0]?y.gene[0]:(k=y.product)!=null&&k[0]?y.product[0]:(P=y.description)!=null&&P[0]?y.description[0]:(G=y.db_xref)!=null&&G[0]?y.db_xref[0]:g.type||"Feature"},F=g=>{const y=S=>S.startsWith("cand_cluster")?1:S.startsWith("protocluster")?2:S.startsWith("CDS")?3:S.startsWith("PFAM_domain")?4:5;return g.sort((S,A)=>{const k=y(S.id),P=y(A.id);return k!==P?k-P:S.id.localeCompare(A.id)})},M=()=>{f.value=!f.value},U=g=>{g.target.checked?c.value=[...l.value.map(y=>y.id)]:c.value=[],_()},H=g=>{g.composedPath().some(A=>A.classList&&A.classList.contains("multi-select-dropdown"))||(f.value=!1)},K=(g,y)=>{if(E.value=g,g.id.endsWith("-core")){const S=m[g.trackId],A=g.id.replace("-core","");if(S){const k=S.annotations.find(P=>P.id===A);k&&(E.value=k)}}W(),p&&p.drawTracks&&p.drawTracks()},te=()=>{E.value=null},ne=g=>{if(!E.value)return!0;if(g.id.endsWith("-core")){const y=m[g.trackId],S=g.id.replace("-core","");if(y){const A=y.annotations.find(k=>k.id===S);if(A)return A.start>=E.value.start&&A.end<=E.value.end}return!1}return g.start>=E.value.start&&g.end<=E.value.end},W=()=>{Object.values(m).forEach(g=>{g.id!=="CDS"&&g.id!=="PFAM_domain"||(g.annotations.forEach(y=>{const S=ne(y);y._originalOpacity===void 0&&(y._originalOpacity=y.opacity!==void 0?y.opacity:1),S?y.opacity=y._originalOpacity:y.opacity=y._originalOpacity*.5}),g.id==="CDS"&&g.primitives&&g.primitives.forEach(y=>{y.id==="cds-baseline"&&(y._originalOpacity===void 0&&(y._originalOpacity=y.opacity!==void 0?y.opacity:1),E.value?y.opacity=y._originalOpacity*.1:y.opacity=y._originalOpacity)}))})};return t({clearViewer:()=>{o.value="",E.value=null,m={},l.value=[],c.value=[],s.value="",r.value&&(r.value.innerHTML=""),p=null},rebuildViewer:b}),{viewerContainer:r,selectedRegion:o,loading:a,error:s,availableTracks:l,selectedTracks:c,dropdownOpen:f,selectedElement:I,currentRegionNumber:h,onRegionChange:T,updateViewer:_,toggleDropdown:M,toggleSelectAll:U,clearSelectedElement:te}}},Yr={class:"region-viewer-wrapper"},Zr={key:0,class:"controls"},eo=["value"],to={key:1,class:"no-regions-message"},no={key:2,class:"feature-controls"},ro={class:"multi-select-container"},oo={class:"selected-display"},so={key:0},io={key:1},ao={key:2},lo={class:"select-all-option"},co=["checked","indeterminate"],uo=["value"],fo={key:1,class:"current-record-info"},ho={class:"file-metadata"},po={ref:"viewerContainer",class:"viewer-container"},mo={key:2,class:"loading"},go={key:3,class:"error"},yo={key:4,class:"feature-details-container"};function bo(n,e,t,r,o,a){var c,f,d,h;const s=i.resolveComponent("FeatureDetails"),l=i.resolveComponent("SimpleDetails");return i.openBlock(),i.createElementBlock("div",Yr,[t.recordInfo?(i.openBlock(),i.createElementBlock("div",Zr,[t.regions.length>0?i.withDirectives((i.openBlock(),i.createElementBlock("select",{key:0,"onUpdate:modelValue":e[0]||(e[0]=p=>r.selectedRegion=p),onChange:e[1]||(e[1]=(...p)=>r.onRegionChange&&r.onRegionChange(...p)),class:"region-select"},[e[7]||(e[7]=i.createElementVNode("option",{value:""},"Show all features",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.regions,p=>(i.openBlock(),i.createElementBlock("option",{key:p.id,value:p.id}," Region "+i.toDisplayString(p.region_number)+" - "+i.toDisplayString(p.product.join(", ")),9,eo))),128))],544)),[[i.vModelSelect,r.selectedRegion]]):i.createCommentVNode("",!0),t.regions.length===0&&!r.loading?(i.openBlock(),i.createElementBlock("div",to," No regions found - showing all features for this record ")):i.createCommentVNode("",!0),r.availableTracks.length>0?(i.openBlock(),i.createElementBlock("div",no,[i.createElementVNode("div",ro,[i.createElementVNode("div",{class:i.normalizeClass(["multi-select-dropdown",{open:r.dropdownOpen}]),onClick:e[6]||(e[6]=(...p)=>r.toggleDropdown&&r.toggleDropdown(...p))},[i.createElementVNode("div",oo,[r.selectedTracks.length===r.availableTracks.length?(i.openBlock(),i.createElementBlock("span",so," All tracks ("+i.toDisplayString(r.selectedTracks.length)+") ",1)):r.selectedTracks.length===0?(i.openBlock(),i.createElementBlock("span",io," No tracks selected ")):(i.openBlock(),i.createElementBlock("span",ao,i.toDisplayString(r.selectedTracks.length)+" tracks selected ",1)),e[8]||(e[8]=i.createElementVNode("span",{class:"dropdown-arrow"},"▼",-1))]),r.dropdownOpen?(i.openBlock(),i.createElementBlock("div",{key:0,class:"dropdown-options",onClick:e[5]||(e[5]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",lo,[i.createElementVNode("label",null,[i.createElementVNode("input",{type:"checkbox",checked:r.selectedTracks.length===r.availableTracks.length,indeterminate:r.selectedTracks.length>0&&r.selectedTracks.length<r.availableTracks.length,onChange:e[2]||(e[2]=(...p)=>r.toggleSelectAll&&r.toggleSelectAll(...p))},null,40,co),e[9]||(e[9]=i.createTextVNode(" Select All ",-1))])]),e[10]||(e[10]=i.createElementVNode("div",{class:"option-separator"},null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.availableTracks,p=>(i.openBlock(),i.createElementBlock("div",{key:p.id,class:"dropdown-option"},[i.createElementVNode("label",null,[i.withDirectives(i.createElementVNode("input",{type:"checkbox",value:p.id,"onUpdate:modelValue":e[3]||(e[3]=m=>r.selectedTracks=m),onChange:e[4]||(e[4]=(...m)=>r.updateViewer&&r.updateViewer(...m))},null,40,uo),[[i.vModelCheckbox,r.selectedTracks]]),i.createTextVNode(" "+i.toDisplayString(p.label)+" ("+i.toDisplayString(p.annotationCount)+") ",1)])]))),128))])):i.createCommentVNode("",!0)],2)])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.recordInfo?(i.openBlock(),i.createElementBlock("div",fo,[i.createElementVNode("span",null,"Current Record: "+i.toDisplayString(t.recordInfo.recordId)+" - "+i.toDisplayString((f=(c=t.recordInfo)==null?void 0:c.recordInfo)==null?void 0:f.description),1),i.createElementVNode("div",ho,"File: "+i.toDisplayString(t.recordInfo.filename)+", version "+i.toDisplayString(((d=t.recordInfo.fileMetadata)==null?void 0:d.version)||"unknown")+", input "+i.toDisplayString(((h=t.recordInfo.fileMetadata)==null?void 0:h.input_file)||"unknown"),1)])):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("div",po,null,512),[[i.vShow,t.recordInfo]]),r.loading?(i.openBlock(),i.createElementBlock("div",mo," Loading region data... ")):i.createCommentVNode("",!0),r.error?(i.openBlock(),i.createElementBlock("div",go,i.toDisplayString(r.error),1)):i.createCommentVNode("",!0),t.recordInfo?(i.openBlock(),i.createElementBlock("div",yo,[r.selectedElement&&r.selectedElement.type&&r.selectedElement.qualifiers?(i.openBlock(),i.createBlock(s,{key:0,feature:r.selectedElement,"all-features":t.features,"data-provider":t.dataProvider,"record-info":t.recordInfo,"region-number":r.currentRegionNumber,onClose:r.clearSelectedElement},null,8,["feature","all-features","data-provider","record-info","region-number","onClose"])):r.selectedElement?(i.openBlock(),i.createBlock(l,{key:1,data:r.selectedElement,"element-type":r.selectedElement._elementType},null,8,["data","element-type"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}const wt=pe(Qr,[["render",bo],["__scopeId","data-v-acc3fea2"]]),wo={name:"LoadingSpinner",props:{color:{type:String,default:"#1976d2"}},setup(n){return{customStyle:i.computed(()=>({borderColor:n.color,borderTopColor:"transparent"}))}}};function Eo(n,e,t,r,o,a){return i.openBlock(),i.createElementBlock("div",{class:"loading-spinner",style:i.normalizeStyle(r.customStyle)},null,4)}const ko={name:"RegionViewerContainer",components:{RegionViewer:wt,LoadingSpinner:pe(wo,[["render",Eo],["__scopeId","data-v-04186386"]])},props:{dataProvider:{type:Object,default:null},recordId:{type:String,default:""},recordData:{type:Object,default:null},initialRegionId:{type:String,default:""}},emits:["region-changed","annotation-clicked","error"],setup(n,{emit:e}){const t=i.ref(null),r=i.ref(null),o=i.ref([]),a=i.ref([]),s=i.ref(null),l=i.ref({}),c=i.ref([]),f=i.ref([]),d=i.ref([]),h=i.ref(""),p=i.ref(!1),m=i.ref(""),E=i.ref(0),O=()=>{r.value=null,o.value=[],a.value=[],s.value=null,c.value=[],f.value=[],d.value=[],h.value=""},I=async()=>{if(t.value)try{l.value=await t.value.getPfamColorMap(),console.log("Loaded PFAM colors for",Object.keys(l.value).length,"domains")}catch(w){console.warn("Failed to load PFAM color mapping:",w.message)}},b=async(w,_)=>{if(t.value)try{const L=_.replace("region_",""),V=await t.value.getTFBSHits(w,L);c.value=V.hits||[],console.log("Loaded",c.value.length,"TFBS binding sites for region",L)}catch(L){console.warn("Failed to load TFBS hits:",L.message),c.value=[]}},T=async w=>{if(t.value)try{const _=await t.value.getTTACodons(w);f.value=_.codons||[],console.log("Loaded",f.value.length,"TTA codons for record",w)}catch(_){console.warn("Failed to load TTA codons:",_.message),f.value=[]}},N=async w=>{if(t.value)try{const _=await t.value.getResistanceFeatures(w);d.value=_.features||[],console.log("Loaded",d.value.length,"resistance features for record",w)}catch(_){console.warn("Failed to load resistance features:",_.message),d.value=[]}},x=async w=>{var L;const _=++E.value;O(),p.value=!0,m.value="";try{if(!t.value)throw new Error("No data provider available");const V=(L=n.recordData)==null?void 0:L.entryId,F=await t.value.loadEntry(V);if(_!==E.value){console.log("Ignoring stale load request for",w);return}r.value={entryId:F.entryId,recordId:F.recordId,filename:F.filename,fileMetadata:F.fileMetadata,recordInfo:F.recordInfo};const M=await t.value.getRegions(r.value.entryId);if(_!==E.value){console.log("Ignoring stale load request for",w);return}if(o.value=M.regions||[],s.value=M.boundaries||null,await T(r.value.entryId),_!==E.value){console.log("Ignoring stale load request for",w);return}if(await N(r.value.entryId),_!==E.value){console.log("Ignoring stale load request for",w);return}if(o.value&&o.value.length>0){const U=n.initialRegionId&&o.value.some(H=>H.id===n.initialRegionId)?n.initialRegionId:o.value[0].id;h.value=U,await D(r.value.entryId,h.value)}else await j(r.value.entryId);if(_!==E.value){console.log("Ignoring stale load request for",w);return}p.value=!1}catch(V){_===E.value&&(console.error("Error loading record:",V),m.value=`Failed to load record: ${V.message}`,e("error",m.value),p.value=!1)}},D=async(w,_)=>{try{const L=await t.value.getRegionFeatures(w,_);a.value=L.features||[],s.value=L.region_boundaries||null,await b(w,_)}catch(L){console.error("Error loading region features:",L),m.value=`Failed to load region features: ${L.message}`,e("error",m.value)}},j=async w=>{try{const _=await t.value.getRecordFeatures(w);a.value=_.features||[],s.value=null,c.value=[]}catch(_){console.error("Error loading features:",_),m.value=`Failed to load features: ${_.message}`,e("error",m.value)}},q=async w=>{h.value=w,w?await D(r.value.entryId,w):await j(r.value.entryId),e("region-changed",w)},ee=w=>{e("annotation-clicked",w)},R=w=>{e("error",w)};return i.onMounted(async()=>{if(!n.dataProvider){m.value="No data provider specified. Please set the dataProvider property.",e("error",m.value);return}t.value=n.dataProvider,await I(),n.recordId&&await x(n.recordId)}),i.watch(()=>n.recordId,async(w,_)=>{w&&t.value?await x(w):!w&&_!==void 0&&O()},{immediate:!0}),i.watch(()=>n.dataProvider,w=>{w&&(t.value=w,I())}),i.watch(()=>n.initialRegionId,w=>{w&&o.value.length>0&&(h.value=w,r.value&&D(r.value.entryId,w))}),{recordInfo:r,regions:o,features:a,regionBoundaries:s,pfamColorMap:l,tfbsHits:c,ttaCodons:f,resistanceFeatures:d,selectedRegionId:h,loading:p,error:m,handleRegionChanged:q,handleAnnotationClicked:ee,handleError:R}}},_o={class:"region-viewer-container"},So={key:0,class:"loading-container"};function Ro(n,e,t,r,o,a){const s=i.resolveComponent("LoadingSpinner"),l=i.resolveComponent("RegionViewer");return i.openBlock(),i.createElementBlock("div",_o,[r.loading?(i.openBlock(),i.createElementBlock("div",So,[i.createVNode(s,{color:"#1976d2",style:{width:"48px",height:"48px","border-width":"4px"}}),e[0]||(e[0]=i.createElementVNode("p",{class:"loading-text"},"Loading record data...",-1))])):r.recordInfo?(i.openBlock(),i.createBlock(l,{key:1,"record-info":r.recordInfo,regions:r.regions,features:r.features,"region-boundaries":r.regionBoundaries,"pfam-color-map":r.pfamColorMap,"selected-region-id":r.selectedRegionId,"data-provider":t.dataProvider,"tfbs-hits":r.tfbsHits,"tta-codons":r.ttaCodons,"resistance-features":r.resistanceFeatures,onRegionChanged:r.handleRegionChanged,onAnnotationClicked:r.handleAnnotationClicked,onError:r.handleError},null,8,["record-info","regions","features","region-boundaries","pfam-color-map","selected-region-id","data-provider","tfbs-hits","tta-codons","resistance-features","onRegionChanged","onAnnotationClicked","onError"])):i.createCommentVNode("",!0)])}const Co=pe(ko,[["render",Ro],["__scopeId","data-v-65ec5ff5"]]);function Et(n,e){return function(){return n.apply(e,arguments)}}const{toString:Ao}=Object.prototype,{getPrototypeOf:fe}=Object,{iterator:Oe,toStringTag:kt}=Symbol,Ne=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),_t=n=>typeof n=="string"&&(n==="__proto__"||n==="constructor"||n==="prototype"),St=(n,e,t)=>n===Object.prototype||!t&&e===null,To=n=>{if(!Object.isExtensible(n))return!1;const e=Object.getOwnPropertyNames(n);return Object.getOwnPropertySymbols&&e.push(...Object.getOwnPropertySymbols(n)),e.every(t=>{if(_t(t))return!1;const r=Object.getOwnPropertyDescriptor(n,t);return!!r&&r.configurable&&r.writable===!0})},Le=(n,e)=>{let t=n;const r=[];for(;t!=null;){if(r.indexOf(t)!==-1)return!1;r.push(t);const o=fe(t);if(St(t,o,t===n))return!1;if(Ne(t,e))return!0;t=o}return!1},xo=(n,e)=>n!=null&&Le(n,e)?n[e]:void 0,Oo=n=>{if(n==null||typeof n!="object"&&typeof n!="function")return n;const e=fe(n);if(e===null&&To(n))return n;const t=Object.create(null),r=Object.create(null),o=[];let a=n;for(;a!=null&&o.indexOf(a)===-1;){o.push(a);const s=a===n?e:fe(a);if(St(a,s,a===n))break;const l=Object.getOwnPropertyNames(a);Object.getOwnPropertySymbols&&l.push(...Object.getOwnPropertySymbols(a));for(const c of l)_t(c)||Ne(r,c)||(t[c]=n[c],r[c]=!0);a=s}return t},tt=(n=>e=>{const t=Ao.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),se=n=>(n=n.toLowerCase(),e=>tt(e)===n),$e=n=>e=>typeof e===n,{isArray:me}=Array,ge=$e("undefined");function _e(n){return n!==null&&!ge(n)&&n.constructor!==null&&!ge(n.constructor)&&re(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Rt=se("ArrayBuffer");function No(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&Rt(n.buffer),e}const Lo=$e("string"),re=$e("function"),Ct=$e("number"),Se=n=>n!==null&&typeof n=="object",Bo=n=>n===!0||n===!1,He=n=>{if(!Se(n))return!1;const e=fe(n);return(e===null||e===Object.prototype||fe(e)===null)&&!Le(n,kt)&&!Le(n,Oe)},Po=n=>{if(!Se(n)||_e(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},Do=se("Date"),Fo=se("File"),Io=n=>!!(n&&typeof n.uri<"u"),Vo=n=>n&&typeof n.getParts<"u",Mo=se("Blob"),jo=se("FileList"),Uo=se("Set"),qo=n=>Se(n)&&re(n.pipe);function $o(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const At=$o(),Tt=typeof At.FormData<"u"?At.FormData:void 0,Ho=n=>{if(!n)return!1;if(Tt&&n instanceof Tt)return!0;const e=fe(n);if(!e||e===Object.prototype||!re(n.append))return!1;const t=tt(n);return t==="formdata"||t==="object"&&re(n.toString)&&n.toString()==="[object FormData]"},zo=se("URLSearchParams"),[vo,Wo,Go,Jo]=["ReadableStream","Request","Response","Headers"].map(se),Ko=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Be(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let r,o;if(typeof n!="object"&&(n=[n]),me(n))for(r=0,o=n.length;r<o;r++)e.call(null,n[r],r,n);else{if(_e(n))return;const a=t?Object.getOwnPropertyNames(n):Object.keys(n),s=a.length;let l;for(r=0;r<s;r++)l=a[r],e.call(null,n[l],l,n)}}function xt(n,e){if(_e(n))return null;e=e.toLowerCase();const t=Object.keys(n);let r=t.length,o;for(;r-- >0;)if(o=t[r],e===o.toLowerCase())return o;return null}const ye=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ot=n=>!ge(n)&&n!==ye;function nt(...n){const{caseless:e,skipUndefined:t}=Ot(this)&&this||{},r={},o=(a,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const l=e&&typeof s=="string"&&xt(r,s)||s,c=Ne(r,l)?r[l]:void 0;He(c)&&He(a)?r[l]=nt(c,a):He(a)?r[l]=nt({},a):me(a)?r[l]=a.slice():(!t||!ge(a))&&(r[l]=a)};for(let a=0,s=n.length;a<s;a++){const l=n[a];if(!l||_e(l)||(Be(l,o),typeof l!="object"||me(l)))continue;const c=Object.getOwnPropertySymbols(l);for(let f=0;f<c.length;f++){const d=c[f];as.call(l,d)&&o(l[d],d)}}return r}const Xo=(n,e,t,{allOwnKeys:r}={})=>(Be(e,(o,a)=>{t&&re(o)?Object.defineProperty(n,a,{__proto__:null,value:Et(o,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(n,a,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),n),Qo=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Yo=(n,e,t,r)=>{n.prototype=Object.create(e.prototype,r),Object.defineProperty(n.prototype,"constructor",{__proto__:null,value:n,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(n,"super",{__proto__:null,value:e.prototype}),t&&Object.assign(n.prototype,t)},Zo=(n,e,t,r)=>{let o,a,s;const l={};if(e=e||{},n==null)return e;do{for(o=Object.getOwnPropertyNames(n),a=o.length;a-- >0;)s=o[a],(!r||r(s,n,e))&&!l[s]&&(e[s]=n[s],l[s]=!0);n=t!==!1&&fe(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},es=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const r=n.indexOf(e,t);return r!==-1&&r===t},ts=n=>{if(!n)return null;if(me(n))return n;let e=n.length;if(!Ct(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},ns=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&fe(Uint8Array)),rs=(n,e)=>{const r=(n&&n[Oe]).call(n);let o;for(;(o=r.next())&&!o.done;){const a=o.value;e.call(n,a[0],a[1])}},os=(n,e)=>{let t;const r=[];for(;(t=n.exec(e))!==null;)r.push(t);return r},ss=se("HTMLFormElement"),is=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,o){return r.toUpperCase()+o}),{propertyIsEnumerable:as}=Object.prototype,ls=se("RegExp"),Nt=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),r={};Be(t,(o,a)=>{let s;(s=e(o,a,n))!==!1&&(r[a]=s||o)}),Object.defineProperties(n,r)},cs=n=>{Nt(n,(e,t)=>{if(re(n)&&["arguments","caller","callee"].includes(t))return!1;const r=n[t];if(re(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},ds=(n,e)=>{const t={},r=o=>{o.forEach(a=>{t[a]=!0})};return me(n)?r(n):r(String(n).split(e)),t},us=()=>{},fs=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e;function hs(n){return!!(n&&re(n.append)&&n[kt]==="FormData"&&n[Oe])}const ps=n=>{const e=new WeakSet,t=r=>{if(Se(r)){if(e.has(r))return;if(_e(r))return r;if(!("toJSON"in r)){e.add(r);let o;if(Uo(r)){o=[];for(const a of r){const s=t(a);!ge(s)&&o.push(s)}}else o=me(r)?[]:{},Be(r,(a,s)=>{const l=t(a);!ge(l)&&(o[s]=l)});return e.delete(r),o}}return r};return t(n)},ms=se("AsyncFunction"),gs=n=>n&&(Se(n)||re(n))&&re(n.then)&&re(n.catch),Lt=((n,e)=>n?setImmediate:e?((t,r)=>(ye.addEventListener("message",({source:o,data:a})=>{o===ye&&a===t&&r.length&&r.shift()()},!1),o=>{r.push(o),ye.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",re(ye.postMessage)),ys=typeof queueMicrotask<"u"?queueMicrotask.bind(ye):typeof process<"u"&&process.nextTick||Lt,Bt=n=>n!=null&&re(n[Oe]),u={isArray:me,isArrayBuffer:Rt,isBuffer:_e,isFormData:Ho,isArrayBufferView:No,isString:Lo,isNumber:Ct,isBoolean:Bo,isObject:Se,isPlainObject:He,isEmptyObject:Po,isReadableStream:vo,isRequest:Wo,isResponse:Go,isHeaders:Jo,isUndefined:ge,isDate:Do,isFile:Fo,isReactNativeBlob:Io,isReactNative:Vo,isBlob:Mo,isRegExp:ls,isFunction:re,isStream:qo,isURLSearchParams:zo,isTypedArray:ns,isFileList:jo,forEach:Be,merge:nt,extend:Xo,trim:Ko,stripBOM:Qo,inherits:Yo,toFlatObject:Zo,kindOf:tt,kindOfTest:se,endsWith:es,toArray:ts,forEachEntry:rs,matchAll:os,isHTMLForm:ss,hasOwnProperty:Ne,hasOwnProp:Ne,hasOwnInPrototypeChain:Le,getSafeProp:xo,toSafeFlatObject:Oo,reduceDescriptors:Nt,freezeMethods:cs,toObjectSet:ds,toCamelCase:is,noop:us,toFiniteNumber:fs,findKey:xt,global:ye,isContextDefined:Ot,isSpecCompliantForm:hs,toJSONObject:ps,isAsyncFn:ms,isThenable:gs,setImmediate:Lt,asap:ys,isIterable:Bt,isSafeIterable:n=>n!=null&&Le(n,Oe)&&Bt(n)},bs=u.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ws=n=>{const e={};let t,r,o;return n&&n.split(`
|
|
26
|
+
`).forEach(function(s){o=s.indexOf(":"),t=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim();const l=u.hasOwnProp(e,t);!t||l&&u.hasOwnProp(bs,t)||(t==="set-cookie"?l?e[t].push(r):e[t]=[r]:e[t]=l?e[t]+", "+r:r)}),e};function Es(n){let e=0,t=n.length;for(;e<t;){const r=n.charCodeAt(e);if(r!==9&&r!==32)break;e+=1}for(;t>e;){const r=n.charCodeAt(t-1);if(r!==9&&r!==32)break;t-=1}return e===0&&t===n.length?n:n.slice(e,t)}const ks=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),_s=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function rt(n,e){return u.isArray(n)?n.map(t=>rt(t,e)):Es(String(n).replace(e,""))}const Ss=n=>rt(n,ks),Rs=n=>rt(n,_s);function Pt(n){const e=Object.create(null);return u.forEach(n.toJSON(),(t,r)=>{e[r]=Rs(t)}),e}const Dt=Symbol("internals");function Pe(n){return n&&String(n).trim().toLowerCase()}function ze(n){return n===!1||n==null?n:u.isArray(n)?n.map(ze):Ss(String(n))}function Cs(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(n);)e[r[1]]=r[2];return e}const As=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function ot(n){let e=0,t=n.length;for(;e<t;){const r=n.charCodeAt(e);if(r!==9&&r!==32)break;e+=1}for(;t>e;){const r=n.charCodeAt(t-1);if(r!==9&&r!==32)break;t-=1}return e===0&&t===n.length?n:n.slice(e,t)}function Ts(n){const e=n.length-1;if(e<1||n.charCodeAt(0)!==34||n.charCodeAt(e)!==34)return n;let t="";for(let r=1;r<e;r++){const o=n.charCodeAt(r);if(o===34||o===92&&(r+=1,r>=e))return n;t+=n[r]}return t}function xs(n){const e=Object.create(null),t=String(n);let r=0,o=!1,a=!1;function s(l){const c=ot(t.slice(r,l)),f=c.indexOf("=");if(f<1)return;const d=ot(c.slice(0,f));if(!As.test(d))return;const h=d.toLowerCase();if(h==="__proto__"||h==="constructor"||h==="prototype")return;const p=ot(c.slice(f+1));e[h]=Ts(p)}for(let l=0;l<t.length;l++){const c=t.charCodeAt(l);o?a?a=!1:c===92?a=!0:c===34&&(o=!1):c===34?o=!0:(c===44||c===59)&&(s(l),r=l+1)}return s(t.length),e}const Os=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function st(n,e,t,r,o){if(u.isFunction(r))return r.call(this,e,t);if(o&&(e=t),!!u.isString(e)){if(u.isString(r))return e.indexOf(r)!==-1;if(u.isRegExp(r))return r.test(e)}}function Ns(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function Ls(n,e){const t=u.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(n,r+t,{__proto__:null,value:function(o,a,s){return this[r].call(this,e,o,a,s)},configurable:!0})})}let Y=class{constructor(e){e&&this.set(e)}set(e,t,r){const o=this;function a(l,c,f){const d=Pe(c);if(!d)return;const h=u.findKey(o,d);(!h||o[h]===void 0||f===!0||f===void 0&&o[h]!==!1)&&(o[h||c]=ze(l))}const s=(l,c)=>u.forEach(l,(f,d)=>a(f,d,c));if(u.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(u.isString(e)&&(e=e.trim())&&!Os(e))s(ws(e),t);else if(u.isObject(e)&&u.isSafeIterable(e)){let l=Object.create(null),c,f;for(const d of e){if(!u.isArray(d))throw new TypeError("Object iterator must return a key-value pair");f=d[0],u.hasOwnProp(l,f)?(c=l[f],l[f]=u.isArray(c)?[...c,d[1]]:[c,d[1]]):l[f]=d[1]}s(l,t)}else e!=null&&a(t,e,r);return this}get(e,t){if(e=Pe(e),e){const r=u.findKey(this,e);if(r){const o=this[r];if(!t)return o;if(t===!0)return Cs(o);if(u.isFunction(t))return t.call(this,o,r);if(u.isRegExp(t))return t.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Pe(e),e){const r=u.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||st(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let o=!1;function a(s){if(s=Pe(s),s){const l=u.findKey(r,s);l&&(!t||st(r,r[l],l,t))&&(delete r[l],o=!0)}}return u.isArray(e)?e.forEach(a):a(e),o}clear(e){const t=Object.keys(this);let r=t.length,o=!1;for(;r--;){const a=t[r];(!e||st(this,this[a],a,e,!0))&&(delete this[a],o=!0)}return o}normalize(e){const t=this,r={};return u.forEach(this,(o,a)=>{const s=u.findKey(r,a);if(s){t[s]=ze(o),delete t[a];return}const l=e?Ns(a):String(a).trim();l!==a&&delete t[a],t[l]=ze(o),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return u.forEach(this,(r,o)=>{r!=null&&r!==!1&&(t[o]=e&&u.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
|
27
|
+
`)}getSetCookie(){const e=this.get("set-cookie");return u.isArray(e)?e:e==null||e===!1?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return xs(e)}static concat(e,...t){const r=new this(e);return t.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[Dt]=this[Dt]={accessors:{}}).accessors,o=this.prototype;function a(s){const l=Pe(s);r[l]||(Ls(o,s),r[l]=!0)}return u.isArray(e)?e.forEach(a):a(e),this}};Y.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),u.reduceDescriptors(Y.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(r){this[t]=r}}}),u.freezeMethods(Y);const ve="[REDACTED ****]";function Bs(n){if(u.hasOwnProp(n,"toJSON"))return!0;let e=Object.getPrototypeOf(n);for(;e&&e!==Object.prototype;){if(u.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function Ps(n,e){const t=new Set(e.map(a=>String(a).toLowerCase())),r=[],o=a=>{if(a===null||typeof a!="object"||u.isBuffer(a))return a;if(r.indexOf(a)!==-1)return;a instanceof Y&&(a=a.toJSON()),r.push(a);let s;if(u.isArray(a))s=[],a.forEach((l,c)=>{const f=o(l);u.isUndefined(f)||(s[c]=f)});else{if(!u.isPlainObject(a)&&Bs(a))return r.pop(),a;s=Object.create(null);for(const[l,c]of Object.entries(a)){const f=t.has(l.toLowerCase())?ve:o(c);u.isUndefined(f)||(s[l]=f)}}return r.pop(),s};return o(n)}function Ft(n){try{return String(n)}catch{return""}}function Ds(n){return n.errors.map(t=>{try{return t&&t.message?Ft(t.message):Ft(t)}catch{return""}}).filter(Boolean).join("; ")||n.name||"AggregateError"}let C=class Fn extends Error{static from(e,t,r,o,a,s){let l=e.message;!l&&u.isArray(e.errors)&&e.errors.length&&(l=Ds(e));const c=new Fn(l,t||e.code,r,o,a);return Object.defineProperty(c,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),c.name=e.name,e.status!=null&&c.status==null&&(c.status=e.status),s&&Object.assign(c,s),c}constructor(e,t,r,o,a){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),r&&(this.config=r),o&&(this.request=o),a&&(this.response=a,this.status=a.status)}toJSON(){const e=this.config,t=e&&u.hasOwnProp(e,"redact")?e.redact:void 0,r=u.isArray(t)&&t.length>0?Ps(e,t):u.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};C.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",C.ERR_BAD_OPTION="ERR_BAD_OPTION",C.ECONNABORTED="ECONNABORTED",C.ETIMEDOUT="ETIMEDOUT",C.ECONNREFUSED="ECONNREFUSED",C.ERR_NETWORK="ERR_NETWORK",C.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",C.ERR_DEPRECATED="ERR_DEPRECATED",C.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",C.ERR_BAD_REQUEST="ERR_BAD_REQUEST",C.ERR_CANCELED="ERR_CANCELED",C.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",C.ERR_INVALID_URL="ERR_INVALID_URL",C.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Fs=null,It=100;function it(n){return u.isPlainObject(n)||u.isArray(n)}function Vt(n){return u.endsWith(n,"[]")?n.slice(0,-2):n}function at(n,e,t){return n?n.concat(e).map(function(o,a){return o=Vt(o),!t&&a?"["+o+"]":o}).join(t?".":""):e}function Is(n){return u.isArray(n)&&!n.some(it)}const Vs=u.toFlatObject(u,{},null,function(e){return/^is[A-Z]/.test(e)});function We(n,e,t){if(!u.isObject(n))throw new TypeError("target must be an object");e=e||new FormData;const r=(T,N)=>{const x=u.getSafeProp(t,T);return u.isUndefined(x)?N:x},o=r("metaTokens",!0),a=r("visitor")||O,s=r("dots",!1),l=r("indexes",!1),c=r("Blob")||typeof Blob<"u"&&Blob,f=r("maxDepth",It),d=c&&u.isSpecCompliantForm(e),h=[];if(!u.isFunction(a))throw new TypeError("visitor must be a function");function p(T){if(T===null)return"";if(u.isDate(T))return T.toISOString();if(u.isBoolean(T))return T.toString();if(!d&&u.isBlob(T))throw new C("Blob is not supported. Use a Buffer instead.");if(u.isArrayBuffer(T)||u.isTypedArray(T)){if(d&&typeof c=="function")return new c([T]);throw new C("Blob is not supported. Use a Buffer instead.",C.ERR_NOT_SUPPORT)}return T}function m(T){if(T>f)throw new C("Object is too deeply nested ("+T+" levels). Max depth: "+f,C.ERR_FORM_DATA_DEPTH_EXCEEDED)}function E(T,N){if(f===1/0)return JSON.stringify(T);const x=[];return JSON.stringify(T,function(j,q){if(!u.isObject(q))return q;for(;x.length&&x[x.length-1]!==this;)x.pop();return x.push(q),m(N+x.length-1),q})}function O(T,N,x){let D=T;if(u.isReactNative(e)&&u.isReactNativeBlob(T))return e.append(at(x,N,s),p(T)),!1;if(T&&!x&&typeof T=="object"){if(u.endsWith(N,"{}"))N=o?N:N.slice(0,-2),T=E(T,1);else if(u.isArray(T)&&Is(T)||(u.isFileList(T)||u.endsWith(N,"[]"))&&(D=u.toArray(T)))return N=Vt(N),D.forEach(function(q,ee){!(u.isUndefined(q)||q===null)&&e.append(l===!0?at([N],ee,s):l===null?N:N+"[]",p(q))}),!1}return it(T)?!0:(e.append(at(x,N,s),p(T)),!1)}const I=Object.assign(Vs,{defaultVisitor:O,convertValue:p,isVisitable:it});function b(T,N,x=0){if(!u.isUndefined(T)){if(m(x),h.indexOf(T)!==-1)throw new Error("Circular reference detected in "+N.join("."));h.push(T),u.forEach(T,function(j,q){(!(u.isUndefined(j)||j===null)&&a.call(e,j,u.isString(q)?q.trim():q,N,I))===!0&&b(j,N?N.concat(q):[q],x+1)}),h.pop()}}if(!u.isObject(n))throw new TypeError("data must be an object");return b(n),e}function Mt(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(n).replace(/[!'()~]|%20/g,function(r){return e[r]})}function lt(n,e){this._pairs=[],n&&We(n,this,e)}const jt=lt.prototype;jt.append=function(e,t){this._pairs.push([e,t])},jt.toString=function(e){const t=e?r=>e.call(this,r,Mt):Mt;return this._pairs.map(function(o){return t(o[0])+"="+t(o[1])},"").join("&")};function Ms(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ut(n,e,t){if(!e)return n;n=n||"";const r=u.isFunction(t)?{serialize:t}:t,o=u.getSafeProp(r,"encode")||Ms,a=u.getSafeProp(r,"serialize");let s;if(a?s=a(e,r):s=u.isURLSearchParams(e)?e.toString():new lt(e,r).toString(o),s){const l=n.indexOf("#");l!==-1&&(n=n.slice(0,l)),n+=(n.indexOf("?")===-1?"?":"&")+s}return n}const De=Symbol("internals");function qt(n){return n?n.length:0}function $t(n){if(n)for(;n.length&&n[n.length-1]===null;)n.pop()}function Fe(n,e){const t=n.handlers,r=qt(t);t!==e.handlersRef?(e.handlersRef=t,e.handlerEntries.clear()):r!==e.handlersLength&&(r?e.handlerEntries.forEach(function(a,s){t[a.index]!==a.handler&&e.handlerEntries.delete(s)}):e.handlerEntries.clear()),e.handlersLength=r}class Ht{constructor(){this.handlers=[],this[De]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,r){const o={fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null},a=this[De];this.handlers==null&&(this.handlers=[]),Fe(this,a);const s=a.nextId++;return this.handlers.push(o),a.handlerEntries.set(s,{handler:o,index:this.handlers.length-1}),a.handlersLength=this.handlers.length,s}eject(e){const t=this[De];Fe(this,t);const r=t.handlerEntries.get(e);if(r){if(t.handlerEntries.delete(e),this.handlers[r.index]!==r.handler)return;this.handlers[r.index]=null,t.iterationDepth||($t(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Fe(this,this[De]))}forEach(e){const t=this[De];Fe(this,t),t.iterationDepth++;try{u.forEach(this.handlers,function(o){o!==null&&e(o)})}finally{--t.iterationDepth||(Fe(this,t),$t(this.handlers),t.handlersLength=qt(this.handlers))}}}const ct={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},js={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:lt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},dt=typeof window<"u"&&typeof document<"u",ut=typeof navigator=="object"&&navigator||void 0,Us=dt&&(!ut||["ReactNative","NativeScript","NS"].indexOf(ut.product)<0),qs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$s=dt&&window.location.href||"http://localhost",Q={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:dt,hasStandardBrowserEnv:Us,hasStandardBrowserWebWorkerEnv:qs,navigator:ut,origin:$s},Symbol.toStringTag,{value:"Module"})),...js};function Hs(n,e){return We(n,new Q.classes.URLSearchParams,{visitor:function(t,r,o,a){return Q.isNode&&u.isBuffer(t)?(this.append(r,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...e})}const zt=It;function vt(n){if(n>zt)throw new C("FormData field is too deeply nested ("+n+" levels). Max depth: "+zt,C.ERR_FORM_DATA_DEPTH_EXCEEDED)}function zs(n){const e=[],t=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;(r=t.exec(n))!==null;)vt(e.length),e.push(r[0]==="[]"?"":r[1]||r[0]);return e}function vs(n){const e={},t=Object.keys(n);let r;const o=t.length;let a;for(r=0;r<o;r++)a=t[r],e[a]=n[a];return e}function Wt(n){function e(t,r,o,a){vt(a);let s=t[a++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=a>=t.length;return s=!s&&u.isArray(o)?o.length:s,c?(u.hasOwnProp(o,s)?o[s]=u.isArray(o[s])?o[s].concat(r):[o[s],r]:o[s]=r,!l):((!u.hasOwnProp(o,s)||!u.isObject(o[s]))&&(o[s]=[]),e(t,r,o[s],a)&&u.isArray(o[s])&&(o[s]=vs(o[s])),!l)}if(u.isFormData(n)&&u.isFunction(n.entries)){const t={};return u.forEachEntry(n,(r,o)=>{e(zs(r),o,t,0)}),t}return null}const Gt=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Re=(n,e)=>n!=null&&u.hasOwnProp(n,e)?n[e]:void 0;function Ws(n,e,t){if(u.isString(n))try{return(e||JSON.parse)(n),u.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}const Ie={transitional:ct,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",o=r.indexOf("application/json")>-1,a=u.isObject(e);if(a&&u.isHTMLForm(e)&&(e=new FormData(e)),u.isFormData(e))return o?JSON.stringify(Wt(e)):e;if(u.isArrayBuffer(e)||u.isBuffer(e)||u.isStream(e)||u.isFile(e)||u.isBlob(e)||u.isReadableStream(e))return e;if(u.isArrayBufferView(e))return e.buffer;if(u.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(a){const c=Re(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return Hs(e,c).toString();if((l=u.isFileList(e))||r.indexOf("multipart/form-data")>-1){const f=Re(this,"env"),d=f&&f.FormData;return We(l?{"files[]":e}:e,d&&new d,c)}}return a||o?(t.setContentType("application/json",!1),Ws(e)):e}],transformResponse:[function(e){const t=Re(this,"transitional")||Ie.transitional,r=t&&t.forcedJSONParsing,o=Re(this,"responseType"),a=o==="json";if(u.isResponse(e)||u.isReadableStream(e))return e;if(e&&u.isString(e)&&(r&&!o||a)){const l=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,Re(this,"parseReviver"))}catch(c){if(l)throw c.name==="SyntaxError"?C.from(c,C.ERR_BAD_RESPONSE,this,null,Re(this,"response")):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(Gt,n=>{Ie.headers[n]={}});function ft(n,e){const t=this||Ie,r=e||t,o=Y.from(r.headers);let a=r.data;return u.forEach(n,function(l){a=l.call(t,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function Jt(n){return!!(n&&n.__CANCEL__)}let Ve=class extends C{constructor(e,t,r){super(e??"canceled",C.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function Kt(n,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new C("Request failed with status code "+t.status,t.status>=400&&t.status<500?C.ERR_BAD_REQUEST:C.ERR_BAD_RESPONSE,t.config,t.request,t))}const Gs=/[\t\n\r]/g;function Xt(n){if(typeof n!="string")return n;let e=0;for(;e<n.length&&n.charCodeAt(e)<=32;)e++;return n.slice(e).replace(Gs,"")}function ht(n){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n);return e&&e[1]||""}function Js(n,e){n=n||10;const t=new Array(n),r=new Array(n);let o=0,a=0,s;return e=e!==void 0?e:1e3,function(c){const f=Date.now(),d=r[a];s||(s=f),t[o]=c,r[o]=f;let h=a,p=0;for(;h!==o;)p+=t[h++],h=h%n;if(o=(o+1)%n,o===a&&(a=(a+1)%n),f-s<e)return;const m=d&&f-d;return m?Math.round(p*1e3/m):void 0}}function Ks(n,e){let t=0,r=1e3/e,o,a;const s=(d,h=Date.now())=>{t=h,o=null,a&&(clearTimeout(a),a=null),n(...d)};return[(...d)=>{const h=Date.now(),p=h-t;p>=r?s(d,h):(o=d,a||(a=setTimeout(()=>{a=null,s(o)},r-p)))},()=>o&&s(o),(...d)=>s(d)]}const Ge=(n,e,t=3)=>{let r=0;const o=Js(50,250);return Ks(a=>{if(!a||!u.isNumber(a.loaded))return;const s=a.loaded,l=a.lengthComputable?a.total:void 0,c=Math.max(0,l!=null?Math.min(s,l):s),f=Math.max(0,c-r),d=o(f);r=Math.max(r,c);const h={loaded:c,total:l,progress:l?c/l:void 0,bytes:f,rate:d||void 0,estimated:d&&l?(l-c)/d:void 0,event:a,lengthComputable:l!=null,[e?"download":"upload"]:!0};n(h)},t)},Qt=(n,e)=>{const t=n!=null;return[r=>e[0]({lengthComputable:t,total:n,loaded:r}),e[1]]},Yt=(n,e=u.asap)=>(...t)=>e(()=>n(...t)),Xs=Q.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,Q.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(Q.origin),Q.navigator&&/(msie|trident)/i.test(Q.navigator.userAgent)):()=>!0,Qs=Q.hasStandardBrowserEnv?{write(n,e,t,r,o,a,s){if(typeof document>"u")return;const l=[`${n}=${encodeURIComponent(e)}`];u.isNumber(t)&&l.push(`expires=${new Date(t).toUTCString()}`),u.isString(r)&&l.push(`path=${r}`),u.isString(o)&&l.push(`domain=${o}`),a===!0&&l.push("secure"),u.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(n){if(typeof document>"u")return null;const e=document.cookie.split(";");for(let t=0;t<e.length;t++){const r=e[t].replace(/^\s+/,""),o=r.indexOf("=");if(o!==-1&&r.slice(0,o)===n)try{return decodeURIComponent(r.slice(o+1))}catch{return r.slice(o+1)}}return null},remove(n){this.write(n,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ys(n){return typeof n!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function Zs(n,e){if(!e)return n;let t=n.length;for(;t>0&&n.charCodeAt(t-1)===47;)t--;return n.slice(0,t)+"/"+e.replace(/^\/+/,"")}const ei=/^https?:(?!\/\/)/i;function ti(n){return n&&n.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,r="")=>`${t}${r}${ve}`)}function ni(n){const e=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${ve}@`),t=e.indexOf("#"),o=(t===-1?e:e.slice(0,t)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${ve}`);return t===-1?o:`${o}#${ti(e.slice(t+1))}`}function Zt(n,e){if(typeof n=="string"){const t=Xt(n);if(ei.test(t))throw new C(`Invalid URL ${JSON.stringify(ni(t))}: missing "//" after protocol`,C.ERR_INVALID_URL,e)}}function en(n,e,t,r){Zt(e,r);let o=!Ys(e);return n&&(o||t===!1)?(Zt(n,r),Zs(n,e)):e}const tn=n=>n instanceof Y?{...n}:n,ri=n=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(n).concat(Object.getOwnPropertySymbols(n).filter(e=>Object.getOwnPropertyDescriptor(n,e).enumerable)):Object.keys(n);function be(n,e){n=n||{},e=e||{};const t=Object.create(null);Object.defineProperty(t,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(d,h,p,m){return u.isPlainObject(d)&&u.isPlainObject(h)?u.merge.call({caseless:m},d,h):u.isPlainObject(h)?u.merge({},h):u.isArray(h)?h.slice():h}function o(d,h,p,m){if(u.isUndefined(h)){if(!u.isUndefined(d))return r(void 0,d,p,m)}else return r(d,h,p,m)}function a(d,h){if(!u.isUndefined(h))return r(void 0,h)}function s(d,h){if(u.isUndefined(h)){if(!u.isUndefined(d))return r(void 0,d)}else return r(void 0,h)}function l(d){const h=u.hasOwnProp(e,"transitional")?e.transitional:void 0;if(!u.isUndefined(h))if(u.isPlainObject(h)){if(u.hasOwnProp(h,d))return h[d]}else return;const p=u.hasOwnProp(n,"transitional")?n.transitional:void 0;if(u.isPlainObject(p)&&u.hasOwnProp(p,d))return p[d]}function c(d,h,p){if(u.hasOwnProp(e,p))return r(d,h);if(u.hasOwnProp(n,p))return r(void 0,d)}const f={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutErrorMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:c,headers:(d,h,p)=>o(tn(d),tn(h),p,!0)};return u.forEach(ri({...n,...e}),function(h){if(h==="__proto__"||h==="constructor"||h==="prototype")return;const p=u.hasOwnProp(f,h)?f[h]:o,m=u.hasOwnProp(n,h)?n[h]:void 0,E=u.hasOwnProp(e,h)?e[h]:void 0,O=p(m,E,h);u.isUndefined(O)&&p!==c||(t[h]=O)}),u.hasOwnProp(e,"validateStatus")&&u.isUndefined(e.validateStatus)&&l("validateStatusUndefinedResolves")===!1&&(u.hasOwnProp(n,"validateStatus")?t.validateStatus=r(void 0,n.validateStatus):delete t.validateStatus),t}const oi=["content-type","content-length"];function si(n,e,t){if(t!=="content-only"){n.set(e);return}Object.entries(e||{}).forEach(([r,o])=>{oi.includes(r.toLowerCase())&&n.set(r,o)})}const ii=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)));function nn(n){const e=be({},n),t=p=>u.hasOwnProp(e,p)?e[p]:void 0,r=t("data");let o=t("withXSRFToken");const a=t("xsrfHeaderName"),s=t("xsrfCookieName");let l=t("headers");const c=t("auth"),f=t("baseURL"),d=t("allowAbsoluteUrls"),h=t("url");if(e.headers=l=Y.from(l),e.url=Ut(en(f,h,d,e),t("params"),t("paramsSerializer")),c){const p=u.getSafeProp(c,"username")||"",m=u.getSafeProp(c,"password")||"";try{l.set("Authorization","Basic "+btoa(p+":"+(m?ii(m):"")))}catch(E){throw C.from(E,C.ERR_BAD_OPTION_VALUE,n)}}if(u.isFormData(r)){const p=u.getSafeProp(r,"getHeaders");Q.hasStandardBrowserEnv||Q.hasStandardBrowserWebWorkerEnv||u.isReactNative(r)?l.setContentType(void 0):u.isFunction(p)&&si(l,p.call(r),t("formDataHeaderPolicy"))}if(Q.hasStandardBrowserEnv&&(u.isFunction(o)&&(o=o(e)),o===!0||o==null&&Xs(e.url))){const m=a&&s&&Qs.read(s);m&&l.set(a,m)}return e}const ai=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(t,r){const o=nn(n);let a=o.data;const s=Y.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:f}=o,d,h,p,m,E,O;function I(){m&&m(),E&&E(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function T(x){if(!b)return;if(b.status===0&&(ht(Xt(o.url))||ht(Q.origin))!=="file"&&!(b.responseURL&&b.responseURL.startsWith("file:"))){r(new C("Request aborted",C.ECONNABORTED,n,b)),I(),b=null;return}try{x?O&&O(x):E&&E()}catch(ee){setTimeout(()=>{throw ee})}if(!b)return;const D=Y.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),q={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:D,config:n,request:b};Kt(function(R){t(R),I()},function(R){r(R),I()},q),b=null}"onloadend"in b?b.onloadend=T:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(T)},b.onabort=function(){b&&(r(new C("Request aborted",C.ECONNABORTED,n,b)),I(),b=null)},b.onerror=function(D){const j=D&&D.message?D.message:"Network Error",q=new C(j,C.ERR_NETWORK,n,b);q.event=D||null,r(q),I(),b=null},b.ontimeout=function(){let D=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const j=o.transitional||ct;o.timeoutErrorMessage&&(D=o.timeoutErrorMessage),r(new C(D,j.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,n,b)),I(),b=null},a===void 0&&s.setContentType(null),"setRequestHeader"in b&&u.forEach(Pt(s),function(D,j){b.setRequestHeader(j,D)}),u.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),l&&l!=="json"&&(b.responseType=o.responseType),f&&([p,E,O]=Ge(f,!0),b.addEventListener("progress",p)),c&&b.upload&&([h,m]=Ge(c),b.upload.addEventListener("progress",h),b.upload.addEventListener("loadend",m)),(o.cancelToken||o.signal)&&(d=x=>{b&&(r(!x||x.type?new Ve(null,n,b):x),b.abort(),I(),b=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const N=ht(o.url);if(N&&!Q.protocols.includes(N)){r(new C("Unsupported protocol "+N+":",C.ERR_BAD_REQUEST,n)),I();return}b.send(a||null)})},li=(n,e)=>{if(n=n?n.filter(Boolean):[],!e&&!n.length)return;const t=new AbortController;let r=!1;const o=function(c){if(!r){r=!0,s();const f=c instanceof Error?c:this.reason;t.abort(f instanceof C?f:new Ve(f instanceof Error?f.message:f))}};let a=e&&setTimeout(()=>{a=null,o(new C(`timeout of ${e}ms exceeded`,C.ETIMEDOUT))},e);const s=()=>{n&&(a&&clearTimeout(a),a=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),n=null)};n.forEach(c=>{if(!r){if(c.aborted){o.call(c);return}c.addEventListener("abort",o,{once:!0})}});const{signal:l}=t;return l.unsubscribe=()=>u.asap(s),l},ci=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let r=0,o;for(;r<t;)o=r+e,yield n.slice(r,o),r=o},di=async function*(n,e){for await(const t of ui(n))yield*ci(t,e)},ui=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},rn=(n,e,t,r)=>{const o=di(n,e);let a=0,s,l=c=>{s||(s=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:d}=await o.next();if(f){l(),c.close();return}let h=d.byteLength;if(t){let p=a+=h;t(p)}c.enqueue(new Uint8Array(d))}catch(f){throw l(f),f}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},on=n=>n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102,sn=(n,e,t)=>e+2<t&&on(n.charCodeAt(e+1))&&on(n.charCodeAt(e+2)),an=n=>n<=57?n-48:(n&223)-55,fi=n=>n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===43||n===47||n===45||n===95,hi=n=>n===9||n===10||n===12||n===13||n===32,pi=n=>{const e=Math.floor(n/4),t=n%4;return e*3+(t===2?1:t===3?2:0)},mi=n=>{const e=n.length;let t=0;return e>0&&n.charCodeAt(e-1)===61&&(t++,e>1&&n.charCodeAt(e-2)===61&&t++),Math.floor((e-t)*3/4)},gi=n=>{const e=n.length;let t=0,r=0,o=!1;for(let a=0;a<e;a++){let s=n.charCodeAt(a);if(s===37&&sn(n,a,e)&&(s=an(n.charCodeAt(a+1))*16+an(n.charCodeAt(a+2)),a+=2),!hi(s)){if(s===61){r++;continue}if(!fi(s)||r>0){o=!0;continue}t++}}return o||r>2||r>0&&(t+r)%4!==0||t%4===1?mi(n):pi(t)},yi=(n,e)=>{if(!n||typeof n!="string"||!n.startsWith("data:"))return 0;const t=n.indexOf(",");if(t<0)return 0;const r=n.slice(5,t),o=n.slice(t+1);if(/;base64/i.test(r))return e(o);let s=0;for(let l=0,c=o.length;l<c;l++){const f=o.charCodeAt(l);if(f===37&&sn(o,l,c))s+=1,l+=2;else if(f<128)s+=1;else if(f<2048)s+=2;else if(f>=55296&&f<=56319&&l+1<c){const d=o.charCodeAt(l+1);d>=56320&&d<=57343?(s+=4,l++):s+=3}else s+=3}return s};function bi(n){const e=typeof n=="string"?n.indexOf("#"):-1;return yi(e===-1?n:n.slice(0,e),gi)}const pt="1.20.0",ln=64*1024,wi={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:Je}=u,Ei=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),cn=n=>{if(!u.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},dn=(n,...e)=>{try{return!!n(...e)}catch{return!1}},ki=n=>{const e=n.indexOf("://");let t=n;return e!==-1&&(t=t.slice(e+3)),t.includes("@")||t.includes(":")},_i=n=>{const e=u.global!==void 0&&u.global!==null?u.global:globalThis,{ReadableStream:t,TextEncoder:r}=e;n=u.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},n);const{fetch:o,Request:a,Response:s}=n,l=o?Je(o):typeof fetch=="function",c=Je(a),f=Je(s);if(!l)return!1;const d=l&&Je(t),h=l&&(typeof r=="function"?(b=>T=>b.encode(T))(new r):async b=>new Uint8Array(await new a(b).arrayBuffer())),p=c&&d&&dn(()=>{let b=!1;const T=new a(Q.origin,{body:new t,method:"POST",get duplex(){return b=!0,"half"}}),N=T.headers.has("Content-Type");return T.body!=null&&T.body.cancel(),b&&!N}),m=f&&d&&dn(()=>u.isReadableStream(new s("").body)),E={stream:m&&(b=>b.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!E[b]&&(E[b]=(T,N)=>{let x=T&&T[b];if(x)return x.call(T);throw new C(`Response type '${b}' is not supported`,C.ERR_NOT_SUPPORT,N)})});const O=async b=>{if(b==null)return 0;if(u.isBlob(b))return b.size;if(u.isSpecCompliantForm(b))return(await new a(Q.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(u.isArrayBufferView(b)||u.isArrayBuffer(b))return b.byteLength;if(u.isURLSearchParams(b)&&(b=b+""),u.isString(b))return(await h(b)).byteLength},I=async(b,T)=>{const N=u.toFiniteNumber(b.getContentLength());return N??O(T)};return async b=>{let{url:T,method:N,data:x,signal:D,cancelToken:j,timeout:q,onDownloadProgress:ee,onUploadProgress:R,responseType:w,headers:_,withCredentials:L="same-origin",fetchOptions:V,maxContentLength:F,maxBodyLength:M,maxRedirects:U}=nn(b);const H=u.isNumber(F)&&F>-1,K=u.isNumber(M)&&M>-1,te=k=>u.hasOwnProp(b,k)?b[k]:void 0;let ne=o||fetch;w=w?(w+"").toLowerCase():"text";let W=li([D,j&&j.toAbortSignal()],q),$=null;const g=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let y,S=null;const A=()=>new C("Request body larger than maxBodyLength limit",C.ERR_BAD_REQUEST,b,$);try{let k;const P=te("auth");if(P){const B=u.getSafeProp(P,"username")||"",X=u.getSafeProp(P,"password")||"";k={username:B,password:X}}if(ki(T)){const B=new URL(T,Q.origin);if(!k&&(B.username||B.password)){const X=cn(B.username),ce=cn(B.password);k={username:X,password:ce}}(B.username||B.password)&&(B.username="",B.password="",T=B.href)}if(k&&(_.delete("authorization"),_.set("Authorization","Basic "+btoa(Ei((k.username||"")+":"+(k.password||""))))),H&&typeof T=="string"&&T.startsWith("data:")&&bi(T)>F)throw new C("maxContentLength size of "+F+" exceeded",C.ERR_BAD_RESPONSE,b,$);if(K&&N!=="get"&&N!=="head"){const B=await O(x);if(typeof B=="number"&&isFinite(B)&&(y=B,B>M))throw A()}const G=K&&(u.isReadableStream(x)||u.isStream(x)),de=(B,X,ce)=>rn(B,ln,ue=>{if(K&&ue>M)throw S=A();X&&X(ue)},ce);if(p&&N!=="get"&&N!=="head"&&(R||G)){if(y=y??await I(_,x),y!==0||G){let B=new a(T,{method:"POST",body:x,duplex:"half"}),X;if(u.isFormData(x)&&(X=B.headers.get("content-type"))&&_.setContentType(X),B.body){const[ce,ue]=R&&Qt(y,Ge(Yt(R)))||[];x=de(B.body,ce,ue)}}}else if(G&&!c&&d&&N!=="get"&&N!=="head")x=de(x);else if(G&&c&&!p&&N!=="get"&&N!=="head")throw new C("Stream request bodies are not supported by the current fetch implementation",C.ERR_NOT_SUPPORT,b,$);u.isString(L)||(L=L?"include":"omit");const Ce=c&&"credentials"in a.prototype;if(u.isFormData(x)){const B=_.getContentType();B&&/^multipart\/form-data/i.test(B)&&!/boundary=/i.test(B)&&_.delete("content-type")}_.set("User-Agent","axios/"+pt,!1);const J=V==null?V:Object.assign(Object.create(null),V);J&&(delete J.body,delete J.headers,delete J.method,delete J.signal,delete J.duplex,delete J.credentials);const ie=Object.assign(Object.create(null),J,{signal:W,method:N.toUpperCase(),headers:Pt(_.normalize()),body:x,duplex:"half",credentials:Ce?L:void 0});c&&(u.forEach(wi,(B,X)=>{ie[X]===void 0&&(ie[X]=B)}),ie.signal===void 0&&(ie.signal=null),ie.body===void 0&&(ie.body=null)),U===0&&(ie.redirect="manual",J&&(J.redirect="manual")),$=c&&new a(T,ie);let ae=await(c?ne($,J):ne(T,ie));const Me=Y.from(ae.headers);if(H){const B=u.toFiniteNumber(Me.getContentLength());if(B!=null&&B>F)throw new C("maxContentLength size of "+F+" exceeded",C.ERR_BAD_RESPONSE,b,$)}const Ae=m&&(w==="stream"||w==="response");if(m&&ae.body&&(ee||H||Ae&&g)){const B={};["status","statusText","headers"].forEach(he=>{B[he]=ae[he]});const X=u.toFiniteNumber(Me.getContentLength()),[ce,ue]=ee&&Qt(X,Ge(Yt(ee),!0))||[];let je=0;const Ye=he=>{if(H&&(je=he,je>F))throw new C("maxContentLength size of "+F+" exceeded",C.ERR_BAD_RESPONSE,b,$);ce&&ce(he)};ae=new s(rn(ae.body,ln,Ye,()=>{ue&&ue(),g&&g()}),B)}w=w||"text";let le=await E[u.findKey(E,w)||"text"](ae,b);if(H&&!m&&!Ae){let B;if(le!=null&&(typeof le.byteLength=="number"?B=le.byteLength:typeof le.size=="number"?B=le.size:typeof le=="string"&&(B=typeof r=="function"?new r().encode(le).byteLength:le.length)),typeof B=="number"&&B>F)throw new C("maxContentLength size of "+F+" exceeded",C.ERR_BAD_RESPONSE,b,$)}return!Ae&&g&&g(),await new Promise((B,X)=>{Kt(B,X,{data:le,headers:Y.from(ae.headers),status:ae.status,statusText:ae.statusText,config:b,request:$})})}catch(k){if(g&&g(),W&&W.aborted&&W.reason instanceof C){const P=W.reason;throw P.config=b,$&&(P.request=$),k!==P&&Object.defineProperty(P,"cause",{__proto__:null,value:k,writable:!0,enumerable:!1,configurable:!0}),P}if(S)throw $&&!S.request&&(S.request=$),S;if(k instanceof C)throw $&&!k.request&&(k.request=$),k;if(k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)){const P=new C("Network Error",C.ERR_NETWORK,b,$,k&&k.response);throw Object.defineProperty(P,"cause",{__proto__:null,value:k.cause||k,writable:!0,enumerable:!1,configurable:!0}),P}throw C.from(k,k&&k.code,b,$,k&&k.response)}}},Si=new Map,un=n=>{let e=n&&n.env||{};const{fetch:t,Request:r,Response:o}=e,a=[r,o,t];let s=a.length,l=s,c,f,d=Si;for(;l--;)c=a[l],f=d.get(c),f===void 0&&d.set(c,f=l?new Map:_i(e)),d=f;return f};un();const mt={http:Fs,xhr:ai,fetch:{get:un}};u.forEach(mt,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(n,"adapterName",{__proto__:null,value:e})}});const fn=n=>`- ${n}`,Ri=n=>u.isFunction(n)||n===null||n===!1;function Ci(n,e){n=u.isArray(n)?n:[n];const{length:t}=n;let r,o;const a={};for(let s=0;s<t;s++){r=n[s];let l;if(o=r,!Ri(r)&&(o=mt[(l=String(r)).toLowerCase()],o===void 0))throw new C(`Unknown adapter '${l}'`);if(o&&(u.isFunction(o)||(o=o.get(e))))break;a[l||"#"+s]=o}if(!o){const s=Object.entries(a).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=t?s.length>1?`since :
|
|
28
|
+
`+s.map(fn).join(`
|
|
29
|
+
`):" "+fn(s[0]):"as no adapter specified";throw new C("There is no suitable adapter to dispatch the request "+l,C.ERR_NOT_SUPPORT)}return o}const hn={getAdapter:Ci,adapters:mt};function gt(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ve(null,n)}function yt(n){const e=u.toSafeFlatObject(n);return gt(e),e.headers=Y.from(u.getSafeProp(e,"headers")),e.data=ft.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),hn.getAdapter(e.adapter||Ie.adapter,e)(e).then(function(o){gt(e),e.response=o;try{o.data=ft.call(e,e.transformResponse,o)}finally{delete e.response}return o.headers=Y.from(o.headers),o},function(o){if(!Jt(o)&&(gt(e),o&&o.response)){e.response=o.response;try{o.response.data=ft.call(e,e.transformResponse,o.response)}finally{delete e.response}o.response.headers=Y.from(o.response.headers)}return Promise.reject(o)})}const Ke={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Ke[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});const pn={};Ke.transitional=function(e,t,r){function o(a,s){return"[Axios v"+pt+"] Transitional option '"+a+"'"+s+(r?". "+r:"")}return(a,s,l)=>{if(e===!1)throw new C(o(s," has been removed"+(t?" in "+t:"")),C.ERR_DEPRECATED);return t&&!pn[s]&&(pn[s]=!0,console.warn(o(s," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,s,l):!0}},Ke.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Ai(n,e,t){if(typeof n!="object"||n===null)throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let o=r.length;for(;o-- >0;){const a=r[o],s=Object.prototype.hasOwnProperty.call(e,a)?e[a]:void 0;if(s){const l=n[a],c=l===void 0||s(l,a,n);if(c!==!0)throw new C("option "+a+" must be "+c,C.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new C("Unknown option "+a,C.ERR_BAD_OPTION)}}const Xe={assertOptions:Ai,validators:Ke},Z=Xe.validators;let we=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ht,response:new Ht}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error)try{let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const a=o.stack;let s="";if(typeof a=="string"){const l=a.indexOf(`
|
|
30
|
+
`);s=l===-1?"":a.slice(l+1)}if(!r.stack)r.stack=s;else if(s){const l=s.indexOf(`
|
|
31
|
+
`),c=l===-1?-1:s.indexOf(`
|
|
32
|
+
`,l+1),f=c===-1?"":s.slice(c+1);String(r.stack).endsWith(f)||(r.stack+=`
|
|
33
|
+
`+s)}}catch{}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=be(this.defaults,t);const{transitional:r,paramsSerializer:o,headers:a}=t;r!==void 0&&Xe.assertOptions(r,{silentJSONParsing:Z.transitional(Z.boolean),forcedJSONParsing:Z.transitional(Z.boolean),clarifyTimeoutError:Z.transitional(Z.boolean),legacyInterceptorReqResOrdering:Z.transitional(Z.boolean),advertiseZstdAcceptEncoding:Z.transitional(Z.boolean),validateStatusUndefinedResolves:Z.transitional(Z.boolean)},!1),o!=null&&(u.isFunction(o)?t.paramsSerializer={serialize:o}:Xe.assertOptions(o,{encode:Z.function,serialize:Z.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Xe.assertOptions(t,{baseUrl:Z.spelling("baseURL"),withXsrfToken:Z.spelling("withXSRFToken")},!0),t.method=(u.getSafeProp(t,"method")||u.getSafeProp(this.defaults,"method")||"get").toLowerCase();let s=a&&u.merge(a.common,a[t.method]);a&&u.forEach(Gt.concat("common"),E=>{delete a[E]}),t.headers=Y.concat(s,a);const l=[];let c=!0;this.interceptors.request.forEach(function(O){if(typeof O.runWhen=="function"&&O.runWhen(t)===!1)return;c=c&&O.synchronous;const I=t.transitional||ct;I&&I.legacyInterceptorReqResOrdering?l.unshift(O.fulfilled,O.rejected):l.push(O.fulfilled,O.rejected)});const f=[];this.interceptors.response.forEach(function(O){f.push(O.fulfilled,O.rejected)});let d,h=0,p;if(!c){const E=[yt.bind(this),void 0];for(E.unshift(...l),E.push(...f),p=E.length,d=Promise.resolve(t);h<p;)d=d.then(E[h++],E[h++]);return d}p=l.length;let m=t;for(;h<p;){const E=l[h++],O=l[h++];try{m=E?E(m):m}catch(I){if(!O){d=Promise.reject(I);break}try{const b=O.call(this,I);u.isThenable(b)&&(d=Promise.resolve(b).then(()=>yt.call(this,m)))}catch(b){d=Promise.reject(b)}break}}if(!d)try{d=yt.call(this,m)}catch(E){d=Promise.reject(E)}for(h=0,p=f.length;h<p;)d=d.then(f[h++],f[h++]);return d}getUri(e){e=be(this.defaults,e);const t=en(e.baseURL,e.url,e.allowAbsoluteUrls,e);return Ut(t,e.params,e.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(e){we.prototype[e]=function(t,r){return this.request(be(r||{},{method:e,url:t,data:r&&u.hasOwnProp(r,"data")?r.data:void 0}))}}),u.forEach(["post","put","patch","query"],function(e){function t(r){return function(a,s,l){return this.request(be(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}we.prototype[e]=t(),e!=="query"&&(we.prototype[e+"Form"]=t(!0))});let Ti=class In{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(a){t=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const s=new Promise(l=>{r.subscribe(l),a=l}).then(o);return s.cancel=function(){r.unsubscribe(a)},s},e(function(a,s,l){r.reason||(r.reason=new Ve(a,s,l),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new In(function(o){e=o}),cancel:e}}};function xi(n){return function(t){return n.apply(null,t)}}function Oi(n){return u.isObject(n)&&n.isAxiosError===!0}const Qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Qe).forEach(([n,e])=>{Qe[e]===void 0&&(Qe[e]=n)});function mn(n){const e=new we(n),t=Et(we.prototype.request,e);return u.extend(t,we.prototype,e,{allOwnKeys:!0}),u.extend(t,e,null,{allOwnKeys:!0}),t.create=function(o){return mn(be(n,o))},t}const v=mn(Ie);v.Axios=we,v.CanceledError=Ve,v.CancelToken=Ti,v.isCancel=Jt,v.VERSION=pt,v.toFormData=We,v.AxiosError=C,v.Cancel=v.CanceledError,v.all=function(e){return Promise.all(e)},v.spread=xi,v.isAxiosError=Oi,v.mergeConfig=be,v.AxiosHeaders=Y,v.formToJSON=n=>Wt(u.isHTMLForm(n)?new FormData(n):n),v.getAdapter=hn.getAdapter,v.HttpStatusCode=Qe,v.default=v;const{Axios:Ki,AxiosError:Xi,CanceledError:Qi,isCancel:Yi,CancelToken:Zi,VERSION:ea,all:ta,Cancel:na,isAxiosError:ra,spread:oa,toFormData:sa,AxiosHeaders:ia,HttpStatusCode:aa,formToJSON:la,getAdapter:ca,mergeConfig:da,create:ua}=v;class gn{}function Ni(n){const e=n.split(`
|
|
34
|
+
`),t={};for(let r=1;r<e.length;r++){const o=e[r].trim();if(o){const[a,s]=o.split(",");a&&s&&(t[a]=s)}}return t}async function yn(n="/domain-colors.csv"){try{const e="/",t=e.endsWith("/")?e:e+"/",r=new URL(t+n.replace(/^\//,""),window.location.origin).href,o=await fetch(r);if(!o.ok)return console.warn(`Failed to load PFAM color mapping from ${r}: ${o.status} ${o.statusText}`),{};const a=await o.text();return Ni(a)}catch(e){return console.warn("Failed to load PFAM color mapping:",e),{}}}class Li extends gn{constructor(e={}){super();const t=e.baseURL||"";this.axiosInstance=v.create({baseURL:t})}async loadEntry(e){const t=await this.axiosInstance.post("/api/load-entry",{id:e});return{entryId:e,recordId:t.data.record_id,filename:t.data.filename,fileMetadata:t.data.file_metadata,recordInfo:{description:t.data.record_info.description}}}async getRecords(){throw new Error("getRecords() is not yet implemented in the API")}async searchRecords(e,t=1,r=20){const o={page:t,per_page:r};e.trim()&&(o.search=e.trim());const a=await this.axiosInstance.get("/api/database-entries",{params:o});return{records:a.data.entries.map(l=>({recordId:l.record_id,filename:l.filename,recordInfo:{description:l.description},entryId:l.id,organism:l.organism,products:l.products,clusterTypes:l.cluster_types,featureCount:l.feature_count,regionCount:l.region_count})),total:a.data.total,totalPages:a.data.total_pages,currentPage:a.data.page}}async getRegions(e){const t=e.includes(":")?e.split(":")[1]:e;return(await this.axiosInstance.get(`/api/records/${t}/regions`)).data}async getRecordFeatures(e){const t=e.includes(":")?e.split(":")[1]:e;return(await this.axiosInstance.get(`/api/records/${t}/features`)).data}async getRegionFeatures(e,t){const r=e.includes(":")?e.split(":")[1]:e;return(await this.axiosInstance.get(`/api/records/${r}/regions/${t}/features`)).data}async getPfamColorMap(){return yn()}async getMiBIGEntries(e,t,r="1"){const o=e.includes(":")?e.split(":")[1]:e;return(await this.axiosInstance.get(`/api/records/${o}/mibig-entries/${t}`,{params:{region:r}})).data}async getTFBSHits(e,t="1"){const r=e.includes(":")?e.split(":")[1]:e;return(await this.axiosInstance.get(`/api/records/${r}/tfbs-hits`,{params:{region:t}})).data}async getTTACodons(e){const t=e.includes(":")?e.split(":")[1]:e;return(await this.axiosInstance.get(`/api/records/${t}/tta-codons`)).data}async getResistanceFeatures(e){const t=e.includes(":")?e.split(":")[1]:e;return(await this.axiosInstance.get(`/api/records/${t}/resistance`)).data}}class Bi extends gn{constructor(e={}){super(),this.records=e.records||[],this.pfamColorMap=e.pfamColorMap||{},this.fileMetadata={}}async loadFromFile(e){let t,r;if(e instanceof File){const o=await e.text();t=JSON.parse(o),r=e.name}else if(typeof e=="string")t=await(await fetch(e)).json(),r=e.split("/").pop()||"unknown";else throw new Error("Invalid file parameter");this.parseAntiSMASHData(t,r)}parseAntiSMASHData(e,t){const r=e.records?e.records:[e],o=e.input_file||t;r.forEach(a=>{const s=a.id;a._originalId=s,a._sourceFilename=t,a._inputFile=o,a.id=`${t}:${s}`}),this.records=[...this.records,...r],e.version&&!this.fileMetadata.version&&(this.fileMetadata.version=e.version),e.input_file&&(this.fileMetadata.input_files||(this.fileMetadata.input_files=[]),Array.isArray(this.fileMetadata.input_files)&&this.fileMetadata.input_files.push(e.input_file))}async loadEntry(e){let t=this.records.find(o=>o.id===e);if(!t&&e.includes(":")){const o=e.split(":")[1];t=this.records.find(a=>a.id===o||a._originalId===o)}if(t||(t=this.records.find(o=>o._originalId===e)),!t)throw new Error(`Record ${e} not found`);let r=t._sourceFilename;return!r&&e.includes(":")&&(r=e.split(":")[0]),{entryId:t.id,recordId:t._originalId||t.id,filename:r||"unknown",fileMetadata:{...this.fileMetadata,input_file:t._inputFile||"unknown"},recordInfo:{description:t.description||""}}}async getRecords(){return this.records.map(e=>({recordId:e.id,filename:e._sourceFilename||"unknown.json",recordInfo:{description:e.description||e.definition||""}}))}async searchRecords(e,t=1,r=20){let o=this.records;if(e.trim()){const s=e.toLowerCase().split(/\s+/).filter(l=>l.length>0);o=this.records.filter(l=>{const f=this.extractLeafValues(l).join(" ");return s.every(d=>f.includes(d))})}const a=o.map(s=>{let l=0;return s.regions&&Array.isArray(s.regions)?l=s.regions.length:s.features&&Array.isArray(s.features)&&(l=s.features.filter(c=>c.type==="region").length),{entryId:s.id,recordId:s._originalId||s.id.split(":")[1],filename:s._sourceFilename||"unknown.json",recordInfo:{description:s.description||s.definition||""},featureCount:(s.features||[]).length,regionCount:l}});return{records:a,total:a.length,totalPages:Math.ceil(a.length/r),currentPage:1}}extractLeafValues(e,t=[]){if(e==null)return t;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return t.push(String(e).toLowerCase()),t;if(Array.isArray(e)){for(const r of e)this.extractLeafValues(r,t);return t}if(typeof e=="object"){for(const r of Object.values(e))this.extractLeafValues(r,t);return t}return t}async getRegions(e){const t=this.findRecord(e);if(!t)throw new Error(`Record not found: ${e}`);const r=[];return(t.features||[]).filter(s=>s.type==="region").forEach((s,l)=>{var d,h,p;const c=this.parseLocation(s.location),f=parseInt((h=(d=s.qualifiers)==null?void 0:d.region_number)==null?void 0:h[0])||l+1;r.push({id:`region_${f}`,region_number:f,product:((p=s.qualifiers)==null?void 0:p.product)||[],start:c==null?void 0:c.start,end:c==null?void 0:c.end})}),{regions:r}}async getRecordFeatures(e){const t=this.findRecord(e);if(!t)throw new Error(`Record not found: ${e}`);return{features:t.features||[]}}async getRegionFeatures(e,t){const r=this.findRecord(e);if(!r)throw new Error(`Record not found: ${e}`);const o=r.features||[],a=t.replace("region_",""),s=o.find(f=>{var h,p;if(f.type!=="region")return!1;const d=(p=(h=f.qualifiers)==null?void 0:h.region_number)==null?void 0:p[0];return String(d)===a});if(!s)throw new Error(`Region not found: ${t}`);const l=this.parseLocation(s.location);if(!l)throw new Error(`Invalid region location: ${s.location}`);return{features:o.filter(f=>{const d=this.parseLocation(f.location);return d?!(d.end<l.start||d.start>l.end):!1}),region_boundaries:{start:l.start,end:l.end}}}async getPfamColorMap(){return Object.keys(this.pfamColorMap).length>0?this.pfamColorMap:(this.pfamColorMap=await yn(),this.pfamColorMap)}setPfamColorMap(e){this.pfamColorMap=e}findRecord(e){return this.records.find((t,r)=>(t.id||`record-${r}`)===e)}async getMiBIGEntries(e,t,r="1"){const o=this.findRecord(e);if(!o)throw new Error(`Record not found: ${e}`);const c=(((o.modules||{})["antismash.modules.clusterblast"]||{}).knowncluster||{}).mibig_entries||{};if(!c[r])return{record_id:e,locus_tag:t,region:r,count:0,entries:[]};const f=c[r][t]||[];if(f.length===0)return{record_id:e,locus_tag:t,region:r,count:0,entries:[]};const d=f.map(h=>({mibig_protein:h[0],description:h[1],mibig_cluster:h[2],rank:h[3],mibig_product:h[4],percent_identity:h[5],blast_score:h[6],percent_coverage:h[7],evalue:h[8]}));return{record_id:e,locus_tag:t,region:r,count:d.length,entries:d}}async getTFBSHits(e,t="1"){const r=this.findRecord(e);if(!r)throw new Error(`Record not found: ${e}`);const s=((r.modules||{})["antismash.modules.tfbs_finder"]||{}).hits_by_region||{};if(!s[t])return{record_id:e,region:t,count:0,hits:[]};const l=s[t]||[];return{record_id:e,region:t,count:l.length,hits:l}}async getTTACodons(e){const t=this.findRecord(e);if(!t)throw new Error(`Record not found: ${e}`);const a=((t.modules||{})["antismash.modules.tta"]||{})["TTA codons"]||[];return{record_id:e,count:a.length,codons:a}}async getResistanceFeatures(e){const t=this.findRecord(e);if(!t)throw new Error(`Record not found: ${e}`);const l=((((t.modules||{})["antismash.detection.genefunctions"]||{}).tools||{}).resist||{}).best_hits||{},c=[];for(const[f,d]of Object.entries(l))c.push({locus_tag:f,...d});return{record_id:e,count:c.length,features:c}}parseLocation(e){if(!e)return null;const t=e.match(/\[<?(\d+):>?(\d+)\](?:\(([+-])\))?/);return t?{start:parseInt(t[1]),end:parseInt(t[2]),strand:t[3]||null}:null}}const bn=i.defineCustomElement(Co),wn=i.defineCustomElement(wt);customElements.define("bgc-region-viewer-container",bn),customElements.define("bgc-region-viewer",wn),oe.BGCViewerAPIProvider=Li,oe.JSONFileProvider=Bi,oe.RegionViewer=wn,oe.RegionViewerContainer=bn,oe.TrackViewer=qe,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
|