@@ -2448,7 +2448,7 @@ Reason: ${a.message}`)}));if(t.isViewSpec(o))return o.baseUrl=(r=s.match(/^[^?#]
${r}
- `:"";return Ai`${a}${o}`}var Dl;class a1 extends Zh{constructor(t,i,s,o,r,a){super(t,i,s,o,r,a);at(this,Dl,[]);this.spec=t,this.needsAxes={x:!0,y:!0}}async initializeChildren(){Fi(this,Dl,await Promise.all(this.spec.layer.map((t,i)=>this.context.createOrImportView(t,this,this,"grid"+i,s=>{if(!rI(s)&&!oI(s))throw new Lh("LayerView accepts only unit or layer specs as children!",this)}))))}get children(){return we(this,Dl).slice()}*[Symbol.iterator](){for(const t of we(this,Dl))yield t}render(t,i,s={}){if(super.render(t,i,s),!!this.isConfiguredVisible()){t.pushView(this,i);for(const o of we(this,Dl))o.render(t,i,s);t.popView(this)}}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0);for(let i=we(this,Dl).length-1;i>=0;i--)if(we(this,Dl)[i].propagateInteractionEvent(t),t.stopped)return;this.handleInteractionEvent(void 0,t,!1)}}Dl=new WeakMap;class MO{constructor(e,t){this.n=e,this.maxCols=t??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=[],t=this.nCols,i=this.nRows;for(let s=0;s
=this.maxCols)return;i=t*this.nCols+e}return i=this.n))return[e%this.nCols,Math.floor(e/this.nCols)]}}const ude="chromosome_ticks_and_labels",hde={x:"width",y:"height"};function tI(n){return n=="x"?"y":"x"}const FC={x:["bottom","top"],y:["left","right"]},PR=Object.fromEntries(Object.entries(FC).map(([n,e])=>e.map(t=>[t,n])).flat(1));function Od(n){return PR[n]}class Rz extends a1{constructor(e,t,i,s,o,r){const a=t=="locus",l={...a?gde:Pz,...fde(t,e),...e};super(a?pde(l,t):Oz(l,t),i,s,o,`axis_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getSize(){const e={px:this.getPerpendicularSize()},t={grow:1};return PR[this.axisProps.orient]=="x"?new Pd(t,e):new Pd(e,t)}getPerpendicularSize(){return OR(this.axisProps)}isPickingSupported(){return!1}}function OR(n){const e=Od(n.orient);let t=n.ticks&&n.tickSize||0;return n.labels&&(t+=n.labelPadding,e=="x"?t+=n.labelFontSize:t+=30),n.title&&(t+=n.titlePadding+n.titleFontSize),t=Math.min(n.maxExtent||1/0,Math.max(n.minExtent||0,t)),t}const Pz={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 fde(n,e){const t=e.orient,i=n=="nominal"||n=="ordinal";let s="center",o="middle",r=e.labelAngle??((t=="top"||t=="bottom")&&i?-90:0);switch(t){case"left":s="right";break;case"right":s="left";break;case"top":case"bottom":Math.abs(r)>30?(s=r>0==(t=="bottom")?"left":"right",o="middle"):o=t=="top"?"alphabetic":"top";break}return{labelAlign:s,labelAngle:r,labelBaseline:o}}function Oz(n,e){const t={...n,extent:OR(n)},i=Od(t.orient),s=tI(i),o=t.orient=="bottom"||t.orient=="right"?1:-1,r=t.orient=="bottom"||t.orient=="left"?1:0,a=()=>({name:"domain",data:{values:[0]},mark:{type:"rule",clip:!1,strokeDash:t.domainDash,strokeCap:t.domainCap,color:t.domainColor,[s]:r,size:t.domainWidth}}),l=()=>({name:"labels",mark:{type:"text",clip:!1,align:t.labelAlign,angle:t.labelAngle,baseline:t.labelBaseline,[s+"Offset"]:(t.tickSize+t.labelPadding)*o,[s]:r,size:t.labelFontSize,color:t.labelColor,minBufferSize:1500},encoding:{[i]:{field:"value",type:e},text:{field:"label"}}}),c=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:t.tickDash,strokeCap:t.tickCap,color:t.tickColor,size:t.tickWidth,minBufferSize:300},encoding:{[s]:{value:r},[s+"2"]:{value:r-t.tickSize/t.extent*(r?1:-1)}}}),d=()=>({name:"title",data:{values:[0]},mark:{type:"text",clip:!1,align:"center",baseline:t.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(t.orient)],text:t.title,color:t.titleColor,[i]:.5,[s]:1-r}}),u=()=>{const f={name:"ticks_and_labels",encoding:{[i]:{field:"value",type:e}},layer:[]};return t.ticks&&f.layer.push(c()),t.labels&&f.layer.push(l()),f},h={resolve:{scale:{[i]:"forced"}},[hde[tI(i)]]:t.extent,data:{lazy:{type:"axisTicks",channel:i,axis:n}},layer:[]};return t.domain&&h.layer.push(a()),(t.ticks||t.labels)&&h.layer.push(u()),t.title&&h.layer.push(d()),h}const gde={...Pz,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 pde(n,e){const t={...n,extent:OR(n)},i=Od(t.orient),s=tI(i),o=t.orient=="bottom"||t.orient=="left"?1:0,r=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:n.chromTickDash,strokeDashOffset:n.chromTickDashOffset,[s]:o,[s+"2"]:o-t.chromTickSize/t.extent*(o?1:-1),color:n.chromTickColor,size:t.chromTickWidth}}),a=()=>{let d;switch(t.orient){case"top":d={y:0,angle:0,paddingX:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":d={y:1,angle:0,paddingX:4,dy:t.chromLabelPadding+t.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":d={x:1,angle:-90,paddingY:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":d={x:0,angle:90,align:"right",paddingY:4,dy:-t.chromLabelPadding};break;default:d={}}return{name:"chromosome_labels",mark:{type:"text",size:t.chromLabelFontSize,font:t.chromLabelFont,fontWeight:t.chromLabelFontWeight,fontStyle:t.chromLabelFontStyle,color:t.chromLabelColor,align:n.chromLabelAlign,baseline:"alphabetic",clip:!1,...d},encoding:{[i+"2"]:{field:"continuousEnd",type:e},text:{field:"name"}}}};let l;switch(t.orient){case"bottom":case"top":l={};break;case"left":l={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":l={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:l={}}const c=Oz({...n,...l},e);if(n.chromTicks||n.chromLabels){const d={name:ude,data:{lazy:{type:"axisGenome",channel:Od(t.orient)}},encoding:{[i]:{field:"continuousStart",type:e,band:0}},layer:[]};if(n.chromTicks&&d.layer.push(r()),n.chromLabels){d.layer.push(a());let u;c.layer.filter(h=>h.name=="ticks_and_labels").forEach(h=>h.layer.filter(f=>f.name=="labels").forEach(f=>{u=f.mark})),u&&(t.orient=="top"||t.orient=="bottom"?(u.viewportEdgeFadeWidthLeft=30,u.viewportEdgeFadeDistanceLeft=40):(u.viewportEdgeFadeWidthBottom=30,u.viewportEdgeFadeDistanceBottom=40))}c.layer.push(d)}return c}class mde extends a1{constructor(e,t,i,s,o,r){const l={...t=="locus"?_de:Fz,...e};super(yde(l,t),i,s,o,`axisGrid_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getOrient(){return this.axisProps.orient}isPickingSupported(){return!1}}const Fz={values:null,grid:!1,gridCap:"butt",gridColor:"lightgray",gridDash:null,gridOpacity:1,gridWidth:1,tickCount:null,tickMinStep:null},_de={...Fz,chromGrid:!1,chromGridCap:"butt",chromGridColor:"gray",chromGridDash:[1,5],chromGridOpacity:1,chromGridWidth:1};function bde(n,e){const t=n,i=Od(t.orient);return{name:"grid_lines",data:{lazy:{type:"axisTicks",channel:i,axis:n}},mark:{type:"rule",strokeDash:t.gridDash,strokeCap:t.gridCap,color:t.gridColor,size:t.gridWidth,opacity:t.gridOpacity,minBufferSize:300},encoding:{[i]:{field:"value",type:e}}}}function vde(n,e){const t=n,i=Od(t.orient);return{name:"chromosome_lines",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rule",strokeDash:t.chromGridDash,strokeCap:t.chromGridCap,color:t.chromGridColor,size:t.chromGridWidth,opacity:t.chromGridOpacity},encoding:{[i]:{field:"continuousStart",type:e,band:0}}}}function wde(n,e){const t=n,i=Od(t.orient);return{name:"chromosome_fill",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rect"},encoding:{[i]:{field:"continuousStart",type:e,band:0},[i+"2"]:{field:"continuousEnd",band:0},fill:{field:"odd",type:"nominal",scale:{domain:[!1,!0],range:[t.chromGridFillEven??"white",t.chromGridFillOdd??"white"]}},opacity:{field:"odd",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[t.chromGridFillEven?1:0,t.chromGridFillOdd?1:0]}}}}}function yde(n,e){const t={...n},i=[];return t.chromGrid&&(t.chromGridFillOdd||t.chromGridFillEven)&&i.push(wde(t,e)),t.chromGrid&&t.chromGridOpacity>0&&i.push(vde(t,e)),t.grid&&t.gridOpacity>0&&i.push(bde(t,e)),{name:"grid_layers",configurableVisibility:!1,resolve:{scale:{[Od(n.orient)]:"forced",fill:"independent",opacity:"independent"}},layer:i}}const RO={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"},Cde={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},Sde={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},xde={start:0,middle:.5,end:1},Lde={start:"left",middle:"center",end:"right"};function Dde(n){if(!n)return;const e=Di(n)?{text:n}:n;if(!e.text||e.orient=="none")return;const t={"track-title":Cde,overlay:Sde}[e.style]??{},i={...RO,...t,...e};let s={},o={x:0,y:0};const r=xde[i.anchor??"middle"];switch(i.orient){case"top":o={x:r,y:1},s={baseline:"alphabetic",angle:0};break;case"right":o={x:1,y:1-r},s={baseline:"alphabetic",angle:90};break;case"bottom":o={x:r,y:0},s={baseline:"top",angle:0};break;case"left":o={x:0,y:r},s={baseline:"alphabetic",angle:-90};break}const a={...RO,...s,...t,...e},l={xOffset:0,yOffset:0};switch(i.orient){case"top":l.yOffset=-a.offset;break;case"right":l.xOffset=a.offset;break;case"bottom":l.yOffset=a.offset;break;case"left":l.xOffset=-a.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...o,...l,text:a.text,align:a.align??Lde[a.anchor],angle:a.angle,baseline:a.baseline,dx:a.dx,dy:a.dy,color:a.color,font:a.font,size:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight}}}function kde(n,e,t,i){if(n.type=="wheel"){n.uiEvent.preventDefault();const s=n.uiEvent,o=s.deltaMode?120:1;let{x:r,y:a}=n.point;if(i){const l=i.mark.encoders;l.x&&!l.x2&&!l.x.constantValue&&(r=+l.x(i.datum)*e.width+e.x),l.y&&!l.y2&&!l.y.constantValue&&(a=(1-+l.y(i.datum))*e.height+e.y)}Math.abs(s.deltaX){t({x:o.clientX,y:o.clientY,xDelta:l.clientX-o.clientX,yDelta:l.clientY-o.clientY,zDelta:0}),o=l},a=l=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",a)};document.addEventListener("mouseup",a,!1),document.addEventListener("mousemove",r,!1)}}var Dp,kp,No,ph,Ep,kl,Mu,mx,Bz,mh,E0,Av,iI,Tv,nI,Nv,sI,_x,Wz,Ip,Dy,bx,Vz;class Ede extends Zh{constructor(t,i,s,o,r,a,l){super(t,i,s,o,r,l);at(this,kl);at(this,mx);at(this,mh);at(this,Av);at(this,Tv);at(this,Nv);at(this,_x);at(this,Ip);at(this,bx);at(this,Dp,1/0);at(this,kp,10);at(this,No,[]);at(this,ph,{});at(this,Ep,0);this.spec=t,Fi(this,kp,t.spacing??10),Fi(this,Dp,a),Fi(this,No,[]),this.wrappingFacet=!1}appendChild(t){t.layoutParent??(t.layoutParent=this),we(this,No).push(new OO(t,this,we(this,Ep))),_3(this,Ep)._++}setChildren(t){Fi(this,No,[]);for(const i of t)this.appendChild(i)}replaceChild(t,i){const s=we(this,No).findIndex(o=>o.view==t);if(s>=0)we(this,No)[s]=new OO(i,this,we(this,Ep));else throw new Error("Not my child view!")}get children(){return we(this,No).map(t=>t.view)}get childCount(){return we(this,No).length}async createAxes(){const t=[];for(const i of Lm){const s=this.resolutions.axis[i];if(s){const o=s.getAxisProps();if(o){const r={title:s.getTitle(),orient:FC[i][0],...o},a=new Rz(r,s.scaleResolution.type,this.context,this,this);t.push(a.initializeChildren()),we(this,ph)[i]=a}}}return Promise.all([...t,...we(this,No).map(i=>i.createAxes())])}*[Symbol.iterator](){for(const t of we(this,No))yield*t.getChildren();for(const t of Object.values(we(this,ph)))yield t}getOverhang(){return ot(this,_x,Wz).call(this).union(ot(this,Ip,Dy).call(this))}getSize(){return this._cache("size",()=>new Pd(ot(this,Tv,nI).call(this,"column"),ot(this,Tv,nI).call(this,"row")).addPadding(ot(this,Ip,Dy).call(this)))}render(t,i,s={}){if(super.render(t,i,s),!this.isConfiguredVisible())return;this.layoutParent||(i=i.shrink(this.getPadding())),i=i.shrink(ot(this,Ip,Dy).call(this)),t.pushView(this,i);const o={devicePixelRatio:this.context.devicePixelRatio},r=_O(ot(this,Av,iI).call(this,"column"),i.width,o),a=_O(ot(this,Av,iI).call(this,"row"),i.height,o),l=new MO(we(this,kl,Mu).length,we(this,Dp)??1/0),c=d=>Math.round(d*devicePixelRatio)/devicePixelRatio;for(const[d,u]of we(this,kl,Mu).entries()){const{view:h,axes:f,gridLines:g,background:p,backgroundStroke:_,title:b}=u,[v,w]=l.getCellCoords(d),y=r[ot(this,Nv,sI).call(this,"column",v)],S=a[ot(this,Nv,sI).call(this,"row",w)],L=h.getViewportSize(),x=h.getSize(),D=h.getOverhang(),k=y.location-D.left,P=S.location-D.top,B=(xt,It)=>(xt[It].grow?(It=="width"?y:S).size:xt[It].px)+D[It],R=B(L,"width"),M=B(L,"height"),$=B(x,"width"),Y=B(x,"height"),ne=u.scrollbars.horizontal,ce=u.scrollbars.vertical,ge=ne?()=>c(ne.viewportOffset):()=>0,se=ce?()=>c(ce.viewportOffset):()=>0,Se=new jl(()=>i.x+k,()=>i.y+P,()=>R,()=>M),Ie=h.isScrollable(),pe=Ie?new jl(()=>i.x+k-ge(),()=>i.y+P-se(),()=>$,()=>Y):Se;u.coords=Se;const ee=s.clipRect?Se.intersect(s.clipRect):Se;p==null||p.render(t,ee,{...s,clipRect:void 0});for(const xt of Object.values(g))xt.render(t,Se,s);const Gt=Nde(h)||Ie;Gt&&h.render(t,pe,{...s,clipRect:ee}),_==null||_.render(t,ee,{...s,clipRect:void 0});for(const[xt,It]of Object.entries(f)){const je=xt=="left"||xt=="right"?"vertical":"horizontal",ei=u.scrollbars[je],De=ei?Se.modify(je=="vertical"?{y:()=>pe.y,height:Y}:{x:()=>pe.x,width:$}):Se,Be=PO(De,xt,It);let he=s.clipRect;ei&&(he=Be.intersect(he).intersect(ei?Se.modify(je=="vertical"?{x:-1e5,width:2e5}:{y:-1e5,height:2e5}):void 0)),It.render(t,Be,{...s,clipRect:he})}for(const xt of Object.values(we(this,ph))){const je=xt.axisProps.orient;(je=="left"&&v==0||je=="right"&&v==l.nCols-1||je=="top"&&w==0||je=="bottom"&&w==l.nRows-1)&&xt.render(t,PO(Se.shrink(u.view.getOverhang()),je,xt),s)}Gt||h.render(t,pe,s);for(const xt of Object.values(u.scrollbars))xt.updateScrollbar(Se,pe),xt.render(t,i,s);b==null||b.render(t,Se,s)}t.popView(this)}propagateInteractionEvent(t){if(this.handleInteractionEvent(void 0,t,!0),t.stopped)return;const i=we(this,kl,Mu).find(o=>o.coords.containsPoint(t.point.x,t.point.y));for(const o of Object.values((i==null?void 0:i.scrollbars)??{}))if(o.coords.containsPoint(t.point.x,t.point.y)&&(o.propagateInteractionEvent(t),t.stopped))return;const s=i==null?void 0:i.view;s&&(s.propagateInteractionEvent(t),(s instanceof Oo||s instanceof a1)&&kde(t,i.coords,o=>ot(this,bx,Vz).call(this,i.coords,i.view,o),this.context.getCurrentHover())),!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,i){return"independent"}}Dp=new WeakMap,kp=new WeakMap,No=new WeakMap,ph=new WeakMap,Ep=new WeakMap,kl=new WeakSet,Mu=function(){return we(this,No).filter(t=>t.view.isConfiguredVisible())},mx=new WeakSet,Bz=function(){return new MO(we(this,kl,Mu).length,we(this,Dp)??1/0)},mh=new WeakSet,E0=function(t){const i=t=="column"?"width":"height",s=(o,r)=>o.map(a=>{const c=we(this,kl,Mu)[a].getOverhangAndPadding();return t=="column"?r?c.right:c.left:r?c.bottom:c.top}).reduce((a,l)=>Math.max(a,l),0);return this._cache(`size/directionSizes/${t}`,()=>we(this,mx,Bz)[t=="column"?"colIndices":"rowIndices"].map(o=>({axisBefore:s(o,0),axisAfter:s(o,1),view:Aae(o.map(r=>we(this,kl,Mu)[r].view.getViewportSize()[i]))})))},Av=new WeakSet,iI=function(t){const i=ot(this,mh,E0).call(this,t),s=[];s.push(n_);for(const[o,r]of i.entries())o>0&&s.push({px:we(this,kp),grow:0}),(o==0||this.wrappingFacet)&&s.push(n_),s.push({px:r.axisBefore,grow:0}),s.push(r.view),s.push({px:r.axisAfter,grow:0}),(o==i.length-1||this.wrappingFacet)&&s.push(n_);return s},Tv=new WeakSet,nI=function(t){let i=0,s=0;const o=t=="row"?this.spec.height:this.spec.width;if(o||o===0)return oz(o);const r=ot(this,mh,E0).call(this,t);for(const[a,l]of r.entries())a>0&&(s+=we(this,kp)),(a==0||this.wrappingFacet)&&(s+=0),s+=l.axisBefore,s+=l.view.px??0,i+=l.view.grow??0,s+=l.axisAfter,(a==r.length-1||this.wrappingFacet)&&(s+=0);return{px:s,grow:i}},Nv=new WeakSet,sI=function(t,i){return t=="row"&&this.wrappingFacet?1+6*i+2:2+4*i+1},_x=new WeakSet,Wz=function(){const t=ot(this,mh,E0).call(this,"column"),i=ot(this,mh,E0).call(this,"row");return!t.length||!i.length?Cs.zero():new Cs(i.at(0).axisBefore,t.at(-1).axisAfter,i.at(-1).axisAfter,t.at(0).axisBefore)},Ip=new WeakSet,Dy=function(){const t=i=>{const s=PR[i],o=we(this,ph)[s];return(o==null?void 0:o.axisProps.orient)!==i?0:Math.max(o.getPerpendicularSize()+o.axisProps.offset,0)};return new Cs(t("top"),t("right"),t("bottom"),t("left"))},bx=new WeakSet,Vz=function(t,i,s){for(const[o,r]of Object.entries(Tde(i))){if(r.size<=0)continue;const a=t.normalizePoint(s.x,s.y),l=t.normalizePoint(s.x+s.xDelta,s.y+s.yDelta),c={x:l.x-a.x,y:l.y-a.y};for(const d of r)d.zoom(2**s.zDelta,o=="y"?1-a[o]:a[o],o=="x"?c.x:-c.y)}this.context.animator.requestRender()};function Ide(n){if(!(!n||!n.fill||n.fillOpacity===0))return{configurableVisibility:!1,data:{values:[{}]},mark:{color:n.fill,opacity:n.fillOpacity??1,type:"rect",clip:!1,tooltip:null,minHeight:1,minOpacity:0}}}function Ade(n){if(!(!n||!n.stroke||n.strokeWidth===0||n.strokeOpacity===0))return{configurableVisibility:!1,resolve:{scale:{x:"excluded",y:"excluded"},axis:{x:"excluded",y:"excluded"}},data:{values:[{x:0,y:0,x2:1,y2:0},{x:1,y:0,x2:1,y2:1},{x:1,y:1,x2:0,y2:1},{x:0,y:1,x2:0,y2:0}]},mark:{size:n.strokeWidth??1,color:n.stroke??"lightgray",strokeCap:"square",strokeOpacity:n.strokeOpacity??1,type:"rule",clip:!1,tooltip:null},encoding:{x:{field:"x",type:"quantitative",scale:null},y:{field:"y",type:"quantitative",scale:null},x2:{field:"x2"},y2:{field:"y2"}}}}function Tde(n){const e={x:new Set,y:new Set};return n.visit(t=>{for(const[i,s]of Object.entries(e)){const o=t.getScaleResolution(i);o&&o.isZoomable()&&s.add(o)}}),e}function Nde(n){let e=!0;return n.visit(t=>{t instanceof Oo&&e&&(e=t.mark.properties.clip===!0)}),e}function PO(n,e,t){const i=t.axisProps,s=t.getPerpendicularSize();if(e=="bottom")return n.translate(0,n.height+i.offset).modify({height:s});if(e=="top")return n.translate(0,-s-i.offset).modify({height:s});if(e=="left")return n.translate(-s-i.offset,0).modify({width:s});if(e=="right")return n.translate(n.width+i.offset,0).modify({width:s})}class OO{constructor(e,t,i){if(this.layoutParent=t,this.view=e,this.serial=i,this.background=void 0,this.backgroundStroke=void 0,this.axes={},this.gridLines={},this.scrollbars={},this.title=void 0,this.coords=jl.ZERO,e.needsAxes.x||e.needsAxes.y){const s=e.spec,o="view"in s?s==null?void 0:s.view:void 0,r=Ide(o);r&&(this.background=new Oo(r,t.context,t,e,"background"+i,{blockEncodingInheritance:!0}));const a=Ade(o);a&&(this.backgroundStroke=new Oo(a,t.context,t,e,"backgroundStroke"+i,{blockEncodingInheritance:!0}));const l=Dde(e.spec.title);if(l){const c=new Oo(l,t.context,t,e,"title"+i,{blockEncodingInheritance:!0});this.title=c}}e.spec.viewportWidth!=null&&(this.scrollbars.horizontal=new FO(this,"horizontal")),e.spec.viewportHeight!=null&&(this.scrollbars.vertical=new FO(this,"vertical"))}*getChildren(){this.background&&(yield this.background),this.backgroundStroke&&(yield this.backgroundStroke),this.title&&(yield this.title),yield*Object.values(this.axes),yield*Object.values(this.gridLines),yield this.view,yield*Object.values(this.scrollbars)}async createAxes(){const{view:e,axes:t,gridLines:i}=this,s=(a,l)=>{const c=a.getAxisProps();if(c===null)return;const d=c?{...c}:{};if(!d.orient){for(const u of FC[l])if(!t[u]){d.orient=u;break}if(!d.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if(d.title??(d.title=a.getTitle()),!FC[l].includes(d.orient))throw new Error(`Invalid axis orientation "${d.orient}" on channel "${l}"!`);return d},o=async(a,l,c)=>{const d=s(a,l);if(d){if(t[d.orient])throw new Error(`An axis with the orient "${d.orient}" already exists!`);const u=new Rz(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);t[d.orient]=u,await u.initializeChildren()}},r=async(a,l,c)=>{const d=s(a,l);if(d&&(d.grid||d.chromGrid)){const u=new mde(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);i[d.orient]=u,await u.initializeChildren()}};for(const a of["x","y"])if(e.needsAxes[a]){const l=e.resolutions.axis[a];if(!l)continue;await o(l,a,e)}for(const a of["x","y"])if(e.needsAxes[a]){const l=e.getAxisResolution(a);if(!l)continue;await r(l,a,e)}if(e instanceof a1){for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&d.orient&&await o(c,l,a)}for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&!d.orient&&await o(c,l,a)}}[...Object.values(t),...Object.values(i)].forEach(a=>a.visit(l=>{l instanceof Oo&&l.resolve("scale")}))}getOverhang(){const e=t=>{const i=this.axes[t];return i?Math.max(i.getPerpendicularSize()+i.axisProps.offset,0):0};return new Cs(e("top"),e("right"),e("bottom"),e("left")).add(this.view.getOverhang())}getOverhangAndPadding(){return this.getOverhang().add(this.view.getPadding())}}class FO extends Oo{constructor(e,t){const i={scrollbarSize:8,scrollbarPadding:2};super({data:{values:[{}]},mark:{type:"rect",fill:"#b0b0b0",fillOpacity:.6,stroke:"white",strokeWidth:1,strokeOpacity:1,cornerRadius:5,clip:!1},configurableVisibility:!1},e.layoutParent.context,e.layoutParent,e.view,"scrollbar-"+t,{blockEncodingInheritance:!0}),this.config=i,this.scrollDirection=t,this.viewportOffset=0,this.maxScrollOffset=0,this.scrollbarCoords=jl.ZERO,this.addInteractionEventListener("mousedown",(s,o)=>{if(o.stopPropagation(),this.maxScrollOffset<=0)return;const r=h=>t=="vertical"?h.clientY:h.clientX,a=o.uiEvent;a.preventDefault();const l=this.getScrollOffset(),c=r(a),d=h=>{const f=J_(r(h)-c+l,0,this.maxScrollOffset);this.viewportOffset=f/this.maxScrollOffset*this.maxViewportOffset,this.context.animator.requestRender()},u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mouseup",u,!1),document.addEventListener("mousemove",d,!1)})}getScrollOffset(){return this.viewportOffset/this.maxViewportOffset*this.maxScrollOffset}render(e,t,i){super.render(e,this.scrollbarCoords,i)}updateScrollbar(e,t){const i=this.config.scrollbarPadding,s=this.config.scrollbarSize,o=this.scrollDirection=="horizontal"?"width":"height",r=Math.min(1,e[o]/t[o]),a=e[o]-2*i,l=r*a;this.maxScrollOffset=a-l,this.maxViewportOffset=t[o]-e[o],this.viewportOffset=J_(this.viewportOffset,0,this.maxViewportOffset),this.scrollbarCoords=this.scrollDirection=="vertical"?new jl(()=>e.x+e.width-s-i,()=>e.y+i+this.getScrollOffset(),()=>s,()=>l):new jl(()=>e.x+i+this.getScrollOffset(),()=>e.y+e.height-s-i,()=>l,()=>s)}}class _k extends Ede{constructor(e,t,i,s,o){super(e,t,i,s,o,aI(e)?e.columns:ky(e)?1:1/0),this.spec=e}async initializeChildren(){const e=this.spec,t=aI(e)?e.concat:ky(e)?e.vconcat:e.hconcat;this.setChildren(await Promise.all(t.map((i,s)=>this.context.createOrImportView(i,this,this,"grid"+s)))),await this.createAxes()}getDefaultResolution(e,t){return t=="axis"?"independent":ky(this.spec)&&e==="x"||zz(this.spec)&&e==="y"?"shared":"independent"}}const Hz="viewRoot";var Ap;class Mde{constructor(e={}){at(this,Ap,new Map);this.options={allowImport:!0,wrapRoot:!0,...e};const t=i=>(s,o,r,a,l)=>new i(s,o,r,a,s.name??l);this.addViewType(rI,t(a1)),this.addViewType(oI,t(Oo)),this.addViewType(ky,t(_k)),this.addViewType(zz,t(_k)),this.addViewType(aI,t(_k)),this.addViewType(Pde,()=>{throw new Error("SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!")})}addViewType(e,t){we(this,Ap).set(e,t)}createView(e,t,i,s,o){for(const[r,a]of we(this,Ap))if(r(e))return a(e,t,i,s,o);throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(e)]))}isViewSpec(e){const t=[...we(this,Ap).keys()].filter(i=>i(e));if(t.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return t.length==1}async createOrImportView(e,t,i,s,o,r){let a;if(Rde(e))if(this.options.allowImport)a=await Hce(e,s.getBaseUrl(),t),r&&r(a);else throw new Lh("Importing views is not allowed!",i);else a=e;!s&&this.options.wrapRoot&&(oI(a)||rI(a))&&o===Hz&&(a={name:"implicitRoot",vconcat:[a]});const l=this.createView(a,t,i,s,o);return l instanceof Zh&&await l.initializeChildren(),l}}Ap=new WeakMap;function oI(n){return"mark"in n&&(Di(n.mark)||Lo(n.mark))}function rI(n){return"layer"in n&&Lo(n.layer)}function Rde(n){return"import"in n}function ky(n){return"vconcat"in n&&Eo(n.vconcat)}function zz(n){return"hconcat"in n&&Eo(n.hconcat)}function aI(n){return"concat"in n&&Eo(n.concat)}function Pde(n){return"samples"in n&&Lo(n.samples)&&"spec"in n&&Lo(n.spec)}var Tp,_h,Mv,bh;class Ode{constructor(){at(this,Tp,void 0);at(this,_h,void 0);at(this,Mv,void 0);at(this,bh,void 0);Fi(this,Tp,new Map),Fi(this,_h,new Set),Fi(this,bh,new Map),Fi(this,Mv,new Proxy(we(this,Tp),{get(e,t){return Di(t)?e.get(t):void 0}}))}allocateSetter(e){if(we(this,_h).has(e))throw new Error("Setter already allocated for parameter: "+e);return we(this,_h).add(e),t=>{we(this,Tp).set(e,t);const i=we(this,bh).get(e);if(i)for(const s of i)s()}}createExpression(e){const t=Fx(e,we(this,Mv));for(const i of t.globals)if(!we(this,_h).has(i))throw new Error(`Unknown variable "${i}" in expression: ${e}`);return t.addListener=i=>{for(const s of t.globals){const o=we(this,bh).get(s)??new Set;we(this,bh).set(s,o),o.add(i)}},t}}Tp=new WeakMap,_h=new WeakMap,Mv=new WeakMap,bh=new WeakMap;TW("fasta",tde);class Fde{constructor(e,t,i={}){this.container=e,this._destructionCallbacks=[];const s=document.createElement("style");s.innerHTML=GJ,e.appendChild(s),this.spec=t,this.accessorFactory=new Oie,this.viewFactory=new Mde,this.namedDataProviders=[],this.animator=new Kce(()=>this.renderAll()),this.genomeStore=void 0,this.viewVisibilityPredicate=o=>o.isVisibleInSpec(),this._renderingContext=void 0,this._pickingContext=void 0,this._dirtyPickingBuffer=!1,this._currentHover=void 0,this._wheelInertia=new ide(this.animator),this._keyboardListeners=new Map,this._eventListeners=new Map,this._extraBroadcastListeners=new Map,this.tooltipHandlers={default:dde,refseqgene:sde,...i.tooltipHandlers??{}},this.viewRoot=void 0,this._paramBroker=new Ode,this._loadingViews=new Map}registerNamedDataProvider(e){this.namedDataProviders.unshift(e)}getNamedDataFromProvider(e){for(const t of this.namedDataProviders){const i=t(e);if(i)return i}}updateNamedData(e,t){const i=this.viewRoot.context.dataFlow.findNamedDataSource(e);if(!i)throw new Error("No such named data source: "+e);i.dataSource.updateDynamicData(t),JE(i.hosts),this.animator.requestRender()}broadcast(e,t){var s;const i={type:e,payload:t};this.viewRoot.visit(o=>o.handleBroadcast(i)),(s=this._extraBroadcastListeners.get(e))==null||s.forEach(o=>o(i))}_updateLoadingIndicators(){const e=[],t=()=>[...this._loadingViews.values()].some(i=>i);for(const[i,s]of this._loadingViews){const o=i.coords;if(o){const r={left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`};e.push(Ai`
+ `:"";return Ai`${a}${o}`}var Dl;class a1 extends Xh{constructor(t,i,s,o,r,a){super(t,i,s,o,r,a);at(this,Dl,[]);this.spec=t,this.needsAxes={x:!0,y:!0}}async initializeChildren(){Fi(this,Dl,await Promise.all(this.spec.layer.map((t,i)=>this.context.createOrImportView(t,this,this,"grid"+i,s=>{if(!rI(s)&&!oI(s))throw new Dh("LayerView accepts only unit or layer specs as children!",this)}))))}get children(){return we(this,Dl).slice()}*[Symbol.iterator](){for(const t of we(this,Dl))yield t}render(t,i,s={}){if(super.render(t,i,s),!!this.isConfiguredVisible()){t.pushView(this,i);for(const o of we(this,Dl))o.render(t,i,s);t.popView(this)}}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0);for(let i=we(this,Dl).length-1;i>=0;i--)if(we(this,Dl)[i].propagateInteractionEvent(t),t.stopped)return;this.handleInteractionEvent(void 0,t,!1)}}Dl=new WeakMap;class MO{constructor(e,t){this.n=e,this.maxCols=t??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=[],t=this.nCols,i=this.nRows;for(let s=0;s
=this.maxCols)return;i=t*this.nCols+e}return i=this.n))return[e%this.nCols,Math.floor(e/this.nCols)]}}const ude="chromosome_ticks_and_labels",hde={x:"width",y:"height"};function tI(n){return n=="x"?"y":"x"}const FC={x:["bottom","top"],y:["left","right"]},PR=Object.fromEntries(Object.entries(FC).map(([n,e])=>e.map(t=>[t,n])).flat(1));function Od(n){return PR[n]}class Rz extends a1{constructor(e,t,i,s,o,r){const a=t=="locus",l={...a?gde:Pz,...fde(t,e),...e};super(a?pde(l,t):Oz(l,t),i,s,o,`axis_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getSize(){const e={px:this.getPerpendicularSize()},t={grow:1};return PR[this.axisProps.orient]=="x"?new Pd(t,e):new Pd(e,t)}getPerpendicularSize(){return OR(this.axisProps)}isPickingSupported(){return!1}}function OR(n){const e=Od(n.orient);let t=n.ticks&&n.tickSize||0;return n.labels&&(t+=n.labelPadding,e=="x"?t+=n.labelFontSize:t+=30),n.title&&(t+=n.titlePadding+n.titleFontSize),t=Math.min(n.maxExtent||1/0,Math.max(n.minExtent||0,t)),t}const Pz={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 fde(n,e){const t=e.orient,i=n=="nominal"||n=="ordinal";let s="center",o="middle",r=e.labelAngle??((t=="top"||t=="bottom")&&i?-90:0);switch(t){case"left":s="right";break;case"right":s="left";break;case"top":case"bottom":Math.abs(r)>30?(s=r>0==(t=="bottom")?"left":"right",o="middle"):o=t=="top"?"alphabetic":"top";break}return{labelAlign:s,labelAngle:r,labelBaseline:o}}function Oz(n,e){const t={...n,extent:OR(n)},i=Od(t.orient),s=tI(i),o=t.orient=="bottom"||t.orient=="right"?1:-1,r=t.orient=="bottom"||t.orient=="left"?1:0,a=()=>({name:"domain",data:{values:[0]},mark:{type:"rule",clip:!1,strokeDash:t.domainDash,strokeCap:t.domainCap,color:t.domainColor,[s]:r,size:t.domainWidth}}),l=()=>({name:"labels",mark:{type:"text",clip:!1,align:t.labelAlign,angle:t.labelAngle,baseline:t.labelBaseline,[s+"Offset"]:(t.tickSize+t.labelPadding)*o,[s]:r,size:t.labelFontSize,color:t.labelColor,minBufferSize:1500},encoding:{[i]:{field:"value",type:e},text:{field:"label"}}}),c=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:t.tickDash,strokeCap:t.tickCap,color:t.tickColor,size:t.tickWidth,minBufferSize:300},encoding:{[s]:{value:r},[s+"2"]:{value:r-t.tickSize/t.extent*(r?1:-1)}}}),d=()=>({name:"title",data:{values:[0]},mark:{type:"text",clip:!1,align:"center",baseline:t.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(t.orient)],text:t.title,color:t.titleColor,[i]:.5,[s]:1-r}}),u=()=>{const f={name:"ticks_and_labels",encoding:{[i]:{field:"value",type:e}},layer:[]};return t.ticks&&f.layer.push(c()),t.labels&&f.layer.push(l()),f},h={resolve:{scale:{[i]:"forced"}},[hde[tI(i)]]:t.extent,data:{lazy:{type:"axisTicks",channel:i,axis:n}},layer:[]};return t.domain&&h.layer.push(a()),(t.ticks||t.labels)&&h.layer.push(u()),t.title&&h.layer.push(d()),h}const gde={...Pz,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 pde(n,e){const t={...n,extent:OR(n)},i=Od(t.orient),s=tI(i),o=t.orient=="bottom"||t.orient=="left"?1:0,r=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:n.chromTickDash,strokeDashOffset:n.chromTickDashOffset,[s]:o,[s+"2"]:o-t.chromTickSize/t.extent*(o?1:-1),color:n.chromTickColor,size:t.chromTickWidth}}),a=()=>{let d;switch(t.orient){case"top":d={y:0,angle:0,paddingX:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":d={y:1,angle:0,paddingX:4,dy:t.chromLabelPadding+t.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":d={x:1,angle:-90,paddingY:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":d={x:0,angle:90,align:"right",paddingY:4,dy:-t.chromLabelPadding};break;default:d={}}return{name:"chromosome_labels",mark:{type:"text",size:t.chromLabelFontSize,font:t.chromLabelFont,fontWeight:t.chromLabelFontWeight,fontStyle:t.chromLabelFontStyle,color:t.chromLabelColor,align:n.chromLabelAlign,baseline:"alphabetic",clip:!1,...d},encoding:{[i+"2"]:{field:"continuousEnd",type:e},text:{field:"name"}}}};let l;switch(t.orient){case"bottom":case"top":l={};break;case"left":l={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":l={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:l={}}const c=Oz({...n,...l},e);if(n.chromTicks||n.chromLabels){const d={name:ude,data:{lazy:{type:"axisGenome",channel:Od(t.orient)}},encoding:{[i]:{field:"continuousStart",type:e,band:0}},layer:[]};if(n.chromTicks&&d.layer.push(r()),n.chromLabels){d.layer.push(a());let u;c.layer.filter(h=>h.name=="ticks_and_labels").forEach(h=>h.layer.filter(f=>f.name=="labels").forEach(f=>{u=f.mark})),u&&(t.orient=="top"||t.orient=="bottom"?(u.viewportEdgeFadeWidthLeft=30,u.viewportEdgeFadeDistanceLeft=40):(u.viewportEdgeFadeWidthBottom=30,u.viewportEdgeFadeDistanceBottom=40))}c.layer.push(d)}return c}class mde extends a1{constructor(e,t,i,s,o,r){const l={...t=="locus"?_de:Fz,...e};super(yde(l,t),i,s,o,`axisGrid_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getOrient(){return this.axisProps.orient}isPickingSupported(){return!1}}const Fz={values:null,grid:!1,gridCap:"butt",gridColor:"lightgray",gridDash:null,gridOpacity:1,gridWidth:1,tickCount:null,tickMinStep:null},_de={...Fz,chromGrid:!1,chromGridCap:"butt",chromGridColor:"gray",chromGridDash:[1,5],chromGridOpacity:1,chromGridWidth:1};function bde(n,e){const t=n,i=Od(t.orient);return{name:"grid_lines",data:{lazy:{type:"axisTicks",channel:i,axis:n}},mark:{type:"rule",strokeDash:t.gridDash,strokeCap:t.gridCap,color:t.gridColor,size:t.gridWidth,opacity:t.gridOpacity,minBufferSize:300},encoding:{[i]:{field:"value",type:e}}}}function vde(n,e){const t=n,i=Od(t.orient);return{name:"chromosome_lines",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rule",strokeDash:t.chromGridDash,strokeCap:t.chromGridCap,color:t.chromGridColor,size:t.chromGridWidth,opacity:t.chromGridOpacity},encoding:{[i]:{field:"continuousStart",type:e,band:0}}}}function wde(n,e){const t=n,i=Od(t.orient);return{name:"chromosome_fill",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rect"},encoding:{[i]:{field:"continuousStart",type:e,band:0},[i+"2"]:{field:"continuousEnd",band:0},fill:{field:"odd",type:"nominal",scale:{domain:[!1,!0],range:[t.chromGridFillEven??"white",t.chromGridFillOdd??"white"]}},opacity:{field:"odd",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[t.chromGridFillEven?1:0,t.chromGridFillOdd?1:0]}}}}}function yde(n,e){const t={...n},i=[];return t.chromGrid&&(t.chromGridFillOdd||t.chromGridFillEven)&&i.push(wde(t,e)),t.chromGrid&&t.chromGridOpacity>0&&i.push(vde(t,e)),t.grid&&t.gridOpacity>0&&i.push(bde(t,e)),{name:"grid_layers",configurableVisibility:!1,resolve:{scale:{[Od(n.orient)]:"forced",fill:"independent",opacity:"independent"}},layer:i}}const RO={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"},Cde={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},Sde={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},xde={start:0,middle:.5,end:1},Lde={start:"left",middle:"center",end:"right"};function Dde(n){if(!n)return;const e=Di(n)?{text:n}:n;if(!e.text||e.orient=="none")return;const t={"track-title":Cde,overlay:Sde}[e.style]??{},i={...RO,...t,...e};let s={},o={x:0,y:0};const r=xde[i.anchor??"middle"];switch(i.orient){case"top":o={x:r,y:1},s={baseline:"alphabetic",angle:0};break;case"right":o={x:1,y:1-r},s={baseline:"alphabetic",angle:90};break;case"bottom":o={x:r,y:0},s={baseline:"top",angle:0};break;case"left":o={x:0,y:r},s={baseline:"alphabetic",angle:-90};break}const a={...RO,...s,...t,...e},l={xOffset:0,yOffset:0};switch(i.orient){case"top":l.yOffset=-a.offset;break;case"right":l.xOffset=a.offset;break;case"bottom":l.yOffset=a.offset;break;case"left":l.xOffset=-a.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...o,...l,text:a.text,align:a.align??Lde[a.anchor],angle:a.angle,baseline:a.baseline,dx:a.dx,dy:a.dy,color:a.color,font:a.font,size:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight}}}function kde(n,e,t,i){if(n.type=="wheel"){n.uiEvent.preventDefault();const s=n.uiEvent,o=s.deltaMode?120:1;let{x:r,y:a}=n.point;if(i){const l=i.mark.encoders;l.x&&!l.x2&&!l.x.constantValue&&(r=+l.x(i.datum)*e.width+e.x),l.y&&!l.y2&&!l.y.constantValue&&(a=(1-+l.y(i.datum))*e.height+e.y)}Math.abs(s.deltaX){t({x:o.clientX,y:o.clientY,xDelta:l.clientX-o.clientX,yDelta:l.clientY-o.clientY,zDelta:0}),o=l},a=l=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",a)};document.addEventListener("mouseup",a,!1),document.addEventListener("mousemove",r,!1)}}var Dp,kp,No,mh,Ep,kl,Mu,mx,Bz,_h,E0,Av,iI,Tv,nI,Nv,sI,_x,Wz,Ip,Dy,bx,Vz;class Ede extends Xh{constructor(t,i,s,o,r,a,l){super(t,i,s,o,r,l);at(this,kl);at(this,mx);at(this,_h);at(this,Av);at(this,Tv);at(this,Nv);at(this,_x);at(this,Ip);at(this,bx);at(this,Dp,1/0);at(this,kp,10);at(this,No,[]);at(this,mh,{});at(this,Ep,0);this.spec=t,Fi(this,kp,t.spacing??10),Fi(this,Dp,a),Fi(this,No,[]),this.wrappingFacet=!1}appendChild(t){t.layoutParent??(t.layoutParent=this),we(this,No).push(new OO(t,this,we(this,Ep))),_3(this,Ep)._++}setChildren(t){Fi(this,No,[]);for(const i of t)this.appendChild(i)}replaceChild(t,i){const s=we(this,No).findIndex(o=>o.view==t);if(s>=0)we(this,No)[s]=new OO(i,this,we(this,Ep));else throw new Error("Not my child view!")}get children(){return we(this,No).map(t=>t.view)}get childCount(){return we(this,No).length}async createAxes(){const t=[];for(const i of Lm){const s=this.resolutions.axis[i];if(s){const o=s.getAxisProps();if(o){const r={title:s.getTitle(),orient:FC[i][0],...o},a=new Rz(r,s.scaleResolution.type,this.context,this,this);t.push(a.initializeChildren()),we(this,mh)[i]=a}}}return Promise.all([...t,...we(this,No).map(i=>i.createAxes())])}*[Symbol.iterator](){for(const t of we(this,No))yield*t.getChildren();for(const t of Object.values(we(this,mh)))yield t}getOverhang(){return ot(this,_x,Wz).call(this).union(ot(this,Ip,Dy).call(this))}getSize(){return this._cache("size",()=>new Pd(ot(this,Tv,nI).call(this,"column"),ot(this,Tv,nI).call(this,"row")).addPadding(ot(this,Ip,Dy).call(this)))}render(t,i,s={}){if(super.render(t,i,s),!this.isConfiguredVisible())return;this.layoutParent||(i=i.shrink(this.getPadding())),i=i.shrink(ot(this,Ip,Dy).call(this)),t.pushView(this,i);const o={devicePixelRatio:this.context.devicePixelRatio},r=_O(ot(this,Av,iI).call(this,"column"),i.width,o),a=_O(ot(this,Av,iI).call(this,"row"),i.height,o),l=new MO(we(this,kl,Mu).length,we(this,Dp)??1/0),c=d=>Math.round(d*devicePixelRatio)/devicePixelRatio;for(const[d,u]of we(this,kl,Mu).entries()){const{view:h,axes:f,gridLines:g,background:p,backgroundStroke:_,title:b}=u,[v,w]=l.getCellCoords(d),y=r[ot(this,Nv,sI).call(this,"column",v)],S=a[ot(this,Nv,sI).call(this,"row",w)],L=h.getViewportSize(),x=h.getSize(),D=h.getOverhang(),k=y.location-D.left,P=S.location-D.top,B=(xt,It)=>(xt[It].grow?(It=="width"?y:S).size:xt[It].px)+D[It],R=B(L,"width"),M=B(L,"height"),$=B(x,"width"),Y=B(x,"height"),ne=u.scrollbars.horizontal,ce=u.scrollbars.vertical,ge=ne?()=>c(ne.viewportOffset):()=>0,se=ce?()=>c(ce.viewportOffset):()=>0,Se=new jl(()=>i.x+k,()=>i.y+P,()=>R,()=>M),Ie=h.isScrollable(),pe=Ie?new jl(()=>i.x+k-ge(),()=>i.y+P-se(),()=>$,()=>Y):Se;u.coords=Se;const ee=s.clipRect?Se.intersect(s.clipRect):Se;p==null||p.render(t,ee,{...s,clipRect:void 0});for(const xt of Object.values(g))xt.render(t,Se,s);const Gt=Nde(h)||Ie;Gt&&h.render(t,pe,{...s,clipRect:ee}),_==null||_.render(t,ee,{...s,clipRect:void 0});for(const[xt,It]of Object.entries(f)){const je=xt=="left"||xt=="right"?"vertical":"horizontal",ei=u.scrollbars[je],De=ei?Se.modify(je=="vertical"?{y:()=>pe.y,height:Y}:{x:()=>pe.x,width:$}):Se,Be=PO(De,xt,It);let he=s.clipRect;ei&&(he=Be.intersect(he).intersect(ei?Se.modify(je=="vertical"?{x:-1e5,width:2e5}:{y:-1e5,height:2e5}):void 0)),It.render(t,Be,{...s,clipRect:he})}for(const xt of Object.values(we(this,mh))){const je=xt.axisProps.orient;(je=="left"&&v==0||je=="right"&&v==l.nCols-1||je=="top"&&w==0||je=="bottom"&&w==l.nRows-1)&&xt.render(t,PO(Se.shrink(u.view.getOverhang()),je,xt),s)}Gt||h.render(t,pe,s);for(const xt of Object.values(u.scrollbars))xt.updateScrollbar(Se,pe),xt.render(t,i,s);b==null||b.render(t,Se,s)}t.popView(this)}propagateInteractionEvent(t){if(this.handleInteractionEvent(void 0,t,!0),t.stopped)return;const i=we(this,kl,Mu).find(o=>o.coords.containsPoint(t.point.x,t.point.y));for(const o of Object.values((i==null?void 0:i.scrollbars)??{}))if(o.coords.containsPoint(t.point.x,t.point.y)&&(o.propagateInteractionEvent(t),t.stopped))return;const s=i==null?void 0:i.view;s&&(s.propagateInteractionEvent(t),(s instanceof Oo||s instanceof a1)&&kde(t,i.coords,o=>ot(this,bx,Vz).call(this,i.coords,i.view,o),this.context.getCurrentHover())),!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,i){return"independent"}}Dp=new WeakMap,kp=new WeakMap,No=new WeakMap,mh=new WeakMap,Ep=new WeakMap,kl=new WeakSet,Mu=function(){return we(this,No).filter(t=>t.view.isConfiguredVisible())},mx=new WeakSet,Bz=function(){return new MO(we(this,kl,Mu).length,we(this,Dp)??1/0)},_h=new WeakSet,E0=function(t){const i=t=="column"?"width":"height",s=(o,r)=>o.map(a=>{const c=we(this,kl,Mu)[a].getOverhangAndPadding();return t=="column"?r?c.right:c.left:r?c.bottom:c.top}).reduce((a,l)=>Math.max(a,l),0);return this._cache(`size/directionSizes/${t}`,()=>we(this,mx,Bz)[t=="column"?"colIndices":"rowIndices"].map(o=>({axisBefore:s(o,0),axisAfter:s(o,1),view:Aae(o.map(r=>we(this,kl,Mu)[r].view.getViewportSize()[i]))})))},Av=new WeakSet,iI=function(t){const i=ot(this,_h,E0).call(this,t),s=[];s.push(n_);for(const[o,r]of i.entries())o>0&&s.push({px:we(this,kp),grow:0}),(o==0||this.wrappingFacet)&&s.push(n_),s.push({px:r.axisBefore,grow:0}),s.push(r.view),s.push({px:r.axisAfter,grow:0}),(o==i.length-1||this.wrappingFacet)&&s.push(n_);return s},Tv=new WeakSet,nI=function(t){let i=0,s=0;const o=t=="row"?this.spec.height:this.spec.width;if(o||o===0)return oz(o);const r=ot(this,_h,E0).call(this,t);for(const[a,l]of r.entries())a>0&&(s+=we(this,kp)),(a==0||this.wrappingFacet)&&(s+=0),s+=l.axisBefore,s+=l.view.px??0,i+=l.view.grow??0,s+=l.axisAfter,(a==r.length-1||this.wrappingFacet)&&(s+=0);return{px:s,grow:i}},Nv=new WeakSet,sI=function(t,i){return t=="row"&&this.wrappingFacet?1+6*i+2:2+4*i+1},_x=new WeakSet,Wz=function(){const t=ot(this,_h,E0).call(this,"column"),i=ot(this,_h,E0).call(this,"row");return!t.length||!i.length?Cs.zero():new Cs(i.at(0).axisBefore,t.at(-1).axisAfter,i.at(-1).axisAfter,t.at(0).axisBefore)},Ip=new WeakSet,Dy=function(){const t=i=>{const s=PR[i],o=we(this,mh)[s];return(o==null?void 0:o.axisProps.orient)!==i?0:Math.max(o.getPerpendicularSize()+o.axisProps.offset,0)};return new Cs(t("top"),t("right"),t("bottom"),t("left"))},bx=new WeakSet,Vz=function(t,i,s){for(const[o,r]of Object.entries(Tde(i))){if(r.size<=0)continue;const a=t.normalizePoint(s.x,s.y),l=t.normalizePoint(s.x+s.xDelta,s.y+s.yDelta),c={x:l.x-a.x,y:l.y-a.y};for(const d of r)d.zoom(2**s.zDelta,o=="y"?1-a[o]:a[o],o=="x"?c.x:-c.y)}this.context.animator.requestRender()};function Ide(n){if(!(!n||!n.fill||n.fillOpacity===0))return{configurableVisibility:!1,data:{values:[{}]},mark:{color:n.fill,opacity:n.fillOpacity??1,type:"rect",clip:!1,tooltip:null,minHeight:1,minOpacity:0}}}function Ade(n){if(!(!n||!n.stroke||n.strokeWidth===0||n.strokeOpacity===0))return{configurableVisibility:!1,resolve:{scale:{x:"excluded",y:"excluded"},axis:{x:"excluded",y:"excluded"}},data:{values:[{x:0,y:0,x2:1,y2:0},{x:1,y:0,x2:1,y2:1},{x:1,y:1,x2:0,y2:1},{x:0,y:1,x2:0,y2:0}]},mark:{size:n.strokeWidth??1,color:n.stroke??"lightgray",strokeCap:"square",strokeOpacity:n.strokeOpacity??1,type:"rule",clip:!1,tooltip:null},encoding:{x:{field:"x",type:"quantitative",scale:null},y:{field:"y",type:"quantitative",scale:null},x2:{field:"x2"},y2:{field:"y2"}}}}function Tde(n){const e={x:new Set,y:new Set};return n.visit(t=>{for(const[i,s]of Object.entries(e)){const o=t.getScaleResolution(i);o&&o.isZoomable()&&s.add(o)}}),e}function Nde(n){let e=!0;return n.visit(t=>{t instanceof Oo&&e&&(e=t.mark.properties.clip===!0)}),e}function PO(n,e,t){const i=t.axisProps,s=t.getPerpendicularSize();if(e=="bottom")return n.translate(0,n.height+i.offset).modify({height:s});if(e=="top")return n.translate(0,-s-i.offset).modify({height:s});if(e=="left")return n.translate(-s-i.offset,0).modify({width:s});if(e=="right")return n.translate(n.width+i.offset,0).modify({width:s})}class OO{constructor(e,t,i){if(this.layoutParent=t,this.view=e,this.serial=i,this.background=void 0,this.backgroundStroke=void 0,this.axes={},this.gridLines={},this.scrollbars={},this.title=void 0,this.coords=jl.ZERO,e.needsAxes.x||e.needsAxes.y){const s=e.spec,o="view"in s?s==null?void 0:s.view:void 0,r=Ide(o);r&&(this.background=new Oo(r,t.context,t,e,"background"+i,{blockEncodingInheritance:!0}));const a=Ade(o);a&&(this.backgroundStroke=new Oo(a,t.context,t,e,"backgroundStroke"+i,{blockEncodingInheritance:!0}));const l=Dde(e.spec.title);if(l){const c=new Oo(l,t.context,t,e,"title"+i,{blockEncodingInheritance:!0});this.title=c}}e.spec.viewportWidth!=null&&(this.scrollbars.horizontal=new FO(this,"horizontal")),e.spec.viewportHeight!=null&&(this.scrollbars.vertical=new FO(this,"vertical"))}*getChildren(){this.background&&(yield this.background),this.backgroundStroke&&(yield this.backgroundStroke),this.title&&(yield this.title),yield*Object.values(this.axes),yield*Object.values(this.gridLines),yield this.view,yield*Object.values(this.scrollbars)}async createAxes(){const{view:e,axes:t,gridLines:i}=this,s=(a,l)=>{const c=a.getAxisProps();if(c===null)return;const d=c?{...c}:{};if(!d.orient){for(const u of FC[l])if(!t[u]){d.orient=u;break}if(!d.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if(d.title??(d.title=a.getTitle()),!FC[l].includes(d.orient))throw new Error(`Invalid axis orientation "${d.orient}" on channel "${l}"!`);return d},o=async(a,l,c)=>{const d=s(a,l);if(d){if(t[d.orient])throw new Error(`An axis with the orient "${d.orient}" already exists!`);const u=new Rz(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);t[d.orient]=u,await u.initializeChildren()}},r=async(a,l,c)=>{const d=s(a,l);if(d&&(d.grid||d.chromGrid)){const u=new mde(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);i[d.orient]=u,await u.initializeChildren()}};for(const a of["x","y"])if(e.needsAxes[a]){const l=e.resolutions.axis[a];if(!l)continue;await o(l,a,e)}for(const a of["x","y"])if(e.needsAxes[a]){const l=e.getAxisResolution(a);if(!l)continue;await r(l,a,e)}if(e instanceof a1){for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&d.orient&&await o(c,l,a)}for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&!d.orient&&await o(c,l,a)}}[...Object.values(t),...Object.values(i)].forEach(a=>a.visit(l=>{l instanceof Oo&&l.resolve("scale")}))}getOverhang(){const e=t=>{const i=this.axes[t];return i?Math.max(i.getPerpendicularSize()+i.axisProps.offset,0):0};return new Cs(e("top"),e("right"),e("bottom"),e("left")).add(this.view.getOverhang())}getOverhangAndPadding(){return this.getOverhang().add(this.view.getPadding())}}class FO extends Oo{constructor(e,t){const i={scrollbarSize:8,scrollbarPadding:2};super({data:{values:[{}]},mark:{type:"rect",fill:"#b0b0b0",fillOpacity:.6,stroke:"white",strokeWidth:1,strokeOpacity:1,cornerRadius:5,clip:!1},configurableVisibility:!1},e.layoutParent.context,e.layoutParent,e.view,"scrollbar-"+t,{blockEncodingInheritance:!0}),this.config=i,this.scrollDirection=t,this.viewportOffset=0,this.maxScrollOffset=0,this.scrollbarCoords=jl.ZERO,this.addInteractionEventListener("mousedown",(s,o)=>{if(o.stopPropagation(),this.maxScrollOffset<=0)return;const r=h=>t=="vertical"?h.clientY:h.clientX,a=o.uiEvent;a.preventDefault();const l=this.getScrollOffset(),c=r(a),d=h=>{const f=J_(r(h)-c+l,0,this.maxScrollOffset);this.viewportOffset=f/this.maxScrollOffset*this.maxViewportOffset,this.context.animator.requestRender()},u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mouseup",u,!1),document.addEventListener("mousemove",d,!1)})}getScrollOffset(){return this.viewportOffset/this.maxViewportOffset*this.maxScrollOffset}render(e,t,i){super.render(e,this.scrollbarCoords,i)}updateScrollbar(e,t){const i=this.config.scrollbarPadding,s=this.config.scrollbarSize,o=this.scrollDirection=="horizontal"?"width":"height",r=Math.min(1,e[o]/t[o]),a=e[o]-2*i,l=r*a;this.maxScrollOffset=a-l,this.maxViewportOffset=t[o]-e[o],this.viewportOffset=J_(this.viewportOffset,0,this.maxViewportOffset),this.scrollbarCoords=this.scrollDirection=="vertical"?new jl(()=>e.x+e.width-s-i,()=>e.y+i+this.getScrollOffset(),()=>s,()=>l):new jl(()=>e.x+i+this.getScrollOffset(),()=>e.y+e.height-s-i,()=>l,()=>s)}}class _k extends Ede{constructor(e,t,i,s,o){super(e,t,i,s,o,aI(e)?e.columns:ky(e)?1:1/0),this.spec=e}async initializeChildren(){const e=this.spec,t=aI(e)?e.concat:ky(e)?e.vconcat:e.hconcat;this.setChildren(await Promise.all(t.map((i,s)=>this.context.createOrImportView(i,this,this,"grid"+s)))),await this.createAxes()}getDefaultResolution(e,t){return t=="axis"?"independent":ky(this.spec)&&e==="x"||zz(this.spec)&&e==="y"?"shared":"independent"}}const Hz="viewRoot";var Ap;class Mde{constructor(e={}){at(this,Ap,new Map);this.options={allowImport:!0,wrapRoot:!0,...e};const t=i=>(s,o,r,a,l)=>new i(s,o,r,a,s.name??l);this.addViewType(rI,t(a1)),this.addViewType(oI,t(Oo)),this.addViewType(ky,t(_k)),this.addViewType(zz,t(_k)),this.addViewType(aI,t(_k)),this.addViewType(Pde,()=>{throw new Error("SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!")})}addViewType(e,t){we(this,Ap).set(e,t)}createView(e,t,i,s,o){for(const[r,a]of we(this,Ap))if(r(e))return a(e,t,i,s,o);throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(e)]))}isViewSpec(e){const t=[...we(this,Ap).keys()].filter(i=>i(e));if(t.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return t.length==1}async createOrImportView(e,t,i,s,o,r){let a;if(Rde(e))if(this.options.allowImport)a=await Hce(e,s.getBaseUrl(),t),r&&r(a);else throw new Dh("Importing views is not allowed!",i);else a=e;!s&&this.options.wrapRoot&&(oI(a)||rI(a))&&o===Hz&&(a={name:"implicitRoot",vconcat:[a]});const l=this.createView(a,t,i,s,o);return l instanceof Xh&&await l.initializeChildren(),l}}Ap=new WeakMap;function oI(n){return"mark"in n&&(Di(n.mark)||Lo(n.mark))}function rI(n){return"layer"in n&&Lo(n.layer)}function Rde(n){return"import"in n}function ky(n){return"vconcat"in n&&Eo(n.vconcat)}function zz(n){return"hconcat"in n&&Eo(n.hconcat)}function aI(n){return"concat"in n&&Eo(n.concat)}function Pde(n){return"samples"in n&&Lo(n.samples)&&"spec"in n&&Lo(n.spec)}var Tp,bh,Mv,vh;class Ode{constructor(){at(this,Tp,void 0);at(this,bh,void 0);at(this,Mv,void 0);at(this,vh,void 0);Fi(this,Tp,new Map),Fi(this,bh,new Set),Fi(this,vh,new Map),Fi(this,Mv,new Proxy(we(this,Tp),{get(e,t){return Di(t)?e.get(t):void 0}}))}allocateSetter(e){if(we(this,bh).has(e))throw new Error("Setter already allocated for parameter: "+e);return we(this,bh).add(e),t=>{we(this,Tp).set(e,t);const i=we(this,vh).get(e);if(i)for(const s of i)s()}}createExpression(e){const t=Fx(e,we(this,Mv));for(const i of t.globals)if(!we(this,bh).has(i))throw new Error(`Unknown variable "${i}" in expression: ${e}`);return t.addListener=i=>{for(const s of t.globals){const o=we(this,vh).get(s)??new Set;we(this,vh).set(s,o),o.add(i)}},t}}Tp=new WeakMap,bh=new WeakMap,Mv=new WeakMap,vh=new WeakMap;TW("fasta",tde);class Fde{constructor(e,t,i={}){this.container=e,this._destructionCallbacks=[];const s=document.createElement("style");s.innerHTML=GJ,e.appendChild(s),this.spec=t,this.accessorFactory=new Oie,this.viewFactory=new Mde,this.namedDataProviders=[],this.animator=new Kce(()=>this.renderAll()),this.genomeStore=void 0,this.viewVisibilityPredicate=o=>o.isVisibleInSpec(),this._renderingContext=void 0,this._pickingContext=void 0,this._dirtyPickingBuffer=!1,this._currentHover=void 0,this._wheelInertia=new ide(this.animator),this._keyboardListeners=new Map,this._eventListeners=new Map,this._extraBroadcastListeners=new Map,this.tooltipHandlers={default:dde,refseqgene:sde,...i.tooltipHandlers??{}},this.viewRoot=void 0,this._paramBroker=new Ode,this._loadingViews=new Map}registerNamedDataProvider(e){this.namedDataProviders.unshift(e)}getNamedDataFromProvider(e){for(const t of this.namedDataProviders){const i=t(e);if(i)return i}}updateNamedData(e,t){const i=this.viewRoot.context.dataFlow.findNamedDataSource(e);if(!i)throw new Error("No such named data source: "+e);i.dataSource.updateDynamicData(t),JE(i.hosts),this.animator.requestRender()}broadcast(e,t){var s;const i={type:e,payload:t};this.viewRoot.visit(o=>o.handleBroadcast(i)),(s=this._extraBroadcastListeners.get(e))==null||s.forEach(o=>o(i))}_updateLoadingIndicators(){const e=[],t=()=>[...this._loadingViews.values()].some(i=>i);for(const[i,s]of this._loadingViews){const o=i.coords;if(o){const r={left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`};e.push(Ai`
Loading...
@@ -2480,39 +2480,39 @@ Reason: ${a.message}`)}));if(t.isViewSpec(o))return o.baseUrl=(r=s.match(/^[^?#]
}
}
}
-`;function Io(n,e=0){return n[n.length-(1+e)]}function Ude(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Ki(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;i
t(n[i],e))}function qde(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,o=e(s);if(o<0)t=s+1;else if(o>0)i=s-1;else return s}return-(t+1)}function*Uz(n,e){let t,i;for(const s of n)i!==void 0&&e(i,s)?t.push(s):(t&&(yield t),t=[s]),i=s;t&&(yield t)}function jz(n,e){for(let t=0;t<=n.length;t++)e(t===0?void 0:n[t-1],t===n.length?void 0:n[t])}function Gde(n,e){for(let t=0;t!!e)}function BO(n){let e=0;for(let t=0;t0}function Xh(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function qz(n,e){return n.length>0?n[0]:e}function ts(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;se;s--)i.push(s);return i}function cL(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function bk(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function lw(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function lI(n,e){for(const t of e)n.push(t)}function Gz(n){return Array.isArray(n)?n:[n]}function Yde(n,e,t){const i=Kz(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r0}n.isGreaterThan=i;function s(o){return o===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(ab||(ab={}));function cr(n,e){return(t,i)=>e(n(t),n(i))}function Zde(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!ab.isNeitherLessOrGreaterThan(s))return s}return ab.neitherLessOrGreaterThan}}const ld=(n,e)=>n-e,Xde=(n,e)=>ld(n?1:0,e?1:0);function Yz(n){return(e,t)=>-n(e,t)}class sc{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class za{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new za(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new za(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(s=>((i||ab.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}}za.empty=new za(n=>{});function Ms(n){return typeof n=="string"}function Ds(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function Qde(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function Fd(n){return typeof n=="number"&&!isNaN(n)}function VO(n){return!!n&&typeof n[Symbol.iterator]=="function"}function Zz(n){return n===!0||n===!1}function Us(n){return typeof n>"u"}function BC(n){return!go(n)}function go(n){return Us(n)||n===null}function Ls(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function cI(n){if(go(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function WC(n){return typeof n=="function"}function Jde(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?wl(i):i}),e}function tue(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(Xz.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!Qde(s)&&e.push(s)}}return n}const Xz=Object.prototype.hasOwnProperty;function Qz(n,e){return dI(n,e,new Set)}function dI(n,e,t){if(go(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const o of n)s.push(dI(o,e,t));return s}if(Ds(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)Xz.call(n,o)&&(s[o]=dI(n[o],e,t));return t.delete(n),s}return n}function dL(n,e,t=!0){return Ds(n)?(Ds(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Ds(n[i])&&Ds(e[i])?dL(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function So(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(s,o)},i={};for(const s of n)i[s]=t(s);return i}let sue=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function oue(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const o=s[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),sue&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(n,e,...t){return oue(e,t)}var vk;const wg="en";let VC=!1,HC=!1,Ey=!1,Jz=!1,BR=!1,WR=!1,e$=!1,cw,wk=wg,HO=wg,rue,Ar;const dr=typeof self=="object"?self:typeof globalThis=="object"?globalThis:{};let is;typeof dr.vscode<"u"&&typeof dr.vscode.process<"u"?is=dr.vscode.process:typeof process<"u"&&(is=process);const aue=typeof((vk=is==null?void 0:is.versions)===null||vk===void 0?void 0:vk.electron)=="string",lue=aue&&(is==null?void 0:is.type)==="renderer";if(typeof navigator=="object"&&!lue)Ar=navigator.userAgent,VC=Ar.indexOf("Windows")>=0,HC=Ar.indexOf("Macintosh")>=0,WR=(Ar.indexOf("Macintosh")>=0||Ar.indexOf("iPad")>=0||Ar.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ey=Ar.indexOf("Linux")>=0,e$=(Ar==null?void 0:Ar.indexOf("Mobi"))>=0,BR=!0,m({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),cw=wg,wk=cw,HO=navigator.language;else if(typeof is=="object"){VC=is.platform==="win32",HC=is.platform==="darwin",Ey=is.platform==="linux",Ey&&is.env.SNAP&&is.env.SNAP_REVISION,is.env.CI||is.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cw=wg,wk=wg;const n=is.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];cw=e.locale,HO=e.osLocale,wk=t||wg,rue=e._translationsConfigFile}catch{}Jz=!0}else console.error("Unable to resolve platform.");const Rs=VC,gt=HC,Zn=Ey,Yg=Jz,Em=BR,cue=BR&&typeof dr.importScripts=="function",Bd=WR,due=e$,Ua=Ar,uue=typeof dr.postMessage=="function"&&!dr.importScripts,t$=(()=>{if(uue){const n=[];dr.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i{const i=++e;n.push({id:i,callback:t}),dr.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),bo=HC||WR?2:VC?1:3;let zO=!0,$O=!1;function hue(){if(!$O){$O=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,zO=new Uint16Array(n.buffer)[0]===512+1}return zO}const i$=!!(Ua&&Ua.indexOf("Chrome")>=0),fue=!!(Ua&&Ua.indexOf("Firefox")>=0),gue=!!(!i$&&Ua&&Ua.indexOf("Safari")>=0),pue=!!(Ua&&Ua.indexOf("Edg/")>=0);Ua&&Ua.indexOf("Android")>=0;const In={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var dt;(function(n){function e(v){return v&&typeof v=="object"&&typeof v[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(v){yield v}n.single=s;function o(v){return e(v)?v:s(v)}n.wrap=o;function r(v){return v||t}n.from=r;function*a(v){for(let w=v.length-1;w>=0;w--)yield v[w]}n.reverse=a;function l(v){return!v||v[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(v){return v[Symbol.iterator]().next().value}n.first=c;function d(v,w){for(const y of v)if(w(y))return!0;return!1}n.some=d;function u(v,w){for(const y of v)if(w(y))return y}n.find=u;function*h(v,w){for(const y of v)w(y)&&(yield y)}n.filter=h;function*f(v,w){let y=0;for(const S of v)yield w(S,y++)}n.map=f;function*g(...v){for(const w of v)for(const y of w)yield y}n.concat=g;function p(v,w,y){let S=y;for(const L of v)S=w(S,L);return S}n.reduce=p;function*_(v,w,y=v.length){for(w<0&&(w+=v.length),y<0?y+=v.length:y>v.length&&(y=v.length);w{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Ei.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ei.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ei.Undefined&&e.next!==Ei.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ei.Undefined&&e.next===Ei.Undefined?(this._first=Ei.Undefined,this._last=Ei.Undefined):e.next===Ei.Undefined?(this._last=this._last.prev,this._last.next=Ei.Undefined):e.prev===Ei.Undefined&&(this._first=this._first.next,this._first.prev=Ei.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ei.Undefined;)yield e.element,e=e.next}}const n$="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function mue(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of n$)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const VR=mue();function s$(n){let e=VR;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const o$=new ks;o$.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function lb(n,e,t,i,s){if(s||(s=dt.first(o$)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),lb(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=s.timeBudget);c++){const d=r-s.windowSize*c;e.lastIndex=Math.max(0,d);const u=_ue(e,t,r,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function _ue(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const Dc=8;class r${constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class a${constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Kt{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return uL(e,t)}compute(e,t,i){return i}}class o_{constructor(e,t){this.newValue=e,this.didChange=t}}function uL(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new o_(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Ki(n,e);return new o_(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=uL(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new o_(n,t)}class l1{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return uL(e,t)}validate(e){return this.defaultValue}}class Im{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return uL(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function be(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class it extends Im{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return be(e,this.defaultValue)}}function Ru(n,e,t,i){if(typeof n>"u")return e;let s=parseInt(n,10);return isNaN(s)?e:(s=Math.max(t,s),s=Math.min(i,s),s|0)}class kt extends Im{static clampedInt(e,t,i,s){return Ru(e,t,i,s)}constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}validate(e){return kt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function bue(n,e,t,i){if(typeof n>"u")return e;const s=sr.float(n,e);return sr.clamp(s,t,i)}class sr extends Im{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,s,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=s}validate(e){return this.validationFn(sr.float(e,this.defaultValue))}}class Hs extends Im{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return Hs.string(e,this.defaultValue)}}function wi(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class ti extends Im{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s,o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return wi(e,this.defaultValue,this._allowedValues)}}class dw extends Kt{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function vue(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class wue extends Kt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[m("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),m("accessibilitySupport.on","Optimize for usage with a Screen Reader"),m("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:m("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class yue extends Kt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:m("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:m("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:be(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:be(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Cue(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var fn;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(fn||(fn={}));function Sue(n){switch(n){case"line":return fn.Line;case"block":return fn.Block;case"underline":return fn.Underline;case"line-thin":return fn.LineThin;case"block-outline":return fn.BlockOutline;case"underline-thin":return fn.UnderlineThin}}class xue extends l1{constructor(){super(140)}compute(e,t,i){const s=["monaco-editor"];return t.get(39)&&s.push(t.get(39)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(73)==="default"?s.push("mouse-default"):t.get(73)==="copy"&&s.push("mouse-copy"),t.get(110)&&s.push("showUnused"),t.get(138)&&s.push("showDeprecated"),s.join(" ")}}class Lue extends it{constructor(){super(37,"emptySelectionClipboard",!0,{description:m("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class Due extends Kt{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:m("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[m("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),m("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),m("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:m("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[m("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),m("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),m("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:m("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:m("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:gt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:m("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:m("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:be(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":wi(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":wi(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:be(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:be(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:be(t.loop,this.defaultValue.loop)}}}class Mo extends Kt{constructor(){super(51,"fontLigatures",Mo.OFF,{anyOf:[{type:"boolean",description:m("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:m("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:m("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Mo.OFF:e==="true"?Mo.ON:e:e?Mo.ON:Mo.OFF}}Mo.OFF='"liga" off, "calt" off';Mo.ON='"liga" on, "calt" on';class $r extends Kt{constructor(){super(54,"fontVariations",$r.OFF,{anyOf:[{type:"boolean",description:m("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:m("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:m("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?$r.OFF:e==="true"?$r.TRANSLATE:e:e?$r.TRANSLATE:$r.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}$r.OFF="normal";$r.TRANSLATE="translate";class kue extends l1{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class Eue extends Im{constructor(){super(52,"fontSize",Wo.fontSize,{type:"number",minimum:6,maximum:100,default:Wo.fontSize,description:m("fontSize","Controls the font size in pixels.")})}validate(e){const t=sr.float(e,this.defaultValue);return t===0?Wo.fontSize:sr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class Ca extends Kt{constructor(){super(53,"fontWeight",Wo.fontWeight,{anyOf:[{type:"number",minimum:Ca.MINIMUM_VALUE,maximum:Ca.MAXIMUM_VALUE,errorMessage:m("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Ca.SUGGESTION_VALUES}],default:Wo.fontWeight,description:m("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(kt.clampedInt(e,Wo.fontWeight,Ca.MINIMUM_VALUE,Ca.MAXIMUM_VALUE))}}Ca.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Ca.MINIMUM_VALUE=1;Ca.MAXIMUM_VALUE=1e3;class Iue extends Kt{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[m("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),m("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),m("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:m("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:m("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:m("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:m("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:m("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:m("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:m("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:m("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:m("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,s,o,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:wi(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:wi(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:wi(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=a.multipleDeclarations)!==null&&s!==void 0?s:wi(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:wi(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:wi(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Hs.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Hs.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Hs.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Hs.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Hs.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class Aue extends Kt{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:m("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:m("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:m("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:m("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:m("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),delay:kt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:be(t.sticky,this.defaultValue.sticky),hidingDelay:kt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:be(t.above,this.defaultValue.above)}}}class Zg extends l1{constructor(){super(143)}compute(e,t,i){return Zg.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const o=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,_=e.verticalScrollbarWidth,b=e.viewLineCount,v=e.remainingWidth,w=e.isViewportWrapping,y=u?2:3;let S=Math.floor(o*s);const L=S/o;let x=!1,D=!1,k=y*h,P=h/o,B=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:ge,extraLinesBeforeFirstLine:se,extraLinesBeyondLastLine:Se,desiredRatio:Ie,minimapLineCount:pe}=Zg.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(b/pe>1)x=!0,D=!0,h=1,k=1,P=h/o;else{let Gt=!1,xt=h+1;if(g==="fit"){const It=Math.ceil((se+b+Se)*k);w&&a&&v<=t.stableFitRemainingWidth?(Gt=!0,xt=t.stableFitMaxMinimapScale):Gt=It>S}if(g==="fill"||Gt){x=!0;const It=h;k=Math.min(l*o,Math.max(1,Math.floor(1/Ie))),w&&a&&v<=t.stableFitRemainingWidth&&(xt=t.stableFitMaxMinimapScale),h=Math.min(xt,Math.max(1,Math.floor(k/y))),h>It&&(B=Math.min(2,h/It)),P=h/o/B,S=Math.ceil(Math.max(ge,se+b+Se)*k),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=v,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const R=Math.floor(f*P),M=Math.min(R,Math.max(0,Math.floor((v-_-2)*P/(c+P)))+Dc);let $=Math.floor(o*M);const Y=$/o;$=Math.floor($*B);const ne=u?1:2,ce=p==="left"?0:i-M-_;return{renderMinimap:ne,minimapLeft:ce,minimapWidth:M,minimapHeightIsEditorHeight:x,minimapIsSampling:D,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:$,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:Y,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,u=e.get(135),h=u==="inherit"?e.get(134):u,f=h==="inherit"?e.get(130):h,g=e.get(133),p=t.isDominatedByLongLines,_=e.get(57),b=e.get(67).renderType!==0,v=e.get(68),w=e.get(104),y=e.get(83),S=e.get(72),L=e.get(102),x=L.verticalScrollbarSize,D=L.verticalHasArrows,k=L.arrowSize,P=L.horizontalScrollbarSize,B=e.get(43),R=e.get(109)!=="never";let M=e.get(65);B&&R&&(M+=16);let $=0;if(b){const ei=Math.max(r,v);$=Math.round(ei*l)}let Y=0;_&&(Y=o*t.glyphMarginDecorationLaneCount);let ne=0,ce=ne+Y,ge=ce+$,se=ge+M;const Se=i-Y-$-M;let Ie=!1,pe=!1,ee=-1;h==="inherit"&&p?(Ie=!0,pe=!0):f==="on"||f==="bounded"?pe=!0:f==="wordWrapColumn"&&(ee=g);const Gt=Zg._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:y.top,paddingBottom:y.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:Se,isViewportWrapping:pe},t.memory||new a$);Gt.renderMinimap!==0&&Gt.minimapLeft===0&&(ne+=Gt.minimapWidth,ce+=Gt.minimapWidth,ge+=Gt.minimapWidth,se+=Gt.minimapWidth);const xt=Se-Gt.minimapWidth,It=Math.max(1,Math.floor((xt-x-2)/a)),je=D?k:0;return pe&&(ee=Math.max(1,It),f==="bounded"&&(ee=Math.min(ee,g))),{width:i,height:s,glyphMarginLeft:ne,glyphMarginWidth:Y,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:ce,lineNumbersWidth:$,decorationsLeft:ge,decorationsWidth:M,contentLeft:se,contentWidth:xt,minimap:Gt,viewportColumn:It,isWordWrapMinified:Ie,isViewportWrapping:pe,wrappingColumn:ee,verticalScrollbarWidth:x,horizontalScrollbarHeight:P,overviewRuler:{top:je,width:x,height:s-2*je,right:0}}}}class Tue extends Kt{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[m("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),m("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:m("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return wi(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class Nue extends Kt{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:m("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:be(e.enabled,this.defaultValue.enabled)}}}class Mue extends Kt{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:m("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:m("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:m("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:m("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:be(t.enabled,this.defaultValue.enabled),maxLineCount:kt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:wi(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:be(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Rue extends Kt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:m("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[m("editor.inlayHints.on","Inlay hints are enabled"),m("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",gt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",gt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:m("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:m("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:m("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:wi(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:kt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Hs.string(t.fontFamily,this.defaultValue.fontFamily),padding:be(t.padding,this.defaultValue.padding)}}}class Pue extends Kt{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):kt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?kt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class Oue extends sr{constructor(){super(66,"lineHeight",Wo.lineHeight,e=>sr.clamp(e,0,150),{markdownDescription:m("lineHeight",`Controls the line height.
+`;function Io(n,e=0){return n[n.length-(1+e)]}function Ude(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Ki(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;i