@genome-spy/app 0.28.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +24 -0
  2. package/dist/index.js +2 -2
  3. package/package.json +4 -3
package/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2018-2022 Kari Lavikka
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/dist/index.js CHANGED
@@ -1343,7 +1343,7 @@ void main() {
1343
1343
  * All rights reserved.
1344
1344
  *
1345
1345
  * BSD-3-Clause License: https://github.com/vega/vega-lite/blob/master/LICENSE
1346
- */const FM="locus",zM="index";var RM=5;function jM(t){const e=t.type;return!t.bins&&(e===Ir||e===ji||e===Ui)}function Bg(t){return Re(t)&&![pt,zM,FM].includes(t)}function Og(t){return t||{warn:(e,...n)=>console.warn(e,...n)}}var UM=sa(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma","zoom","fp64","name"]);function Pg(t,e,n){n=Og(n);for(const r in t)if(!UM[r]){if(r==="padding"&&Bg(e.type))continue;ke(e[r])?e[r](t[r]):n.warn("Unsupported scale property: "+r)}XM(e,t,WM(e,t,VM(e,t,n)))}function HM(t,e){const n=GM(t),r=X(n);if(!r)throw new Error("Unknown scale type: "+n);const i=r();return Pg(t,i,e),i}function GM(t){var e=t.type,n="",r;return e===pt?pt+"-"+Ir:(QM(t)&&(r=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(t.domainMid!=null):0,n=r===2?pt+"-":r===3?kr+"-":""),(n+e||Ir).toLowerCase())}function QM(t){const e=t.type;return Re(e)&&e!==$0&&e!==ep&&(t.scheme||t.range&&t.range.length&&t.range.every(ne))}function VM(t,e,n){if(!t.domain)return 0;n=Og(n);var r=YM(t,e.domainRaw,n);if(r>-1)return r;var i=e.domain,o=t.type,a=e.zero||e.zero===void 0&&jM(t),s,c;return i?(Bg(o)&&e.padding&&i[0]!==nt(i)&&(i=_M(o,i,e.range,e.padding,e.exponent,e.constant)),(a||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(s=(i=i.slice()).length-1||1,a&&(i[0]>0&&(i[0]=0),i[s]<0&&(i[s]=0)),e.domainMin!=null&&(i[0]=e.domainMin),e.domainMax!=null&&(i[s]=e.domainMax),e.domainMid!=null&&(c=e.domainMid,(c<i[0]||c>i[s])&&n.warn("Scale domainMid exceeds domain min or max.",c),i.splice(s,0,c))),t.domain(Fg(o,i,n)),o===Lu&&t.unknown(e.domainImplicit?$c:void 0),e.nice&&t.nice&&t.nice(e.nice!==!0&&Ng(t,e.nice)||null),i.length):0}function YM(t,e,n){return e?(t.domain(Fg(t.type,e,n)),e.length):-1}function _M(t,e,n,r,i,o){var a=Math.abs(nt(n)-n[0]),s=a/(a-2*r),c=t===rn?Hd(e,null,s):t===Ui?yc(e,null,s,.5):t===ji?yc(e,null,s,i||1):t===Pa?tb(e,null,s,o||1):gc(e,null,s);return e=e.slice(),e[0]=c[0],e[e.length-1]=c[1],e}function Fg(t,e,n){if(sp(t)){var r=Math.abs(e.reduce(function(i,o){return i+(o<0?-1:o>0?1:0)},0));r!==e.length&&n.warn("Log scale domain includes zero: "+aa(e))}return e}function WM(t,e,n){let r=e.bins;if(r&&!We(r)){const i=(r.start==null||r.stop==null)&&t.domain(),o=r.start==null?i[0]:r.start,a=r.stop==null?nt(i):r.stop,s=r.step;s||ae("Scale bins parameter missing step property."),r=Xt(o,a+s,s)}return r?t.bins=r:t.bins&&delete t.bins,t.type===Ou&&(r?!e.domain&&!e.domainRaw&&(t.domain(r),n=r.length):t.bins=t.domain()),n}function XM(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(e.rangeStep!=null)o=ZM(r,e,n);else if(e.scheme&&(o=qM(r,e,n),ke(o))){if(t.interpolator)return t.interpolator(o);ae(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&za(r))return t.interpolator(Ra(Pl(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(cp(e.interpolate,e.interpolateGamma)):ke(t.round)?t.round(i):ke(t.rangeRound)&&t.interpolate(i?zi:tn),o&&t.range(Pl(o,e.reverse))}function ZM(t,e,n){t!==rp&&t!==Bu&&ae("Only band and point scales support rangeStep.");var r=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,i=t===Bu?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*ku(n,i,r)]}function qM(t,e,n){var r=e.schemeExtent,i,o;return We(e.scheme)?o=Ra(e.scheme,e.interpolate,e.interpolateGamma):(i=e.scheme.toLowerCase(),o=Fu(i),o||ae(`Unrecognized scheme name: ${e.scheme}`)),n=t===np?n+1:t===Ou?n-1:t===Nu||t===tp?+e.schemeCount||RM:n,za(t)?zg(o,r,e.reverse):ke(o)?n4(zg(o,r),n):t===Lu?o:o.slice(0,n)}function zg(t,e,n){return ke(t)&&(e||n)?t4(t,Pl(e||[0,1],n)):t}function Pl(t,e){return e?t.slice().reverse():t}const Fl=de(",d");function KM(t){return t.chrom+":"+Fl(Math.floor(t.pos+1))}function JM(t,e){return t.chrom+":"+Fl(Math.floor(t.pos+1))+"-"+(t.chrom!=e.chrom?e.chrom+":":"")+Fl(Math.ceil(e.pos))}const $M="https://genomespy.app/data/genomes/";class e8{constructor(e){if(this.config=e,!this.config.contigs&&typeof this.config.name!="string")throw new Error("No name has been defined for the genome assembly!");this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,this.config.contigs&&this.setChromSizes(this.config.contigs)}get name(){return this.config.name}async load(e){if(!this.config.contigs){this.config.baseUrl?this.baseUrl=/^http(s)?/.test(this.config.baseUrl)?this.config.baseUrl:e+"/"+this.config.baseUrl:this.baseUrl=$M;try{this.setChromSizes(t8(await Bi({baseURL:this.baseUrl}).load(`${this.config.name}/${this.name}.chrom.sizes`)))}catch(n){throw new Error(`Could not load chrom sizes: ${n.message}`)}}}setChromSizes(e){let n=0;this.startByIndex=[0];for(let r=0;r<e.length;r++){this.startByIndex.push(n);const i=e[r].size,o={...e[r],continuousStart:n,continuousEnd:n+i,continuousInterval:[n,n+i],index:r,number:r+1,odd:!(r&1)};this.chromosomes.push(o);const a=o.name.replace(/^chr/i,"");for(const s of["chr"+a,"CHR"+a,"Chr"+a,o.number,""+o.number,a,o.name])this.cumulativeChromPositions.set(s,n),this.chromosomesByName.set(s,o);n+=o.size}this.totalSize=n}getExtent(){return[0,this.totalSize]}toContinuous(e,n){let r=this.cumulativeChromPositions.get(e);if(r===void 0)throw new Error("Unknown chromosome/contig: "+e);return r+ +n}toChromosome(e){if(e>=this.totalSize)return;e=Math.floor(e);const n=Tn(this.startByIndex,e)-1;if(n>0&&n<=this.chromosomes.length)return this.chromosomes[n-1]}toChromosomal(e){const n=this.toChromosome(e);if(!!n)return{chrom:n.name,pos:Math.floor(e)-n.continuousStart}}getChromosome(e){return this.chromosomesByName.get(e)}formatInterval(e){return JM(...this.toChromosomalInterval(e))}toChromosomalInterval(e){const n=this.toChromosomal(e[0]+.5),r=this.toChromosomal(e[1]-.5);return r.pos+=1,[n,r]}toContinuousInterval(e){var i,o,a;let[n,r]=e;return r||(r=n),[this.toContinuous(n.chrom,(i=n.pos)!=null?i:0),this.toContinuous(r.chrom,(a=r.pos)!=null?a:(o=this.chromosomesByName.get(r.chrom))==null?void 0:o.size)]}parseInterval(e){const n=e.match(/^(chr[0-9A-Z]+)(?::([0-9,]+)(?:-(?:(chr[0-9A-Z]+):)?([0-9,]+))?)?$/);if(n){const r=n[1];if(n.slice(2).every(s=>s===void 0)){const s=this.getChromosome(r);return s?[s.continuousStart,s.continuousEnd]:void 0}const i=n[3]||r,o=parseInt(n[2].replace(/,/g,"")),a=n[4]!==void 0?parseInt(n[4].replace(/,/g,"")):o;return[this.toContinuous(r,o-1),this.toContinuous(i,a)]}}}function t8(t){return Ab(t).filter(e=>/^chr[0-9A-Z]+$/.test(e[0])).map(([e,n])=>({name:e,size:parseInt(n)}))}function Rg(t){return ze(t)&&"chrom"in t}function n8(t){return t.every(Rg)}class xo extends Array{constructor(){super(),this.type=void 0}extend(e){return this}extendAll(e){if(e instanceof xo&&e.type!=this.type)throw new Error(`Cannot combine different types of domains: ${this.type} and ${e.type}`);for(const n of e)this.extend(n);return this}extendAllWithAccessor(e,n){for(const r of e)this.extend(n(r));return this}}class zl extends xo{constructor(){super(),this.type="quantitative"}extend(e){return e==null||Number.isNaN(e)?this:(e=+e,this.length?e<this[0]?this[0]=e:e>this[1]&&(this[1]=e):(this.push(e),this.push(e)),this)}}class jg extends xo{constructor(){super(),this.type="ordinal",this.uniqueValues=new Set}extend(e){return e==null||Number.isNaN(e)?this:(this.uniqueValues.has(e)||(this.uniqueValues.add(e),this.push(e)),this)}}class Ug extends jg{constructor(){super(),this.type="nominal"}}class r8 extends xo{constructor(e){super();let n=0;for(let r=1;r<e.length;r++)n+=Math.sign(e[r]-e[r-1]);if(Math.abs(n)!=e.length-1)throw new Error("Piecewise domain must be strictly increasing or decreasing: "+JSON.stringify(e));e.forEach(r=>this.push(r))}extend(e){if(this.includes(e))return this;throw new Error("Piecewise domains are immutable and cannot be unioned!")}}const Hg={quantitative:zl,index:zl,locus:zl,nominal:Ug,ordinal:jg};function Gg(t,e){if(t=="quantitative"&&i8(e)){const n=new r8(e);return n.type=t,n}else if(Hg[t]){const n=new Hg[t];return n.type=t,e&&n.extendAll(e),n}throw new Error("Unknown type: "+t)}function i8(t){return t&&t.length>0&&t.length!=2&&t.every(e=>typeof e=="number")}function Qg(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function o8(t){return--t*t*t+1}function a8(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}function s8(t){return 1-a8(t)}const Vg="quantitative",Rl="ordinal",jl="nominal",Yg="locus",c8="index";class u8{constructor(e){this.channel=e,this.members=[],this.type=null,this._zoomExtent=void 0,this._domainListeners=new Set,this.name=void 0,this._scale=void 0}addEventListener(e,n){if(e!="domain")throw new Error("Unsupported event type: "+e);this._domainListeners.add(n)}removeEventListener(e,n){if(e!="domain")throw new Error("Unsupported event type: "+e);this._domainListeners.delete(n)}_notifyDomainListeners(){for(const e of this._domainListeners.values())e({type:"domain",scaleResolution:this})}pushUnitView(e,n){var a;const r=Xu(e,n),i=r.type,o=(a=r==null?void 0:r.scale)==null?void 0:a.name;if(o){if(this.name!==void 0&&o!=this.name)throw new Error(`Shared scales have conflicting names: "${o}" vs. "${this.name}"!`);this.name=o}if(!this.type)this.type=i;else if(i!==this.type&&!oo(n))throw new Error(`Can not use shared scale for different data types: ${this.type} vs. ${i}. Use "resolve: independent" for channel ${this.channel}`);this.members.push({view:e,channel:n})}isExplicitDomain(){return!!this.getConfiguredDomain()}_getMergedScaleProps(){return _r(this,"mergedScaleProps",()=>{const e=this.members.map(n=>Xu(n.view,n.channel).scale).filter(n=>n!==void 0);return bs(e,"scale",["domain"])})}getScaleProps(){return _r(this,"scaleProps",()=>{var i,o;const e=this._getMergedScaleProps();if(e===null||e.type=="null")return{type:"null"};const n={...this._getDefaultScaleProperties(this.type),...e};n.type||(n.type=l8(this.channel,this.type));const r=this.getInitialDomain();return r&&r.length>0?n.domain=r:on(n.type)&&(n.domain=new Ug),!n.domain&&n.domainMid!==void 0&&(n.domain=[(i=n.domainMin)!=null?i:0,(o=n.domainMax)!=null?o:1]),this.channel=="y"&&on(n.type)&&n.reverse==null&&(n.reverse=!0),n.range&&n.scheme&&delete n.scheme,!("zoom"in n)&&["index","locus"].includes(n.type)&&(n.zoom=!0),f8(n,this.channel),n})}getInitialDomain(){var e;return(e=this.getConfiguredDomain())!=null?e:this.type==Yg?this.getGenome().getExtent():this.getDataDomain()}getConfiguredDomain(){return this._reduceDomains(e=>oo(e.channel)?void 0:e.view.getConfiguredDomain(e.channel))}getDataDomain(){return this._reduceDomains(e=>oo(e.channel)?void 0:e.view.extractDataDomain(e.channel))}reconfigure(){if(this._scale&&this._scale.type!="null"){mg(this,"scaleProps");const e=this.getScaleProps();Pg(e,this._scale),Re(this._scale.type)&&(this._zoomExtent=this._getZoomExtent())}}getScale(){if(this._scale)return this._scale;const e=this.getScaleProps(),n=HM(e);return this._scale=n,Qx(n)&&n.genome(this.getGenome()),Re(n.type)&&(this._zoomExtent=this._getZoomExtent()),n}getDomain(){return this.getScale().domain()}getComplexDomain(){var e,n;return(n=(e=this.getGenome())==null?void 0:e.toChromosomalInterval(this.getDomain()))!=null?n:this.getDomain()}isZoomed(){return this.isZoomable()&&Ip(this.getInitialDomain(),this.getDomain())}isZoomable(){if(!Vp(this.channel))return!1;const e=this.getScale().type;return["linear","locus","index","log","pow","sqrt"].includes(e)?!!this.getScaleProps().zoom:!1}zoom(e,n,r){if(!this.isZoomable())return!1;const i=this.getScale(),o=i.domain();let a=[...o],s=i.invert(n);switch(this.getScaleProps().reverse&&(r=-r),"align"in i&&(s+=i.align()),i.type){case"linear":case"index":case"locus":a=J2(a,r||0),a=gc(a,s,e);break;case"log":a=$2(a,r||0),a=Hd(a,s,e);break;case"pow":case"sqrt":{const c=i;a=eb(a,r||0,c.exponent()),a=yc(a,s,e,c.exponent());break}default:throw new Error("Zooming is not implemented for: "+i.type)}return this._zoomExtent&&(a=nb(a,this._zoomExtent[0],this._zoomExtent[1])),[0,1].some(c=>a[c]!=o[c])?(i.domain(a),this._notifyDomainListeners(),!0):!1}async zoomTo(e,n=!1){var s;if(ia(n)&&(n=n?700:0),!this.isZoomable())throw new Error("Not a zoomable scale!");const r=this.fromComplexInterval(e),i=(s=this.members[0])==null?void 0:s.view.context.animator,o=this.getScale(),a=o.domain();if(n>0&&a.length==2){const c=a[1]-a[0],u=a[0]+c/2,f=r[1]-r[0],l=r[0]+f/2,d=I0([u,0,c],[l,0,f]).rho(.7);await i.transition({duration:n/1e3*d.duration,easingFunction:Qg,onUpdate:h=>{const[p,,m]=d(h);o.domain([p-m/2,p+m/2]),this._notifyDomainListeners()}}),o.domain(r),this._notifyDomainListeners()}else o.domain(r),i==null||i.requestRender(),this._notifyDomainListeners()}resetZoom(){if(!this.isZoomable())throw new Error("Not a zoomable scale!");const e=this.getDomain(),n=this.getInitialDomain();return[0,1].some(r=>n[r]!=e[r])?(this._scale.domain(n),this._notifyDomainListeners(),!0):!1}getZoomLevel(){return this.isZoomable()?oa(this._zoomExtent)/oa(this.getScale().domain()):1}_getZoomExtent(){const e=this.getScaleProps(),n=e.zoom;if(d8(n)&&We(n.extent))return this.fromComplexInterval(n.extent);if(n)return e.type=="locus"?this.getGenome().getExtent():this._scale.domain()}_getDefaultScaleProperties(e){const n=this.channel,r={};return this.isExplicitDomain()&&(r.zero=!1),io(n)?r.nice=!this.isExplicitDomain():qn(n)?r.scheme=e==jl?"tableau10":e==Rl?"blues":"viridis":_a(n)?r.range=_p(n):n=="size"?r.range=[0,400]:n=="angle"&&(r.range=[0,360]),r}getGenome(){var n;if(this.type!=="locus")return;const e=(n=this.members[0].view.context.genomeStore)==null?void 0:n.getGenome();if(!e)throw new Error("No genome has been defined!");return e}invertToComplex(e){const n=this.getScale();if("invert"in n){const r=n.invert(e);return this.toComplex(r)}else throw new Error("The scale does not support inverting!")}toComplex(e){const n=this.getGenome();return n?n.toChromosomal(e):e}fromComplex(e){return Rg(e)?this.getGenome().toContinuous(e.chrom,e.pos):e}fromComplexInterval(e){return this.type==="locus"&&n8(e)?this.getGenome().toContinuousInterval(e):e}_getViewPaths(){return this.members.map(e=>e.view.getPathString()).join(", ")}_reduceDomains(e){const n=this.members.map(e).filter(r=>!!r);if(n.length)return n.reduce((r,i)=>r.extendAll(i))}}function l8(t,e){if(e==c8||e==Yg){if(Vp(t))return e;throw new Error(`${t} does not support ${e} data type. Only positional channels do.`)}const n={x:["band","band","linear"],y:["band","band","linear"],size:[void 0,"point","linear"],opacity:[void 0,"point","linear"],fillOpacity:[void 0,"point","linear"],strokeOpacity:[void 0,"point","linear"],color:["ordinal","ordinal","linear"],fill:["ordinal","ordinal","linear"],stroke:["ordinal","ordinal","linear"],strokeWidth:[void 0,void 0,"linear"],shape:["ordinal","ordinal",void 0],dx:[void 0,void 0,"null"],dy:[void 0,void 0,"null"],angle:[void 0,void 0,"linear"]},i=["uniqueId","facetIndex","semanticScore","search","text","sample"].includes(t)?"null":n[t]?n[t][[jl,Rl,Vg].indexOf(e)]:e==Vg?"linear":"ordinal";if(i===void 0)throw new Error(`Channel "${t}" is not compatible with "${e}" data type. Use of a proper scale may be needed.`);return i}function f8(t,e){io(e)&&t.type!=="ordinal"&&(t.range=[0,1]),e=="opacity"&&Re(t.type)&&(t.clamp=!0)}function d8(t){return ze(t)}function Ul(...t){for(const e of t)if(e!==void 0)return e}class h8{constructor(e){this.channel=e,this.members=[]}get scaleResolution(){var e;return(e=je(this.members))==null?void 0:e.view.getScaleResolution(this.channel)}pushUnitView(e,n){const r=e.getScaleResolution(this.channel);if(!r)throw new Error("Cannot find a scale resolution!");if(this.scaleResolution&&r!==this.scaleResolution)throw new Error("Shared axes must have a shared scale!");this.members.push({view:e,channel:n})}getAxisProps(){return _r(this,"axisProps",()=>{const e=this.members.map(n=>{const r=n.view.mark.encoding[n.channel];return"axis"in r&&r.axis});return e.length>0&&e.some(n=>n===null)?null:bs(e.filter(n=>n!==void 0),"axis",["title"])})}getTitle(){const e=o=>{var s;const a=Xu(o.view,o.channel);if(!at(a))return{member:o,explicitTitle:Ul((s=a.axis)==null?void 0:s.title,a.title),implicitTitle:Ul(Zn(a)?a.field:void 0,Zu(a)?a.expr:void 0)}},n=this.members.map(e),r=n.filter(o=>{var a;if(oo(o.member.channel)&&!o.explicitTitle){const s=Pr(o.member.channel);return((a=n.find(c=>c.member.view==o.member.view&&c.member.channel==s))==null?void 0:a.explicitTitle)===void 0}return!0}),i=new Set(r.map(o=>Ul(o.explicitTitle,o.implicitTitle)).filter(ne));return i.size?[...i].join(", "):null}}class _g extends Ig{constructor(e,n,r,i){super(e,n,r,i),this.spec=e}}class Pt extends rr{constructor(e,n,r,i){super(e,n,r,i),this.spec=e,this.children=(e.layer||[]).map((o,a)=>{if(Yl(o)||Vl(o))return n.createView(o,this,"layer"+a);throw new Error("LayerView accepts only unit or layer specs as children!")})}*[Symbol.iterator](){for(const e of this.children)yield e}render(e,n,r={}){if(!!this.isVisible()){e.pushView(this,n);for(const i of this.children)i.render(e,n,r);e.popView(this)}}propagateInteractionEvent(e){this.handleInteractionEvent(void 0,e,!0),this.children.length&&this.children.at(-1).propagateInteractionEvent(e),!e.stopped&&this.handleInteractionEvent(void 0,e,!1)}}class Wg{constructor(e,n){this.n=e,this.maxCols=n!=null?n:1/0}get nRows(){return this.maxCols==1/0?1:Math.ceil(this.n/this.maxCols)}get nCols(){return Math.min(this.n,this.maxCols)}get rowIndices(){const e=[],n=this.nCols,r=this.nRows;for(let i=0;i<r;i++){const o=[];e.push(o);for(let a=0;a<n;a++){const s=i*n+a;s<this.n&&o.push(s)}}return e}get colIndices(){const e=[],n=this.nCols,r=this.nRows;for(let i=0;i<n;i++){const o=[];e.push(o);for(let a=0;a<r;a++){const s=a*n+i;s<this.n&&o.push(s)}}return e}getCellIndex(e,n){let r=0;if(this.maxCols==1/0)r=n==0?e:void 0;else{if(e>=this.maxCols)return;r=n*this.nCols+e}return r<this.n?r:void 0}getCellCoords(e){if(!(e<0||e>=this.n))return[e%this.nCols,Math.floor(e/this.nCols)]}}function Ft(t){return()=>t}const _t=class{static create(e,n,r,i){return new _t(Ft(e),Ft(n),Ft(r),Ft(i))}_offset(e,n){const r=this["_"+e];if(n===0)return r;switch(typeof n){case"number":return()=>r()+n;case"function":return()=>r()+n();default:throw new Error("Not a number of function")}}_passThrough(e){return this._offset(e,0)}constructor(e,n,r,i){this._x=e,this._y=n,this._width=r,this._height=i}get x(){return this._x()}get y(){return this._y()}get width(){return this._width()}get height(){return this._height()}get x2(){return this._x()+this._width()}get y2(){return this._y()+this._height()}equals(e){return e?this===e||this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height:!1}modify(e){if(!Object.keys(e).length)return this;const n=r=>{const i=e[r];return typeof i=="number"?Ft(i):typeof i=="function"?i:this._passThrough(r)};return new _t(n("x"),n("y"),n("width"),n("height"))}translate(e,n){return e===0&&n===0?this:new _t(this._offset("x",e),this._offset("y",n),this._passThrough("width"),this._passThrough("height"))}translateBy(e){return this.translate(e.x,e.y)}expand(e,n=1){return e.left==0&&e.top==0&&e.right==0&&e.bottom==0?this:new _t(e.left?this._offset("x",-e.left*n):this._passThrough("x"),e.top?this._offset("y",-e.top*n):this._passThrough("y"),e.width?this._offset("width",e.width*n):this._passThrough("width"),e.height?this._offset("height",e.height*n):this._passThrough("height"))}shrink(e){return this.expand(e,-1)}intersect(e){return this===e?this:new _t(()=>Math.max(this.x,e.x),()=>Math.max(this.y,e.y),()=>Math.min(this.x2,e.x2)-Math.max(this.x,e.x),()=>Math.min(this.y2,e.y2)-Math.max(this.y,e.y))}isDefined(){return this.width>=0&&this.height>=0}flatten(){return new _t(Ft(this.x),Ft(this.y),Ft(this.width),Ft(this.height))}containsPoint(e,n){return e>=this.x&&e<this.x2&&n>=this.y&&n<this.y2}normalizePoint(e,n){return{x:(e-this.x)/this.width,y:(n-this.y)/this.height}}toString(){return`Rectangle: x: ${this.x}, y: ${this.y}, width: ${this.width}, height: ${this.height}`}};let pn=_t;hc(pn,"ZERO",_t.create(0,0,0,0));function Xg(t,e,n){return n=(n-t)/(e-t),n=Math.max(0,Math.min(1,n)),n*n*(3-2*n)}class ir extends ue{get identifier(){}handle(e){throw new Error("Source does not handle incoming data!")}async load(){}}function Zg(t){var n,r;const e={...t.format};if((n=e.type)!=null||(e.type=y8(t)&&p8(t.url)),(r=e.parse)!=null||(e.parse="auto"),!e.type)throw new Error("Format for the data source was not defined and it could not be inferred: "+JSON.stringify(t));return e}function p8(t){var e;if(Array.isArray(t)&&(t=t[0]),t)return(e=t.match(/\.(csv|tsv|json)/))==null?void 0:e[1]}const As=t=>typeof t!="object"?m8:g8,m8=t=>({data:t}),g8=t=>t;function y8(t){return"url"in t}function v8(t){return"dynamicCallbackSource"in t}class qg extends ir{constructor(e){super(),this.callback=e}loadSynchronously(){if(!this.callback)return;const e=this.callback();if(!e||typeof e[Symbol.iterator]!="function")throw new Error("Dynamic data callback didn't return iterable data!");this.reset(),this.beginBatch({type:"file"});let n;for(const r of e)n||(n=As(r)),this._propagate(n(r));this.complete()}async load(){this.loadSynchronously()}}const Kg="chromosome_ticks_and_labels",Jg={x:"width",y:"height"};function Hl(t){return t=="x"?"y":"x"}const Gl={x:["bottom","top"],y:["left","right"]},$g=Object.fromEntries(Object.entries(Gl).map(([t,e])=>e.map(n=>[n,t])).flat(1));function or(t){return $g[t]}class e1 extends Pt{constructor(e,n,r,i){const o=n=="locus",a={...o?x8:t1,...A8(n,e),...e};if(super(o?w8(a):n1(a),r,i,`axis_${e.orient}`),this.axisProps=a,this.axisUpdateRequested=!0,this._addBroadcastHandler("layout",()=>{this.axisUpdateRequested=!0}),this.previousScaleDomain=[],this.axisLength=void 0,this.ticks=[],this.tickSource=new qg(()=>this.ticks),o){const s=or(this.axisProps.orient),c=this.getScaleResolution(s).getGenome();this.findChildByName(Kg).getDynamicDataSource=()=>new qg(()=>c.chromosomes)}this.blockEncodingInheritance=!0}getOrient(){return this.axisProps.orient}getSize(){const e={px:this.getPerpendicularSize()},n={grow:1};return $g[this.axisProps.orient]=="x"?new tr(n,e):new tr(e,n)}getPerpendicularSize(){return Ql(this.axisProps)}getDynamicDataSource(){return this.tickSource}_updateAxisData(){const e=or(this.axisProps.orient),n=this.getScaleResolution(e).getScale(),r=n.domain();if(Ip(r,this.previousScaleDomain)&&!this.axisUpdateRequested)return;this.previousScaleDomain=r;const i=this.ticks,o=b8(this.axisProps,n,this.axisLength,i);o!==i&&(this.ticks=o,this.tickSource.loadSynchronously()),this.axisUpdateRequested=!1}onBeforeRender(){super.onBeforeRender(),this._updateAxisData()}render(e,n,r={}){!this.isVisible()||(this.axisLength=n[Jg[or(this.getOrient())]],super.render(e,n,r))}isPickingSupported(){return!1}}function Ql(t){const e=or(t.orient);let n=t.ticks&&t.tickSize||0;return t.labels&&(n+=t.labelPadding,e=="x"?n+=t.labelFontSize:n+=30),t.title&&(n+=t.titlePadding+t.titleFontSize),n=Math.min(t.maxExtent||1/0,Math.max(t.minExtent||0,n)),n}function b8(t,e,n,r=[]){const i=s=>25+60*Xg(100,700,s);let o=le(t.tickCount)?t.tickCount:Math.round(n/i(n));o=Ng(e,o,t.tickMinStep);const a=t.values?Lg(e,t.values,o):IM(e,o);if(l4(a,r,s=>s,s=>s.value))return r;{const s=NM(e,o,t.format);return a.map(c=>({value:c,label:s(c)}))}}const t1={values:null,minExtent:20,maxExtent:1/0,offset:0,domain:!0,domainWidth:1,domainColor:"gray",domainDash:null,domainDashOffset:0,domainCap:"square",ticks:!0,tickSize:5,tickWidth:1,tickColor:"gray",tickDash:null,tickDashOffset:0,tickCap:"square",tickCount:null,tickMinStep:null,labels:!0,labelAlign:"center",labelBaseline:"middle",labelPadding:4,labelFontSize:10,labelLimit:180,labelColor:"black",format:null,titleColor:"black",titleFont:"sans-serif",titleFontSize:10,titlePadding:3};function A8(t,e){var s;const n=e.orient,r=t=="nominal"||t=="ordinal";let i="center",o="middle",a=(s=e.labelAngle)!=null?s:(n=="top"||n=="bottom")&&r?-90:0;switch(n){case"left":i="right";break;case"right":i="left";break;case"top":case"bottom":Math.abs(a)>30?(i=a>0==(n=="bottom")?"left":"right",o="middle"):o=n=="top"?"alphabetic":"top";break}return{labelAlign:i,labelAngle:a,labelBaseline:o}}function n1(t){const e={...t,extent:Ql(t)},n=or(e.orient),r=Hl(n),i=e.orient=="bottom"||e.orient=="right"?1:-1,o=e.orient=="bottom"||e.orient=="left"?1:0,a=()=>({name:"domain",data:{values:[0]},mark:{type:"rule",clip:!1,strokeDash:e.domainDash,strokeCap:e.domainCap,color:e.domainColor,[r]:o,size:e.domainWidth}}),s=()=>({name:"labels",mark:{type:"text",clip:!1,align:e.labelAlign,angle:e.labelAngle,baseline:e.labelBaseline,[r+"Offset"]:(e.tickSize+e.labelPadding)*i,[r]:o,size:e.labelFontSize,color:e.labelColor,minBufferSize:1500},encoding:{[n]:{field:"value",type:"quantitative"},text:{field:"label"}}}),c=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:e.tickDash,strokeCap:e.tickCap,color:e.tickColor,size:e.tickWidth,minBufferSize:300},encoding:{[r]:{value:o},[r+"2"]:{value:o-e.tickSize/e.extent*(o?1:-1)}}}),u=()=>({name:"title",data:{values:[0]},mark:{type:"text",clip:!1,align:"center",baseline:e.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(e.orient)],text:e.title,color:e.titleColor,[n]:.5,[r]:1-o}}),f=()=>{const d={name:"ticks_and_labels",encoding:{[n]:{field:"value",type:"quantitative"}},layer:[]};return e.ticks&&d.layer.push(c()),e.labels&&d.layer.push(s()),d},l={[Jg[Hl(or(e.orient))]]:e.extent,data:{dynamicCallbackSource:!0},layer:[]};return e.domain&&l.layer.push(a()),(e.ticks||e.labels)&&l.layer.push(f()),e.title&&l.layer.push(u()),l}const x8={...t1,chromTicks:!0,chromTickSize:18,chromTickWidth:1,chromTickColor:"#989898",chromTickDash:[4,2],chromTickDashOffset:1,chromLabels:!0,chromLabelFontSize:13,chromLabelFontWeight:"normal",chromLabelFontStyle:"normal",chromLabelColor:"black",chromLabelAlign:"left",chromLabelPadding:7};function w8(t){const e={...t,extent:Ql(t)},n=or(e.orient),r=Hl(n),i=e.orient=="bottom"||e.orient=="left"?1:0,o=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:t.chromTickDash,strokeDashOffset:t.chromTickDashOffset,[r]:i,[r+"2"]:i-e.chromTickSize/e.extent*(i?1:-1),color:t.chromTickColor,size:e.chromTickWidth}}),a=()=>{let u;switch(e.orient){case"top":u={y:0,angle:0,paddingX:4,dy:-e.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":u={y:1,angle:0,paddingX:4,dy:e.chromLabelPadding+e.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":u={x:1,angle:-90,paddingY:4,dy:-e.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":u={x:0,angle:90,align:"right",paddingY:4,dy:-e.chromLabelPadding};break;default:u={}}return{name:"chromosome_labels",mark:{type:"text",size:e.chromLabelFontSize,font:e.chromLabelFont,fontWeight:e.chromLabelFontWeight,fontStyle:e.chromLabelFontStyle,color:e.chromLabelColor,align:t.chromLabelAlign,baseline:"alphabetic",clip:!1,...u},encoding:{[n+"2"]:{field:"continuousEnd",type:"locus"},text:{field:"name"}}}};let s;switch(e.orient){case"bottom":case"top":s={};break;case"left":s={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":s={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:s={}}const c=n1({...t,...s});if(t.chromTicks||t.chromLabels){const u={name:Kg,data:{dynamicCallbackSource:!0},encoding:{[n]:{field:"continuousStart",type:"locus",band:0}},layer:[]};if(t.chromTicks&&u.layer.push(o()),t.chromLabels){u.layer.push(a());let f;c.layer.filter(l=>l.name=="ticks_and_labels").forEach(l=>l.layer.filter(d=>d.name=="labels").forEach(d=>{f=d.mark})),f&&(e.orient=="top"||e.orient=="bottom"?(f.viewportEdgeFadeWidthLeft=30,f.viewportEdgeFadeDistanceLeft=40):(f.viewportEdgeFadeWidthBottom=30,f.viewportEdgeFadeDistanceBottom=40))}c.layer.push(u)}return c}const r1={anchor:"middle",frame:"group",offset:10,orient:"top",align:void 0,angle:0,baseline:"alphabetic",dx:0,dy:0,color:void 0,font:void 0,fontSize:12,fontStyle:"normal",fontWeight:"normal"},C8={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},S8={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},E8={start:0,middle:.5,end:1},D8={start:"left",middle:"center",end:"right"};function M8(t){var u,f,l;if(!t)return;const e=ne(t)?{text:t}:t;if(!e.text||e.orient=="none")return;const n=(u={"track-title":C8,overlay:S8}[e.style])!=null?u:{},r={...r1,...n,...e};let i={},o={x:0,y:0};const a=E8[(f=r.anchor)!=null?f:"middle"];switch(r.orient){case"top":o={x:a,y:1},i={baseline:"alphabetic",angle:0};break;case"right":o={x:1,y:1-a},i={baseline:"alphabetic",angle:90};break;case"bottom":o={x:a,y:0},i={baseline:"top",angle:0};break;case"left":o={x:0,y:a},i={baseline:"alphabetic",angle:-90};break}const s={...r1,...i,...n,...e},c={xOffset:0,yOffset:0};switch(r.orient){case"top":c.yOffset=-s.offset;break;case"right":c.xOffset=s.offset;break;case"bottom":c.yOffset=s.offset;break;case"left":c.xOffset=-s.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...o,...c,text:s.text,align:(l=s.align)!=null?l:D8[s.anchor],angle:s.angle,baseline:s.baseline,dx:s.dx,dy:s.dy,color:s.color,font:s.font,size:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight}}}function i1(t,e,n,r){if(t.type=="wheel"){t.uiEvent.preventDefault();const i=t.uiEvent,o=i.deltaMode?120:1;let{x:a,y:s}=t.point;if(r){const c=r.mark.encoders;c.x&&!c.x2&&(a=+c.x(r.datum)*e.width+e.x),c.y&&!c.y2&&(s=(1-+c.y(r.datum))*e.height+e.y)}Math.abs(i.deltaX)<Math.abs(i.deltaY)?n({x:a,y:s,xDelta:0,yDelta:0,zDelta:i.deltaY*o/300}):n({x:a,y:s,xDelta:-i.deltaX*o,yDelta:0,zDelta:0})}else if(t.type=="mousedown"&&t.uiEvent.button===0){const i=t.uiEvent;i.preventDefault();let o=i;const a=c=>{n({x:o.clientX,y:o.clientY,xDelta:c.clientX-o.clientX,yDelta:c.clientY-o.clientY,zDelta:0}),o=c},s=c=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s)};document.addEventListener("mouseup",s,!1),document.addEventListener("mousemove",a,!1)}}class o1 extends rr{constructor(n,r,i,o,a){var s;super(n,r,i,o);te(this,Vo);te(this,Dt);te(this,oc);te(this,ac);te(this,br);te(this,Yo);te(this,_o);te(this,Wo);te(this,sc);te(this,ui,1/0);te(this,li,10);te(this,et,[]);te(this,fi,0);this.spec=n,tt(this,li,(s=n.spacing)!=null?s:10),tt(this,ui,a),tt(this,et,[]),this.wrappingFacet=!1,this._createChildren()}_createChildren(){}appendChild(n){var r;(r=n.parent)!=null||(n.parent=this),G(this,et).push(se(this,Vo,Od).call(this,n)),j2(this,fi)._++}setChildren(n){for(const r of n)this.appendChild(r)}replaceChild(n,r){const i=G(this,et).findIndex(o=>o.view==n);if(i>=0)G(this,et)[i]=se(this,Vo,Od).call(this,r);else throw new Error("Not my child view!")}get children(){return G(this,et).map(n=>n.view)}get childCount(){return G(this,et).length}onScalesResolved(){super.onScalesResolved(),se(this,ac,H2).call(this)}*[Symbol.iterator](){for(const n of G(this,et)){n.background&&(yield n.background);for(const r of Object.values(n.axes))r&&(yield r);yield n.view,n.title&&(yield n.title)}}getOverhang(){const n=se(this,br,$o).call(this,"column"),r=se(this,br,$o).call(this,"row");return!n.length||!r.length?Je.zero():new Je(r.at(0).axisBefore,n.at(-1).axisAfter,r.at(-1).axisAfter,n.at(0).axisBefore)}getSize(){return this._cache("size",()=>new tr(se(this,_o,Fd).call(this,"column"),se(this,_o,Fd).call(this,"row")).subtractPadding(this.getOverhang()).addPadding(this.getPadding()))}render(n,r,i={}){var u;if(!this.isVisible())return;r=r.shrink(this.getPadding()),n.pushView(this,r);const o={devicePixelRatio:this.context.glHelper.dpr},a=bo(se(this,Yo,Pd).call(this,"column"),r.width,o),s=bo(se(this,Yo,Pd).call(this,"row"),r.height,o),c=new Wg(G(this,Dt,Sn).length,(u=G(this,ui))!=null?u:1/0);for(const[f,l]of G(this,Dt,Sn).entries()){const{view:d,axes:h,background:p,title:m}=l,[g,y]=c.getCellCoords(f),A=a[se(this,Wo,zd).call(this,"column",g)],x=s[se(this,Wo,zd).call(this,"row",y)],w=d.getSize(),b=d.getPadding().subtract(d.getOverhang()),v=A.location+b.left,C=x.location+b.top,S=(w.width.grow?A.size:w.width.px)-b.width,I=(w.height.grow?x.size:w.height.px)-b.height,N=new pn(()=>r.x+v,()=>r.y+C,()=>S,()=>I);l.coords=N,p==null||p.render(n,N,i);const T=k8(d);T&&d.render(n,N,i);for(const[O,Q]of Object.entries(h)){const U=Q.axisProps;let we;const Ie=Q.getPerpendicularSize();O=="bottom"?we=N.translate(0,N.height+U.offset).modify({height:Ie}):O=="top"?we=N.translate(0,-Ie-U.offset).modify({height:Ie}):O=="left"?we=N.translate(-Ie-U.offset,0).modify({width:Ie}):O=="right"&&(we=N.translate(N.width+U.offset,0).modify({width:Ie})),Q.render(n,we)}T||d.render(n,N,i),m==null||m.render(n,N,{...i,clipRect:void 0})}n.popView(this)}propagateInteractionEvent(n){if(this.handleInteractionEvent(void 0,n,!0),n.stopped)return;const r=G(this,Dt,Sn).find(o=>o.coords.containsPoint(n.point.x,n.point.y)),i=r==null?void 0:r.view;i&&(i.propagateInteractionEvent(n),(i instanceof be||i instanceof Pt)&&i1(n,r.coords,o=>se(this,sc,G2).call(this,r.coords,r.view,o),this.context.getCurrentHover())),!n.stopped&&this.handleInteractionEvent(void 0,n,!1)}getDefaultResolution(n,r){return"independent"}}ui=new WeakMap,li=new WeakMap,et=new WeakMap,fi=new WeakMap,Vo=new WeakSet,Od=function(n){var i;const r={view:n,background:void 0,axes:{},coords:pn.ZERO};if(n instanceof be||n instanceof Pt){const o=(i=n.spec)==null?void 0:i.view;if((o==null?void 0:o.fill)||(o==null?void 0:o.stroke)){const s=new be(T8(o),this.context,n,"background"+G(this,fi));s.blockEncodingInheritance=!0,r.background=s}const a=M8(n.spec.title);if(a){const s=new be(a,this.context,n,"title"+G(this,fi));s.blockEncodingInheritance=!0,r.title=s}}return r},Dt=new WeakSet,Sn=function(){return G(this,et).filter(n=>n.view.isVisible())},oc=new WeakSet,U2=function(){var n;return new Wg(G(this,Dt,Sn).length,(n=G(this,ui))!=null?n:1/0)},ac=new WeakSet,H2=function(){if(Object.keys(this.resolutions.axis).length)throw new Error("ConcatView does not (currently) support shared axes!");for(const n of G(this,et)){const{view:r,axes:i}=n,o=(a,s,c)=>{var f;const u=a.getAxisProps();if(u!==null){if(!u.orient){for(const l of Gl[s])if(!i[l]){u.orient=l;break}if(!u.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if((f=u.title)!=null||(u.title=a.getTitle()),!Gl[s].includes(u.orient))throw new Error(`Invalid axis orientation "${u.orient}" on channel "${s}"!`);if(i[u.orient])throw new Error(`An axis with the orient "${u.orient}" already exists!`);i[u.orient]=new e1(u,a.scaleResolution.type,this.context,c)}};if(r instanceof be||r instanceof Pt)for(const a of["x","y"]){const s=r.resolutions.axis[a];!s||o(s,a,r)}if(r instanceof Pt){for(const a of r.children)for(const[s,c]of Object.entries(a.resolutions.axis)){const u=c.getAxisProps();u&&u.orient&&o(c,s,a)}for(const a of r.children)for(const[s,c]of Object.entries(a.resolutions.axis)){const u=c.getAxisProps();u&&!u.orient&&o(c,s,a)}}}},br=new WeakSet,$o=function(n){const r=n=="column"?["left","right"]:["top","bottom"],i=n=="column"?"width":"height",o=(a,s)=>a.map(c=>{const u=G(this,Dt,Sn)[c].axes[r[s]];if(u)return Math.max(u.getPerpendicularSize()+u.axisProps.offset,0);const f=G(this,Dt,Sn)[c].view.getOverhang();return n=="column"?s?f.right:f.left:s?f.bottom:f.top}).reduce((c,u)=>Math.max(c,u),0);return G(this,oc,U2)[n=="column"?"colIndices":"rowIndices"].map(a=>({axisBefore:o(a,0),axisAfter:o(a,1),view:bM(a.map(s=>G(this,Dt,Sn)[s].view.getSize()[i]))}))},Yo=new WeakSet,Pd=function(n){const r=se(this,br,$o).call(this,n),i=[];i.push(Ao);for(const[o,a]of r.entries())o>0&&i.push({px:G(this,li),grow:0}),(o==0||this.wrappingFacet)&&i.push(Ao),i.push({px:a.axisBefore,grow:0}),i.push(a.view),i.push({px:a.axisAfter,grow:0}),(o==r.length-1||this.wrappingFacet)&&i.push(Ao);return i},_o=new WeakSet,Fd=function(n){var s,c;let r=0,i=0;const o=n=="row"&&this.spec.height||n=="column"&&this.spec.width;if(o!==void 0&&o!=="")return Dg(o);const a=se(this,br,$o).call(this,n);for(const[u,f]of a.entries())u>0&&(i+=G(this,li)),(u==0||this.wrappingFacet)&&(i+=0),i+=f.axisBefore,i+=(s=f.view.px)!=null?s:0,r+=(c=f.view.grow)!=null?c:0,i+=f.axisAfter,(u==a.length-1||this.wrappingFacet)&&(i+=0);return{px:i,grow:r}},Wo=new WeakSet,zd=function(n,r){return n=="row"&&this.wrappingFacet?1+6*r+2:2+4*r+1},sc=new WeakSet,G2=function(n,r,i){for(const[o,a]of Object.entries(I8(r))){if(a.size<=0)continue;const s=n.normalizePoint(i.x,i.y),c=n.normalizePoint(i.x+i.xDelta,i.y+i.yDelta),u={x:c.x-s.x,y:c.y-s.y};for(const f of a)f.zoom(2**i.zDelta,o=="y"?1-s[o]:s[o],o=="x"?u.x:-u.y)}this.context.animator.requestRender()};function T8(t){return{configurableVisibility:!1,data:{values:[{}]},mark:{fill:null,strokeWidth:1,fillOpacity:t.fill?1:0,...t,type:"rect",clip:!1,tooltip:null}}}function I8(t){const e={x:new Set,y:new Set};return t.visit(n=>{for(const[r,i]of Object.entries(e)){const o=n.getScaleResolution(r);o&&o.isZoomable()&&i.add(o)}}),e}function k8(t){let e=!0;return t.visit(n=>{n instanceof be&&e&&(e=n.mark.properties.clip)}),e}class Xr extends o1{constructor(e,n,r,i){super(e,n,r,i,Wl(e)?e.columns:_l(e)?1:1/0),this.spec=e}_createChildren(){const e=this.spec,n=Wl(e)?e.concat:_l(e)?e.vconcat:e.hconcat;this.setChildren(n.map((r,i)=>this.context.createView(r,this,"grid"+i)))}}class N8{constructor(){this.types=[];const e=n=>(r,i,o,a)=>{var s;return new n(r,i,o,(s=r.name)!=null?s:a)};this.addViewType(L8,e(_g)),this.addViewType(Yl,e(Pt)),this.addViewType(Vl,e(be)),this.addViewType(_l,e(Xr)),this.addViewType(B8,e(Xr)),this.addViewType(Wl,e(Xr))}addViewType(e,n){this.types.push({specGuard:e,factory:n})}createView(e,n,r,i){const o=this.types.find(a=>a.specGuard(e));if(o)return o.factory(e,n,r,i!=null?i:"unnamed");throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(e)]))}isViewSpec(e){const n=this.types.filter(r=>r.specGuard(e));if(n.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return n.length==1}}function Vl(t){return"mark"in t&&(ne(t.mark)||ze(t.mark))}function Yl(t){return"layer"in t&&ze(t.layer)}function a1(t){return t&&(Vl(t)||Yl(t))&&"aggregateSamples"in t}function L8(t){return"import"in t}function _l(t){return"vconcat"in t&&We(t.vconcat)}function B8(t){return"hconcat"in t&&We(t.hconcat)}function Wl(t){return"concat"in t&&We(t.concat)}const O8={point:oM,rect:$D,rule:cM,link:dM,text:vM};class be extends rr{constructor(e,n,r,i){super(e,n,r,i),this.spec=e;const o=O8[this.getMarkType()];if(o)this.mark=new o(this);else throw new Error(`No such mark: ${this.getMarkType()}`);this.sampleAggregateViews=[],this._initializeAggregateViews(),this.coords=void 0}*[Symbol.iterator](){for(const e of this.sampleAggregateViews)yield e}replaceChild(e,n){const r=this.sampleAggregateViews.indexOf(e);if(r>=0)this.sampleAggregateViews[r]=n;else throw new Error("Not my child view!")}render(e,n,r={}){!this.isVisible()||(this.coords=n,e.pushView(this,n),e.renderMark(this.mark,r),e.popView(this))}getMarkType(){return typeof this.spec.mark=="object"?this.spec.mark.type:this.spec.mark}resolve(e){var r;const n=this.mark.encoding;for(const[i,o]of Object.entries(n)){if(!Ke(o))continue;let a=Pr((r=o.resolutionChannel)!=null?r:i);if(e=="axis"&&!io(a))continue;let s=this;for(;s.parent instanceof rr&&["shared","excluded"].includes(s.parent.getConfiguredOrDefaultResolution(a,e))&&s.getConfiguredOrDefaultResolution(a,e)!="excluded";)s=s.parent;s.resolutions[e][a]||(s.resolutions[e][a]=e=="scale"?new u8(a):new h8(a)),io(i)?s.resolutions[e][a].pushUnitView(this,i):e=="scale"&&s.resolutions[e][a].pushUnitView(this,i)}}getAccessor(e){return this._cache("accessor/"+e,()=>{const n=this.mark.encoding;if(n&&n[e])return this.context.accessorFactory.createAccessor(n[e])})}getFacetAccessor(e){const n=this.getAccessor("sample");return n||super.getFacetAccessor(this)}getCollector(){return this.context.dataFlow.findCollectorByKey(this)}_validateDomainQuery(e){if(oo(e))throw new Error(`getDomain(${e}), must only be called for primary channels!`);const n=this.mark.encoding[e];if(!Ke(n))throw new Error("The channel has no scale, cannot get domain!");return n}getConfiguredDomain(e){var i,o;const n=this._validateDomainQuery(e),r=n&&n.scale&&n.scale.domain;if(r){const a=this.getScaleResolution((i=n.resolutionChannel)!=null?i:e);return Gg((o=n.type)!=null?o:"nominal",a.fromComplexInterval(r))}}extractDataDomain(e){var s;const r=(s=this._validateDomainQuery(e).type)!=null?s:"nominal",i=c=>{let u;const f=this.mark.encoding[c];if(f){const l=this.context.accessorFactory.createAccessor(f);if(l)if(u=Gg(r),l.constant)u.extend(l({}));else{const d=this.getCollector();d!=null&&d.completed&&d.visitData(h=>u.extend(l(h)))}}return u};let o=i(e);const a=qu[e];if(a){const c=i(a);c&&o.extendAll(c)}return o}getZoomLevel(){const e=n=>{var r,i;return(i=(r=this.getScaleResolution(n))==null?void 0:r.getZoomLevel())!=null?i:1};return ro.map(e).reduce((n,r)=>n*r,1)}_initializeAggregateViews(){var e,n;if(a1(this.spec))for(const r of this.spec.aggregateSamples){const i=(e=r.transform)!=null?e:[];i.length&&je(i).type!="collect"&&i.push({type:"collect"}),i.push({type:"mergeFacets"}),r.transform=i,r.encoding={...(n=r.encoding)!=null?n:{},sample:null};const o=this.context.createView(r,this,"summaryView");o.getFacetFields=a=>{},this.sampleAggregateViews.push(o)}}propagateInteractionEvent(e){e.target=this}getDefaultResolution(e,n){return e=="x"?"shared":"independent"}}function*Xl(t,e=[]){for(const[n,r]of t.entries())if(r instanceof Map)for(const i of Xl(r,[...e,n]))yield i;else yield[[...e,n],r]}class Zr extends ue{constructor(e){super(),this.params=e!=null?e:{type:"collect"},this.observers=[],this.facetBatches=void 0,this._init()}_init(){this._data=[],this.facetBatches=new In([],JSON.stringify),this.facetBatches.set(void 0,this._data)}reset(){super.reset(),this._init()}handle(e){this._data.push(e)}beginBatch(e){rM(e)&&(this._data=[],this.facetBatches.set(qe(e.facetId),this._data))}complete(){var i,o;const e=(i=this.params)==null?void 0:i.sort,n=e?Gd(e.field,e.order):void 0,r=a=>{n&&a.sort(n)};if((o=this.params.groupby)!=null&&o.length){if(this.facetBatches.size>1)throw new Error("TODO: Support faceted data!");const a=this.params.groupby.map(c=>q(c)),s=gi(this._data,...a);this.facetBatches.clear();for(const[c,u]of Xl(s))this.facetBatches.set(c,u)}for(const a of this.facetBatches.values())r(a);if(this.children.length)for(const[a,s]of this.facetBatches.entries()){if(a){const c={type:"facet",facetId:a};for(const u of this.children)u.beginBatch(c)}for(const c of s)this._propagate(c)}super.complete();for(const a of this.observers)a(this)}getData(){switch(this._checkStatus(),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{const e=this.facetBatches;return{[Symbol.iterator]:function*(){for(const r of e.values())for(let i=0;i<r.length;i++)yield r[i]}}}}}visitData(e){this._checkStatus();for(const n of this.facetBatches.values())for(let r=0;r<n.length;r++)e(n[r])}getItemCount(){let e=0;for(const n of this.facetBatches.values())e+=n.length;return e}_checkStatus(){if(!this.completed)throw new Error("Data propagation is not completed! No data are available.")}}class wo{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(e,n){let r=this.length++;for(;r>0;){const i=r-1>>1,o=this.values[i];if(n>=o)break;this.ids[r]=this.ids[i],this.values[r]=o,r=i}this.ids[r]=e,this.values[r]=n}pop(){if(this.length===0)return;const e=this.ids[0];if(this.length--,this.length>0){const n=this.ids[0]=this.ids[this.length],r=this.values[0]=this.values[this.length],i=this.length>>1;let o=0;for(;o<i;){let a=(o<<1)+1;const s=a+1;let c=this.ids[a],u=this.values[a];const f=this.values[s];if(s<this.length&&f<u&&(a=s,c=this.ids[s],u=f),u>=r)break;this.ids[o]=c,this.values[o]=u,o=a}this.ids[o]=n,this.values[o]=r}return e}peek(){if(this.length!==0)return this.ids[0]}peekValue(){if(this.length!==0)return this.values[0]}shrink(){this.ids.length=this.values.length=this.length}}class P8 extends ue{get behavior(){return Ot}constructor(e){super(),this.params=e,this.startAccessor=q(e.start),this.endAccessor=q(e.end),this.chromAccessor=e.chrom?q(e.chrom):n=>{},this.weightAccessor=e.weight?q(e.weight):n=>1,this.as={coverage:e.as||"coverage",start:e.asStart||e.start,end:e.asEnd||e.end,chrom:e.asChrom||e.chrom},this.createSegment=new Function("start","end","coverage","chrom","return {"+Object.entries(this.as).filter(([n,r])=>r).map(([n,r])=>`${JSON.stringify(r)}: ${n}`).join(", ")+"};"),this.ends=new wo}reset(){super.reset(),this.initialize()}initialize(){const e=this.as.coverage,n=this.as.end,r=this.as.chrom,i=this.startAccessor,o=this.endAccessor,a=this.chromAccessor,s=this.weightAccessor;let c,u,f,l=0,d;const h=this.ends;h.clear();const p=(g,y,A)=>{if(g==y)return;let x=!1;c&&(c[e]===A?(c[n]=y,x=!0):c[e]!=0&&this._propagate(c)),x||(c=this.createSegment(g,y,A,f))},m=()=>{let g;for(;(g=h.peekValue())!==void 0;)p(d,g,l),d=g,l-=h.pop();d=void 0,c&&(this._propagate(c),c=void 0)};this.handle=g=>{const y=i(g);let A;for(;(A=h.peekValue())!==void 0&&A<y;)p(d,A,l),d=A,l-=h.pop();if(r){let w=a(g);w!==u&&(m(),f=w,u=f)}d!==void 0&&p(d,y,l),d=y;const x=s(g);l+=x,h.push(x,o(g))},this.complete=()=>{m(),super.complete()}}}function F8(t,e,n=0,r=t.length){const i=new wo,o=r-n;let a;for(a=0;a<e&&a<o;a++)i.push(a,t[n+a]);for(;a<o;a++){const u=t[n+a];u>=i.peekValue()&&(i.push(a,u),i.pop())}const s=[];let c;for(;(c=i.pop())!==void 0;)s.push(n+c);return s.reverse()}class z8{constructor(e,n=-1/0,r=1/0){this.maxSize=e,this.lowerLimit=n,this.upperLimit=r;const i=this.maxSize*2+1;this.lowerLimits=new Float64Array(i),this.upperLimits=new Float64Array(i),this.lowerChildren=new Int32Array(i),this.upperChildren=new Int32Array(i),this.reset()}reset(){this.lowerLimits.fill(0),this.upperLimits.fill(0),this.lowerChildren.fill(0),this.upperChildren.fill(0),this.n=1,this.lowerLimits[0]=this.lowerLimit,this.upperLimits[0]=this.upperLimit}_findSlot(e,n,r=0){if(e>=this.lowerLimits[r]&&n<=this.upperLimits[r]){const i=this.lowerChildren[r];if(i){const o=this._findSlot(e,n,i);return o>=0?o:this._findSlot(e,n,this.upperChildren[r])}else return r}else return-1}reserve(e,n){if(n-e<=0)throw new Error("Cannot reserve an empty or negative-size slot!");if(this.n+1>this.lowerLimits.length)return!1;const r=this._findSlot(e,n);if(r<0)return!1;const i=this.n++,o=this.n++;return this.lowerLimits[i]=this.lowerLimits[r],this.upperLimits[i]=e,this.lowerLimits[o]=n,this.upperLimits[o]=this.upperLimits[r],this.lowerChildren[r]=i,this.upperChildren[r]=o,!0}}class R8 extends ue{constructor(e,n){var i,o;if(super(),this.params=e,this._data=[],this.channel=(i=e.channel)!=null?i:"x",!["x","y"].includes(this.channel))throw new Error("Invalid channel: "+this.channel);this.posAccessor=q(this.params.pos),this.posBisector=ca(this.posAccessor),this.scoreAccessor=q(this.params.score),this.widthAccessor=q(this.params.width),this.laneAccessor=this.params.lane?q(this.params.lane):a=>0,this.padding=(o=this.params.padding)!=null?o:0,this.reservationMaps=new Map,this.resolution=n.getScaleResolution(this.channel);const r=()=>this._filterAndPropagate();this.schedule=()=>n.context.animator.requestTransition(r),this.resolution.addEventListener("domain",a=>this.schedule()),n._addBroadcastHandler("layoutComputed",()=>this.schedule())}complete(){const e=this.posAccessor;this._data.sort((n,r)=>e(n)-e(r)),this._scores=this._data.map(this.scoreAccessor);for(const n of new Set(this._data.map(this.laneAccessor)))this.reservationMaps.set(n,new z8(200));this.schedule(),super.complete()}_filterAndPropagate(){var a;super.reset();const e=this.resolution.getScale(),n=(a=this.resolution.members[0].view.coords)==null?void 0:a[this.channel=="x"?"width":"height"];if(!n)return;for(const s of this.reservationMaps.values())s.reset();const r=e.domain(),i=70,o=F8(this._scores,i,this.posBisector.left(this._data,r[0]),this.posBisector.right(this._data,r[1]));for(const s of o){const c=this._data[s],u=e(this.posAccessor(c))*n,f=this.widthAccessor(c)/2+this.padding;this.reservationMaps.get(this.laneAccessor(c)).reserve(u-f,u+f)&&this._propagate(c)}super.complete()}reset(){super.reset(),this._data=[],this.groups=new Map}handle(e){this._data.push(e)}}class j8 extends ue{constructor(e){super(),this.params=e,this.predicate=void 0}initialize(){this.predicate=Wu(this.params.expr,this.getGlobalObject())}handle(e){this.predicate(e)&&this._propagate(e)}}const U8="0".charCodeAt(0);function*H8(t,e=","){const n=e.charCodeAt(0);let r=0;for(let i=0;i<t.length;i++){const o=t.charCodeAt(i);o==n?(yield r,r=0):r=r*10+o-U8}yield r}class G8 extends ue{get behavior(){return Ot}constructor(e){var a,s;super();const n=q((a=e.exons)!=null?a:"exons"),r=q((s=e.start)!=null?s:"start"),[i,o]=e.as||["exonStart","exonEnd"];this.handle=c=>{let u=r(c),f=u,l=!0;const d=n(c);for(const h of H8(d)){if(l)f=u+h;else{u=f+h;const p=Object.assign({},c);p[i]=f,p[o]=u,this._propagate(p)}l=!l}}}}class Q8 extends ue{get behavior(){return Ot}constructor(e){super();const n=qe(e.field).map(o=>q(o)),r=qe(e.separator),i=qe(e.as||e.field);if(n.length!==r.length||n.length!==i.length)throw new Error(`Lengths of "separator" (${r.length}), "fields" (${n.length}), and "as" (${i.length}) do not match!`);this.handle=o=>{if(n.some(c=>!c(o)))return;const a=n.map((c,u)=>c(o).split(r[u]));V8(a,o);const s=a[0].length;for(let c=0;c<s;c++){const u=Object.assign({},o);for(let f=0;f<n.length;f++)u[i[f]]=a[f][c];this._propagate(u)}}}}function V8(t,e){const n=t.map(r=>r.length);if(!n.every(r=>r==n[0]))throw new Error("Mismatching number of elements in the fields to be split: "+JSON.stringify(e))}class Y8 extends ue{get behavior(){return hn}constructor(e){super(),this.params=e,this.as=e.as,this.fn=void 0}initialize(){this.fn=Wu(this.params.expr,this.getGlobalObject())}handle(e){e[this.as]=this.fn(e),this._propagate(e)}}class s1 extends ue{get behavior(){return hn}constructor(e,n){var p;super();const r=(p=e.channel)!=null?p:"x";if(!["x","y"].includes(r))throw new Error("Invalid channel: "+r);const i=n.getScaleResolution(r).getGenome();if(!i)throw new Error("LinearizeGenomicCoordinate transform requires a locus scale!");const o=q(e.chrom),a=qe(e.pos).map(m=>q(m)),s=qe(e.as);if(a.length!=s.length)throw new Error('The number of "pos" and "as" elements must be equal!');const c=qe(e.offset);let u;if(c.length==0)u=new Array(a.length).fill(0);else if(c.length==1)u=new Array(a.length).fill(c[0]);else if(c.length==a.length)u=c;else throw new Error(`Invalid "offset" parameter: ${JSON.stringify(e.offset)}!`);const f=new Function("datum","chromOffset","posAccessors",s.map((m,g)=>`datum[${JSON.stringify(m)}] = chromOffset + +posAccessors[${g}](datum) - ${u[g]};`).join(`
1346
+ */const FM="locus",zM="index";var RM=5;function jM(t){const e=t.type;return!t.bins&&(e===Ir||e===ji||e===Ui)}function Bg(t){return Re(t)&&![pt,zM,FM].includes(t)}function Og(t){return t||{warn:(e,...n)=>console.warn(e,...n)}}var UM=sa(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma","zoom","fp64","name"]);function Pg(t,e,n){n=Og(n);for(const r in t)if(!UM[r]){if(r==="padding"&&Bg(e.type))continue;ke(e[r])?e[r](t[r]):n.warn("Unsupported scale property: "+r)}XM(e,t,WM(e,t,VM(e,t,n)))}function HM(t,e){const n=GM(t),r=X(n);if(!r)throw new Error("Unknown scale type: "+n);const i=r();return Pg(t,i,e),i}function GM(t){var e=t.type,n="",r;return e===pt?pt+"-"+Ir:(QM(t)&&(r=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(t.domainMid!=null):0,n=r===2?pt+"-":r===3?kr+"-":""),(n+e||Ir).toLowerCase())}function QM(t){const e=t.type;return Re(e)&&e!==$0&&e!==ep&&(t.scheme||t.range&&t.range.length&&t.range.every(ne))}function VM(t,e,n){if(!t.domain)return 0;n=Og(n);var r=YM(t,e.domainRaw,n);if(r>-1)return r;var i=e.domain,o=t.type,a=e.zero||e.zero===void 0&&jM(t),s,c;return i?(Bg(o)&&e.padding&&i[0]!==nt(i)&&(i=_M(o,i,e.range,e.padding,e.exponent,e.constant)),(a||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(s=(i=i.slice()).length-1||1,a&&(i[0]>0&&(i[0]=0),i[s]<0&&(i[s]=0)),e.domainMin!=null&&(i[0]=e.domainMin),e.domainMax!=null&&(i[s]=e.domainMax),e.domainMid!=null&&(c=e.domainMid,(c<i[0]||c>i[s])&&n.warn("Scale domainMid exceeds domain min or max.",c),i.splice(s,0,c))),t.domain(Fg(o,i,n)),o===Lu&&t.unknown(e.domainImplicit?$c:void 0),e.nice&&t.nice&&t.nice(e.nice!==!0&&Ng(t,e.nice)||null),i.length):0}function YM(t,e,n){return e?(t.domain(Fg(t.type,e,n)),e.length):-1}function _M(t,e,n,r,i,o){var a=Math.abs(nt(n)-n[0]),s=a/(a-2*r),c=t===rn?Hd(e,null,s):t===Ui?yc(e,null,s,.5):t===ji?yc(e,null,s,i||1):t===Pa?tb(e,null,s,o||1):gc(e,null,s);return e=e.slice(),e[0]=c[0],e[e.length-1]=c[1],e}function Fg(t,e,n){if(sp(t)){var r=Math.abs(e.reduce(function(i,o){return i+(o<0?-1:o>0?1:0)},0));r!==e.length&&n.warn("Log scale domain includes zero: "+aa(e))}return e}function WM(t,e,n){let r=e.bins;if(r&&!We(r)){const i=(r.start==null||r.stop==null)&&t.domain(),o=r.start==null?i[0]:r.start,a=r.stop==null?nt(i):r.stop,s=r.step;s||ae("Scale bins parameter missing step property."),r=Xt(o,a+s,s)}return r?t.bins=r:t.bins&&delete t.bins,t.type===Ou&&(r?!e.domain&&!e.domainRaw&&(t.domain(r),n=r.length):t.bins=t.domain()),n}function XM(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(e.rangeStep!=null)o=ZM(r,e,n);else if(e.scheme&&(o=qM(r,e,n),ke(o))){if(t.interpolator)return t.interpolator(o);ae(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&za(r))return t.interpolator(Ra(Pl(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(cp(e.interpolate,e.interpolateGamma)):ke(t.round)?t.round(i):ke(t.rangeRound)&&t.interpolate(i?zi:tn),o&&t.range(Pl(o,e.reverse))}function ZM(t,e,n){t!==rp&&t!==Bu&&ae("Only band and point scales support rangeStep.");var r=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,i=t===Bu?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*ku(n,i,r)]}function qM(t,e,n){var r=e.schemeExtent,i,o;return We(e.scheme)?o=Ra(e.scheme,e.interpolate,e.interpolateGamma):(i=e.scheme.toLowerCase(),o=Fu(i),o||ae(`Unrecognized scheme name: ${e.scheme}`)),n=t===np?n+1:t===Ou?n-1:t===Nu||t===tp?+e.schemeCount||RM:n,za(t)?zg(o,r,e.reverse):ke(o)?n4(zg(o,r),n):t===Lu?o:o.slice(0,n)}function zg(t,e,n){return ke(t)&&(e||n)?t4(t,Pl(e||[0,1],n)):t}function Pl(t,e){return e?t.slice().reverse():t}const Fl=de(",d");function KM(t){return t.chrom+":"+Fl(Math.floor(t.pos+1))}function JM(t,e){return t.chrom+":"+Fl(Math.floor(t.pos+1))+"-"+(t.chrom!=e.chrom?e.chrom+":":"")+Fl(Math.ceil(e.pos))}const $M="https://genomespy.app/data/genomes/";class e8{constructor(e){if(this.config=e,!this.config.contigs&&typeof this.config.name!="string")throw new Error("No name has been defined for the genome assembly!");this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,this.config.contigs&&this.setChromSizes(this.config.contigs)}get name(){return this.config.name}async load(e){if(!this.config.contigs){this.config.baseUrl?this.baseUrl=/^http(s)?/.test(this.config.baseUrl)?this.config.baseUrl:e+"/"+this.config.baseUrl:this.baseUrl=$M;try{this.setChromSizes(t8(await Bi({baseURL:this.baseUrl}).load(`${this.config.name}/${this.name}.chrom.sizes`)))}catch(n){throw new Error(`Could not load chrom sizes: ${n.message}`)}}}setChromSizes(e){let n=0;this.startByIndex=[0];for(let r=0;r<e.length;r++){this.startByIndex.push(n);const i=e[r].size,o={...e[r],continuousStart:n,continuousEnd:n+i,continuousInterval:[n,n+i],index:r,number:r+1,odd:!(r&1)};this.chromosomes.push(o);const a=o.name.replace(/^chr/i,"");for(const s of["chr"+a,"CHR"+a,"Chr"+a,o.number,""+o.number,a,o.name])this.cumulativeChromPositions.set(s,n),this.chromosomesByName.set(s,o);n+=o.size}this.totalSize=n}getExtent(){return[0,this.totalSize]}toContinuous(e,n){let r=this.cumulativeChromPositions.get(e);if(r===void 0)throw new Error("Unknown chromosome/contig: "+e);return r+ +n}toChromosome(e){if(e>=this.totalSize)return;e=Math.floor(e);const n=Tn(this.startByIndex,e)-1;if(n>0&&n<=this.chromosomes.length)return this.chromosomes[n-1]}toChromosomal(e){const n=this.toChromosome(e);if(!!n)return{chrom:n.name,pos:Math.floor(e)-n.continuousStart}}getChromosome(e){return this.chromosomesByName.get(e)}formatInterval(e){return JM(...this.toChromosomalInterval(e))}toChromosomalInterval(e){const n=this.toChromosomal(e[0]+.5),r=this.toChromosomal(e[1]-.5);return r.pos+=1,[n,r]}toContinuousInterval(e){var i,o,a;let[n,r]=e;return r||(r=n),[this.toContinuous(n.chrom,(i=n.pos)!=null?i:0),this.toContinuous(r.chrom,(a=r.pos)!=null?a:(o=this.chromosomesByName.get(r.chrom))==null?void 0:o.size)]}parseInterval(e){const n=e.match(/^(chr[0-9A-Z]+)(?::([0-9,]+)(?:-(?:(chr[0-9A-Z]+):)?([0-9,]+))?)?$/);if(n){const r=n[1];if(n.slice(2).every(s=>s===void 0)){const s=this.getChromosome(r);return s?[s.continuousStart,s.continuousEnd]:void 0}const i=n[3]||r,o=parseInt(n[2].replace(/,/g,"")),a=n[4]!==void 0?parseInt(n[4].replace(/,/g,"")):o;return[this.toContinuous(r,o-1),this.toContinuous(i,a)]}}}function t8(t){return Ab(t).filter(e=>/^chr[0-9A-Z]+$/.test(e[0])).map(([e,n])=>({name:e,size:parseInt(n)}))}function Rg(t){return ze(t)&&"chrom"in t}function n8(t){return t.every(Rg)}class xo extends Array{constructor(){super(),this.type=void 0}extend(e){return this}extendAll(e){if(e instanceof xo&&e.type!=this.type)throw new Error(`Cannot combine different types of domains: ${this.type} and ${e.type}`);for(const n of e)this.extend(n);return this}extendAllWithAccessor(e,n){for(const r of e)this.extend(n(r));return this}}class zl extends xo{constructor(){super(),this.type="quantitative"}extend(e){return e==null||Number.isNaN(e)?this:(e=+e,this.length?e<this[0]?this[0]=e:e>this[1]&&(this[1]=e):(this.push(e),this.push(e)),this)}}class jg extends xo{constructor(){super(),this.type="ordinal",this.uniqueValues=new Set}extend(e){return e==null||Number.isNaN(e)?this:(this.uniqueValues.has(e)||(this.uniqueValues.add(e),this.push(e)),this)}}class Ug extends jg{constructor(){super(),this.type="nominal"}}class r8 extends xo{constructor(e){super();let n=0;for(let r=1;r<e.length;r++)n+=Math.sign(e[r]-e[r-1]);if(Math.abs(n)!=e.length-1)throw new Error("Piecewise domain must be strictly increasing or decreasing: "+JSON.stringify(e));e.forEach(r=>this.push(r))}extend(e){if(this.includes(e))return this;throw new Error("Piecewise domains are immutable and cannot be unioned!")}}const Hg={quantitative:zl,index:zl,locus:zl,nominal:Ug,ordinal:jg};function Gg(t,e){if(t=="quantitative"&&i8(e)){const n=new r8(e);return n.type=t,n}else if(Hg[t]){const n=new Hg[t];return n.type=t,e&&n.extendAll(e),n}throw new Error("Unknown type: "+t)}function i8(t){return t&&t.length>0&&t.length!=2&&t.every(e=>typeof e=="number")}function Qg(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function o8(t){return--t*t*t+1}function a8(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}function s8(t){return 1-a8(t)}const Vg="quantitative",Rl="ordinal",jl="nominal",Yg="locus",c8="index";class u8{constructor(e){this.channel=e,this.members=[],this.type=null,this._zoomExtent=void 0,this._domainListeners=new Set,this.name=void 0,this._scale=void 0}addEventListener(e,n){if(e!="domain")throw new Error("Unsupported event type: "+e);this._domainListeners.add(n)}removeEventListener(e,n){if(e!="domain")throw new Error("Unsupported event type: "+e);this._domainListeners.delete(n)}_notifyDomainListeners(){for(const e of this._domainListeners.values())e({type:"domain",scaleResolution:this})}pushUnitView(e,n){var a;const r=Xu(e,n),i=r.type,o=(a=r==null?void 0:r.scale)==null?void 0:a.name;if(o){if(this.name!==void 0&&o!=this.name)throw new Error(`Shared scales have conflicting names: "${o}" vs. "${this.name}"!`);this.name=o}if(!this.type)this.type=i;else if(i!==this.type&&!oo(n))throw new Error(`Can not use shared scale for different data types: ${this.type} vs. ${i}. Use "resolve: independent" for channel ${this.channel}`);this.members.push({view:e,channel:n})}isExplicitDomain(){return!!this.getConfiguredDomain()}_getMergedScaleProps(){return _r(this,"mergedScaleProps",()=>{const e=this.members.map(n=>Xu(n.view,n.channel).scale).filter(n=>n!==void 0);return bs(e,"scale",["domain"])})}getScaleProps(){return _r(this,"scaleProps",()=>{var i,o;const e=this._getMergedScaleProps();if(e===null||e.type=="null")return{type:"null"};const n={...this._getDefaultScaleProperties(this.type),...e};n.type||(n.type=l8(this.channel,this.type));const r=this.getInitialDomain();return r&&r.length>0?n.domain=r:on(n.type)&&(n.domain=new Ug),!n.domain&&n.domainMid!==void 0&&(n.domain=[(i=n.domainMin)!=null?i:0,(o=n.domainMax)!=null?o:1]),this.channel=="y"&&on(n.type)&&n.reverse==null&&(n.reverse=!0),n.range&&n.scheme&&delete n.scheme,!("zoom"in n)&&["index","locus"].includes(n.type)&&(n.zoom=!0),f8(n,this.channel),n})}getInitialDomain(){var e;return(e=this.getConfiguredDomain())!=null?e:this.type==Yg?this.getGenome().getExtent():this.getDataDomain()}getConfiguredDomain(){return this._reduceDomains(e=>oo(e.channel)?void 0:e.view.getConfiguredDomain(e.channel))}getDataDomain(){return this._reduceDomains(e=>oo(e.channel)?void 0:e.view.extractDataDomain(e.channel))}reconfigure(){if(this._scale&&this._scale.type!="null"){mg(this,"scaleProps");const e=this.getScaleProps();Pg(e,this._scale),Re(this._scale.type)&&(this._zoomExtent=this._getZoomExtent())}}getScale(){if(this._scale)return this._scale;const e=this.getScaleProps(),n=HM(e);return this._scale=n,Qx(n)&&n.genome(this.getGenome()),Re(n.type)&&(this._zoomExtent=this._getZoomExtent()),n}getDomain(){return this.getScale().domain()}getComplexDomain(){var e,n;return(n=(e=this.getGenome())==null?void 0:e.toChromosomalInterval(this.getDomain()))!=null?n:this.getDomain()}isZoomed(){return this.isZoomable()&&Ip(this.getInitialDomain(),this.getDomain())}isZoomable(){if(!Vp(this.channel))return!1;const e=this.getScale().type;return["linear","locus","index","log","pow","sqrt"].includes(e)?!!this.getScaleProps().zoom:!1}zoom(e,n,r){if(!this.isZoomable())return!1;const i=this.getScale(),o=i.domain();let a=[...o],s=i.invert(n);switch(this.getScaleProps().reverse&&(r=-r),"align"in i&&(s+=i.align()),i.type){case"linear":case"index":case"locus":a=J2(a,r||0),a=gc(a,s,e);break;case"log":a=$2(a,r||0),a=Hd(a,s,e);break;case"pow":case"sqrt":{const c=i;a=eb(a,r||0,c.exponent()),a=yc(a,s,e,c.exponent());break}default:throw new Error("Zooming is not implemented for: "+i.type)}return this._zoomExtent&&(a=nb(a,this._zoomExtent[0],this._zoomExtent[1])),[0,1].some(c=>a[c]!=o[c])?(i.domain(a),this._notifyDomainListeners(),!0):!1}async zoomTo(e,n=!1){var s;if(ia(n)&&(n=n?700:0),!this.isZoomable())throw new Error("Not a zoomable scale!");const r=this.fromComplexInterval(e),i=(s=this.members[0])==null?void 0:s.view.context.animator,o=this.getScale(),a=o.domain();if(n>0&&a.length==2){const c=a[1]-a[0],u=a[0]+c/2,f=r[1]-r[0],l=r[0]+f/2,d=I0([u,0,c],[l,0,f]).rho(.7);await i.transition({duration:n/1e3*d.duration,easingFunction:Qg,onUpdate:h=>{const[p,,m]=d(h);o.domain([p-m/2,p+m/2]),this._notifyDomainListeners()}}),o.domain(r),this._notifyDomainListeners()}else o.domain(r),i==null||i.requestRender(),this._notifyDomainListeners()}resetZoom(){if(!this.isZoomable())throw new Error("Not a zoomable scale!");const e=this.getDomain(),n=this.getInitialDomain();return[0,1].some(r=>n[r]!=e[r])?(this._scale.domain(n),this._notifyDomainListeners(),!0):!1}getZoomLevel(){return this.isZoomable()?oa(this._zoomExtent)/oa(this.getScale().domain()):1}_getZoomExtent(){const e=this.getScaleProps(),n=e.zoom;if(d8(n)&&We(n.extent))return this.fromComplexInterval(n.extent);if(n)return e.type=="locus"?this.getGenome().getExtent():this._scale.domain()}_getDefaultScaleProperties(e){const n=this.channel,r={};return this.isExplicitDomain()&&(r.zero=!1),io(n)?r.nice=!this.isExplicitDomain():qn(n)?r.scheme=e==jl?"tableau10":e==Rl?"blues":"viridis":_a(n)?r.range=_p(n):n=="size"?r.range=[0,400]:n=="angle"&&(r.range=[0,360]),r}getGenome(){var n;if(this.type!=="locus")return;const e=(n=this.members[0].view.context.genomeStore)==null?void 0:n.getGenome();if(!e)throw new Error("No genome has been defined!");return e}invertToComplex(e){const n=this.getScale();if("invert"in n){const r=n.invert(e);return this.toComplex(r)}else throw new Error("The scale does not support inverting!")}toComplex(e){const n=this.getGenome();return n?n.toChromosomal(e):e}fromComplex(e){return Rg(e)?this.getGenome().toContinuous(e.chrom,e.pos):e}fromComplexInterval(e){return this.type==="locus"&&n8(e)?this.getGenome().toContinuousInterval(e):e}_getViewPaths(){return this.members.map(e=>e.view.getPathString()).join(", ")}_reduceDomains(e){const n=this.members.map(e).filter(r=>!!r);if(n.length)return n.reduce((r,i)=>r.extendAll(i))}}function l8(t,e){if(e==c8||e==Yg){if(Vp(t))return e;throw new Error(`${t} does not support ${e} data type. Only positional channels do.`)}const n={x:["band","band","linear"],y:["band","band","linear"],size:[void 0,"point","linear"],opacity:[void 0,"point","linear"],fillOpacity:[void 0,"point","linear"],strokeOpacity:[void 0,"point","linear"],color:["ordinal","ordinal","linear"],fill:["ordinal","ordinal","linear"],stroke:["ordinal","ordinal","linear"],strokeWidth:[void 0,void 0,"linear"],shape:["ordinal","ordinal",void 0],dx:[void 0,void 0,"null"],dy:[void 0,void 0,"null"],angle:[void 0,void 0,"linear"]},i=["uniqueId","facetIndex","semanticScore","search","text","sample"].includes(t)?"null":n[t]?n[t][[jl,Rl,Vg].indexOf(e)]:e==Vg?"linear":"ordinal";if(i===void 0)throw new Error(`Channel "${t}" is not compatible with "${e}" data type. Use of a proper scale may be needed.`);return i}function f8(t,e){io(e)&&t.type!=="ordinal"&&(t.range=[0,1]),e=="opacity"&&Re(t.type)&&(t.clamp=!0)}function d8(t){return ze(t)}function Ul(...t){for(const e of t)if(e!==void 0)return e}class h8{constructor(e){this.channel=e,this.members=[]}get scaleResolution(){var e;return(e=je(this.members))==null?void 0:e.view.getScaleResolution(this.channel)}pushUnitView(e,n){const r=e.getScaleResolution(this.channel);if(!r)throw new Error("Cannot find a scale resolution!");if(this.scaleResolution&&r!==this.scaleResolution)throw new Error("Shared axes must have a shared scale!");this.members.push({view:e,channel:n})}getAxisProps(){return _r(this,"axisProps",()=>{const e=this.members.map(n=>{const r=n.view.mark.encoding[n.channel];return"axis"in r&&r.axis});return e.length>0&&e.some(n=>n===null)?null:bs(e.filter(n=>n!==void 0),"axis",["title"])})}getTitle(){const e=o=>{var s;const a=Xu(o.view,o.channel);if(!at(a))return{member:o,explicitTitle:Ul((s=a.axis)==null?void 0:s.title,a.title),implicitTitle:Ul(Zn(a)?a.field:void 0,Zu(a)?a.expr:void 0)}},n=this.members.map(e),r=n.filter(o=>{var a;if(oo(o.member.channel)&&!o.explicitTitle){const s=Pr(o.member.channel);return((a=n.find(c=>c.member.view==o.member.view&&c.member.channel==s))==null?void 0:a.explicitTitle)===void 0}return!0}),i=new Set(r.map(o=>Ul(o.explicitTitle,o.implicitTitle)).filter(ne));return i.size?[...i].join(", "):null}}class _g extends Ig{constructor(e,n,r,i){super(e,n,r,i),this.spec=e}}class Pt extends rr{constructor(e,n,r,i){super(e,n,r,i),this.spec=e,this.children=(e.layer||[]).map((o,a)=>{if(Yl(o)||Vl(o))return n.createView(o,this,"layer"+a);throw new Error("LayerView accepts only unit or layer specs as children!")})}*[Symbol.iterator](){for(const e of this.children)yield e}render(e,n,r={}){if(!!this.isVisible()){e.pushView(this,n);for(const i of this.children)i.render(e,n,r);e.popView(this)}}propagateInteractionEvent(e){this.handleInteractionEvent(void 0,e,!0),this.children.length&&this.children.at(-1).propagateInteractionEvent(e),!e.stopped&&this.handleInteractionEvent(void 0,e,!1)}}class Wg{constructor(e,n){this.n=e,this.maxCols=n!=null?n:1/0}get nRows(){return this.maxCols==1/0?1:Math.ceil(this.n/this.maxCols)}get nCols(){return Math.min(this.n,this.maxCols)}get rowIndices(){const e=[],n=this.nCols,r=this.nRows;for(let i=0;i<r;i++){const o=[];e.push(o);for(let a=0;a<n;a++){const s=i*n+a;s<this.n&&o.push(s)}}return e}get colIndices(){const e=[],n=this.nCols,r=this.nRows;for(let i=0;i<n;i++){const o=[];e.push(o);for(let a=0;a<r;a++){const s=a*n+i;s<this.n&&o.push(s)}}return e}getCellIndex(e,n){let r=0;if(this.maxCols==1/0)r=n==0?e:void 0;else{if(e>=this.maxCols)return;r=n*this.nCols+e}return r<this.n?r:void 0}getCellCoords(e){if(!(e<0||e>=this.n))return[e%this.nCols,Math.floor(e/this.nCols)]}}function Ft(t){return()=>t}const _t=class{static create(e,n,r,i){return new _t(Ft(e),Ft(n),Ft(r),Ft(i))}_offset(e,n){const r=this["_"+e];if(n===0)return r;switch(typeof n){case"number":return()=>r()+n;case"function":return()=>r()+n();default:throw new Error("Not a number of function")}}_passThrough(e){return this._offset(e,0)}constructor(e,n,r,i){this._x=e,this._y=n,this._width=r,this._height=i}get x(){return this._x()}get y(){return this._y()}get width(){return this._width()}get height(){return this._height()}get x2(){return this._x()+this._width()}get y2(){return this._y()+this._height()}equals(e){return e?this===e||this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height:!1}modify(e){if(!Object.keys(e).length)return this;const n=r=>{const i=e[r];return typeof i=="number"?Ft(i):typeof i=="function"?i:this._passThrough(r)};return new _t(n("x"),n("y"),n("width"),n("height"))}translate(e,n){return e===0&&n===0?this:new _t(this._offset("x",e),this._offset("y",n),this._passThrough("width"),this._passThrough("height"))}translateBy(e){return this.translate(e.x,e.y)}expand(e,n=1){return e.left==0&&e.top==0&&e.right==0&&e.bottom==0?this:new _t(e.left?this._offset("x",-e.left*n):this._passThrough("x"),e.top?this._offset("y",-e.top*n):this._passThrough("y"),e.width?this._offset("width",e.width*n):this._passThrough("width"),e.height?this._offset("height",e.height*n):this._passThrough("height"))}shrink(e){return this.expand(e,-1)}intersect(e){return this===e?this:new _t(()=>Math.max(this.x,e.x),()=>Math.max(this.y,e.y),()=>Math.min(this.x2,e.x2)-Math.max(this.x,e.x),()=>Math.min(this.y2,e.y2)-Math.max(this.y,e.y))}isDefined(){return this.width>=0&&this.height>=0}flatten(){return new _t(Ft(this.x),Ft(this.y),Ft(this.width),Ft(this.height))}containsPoint(e,n){return e>=this.x&&e<this.x2&&n>=this.y&&n<this.y2}normalizePoint(e,n){return{x:(e-this.x)/this.width,y:(n-this.y)/this.height}}toString(){return`Rectangle: x: ${this.x}, y: ${this.y}, width: ${this.width}, height: ${this.height}`}};let pn=_t;hc(pn,"ZERO",_t.create(0,0,0,0));function Xg(t,e,n){return n=(n-t)/(e-t),n=Math.max(0,Math.min(1,n)),n*n*(3-2*n)}class ir extends ue{get identifier(){}handle(e){throw new Error("Source does not handle incoming data!")}async load(){}}function Zg(t){var n,r;const e={...t.format};if((n=e.type)!=null||(e.type=y8(t)&&p8(t.url)),(r=e.parse)!=null||(e.parse="auto"),!e.type)throw new Error("Format for the data source was not defined and it could not be inferred: "+JSON.stringify(t));return e}function p8(t){var e;if(Array.isArray(t)&&(t=t[0]),t)return(e=t.match(/\.(csv|tsv|json)/))==null?void 0:e[1]}const As=t=>typeof t!="object"?m8:g8,m8=t=>({data:t}),g8=t=>t;function y8(t){return"url"in t}function v8(t){return"dynamicCallbackSource"in t}class qg extends ir{constructor(e){super(),this.callback=e}loadSynchronously(){if(!this.callback)return;const e=this.callback();if(!e||typeof e[Symbol.iterator]!="function")throw new Error("Dynamic data callback didn't return iterable data!");this.reset(),this.beginBatch({type:"file"});let n;for(const r of e)n||(n=As(r)),this._propagate(n(r));this.complete()}async load(){this.loadSynchronously()}}const Kg="chromosome_ticks_and_labels",Jg={x:"width",y:"height"};function Hl(t){return t=="x"?"y":"x"}const Gl={x:["bottom","top"],y:["left","right"]},$g=Object.fromEntries(Object.entries(Gl).map(([t,e])=>e.map(n=>[n,t])).flat(1));function or(t){return $g[t]}class e1 extends Pt{constructor(e,n,r,i){const o=n=="locus",a={...o?x8:t1,...A8(n,e),...e};if(super(o?w8(a):n1(a),r,i,`axis_${e.orient}`),this.axisProps=a,this.axisUpdateRequested=!0,this._addBroadcastHandler("layout",()=>{this.axisUpdateRequested=!0}),this.previousScaleDomain=[],this.axisLength=void 0,this.ticks=[],this.tickSource=new qg(()=>this.ticks),o){const s=or(this.axisProps.orient),c=this.getScaleResolution(s).getGenome();this.findChildByName(Kg).getDynamicDataSource=()=>new qg(()=>c.chromosomes)}this.blockEncodingInheritance=!0}getOrient(){return this.axisProps.orient}getSize(){const e={px:this.getPerpendicularSize()},n={grow:1};return $g[this.axisProps.orient]=="x"?new tr(n,e):new tr(e,n)}getPerpendicularSize(){return Ql(this.axisProps)}getDynamicDataSource(){return this.tickSource}_updateAxisData(){const e=or(this.axisProps.orient),n=this.getScaleResolution(e).getScale(),r=n.domain();if(Ip(r,this.previousScaleDomain)&&!this.axisUpdateRequested)return;this.previousScaleDomain=r;const i=this.ticks,o=b8(this.axisProps,n,this.axisLength,i);o!==i&&(this.ticks=o,this.tickSource.loadSynchronously()),this.axisUpdateRequested=!1}onBeforeRender(){super.onBeforeRender(),this._updateAxisData()}render(e,n,r={}){!this.isVisible()||(this.axisLength=n[Jg[or(this.getOrient())]],super.render(e,n,r))}isPickingSupported(){return!1}}function Ql(t){const e=or(t.orient);let n=t.ticks&&t.tickSize||0;return t.labels&&(n+=t.labelPadding,e=="x"?n+=t.labelFontSize:n+=30),t.title&&(n+=t.titlePadding+t.titleFontSize),n=Math.min(t.maxExtent||1/0,Math.max(t.minExtent||0,n)),n}function b8(t,e,n,r=[]){const i=s=>25+60*Xg(100,700,s);let o=le(t.tickCount)?t.tickCount:Math.round(n/i(n));o=Ng(e,o,t.tickMinStep);const a=t.values?Lg(e,t.values,o):IM(e,o);if(l4(a,r,s=>s,s=>s.value))return r;{const s=NM(e,o,t.format);return a.map(c=>({value:c,label:s(c)}))}}const t1={values:null,minExtent:20,maxExtent:1/0,offset:0,domain:!0,domainWidth:1,domainColor:"gray",domainDash:null,domainDashOffset:0,domainCap:"square",ticks:!0,tickSize:5,tickWidth:1,tickColor:"gray",tickDash:null,tickDashOffset:0,tickCap:"square",tickCount:null,tickMinStep:null,labels:!0,labelAlign:"center",labelBaseline:"middle",labelPadding:4,labelFontSize:10,labelLimit:180,labelColor:"black",format:null,titleColor:"black",titleFont:"sans-serif",titleFontSize:10,titlePadding:3};function A8(t,e){var s;const n=e.orient,r=t=="nominal"||t=="ordinal";let i="center",o="middle",a=(s=e.labelAngle)!=null?s:(n=="top"||n=="bottom")&&r?-90:0;switch(n){case"left":i="right";break;case"right":i="left";break;case"top":case"bottom":Math.abs(a)>30?(i=a>0==(n=="bottom")?"left":"right",o="middle"):o=n=="top"?"alphabetic":"top";break}return{labelAlign:i,labelAngle:a,labelBaseline:o}}function n1(t){const e={...t,extent:Ql(t)},n=or(e.orient),r=Hl(n),i=e.orient=="bottom"||e.orient=="right"?1:-1,o=e.orient=="bottom"||e.orient=="left"?1:0,a=()=>({name:"domain",data:{values:[0]},mark:{type:"rule",clip:!1,strokeDash:e.domainDash,strokeCap:e.domainCap,color:e.domainColor,[r]:o,size:e.domainWidth}}),s=()=>({name:"labels",mark:{type:"text",clip:!1,align:e.labelAlign,angle:e.labelAngle,baseline:e.labelBaseline,[r+"Offset"]:(e.tickSize+e.labelPadding)*i,[r]:o,size:e.labelFontSize,color:e.labelColor,minBufferSize:1500},encoding:{[n]:{field:"value",type:"quantitative"},text:{field:"label"}}}),c=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:e.tickDash,strokeCap:e.tickCap,color:e.tickColor,size:e.tickWidth,minBufferSize:300},encoding:{[r]:{value:o},[r+"2"]:{value:o-e.tickSize/e.extent*(o?1:-1)}}}),u=()=>({name:"title",data:{values:[0]},mark:{type:"text",clip:!1,align:"center",baseline:e.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(e.orient)],text:e.title,color:e.titleColor,[n]:.5,[r]:1-o}}),f=()=>{const d={name:"ticks_and_labels",encoding:{[n]:{field:"value",type:"quantitative"}},layer:[]};return e.ticks&&d.layer.push(c()),e.labels&&d.layer.push(s()),d},l={[Jg[Hl(or(e.orient))]]:e.extent,data:{dynamicCallbackSource:!0},layer:[]};return e.domain&&l.layer.push(a()),(e.ticks||e.labels)&&l.layer.push(f()),e.title&&l.layer.push(u()),l}const x8={...t1,chromTicks:!0,chromTickSize:18,chromTickWidth:1,chromTickColor:"#989898",chromTickDash:[4,2],chromTickDashOffset:1,chromLabels:!0,chromLabelFontSize:13,chromLabelFontWeight:"normal",chromLabelFontStyle:"normal",chromLabelColor:"black",chromLabelAlign:"left",chromLabelPadding:7};function w8(t){const e={...t,extent:Ql(t)},n=or(e.orient),r=Hl(n),i=e.orient=="bottom"||e.orient=="left"?1:0,o=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:t.chromTickDash,strokeDashOffset:t.chromTickDashOffset,[r]:i,[r+"2"]:i-e.chromTickSize/e.extent*(i?1:-1),color:t.chromTickColor,size:e.chromTickWidth}}),a=()=>{let u;switch(e.orient){case"top":u={y:0,angle:0,paddingX:4,dy:-e.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":u={y:1,angle:0,paddingX:4,dy:e.chromLabelPadding+e.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":u={x:1,angle:-90,paddingY:4,dy:-e.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":u={x:0,angle:90,align:"right",paddingY:4,dy:-e.chromLabelPadding};break;default:u={}}return{name:"chromosome_labels",mark:{type:"text",size:e.chromLabelFontSize,font:e.chromLabelFont,fontWeight:e.chromLabelFontWeight,fontStyle:e.chromLabelFontStyle,color:e.chromLabelColor,align:t.chromLabelAlign,baseline:"alphabetic",clip:!1,...u},encoding:{[n+"2"]:{field:"continuousEnd",type:"locus"},text:{field:"name"}}}};let s;switch(e.orient){case"bottom":case"top":s={};break;case"left":s={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":s={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:s={}}const c=n1({...t,...s});if(t.chromTicks||t.chromLabels){const u={name:Kg,data:{dynamicCallbackSource:!0},encoding:{[n]:{field:"continuousStart",type:"locus",band:0}},layer:[]};if(t.chromTicks&&u.layer.push(o()),t.chromLabels){u.layer.push(a());let f;c.layer.filter(l=>l.name=="ticks_and_labels").forEach(l=>l.layer.filter(d=>d.name=="labels").forEach(d=>{f=d.mark})),f&&(e.orient=="top"||e.orient=="bottom"?(f.viewportEdgeFadeWidthLeft=30,f.viewportEdgeFadeDistanceLeft=40):(f.viewportEdgeFadeWidthBottom=30,f.viewportEdgeFadeDistanceBottom=40))}c.layer.push(u)}return c}const r1={anchor:"middle",frame:"group",offset:10,orient:"top",align:void 0,angle:0,baseline:"alphabetic",dx:0,dy:0,color:void 0,font:void 0,fontSize:12,fontStyle:"normal",fontWeight:"normal"},C8={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},S8={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},E8={start:0,middle:.5,end:1},D8={start:"left",middle:"center",end:"right"};function M8(t){var u,f,l;if(!t)return;const e=ne(t)?{text:t}:t;if(!e.text||e.orient=="none")return;const n=(u={"track-title":C8,overlay:S8}[e.style])!=null?u:{},r={...r1,...n,...e};let i={},o={x:0,y:0};const a=E8[(f=r.anchor)!=null?f:"middle"];switch(r.orient){case"top":o={x:a,y:1},i={baseline:"alphabetic",angle:0};break;case"right":o={x:1,y:1-a},i={baseline:"alphabetic",angle:90};break;case"bottom":o={x:a,y:0},i={baseline:"top",angle:0};break;case"left":o={x:0,y:a},i={baseline:"alphabetic",angle:-90};break}const s={...r1,...i,...n,...e},c={xOffset:0,yOffset:0};switch(r.orient){case"top":c.yOffset=-s.offset;break;case"right":c.xOffset=s.offset;break;case"bottom":c.yOffset=s.offset;break;case"left":c.xOffset=-s.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...o,...c,text:s.text,align:(l=s.align)!=null?l:D8[s.anchor],angle:s.angle,baseline:s.baseline,dx:s.dx,dy:s.dy,color:s.color,font:s.font,size:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight}}}function i1(t,e,n,r){if(t.type=="wheel"){t.uiEvent.preventDefault();const i=t.uiEvent,o=i.deltaMode?120:1;let{x:a,y:s}=t.point;if(r){const c=r.mark.encoders;c.x&&!c.x2&&(a=+c.x(r.datum)*e.width+e.x),c.y&&!c.y2&&(s=(1-+c.y(r.datum))*e.height+e.y)}Math.abs(i.deltaX)<Math.abs(i.deltaY)?n({x:a,y:s,xDelta:0,yDelta:0,zDelta:i.deltaY*o/300}):n({x:a,y:s,xDelta:-i.deltaX*o,yDelta:0,zDelta:0})}else if(t.type=="mousedown"&&t.uiEvent.button===0){const i=t.uiEvent;i.preventDefault();let o=i;const a=c=>{n({x:o.clientX,y:o.clientY,xDelta:c.clientX-o.clientX,yDelta:c.clientY-o.clientY,zDelta:0}),o=c},s=c=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s)};document.addEventListener("mouseup",s,!1),document.addEventListener("mousemove",a,!1)}}class o1 extends rr{constructor(n,r,i,o,a){var s;super(n,r,i,o);te(this,Vo);te(this,Dt);te(this,oc);te(this,ac);te(this,br);te(this,Yo);te(this,_o);te(this,Wo);te(this,sc);te(this,ui,1/0);te(this,li,10);te(this,et,[]);te(this,fi,0);this.spec=n,tt(this,li,(s=n.spacing)!=null?s:10),tt(this,ui,a),tt(this,et,[]),this.wrappingFacet=!1,this._createChildren()}_createChildren(){}appendChild(n){var r;(r=n.parent)!=null||(n.parent=this),G(this,et).push(se(this,Vo,Od).call(this,n)),j2(this,fi)._++}setChildren(n){for(const r of n)this.appendChild(r)}replaceChild(n,r){const i=G(this,et).findIndex(o=>o.view==n);if(i>=0)G(this,et)[i]=se(this,Vo,Od).call(this,r);else throw new Error("Not my child view!")}get children(){return G(this,et).map(n=>n.view)}get childCount(){return G(this,et).length}onScalesResolved(){super.onScalesResolved(),se(this,ac,H2).call(this)}*[Symbol.iterator](){for(const n of G(this,et)){n.background&&(yield n.background);for(const r of Object.values(n.axes))r&&(yield r);yield n.view,n.title&&(yield n.title)}}getOverhang(){const n=se(this,br,$o).call(this,"column"),r=se(this,br,$o).call(this,"row");return!n.length||!r.length?Je.zero():new Je(r.at(0).axisBefore,n.at(-1).axisAfter,r.at(-1).axisAfter,n.at(0).axisBefore)}getSize(){return new tr(se(this,_o,Fd).call(this,"column"),se(this,_o,Fd).call(this,"row")).subtractPadding(this.getOverhang()).addPadding(this.getPadding())}render(n,r,i={}){var u;if(!this.isVisible())return;r=r.shrink(this.getPadding()),n.pushView(this,r);const o={devicePixelRatio:this.context.glHelper.dpr},a=bo(se(this,Yo,Pd).call(this,"column"),r.width,o),s=bo(se(this,Yo,Pd).call(this,"row"),r.height,o),c=new Wg(G(this,Dt,Sn).length,(u=G(this,ui))!=null?u:1/0);for(const[f,l]of G(this,Dt,Sn).entries()){const{view:d,axes:h,background:p,title:m}=l,[g,y]=c.getCellCoords(f),A=a[se(this,Wo,zd).call(this,"column",g)],x=s[se(this,Wo,zd).call(this,"row",y)],w=d.getSize(),b=d.getPadding().subtract(d.getOverhang()),v=A.location+b.left,C=x.location+b.top,S=(w.width.grow?A.size:w.width.px)-b.width,I=(w.height.grow?x.size:w.height.px)-b.height,N=new pn(()=>r.x+v,()=>r.y+C,()=>S,()=>I);l.coords=N,p==null||p.render(n,N,i);const T=k8(d);T&&d.render(n,N,i);for(const[O,Q]of Object.entries(h)){const U=Q.axisProps;let we;const Ie=Q.getPerpendicularSize();O=="bottom"?we=N.translate(0,N.height+U.offset).modify({height:Ie}):O=="top"?we=N.translate(0,-Ie-U.offset).modify({height:Ie}):O=="left"?we=N.translate(-Ie-U.offset,0).modify({width:Ie}):O=="right"&&(we=N.translate(N.width+U.offset,0).modify({width:Ie})),Q.render(n,we)}T||d.render(n,N,i),m==null||m.render(n,N,{...i,clipRect:void 0})}n.popView(this)}propagateInteractionEvent(n){if(this.handleInteractionEvent(void 0,n,!0),n.stopped)return;const r=G(this,Dt,Sn).find(o=>o.coords.containsPoint(n.point.x,n.point.y)),i=r==null?void 0:r.view;i&&(i.propagateInteractionEvent(n),(i instanceof be||i instanceof Pt)&&i1(n,r.coords,o=>se(this,sc,G2).call(this,r.coords,r.view,o),this.context.getCurrentHover())),!n.stopped&&this.handleInteractionEvent(void 0,n,!1)}getDefaultResolution(n,r){return"independent"}}ui=new WeakMap,li=new WeakMap,et=new WeakMap,fi=new WeakMap,Vo=new WeakSet,Od=function(n){var i;const r={view:n,background:void 0,axes:{},coords:pn.ZERO};if(n instanceof be||n instanceof Pt){const o=(i=n.spec)==null?void 0:i.view;if((o==null?void 0:o.fill)||(o==null?void 0:o.stroke)){const s=new be(T8(o),this.context,n,"background"+G(this,fi));s.blockEncodingInheritance=!0,r.background=s}const a=M8(n.spec.title);if(a){const s=new be(a,this.context,n,"title"+G(this,fi));s.blockEncodingInheritance=!0,r.title=s}}return r},Dt=new WeakSet,Sn=function(){return G(this,et).filter(n=>n.view.isVisible())},oc=new WeakSet,U2=function(){var n;return new Wg(G(this,Dt,Sn).length,(n=G(this,ui))!=null?n:1/0)},ac=new WeakSet,H2=function(){if(Object.keys(this.resolutions.axis).length)throw new Error("ConcatView does not (currently) support shared axes!");for(const n of G(this,et)){const{view:r,axes:i}=n,o=(a,s,c)=>{var f;const u=a.getAxisProps();if(u!==null){if(!u.orient){for(const l of Gl[s])if(!i[l]){u.orient=l;break}if(!u.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if((f=u.title)!=null||(u.title=a.getTitle()),!Gl[s].includes(u.orient))throw new Error(`Invalid axis orientation "${u.orient}" on channel "${s}"!`);if(i[u.orient])throw new Error(`An axis with the orient "${u.orient}" already exists!`);i[u.orient]=new e1(u,a.scaleResolution.type,this.context,c)}};if(r instanceof be||r instanceof Pt)for(const a of["x","y"]){const s=r.resolutions.axis[a];!s||o(s,a,r)}if(r instanceof Pt){for(const a of r.children)for(const[s,c]of Object.entries(a.resolutions.axis)){const u=c.getAxisProps();u&&u.orient&&o(c,s,a)}for(const a of r.children)for(const[s,c]of Object.entries(a.resolutions.axis)){const u=c.getAxisProps();u&&!u.orient&&o(c,s,a)}}}},br=new WeakSet,$o=function(n){const r=n=="column"?["left","right"]:["top","bottom"],i=n=="column"?"width":"height",o=(a,s)=>a.map(c=>{const u=G(this,Dt,Sn)[c].axes[r[s]];if(u)return Math.max(u.getPerpendicularSize()+u.axisProps.offset,0);const f=G(this,Dt,Sn)[c].view.getOverhang();return n=="column"?s?f.right:f.left:s?f.bottom:f.top}).reduce((c,u)=>Math.max(c,u),0);return G(this,oc,U2)[n=="column"?"colIndices":"rowIndices"].map(a=>({axisBefore:o(a,0),axisAfter:o(a,1),view:bM(a.map(s=>G(this,Dt,Sn)[s].view.getSize()[i]))}))},Yo=new WeakSet,Pd=function(n){const r=se(this,br,$o).call(this,n),i=[];i.push(Ao);for(const[o,a]of r.entries())o>0&&i.push({px:G(this,li),grow:0}),(o==0||this.wrappingFacet)&&i.push(Ao),i.push({px:a.axisBefore,grow:0}),i.push(a.view),i.push({px:a.axisAfter,grow:0}),(o==r.length-1||this.wrappingFacet)&&i.push(Ao);return i},_o=new WeakSet,Fd=function(n){var s,c,u;let r=0,i=0;const o=(s=n=="row"&&this.spec.height)!=null?s:n=="column"&&this.spec.width;if(o||o===0)return Dg(o);const a=se(this,br,$o).call(this,n);for(const[f,l]of a.entries())f>0&&(i+=G(this,li)),(f==0||this.wrappingFacet)&&(i+=0),i+=l.axisBefore,i+=(c=l.view.px)!=null?c:0,r+=(u=l.view.grow)!=null?u:0,i+=l.axisAfter,(f==a.length-1||this.wrappingFacet)&&(i+=0);return{px:i,grow:r}},Wo=new WeakSet,zd=function(n,r){return n=="row"&&this.wrappingFacet?1+6*r+2:2+4*r+1},sc=new WeakSet,G2=function(n,r,i){for(const[o,a]of Object.entries(I8(r))){if(a.size<=0)continue;const s=n.normalizePoint(i.x,i.y),c=n.normalizePoint(i.x+i.xDelta,i.y+i.yDelta),u={x:c.x-s.x,y:c.y-s.y};for(const f of a)f.zoom(2**i.zDelta,o=="y"?1-s[o]:s[o],o=="x"?u.x:-u.y)}this.context.animator.requestRender()};function T8(t){return{configurableVisibility:!1,data:{values:[{}]},mark:{fill:null,strokeWidth:1,fillOpacity:t.fill?1:0,...t,type:"rect",clip:!1,tooltip:null}}}function I8(t){const e={x:new Set,y:new Set};return t.visit(n=>{for(const[r,i]of Object.entries(e)){const o=n.getScaleResolution(r);o&&o.isZoomable()&&i.add(o)}}),e}function k8(t){let e=!0;return t.visit(n=>{n instanceof be&&e&&(e=n.mark.properties.clip)}),e}class Xr extends o1{constructor(e,n,r,i){super(e,n,r,i,Wl(e)?e.columns:_l(e)?1:1/0),this.spec=e}_createChildren(){const e=this.spec,n=Wl(e)?e.concat:_l(e)?e.vconcat:e.hconcat;this.setChildren(n.map((r,i)=>this.context.createView(r,this,"grid"+i)))}}class N8{constructor(){this.types=[];const e=n=>(r,i,o,a)=>{var s;return new n(r,i,o,(s=r.name)!=null?s:a)};this.addViewType(L8,e(_g)),this.addViewType(Yl,e(Pt)),this.addViewType(Vl,e(be)),this.addViewType(_l,e(Xr)),this.addViewType(B8,e(Xr)),this.addViewType(Wl,e(Xr))}addViewType(e,n){this.types.push({specGuard:e,factory:n})}createView(e,n,r,i){const o=this.types.find(a=>a.specGuard(e));if(o)return o.factory(e,n,r,i!=null?i:"unnamed");throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(e)]))}isViewSpec(e){const n=this.types.filter(r=>r.specGuard(e));if(n.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return n.length==1}}function Vl(t){return"mark"in t&&(ne(t.mark)||ze(t.mark))}function Yl(t){return"layer"in t&&ze(t.layer)}function a1(t){return t&&(Vl(t)||Yl(t))&&"aggregateSamples"in t}function L8(t){return"import"in t}function _l(t){return"vconcat"in t&&We(t.vconcat)}function B8(t){return"hconcat"in t&&We(t.hconcat)}function Wl(t){return"concat"in t&&We(t.concat)}const O8={point:oM,rect:$D,rule:cM,link:dM,text:vM};class be extends rr{constructor(e,n,r,i){super(e,n,r,i),this.spec=e;const o=O8[this.getMarkType()];if(o)this.mark=new o(this);else throw new Error(`No such mark: ${this.getMarkType()}`);this.sampleAggregateViews=[],this._initializeAggregateViews(),this.coords=void 0}*[Symbol.iterator](){for(const e of this.sampleAggregateViews)yield e}replaceChild(e,n){const r=this.sampleAggregateViews.indexOf(e);if(r>=0)this.sampleAggregateViews[r]=n;else throw new Error("Not my child view!")}render(e,n,r={}){!this.isVisible()||(this.coords=n,e.pushView(this,n),e.renderMark(this.mark,r),e.popView(this))}getMarkType(){return typeof this.spec.mark=="object"?this.spec.mark.type:this.spec.mark}resolve(e){var r;const n=this.mark.encoding;for(const[i,o]of Object.entries(n)){if(!Ke(o))continue;let a=Pr((r=o.resolutionChannel)!=null?r:i);if(e=="axis"&&!io(a))continue;let s=this;for(;s.parent instanceof rr&&["shared","excluded"].includes(s.parent.getConfiguredOrDefaultResolution(a,e))&&s.getConfiguredOrDefaultResolution(a,e)!="excluded";)s=s.parent;s.resolutions[e][a]||(s.resolutions[e][a]=e=="scale"?new u8(a):new h8(a)),io(i)?s.resolutions[e][a].pushUnitView(this,i):e=="scale"&&s.resolutions[e][a].pushUnitView(this,i)}}getAccessor(e){return this._cache("accessor/"+e,()=>{const n=this.mark.encoding;if(n&&n[e])return this.context.accessorFactory.createAccessor(n[e])})}getFacetAccessor(e){const n=this.getAccessor("sample");return n||super.getFacetAccessor(this)}getCollector(){return this.context.dataFlow.findCollectorByKey(this)}_validateDomainQuery(e){if(oo(e))throw new Error(`getDomain(${e}), must only be called for primary channels!`);const n=this.mark.encoding[e];if(!Ke(n))throw new Error("The channel has no scale, cannot get domain!");return n}getConfiguredDomain(e){var i,o;const n=this._validateDomainQuery(e),r=n&&n.scale&&n.scale.domain;if(r){const a=this.getScaleResolution((i=n.resolutionChannel)!=null?i:e);return Gg((o=n.type)!=null?o:"nominal",a.fromComplexInterval(r))}}extractDataDomain(e){var s;const r=(s=this._validateDomainQuery(e).type)!=null?s:"nominal",i=c=>{let u;const f=this.mark.encoding[c];if(f){const l=this.context.accessorFactory.createAccessor(f);if(l)if(u=Gg(r),l.constant)u.extend(l({}));else{const d=this.getCollector();d!=null&&d.completed&&d.visitData(h=>u.extend(l(h)))}}return u};let o=i(e);const a=qu[e];if(a){const c=i(a);c&&o.extendAll(c)}return o}getZoomLevel(){const e=n=>{var r,i;return(i=(r=this.getScaleResolution(n))==null?void 0:r.getZoomLevel())!=null?i:1};return ro.map(e).reduce((n,r)=>n*r,1)}_initializeAggregateViews(){var e,n;if(a1(this.spec))for(const r of this.spec.aggregateSamples){const i=(e=r.transform)!=null?e:[];i.length&&je(i).type!="collect"&&i.push({type:"collect"}),i.push({type:"mergeFacets"}),r.transform=i,r.encoding={...(n=r.encoding)!=null?n:{},sample:null};const o=this.context.createView(r,this,"summaryView");o.getFacetFields=a=>{},this.sampleAggregateViews.push(o)}}propagateInteractionEvent(e){e.target=this}getDefaultResolution(e,n){return e=="x"?"shared":"independent"}}function*Xl(t,e=[]){for(const[n,r]of t.entries())if(r instanceof Map)for(const i of Xl(r,[...e,n]))yield i;else yield[[...e,n],r]}class Zr extends ue{constructor(e){super(),this.params=e!=null?e:{type:"collect"},this.observers=[],this.facetBatches=void 0,this._init()}_init(){this._data=[],this.facetBatches=new In([],JSON.stringify),this.facetBatches.set(void 0,this._data)}reset(){super.reset(),this._init()}handle(e){this._data.push(e)}beginBatch(e){rM(e)&&(this._data=[],this.facetBatches.set(qe(e.facetId),this._data))}complete(){var i,o;const e=(i=this.params)==null?void 0:i.sort,n=e?Gd(e.field,e.order):void 0,r=a=>{n&&a.sort(n)};if((o=this.params.groupby)!=null&&o.length){if(this.facetBatches.size>1)throw new Error("TODO: Support faceted data!");const a=this.params.groupby.map(c=>q(c)),s=gi(this._data,...a);this.facetBatches.clear();for(const[c,u]of Xl(s))this.facetBatches.set(c,u)}for(const a of this.facetBatches.values())r(a);if(this.children.length)for(const[a,s]of this.facetBatches.entries()){if(a){const c={type:"facet",facetId:a};for(const u of this.children)u.beginBatch(c)}for(const c of s)this._propagate(c)}super.complete();for(const a of this.observers)a(this)}getData(){switch(this._checkStatus(),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{const e=this.facetBatches;return{[Symbol.iterator]:function*(){for(const r of e.values())for(let i=0;i<r.length;i++)yield r[i]}}}}}visitData(e){this._checkStatus();for(const n of this.facetBatches.values())for(let r=0;r<n.length;r++)e(n[r])}getItemCount(){let e=0;for(const n of this.facetBatches.values())e+=n.length;return e}_checkStatus(){if(!this.completed)throw new Error("Data propagation is not completed! No data are available.")}}class wo{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(e,n){let r=this.length++;for(;r>0;){const i=r-1>>1,o=this.values[i];if(n>=o)break;this.ids[r]=this.ids[i],this.values[r]=o,r=i}this.ids[r]=e,this.values[r]=n}pop(){if(this.length===0)return;const e=this.ids[0];if(this.length--,this.length>0){const n=this.ids[0]=this.ids[this.length],r=this.values[0]=this.values[this.length],i=this.length>>1;let o=0;for(;o<i;){let a=(o<<1)+1;const s=a+1;let c=this.ids[a],u=this.values[a];const f=this.values[s];if(s<this.length&&f<u&&(a=s,c=this.ids[s],u=f),u>=r)break;this.ids[o]=c,this.values[o]=u,o=a}this.ids[o]=n,this.values[o]=r}return e}peek(){if(this.length!==0)return this.ids[0]}peekValue(){if(this.length!==0)return this.values[0]}shrink(){this.ids.length=this.values.length=this.length}}class P8 extends ue{get behavior(){return Ot}constructor(e){super(),this.params=e,this.startAccessor=q(e.start),this.endAccessor=q(e.end),this.chromAccessor=e.chrom?q(e.chrom):n=>{},this.weightAccessor=e.weight?q(e.weight):n=>1,this.as={coverage:e.as||"coverage",start:e.asStart||e.start,end:e.asEnd||e.end,chrom:e.asChrom||e.chrom},this.createSegment=new Function("start","end","coverage","chrom","return {"+Object.entries(this.as).filter(([n,r])=>r).map(([n,r])=>`${JSON.stringify(r)}: ${n}`).join(", ")+"};"),this.ends=new wo}reset(){super.reset(),this.initialize()}initialize(){const e=this.as.coverage,n=this.as.end,r=this.as.chrom,i=this.startAccessor,o=this.endAccessor,a=this.chromAccessor,s=this.weightAccessor;let c,u,f,l=0,d;const h=this.ends;h.clear();const p=(g,y,A)=>{if(g==y)return;let x=!1;c&&(c[e]===A?(c[n]=y,x=!0):c[e]!=0&&this._propagate(c)),x||(c=this.createSegment(g,y,A,f))},m=()=>{let g;for(;(g=h.peekValue())!==void 0;)p(d,g,l),d=g,l-=h.pop();d=void 0,c&&(this._propagate(c),c=void 0)};this.handle=g=>{const y=i(g);let A;for(;(A=h.peekValue())!==void 0&&A<y;)p(d,A,l),d=A,l-=h.pop();if(r){let w=a(g);w!==u&&(m(),f=w,u=f)}d!==void 0&&p(d,y,l),d=y;const x=s(g);l+=x,h.push(x,o(g))},this.complete=()=>{m(),super.complete()}}}function F8(t,e,n=0,r=t.length){const i=new wo,o=r-n;let a;for(a=0;a<e&&a<o;a++)i.push(a,t[n+a]);for(;a<o;a++){const u=t[n+a];u>=i.peekValue()&&(i.push(a,u),i.pop())}const s=[];let c;for(;(c=i.pop())!==void 0;)s.push(n+c);return s.reverse()}class z8{constructor(e,n=-1/0,r=1/0){this.maxSize=e,this.lowerLimit=n,this.upperLimit=r;const i=this.maxSize*2+1;this.lowerLimits=new Float64Array(i),this.upperLimits=new Float64Array(i),this.lowerChildren=new Int32Array(i),this.upperChildren=new Int32Array(i),this.reset()}reset(){this.lowerLimits.fill(0),this.upperLimits.fill(0),this.lowerChildren.fill(0),this.upperChildren.fill(0),this.n=1,this.lowerLimits[0]=this.lowerLimit,this.upperLimits[0]=this.upperLimit}_findSlot(e,n,r=0){if(e>=this.lowerLimits[r]&&n<=this.upperLimits[r]){const i=this.lowerChildren[r];if(i){const o=this._findSlot(e,n,i);return o>=0?o:this._findSlot(e,n,this.upperChildren[r])}else return r}else return-1}reserve(e,n){if(n-e<=0)throw new Error("Cannot reserve an empty or negative-size slot!");if(this.n+1>this.lowerLimits.length)return!1;const r=this._findSlot(e,n);if(r<0)return!1;const i=this.n++,o=this.n++;return this.lowerLimits[i]=this.lowerLimits[r],this.upperLimits[i]=e,this.lowerLimits[o]=n,this.upperLimits[o]=this.upperLimits[r],this.lowerChildren[r]=i,this.upperChildren[r]=o,!0}}class R8 extends ue{constructor(e,n){var i,o;if(super(),this.params=e,this._data=[],this.channel=(i=e.channel)!=null?i:"x",!["x","y"].includes(this.channel))throw new Error("Invalid channel: "+this.channel);this.posAccessor=q(this.params.pos),this.posBisector=ca(this.posAccessor),this.scoreAccessor=q(this.params.score),this.widthAccessor=q(this.params.width),this.laneAccessor=this.params.lane?q(this.params.lane):a=>0,this.padding=(o=this.params.padding)!=null?o:0,this.reservationMaps=new Map,this.resolution=n.getScaleResolution(this.channel);const r=()=>this._filterAndPropagate();this.schedule=()=>n.context.animator.requestTransition(r),this.resolution.addEventListener("domain",a=>this.schedule()),n._addBroadcastHandler("layoutComputed",()=>this.schedule())}complete(){const e=this.posAccessor;this._data.sort((n,r)=>e(n)-e(r)),this._scores=this._data.map(this.scoreAccessor);for(const n of new Set(this._data.map(this.laneAccessor)))this.reservationMaps.set(n,new z8(200));this.schedule(),super.complete()}_filterAndPropagate(){var a;super.reset();const e=this.resolution.getScale(),n=(a=this.resolution.members[0].view.coords)==null?void 0:a[this.channel=="x"?"width":"height"];if(!n)return;for(const s of this.reservationMaps.values())s.reset();const r=e.domain(),i=70,o=F8(this._scores,i,this.posBisector.left(this._data,r[0]),this.posBisector.right(this._data,r[1]));for(const s of o){const c=this._data[s],u=e(this.posAccessor(c))*n,f=this.widthAccessor(c)/2+this.padding;this.reservationMaps.get(this.laneAccessor(c)).reserve(u-f,u+f)&&this._propagate(c)}super.complete()}reset(){super.reset(),this._data=[],this.groups=new Map}handle(e){this._data.push(e)}}class j8 extends ue{constructor(e){super(),this.params=e,this.predicate=void 0}initialize(){this.predicate=Wu(this.params.expr,this.getGlobalObject())}handle(e){this.predicate(e)&&this._propagate(e)}}const U8="0".charCodeAt(0);function*H8(t,e=","){const n=e.charCodeAt(0);let r=0;for(let i=0;i<t.length;i++){const o=t.charCodeAt(i);o==n?(yield r,r=0):r=r*10+o-U8}yield r}class G8 extends ue{get behavior(){return Ot}constructor(e){var a,s;super();const n=q((a=e.exons)!=null?a:"exons"),r=q((s=e.start)!=null?s:"start"),[i,o]=e.as||["exonStart","exonEnd"];this.handle=c=>{let u=r(c),f=u,l=!0;const d=n(c);for(const h of H8(d)){if(l)f=u+h;else{u=f+h;const p=Object.assign({},c);p[i]=f,p[o]=u,this._propagate(p)}l=!l}}}}class Q8 extends ue{get behavior(){return Ot}constructor(e){super();const n=qe(e.field).map(o=>q(o)),r=qe(e.separator),i=qe(e.as||e.field);if(n.length!==r.length||n.length!==i.length)throw new Error(`Lengths of "separator" (${r.length}), "fields" (${n.length}), and "as" (${i.length}) do not match!`);this.handle=o=>{if(n.some(c=>!c(o)))return;const a=n.map((c,u)=>c(o).split(r[u]));V8(a,o);const s=a[0].length;for(let c=0;c<s;c++){const u=Object.assign({},o);for(let f=0;f<n.length;f++)u[i[f]]=a[f][c];this._propagate(u)}}}}function V8(t,e){const n=t.map(r=>r.length);if(!n.every(r=>r==n[0]))throw new Error("Mismatching number of elements in the fields to be split: "+JSON.stringify(e))}class Y8 extends ue{get behavior(){return hn}constructor(e){super(),this.params=e,this.as=e.as,this.fn=void 0}initialize(){this.fn=Wu(this.params.expr,this.getGlobalObject())}handle(e){e[this.as]=this.fn(e),this._propagate(e)}}class s1 extends ue{get behavior(){return hn}constructor(e,n){var p;super();const r=(p=e.channel)!=null?p:"x";if(!["x","y"].includes(r))throw new Error("Invalid channel: "+r);const i=n.getScaleResolution(r).getGenome();if(!i)throw new Error("LinearizeGenomicCoordinate transform requires a locus scale!");const o=q(e.chrom),a=qe(e.pos).map(m=>q(m)),s=qe(e.as);if(a.length!=s.length)throw new Error('The number of "pos" and "as" elements must be equal!');const c=qe(e.offset);let u;if(c.length==0)u=new Array(a.length).fill(0);else if(c.length==1)u=new Array(a.length).fill(c[0]);else if(c.length==a.length)u=c;else throw new Error(`Invalid "offset" parameter: ${JSON.stringify(e.offset)}!`);const f=new Function("datum","chromOffset","posAccessors",s.map((m,g)=>`datum[${JSON.stringify(m)}] = chromOffset + +posAccessors[${g}](datum) - ${u[g]};`).join(`
1347
1347
  `));let l,d=0;const h=m=>{if(m!==l){if(d=i.cumulativeChromPositions.get(m),d===void 0)throw new Error("Unknown chromosome/contig: "+m);l=m}return d};this.handle=m=>{f(m,h(o(m)),a),this._propagate(m)}}}const c1={pages:["Lato-Regular.png"],chars:[{id:87,width:53,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:43.491,chnl:15,x:0,y:0,page:0},{id:124,width:17,height:50,xoffset:0,yoffset:-32.193000000000005,xadvance:10.521,chnl:15,x:0,y:42,page:0},{id:40,width:20,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:94,page:0},{id:41,width:19,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:145,page:0},{id:36,width:32,height:49,xoffset:0,yoffset:-34.419000000000004,xadvance:24.360000000000003,chnl:15,x:0,y:196,page:0},{id:125,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:247,page:0},{id:91,width:22,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:297,page:0},{id:93,width:19,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:347,page:0},{id:123,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:397,page:0},{id:106,width:19,height:48,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:0,y:447,page:0},{id:81,width:43,height:47,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:21,y:447,page:0},{id:77,width:45,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:38.997,chnl:15,x:66,y:447,page:0},{id:64,width:43,height:44,xoffset:0,yoffset:-28.539,xadvance:35.133,chnl:15,x:23,y:397,page:0},{id:92,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:68,y:397,page:0},{id:47,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:98,y:397,page:0},{id:109,width:42,height:32,xoffset:0,yoffset:-21.609,xadvance:34.545,chnl:15,x:113,y:447,page:0},{id:119,width:42,height:31,xoffset:0,yoffset:-21.315,xadvance:32.991,chnl:15,x:157,y:447,page:0},{id:42,width:25,height:42,xoffset:0,yoffset:-31.626,xadvance:17.85,chnl:15,x:128,y:397,page:0},{id:37,width:42,height:41,xoffset:0,yoffset:-30.387,xadvance:33.663000000000004,chnl:15,x:155,y:397,page:0},{id:79,width:42,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:199,y:397,page:0},{id:102,width:24,height:41,xoffset:0,yoffset:-30.534000000000002,xadvance:14.721,chnl:15,x:243,y:397,page:0},{id:100,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:269,y:397,page:0},{id:98,width:32,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:302,y:397,page:0},{id:56,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:336,y:397,page:0},{id:38,width:40,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:29.904000000000003,chnl:15,x:370,y:397,page:0},{id:108,width:17,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:9.912,chnl:15,x:412,y:397,page:0},{id:107,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:21.336000000000002,chnl:15,x:431,y:397,page:0},{id:48,width:33,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:464,y:397,page:0},{id:71,width:38,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:30.681,chnl:15,x:21,y:347,page:0},{id:83,width:31,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:22.785,chnl:15,x:61,y:347,page:0},{id:63,width:27,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:18.795,chnl:15,x:94,y:347,page:0},{id:105,width:18,height:41,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:123,y:347,page:0},{id:51,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:143,y:347,page:0},{id:104,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.436,chnl:15,x:177,y:347,page:0},{id:67,width:37,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:28.056,chnl:15,x:210,y:347,page:0},{id:88,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.258000000000003,chnl:15,x:249,y:347,page:0},{id:68,width:40,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:31.941000000000003,chnl:15,x:288,y:347,page:0},{id:70,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:23.751,chnl:15,x:330,y:347,page:0},{id:34,width:23,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:15.561000000000002,chnl:15,x:364,y:347,page:0},{id:72,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:389,y:347,page:0},{id:73,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.760000000000002,chnl:15,x:429,y:347,page:0},{id:74,width:24,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:17.745,chnl:15,x:449,y:347,page:0},{id:75,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.825000000000003,chnl:15,x:24,y:297,page:0},{id:76,width:31,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:21.567,chnl:15,x:475,y:347,page:0},{id:66,width:35,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.153000000000002,chnl:15,x:64,y:297,page:0},{id:78,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:101,y:297,page:0},{id:33,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.298,chnl:15,x:141,y:297,page:0},{id:80,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.221,chnl:15,x:161,y:297,page:0},{id:65,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:197,y:297,page:0},{id:82,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.313000000000002,chnl:15,x:237,y:297,page:0},{id:35,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:275,y:297,page:0},{id:84,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.801000000000002,chnl:15,x:310,y:297,page:0},{id:85,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:30.891000000000002,chnl:15,x:346,y:297,page:0},{id:86,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:385,y:297,page:0},{id:39,width:16,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:8.568000000000001,chnl:15,x:425,y:297,page:0},{id:69,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.255000000000003,chnl:15,x:443,y:297,page:0},{id:89,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.208000000000002,chnl:15,x:23,y:247,page:0},{id:90,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.284000000000002,chnl:15,x:477,y:297,page:0},{id:49,width:31,height:40,xoffset:0,yoffset:-30.156000000000002,xadvance:24.360000000000003,chnl:15,x:61,y:247,page:0},{id:50,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:94,y:247,page:0},{id:57,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:128,y:247,page:0},{id:94,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:162,y:247,page:0},{id:96,width:21,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:16.8,chnl:15,x:196,y:247,page:0},{id:55,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:219,y:247,page:0},{id:54,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:254,y:247,page:0},{id:53,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:289,y:247,page:0},{id:52,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:323,y:247,page:0},{id:103,width:31,height:39,xoffset:0,yoffset:-21.630000000000003,xadvance:21.84,chnl:15,x:358,y:247,page:0},{id:112,width:32,height:39,xoffset:0,yoffset:-21.651,xadvance:23.541,chnl:15,x:391,y:247,page:0},{id:113,width:31,height:39,xoffset:0,yoffset:-21.651,xadvance:23.520000000000003,chnl:15,x:425,y:247,page:0},{id:116,width:25,height:39,xoffset:0,yoffset:-28.182000000000002,xadvance:15.057,chnl:15,x:458,y:247,page:0},{id:121,width:31,height:38,xoffset:0,yoffset:-21.273,xadvance:21.651,chnl:15,x:34,y:196,page:0},{id:59,width:18,height:36,xoffset:0,yoffset:-20.706,xadvance:10.983,chnl:15,x:485,y:247,page:0},{id:43,width:32,height:34,xoffset:0,yoffset:-24.486,xadvance:24.360000000000003,chnl:15,x:67,y:196,page:0},{id:60,width:30,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:101,y:196,page:0},{id:62,width:31,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:133,y:196,page:0},{id:117,width:30,height:32,xoffset:0,yoffset:-21.273,xadvance:23.415000000000003,chnl:15,x:166,y:196,page:0},{id:99,width:29,height:32,xoffset:0,yoffset:-21.609,xadvance:20.055,chnl:15,x:198,y:196,page:0},{id:110,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:23.436,chnl:15,x:229,y:196,page:0},{id:111,width:32,height:32,xoffset:0,yoffset:-21.609,xadvance:23.814,chnl:15,x:262,y:196,page:0},{id:126,width:32,height:26,xoffset:0,yoffset:-16.128,xadvance:24.360000000000003,chnl:15,x:201,y:447,page:0},{id:101,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:22.176000000000002,chnl:15,x:296,y:196,page:0},{id:114,width:25,height:32,xoffset:0,yoffset:-21.651,xadvance:15.288,chnl:15,x:329,y:196,page:0},{id:115,width:27,height:32,xoffset:0,yoffset:-21.609,xadvance:18.186,chnl:15,x:356,y:196,page:0},{id:97,width:28,height:32,xoffset:0,yoffset:-21.651,xadvance:20.874000000000002,chnl:15,x:385,y:196,page:0},{id:118,width:31,height:31,xoffset:0,yoffset:-21.273,xadvance:21.672,chnl:15,x:415,y:196,page:0},{id:61,width:31,height:29,xoffset:0,yoffset:-19.089000000000002,xadvance:24.360000000000003,chnl:15,x:448,y:196,page:0},{id:120,width:30,height:31,xoffset:0,yoffset:-21.273,xadvance:20.916,chnl:15,x:21,y:145,page:0},{id:58,width:18,height:31,xoffset:0,yoffset:-20.706,xadvance:10.5,chnl:15,x:53,y:145,page:0},{id:122,width:28,height:31,xoffset:0,yoffset:-21.273,xadvance:18.984,chnl:15,x:73,y:145,page:0},{id:95,width:28,height:16,xoffset:0,yoffset:0,xadvance:19.278000000000002,chnl:15,x:235,y:447,page:0},{id:45,width:23,height:24,xoffset:0,yoffset:-14.175,xadvance:15.603000000000002,chnl:15,x:481,y:196,page:0},{id:44,width:17,height:21,xoffset:0,yoffset:-4.956,xadvance:9.534,chnl:15,x:103,y:145,page:0},{id:46,width:18,height:15,xoffset:0,yoffset:-4.956,xadvance:9.912,chnl:15,x:0,y:497,page:0},{id:32,width:0,height:0,xoffset:0,yoffset:0,xadvance:10.752,chnl:15,x:20,y:497,page:0}],info:{face:"Lato Regular",size:42,bold:0,italic:0,charset:[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],unicode:1,stretchH:100,smooth:1,aa:1,padding:[0,0,0,0],spacing:[2,2]},common:{lineHeight:50.400000000000006,base:41.454,scaleW:512,scaleH:512,pages:1,packed:0,alphaChnl:0,redChnl:0,greenChnl:0,blueChnl:0},kernings:[]};class _8 extends ue{get behavior(){return hn}constructor(e){super();const n=Nl(c1),r=q(e.field),i=e.as,o=e.fontSize;this.handle=a=>{const s=r(a);s!==void 0?a[i]=n.measureWidth(s,o):a[i]=0,this._propagate(a)}}}const W8=65536;class X8 extends ue{get behavior(){return hn}constructor(e){super(),this.params=e}reset(){this.initialize()}initialize(){const e=this.params,n=e.as||"lane",r=le(e.spacing)?e.spacing:1,i=q(e.start),o=q(e.end);if(!e.preference!=!e.preferredOrder)throw new Error('Must specify both "preference" and "preferredOrder"');if(e.preference){const a=new Float64Array(W8),s=q(e.preference),c=e.preferredOrder;let u=1/0;this.handle=f=>{const l=i(f);l<u&&a.fill(-1/0),u=l;const d=c.indexOf(s(f));let h=-1;if(d>=0&&a[d]<l)h=d;else{const p=i(f);for(h=0;h<a.length&&!(a[h]<p);h++);if(h>=a.length)throw new Error("Out of lanes!")}a[h]=o(f)+r,f[n]=h,this._propagate(f)}}else{const a=new wo,s=new wo;let c=-1/0,u=0;this.handle=f=>{const l=i(f);for(;a.length&&(a.peekValue()<=l||l<c);){const h=a.pop();s.push(h,h)}c=l;let d=s.pop();d===void 0&&(d=u++),f[n]=d,this._propagate(f),a.push(d,o(f)+r)}}}}class Z8 extends ue{get behavior(){return Ot}constructor(e){if(super(),e.as&&e.as.length!=e.fields.length)throw new Error('"fields" and "as" have unequal lengths!');const n=e.fields.map(i=>q(i)),r=e.as?e.as:n.map(ce);this.handle=i=>{const o={};for(let a=0;a<n.length;a++)o[r[a]]=n[a](i);this._propagate(o)}}}class q8 extends ue{get behavior(){return hn}constructor(e){super();const n=new RegExp(e.regex),r=typeof e.as=="string"?[e.as]:e.as,i=q(e.field);this.handle=o=>{const a=i(o);if(ne(a)){const s=a.match(n);if(s){if(s.length-1!=r.length)throw new Error('The number of RegEx groups and the length of "as" do not match!');for(let c=0;c<r.length;c++)o[r[c]]=s[c+1]}else if(e.skipInvalidInput)for(let c=0;c<r.length;c++)o[r[c]]=void 0;else throw new Error(`"${a}" does not match the given regex: ${n.toString()}`)}else if(!e.skipInvalidInput)throw new Error(`Trying to match a non-string field. Encountered type: ${typeof a}, field content: "${a}".`);this._propagate(o)}}}class K8 extends ue{get behavior(){return Ot}constructor(e){super();const n=qe(e.columnRegex).map(d=>new RegExp(d)),r=qe(e.asValue);if(n.length!=r.length)throw new Error('Lengths of "columnRegex" and "as" are not equal!');const i=e.skipRegex?new RegExp(e.skipRegex):void 0,o=e.asKey||"sample";let a,s,c;const u=d=>{var g;const h=Object.keys(d),p=new Map;for(const[y,A]of n.entries())for(const x of h){const w=(g=A.exec(x))==null?void 0:g[1];if(w!==void 0){let b=p.get(w);b||(b=[],p.set(w,b)),b[y]=x}}a=[...p.entries()],s=h.filter(y=>!n.some(A=>A.test(y))&&!(i&&i.test(y)));const m=[...s.map(y=>JSON.stringify(y)+": datum["+JSON.stringify(y)+"]"),JSON.stringify(o)+": sampleId",...r.map(y=>JSON.stringify(y)+": null")];c=new Function("datum","sampleId",`return {
1348
1348
  `+m.join(`,
1349
1349
  `)+`
@@ -2163,7 +2163,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
2163
2163
  * @license
2164
2164
  * Copyright 2018 Google LLC
2165
2165
  * SPDX-License-Identifier: BSD-3-Clause
2166
- */const qk={},Kk=ar(class extends Kr{constructor(){super(...arguments),this.ot=qk}render(t,e){return e()}update(t,[e,n]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every((r,i)=>r===this.ot[i]))return Ae}else if(this.ot===e)return Ae;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,n)}});class Jk extends vt{constructor(){super(),this.inputRef=A2(),this.app=void 0,this.getDefaultValue=()=>"",this._keyListener=this._onKeyDown.bind(this),this._documentClickListener=e=>{var n;e.target!==this._inputField&&((n=this._inputField)==null||n.blur())},this._focused=!1}get genomeSpy(){return this.app.genomeSpy}get _inputField(){return this.inputRef.value}static get properties(){return{app:{type:Object}}}connectedCallback(){super.connectedCallback(),this._initializeGenome(),document.addEventListener("keydown",this._keyListener),document.addEventListener("click",this._documentClickListener)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._keyListener),document.removeEventListener("click",this._documentClickListener)}createRenderRoot(){return this}_onKeyDown(e){switch(e.code){case"KeyF":e.metaKey||e.altKey||e.ctrlKey||(e.preventDefault(),this.inputRef.value.focus());break}}_initializeGenome(){const e=w2(this.genomeSpy.viewRoot);e&&(this._genomeResolution=e,this._genome=this.genomeSpy.genomeStore.getGenome(),this.getDefaultValue=()=>this._genome.formatInterval(e.getDomain()),e.addEventListener("domain",ws(()=>this.requestUpdate(),60,!1)))}async searchViews(e){var r,i;const n=new Intl.Collator("en",{usage:"search",sensitivity:"base"});for(const o of this.genomeSpy.getSearchableViews()){const a=o.getAccessor("search"),s=o.getAccessor("x"),c=o.getAccessor("x2"),u=o.getScaleResolution("x");if(!(!s||!c||!(u!=null&&u.isZoomable()))){for(const f of(i=(r=o.getCollector())==null?void 0:r.getData())!=null?i:[])if(n.compare(a(f),e)===0){const l=gc([s(f),c(f)],null,1.2);return await u.zoomTo(l),!0}}}return!1}async search(e){await(async()=>{if(this._genomeResolution&&this._genome){const r=this._genome.parseInterval(e);if(r){this._genomeResolution.zoomTo(r);return}if(await this.searchViews(e))return;this.genomeSpy.viewRoot.visit(i=>{i instanceof a2&&i.handleVerboseCommand(e)})}})(),this._inputField.value=this.getDefaultValue(),this.requestUpdate()}_onSearchHelpClicked(e){const n=e.target;n.tagName=="LI"&&this._doExampleSearch(n.innerText)}_onSearchFocused(e){const n=e.target;switch(e.type){case"focus":this._focused=!0,n.select();break;case"blur":this._focused=!1;break}}_onSearchKeyDown(e){const n=e.target;e.code=="Enter"?(e.preventDefault(),this.search(n.value).then(()=>{n.focus(),n.select()}).catch(r=>{console.log(r),alert(r)})):e.code=="Escape"?n.blur():e.stopPropagation()}_doExampleSearch(e){$k(e,this._inputField).then(()=>{this._inputField.blur(),this.search(e)})}_getSearchHelp(){var i,o;const e=[];e.push(D`<p>Focus to a specific range. Examples:</p><ul><li>chr8</li><li>chr8:21,445,873</li><li>chr8:21,445,873-24,623,697</li><li>chr4:166,014,727-chr15:23,731,397</li></ul>`);for(const a of((i=this.genomeSpy)==null?void 0:i.getSearchableViews())||[]){const s=(o=a.getTitleText())!=null?o:a.spec.name,c=a.getAccessor("search"),u=c.fields.join(", "),f=Eg(3,a.getCollector().getData(),c);e.push(D`<p>Search <em>${s}</em> (${u}). Examples:</p><ul>${f.map(l=>D`<li>${l}</li>`)}</ul>`)}const n=this.app.getSampleView().attributePanel,r=n.getAttributeNames().map(a=>n.getAttributeInfo(a)).filter(a=>a.type=="nominal"||a.type=="ordinal").sort(()=>.5-Math.random()).map(a=>{var s,c;return[...(c=(s=a.scale)==null?void 0:s.domain())!=null?c:[]].sort(()=>.5-Math.random())[0]}).filter(a=>a!==void 0).slice(0,3);return r.length&&e.push(D`<p>Filter samples by categorical attributes. Examples:</p><ul>${r.map(a=>D`<li>${a}</li>`)}</ul>`),D`<div class="search-help" @click="${this._onSearchHelpClicked}">${e}</div>`}updated(e){this._focused&&this._inputField.select()}render(){return D`<div class="search"><input type="text" class="search-input" .value="${this.getDefaultValue()}" @mousedown="${e=>{this._focused||(this._inputField.focus(),e.preventDefault(),e.stopPropagation())}}" @keydown="${this._onSearchKeyDown.bind(this)}" @focus="${this._onSearchFocused}" @blur="${this._onSearchFocused}" ${x2(this.inputRef)}> ${Kk([123],()=>this._getSearchHelp())}</div>`}}customElements.define("genome-spy-search-field",Jk);function $k(t,e){return new Promise(n=>{let r=0;const i=700/t.length+30;function o(){e.value=t.substring(0,r),r>=t.length?setTimeout(n,500):(r++,setTimeout(o,Math.random()*i*2))}o()})}function w2(t){let e;return t.visit(n=>{for(const r of["x","y"]){const i=n.resolutions.scale[r];if(i&&i.type=="locus"&&i.isZoomable())return e=i,nr}}),e}const C2="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMzIgMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEuNSI+PHBhdGggZD0iTTQuNyAyMS4ycy40IDIuMyAxLjMgMy42QzcgMjYgOS44IDI4IDkuOCAyOHMzLjQtMi42IDYuNC04LjVjMCAwIDEgLjEgMS45LS40LjktLjYuOC0uNCAxLTEuMiAwIDAgMi45LjUgNi42IDAgMi4xLS4zIDQuMy0xIDYuMi0yLjUgMCAwLTEuMS0xLjctMi41LTUuMS0uNS0xLjMtMi0xLjgtNC42LTQuNmwtOC4yIDguNi0xMS45IDYuOXoiIGZpbGwtb3BhY2l0eT0iLjEiLz48cGF0aCBkPSJNMTIuNyAxNC44cy00LTEuOC0xMiAyLjdjMCAwIDEgMy43IDIuNSA1LjMgMS40IDEuNSAyLjMgMy42IDQuNiA0LjYgMCAwIDQuNy0zIDYuOS05LjJsMy0yczQuNyAyLjggMTIuNi0xLjZjMCAwLS42LTMuMy0zLTYtMi42LTMtMy44LTQuNy0zLjgtNC43cy00LjEgMi4zLTcuNSA5LjNsLTMuMyAxLjZ6IiBmaWxsPSIjN2ZiYmRkIi8+PHBhdGggZD0iTTEyLjQgMTUuNWMtLjctLjUtMi40LS44LTQuNC0uNC0yIC40LTQgMS4zLTQuOCAxLjgtLjUuMy0xLjIgMS0xLjIgMS40IDAgLjcuMyAxLjguOCAyLjQuMy4zLjcuNSAxLjQuNi44IDAgMi41LTEuNCAzLjUtMiAxLS42IDEuNi0uOCAyLjctMS4ybC0yLjkgMi40Yy0xLjMgMS4yLTIuMiAxLjUtMi40IDIuMyAwIC41IDAgMS40LjUgMS44LjQuNS42LjggMS42LjguNiAwIDEgMCAyLjYtMS41LjktLjkgMi4zLTMgMi43LTMuNy42LTEuMSAxLTIuMi43LTMtLjItMS0uNC0xLjQtLjgtMS43ek0xNy40IDE0LjJjLS4zLS41LS45LTEuMi0uMi0yLjVsMS45LTNjLjUtLjggMi0yLjMgMi42LTIuNi42LS40IDEuNS0uNiAyLS4yLjYuNCAxIDEgMS4zIDEuNS40LjYuNyAxLjMuMiAyLS43IDEtMS42LjktMi44IDEuNy0xLjIuOC0xLjkgMS4yLTIuNSAxLjlsMy44LTEuOGMxLjMtLjYgMi43LTEuMSAzLjQtLjcuOC41LjguNyAxIDEuNC4zIDEtLjIgMS45LS44IDIuNC0uNS42LTEuNS45LTIuNiAxLjItMS40LjQtNC41IDEtNS44LjUtMS4zLS41LTEuMy0xLjQtMS41LTEuOHoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTIuNyAxNC44cy00LTEuOC0xMiAyLjdjMCAwIDEgMy43IDIuNSA1LjMgMS40IDEuNSAyLjMgMy42IDQuNiA0LjYgMCAwIDQuNy0zIDYuOS05LjJsMy0yczQuNyAyLjggMTIuNi0xLjZjMCAwLS42LTMuMy0zLTYtMi42LTMtMy44LTQuNy0zLjgtNC43cy00LjEgMi4zLTcuNSA5LjNsLTMuMyAxLjZ6IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iLjUiLz48cGF0aCBkPSJNMTIuNCAxNC45czIuMS0yIDMtMmMxLjEgMCAyLjMgMi43IDIuMyAzLjUgMCAuOC0yLjEgMi40LTMuMSAyLjMgMCAwIDAtMS4yLS43LTIuNi0uOC0xLjMtMS41LTEuMi0xLjUtMS4yeiIgZmlsbD0iIzdmYmJkZCIvPjxwYXRoIGQ9Ik0xMy44IDE1LjNjLjkuOC42IDIgMS40IDEuOCAxLS4yIDEuNC0uOCAxLjMtMS41IDAtLjcgMC0uOC0uNC0xLjYtLjMtLjctMS0xLjEtMi0uNS0uNy41LTEuNCAxLjMtMS40IDEuM3MuMi0uMyAxLjEuNXoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTIuNCAxNC45czIuMS0yIDMtMmMxLjEgMCAyLjMgMi43IDIuMyAzLjUgMCAuOC0yLjEgMi40LTMuMSAyLjMgMCAwIDAtMS4yLS43LTIuNi0uOC0xLjMtMS41LTEuMi0xLjUtMS4yeiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9Ii41Ii8+PC9zdmc+",S2={name:"@genome-spy/app",description:"GenomeSpy-based visualization tool for multiple patient samples",author:{name:"Kari Lavikka",email:"kari.lavikka@helsinki.fi"},contributors:[],license:"BSD-2-Clause",version:"0.28.0",main:"dist/index.js",files:["dist/"],repository:{type:"git",url:"github:genome-spy/genome-spy",directory:"packages/app"},scripts:{dev:"node dev-server.js",build:"vite build",prepublishOnly:"npm run build"},dependencies:{"@floating-ui/dom":"^0.5.0","@fortawesome/fontawesome-free":"^6.1.1","@fortawesome/fontawesome-svg-core":"^6.1.1","@fortawesome/free-solid-svg-icons":"^6.1.1","@genome-spy/core":"^0.28.0","@reduxjs/toolkit":"^1.8.4",idb:"^7.0.1",lit:"^2.4.0","lz-string":"^1.4.4",mapsort:"^1.0.5","redux-batched-actions":"^0.5.0","redux-undo":"^1.0.1",snarkdown:"^2.0.0"}};/**
2166
+ */const qk={},Kk=ar(class extends Kr{constructor(){super(...arguments),this.ot=qk}render(t,e){return e()}update(t,[e,n]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every((r,i)=>r===this.ot[i]))return Ae}else if(this.ot===e)return Ae;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,n)}});class Jk extends vt{constructor(){super(),this.inputRef=A2(),this.app=void 0,this.getDefaultValue=()=>"",this._keyListener=this._onKeyDown.bind(this),this._documentClickListener=e=>{var n;e.target!==this._inputField&&((n=this._inputField)==null||n.blur())},this._focused=!1}get genomeSpy(){return this.app.genomeSpy}get _inputField(){return this.inputRef.value}static get properties(){return{app:{type:Object}}}connectedCallback(){super.connectedCallback(),this._initializeGenome(),document.addEventListener("keydown",this._keyListener),document.addEventListener("click",this._documentClickListener)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._keyListener),document.removeEventListener("click",this._documentClickListener)}createRenderRoot(){return this}_onKeyDown(e){switch(e.code){case"KeyF":e.metaKey||e.altKey||e.ctrlKey||(e.preventDefault(),this.inputRef.value.focus());break}}_initializeGenome(){const e=w2(this.genomeSpy.viewRoot);e&&(this._genomeResolution=e,this._genome=this.genomeSpy.genomeStore.getGenome(),this.getDefaultValue=()=>this._genome.formatInterval(e.getDomain()),e.addEventListener("domain",ws(()=>this.requestUpdate(),60,!1)))}async searchViews(e){var r,i;const n=new Intl.Collator("en",{usage:"search",sensitivity:"base"});for(const o of this.genomeSpy.getSearchableViews()){const a=o.getAccessor("search"),s=o.getAccessor("x"),c=o.getAccessor("x2"),u=o.getScaleResolution("x");if(!(!s||!c||!(u!=null&&u.isZoomable()))){for(const f of(i=(r=o.getCollector())==null?void 0:r.getData())!=null?i:[])if(n.compare(a(f),e)===0){const l=gc([s(f),c(f)],null,1.2);return await u.zoomTo(l),!0}}}return!1}async search(e){await(async()=>{if(this._genomeResolution&&this._genome){const r=this._genome.parseInterval(e);if(r){this._genomeResolution.zoomTo(r);return}if(await this.searchViews(e))return;this.genomeSpy.viewRoot.visit(i=>{i instanceof a2&&i.handleVerboseCommand(e)})}})(),this._inputField.value=this.getDefaultValue(),this.requestUpdate()}_onSearchHelpClicked(e){const n=e.target;n.tagName=="LI"&&this._doExampleSearch(n.innerText)}_onSearchFocused(e){const n=e.target;switch(e.type){case"focus":this._focused=!0,n.select();break;case"blur":this._focused=!1;break}}_onSearchKeyDown(e){const n=e.target;e.code=="Enter"?(e.preventDefault(),this.search(n.value).then(()=>{n.focus(),n.select()}).catch(r=>{console.log(r),alert(r)})):e.code=="Escape"?n.blur():e.stopPropagation()}_doExampleSearch(e){$k(e,this._inputField).then(()=>{this._inputField.blur(),this.search(e)})}_getSearchHelp(){var i,o;const e=[];e.push(D`<p>Focus to a specific range. Examples:</p><ul><li>chr8</li><li>chr8:21,445,873</li><li>chr8:21,445,873-24,623,697</li><li>chr4:166,014,727-chr15:23,731,397</li></ul>`);for(const a of((i=this.genomeSpy)==null?void 0:i.getSearchableViews())||[]){const s=(o=a.getTitleText())!=null?o:a.spec.name,c=a.getAccessor("search"),u=c.fields.join(", "),f=Eg(3,a.getCollector().getData(),c);e.push(D`<p>Search <em>${s}</em> (${u}). Examples:</p><ul>${f.map(l=>D`<li>${l}</li>`)}</ul>`)}const n=this.app.getSampleView().attributePanel,r=n.getAttributeNames().map(a=>n.getAttributeInfo(a)).filter(a=>a.type=="nominal"||a.type=="ordinal").sort(()=>.5-Math.random()).map(a=>{var s,c;return[...(c=(s=a.scale)==null?void 0:s.domain())!=null?c:[]].sort(()=>.5-Math.random())[0]}).filter(a=>a!==void 0).slice(0,3);return r.length&&e.push(D`<p>Filter samples by categorical attributes. Examples:</p><ul>${r.map(a=>D`<li>${a}</li>`)}</ul>`),D`<div class="search-help" @click="${this._onSearchHelpClicked}">${e}</div>`}updated(e){this._focused&&this._inputField.select()}render(){return D`<div class="search"><input type="text" class="search-input" .value="${this.getDefaultValue()}" @mousedown="${e=>{this._focused||(this._inputField.focus(),e.preventDefault(),e.stopPropagation())}}" @keydown="${this._onSearchKeyDown.bind(this)}" @focus="${this._onSearchFocused}" @blur="${this._onSearchFocused}" ${x2(this.inputRef)}> ${Kk([123],()=>this._getSearchHelp())}</div>`}}customElements.define("genome-spy-search-field",Jk);function $k(t,e){return new Promise(n=>{let r=0;const i=700/t.length+30;function o(){e.value=t.substring(0,r),r>=t.length?setTimeout(n,500):(r++,setTimeout(o,Math.random()*i*2))}o()})}function w2(t){let e;return t.visit(n=>{for(const r of["x","y"]){const i=n.resolutions.scale[r];if(i&&i.type=="locus"&&i.isZoomable())return e=i,nr}}),e}const C2="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMzIgMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEuNSI+PHBhdGggZD0iTTQuNyAyMS4ycy40IDIuMyAxLjMgMy42QzcgMjYgOS44IDI4IDkuOCAyOHMzLjQtMi42IDYuNC04LjVjMCAwIDEgLjEgMS45LS40LjktLjYuOC0uNCAxLTEuMiAwIDAgMi45LjUgNi42IDAgMi4xLS4zIDQuMy0xIDYuMi0yLjUgMCAwLTEuMS0xLjctMi41LTUuMS0uNS0xLjMtMi0xLjgtNC42LTQuNmwtOC4yIDguNi0xMS45IDYuOXoiIGZpbGwtb3BhY2l0eT0iLjEiLz48cGF0aCBkPSJNMTIuNyAxNC44cy00LTEuOC0xMiAyLjdjMCAwIDEgMy43IDIuNSA1LjMgMS40IDEuNSAyLjMgMy42IDQuNiA0LjYgMCAwIDQuNy0zIDYuOS05LjJsMy0yczQuNyAyLjggMTIuNi0xLjZjMCAwLS42LTMuMy0zLTYtMi42LTMtMy44LTQuNy0zLjgtNC43cy00LjEgMi4zLTcuNSA5LjNsLTMuMyAxLjZ6IiBmaWxsPSIjN2ZiYmRkIi8+PHBhdGggZD0iTTEyLjQgMTUuNWMtLjctLjUtMi40LS44LTQuNC0uNC0yIC40LTQgMS4zLTQuOCAxLjgtLjUuMy0xLjIgMS0xLjIgMS40IDAgLjcuMyAxLjguOCAyLjQuMy4zLjcuNSAxLjQuNi44IDAgMi41LTEuNCAzLjUtMiAxLS42IDEuNi0uOCAyLjctMS4ybC0yLjkgMi40Yy0xLjMgMS4yLTIuMiAxLjUtMi40IDIuMyAwIC41IDAgMS40LjUgMS44LjQuNS42LjggMS42LjguNiAwIDEgMCAyLjYtMS41LjktLjkgMi4zLTMgMi43LTMuNy42LTEuMSAxLTIuMi43LTMtLjItMS0uNC0xLjQtLjgtMS43ek0xNy40IDE0LjJjLS4zLS41LS45LTEuMi0uMi0yLjVsMS45LTNjLjUtLjggMi0yLjMgMi42LTIuNi42LS40IDEuNS0uNiAyLS4yLjYuNCAxIDEgMS4zIDEuNS40LjYuNyAxLjMuMiAyLS43IDEtMS42LjktMi44IDEuNy0xLjIuOC0xLjkgMS4yLTIuNSAxLjlsMy44LTEuOGMxLjMtLjYgMi43LTEuMSAzLjQtLjcuOC41LjguNyAxIDEuNC4zIDEtLjIgMS45LS44IDIuNC0uNS42LTEuNS45LTIuNiAxLjItMS40LjQtNC41IDEtNS44LjUtMS4zLS41LTEuMy0xLjQtMS41LTEuOHoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTIuNyAxNC44cy00LTEuOC0xMiAyLjdjMCAwIDEgMy43IDIuNSA1LjMgMS40IDEuNSAyLjMgMy42IDQuNiA0LjYgMCAwIDQuNy0zIDYuOS05LjJsMy0yczQuNyAyLjggMTIuNi0xLjZjMCAwLS42LTMuMy0zLTYtMi42LTMtMy44LTQuNy0zLjgtNC43cy00LjEgMi4zLTcuNSA5LjNsLTMuMyAxLjZ6IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iLjUiLz48cGF0aCBkPSJNMTIuNCAxNC45czIuMS0yIDMtMmMxLjEgMCAyLjMgMi43IDIuMyAzLjUgMCAuOC0yLjEgMi40LTMuMSAyLjMgMCAwIDAtMS4yLS43LTIuNi0uOC0xLjMtMS41LTEuMi0xLjUtMS4yeiIgZmlsbD0iIzdmYmJkZCIvPjxwYXRoIGQ9Ik0xMy44IDE1LjNjLjkuOC42IDIgMS40IDEuOCAxLS4yIDEuNC0uOCAxLjMtMS41IDAtLjcgMC0uOC0uNC0xLjYtLjMtLjctMS0xLjEtMi0uNS0uNy41LTEuNCAxLjMtMS40IDEuM3MuMi0uMyAxLjEuNXoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTIuNCAxNC45czIuMS0yIDMtMmMxLjEgMCAyLjMgMi43IDIuMyAzLjUgMCAuOC0yLjEgMi40LTMuMSAyLjMgMCAwIDAtMS4yLS43LTIuNi0uOC0xLjMtMS41LTEuMi0xLjUtMS4yeiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9Ii41Ii8+PC9zdmc+",S2={name:"@genome-spy/app",description:"GenomeSpy-based visualization tool for multiple patient samples",author:{name:"Kari Lavikka",email:"kari.lavikka@helsinki.fi"},contributors:[],license:"BSD-2-Clause",version:"0.28.1",main:"dist/index.js",files:["dist/"],repository:{type:"git",url:"github:genome-spy/genome-spy",directory:"packages/app"},scripts:{dev:"node dev-server.js",build:"vite build",prepublishOnly:"npm run build"},dependencies:{"@floating-ui/dom":"^0.5.0","@fortawesome/fontawesome-free":"^6.1.1","@fortawesome/fontawesome-svg-core":"^6.1.1","@fortawesome/free-solid-svg-icons":"^6.1.1","@genome-spy/core":"^0.28.1","@reduxjs/toolkit":"^1.8.4",idb:"^7.0.1",lit:"^2.4.0","lz-string":"^1.4.4",mapsort:"^1.0.5","redux-batched-actions":"^0.5.0","redux-undo":"^1.0.1",snarkdown:"^2.0.0"},gitHead:"afa6f0dad1d3b205e95a6335fd474cf7984021b3"};/**
2167
2167
  * @license
2168
2168
  * Copyright 2020 Google LLC
2169
2169
  * SPDX-License-Identifier: BSD-3-Clause
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "contributors": [],
9
9
  "license": "BSD-2-Clause",
10
- "version": "0.28.0",
10
+ "version": "0.28.1",
11
11
  "main": "dist/index.js",
12
12
  "files": [
13
13
  "dist/"
@@ -27,7 +27,7 @@
27
27
  "@fortawesome/fontawesome-free": "^6.1.1",
28
28
  "@fortawesome/fontawesome-svg-core": "^6.1.1",
29
29
  "@fortawesome/free-solid-svg-icons": "^6.1.1",
30
- "@genome-spy/core": "^0.28.0",
30
+ "@genome-spy/core": "^0.28.1",
31
31
  "@reduxjs/toolkit": "^1.8.4",
32
32
  "idb": "^7.0.1",
33
33
  "lit": "^2.4.0",
@@ -36,5 +36,6 @@
36
36
  "redux-batched-actions": "^0.5.0",
37
37
  "redux-undo": "^1.0.1",
38
38
  "snarkdown": "^2.0.0"
39
- }
39
+ },
40
+ "gitHead": "afa6f0dad1d3b205e95a6335fd474cf7984021b3"
40
41
  }