ai-station/.venv/lib/python3.12/site-packages/chainlit/frontend/dist/assets/react-plotly-X7Qwg0tb.js

3486 lines
3.6 MiB
JavaScript
Raw Permalink Normal View History

import{r as O0,p as B0,n as N0}from"./index-D9fGsswH.js";function U0(Cs,El){for(var $s=0;$s<El.length;$s++){const di=El[$s];if(typeof di!="string"&&!Array.isArray(di)){for(const Zi in di)if(Zi!=="default"&&!(Zi in Cs)){const Cl=Object.getOwnPropertyDescriptor(di,Zi);Cl&&Object.defineProperty(Cs,Zi,Cl.get?Cl:{enumerable:!0,get:()=>di[Zi]})}}}return Object.freeze(Object.defineProperty(Cs,Symbol.toStringTag,{value:"Module"}))}var Ph={},Ov={};(function(Cs){function El(u){"@babel/helpers - typeof";return El=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},El(u)}Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.default=c;var $s=te(O0),di=Zi(B0);function Zi(u){return u&&u.__esModule?u:{default:u}}function Cl(u){if(typeof WeakMap!="function")return null;var l=new WeakMap,y=new WeakMap;return(Cl=function(T){return T?y:l})(u)}function te(u,l){if(u&&u.__esModule)return u;if(u===null||El(u)!=="object"&&typeof u!="function")return{default:u};var y=Cl(l);if(y&&y.has(u))return y.get(u);var h={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in u)if(f!=="default"&&Object.prototype.hasOwnProperty.call(u,f)){var n=T?Object.getOwnPropertyDescriptor(u,f):null;n&&(n.get||n.set)?Object.defineProperty(h,f,n):h[f]=u[f]}return h.default=u,y&&y.set(u,h),h}function X(u,l){if(!(u instanceof l))throw new TypeError("Cannot call a class as a function")}function e(u,l){for(var y=0;y<l.length;y++){var h=l[y];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}function A(u,l,y){return e(u.prototype,l),Object.defineProperty(u,"prototype",{writable:!1}),u}function P(u,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(l&&l.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),l&&o(u,l)}function o(u,l){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(h,T){return h.__proto__=T,h},o(u,l)}function L(u){var l=g();return function(){var h=r(u),T;if(l){var f=r(this).constructor;T=Reflect.construct(h,arguments,f)}else T=h.apply(this,arguments);return M(this,T)}}function M(u,l){if(l&&(El(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(u)}function d(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function g(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function r(u){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(y){return y.__proto__||Object.getPrototypeOf(y)},r(u)}var t=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],s=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],a=typeof window<"u";function c(u){var l=function(y){P(T,y);var h=L(T);function T(f){var n;return X(this,T),n=h.call(this,f),n.p=Promise.resolve(),n.resizeHandler=null,n.handlers={},n.syncWindowResize=n.syncWindowResize.bind(d(n)),n.syncEventHandlers=n.syncEventHandlers.bind(d(n)),n.attachUpdateEvents=n.attachUpdateEvents.bind(d(n)),n.getRef=n.getRef.bind(d(n)),n.handleUpdate=n.handleUpdate.bind(d(n)),n.figureCallback=n.figureCallback.bind(d(n)),n.updatePlotly=n.updatePlotly.bind(d(n)),n}return
`+V.year;else return I(_,O)+`
`+x(V.dayMonthYear,_,F,N);return x(z,_,F,N)};var B=3*g;X.incrementMonth=function(_,z,O){O=T(O)&&O;var F=L(_,g);if(_=Math.round(_-F),O)try{var N=Math.round(_/g)+a,V=c.getComponentMethod("calendars","getCal")(O),j=V.fromJD(N);return z%12?V.add(j,z,"m"):V.add(j,z/12,"y"),(j.toJD()-a)*g+F}catch{o.error("invalid ms "+_+" in calendar "+O)}var $=new Date(_+B);return $.setUTCMonth($.getUTCMonth()+z)+F-B},X.findExactDates=function(_,z){for(var O=0,F=0,N=0,V=0,j,$,q=T(z)&&c.getComponentMethod("calendars","getCal")(z),oe=0;oe<_.length;oe++){if($=_[oe],!P($)){V++;continue}if(!($%g))if(q)try{j=q.fromJD($/g+a),j.day()===1?j.month()===1?O++:F++:N++}catch{}else j=new Date($),j.getUTCDate()===1?j.getUTCMonth()===0?O++:F++:N++}F+=O,N+=F;var Z=_.length-V;return{exactYears:O/Z,exactMonths:F/Z,exactDays:N/Z}}},52200:function(te,X,e){var A=e(33428),P=e(24248),o=e(52248),L=e(36524);function M(h){var T;if(typeof h=="string"){if(T=document.getElementById(h),T===null)throw new Error("No DOM element with id '"+h+"' exists on the page.");return T}else if(h==null)throw new Error("DOM element provided is null or undefined");return h}function d(h){var T=A.select(h);return T.node()instanceof HTMLElement&&T.size()&&T.classed("js-plotly-plot")}function g(h){var T=h&&h.parentNode;T&&T.removeChild(h)}function r(h,T){t("global",h,T)}function t(h,T,f){var n="plotly.js-style-"+h,v=document.getElementById(n);v||(v=document.createElement("style"),v.setAttribute("id",n),v.appendChild(document.createTextNode("")),document.head.appendChild(v));var m=v.sheet;m.insertRule?m.insertRule(T+"{"+f+"}",0):m.addRule?m.addRule(T,f,0):P.warn("addStyleRule failed")}function s(h){var T="plotly.js-style-"+h,f=document.getElementById(T);f&&g(f)}function a(h){var T=u(h),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return T.forEach(function(n){var v=c(n);if(v){var m=o.convertCssMatrix(v);f=L.multiply(f,f,m)}}),f}function c(h){var T=window.getComputedStyle(h,null),f=T.getPropertyValue("-webkit-transform")||T.getPropertyValue("-moz-transform")||T.getPropertyValue("-ms-transform")||T.getPropertyValue("-o-transform")||T.getPropertyValue("transform");return f==="none"?null:f.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(n){return+n})}function u(h){for(var T=[];l(h);)T.push(h),h=h.parentNode;return T}function l(h){return h&&(h instanceof Element||h instanceof HTMLElement)}function y(h,T){return h&&T&&h.top===T.top&&h.left===T.left&&h.right===T.right&&h.bottom===T.bottom}te.exports={getGraphDiv:M,isPlotDiv:d,removeElement:g,addStyleRule:r,addRelatedStyleRule:t,deleteRelatedStyleRule:s,getFullTransformMatrix:a,getElementTransformMatrix:c,getElementAndAncestors:u,equalDomRects:y}},95924:function(te,X,e){var A=e(61252).EventEmitter,P={init:function(o){if(o._ev instanceof A)return o;var L=new A,M=new A;return o._ev=L,o._internalEv=M,o.on=L.on.bind(L),o.once=L.once.bind(L),o.removeListener=L.removeListener.bind(L),o.removeAllListeners=L.removeAllListeners.bind(L),o._internalOn=M.on.bind(M),o._internalOnce=M.once.bind(M),o._removeInternalListener=M.removeListener.bind(M),o._removeAllInternalListeners=M.removeAllListeners.bind(M),o.emit=function(d,g){typeof jQuery<"u"&&jQuery(o).trigger(d,g),L.emit(d,g),M.emit(d,g)},o},triggerHandler:function(o,L,M){var d,g;typeof jQuery<"u"&&(d=jQuery(o).triggerHandler(L,M));var r=o._ev;if(!r)return d;var t=r._events[L];if(!t)return d;function s(c){if(c.listener){if(r.removeListener(L,c.listener),!c.fired)return c.fired=!0,c.listener.apply(r,[M])}else return c.apply(r,[M])}t=Array.isArray(t)?t:[t];var a;for(a=0;a<t.length-1;a++)s(t[a]);return g=s(t[a]),d!==void 0?d:g},purge:function(o){return delete o._ev,delete o.on,delete o.once,delete o.removeListener,delete o.removeAllListeners,delete o.emit,delete o._ev,delete o._internalEv,delete o._internalOn,delete o._internalOnce,delete o._removeInternalListener,delete o._removeAllInternalListeners,o}};te.exports=P},92880:function(te,X,e){var A=e(63620),P=Array.isArray;function o(M,d){var g,r;for(g=0;g<M.length;g++){if(r=M[g],r!==null&&typeof r=="object")return!1;r!==void 0&&(d[g]=r)}return!0}X.ext
`);if(Dt!==-1&&(Kt=rr.substr(Dt+1),rr=rr.substr(0,Dt)),Lt&&(Kt!==void 0&&(rr==="00:00:00"||rr==="00:00")?(rr=Kt,Kt=""):rr.length===8&&(rr=rr.replace(/:00$/,""))),Kt)if(Rt)Ut==="d"?rr+=", "+Kt:rr=Kt+(rr?", "+rr:"");else if(!Be._inCalcTicks||Be._prevDateHead!==Kt)Be._prevDateHead=Kt,rr+="<br>"+Kt;else{var sr=Gt(Be),fr=Be._trueSide||Be.side;(!sr&&fr==="top"||sr&&fr==="bottom")&&(rr+="<br> ")}Fe.text=rr}function Je(Be,Fe,Rt,Lt,Ut){var Qt=Be.dtick,rr=Fe.x,Kt=Be.tickformat,Dt=typeof Qt=="string"&&Qt.charAt(0);if(Ut==="never"&&(Ut=""),Lt&&Dt!=="L"&&(Qt="L3",Dt="L"),Kt||Dt==="L")Fe.text=be(Math.pow(10,rr),Be,Ut,Lt);else if(P(Qt)||Dt==="D"&&M.mod(rr+.01,1)<.1){var sr=Math.round(rr),fr=Math.abs(sr),vr=Be.exponentformat;vr==="power"||pe(vr)&&Te(sr)?(sr===0?Fe.text=1:sr===1?Fe.text="10":Fe.text="10<sup>"+(sr>1?"":x)+fr+"</sup>",Fe.fontSize*=1.25):(vr==="e"||vr==="E")&&fr>2?Fe.text="1"+vr+(sr>0?"+":x)+fr:(Fe.text=be(Math.pow(10,rr),Be,"","fakehover"),Qt==="D1"&&Be._id.charAt(0)==="y"&&(Fe.dy-=Fe.fontSize/6))}else if(Dt==="D")Fe.text=String(Math.round(Math.pow(10,M.mod(rr,1)))),Fe.fontSize*=.75;else throw"unrecognized dtick "+String(Qt);if(Be.dtick==="D1"){var lr=String(Fe.text).charAt(0);(lr==="0"||lr==="1")&&(Be._id.charAt(0)==="y"?Fe.dx-=Fe.fontSize/4:(Fe.dy+=Fe.fontSize/2,Fe.dx+=(Be.range[1]>Be.range[0]?1:-1)*Fe.fontSize*(rr<0?.5:.25)))}}function Pe(Be,Fe){var Rt=Be._categories[Math.round(Fe.x)];Rt===void 0&&(Rt=""),Fe.text=String(Rt)}function Ue(Be,Fe,Rt){var Lt=Math.round(Fe.x),Ut=Be._categories[Lt]||[],Qt=Ut[1]===void 0?"":String(Ut[1]),rr=Ut[0]===void 0?"":String(Ut[0]);Rt?Fe.text=rr+" - "+Qt:(Fe.text=Qt,Fe.text2=rr)}function He(Be,Fe,Rt,Lt,Ut){Ut==="never"?Ut="":Be.showexponent==="all"&&Math.abs(Fe.x/Be.dtick)<1e-6&&(Ut="hide"),Fe.text=be(Fe.x,Be,Ut,Lt)}function Oe(Be,Fe,Rt,Lt,Ut){if(Be.thetaunit==="radians"&&!Rt){var Qt=Fe.x/180;if(Qt===0)Fe.text="0";else{var rr=Ce(Qt);if(rr[1]>=100)Fe.text=be(M.deg2rad(Fe.x),Be,Ut,Lt);else{var Kt=Fe.x<0;rr[1]===1?rr[0]===1?Fe.text="π":Fe.text=rr[0]+"π":Fe.text=["<sup>",rr[0],"</sup>","","<sub>",rr[1],"</sub>","π"].join(""),Kt&&(Fe.text=x+Fe.text)}}}else Fe.text=be(Fe.x,Be,Ut,Lt)}function Ce(Be){function Fe(Kt,Dt){return Math.abs(Kt-Dt)<=1e-6}function Rt(Kt,Dt){return Fe(Dt,0)?Kt:Rt(Dt,Kt%Dt)}function Lt(Kt){for(var Dt=1;!Fe(Math.round(Kt*Dt)/Dt,Kt);)Dt*=10;return Dt}var Ut=Lt(Be),Qt=Be*Ut,rr=Math.abs(Rt(Qt,Ut));return[Math.round(Qt/rr),Math.round(Ut/rr)]}var ge=["f","p","n","μ","m","","k","M","G","T"];function pe(Be){return Be==="SI"||Be==="B"}function Te(Be){return Be>14||Be<-15}function be(Be,Fe,Rt,Lt){var Ut=Be<0,Qt=Fe._tickround,rr=Rt||Fe.exponentformat||"B",Kt=Fe._tickexponent,Dt=Z.getTickFormat(Fe),sr=Fe.separatethousands;if(Lt){var fr={exponentformat:rr,minexponent:Fe.minexponent,dtick:Fe.showexponent==="none"?Fe.dtick:P(Be)&&Math.abs(Be)||1,range:Fe.showexponent==="none"?Fe.range.map(Fe.r2d):[0,Be||1]};lt(fr),Qt=(Number(fr._tickround)||0)+4,Kt=fr._tickexponent,Fe.hoverformat&&(Dt=Fe.hoverformat)}if(Dt)return Fe._numFormat(Dt)(Be).replace(/-/g,x);var vr=Math.pow(10,-Qt)/2;if(rr==="none"&&(Kt=0),Be=Math.abs(Be),Be<vr)Be="0",Ut=!1;else{if(Be+=vr,Kt&&(Be*=Math.pow(10,-Kt),Qt+=Kt),Qt===0)Be=String(Math.floor(Be));else if(Qt<0){Be=String(Math.round(Be)),Be=Be.substr(0,Be.length+Qt);for(var lr=Qt;lr<0;lr++)Be+="0"}else{Be=String(Be);var Or=Be.indexOf(".")+1;Or&&(Be=Be.substr(0,Or+Qt).replace(/\.?0+$/,""))}Be=M.numSeparate(Be,Fe._separators,sr)}if(Kt&&rr!=="hide"){pe(rr)&&Te(Kt)&&(rr="power");var Sr;Kt<0?Sr=x+-Kt:rr!=="power"?Sr="+"+Kt:Sr=String(Kt),rr==="e"||rr==="E"?Be+=rr+Sr:rr==="power"?Be+="×10<sup>"+Sr+"</sup>":rr==="B"&&Kt===9?Be+="B":pe(rr)&&(Be+=ge[Kt/3+5])}return Ut?x+Be:Be}Z.getTickFormat=function(Be){var Fe;function Rt(Dt){return typeof Dt!="string"?Dt:Number(Dt.replace("M",""))*m}function Lt(Dt,sr){var fr=["L","D"];if(typeof Dt==typeof sr){if(typeof Dt=="number")return Dt-sr;var vr=fr.indexOf(Dt.charAt(0)),lr=fr.indexOf(sr.charAt(0));return vr===lr?Number(Dt.replace(/(L|D)/g,""))-Number(sr.replace(/(L|D)/g,"")):vr-lr}else return typeof Dt=="number"?1:-1}function Ut(Dt,
`),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(`
`),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",r.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(`
`),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(`
`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new"
`));var ye;q.med!==M?ye=q.med:q.q1!==M?q.q3!==M?ye=(q.q1+q.q3)/2:ye=q.q1:q.q3!==M?ye=q.q3:ye=0,q.med=ye,q.q1=q.q3=ye,q.lf=q.uf=ye,q.mean=q.sd=ye,q.ln=q.un=ye,q.min=q.max=ye}Y=Math.min(Y,q.min),ie=Math.max(ie,q.max),q.pts2=oe.filter(J),w.push(q)}}b._extremes[k._id]=P.findExtremes(k,[Y,ie],{padded:!0})}else{var Se=k.makeCalcdata(b,I),_e=r(j,$),ze=j.length,Ie=t(ze);for(C=0;C<b._length;C++)if(H=Se[C],!!A(H)){var Ne=L.findBin(F[C],_e);Ne>=0&&Ne<ze&&(re={v:H,i:C},a(re,b,C),Ie[Ne].push(re))}var et=1/0,st=-1/0,Ze=b.quartilemethod,Ke=Ze==="exclusive",nt=Ze==="inclusive";for(C=0;C<ze;C++)if(Ie[C].length>0){if(q={},q.pos=q[_]=j[C],oe=q.pts=Ie[C].sort(u),Z=q[I]=oe.map(l),G=Z.length,q.min=Z[0],q.max=Z[G-1],q.mean=L.mean(Z,G),q.sd=L.stdev(Z,G,q.mean)*b.sdmultiple,q.med=L.interp(Z,.5),G%2&&(Ke||nt)){var it,lt;Ke?(it=Z.slice(0,G/2),lt=Z.slice(G/2+1)):nt&&(it=Z.slice(0,G/2+1),lt=Z.slice(G/2)),q.q1=L.interp(it,.5),q.q3=L.interp(lt,.5)}else q.q1=L.interp(Z,.25),q.q3=L.interp(Z,.75);q.lf=y(q,Z,G),q.uf=h(q,Z,G),q.lo=T(q),q.uo=f(q);var vt=n(q,G);q.ln=q.med-vt,q.un=q.med+vt,et=Math.min(et,q.ln),st=Math.max(st,q.un),q.pts2=oe.filter(J),w.push(q)}b.notched&&L.isTypedArray(Se)&&(Se=Array.from(Se)),b._extremes[k._id]=P.findExtremes(k,b.notched?Se.concat([et,st]):Se,{padded:!0})}return c(w,b),w.length>0?(w[0].t={num:E[i],dPos:$,posLetter:_,valLetter:I,labels:{med:d(m,"median:"),min:d(m,"min:"),q1:d(m,"q1:"),q3:d(m,"q3:"),max:d(m,"max:"),mean:b.boxmean==="sd"||b.sizemode==="sd"?d(m,"mean ± σ:").replace("σ",b.sdmultiple===1?"σ":b.sdmultiple+"σ"):d(m,"mean:"),lf:d(m,"lower fence:"),uf:d(m,"upper fence:")}},E[i]++,w):[{t:{empty:!0}}]};function g(v,m,b,E){var p=m in v,S=m+"0"in v,w="d"+m in v;if(p||S&&w){var i=b.makeCalcdata(v,m),C=o(v,b,m,i).vals;return[C,i]}var x;S?x=v[m+"0"]:"name"in v&&(b.type==="category"||A(v.name)&&["linear","log"].indexOf(b.type)!==-1||L.isDateTime(v.name)&&b.type==="date")?x=v.name:x=E;for(var k=b.type==="multicategory"?b.r2c_just_indices(x):b.d2c(x,0,v[m+"calendar"]),I=v._length,B=new Array(I),_=0;_<I;_++)B[_]=k;return[B]}function r(v,m){for(var b=v.length,E=new Array(b+1),p=0;p<b;p++)E[p]=v[p]-m;return E[b]=v[b-1]+m,E}function t(v){for(var m=new Array(v),b=0;b<v;b++)m[b]=[];return m}var s={text:"tx",hovertext:"htx"};function a(v,m,b){for(var E in s)L.isArrayOrTypedArray(m[E])&&(Array.isArray(b)?L.isArrayOrTypedArray(m[E][b[0]])&&(v[s[E]]=m[E][b[0]][b[1]]):v[s[E]]=m[E][b])}function c(v,m){if(L.isArrayOrTypedArray(m.selectedpoints))for(var b=0;b<v.length;b++){for(var E=v[b].pts||[],p={},S=0;S<E.length;S++)p[E[S].i]=S;L.tagSelected(E,m,p)}}function u(v,m){return v.v-m.v}function l(v){return v.v}function y(v,m,b){return b===0?v.q1:Math.min(v.q1,m[Math.min(L.findBin(2.5*v.q1-1.5*v.q3,m,!0)+1,b-1)])}function h(v,m,b){return b===0?v.q3:Math.max(v.q3,m[Math.max(L.findBin(2.5*v.q3-1.5*v.q1,m),0)])}function T(v){return 4*v.q1-3*v.q3}function f(v){return 4*v.q3-3*v.q1}function n(v,m){return m===0?0:1.57*(v.q3-v.q1)/Math.sqrt(m)}},96404:function(te,X,e){var A=e(54460),P=e(3400),o=e(71888).getAxisGroup,L=["v","h"];function M(g,r){for(var t=g.calcdata,s=r.xaxis,a=r.yaxis,c=0;c<L.length;c++){for(var u=L[c],l=u==="h"?a:s,y=[],h=0;h<t.length;h++){var T=t[h],f=T[0].t,n=T[0].trace;n.visible===!0&&(n.type==="box"||n.type==="candlestick")&&!f.empty&&(n.orientation||"v")===u&&n.xaxis===s._id&&n.yaxis===a._id&&y.push(h)}d("box",g,y,l)}}function d(g,r,t,s){var a=r.calcdata,c=r._fullLayout,u=s._id,l=u.charAt(0),y,h,T,f=[],n=0;for(y=0;y<t.length;y++)for(T=a[t[y]],h=0;h<T.length;h++)f.push(s.c2l(T[h].pos,!0)),n+=(T[h].pts2||[]).length;if(f.length){var v=P.distinctVals(f);(s.type==="category"||s.type==="multicategory")&&(v.minDiff=1);var m=v.minDiff/2;A.minDtick(s,v.minDiff,v.vals[0],!0);var b=g==="violin"?"_numViolins":"_numBoxes",E=c[b],p=c[g+"mode"]==="group"&&E>1,S=1-c[g+"gap"],w=1-c[g+"groupgap"];for(y=0;y<t.length;y++){T=a[t[y]];var i=T[0].trace,C=T[0].t,x=i.width,k=i.side,I,B,_,z;if(x)I=B=z=x/2,_=0;else if(I=m,p){var O=o(c,s._id)+i.orientation,F=c._alignmentOpts[O]||{},N=F[i.alignmentgroup]||{},V=Object.keys(N.offsetGroups||{}).length,j=V||
`),P=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(`
`),o=e(30140).maxDimensionCount,L=e(3400),M=1e-6,d=2048,g=new Uint8Array(4),r=new Uint8Array(4),t={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function s(p){p.read({x:0,y:0,width:1,height:1,data:g})}function a(p,S,w,i,C){var x=p._gl;x.enable(x.SCISSOR_TEST),x.scissor(S,w,i,C),p.clear({color:[0,0,0,0],depth:1})}function c(p,S,w,i,C,x){var k=x.key;function I(B){var _=Math.min(i,C-B*i);B===0&&(window.cancelAnimationFrame(w.currentRafs[k]),delete w.currentRafs[k],a(p,x.scissorX,x.scissorY,x.scissorWidth,x.viewBoxSize[1])),!w.clearOnly&&(x.count=2*_,x.offset=2*B*i,S(x),B*i+_<C&&(w.currentRafs[k]=window.requestAnimationFrame(function(){I(B+1)})),w.drawCompleted=!1)}w.drawCompleted||(s(p),w.drawCompleted=!0),I(0)}function u(p){return Math.max(M,Math.min(1-M,p))}function l(p,S){for(var w=new Array(256),i=0;i<256;i++)w[i]=p(i/255).concat(S);return w}function y(p,S){return(p>>>8*S)%256/255}function h(p,S,w){for(var i=new Array(p*(o+4)),C=0,x=0;x<p;x++){for(var k=0;k<o;k++)i[C++]=k<S.length?S[k].paddedUnitValues[x]:.5;i[C++]=y(x,2),i[C++]=y(x,1),i[C++]=y(x,0),i[C++]=u(w[x])}return i}function T(p,S,w){for(var i=new Array(S*8),C=0,x=0;x<S;x++)for(var k=0;k<2;k++)for(var I=0;I<4;I++){var B=p*4+I,_=w[x*64+B];B===63&&k===0&&(_*=-1),i[C++]=_}return i}function f(p){var S="0"+p;return S.substr(S.length-2)}function n(p){return p<o?"p"+f(p+1)+"_"+f(p+4):"colors"}function v(p,S,w){for(var i=0;i<=o;i+=4)p[n(i)](T(i/4,S,w))}function m(p){for(var S={},w=0;w<=o;w+=4)S[n(w)]=p.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return S}function b(p,S,w,i,C,x,k,I,B,_,z,O,F,N){for(var V=[[],[]],j=0;j<64;j++)V[0][j]=j===C?1:0,V[1][j]=j===x?1:0;k*=N,I*=N,B*=N,_*=N;var $=p.lines.canvasOverdrag*N,q=p.domain,oe=p.canvasWidth*N,Z=p.canvasHeight*N,G=p.pad.l*N,re=p.pad.b*N,H=p.layoutHeight*N,J=p.layoutWidth*N,ae=p.deselectedLines.color,K=p.deselectedLines.opacity,Y=L.extendFlat({key:z,resolution:[oe,Z],viewBoxPos:[k+$,I],viewBoxSize:[B,_],i0:C,i1:x,dim0A:V[0].slice(0,16),dim0B:V[0].slice(16,32),dim0C:V[0].slice(32,48),dim0D:V[0].slice(48,64),dim1A:V[1].slice(0,16),dim1B:V[1].slice(16,32),dim1C:V[1].slice(32,48),dim1D:V[1].slice(48,64),drwLayer:O,contextColor:[ae[0]/255,ae[1]/255,ae[2]/255,K!=="auto"?ae[3]*K:Math.max(1/255,Math.pow(1/p.lines.color.length,1/3))],scissorX:(i===S?0:k+$)+(G-$)+J*q.x[0],scissorWidth:(i===w?oe-k+$:B+.5)+(i===S?k+$:0),scissorY:I+re+H*q.y[0],scissorHeight:_,viewportX:G-$+J*q.x[0],viewportY:re+H*q.y[0],viewportWidth:oe,viewportHeight:Z},F);return Y}function E(p){var S=d-1,w=Math.max(0,Math.floor(p[0]*S),0),i=Math.min(S,Math.ceil(p[1]*S),S);return[Math.min(w,i),Math.max(w,i)]}te.exports=function(p,S){var w=S.context,i=S.pick,C=S.regl,x=C._gl,k=x.getParameter(x.ALIASED_LINE_WIDTH_RANGE),I=Math.max(k[0],Math.min(k[1],S.viewModel.plotGlPixelRatio)),B={currentRafs:{},drawCompleted:!0,clearOnly:!1},_,z,O,F,N=m(C),V,j=C.texture(t),$=[];oe(S);var q=C({profile:!1,blend:{enable:w,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!w,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:C.prop("scissorX"),y:C.prop("scissorY"),width:C.prop("scissorWidth"),height:C.prop("scissorHeight")}},viewport:{x:C.prop("viewportX"),y:C.prop("viewportY"),width:C.prop("viewportWidth"),height:C.prop("viewportHeight")},dither:!1,vert:A,frag:P,primitive:"lines",lineWidth:I,attributes:N,uniforms:{resolution:C.prop("resolution"),viewBoxPos:C.prop("viewBoxPos"),viewBoxSize:C.prop("viewBoxSize"),dim0A:C.prop("dim0A"),dim1A:C.prop("dim1A"),dim0B:C.prop("dim0B"),dim1B:C.prop("dim1B"),dim0C:C.prop("dim0C"),dim1C:C.prop("dim1C"),dim0D:C.prop("dim0D"),dim1D:C.prop("dim1D"),loA:C.prop("loA"),hiA:C.prop("hiA"),loB:C.prop("loB"),hiB:C.prop("hiB"),loC:C.prop("loC"),hiC:C.prop("hiC"),loD:C.prop("loD"),hiD:C.prop("hiD"),palette:j,contextColor:C.prop("contextColor"),maskTexture:C.prop("maskTexture"),drwLayer:C.prop("drwLayer"),maskHeight:C.prop("maskHeight")},offset:C.prop("offset"),count:C.prop("count")});function oe(a
`)),k.push({type:"Feature",geometry:{type:"Point",coordinates:B.lonlat},properties:{symbol:i(I),angle:C(I),text:z}})}}return{type:"FeatureCollection",features:k}}function h(v,m){return P.isArrayOrTypedArray(v)?m?function(b){return A(v[b])?+v[b]:0}:function(b){return v[b]}:v?function(){return v}:T}function T(){return""}function f(v){return v[0]===o}function n(v,m){var b;if(P.isArrayOrTypedArray(v)&&P.isArrayOrTypedArray(m)){b=["step",["get","point_count"],v[0]];for(var E=1;E<v.length;E++)b.push(m[E-1],v[E])}else b=v;return b}},15752:function(te,X,e){var A=e(3400),P=e(43028),o=e(74428),L=e(66828),M=e(124),d=e(70840),g=e(31512),r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extra Bold Italic","Open Sans Extra Bold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];te.exports=function(a,c,u,l){function y(S,w){return A.coerce(a,c,g,S,w)}function h(S,w){return A.coerce2(a,c,g,S,w)}var T=t(a,c,y);if(!T){c.visible=!1;return}if(y("text"),y("texttemplate"),y("hovertext"),y("hovertemplate"),y("mode"),y("below"),P.hasMarkers(c)){o(a,c,u,l,y,{noLine:!0,noAngle:!0}),y("marker.allowoverlap"),y("marker.angle");var f=c.marker;f.symbol!=="circle"&&(A.isArrayOrTypedArray(f.size)&&(f.size=f.size[0]),A.isArrayOrTypedArray(f.color)&&(f.color=f.color[0]))}P.hasLines(c)&&(L(a,c,u,l,y,{noDash:!0}),y("connectgaps"));var n=h("cluster.maxzoom"),v=h("cluster.step"),m=h("cluster.color",c.marker&&c.marker.color||u),b=h("cluster.size"),E=h("cluster.opacity"),p=n!==!1||v!==!1||m!==!1||b!==!1||E!==!1;y("cluster.enabled",p),P.hasText(c)&&M(a,c,l,y,{noSelect:!0,font:{family:r.indexOf(l.font.family)!==-1?l.font.family:"Open Sans Regular",size:l.font.size,color:l.font.color}}),y("fill"),c.fill!=="none"&&d(a,c,u,y),A.coerceSelectionMarkerOpacity(c,y)};function t(s,a,c){var u=c("lon")||[],l=c("lat")||[],y=Math.min(u.length,l.length);return a._length=y,y}},37920:function(te){te.exports=function(e,A){return e.lon=A.lon,e.lat=A.lat,e}},11960:function(te,X,e){var A=e(54460);te.exports=function(o,L,M){var d={},g=M[L.subplot]._subplot,r=g.mockAxis,t=o.lonlat;return d.lonLabel=A.tickText(r,r.c2l(t[0]),!0).text,d.latLabel=A.tickText(r,r.c2l(t[1]),!0).text,d}},63312:function(te,X,e){var A=e(93024),P=e(3400),o=e(44928),L=P.fillText,M=e(39032).BADNUM,d=e(47552).traceLayerPrefix;function g(t,s,a){var c=t.cd,u=c[0].trace,l=t.xa,y=t.ya,h=t.subplot,T=[],f=d+u.uid+"-circle",n=u.cluster&&u.cluster.enabled;if(n){var v=h.map.queryRenderedFeatures(null,{layers:[f]});T=v.map(function(_){return _.id})}var m=s>=0?Math.floor((s+180)/360):Math.ceil((s-180)/360),b=m*360,E=s-b;function p(_){var z=_.lonlat;if(z[0]===M||n&&T.indexOf(_.i+1)===-1)return 1/0;var O=P.modHalf(z[0],360),F=z[1],N=h.project([O,F]),V=N.x-l.c2p([E,F]),j=N.y-y.c2p([O,a]),$=Math.max(3,_.mrc||0);return Math.max(Math.sqrt(V*V+j*j)-$,1-3/$)}if(A.getClosest(c,p,t),t.index!==!1){var S=c[t.index],w=S.lonlat,i=[P.modHalf(w[0],360)+b,w[1]],C=l.c2p(i),x=y.c2p(i),k=S.mrc||1;t.x0=C-k,t.x1=C+k,t.y0=x-k,t.y1=x+k;var I={};I[u.subplot]={_subplot:h};var B=u._module.formatLabels(S,u,I);return t.lonLabel=B.lonLabel,t.latLabel=B.latLabel,t.color=o(u,S),t.extraText=r(u,S,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}function r(t,s,a){if(t.hovertemplate)return;var c=s.hi||t.hoverinfo,u=c.split("+"),l=u.indexOf("all")!==-1,y=u.indexOf("lon")!==-1,h=u.indexOf("lat")!==-1,T=s.lonlat,f=[];function n(v){return v+"°"}return l||y&&h?f.push("("+n(T[1])+", "+n(T[0])+")
parent value =`,ae,`
children sum =`,K].join(" "))}H.value=ae});break}else c($,l,{branches:l.count.indexOf("branches")!==-1,leaves:l.count.indexOf("leaves")!==-1});if(!q){l.sort&&$.sort(function(H,J){return J.value-H.value});var oe,Z,G=l.marker.colors||[],re=!!G.length;return l._hasColorscale?(re||(G=m?l.values:l._values),g(u,l,{vals:G,containerStr:"marker",cLetter:"c"}),Z=L(l.marker)):oe=M(y["_"+l.type+"colormap"]),$.each(function(H){var J=H.data.data;J.color=l._hasColorscale?Z(G[J.i]):oe(G[J.i],J.id)}),b[0].hierarchy=$,b}},X._runCrossTraceCalc=function(u,l){var y=l._fullLayout,h=l.calcdata,T=y[u+"colorway"],f=y["_"+u+"colormap"];y["extend"+u+"colors"]&&(T=d(T,u==="icicle"?a:u==="treemap"?s:t));var n=0,v;function m(S){var w=S.data.data,i=w.id;w.color===!1&&(f[i]?w.color=f[i]:S.parent?S.parent.parent?w.color=S.parent.data.data.color:(f[i]=w.color=T[n%T.length],n++):w.color=v)}for(var b=0;b<h.length;b++){var E=h[b],p=E[0];p.trace.type===u&&p.hierarchy&&(v=p.trace.root.color,p.hierarchy.each(m))}},X.crossTraceCalc=function(u){return X._runCrossTraceCalc("sunburst",u)};function c(u,l,y){var h=0,T=u.children;if(T){for(var f=T.length,n=0;n<f;n++)h+=c(T[n],l,y);y.branches&&h++}else y.leaves&&h++;return u.value=u.data.data.value=h,l._values||(l._values=[]),l._values[u.data.data.i]=h,h}},27328:function(te){te.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}},25244:function(te,X,e){var A=e(3400),P=e(424),o=e(86968).Q,L=e(31508).handleText,M=e(74174).handleMarkerDefaults,d=e(8932),g=d.hasColorscale,r=d.handleDefaults;te.exports=function(s,a,c,u){function l(m,b){return A.coerce(s,a,P,m,b)}var y=l("labels"),h=l("parents");if(!y||!y.length||!h||!h.length){a.visible=!1;return}var T=l("values");T&&T.length?l("branchvalues"):l("count"),l("level"),l("maxdepth"),M(s,a,u,l);var f=a._hasColorscale=g(s,"marker","colors")||(s.marker||{}).coloraxis;f&&r(s,a,u,l,{prefix:"marker.",cLetter:"c"}),l("leaf.opacity",f?1:.7);var n=l("text");l("texttemplate"),a.texttemplate||l("textinfo",A.isArrayOrTypedArray(n)?"text+label":"label"),l("hovertext"),l("hovertemplate");var v="auto";L(s,a,u,l,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),l("insidetextorientation"),l("sort"),l("rotation"),l("root.color"),o(a,u,l),a._length=null}},60404:function(te,X,e){var A=e(43616),P=e(76308);te.exports=function(L,M,d,g,r){var t=M.data.data,s=t.i,a=r||t.color;if(s>=0){M.i=t.i;var c=d.marker;c.pattern?(!c.colors||!c.pattern.shape)&&(c.color=a,M.color=a):(c.color=a,M.color=a),A.pointStyle(L,d,g,M)}else P.fill(L,a)}},45716:function(te,X,e){var A=e(33428),P=e(24040),o=e(10624).appendArrayPointValue,L=e(93024),M=e(3400),d=e(95924),g=e(78176),r=e(69656),t=r.formatPieValue;te.exports=function(c,u,l,y,h){var T=y[0],f=T.trace,n=T.hierarchy,v=f.type==="sunburst",m=f.type==="treemap"||f.type==="icicle";"_hasHoverLabel"in f||(f._hasHoverLabel=!1),"_hasHoverEvent"in f||(f._hasHoverEvent=!1);var b=function(S){var w=l._fullLayout;if(!(l._dragging||w.hovermode===!1)){var i=l._fullData[f.index],C=S.data.data,x=C.i,k=g.isHierarchyRoot(S),I=g.getParent(n,S),B=g.getValue(S),_=function(Y){return M.castOption(i,x,Y)},z=_("hovertemplate"),O=L.castHoverinfo(i,w,x),F=w.separators,N;if(z||O&&O!=="none"&&O!=="skip"){var V,j;v&&(V=T.cx+S.pxmid[0]*(1-S.rInscribed),j=T.cy+S.pxmid[1]*(1-S.rInscribed)),m&&(V=S._hoverX,j=S._hoverY);var $={},q=[],oe=[],Z=function(Y){return q.indexOf(Y)!==-1};O&&(q=O==="all"?i._module.attributes.hoverinfo.flags:O.split("+")),$.label=C.label,Z("label")&&$.label&&oe.push($.label),C.hasOwnProperty("v")&&($.value=C.v,$.valueLabel=t($.value,F),Z("value")&&oe.push($.valueLabel)),$.currentPath=S.currentPath=g.getPath(S.data),Z("current path")&&!k&&oe.push($.currentPath);var G,re=[],H=function(){re.indexOf(G)===-1&&(oe.push(G),re.push(G))};$.percentParent=S.percentParent=B/g.getValue(I),$.parent=S.parentString=g.getPtLabel(I),Z("percent parent")&&(G=g.formatPercent($.percentParent,F)+" of "+$.paren
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/function t(ge,pe){if(!(ge instanceof pe))throw new TypeError("Cannot call a class as a function")}function s(ge,pe){for(var Te=0;Te<pe.length;Te++){var be=pe[Te];be.enumerable=be.enumerable||!1,be.configurable=!0,"value"in be&&(be.writable=!0),Object.defineProperty(ge,be.key,be)}}function a(ge,pe,Te){return s(ge.prototype,pe),Object.defineProperty(ge,"prototype",{writable:!1}),ge}function c(ge,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");ge.prototype=Object.create(pe&&pe.prototype,{constructor:{value:ge,writable:!0,configurable:!0}}),Object.defineProperty(ge,"prototype",{writable:!1}),pe&&u(ge,pe)}function u(ge,pe){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(be,ke){return be.__proto__=ke,be},u(ge,pe)}function l(ge){var pe=T();return function(){var be=f(ge),ke;if(pe){var Ve=f(this).constructor;ke=Reflect.construct(be,arguments,Ve)}else ke=be.apply(this,arguments);return y(this,ke)}}function y(ge,pe){if(pe&&(n(pe)==="object"||typeof pe=="function"))return pe;if(pe!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h(ge)}function h(ge){if(ge===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ge}function T(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function f(ge){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Te){return Te.__proto__||Object.getPrototypeOf(Te)},f(ge)}function n(ge){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(pe){return typeof pe}:function(pe){return pe&&typeof Symbol=="function"&&pe.constructor===Symbol&&pe!==Symbol.prototype?"symbol":typeof pe},n(ge)}var v=r(3910),m=r(3187),b=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.lW=w,g.h2=50;var E=2147483647;w.TYPED_ARRAY_SUPPORT=p(),!w.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function p(){try{var ge=new Uint8Array(1),pe={foo:function(){return 42}};return Object.setPrototypeOf(pe,Uint8Array.prototype),Object.setPrototypeOf(ge,pe),ge.foo()===42}catch{return!1}}Object.defineProperty(w.prototype,"parent",{enumerable:!0,get:function(){if(w.isBuffer(this))return this.buffer}}),Object.defineProperty(w.prototype,"offset",{enumerable:!0,get:function(){if(w.isBuffer(this))return this.byteOffset}});function S(ge){if(ge>E)throw new RangeError('The value "'+ge+'" is invalid for option "size"');var pe=new Uint8Array(ge);return Object.setPrototypeOf(pe,w.prototype),pe}function w(ge,pe,Te){if(typeof ge=="number"){if(typeof pe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return k(ge)}return i(ge,pe,Te)}w.poolSize=8192;function i(ge,pe,Te){if(typeof ge=="string")return I(ge,pe);if(ArrayBuffer.isView(ge))return _(ge);if(ge==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(ge));if(Pe(ge,ArrayBuffer)||ge&&Pe(ge.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Pe(ge,SharedArrayBuffer)||ge&&Pe(ge.buffer,SharedArrayBuffer)))return z(ge,pe,Te);if(typeof ge=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var be=ge.valueOf&&ge.valueOf();if(be!=null&&be!==ge)return w.from(be,pe,Te);var ke=O(ge);if(ke)return ke;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ge[Symbol.toPrimitive]=="function")return w.from(ge[Symbol.toPrimitive]("string"),pe,Te);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(ge))}w.from=funct
`)}},2153:function(d,g,r){d.exports=a;var t=r(417);function s(c,u){for(var l=new Array(u+1),y=0;y<c.length;++y)l[y]=c[y];for(var y=0;y<=c.length;++y){for(var h=c.length;h<=u;++h){for(var T=new Array(u),f=0;f<u;++f)T[f]=Math.pow(h+1-y,f);l[h]=T}var n=t.apply(void 0,l);if(n)return!0}return!1}function a(c){var u=c.length;if(u===0)return[];if(u===1)return[0];for(var l=c[0].length,y=[c[0]],h=[0],T=1;T<u;++T){if(y.push(c[T]),!s(y,l)){y.pop();continue}if(h.push(T),h.length===l+1)return h}return h}},4653:function(d,g,r){d.exports=a;var t=r(4419),s=r(1778);function a(c,u){return t(u).filter(function(l){for(var y=new Array(l.length),h=0;h<l.length;++h)y[h]=u[l[h]];return s(y)*c<1})}},2350:function(d,g,r){d.exports=a;var t=r(4653),s=r(8691);function a(c,u){return s(t(c,u))}},7896:function(d){d.exports=function(r){return atob(r)}},957:function(d,g,r){d.exports=a;var t=r(6606);function s(c){for(var u=0,l=0;l<c.length;++l)u+=c[l];return u}function a(c,u){for(var l=u.length,y=new Array(l+1),h=0;h<l;++h){for(var T=new Array(l+1),f=0;f<=l;++f)T[f]=c[f][h];y[h]=T}y[l]=new Array(l+1);for(var h=0;h<=l;++h)y[l][h]=1;for(var n=new Array(l+1),h=0;h<l;++h)n[h]=u[h];n[l]=1;var v=t(y,n),m=s(v[l+1]);m===0&&(m=1);for(var b=new Array(l+1),h=0;h<=l;++h)b[h]=s(v[h])/m;return b}},1539:function(d,g,r){var t=r(8524);d.exports=s;function s(a,c){return t(a[0].mul(c[1]).add(c[0].mul(a[1])),a[1].mul(c[1]))}},8846:function(d){d.exports=g;function g(r,t){return r[0].mul(t[1]).cmp(t[0].mul(r[1]))}},9189:function(d,g,r){var t=r(8524);d.exports=s;function s(a,c){return t(a[0].mul(c[1]),a[1].mul(c[0]))}},5125:function(d,g,r){var t=r(234),s=r(3218),a=r(5514),c=r(2813),u=r(8524),l=r(9189);d.exports=y;function y(h,T){if(t(h))return T?l(h,y(T)):[h[0].clone(),h[1].clone()];var f=0,n,v;if(s(h))n=h.clone();else if(typeof h=="string")n=c(h);else{if(h===0)return[a(0),a(1)];if(h===Math.floor(h))n=a(h);else{for(;h!==Math.floor(h);)h=h*Math.pow(2,256),f-=256;n=a(h)}}if(t(T))n.mul(T[1]),v=T[0].clone();else if(s(T))v=T.clone();else if(typeof T=="string")v=c(T);else if(!T)v=a(1);else if(T===Math.floor(T))v=a(T);else{for(;T!==Math.floor(T);)T=T*Math.pow(2,256),f+=256;v=a(T)}return f>0?n=n.ushln(f):f<0&&(v=v.ushln(-f)),u(n,v)}},234:function(d,g,r){var t=r(3218);d.exports=s;function s(a){return Array.isArray(a)&&a.length===2&&t(a[0])&&t(a[1])}},4275:function(d,g,r){var t=r(1928);d.exports=s;function s(a){return a.cmp(new t(0))}},9958:function(d,g,r){var t=r(4275);d.exports=s;function s(a){var c=a.length,u=a.words,l=0;if(c===1)l=u[0];else if(c===2)l=u[0]+u[1]*67108864;else for(var y=0;y<c;y++){var h=u[y];l+=h*Math.pow(67108864,y)}return t(a)*l}},1112:function(d,g,r){var t=r(8362),s=r(2288).countTrailingZeros;d.exports=a;function a(c){var u=s(t.lo(c));if(u<32)return u;var l=s(t.hi(c));return l>20?52:l+32}},3218:function(d,g,r){r(1928),d.exports=t;function t(s){return s&&typeof s=="object"&&!!s.words}},5514:function(d,g,r){var t=r(1928),s=r(8362);d.exports=a;function a(c){var u=s.exponent(c);return u<52?new t(c):new t(c*Math.pow(2,52-u)).ushln(u-52)}},8524:function(d,g,r){var t=r(5514),s=r(4275);d.exports=a;function a(c,u){var l=s(c),y=s(u);if(l===0)return[t(0),t(1)];if(y===0)return[t(0),t(0)];y<0&&(c=c.neg(),u=u.neg());var h=c.gcd(u);return h.cmpn(1)?[c.div(h),u.div(h)]:[c,u]}},2813:function(d,g,r){var t=r(1928);d.exports=s;function s(a){return new t(a)}},3962:function(d,g,r){var t=r(8524);d.exports=s;function s(a,c){return t(a[0].mul(c[0]),a[1].mul(c[1]))}},4951:function(d,g,r){var t=r(4275);d.exports=s;function s(a){return t(a[0])*t(a[1])}},4354:function(d,g,r){var t=r(8524);d.exports=s;function s(a,c){return t(a[0].mul(c[1]).sub(a[1].mul(c[0])),a[1].mul(c[1]))}},7999:function(d,g,r){var t=r(9958),s=r(1112);d.exports=a;function a(c){var u=c[0],l=c[1];if(u.cmpn(0)===0)return 0;var y=u.abs().divmod(l.abs()),h=y.div,T=t(h),f=y.mod,n=u.negative!==l.negative?-1:1;if(f.cmpn(0)===0)return n*T;if(T){var v=s(T)+4,m=t(f.ushln(v).divRound(l));return n*(T+m*Math.pow(2,-v))}else{var b=l.bitLength()-f.bitLength()+53,m=t(f.ushln(b).divRound(l));return b<1023?n*m*Math.pow(2,-b):(m*=Math.pow(2,-10
#define GLSLIFY 1
attribute vec3 position;
uniform mat4 model, view, projection;
uniform vec3 offset, majorAxis, minorAxis, screenAxis;
uniform float lineWidth;
uniform vec2 screenShape;
vec3 project(vec3 p) {
vec4 pp = projection * view * model * vec4(p, 1.0);
return pp.xyz / max(pp.w, 0.0001);
}
void main() {
vec3 major = position.x * majorAxis;
vec3 minor = position.y * minorAxis;
vec3 vPosition = major + minor + offset;
vec3 pPosition = project(vPosition);
vec3 offset = project(vPosition + screenAxis * position.z);
vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;
gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);
}
`]),c=t([`precision highp float;
#define GLSLIFY 1
uniform vec4 color;
void main() {
gl_FragColor = color;
}`]);g.j=function(T){return s(T,a,c,null,[{name:"position",type:"vec3"}])};var u=t([`precision highp float;
#define GLSLIFY 1
attribute vec3 position;
uniform mat4 model, view, projection;
uniform vec3 offset, axis, alignDir, alignOpt;
uniform float scale, angle, pixelScale;
uniform vec2 resolution;
vec3 project(vec3 p) {
vec4 pp = projection * view * model * vec4(p, 1.0);
return pp.xyz / max(pp.w, 0.0001);
}
float computeViewAngle(vec3 a, vec3 b) {
vec3 A = project(a);
vec3 B = project(b);
return atan(
(B.y - A.y) * resolution.y,
(B.x - A.x) * resolution.x
);
}
const float PI = 3.141592;
const float TWO_PI = 2.0 * PI;
const float HALF_PI = 0.5 * PI;
const float ONE_AND_HALF_PI = 1.5 * PI;
int option = int(floor(alignOpt.x + 0.001));
float hv_ratio = alignOpt.y;
bool enableAlign = (alignOpt.z != 0.0);
float mod_angle(float a) {
return mod(a, PI);
}
float positive_angle(float a) {
return mod_angle((a < 0.0) ?
a + TWO_PI :
a
);
}
float look_upwards(float a) {
float b = positive_angle(a);
return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?
b - PI :
b;
}
float look_horizontal_or_vertical(float a, float ratio) {
// ratio controls the ratio between being horizontal to (vertical + horizontal)
// if ratio is set to 0.5 then it is 50%, 50%.
// when using a higher ratio e.g. 0.75 the result would
// likely be more horizontal than vertical.
float b = positive_angle(a);
return
(b < ( ratio) * HALF_PI) ? 0.0 :
(b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :
(b < (2.0 + ratio) * HALF_PI) ? 0.0 :
(b < (4.0 - ratio) * HALF_PI) ? HALF_PI :
0.0;
}
float roundTo(float a, float b) {
return float(b * floor((a + 0.5 * b) / b));
}
float look_round_n_directions(float a, int n) {
float b = positive_angle(a);
float div = TWO_PI / float(n);
float c = roundTo(b, div);
return look_upwards(c);
}
float applyAlignOption(float rawAngle, float delta) {
return
(option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions
(option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical
(option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis
(option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards
(option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal
rawAngle; // otherwise return back raw input angle
}
bool isAxisTitle = (axis.x == 0.0) &&
(axis.y == 0.0) &&
(axis.z == 0.0);
void main() {
//Compute world offset
float axisDistance = position.z;
vec3 dataPosition = axisDistance * axis + offset;
float beta = angle; // i.e. user defined attributes for each tick
float axisAngle;
float clipAngle;
float flip;
if (enableAlign) {
axisAngle = (isAxisTitle) ? HALF_PI :
computeViewAngle(dataPosition, dataPosition + axis);
clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);
axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;
clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;
flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),
vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;
beta += applyAlignOption(clipAngle, flip * PI);
}
//Compute plane offset
vec2 planeCoord = position.xy * pixelScale;
mat2 planeXform = scale * mat2(
cos(beta), sin(beta),
-sin(beta), cos(beta)
);
vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;
//Compute clip position
vec3 clipPosition = project(dataPosition);
//Apply text offset in clip coordinates
clipPosition += vec3(viewOffset, 0.0);
//Done
gl_Position = vec4(clipPosition, 1.0);
}`]),l=t([`precision highp float;
#define GLSLIFY 1
uniform vec4 color;
void main() {
gl_FragColor = color;
}`]);g.f=function(T){return s(T,u,l,null,[{name:"position",type:"vec3"}])};var y=t([`precision highp float;
#define GLSLIFY 1
attribute vec3 position;
attribute vec3 normal;
uniform mat4 model, view, projection;
uniform vec3 enable;
uniform vec3 bounds[2];
varying vec3 colorChannel;
void main() {
vec3 signAxis = sign(bounds[1] - bounds[0]);
vec3 realNormal = signAxis * normal;
if(dot(realNormal, enable) > 0.0) {
vec3 minRange = min(bounds[0], bounds[1]);
vec3 maxRange = max(bounds[0], bounds[1]);
vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));
gl_Position = projection * view * model * vec4(nPosition, 1.0);
} else {
gl_Position = vec4(0,0,0,0);
}
colorChannel = abs(realNormal);
}`]),h=t([`precision highp float;
#define GLSLIFY 1
uniform vec4 colors[3];
varying vec3 colorChannel;
void main() {
gl_FragColor = colorChannel.x * colors[0] +
colorChannel.y * colors[1] +
colorChannel.z * colors[2];
}`]);g.bg=function(T){return s(T,y,h,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},9557:function(d,g,r){d.exports=v;var t=r(5827),s=r(2944),a=r(875),c=r(1943).f,u=window||A.global||{},l=u.__TEXT_CACHE||{};u.__TEXT_CACHE={};var y=3;function h(m,b,E,p){this.gl=m,this.shader=b,this.buffer=E,this.vao=p,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var T=h.prototype,f=[0,0];T.bind=function(m,b,E,p){this.vao.bind(),this.shader.bind();var S=this.shader.uniforms;S.model=m,S.view=b,S.projection=E,S.pixelScale=p,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},T.unbind=function(){this.vao.unbind()},T.update=function(m,b,E,p,S){var w=[];function i(F,N,V,j,$,q){var oe=l[V];oe||(oe=l[V]={});var Z=oe[N];Z||(Z=oe[N]=n(N,{triangles:!0,font:V,textAlign:"center",textBaseline:"middle",lineSpacing:$,styletags:q}));for(var G=(j||12)/12,re=Z.positions,H=Z.cells,J=0,ae=H.length;J<ae;++J)for(var K=H[J],Y=2;Y>=0;--Y){var ie=re[K[Y]];w.push(G*ie[0],-G*ie[1],F)}}for(var C=[0,0,0],x=[0,0,0],k=[0,0,0],I=[0,0,0],B=1.25,_={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},z=0;z<3;++z){k[z]=w.length/y|0,i(.5*(m[0][z]+m[1][z]),b[z],E[z],12,B,_),I[z]=(w.length/y|0)-k[z],C[z]=w.length/y|0;for(var O=0;O<p[z].length;++O)p[z][O].text&&i(p[z][O].x,p[z][O].text,p[z][O].font||S,p[z][O].fontSize||12,B,_);x[z]=(w.length/y|0)-C[z]}this.buffer.update(w),this.tickOffset=C,this.tickCount=x,this.labelOffset=k,this.labelCount=I},T.drawTicks=function(m,b,E,p,S,w,i,C){this.tickCount[m]&&(this.shader.uniforms.axis=w,this.shader.uniforms.color=S,this.shader.uniforms.angle=E,this.shader.uniforms.scale=b,this.shader.uniforms.offset=p,this.shader.uniforms.alignDir=i,this.shader.uniforms.alignOpt=C,this.vao.draw(this.gl.TRIANGLES,this.tickCount[m],this.tickOffset[m]))},T.drawLabel=function(m,b,E,p,S,w,i,C){this.labelCount[m]&&(this.shader.uniforms.axis=w,this.shader.uniforms.color=S,this.shader.uniforms.angle=E,this.shader.uniforms.scale=b,this.shader.uniforms.offset=p,this.shader.uniforms.alignDir=i,this.shader.uniforms.alignOpt=C,this.vao.draw(this.gl.TRIANGLES,this.labelCount[m],this.labelOffset[m]))},T.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function n(m,b){try{return a(m,b)}catch(E){return console.warn('error vectorizing text:"'+m+'" error:',E),{cells:[],positions:[]}}}function v(m,b,E,p,S,w){var i=t(m),C=s(m,[{buffer:i,size:3}]),x=c(m);x.attributes.position.location=0;var k=new h(m,x,i,C);return k.update(b,E,p,S,w),k}},8468:function(d,g){g.create=t,g.equal=s;function r(a,c){var u=a+"",l=u.indexOf("."),y=0;l>=0&&(y=u.length-l-1);var h=Math.pow(10,y),T=Math.round(a*c*h),f=T+"";if(f.indexOf("e")>=0)return f;var n=T/h,v=T%h;T<0?(n=-Math.ceil(n)|0,v=-v|0):(n=Math.floor(n)|0,v=v|0);var m=""+n;if(T<0&&(m="-"+m),y){for(var b=""+v;b.length<y;)b="0"+b;return m+"."+b}else return m}function t(a,c){for(var u=[],l=0;l<3;++l){var y=[];.5*(a[0][l]+a[1][l]);for(var h=0;h*c[l]<=a[1][l];++h)y.push({x:h*c[l],text:r(c[l],h)});for(var h=-1;h*c[l]>=a[0][l];--h)y.push({x:h*c[l],text:r(c[l],h)});u.push(y)}return u}function s(a,c){for(var u=0;u<3;++u){if(a[u].length!==c[u].length)return!1;for(var l=0;l<a[u].length;++l){var y=a[u][l],h=c[u][l];if(y.x!==h.x||y.text!==h.text||y.font!==h.font||y.fontColor!==h.fontColor||y.fontSize!==h.fontSize||y.dx!==h.dx||y.dy!==h.dy)return!1}}return!0}},2771:function(d,g,r){d.exports=E;var t=r(5795),s=r(4670),a=r(2864),c=r(104),u=r(2142),l=r(6342),y=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),h=new Float32Array(16);function T(p,S,w){this.lo=p,this.hi=S,this.pixelsPerDataUnit=w}var f=[0,0,0,1],n=[0,0,0,1];function v(p,S,w,i,C){for(var x=0;x<3;++x){for(var k=f,I=n,B=0;B<3;++B)I[B]=k[B]=w[B];I[3]=k[3]=1,I[x]+=1,l(I,I,S),I[3]<0&&(p[x]=1/0),k[x]-=1,l(k,k,S),k[3]<0&&(p[x]=1/0);var _=(k[0]/k[3]-I[0]/I[3])*i,z=(k[1]/k[3]-I[1]/I[3])*C;p[x]=.25*Math.sqrt(_*_+z*z)}return p}var m=[new T(1/0,-1/0,1/0),new T(1/0,-1/0,1/0),new T(1/0,-1/0,1/0)],b=[0,0,0];function E(p,S,w,i,z){var x=S.model||y,k=S.view||y,I=S.projection|
precision highp float;
#define GLSLIFY 1
vec3 getOrthogonalVector(vec3 v) {
// Return up-vector for only-z vector.
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
// Assign z = 0, x = -b, y = a:
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
return normalize(vec3(-v.y, v.x, 0.0));
} else {
return normalize(vec3(0.0, v.z, -v.y));
}
}
// Calculate the cone vertex and normal at the given index.
//
// The returned vertex is for a cone with its top at origin and height of 1.0,
// pointing in the direction of the vector attribute.
//
// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.
// These vertices are used to make up the triangles of the cone by the following:
// segment + 0 top vertex
// segment + 1 perimeter vertex a+1
// segment + 2 perimeter vertex a
// segment + 3 center base vertex
// segment + 4 perimeter vertex a
// segment + 5 perimeter vertex a+1
// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.
// To go from index to segment, floor(index / 6)
// To go from segment to angle, 2*pi * (segment/segmentCount)
// To go from index to segment index, index - (segment*6)
//
vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {
const float segmentCount = 8.0;
float index = rawIndex - floor(rawIndex /
(segmentCount * 6.0)) *
(segmentCount * 6.0);
float segment = floor(0.001 + index/6.0);
float segmentIndex = index - (segment*6.0);
normal = -normalize(d);
if (segmentIndex > 2.99 && segmentIndex < 3.01) {
return mix(vec3(0.0), -d, coneOffset);
}
float nextAngle = (
(segmentIndex > 0.99 && segmentIndex < 1.01) ||
(segmentIndex > 4.99 && segmentIndex < 5.01)
) ? 1.0 : 0.0;
float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);
vec3 v1 = mix(d, vec3(0.0), coneOffset);
vec3 v2 = v1 - d;
vec3 u = getOrthogonalVector(d);
vec3 v = normalize(cross(u, d));
vec3 x = u * cos(angle) * length(d)*0.25;
vec3 y = v * sin(angle) * length(d)*0.25;
vec3 v3 = v2 + x + y;
if (segmentIndex < 3.0) {
vec3 tx = u * sin(angle);
vec3 ty = v * -cos(angle);
vec3 tangent = tx + ty;
normal = normalize(cross(v3 - v1, tangent));
}
if (segmentIndex == 0.0) {
return mix(d, vec3(0.0), coneOffset);
}
return v3;
}
attribute vec3 vector;
attribute vec4 color, position;
attribute vec2 uv;
uniform float vectorScale, coneScale, coneOffset;
uniform mat4 model, view, projection, inverseModel;
uniform vec3 eyePosition, lightPosition;
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
varying vec4 f_color;
varying vec2 f_uv;
void main() {
// Scale the vector magnitude to stay constant with
// model & view changes.
vec3 normal;
vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);
vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
//Lighting geometry parameters
vec4 cameraCoordinate = view * conePosition;
cameraCoordinate.xyz /= cameraCoordinate.w;
f_lightDirection = lightPosition - cameraCoordinate.xyz;
f_eyeDirection = eyePosition - cameraCoordinate.xyz;
f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
// vec4 m_position = model * vec4(conePosition, 1.0);
vec4 t_position = view * conePosition;
gl_Position = projection * t_position;
f_color = color;
f_data = conePosition.xyz;
f_position = position.xyz;
f_uv = uv;
}
`]),a=t([`#extension GL_OES_standard_derivatives : enable
precision highp float;
#define GLSLIFY 1
float beckmannDistribution(float x, float roughness) {
float NdotH = max(x, 0.0001);
float cos2Alpha = NdotH * NdotH;
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
float roughness2 = roughness * roughness;
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
return exp(tan2Alpha / roughness2) / denom;
}
float cookTorranceSpecular(
vec3 lightDirection,
vec3 viewDirection,
vec3 surfaceNormal,
float roughness,
float fresnel) {
float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
//Half angle vector
vec3 H = normalize(lightDirection + viewDirection);
//Geometric term
float NdotH = max(dot(surfaceNormal, H), 0.0);
float VdotH = max(dot(viewDirection, H), 0.000001);
float LdotH = max(dot(lightDirection, H), 0.000001);
float G1 = (2.0 * NdotH * VdotN) / VdotH;
float G2 = (2.0 * NdotH * LdotN) / LdotH;
float G = min(1.0, min(G1, G2));
//Distribution term
float D = beckmannDistribution(NdotH, roughness);
//Fresnel term
float F = pow(1.0 - VdotN, fresnel);
//Multiply terms and done
return G * F * D / max(3.14159265 * VdotN, 0.000001);
}
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 clipBounds[2];
uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
uniform sampler2D texture;
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
varying vec4 f_color;
varying vec2 f_uv;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
vec3 N = normalize(f_normal);
vec3 L = normalize(f_lightDirection);
vec3 V = normalize(f_eyeDirection);
if(gl_FrontFacing) {
N = -N;
}
float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
vec4 surfaceColor = f_color * texture2D(texture, f_uv);
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
gl_FragColor = litColor * opacity;
}
`]),c=t([`precision highp float;
precision highp float;
#define GLSLIFY 1
vec3 getOrthogonalVector(vec3 v) {
// Return up-vector for only-z vector.
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
// Assign z = 0, x = -b, y = a:
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
return normalize(vec3(-v.y, v.x, 0.0));
} else {
return normalize(vec3(0.0, v.z, -v.y));
}
}
// Calculate the cone vertex and normal at the given index.
//
// The returned vertex is for a cone with its top at origin and height of 1.0,
// pointing in the direction of the vector attribute.
//
// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.
// These vertices are used to make up the triangles of the cone by the following:
// segment + 0 top vertex
// segment + 1 perimeter vertex a+1
// segment + 2 perimeter vertex a
// segment + 3 center base vertex
// segment + 4 perimeter vertex a
// segment + 5 perimeter vertex a+1
// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.
// To go from index to segment, floor(index / 6)
// To go from segment to angle, 2*pi * (segment/segmentCount)
// To go from index to segment index, index - (segment*6)
//
vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {
const float segmentCount = 8.0;
float index = rawIndex - floor(rawIndex /
(segmentCount * 6.0)) *
(segmentCount * 6.0);
float segment = floor(0.001 + index/6.0);
float segmentIndex = index - (segment*6.0);
normal = -normalize(d);
if (segmentIndex > 2.99 && segmentIndex < 3.01) {
return mix(vec3(0.0), -d, coneOffset);
}
float nextAngle = (
(segmentIndex > 0.99 && segmentIndex < 1.01) ||
(segmentIndex > 4.99 && segmentIndex < 5.01)
) ? 1.0 : 0.0;
float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);
vec3 v1 = mix(d, vec3(0.0), coneOffset);
vec3 v2 = v1 - d;
vec3 u = getOrthogonalVector(d);
vec3 v = normalize(cross(u, d));
vec3 x = u * cos(angle) * length(d)*0.25;
vec3 y = v * sin(angle) * length(d)*0.25;
vec3 v3 = v2 + x + y;
if (segmentIndex < 3.0) {
vec3 tx = u * sin(angle);
vec3 ty = v * -cos(angle);
vec3 tangent = tx + ty;
normal = normalize(cross(v3 - v1, tangent));
}
if (segmentIndex == 0.0) {
return mix(d, vec3(0.0), coneOffset);
}
return v3;
}
attribute vec4 vector;
attribute vec4 position;
attribute vec4 id;
uniform mat4 model, view, projection;
uniform float vectorScale, coneScale, coneOffset;
varying vec3 f_position;
varying vec4 f_id;
void main() {
vec3 normal;
vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);
vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
gl_Position = projection * view * conePosition;
f_id = id;
f_position = position.xyz;
}
`]),u=t([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 clipBounds[2];
uniform float pickId;
varying vec3 f_position;
varying vec4 f_id;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
gl_FragColor = vec4(pickId, f_id.xyz);
}`]);g.meshShader={vertex:s,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},g.pickShader={vertex:c,fragment:u,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},1950:function(d){d.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",340
#define GLSLIFY 1
attribute vec3 position, offset;
attribute vec4 color;
uniform mat4 model, view, projection;
uniform float capSize;
varying vec4 fragColor;
varying vec3 fragPosition;
void main() {
vec4 worldPosition = model * vec4(position, 1.0);
worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);
gl_Position = projection * view * worldPosition;
fragColor = color;
fragPosition = position;
}`]),c=t([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 clipBounds[2];
uniform float opacity;
varying vec3 fragPosition;
varying vec4 fragColor;
void main() {
if (
outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||
fragColor.a * opacity == 0.
) discard;
gl_FragColor = opacity * fragColor;
}`]);d.exports=function(u){return s(u,a,c,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},4234:function(d,g,r){var t=r(8931);d.exports=S;var s=null,a,c,u,l;function y(w){var i=w.getParameter(w.FRAMEBUFFER_BINDING),C=w.getParameter(w.RENDERBUFFER_BINDING),x=w.getParameter(w.TEXTURE_BINDING_2D);return[i,C,x]}function h(w,i){w.bindFramebuffer(w.FRAMEBUFFER,i[0]),w.bindRenderbuffer(w.RENDERBUFFER,i[1]),w.bindTexture(w.TEXTURE_2D,i[2])}function T(w,i){var C=w.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL);s=new Array(C+1);for(var x=0;x<=C;++x){for(var k=new Array(C),I=0;I<x;++I)k[I]=w.COLOR_ATTACHMENT0+I;for(var I=x;I<C;++I)k[I]=w.NONE;s[x]=k}}function f(w){switch(w){case a:throw new Error("gl-fbo: Framebuffer unsupported");case c:throw new Error("gl-fbo: Framebuffer incomplete attachment");case u:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case l:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function n(w,i,C,x,k,I){if(!x)return null;var B=t(w,i,C,k,x);return B.magFilter=w.NEAREST,B.minFilter=w.NEAREST,B.mipSamples=1,B.bind(),w.framebufferTexture2D(w.FRAMEBUFFER,I,w.TEXTURE_2D,B.handle,0),B}function v(w,i,C,x,k){var I=w.createRenderbuffer();return w.bindRenderbuffer(w.RENDERBUFFER,I),w.renderbufferStorage(w.RENDERBUFFER,x,i,C),w.framebufferRenderbuffer(w.FRAMEBUFFER,k,w.RENDERBUFFER,I),I}function m(w){var i=y(w.gl),C=w.gl,x=w.handle=C.createFramebuffer(),k=w._shape[0],I=w._shape[1],B=w.color.length,_=w._ext,z=w._useStencil,O=w._useDepth,F=w._colorType;C.bindFramebuffer(C.FRAMEBUFFER,x);for(var N=0;N<B;++N)w.color[N]=n(C,k,I,F,C.RGBA,C.COLOR_ATTACHMENT0+N);B===0?(w._color_rb=v(C,k,I,C.RGBA4,C.COLOR_ATTACHMENT0),_&&_.drawBuffersWEBGL(s[0])):B>1&&_.drawBuffersWEBGL(s[B]);var V=C.getExtension("WEBGL_depth_texture");V?z?w.depth=n(C,k,I,V.UNSIGNED_INT_24_8_WEBGL,C.DEPTH_STENCIL,C.DEPTH_STENCIL_ATTACHMENT):O&&(w.depth=n(C,k,I,C.UNSIGNED_SHORT,C.DEPTH_COMPONENT,C.DEPTH_ATTACHMENT)):O&&z?w._depth_rb=v(C,k,I,C.DEPTH_STENCIL,C.DEPTH_STENCIL_ATTACHMENT):O?w._depth_rb=v(C,k,I,C.DEPTH_COMPONENT16,C.DEPTH_ATTACHMENT):z&&(w._depth_rb=v(C,k,I,C.STENCIL_INDEX,C.STENCIL_ATTACHMENT));var j=C.checkFramebufferStatus(C.FRAMEBUFFER);if(j!==C.FRAMEBUFFER_COMPLETE){w._destroyed=!0,C.bindFramebuffer(C.FRAMEBUFFER,null),C.deleteFramebuffer(w.handle),w.handle=null,w.depth&&(w.depth.dispose(),w.depth=null),w._depth_rb&&(C.deleteRenderbuffer(w._depth_rb),w._depth_rb=null);for(var N=0;N<w.color.length;++N)w.color[N].dispose(),w.color[N]=null;w._color_rb&&(C.deleteRenderbuffer(w._color_rb),w._color_rb=null),h(C,i),f(j)}h(C,i)}function b(w,i,C,x,k,I,B,_){this.gl=w,this._shape=[i|0,C|0],this._destroyed=!1,this._ext=_,this.color=new Array(k);for(var z=0;z<k;++z)this.color[z]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=x,this._useDepth=I,this._useStencil=B;var O=this,F=[i|0,C|0];Object.defineProperties(F,{0:{get:function(){return O._shape[0]},set:function(N){return O.width=N}},1:{get:function(){return O._shape[1]},set:function(N){return O.height=N}}}),this._shapeVector=F,m(this)}var E=b.prototype;function p(w,i,C){if(w._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(!(w._shape[0]===i&&w._shape[1]===C)){var x=w.gl,k=x.getParameter(x.MAX_RENDERBUFFER_SIZE);if(i<0||i>k||C<0||C>k)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");w._shape[0]=i,w._shape[1]=C;for(var I=y(x),B=0;B<w.color.length;++B)w.color[B].shape=w._shape;w._color_rb&&(x.bindRenderbuffer(x.RENDERBUFFER,w._color_rb),x.renderbufferStorage(x.RENDERBUFFER,x.RGBA4,w._shape[0],w._shape[1])),w.depth&&(w.depth.shape=w._shape),w._depth_rb&&(x.bindRenderbuffer(x.RENDERBUFFER,w._depth_rb),w._useDepth&&w._useStencil?x.renderbufferStorage(x.RENDERBUFFER,x.DEPTH_STENCIL,w._shape[0],w._shape[1]):w._useDepth?x.renderbufferStorage(x.RENDERBUFFER,x.DEPTH_COMPONENT16,w._shape[0],w._shape[1]):w._useStencil&&x.renderbufferStorage(x.RENDERBUFFER,x.STENCIL_INDEX,w._shape[0],w._shape[1])),x.bindFra
`,f,T),v=t("%s%s",n,l),m=l.split(`
`),b={},E=0;E<m.length;E++){var p=m[E];if(!(p===""||p==="\0")){var S=parseInt(p.split(":")[2]);if(isNaN(S))throw new Error(t("Could not parse error: %s",p));b[S]=p}}for(var w=c(y).split(`
`),E=0;E<w.length;E++)if(!(!b[E+3]&&!b[E+2]&&!b[E+1])){var i=w[E];if(n+=i+`
`,b[E+1]){var C=b[E+1];C=C.substr(C.split(":",3).join(":").length+1).trim(),n+=t(`^^^ %s
`,C)}}return{long:n.trim(),short:v.trim()}}},6386:function(d,g,r){d.exports=f;var t=r(5070),s=r(9560),a=r(5306),c=r(5158),u=r(5827),l=r(1292);function y(n,v,m,b,E,p,S){this.plot=n,this.shader=v,this.pickShader=m,this.positionBuffer=b,this.weightBuffer=E,this.colorBuffer=p,this.idBuffer=S,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}var h=y.prototype,T=[0,0,1,0,0,1,1,0,1,1,0,1];h.draw=function(){var n=[1,0,0,0,1,0,0,0,1];return function(){var v=this.plot,m=this.shader,b=this.bounds,E=this.numVertices;if(!(E<=0)){var p=v.gl,S=v.dataBox,w=b[2]-b[0],i=b[3]-b[1],C=S[2]-S[0],x=S[3]-S[1];n[0]=2*w/C,n[4]=2*i/x,n[6]=2*(b[0]-S[0])/C-1,n[7]=2*(b[1]-S[1])/x-1,m.bind();var k=m.uniforms;k.viewTransform=n,k.shape=this.shape;var I=m.attributes;this.positionBuffer.bind(),I.position.pointer(),this.weightBuffer.bind(),I.weight.pointer(p.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),I.color.pointer(p.UNSIGNED_BYTE,!0),p.drawArrays(p.TRIANGLES,0,E)}}}(),h.drawPick=function(){var n=[1,0,0,0,1,0,0,0,1],v=[0,0,0,0];return function(m){var b=this.plot,E=this.pickShader,p=this.bounds,S=this.numVertices;if(!(S<=0)){var w=b.gl,i=b.dataBox,C=p[2]-p[0],x=p[3]-p[1],k=i[2]-i[0],I=i[3]-i[1];n[0]=2*C/k,n[4]=2*x/I,n[6]=2*(p[0]-i[0])/k-1,n[7]=2*(p[1]-i[1])/I-1;for(var B=0;B<4;++B)v[B]=m>>B*8&255;this.pickOffset=m,E.bind();var _=E.uniforms;_.viewTransform=n,_.pickOffset=v,_.shape=this.shape;var z=E.attributes;return this.positionBuffer.bind(),z.position.pointer(),this.weightBuffer.bind(),z.weight.pointer(w.UNSIGNED_BYTE,!1),this.idBuffer.bind(),z.pickId.pointer(w.UNSIGNED_BYTE,!1),w.drawArrays(w.TRIANGLES,0,S),m+this.shape[0]*this.shape[1]}}}(),h.pick=function(n,v,m){var b=this.pickOffset,E=this.shape[0]*this.shape[1];if(m<b||m>=b+E)return null;var p=m-b,S=this.xData,w=this.yData;return{object:this,pointId:p,dataCoord:[S[p%this.shape[0]],w[p/this.shape[0]|0]]}},h.update=function(n){n=n||{};var v=n.shape||[0,0],m=n.x||s(v[0]),b=n.y||s(v[1]),E=n.z||new Float32Array(v[0]*v[1]),p=n.zsmooth!==!1;this.xData=m,this.yData=b;var S=n.colorLevels||[0],w=n.colorValues||[0,0,0,1],i=S.length,C=this.bounds,x,k,I,B;p?(x=C[0]=m[0],k=C[1]=b[0],I=C[2]=m[m.length-1],B=C[3]=b[b.length-1]):(x=C[0]=m[0]+(m[1]-m[0])/2,k=C[1]=b[0]+(b[1]-b[0])/2,I=C[2]=m[m.length-1]+(m[m.length-1]-m[m.length-2])/2,B=C[3]=b[b.length-1]+(b[b.length-1]-b[b.length-2])/2);var _=1/(I-x),z=1/(B-k),O=v[0],F=v[1];this.shape=[O,F];var N=(p?(O-1)*(F-1):O*F)*(T.length>>>1);this.numVertices=N;for(var V=a.mallocUint8(N*4),j=a.mallocFloat32(N*2),$=a.mallocUint8(N*2),q=a.mallocUint32(N),oe=0,Z=p?O-1:O,G=p?F-1:F,re=0;re<G;++re){var H,J;p?(H=z*(b[re]-k),J=z*(b[re+1]-k)):(H=re<F-1?z*(b[re]-(b[re+1]-b[re])/2-k):z*(b[re]-(b[re]-b[re-1])/2-k),J=re<F-1?z*(b[re]+(b[re+1]-b[re])/2-k):z*(b[re]+(b[re]-b[re-1])/2-k));for(var ae=0;ae<Z;++ae){var K,Y;p?(K=_*(m[ae]-x),Y=_*(m[ae+1]-x)):(K=ae<O-1?_*(m[ae]-(m[ae+1]-m[ae])/2-x):_*(m[ae]-(m[ae]-m[ae-1])/2-x),Y=ae<O-1?_*(m[ae]+(m[ae+1]-m[ae])/2-x):_*(m[ae]+(m[ae]-m[ae-1])/2-x));for(var ie=0;ie<T.length;ie+=2){var ne=T[ie],le=T[ie+1],de=p?(re+le)*O+(ae+ne):re*O+ae,we=E[de],me=t.le(S,we),Le,ve,Ae,ye;if(me<0)Le=w[0],ve=w[1],Ae=w[2],ye=w[3];else if(me===i-1)Le=w[4*i-4],ve=w[4*i-3],Ae=w[4*i-2],ye=w[4*i-1];else{var Se=(we-S[me])/(S[me+1]-S[me]),_e=1-Se,ze=4*me,Ie=4*(me+1);Le=_e*w[ze]+Se*w[Ie],ve=_e*w[ze+1]+Se*w[Ie+1],Ae=_e*w[ze+2]+Se*w[Ie+2],ye=_e*w[ze+3]+Se*w[Ie+3]}V[4*oe]=255*Le,V[4*oe+1]=255*ve,V[4*oe+2]=255*Ae,V[4*oe+3]=255*ye,j[2*oe]=K*.5+Y*.5,j[2*oe+1]=H*.5+J*.5,$[2*oe]=ne,$[2*oe+1]=le,q[oe]=re*O+ae,oe+=1}}}this.positionBuffer.update(j),this.weightBuffer.update($),this.colorBuffer.update(V),this.idBuffer.update(q),a.free(j),a.free(V),a.free($),a.free(q)},h.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.weightBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)};function f(n,v){var m=n.gl,b=c(m,l.vertex,l.fragment),E=c(m,l.pickVertex,l.pickFragment),p=u(m),S=u(m),w=u(m),i=u(m),C=new y(n,b,E,p,S,w,i);return C.update(v),n.addObject(C),C}},1292:fu
#define GLSLIFY 1
varying vec4 fragColor;
void main() {
gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);
}
`]),vertex:t([`precision mediump float;
#define GLSLIFY 1
attribute vec2 position;
attribute vec4 color;
attribute vec2 weight;
uniform vec2 shape;
uniform mat3 viewTransform;
varying vec4 fragColor;
void main() {
vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);
fragColor = color;
gl_Position = vec4(vPosition.xy, 0, vPosition.z);
}
`]),pickFragment:t([`precision mediump float;
#define GLSLIFY 1
varying vec4 fragId;
varying vec2 vWeight;
uniform vec2 shape;
uniform vec4 pickOffset;
void main() {
vec2 d = step(.5, vWeight);
vec4 id = fragId + pickOffset;
id.x += d.x + d.y*shape.x;
id.y += floor(id.x / 256.0);
id.x -= floor(id.x / 256.0) * 256.0;
id.z += floor(id.y / 256.0);
id.y -= floor(id.y / 256.0) * 256.0;
id.w += floor(id.z / 256.0);
id.z -= floor(id.z / 256.0) * 256.0;
gl_FragColor = id/255.;
}
`]),pickVertex:t([`precision mediump float;
#define GLSLIFY 1
attribute vec2 position;
attribute vec4 pickId;
attribute vec2 weight;
uniform vec2 shape;
uniform mat3 viewTransform;
varying vec4 fragId;
varying vec2 vWeight;
void main() {
vWeight = weight;
fragId = pickId;
vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);
gl_Position = vec4(vPosition.xy, 0, vPosition.z);
}
`])}},248:function(d,g,r){var t=r(6832),s=r(5158),a=t([`precision highp float;
#define GLSLIFY 1
attribute vec3 position, nextPosition;
attribute float arcLength, lineWidth;
attribute vec4 color;
uniform vec2 screenShape;
uniform float pixelRatio;
uniform mat4 model, view, projection;
varying vec4 fragColor;
varying vec3 worldPosition;
varying float pixelArcLength;
vec4 project(vec3 p) {
return projection * view * model * vec4(p, 1.0);
}
void main() {
vec4 startPoint = project(position);
vec4 endPoint = project(nextPosition);
vec2 A = startPoint.xy / startPoint.w;
vec2 B = endPoint.xy / endPoint.w;
float clipAngle = atan(
(B.y - A.y) * screenShape.y,
(B.x - A.x) * screenShape.x
);
vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(
sin(clipAngle),
-cos(clipAngle)
) / screenShape;
gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);
worldPosition = position;
pixelArcLength = arcLength;
fragColor = color;
}
`]),c=t([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 clipBounds[2];
uniform sampler2D dashTexture;
uniform float dashScale;
uniform float opacity;
varying vec3 worldPosition;
varying float pixelArcLength;
varying vec4 fragColor;
void main() {
if (
outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||
fragColor.a * opacity == 0.
) discard;
float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;
if(dashWeight < 0.5) {
discard;
}
gl_FragColor = fragColor * opacity;
}
`]),u=t([`precision highp float;
#define GLSLIFY 1
#define FLOAT_MAX 1.70141184e38
#define FLOAT_MIN 1.17549435e-38
// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl
vec4 packFloat(float v) {
float av = abs(v);
//Handle special cases
if(av < FLOAT_MIN) {
return vec4(0.0, 0.0, 0.0, 0.0);
} else if(v > FLOAT_MAX) {
return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;
} else if(v < -FLOAT_MAX) {
return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;
}
vec4 c = vec4(0,0,0,0);
//Compute exponent and mantissa
float e = floor(log2(av));
float m = av * pow(2.0, -e) - 1.0;
//Unpack mantissa
c[1] = floor(128.0 * m);
m -= c[1] / 128.0;
c[2] = floor(32768.0 * m);
m -= c[2] / 32768.0;
c[3] = floor(8388608.0 * m);
//Unpack exponent
float ebias = e + 127.0;
c[0] = floor(ebias / 2.0);
ebias -= c[0] * 2.0;
c[1] += floor(ebias) * 128.0;
//Unpack sign bit
c[0] += 128.0 * step(0.0, -v);
//Scale back to range
return c / 255.0;
}
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform float pickId;
uniform vec3 clipBounds[2];
varying vec3 worldPosition;
varying float pixelArcLength;
varying vec4 fragColor;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;
gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);
}`]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];g.createShader=function(y){return s(y,a,c,null,l)},g.createPickShader=function(y){return s(y,a,u,null,l)}},6086:function(d,g,r){d.exports=w;var t=r(5827),s=r(2944),a=r(8931),c=new Uint8Array(4),u=new Float32Array(c.buffer);function l(i,C,x,k){return c[0]=k,c[1]=x,c[2]=C,c[3]=i,u[0]}var y=r(5070),h=r(5050),T=r(248),f=T.createShader,n=T.createPickShader,v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function m(i,C){for(var x=0,k=0;k<3;++k){var I=i[k]-C[k];x+=I*I}return Math.sqrt(x)}function b(i){for(var C=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],x=0;x<3;++x)C[0][x]=Math.max(i[0][x],C[0][x]),C[1][x]=Math.min(i[1][x],C[1][x]);return C}function E(i,C,x,k){this.arcLength=i,this.position=C,this.index=x,this.dataCoordinate=k}function p(i,C,x,k,I,B){this.gl=i,this.shader=C,this.pickShader=x,this.buffer=k,this.vao=I,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=B,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var S=p.prototype;S.isTransparent=function(){return this.hasAlpha},S.isOpaque=function(){return!this.hasAlpha},S.pickSlots=1,S.setPickBase=function(i){this.pickId=i},S.drawTransparent=S.draw=function(i){if(this.vertexCount){var C=this.gl,x=this.shader,k=this.vao;x.bind(),x.uniforms={model:i.model||v,view:i.view||v,projection:i.projection||v,clipBounds:b(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[C.drawingBufferWidth,C.drawingBufferHeight],pixelRatio:this.pixelRatio},k.bind(),k.draw(C.TRIANGLE_STRIP,this.vertexCount),k.unbind()}},S.drawPick=function(i){if(this.vertexCount){var C=this.gl,x=this.pickShader,k=this.vao;x.bind(),x.uniforms={model:i.model||v,view:i.view||v,projection:i.projection||v,pickId:this.pickId,clipBounds:b(this.clipBounds),screenShape:[C.drawingBufferWidth,C.drawingBufferHeight],pixelRatio:this.pixelRatio},k.bind(),k.draw(C.TRIANGLE_STRIP,this.vertexCount),k.unbind()}},S.update=function(i){var C,x;this.dirty=!0;var k=!!i.connectGaps;"dashScale"in i&&(this.dashScale=i.dashScale),this.hasAlpha=!1,"opacity"in i&&(this.opacity=+i.opacity,this.opacity<1&&(this.hasAlpha=!0));var I=[],B=[],_=[],z=0,O=0,F=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],N=i.position||i.positions;if(N){var V=i.color||i.colors||[0,0,0,1],j=i.lineWidth||1,$=!1;e:for(C=1;C<N.length;++C){var q=N[C-1],oe=N[C];for(B.push(z),_.push(q.slice()),x=0;x<3;++x){if(isNaN(q[x])||isNaN(oe[x])||!isFinite(q[x])||!isFinite(oe[x])){if(!k&&I.length>0){for(var Z=0;Z<24;++Z)I.push(I[I.length-12]);O+=2,$=!0}continue e}F[0][x]=Math.min(F[0][x],q[x],oe[x]),F[1][x]=Math.max(F[1][x],q[x],oe[x])}var G,re;Array.isArray(V[0])?(G=V.length>C-1?V[C-1]:V.length>0?V[V.length-1]:[0,0,0,1],re=V.length>C?V[C]:V.length>0?V[V.length-1]:[0,0,0,1]):G=re=V,G.length===3&&(G=[G[0],G[1],G[2],1]),re.length===3&&(re=[re[0],re[1],re[2],1]),!this.hasAlpha&&G[3]<1&&(this.hasAlpha=!0);var H;Array.isArray(j)?H=j.length>C-1?j[C-1]:j.length>0?j[j.length-1]:[0,0,0,1]:H=j;var J=z;if(z+=m(q,oe),$){for(x=0;x<2;++x)I.push(q[0],q[1],q[2],oe[0],oe[1],oe[2],J,H,G[0],G[1],G[2],G[3]);O+=2,$=!1}I.push(q[0],q[1],q[2],oe[0],oe[1],oe[2],J,H,G[0],G[1],G[2],G[3],q[0],q[1],q[2],oe[0],oe[1],oe[2],J,-H,G[0],G[1],G[2],G[3],oe[0],oe[1],oe[2],q[0],q[1],q[2],z,-H,re[0],re[1],re[2],re[3],oe[0],oe[1],oe[2],q[0],q[1],q[2],z,H,re[0],re[1],re[2],re[3]),O+=4}}if(this.buffer.update(I),B.push(z),_.push(N[N.length-1].slice()),this.bounds=F,this.vertexCount=O,this.points=_,this.arcLength=B,"dashes"in i){var ae=i.dashes,K=ae.slice();for(K.unshift(0),C=1;C<K.length;++C)K[C]=K[C-1]+K[C];var Y=h(new Array(256*4),[256,1,4]);for(C=0;C<256;++C){for(x=0;x<4;++x)Y.set(C,0,x,0);y.le(K,K[K.length-1]*C/255)&1?Y.set(C,0,0,0):Y.set(C,0,0,255)}this.texture.setPixels(Y)}},S.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.d
#define GLSLIFY 1
attribute vec3 position, normal;
attribute vec4 color;
attribute vec2 uv;
uniform mat4 model
, view
, projection
, inverseModel;
uniform vec3 eyePosition
, lightPosition;
varying vec3 f_normal
, f_lightDirection
, f_eyeDirection
, f_data;
varying vec4 f_color;
varying vec2 f_uv;
vec4 project(vec3 p) {
return projection * view * model * vec4(p, 1.0);
}
void main() {
gl_Position = project(position);
//Lighting geometry parameters
vec4 cameraCoordinate = view * vec4(position , 1.0);
cameraCoordinate.xyz /= cameraCoordinate.w;
f_lightDirection = lightPosition - cameraCoordinate.xyz;
f_eyeDirection = eyePosition - cameraCoordinate.xyz;
f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
f_color = color;
f_data = position;
f_uv = uv;
}
`]),a=t([`#extension GL_OES_standard_derivatives : enable
precision highp float;
#define GLSLIFY 1
float beckmannDistribution(float x, float roughness) {
float NdotH = max(x, 0.0001);
float cos2Alpha = NdotH * NdotH;
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
float roughness2 = roughness * roughness;
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
return exp(tan2Alpha / roughness2) / denom;
}
float cookTorranceSpecular(
vec3 lightDirection,
vec3 viewDirection,
vec3 surfaceNormal,
float roughness,
float fresnel) {
float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
//Half angle vector
vec3 H = normalize(lightDirection + viewDirection);
//Geometric term
float NdotH = max(dot(surfaceNormal, H), 0.0);
float VdotH = max(dot(viewDirection, H), 0.000001);
float LdotH = max(dot(lightDirection, H), 0.000001);
float G1 = (2.0 * NdotH * VdotN) / VdotH;
float G2 = (2.0 * NdotH * LdotN) / LdotH;
float G = min(1.0, min(G1, G2));
//Distribution term
float D = beckmannDistribution(NdotH, roughness);
//Fresnel term
float F = pow(1.0 - VdotN, fresnel);
//Multiply terms and done
return G * F * D / max(3.14159265 * VdotN, 0.000001);
}
//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 clipBounds[2];
uniform float roughness
, fresnel
, kambient
, kdiffuse
, kspecular;
uniform sampler2D texture;
varying vec3 f_normal
, f_lightDirection
, f_eyeDirection
, f_data;
varying vec4 f_color;
varying vec2 f_uv;
void main() {
if (f_color.a == 0.0 ||
outOfRange(clipBounds[0], clipBounds[1], f_data)
) discard;
vec3 N = normalize(f_normal);
vec3 L = normalize(f_lightDirection);
vec3 V = normalize(f_eyeDirection);
if(gl_FrontFacing) {
N = -N;
}
float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
//float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
gl_FragColor = litColor * f_color.a;
}
`]),c=t([`precision highp float;
#define GLSLIFY 1
attribute vec3 position;
attribute vec4 color;
attribute vec2 uv;
uniform mat4 model, view, projection;
varying vec4 f_color;
varying vec3 f_data;
varying vec2 f_uv;
void main() {
gl_Position = projection * view * model * vec4(position, 1.0);
f_color = color;
f_data = position;
f_uv = uv;
}`]),u=t([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 clipBounds[2];
uniform sampler2D texture;
uniform float opacity;
varying vec4 f_color;
varying vec3 f_data;
varying vec2 f_uv;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;
gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;
}`]),l=t([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
attribute vec3 position;
attribute vec4 color;
attribute vec2 uv;
attribute float pointSize;
uniform mat4 model, view, projection;
uniform vec3 clipBounds[2];
varying vec4 f_color;
varying vec2 f_uv;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);
} else {
gl_Position = projection * view * model * vec4(position, 1.0);
}
gl_PointSize = pointSize;
f_color = color;
f_uv = uv;
}`]),y=t([`precision highp float;
#define GLSLIFY 1
uniform sampler2D texture;
uniform float opacity;
varying vec4 f_color;
varying vec2 f_uv;
void main() {
vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);
if(dot(pointR, pointR) > 0.25) {
discard;
}
gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;
}`]),h=t([`precision highp float;
#define GLSLIFY 1
attribute vec3 position;
attribute vec4 id;
uniform mat4 model, view, projection;
varying vec3 f_position;
varying vec4 f_id;
void main() {
gl_Position = projection * view * model * vec4(position, 1.0);
f_id = id;
f_position = position;
}`]),T=t([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 clipBounds[2];
uniform float pickId;
varying vec3 f_position;
varying vec4 f_id;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
gl_FragColor = vec4(pickId, f_id.xyz);
}`]),f=t([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
attribute vec3 position;
attribute float pointSize;
attribute vec4 id;
uniform mat4 model, view, projection;
uniform vec3 clipBounds[2];
varying vec3 f_position;
varying vec4 f_id;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
gl_Position = vec4(0.0, 0.0, 0.0, 0.0);
} else {
gl_Position = projection * view * model * vec4(position, 1.0);
gl_PointSize = pointSize;
}
f_id = id;
f_position = position;
}`]),n=t([`precision highp float;
#define GLSLIFY 1
attribute vec3 position;
uniform mat4 model, view, projection;
void main() {
gl_Position = projection * view * model * vec4(position, 1.0);
}`]),v=t([`precision highp float;
#define GLSLIFY 1
uniform vec3 contourColor;
void main() {
gl_FragColor = vec4(contourColor, 1.0);
}
`]);g.meshShader={vertex:s,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},g.wireShader={vertex:c,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},g.pointShader={vertex:l,fragment:y,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},g.pickShader={vertex:h,fragment:T,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},g.pointPickShader={vertex:f,fragment:T,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},g.contourShader={vertex:n,fragment:v,attributes:[{name:"position",type:"vec3"}]}},8116:function(d,g,r){var t=1e-6,s=1e-6,a=r(5158),c=r(5827),u=r(2944),l=r(8931),y=r(115),h=r(104),T=r(7437),f=r(5050),n=r(9156),v=r(7212),m=r(5306),b=r(2056),E=r(4340),p=b.meshShader,S=b.wireShader,w=b.pointShader,i=b.pickShader,C=b.pointPickShader,x=b.contourShader,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function I(Z,G,re,H,J,ae,K,Y,ie,ne,le,de,we,me,Le,ve,Ae,ye,Se,_e,ze,Ie,Ne,et,st,Ze,Ke){this.gl=Z,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=G,this.dirty=!0,this.triShader=re,this.lineShader=H,this.pointShader=J,this.pickShader=ae,this.pointPickShader=K,this.contourShader=Y,this.trianglePositions=ie,this.triangleColors=le,this.triangleNormals=we,this.triangleUVs=de,this.triangleIds=ne,this.triangleVAO=me,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Le,this.edgeColors=Ae,this.edgeUVs=ye,this.edgeIds=ve,this.edgeVAO=Se,this.edgeCount=0,this.pointPositions=_e,this.pointColors=Ie,this.pointUVs=Ne,this.pointSizes=et,this.pointIds=ze,this.pointVAO=st,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=Ze,this.contourVAO=Ke,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=k,this._view=k,this._projection=k,this._resolution=[1,1]}var B=I.prototype;B.isOpaque=function(){return!this.hasAlpha},B.isTransparent=function(){return this.hasAlpha},B.pickSlots=1,B.setPickBase=function(Z){this.pickId=Z};function _(Z,G){if(!G||!G.length)return 1;for(var re=0;re<G.length;++re){if(G.length<2)return 1;if(G[re][0]===Z)return G[re][1];if(G[re][0]>Z&&re>0){var H=(G[re][0]-Z)/(G[re][0]-G[re-1][0]);return G[re][1]*(1-H)+H*G[re-1][1]}}return 1}function z(Z,G){for(var re=n({colormap:Z,nshades:256,format:"rgba"}),H=new Uint8Array(256*4),J=0;J<256;++J){for(var ae=re[J],K=0;K<3;++K)H[4*J+K]=ae[K];G?H[4*J+3]=255*_(J/255,G):H[4*J+3]=255*ae[3]}return f(H,[256,256,4],[4,0,1])}function O(Z){for(var G=Z.length,re=new Array(G),H=0;H<G;++H)re[H]=Z[H][2];return re}B.highlight=function(Z){if(!Z||!this.contourEnable){this.contourCount=0;return}for(var G=v(this.cells,this.intensity,Z.intensity),re=G.cells,H=G.vertexIds,J=G.vertexWeights,ae=re.length,K=m.mallocFloat32(2*3*ae),Y=0,ie=0;ie<ae;++ie)for(var ne=re[ie],le=0;le<2;++le){var de=ne[0];ne.length===2&&(de=ne[le]);for(var we=H[de][0],me=H[de][1],Le=J[de],ve=1-Le,Ae=this.positions[we],ye=this.positions[me],Se=0;Se<3;++Se)K[Y++]=Le*Ae[Se]+ve*ye[Se]}this.contourCount=Y/3|0,this.contourPositions.update(K.subarray(0,Y)),m.free(K)},B.update=function(Z){Z=Z||{};var G=this.gl;this.dirty=!0,"contourEnable"in Z&&(this.contourEnable=Z.contourEnable),"contourColor"in Z&&(this.contourColor=Z.contourColor),"lineWidth"in Z&&(this.lineWidth=Z.lineWidth),"lightPosition"in Z&&(this.lightPosition=Z.lightPosition),this.hasAlpha=!1,"opacity"in Z&&(this.opacity=Z.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in Z&&(this.opacityscale=Z.opacityscale,this.hasAlpha=!0),"ambient"in Z&&(this.ambientLight=Z.ambient),"diffuse"in Z&&(this.diffuseLight=Z.diffuse),"specular"in Z&&(th
#define GLSLIFY 1
uniform vec4 color;
void main() {
gl_FragColor = vec4(color.xyz * color.w, color.w);
}
`]);d.exports={lineVert:t([`precision mediump float;
#define GLSLIFY 1
attribute vec2 coord;
uniform vec4 screenBox;
uniform vec2 start, end;
uniform float width;
vec2 perp(vec2 v) {
return vec2(v.y, -v.x);
}
vec2 screen(vec2 v) {
return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;
}
void main() {
vec2 delta = normalize(perp(start - end));
vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));
gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);
}
`]),lineFrag:s,textVert:t([`#define GLSLIFY 1
attribute vec3 textCoordinate;
uniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;
uniform float angle;
void main() {
float dataOffset = textCoordinate.z;
vec2 glyphOffset = textCoordinate.xy;
mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));
vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +
glyphMatrix * glyphOffset * textScale + screenOffset;
gl_Position = vec4(screenCoordinate, 0, 1);
}
`]),textFrag:s,gridVert:t([`precision mediump float;
#define GLSLIFY 1
attribute vec3 dataCoord;
uniform vec2 dataAxis, dataShift, dataScale;
uniform float lineWidth;
void main() {
vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);
pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;
gl_Position = vec4(pos, 0, 1);
}
`]),gridFrag:s,boxVert:t([`precision mediump float;
#define GLSLIFY 1
attribute vec2 coord;
uniform vec4 screenBox;
uniform vec2 lo, hi;
vec2 screen(vec2 v) {
return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;
}
void main() {
gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);
}
`]),tickVert:t([`precision mediump float;
#define GLSLIFY 1
attribute vec3 dataCoord;
uniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;
void main() {
vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);
gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);
}
`])}},5613:function(d,g,r){d.exports=h;var t=r(5827),s=r(5158),a=r(6946),c=r(5070),u=r(2709);function l(T,f,n){this.plot=T,this.vbo=f,this.shader=n,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}var y=l.prototype;y.drawTicks=function(){var T=[0,0],f=[0,0],n=[0,0];return function(v){var m=this.plot,b=this.shader,E=this.tickX[v],p=this.tickOffset[v],S=m.gl,w=m.viewBox,i=m.dataBox,C=m.screenBox,x=m.pixelRatio,k=m.tickEnable,I=m.tickPad,B=m.tickColor,_=m.tickAngle,z=m.labelEnable,O=m.labelPad,F=m.labelColor,N=m.labelAngle,V=this.labelOffset[v],j=this.labelCount[v],$=c.lt(E,i[v]),q=c.le(E,i[v+2]);T[0]=T[1]=0,T[v]=1,f[v]=(w[2+v]+w[v])/(C[2+v]-C[v])-1;var oe=2/C[2+(v^1)]-C[v^1];f[v^1]=oe*w[v^1]-1,k[v]&&(f[v^1]-=oe*x*I[v],$<q&&p[q]>p[$]&&(b.uniforms.dataAxis=T,b.uniforms.screenOffset=f,b.uniforms.color=B[v],b.uniforms.angle=_[v],S.drawArrays(S.TRIANGLES,p[$],p[q]-p[$]))),z[v]&&j&&(f[v^1]-=oe*x*O[v],b.uniforms.dataAxis=n,b.uniforms.screenOffset=f,b.uniforms.color=F[v],b.uniforms.angle=N[v],S.drawArrays(S.TRIANGLES,V,j)),f[v^1]=oe*w[2+(v^1)]-1,k[v+2]&&(f[v^1]+=oe*x*I[v+2],$<q&&p[q]>p[$]&&(b.uniforms.dataAxis=T,b.uniforms.screenOffset=f,b.uniforms.color=B[v+2],b.uniforms.angle=_[v+2],S.drawArrays(S.TRIANGLES,p[$],p[q]-p[$]))),z[v+2]&&j&&(f[v^1]+=oe*x*O[v+2],b.uniforms.dataAxis=n,b.uniforms.screenOffset=f,b.uniforms.color=F[v+2],b.uniforms.angle=N[v+2],S.drawArrays(S.TRIANGLES,V,j))}}(),y.drawTitle=function(){var T=[0,0],f=[0,0];return function(){var n=this.plot,v=this.shader,m=n.gl,b=n.screenBox,E=n.titleCenter,p=n.titleAngle,S=n.titleColor,w=n.pixelRatio;if(this.titleCount){for(var i=0;i<2;++i)f[i]=2*(E[i]*w-b[i])/(b[2+i]-b[i])-1;v.bind(),v.uniforms.dataAxis=T,v.uniforms.screenOffset=f,v.uniforms.angle=p,v.uniforms.color=S,m.drawArrays(m.TRIANGLES,this.titleOffset,this.titleCount)}}}(),y.bind=function(){var T=[0,0],f=[0,0],n=[0,0];return function(){var v=this.plot,m=this.shader,b=v._tickBounds,E=v.dataBox,p=v.screenBox,S=v.viewBox;m.bind();for(var w=0;w<2;++w){var i=b[w],C=b[w+2],x=C-i,k=.5*(E[w+2]+E[w]),I=E[w+2]-E[w],B=S[w],_=S[w+2],z=_-B,O=p[w],F=p[w+2],N=F-O;f[w]=2*x/I*z/N,T[w]=2*(i-k)/I*z/N}n[1]=2*v.pixelRatio/(p[3]-p[1]),n[0]=n[1]*(p[3]-p[1])/(p[2]-p[0]),m.uniforms.dataScale=f,m.uniforms.dataShift=T,m.uniforms.textScale=n,this.vbo.bind(),m.attributes.textCoordinate.pointer()}}(),y.update=function(T){var f=[],n=T.ticks,v=T.bounds,m,b,E,p,S;for(S=0;S<2;++S){var w=[Math.floor(f.length/3)],i=[-1/0],C=n[S];for(m=0;m<C.length;++m){var x=C[m],k=x.x,I=x.text,B=x.font||"sans-serif";p=x.fontSize||12;for(var _=1/(v[S+2]-v[S]),z=v[S],O=I.split(`
`),F=0;F<O.length;F++)for(E=a(B,O[F]).data,b=0;b<E.length;b+=2)f.push(E[b]*p,-E[b+1]*p-F*p*1.2,(k-z)*_);w.push(Math.floor(f.length/3)),i.push(k)}this.tickOffset[S]=w,this.tickX[S]=i}for(S=0;S<2;++S){for(this.labelOffset[S]=Math.floor(f.length/3),E=a(T.labelFont[S],T.labels[S],{textAlign:"center"}).data,p=T.labelSize[S],m=0;m<E.length;m+=2)f.push(E[m]*p,-E[m+1]*p,0);this.labelCount[S]=Math.floor(f.length/3)-this.labelOffset[S]}for(this.titleOffset=Math.floor(f.length/3),E=a(T.titleFont,T.title).data,p=T.titleSize,m=0;m<E.length;m+=2)f.push(E[m]*p,-E[m+1]*p,0);this.titleCount=Math.floor(f.length/3)-this.titleOffset,this.vbo.update(f)},y.dispose=function(){this.vbo.dispose(),this.shader.dispose()};function h(T){var f=T.gl,n=t(f),v=s(f,u.textVert,u.textFrag),m=new l(T,n,v);return m}},2117:function(d,g,r){d.exports=f;var t=r(2611),s=r(3016),a=r(5613),c=r(1154),u=r(4554);function l(n,v){this.gl=n,this.pickBuffer=v,this.screenBox=[0,0,n.drawingBufferWidth,n.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-1/0,-1/0],this.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}var y=l.prototype;y.setDirty=function(){this.dirty=this.pickDirty=!0},y.setOverlayDirty=function(){this.dirty=!0},y.nextDepthValue=function(){return this._depthCounter++/65536},y.draw=function(){return function(){var n=this.gl,v=this.screenBox,m=this.viewBox,b=this.dataBox,E=this.pixelRatio,p=this.grid,S=this.line,w=this.text,i=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),!!this.dirty){if(this.dirty=!1,n.bindFramebuffer(n.FRAMEBUFFER,null),n.enable(n.SCISSOR_TEST),n.disable(n.DEPTH_TEST),n.depthFunc(n.LESS),n.depthMask(!1),n.enable(n.BLEND),n.blendEquation(n.FUNC_ADD,n.FUNC_ADD),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),this.borderColor){n.scissor(v[0],v[1],v[2]-v[0],v[3]-v[1]);var C=this.borderColor;n.clearColor(C[0]*C[3],C[1]*C[3],C[2]*C[3],C[3]),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)}n.scissor(m[0],m[1],m[2]-m[0],m[3]-m[1]),n.viewport(m[0],m[1],m[2]-m[0],m[3]-m[1]);var x=this.backgroundColor;n.clearColor(x[0]*x[3],x[1]*x[3],x[2]*x[3],x[3]),n.clear(n.COLOR_BUFFER_BIT),p.draw();var k=this.zeroLineEnable,I=this.zeroLineColor,B=this.zeroLineWidth;if(k[0]||k[1]){S.bind();for(var _=0;_<2;++_)if(!(!k[_]||!(b[_]<=0&&b[_+2]>=0))){var z=v[_]-b[_]*(v[_+2]-v[_])/(b[_+2]-b[_]);_===0?S.drawLine(z,v[1],z,v[3],B[_],I[_]):S.drawLine(v[0],z,v[2],z,B[_],I[_])}}for(var _=0;_<i.length;++_)i[_].draw();n.viewport(v[0],v[1],v[2]-v[0],v[3]-v[1]),n.scissor(v[0],v[1],v[2]-v[0],v[3]-v[1]),this.grid.drawTickMarks(),S.bind();var O=this.borderLineEnable,F=this.borderLineWidth,N=this.borderLineColor;O[1]&&S.drawLine(m[0],m[1]-.5*F[1]*E,m[0],m[3]+.5*F[3]*E,F[1],N[1]),O[0]&&S.drawLine(m[0]-.5*F[0]*E,m[1],m[2]+.5*F[2]*E,m[1],F[0],N[0]),O[3]&&S.drawLine(m[2],m[1]-.5*F[1]*E,m[2],m[3]+.5*F[3]*E,F[3],N[3]),O[2]&&S.draw
#define GLSLIFY 1
attribute vec2 position;
varying vec2 uv;
void main() {
uv = position;
gl_Position = vec4(position, 0, 1);
}`]),c=t([`precision mediump float;
#define GLSLIFY 1
uniform sampler2D accumBuffer;
varying vec2 uv;
void main() {
vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));
gl_FragColor = min(vec4(1,1,1,1), accum);
}`]);d.exports=function(u){return s(u,a,c,null,[{name:"position",type:"vec2"}])}},1059:function(d,g,r){var t=r(4296),s=r(7453),a=r(2771),c=r(6496),u=r(2611),l=r(4234),y=r(8126),h=r(6145),T=r(1120),f=r(5268),n=r(8245),v=r(2321)({tablet:!0,featureDetect:!0});d.exports={createScene:S,createCamera:t};function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function b(i,C){var x=null;try{x=i.getContext("webgl",C),x||(x=i.getContext("experimental-webgl",C))}catch{return null}return x}function E(i){var C=Math.round(Math.log(Math.abs(i))/Math.log(10));if(C<0){var x=Math.round(Math.pow(10,-C));return Math.ceil(i*x)/x}else if(C>0){var x=Math.round(Math.pow(10,C));return Math.ceil(i/x)*x}return Math.ceil(i)}function p(i){return typeof i=="boolean"?i:!0}function S(i){i=i||{},i.camera=i.camera||{};var C=i.canvas;if(!C)if(C=document.createElement("canvas"),i.container){var x=i.container;x.appendChild(C)}else document.body.appendChild(C);var k=i.gl;if(k||(i.glOptions&&(v=!!i.glOptions.preserveDrawingBuffer),k=b(C,i.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:v})),!k)throw new Error("webgl not supported");var I=i.bounds||[[-10,-10,-10],[10,10,10]],B=new m,_=l(k,k.drawingBufferWidth,k.drawingBufferHeight,{preferFloat:!v}),z=n(k),O=i.cameraObject&&i.cameraObject._ortho===!0||i.camera.projection&&i.camera.projection.type==="orthographic"||!1,F={eye:i.camera.eye||[2,0,0],center:i.camera.center||[0,0,0],up:i.camera.up||[0,1,0],zoomMin:i.camera.zoomMax||.1,zoomMax:i.camera.zoomMin||100,mode:i.camera.mode||"turntable",_ortho:O},N=i.axes||{},V=s(k,N);V.enable=!N.disable;var j=i.spikes||{},$=c(k,j),q=[],oe=[],Z=[],G=[],re=!0,K=!0,H=new Array(16),J=new Array(16),ae={view:null,projection:H,model:J,_ortho:!1},K=!0,Y=[k.drawingBufferWidth,k.drawingBufferHeight],ie=i.cameraObject||t(C,F),ne={gl:k,contextLost:!1,pixelRatio:i.pixelRatio||1,canvas:C,selection:B,camera:ie,axes:V,axesPixels:null,spikes:$,bounds:I,objects:q,shape:Y,aspect:i.aspectRatio||[1,1,1],pickRadius:i.pickRadius||10,zNear:i.zNear||.01,zFar:i.zFar||1e3,fovy:i.fovy||Math.PI/4,clearColor:i.clearColor||[0,0,0,0],autoResize:p(i.autoResize),autoBounds:p(i.autoBounds),autoScale:!!i.autoScale,autoCenter:p(i.autoCenter),clipToBounds:p(i.clipToBounds),snapToData:!!i.snapToData,onselect:i.onselect||null,onrender:i.onrender||null,onclick:i.onclick||null,cameraParams:ae,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(_e){this.aspect[0]=_e.x,this.aspect[1]=_e.y,this.aspect[2]=_e.z,K=!0},setBounds:function(_e,ze){this.bounds[0][_e]=ze.min,this.bounds[1][_e]=ze.max},setClearColor:function(_e){this.clearColor=_e},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},le=[k.drawingBufferWidth/ne.pixelRatio|0,k.drawingBufferHeight/ne.pixelRatio|0];function de(){if(!ne._stopped&&ne.autoResize){var _e=C.parentNode,ze=1,Ie=1;_e&&_e!==document.body?(ze=_e.clientWidth,Ie=_e.clientHeight):(ze=window.innerWidth,Ie=window.innerHeight);var Ne=Math.ceil(ze*ne.pixelRatio)|0,et=Math.ceil(Ie*ne.pixelRatio)|0;if(Ne!==C.width||et!==C.height){C.width=Ne,C.height=et;var st=C.style;st.position=st.position||"absolute",st.left="0px",st.top="0px",st.width=ze+"px",st.height=Ie+"px",re=!0}}}ne.autoResize&&de(),window.addEventListener("resize",de);function we(){for(var _e=q.length,ze=G.length,Ie=0;Ie<ze;++Ie)Z[Ie]=0;e:for(var Ie=0;Ie<_e;++Ie){var Ne=q[Ie],et=Ne.pickSlots;if(!et){oe[Ie]=-1;continue}for(var st=0;st<ze;++st)if(Z[st]+et<255){oe[Ie]=st,Ne.setPickBase(Z[st]+1),Z[st]+=et;continue e}var Ze=u(k,Y);oe[Ie]=ze,G.push(Ze),Z.push(et),Ne.setPickBase(1),ze+=1}for(;ze>0&&Z[ze-1]===0;)Z.pop(),G.pop().dispose()}ne.update=function(_e){ne._stopped||(re=!0,K=!0)},ne.add=function(_e){ne._stopped||(_e.axes=V,q.push(_e),oe.push(-1),re=!0,K=!0,we())},ne.remove=function
#define GLSLIFY 1
attribute vec2 position;
uniform mat3 matrix;
uniform float pointSize;
uniform float pointCloud;
highp float rand(vec2 co) {
highp float a = 12.9898;
highp float b = 78.233;
highp float c = 43758.5453;
highp float d = dot(co.xy, vec2(a, b));
highp float e = mod(d, 3.14);
return fract(sin(e) * c);
}
void main() {
vec3 hgPosition = matrix * vec3(position, 1);
gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);
// if we don't jitter the point size a bit, overall point cloud
// saturation 'jumps' on zooming, which is disturbing and confusing
gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);
if(pointCloud != 0.0) { // pointCloud is truthy
// get the same square surface as circle would be
gl_PointSize *= 0.886;
}
}`]),g.pointFragment=t([`precision mediump float;
#define GLSLIFY 1
uniform vec4 color, borderColor;
uniform float centerFraction;
uniform float pointCloud;
void main() {
float radius;
vec4 baseColor;
if(pointCloud != 0.0) { // pointCloud is truthy
if(centerFraction == 1.0) {
gl_FragColor = color;
} else {
gl_FragColor = mix(borderColor, color, centerFraction);
}
} else {
radius = length(2.0 * gl_PointCoord.xy - 1.0);
if(radius > 1.0) {
discard;
}
baseColor = mix(borderColor, color, step(radius, centerFraction));
gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);
}
}
`]),g.pickVertex=t([`precision mediump float;
#define GLSLIFY 1
attribute vec2 position;
attribute vec4 pickId;
uniform mat3 matrix;
uniform float pointSize;
uniform vec4 pickOffset;
varying vec4 fragId;
void main() {
vec3 hgPosition = matrix * vec3(position, 1);
gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);
gl_PointSize = pointSize;
vec4 id = pickId + pickOffset;
id.y += floor(id.x / 256.0);
id.x -= floor(id.x / 256.0) * 256.0;
id.z += floor(id.y / 256.0);
id.y -= floor(id.y / 256.0) * 256.0;
id.w += floor(id.z / 256.0);
id.z -= floor(id.z / 256.0) * 256.0;
fragId = id;
}
`]),g.pickFragment=t([`precision mediump float;
#define GLSLIFY 1
varying vec4 fragId;
void main() {
float radius = length(2.0 * gl_PointCoord.xy - 1.0);
if(radius > 1.0) {
discard;
}
gl_FragColor = fragId / 255.0;
}
`])},8271:function(d,g,r){var t=r(5158),s=r(5827),a=r(5306),c=r(8023);d.exports=h;function u(T,f,n,v,m){this.plot=T,this.offsetBuffer=f,this.pickBuffer=n,this.shader=v,this.pickShader=m,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}var l=u.prototype;l.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},l.update=function(T){var f;T=T||{};function n(w,i){return w in T?T[w]:i}this.sizeMin=n("sizeMin",.5),this.sizeMax=n("sizeMax",20),this.color=n("color",[1,0,0,1]).slice(),this.areaRatio=n("areaRatio",1),this.borderColor=n("borderColor",[0,0,0,1]).slice(),this.blend=n("blend",!1);var v=T.positions.length>>>1,m=T.positions instanceof Float32Array,b=T.idToIndex instanceof Int32Array&&T.idToIndex.length>=v,E=T.positions,p=m?E:a.mallocFloat32(E.length),S=b?T.idToIndex:a.mallocInt32(v);if(m||p.set(E),!b)for(p.set(E),f=0;f<v;f++)S[f]=f;this.points=E,this.offsetBuffer.update(p),this.pickBuffer.update(S),m||a.free(p),b||a.free(S),this.pointCount=v,this.pickOffset=0};function y(T,f){var n=0,v=T.length>>>1,m;for(m=0;m<v;m++){var b=T[m*2],E=T[m*2+1];b>=f[0]&&b<=f[2]&&E>=f[1]&&E<=f[3]&&n++}return n}l.unifiedDraw=function(){var T=[1,0,0,0,1,0,0,0,1],f=[0,0,0,0];return function(n){var v=n!==void 0,m=v?this.pickShader:this.shader,b=this.plot.gl,E=this.plot.dataBox;if(this.pointCount===0)return n;var p=E[2]-E[0],S=E[3]-E[1],w=y(this.points,E),i=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(w,.33333)));T[0]=2/p,T[4]=2/S,T[6]=-2*E[0]/p-1,T[7]=-2*E[1]/S-1,this.offsetBuffer.bind(),m.bind(),m.attributes.position.pointer(),m.uniforms.matrix=T,m.uniforms.color=this.color,m.uniforms.borderColor=this.borderColor,m.uniforms.pointCloud=i<5,m.uniforms.pointSize=i,m.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),v&&(f[0]=n&255,f[1]=n>>8&255,f[2]=n>>16&255,f[3]=n>>24&255,this.pickBuffer.bind(),m.attributes.pickId.pointer(b.UNSIGNED_BYTE),m.uniforms.pickOffset=f,this.pickOffset=n);var C=b.getParameter(b.BLEND),x=b.getParameter(b.DITHER);return C&&!this.blend&&b.disable(b.BLEND),x&&b.disable(b.DITHER),b.drawArrays(b.POINTS,0,this.pointCount),C&&!this.blend&&b.enable(b.BLEND),x&&b.enable(b.DITHER),n+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.pick=function(T,f,n){var v=this.pickOffset,m=this.pointCount;if(n<v||n>=v+m)return null;var b=n-v,E=this.points;return{object:this,pointId:b,dataCoord:[E[2*b],E[2*b+1]]}};function h(T,f){var n=T.gl,v=s(n),m=s(n),b=t(n,c.pointVertex,c.pointFragment),E=t(n,c.pickVertex,c.pickFragment),p=new u(T,v,m,b,E);return p.update(f),T.addObject(p),p}},6093:function(d){d.exports=g;function g(r,t,s,a){var c=t[0],u=t[1],l=t[2],y=t[3],h=s[0],T=s[1],f=s[2],n=s[3],v,m,b,E,p;return m=c*h+u*T+l*f+y*n,m<0&&(m=-m,h=-h,T=-T,f=-f,n=-n),1-m>1e-6?(v=Math.acos(m),b=Math.sin(v),E=Math.sin((1-a)*v)/b,p=Math.sin(a*v)/b):(E=1-a,p=a),r[0]=E*c+p*h,r[1]=E*u+p*T,r[2]=E*l+p*f,r[3]=E*y+p*n,r}},8240:function(d){d.exports=function(g){return!g&&g!==0?"":g.toString()}},4123:function(d,g,r){var t=r(875);d.exports=a;var s={};function a(c,u,l){var y=s[u];if(y||(y=s[u]={}),c in y)return y[c];var h={textAlign:"center",textBaseline:"middle",lineHeight:1,font:u,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};h.triangles=!0;var T=t(c,h);h.triangles=!1;var f=t(c,h),n,v;if(l&&l!==1){for(n=0;n<T.positions.length;++n)for(v=0;v<T.positions[n].length;++v)T.positions[n][v]/=l;for(n=0;n<f.positions.length;++n)for(v=0;v<f.positions[n].length;++v)f.positions[n][v]/=l}var m=[[1/0,1/0],[-1/0,-1/0]],b=f.positions.length;for(n=0;n<b;++n){var E=f.positions[n];for(v=0;v<2;++v)m[0][v]=Math.min(m[0][v],E[v]),m[1][v]=Math.max(m[1][v],E[v])}return y[c]=[T,f,m]}},9282:function(d,g,r){var t=r(5158),s=r(6832),a=s([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
attribute vec3 position;
attribute vec4 color;
attribute vec2 glyph;
attribute vec4 id;
uniform vec4 highlightId;
uniform float highlightScale;
uniform mat4 model, view, projection;
uniform vec3 clipBounds[2];
varying vec4 interpColor;
varying vec4 pickId;
varying vec3 dataCoordinate;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
gl_Position = vec4(0,0,0,0);
} else {
float scale = 1.0;
if(distance(highlightId, id) < 0.0001) {
scale = highlightScale;
}
vec4 worldPosition = model * vec4(position, 1);
vec4 viewPosition = view * worldPosition;
viewPosition = viewPosition / viewPosition.w;
vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));
gl_Position = clipPosition;
interpColor = color;
pickId = id;
dataCoordinate = position;
}
}`]),c=s([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
attribute vec3 position;
attribute vec4 color;
attribute vec2 glyph;
attribute vec4 id;
uniform mat4 model, view, projection;
uniform vec2 screenSize;
uniform vec3 clipBounds[2];
uniform float highlightScale, pixelRatio;
uniform vec4 highlightId;
varying vec4 interpColor;
varying vec4 pickId;
varying vec3 dataCoordinate;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
gl_Position = vec4(0,0,0,0);
} else {
float scale = pixelRatio;
if(distance(highlightId.bgr, id.bgr) < 0.001) {
scale *= highlightScale;
}
vec4 worldPosition = model * vec4(position, 1.0);
vec4 viewPosition = view * worldPosition;
vec4 clipPosition = projection * viewPosition;
clipPosition /= clipPosition.w;
gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);
interpColor = color;
pickId = id;
dataCoordinate = position;
}
}`]),u=s([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
attribute vec3 position;
attribute vec4 color;
attribute vec2 glyph;
attribute vec4 id;
uniform float highlightScale;
uniform vec4 highlightId;
uniform vec3 axes[2];
uniform mat4 model, view, projection;
uniform vec2 screenSize;
uniform vec3 clipBounds[2];
uniform float scale, pixelRatio;
varying vec4 interpColor;
varying vec4 pickId;
varying vec3 dataCoordinate;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
gl_Position = vec4(0,0,0,0);
} else {
float lscale = pixelRatio * scale;
if(distance(highlightId, id) < 0.0001) {
lscale *= highlightScale;
}
vec4 clipCenter = projection * view * model * vec4(position, 1);
vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;
vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);
gl_Position = clipPosition;
interpColor = color;
pickId = id;
dataCoordinate = dataPosition;
}
}
`]),l=s([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 fragClipBounds[2];
uniform float opacity;
varying vec4 interpColor;
varying vec3 dataCoordinate;
void main() {
if (
outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||
interpColor.a * opacity == 0.
) discard;
gl_FragColor = interpColor * opacity;
}
`]),y=s([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 fragClipBounds[2];
uniform float pickGroup;
varying vec4 pickId;
varying vec3 dataCoordinate;
void main() {
if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;
gl_FragColor = vec4(pickGroup, pickId.bgr);
}`]),h=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],T={vertex:a,fragment:l,attributes:h},f={vertex:c,fragment:l,attributes:h},n={vertex:u,fragment:l,attributes:h},v={vertex:a,fragment:y,attributes:h},m={vertex:c,fragment:y,attributes:h},b={vertex:u,fragment:y,attributes:h};function E(p,S){var w=t(p,S),i=w.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,w}g.createPerspective=function(p){return E(p,T)},g.createOrtho=function(p){return E(p,f)},g.createProject=function(p){return E(p,n)},g.createPickPerspective=function(p){return E(p,v)},g.createPickOrtho=function(p){return E(p,m)},g.createPickProject=function(p){return E(p,b)}},2182:function(d,g,r){var t=r(3596),s=r(5827),a=r(2944),c=r(5306),u=r(104),l=r(9282),y=r(4123),h=r(8240),T=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];d.exports=oe;function f(Z,G){var re=Z[0],H=Z[1],J=Z[2],ae=Z[3];return Z[0]=G[0]*re+G[4]*H+G[8]*J+G[12]*ae,Z[1]=G[1]*re+G[5]*H+G[9]*J+G[13]*ae,Z[2]=G[2]*re+G[6]*H+G[10]*J+G[14]*ae,Z[3]=G[3]*re+G[7]*H+G[11]*J+G[15]*ae,Z}function n(Z,G,re,H){return f(H,H),f(H,H),f(H,H)}function v(Z,G){this.index=Z,this.dataCoordinate=this.position=G}function m(Z){return Z===!0||Z>1?1:Z}function b(Z,G,re,H,J,ae,K,Y,ie,ne,le,de){this.gl=Z,this.pixelRatio=1,this.shader=G,this.orthoShader=re,this.projectShader=H,this.pointBuffer=J,this.colorBuffer=ae,this.glyphBuffer=K,this.idBuffer=Y,this.vao=ie,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=ne,this.pickOrthoShader=le,this.pickProjectShader=de,this.points=[],this._selectResult=new v(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var E=b.prototype;E.pickSlots=1,E.setPickBase=function(Z){this.pickId=Z},E.isTransparent=function(){if(this.hasAlpha)return!0;for(var Z=0;Z<3;++Z)if(this.axesProject[Z]&&this.projectHasAlpha)return!0;return!1},E.isOpaque=function(){if(!this.hasAlpha)return!0;for(var Z=0;Z<3;++Z)if(this.axesProject[Z]&&!this.projectHasAlpha)return!0;return!1};var p=[0,0],S=[0,0,0],w=[0,0,0],i=[0,0,0,1],C=[0,0,0,1],x=T.slice(),k=[0,0,0],I=[[0,0,0],[0,0,0]];function B(Z){return Z[0]=Z[1]=Z[2]=0,Z}function _(Z,G){return Z[0]=G[0],Z[1]=G[1],Z[2]=G[2],Z[3]=1,Z}function z(Z,G,re,H){return Z[0]=G[0],Z[1]=G[1],Z[2]=G[2],Z[re]=H,Z}function O(Z){for(var G=I,re=0;re<2;++re)for(var H=0;H<3;++H)G[re][H]=Math.max(Math.min(Z[re][H],1e8),-1e8);return G}function F(Z,G,re,H){var J=G.axesProject,ae=G.gl,K=Z.uniforms,Y=re.model||T,ie=re.view||T,ne=re.projection||T,le=G.axesBounds,de=O(G.clipBounds),we;G.axes&&G.axes.lastCubeProps?we=G.axes.lastCubeProps.axis:we=[1,1,1],p[0]=2/ae.drawingBufferWidth,p[1]=2/ae.drawingBufferHeight,Z.bind(),K.view=ie,K.projection=ne,K.screenSize=p,K.highlightId=G.highlightId,K.highlightScale=G.highlightScale,K.clipBounds=de,K.pickGroup=G.pickId/255,K.pixelRatio=H;for(var me=0;me<3;++me)if(J[me]){K.scale=G.projectScale[me],K.opacity=G.projectOpacity[me];for(var Le=x,ve=0;ve<16;++ve)Le[ve]=0;for(var ve=0;ve<4;++ve)Le[5*ve]=1;Le[5*me]=0,we[me]<0?Le[12+me]=le[0][me]:Le[12+me]=le[1][me],u(Le,Y,Le),K.model=Le;var Ae=(me+1)%3,ye=(me+2)%3,Se=B(S),_e=B(w);Se[Ae]=1,_e[ye]=1;var ze=n(ne,ie,Y,_(i,Se)),Ie=n(ne,ie,Y,_(C,_e));if(Math.abs(ze[1])>Math.abs(Ie[1])){var Ne=ze;ze=Ie,Ie=Ne,Ne=Se,Se=_e,_e=Ne;var et=Ae;Ae=ye,ye=et}ze[0]<0&&(Se[Ae]=-1),Ie[1]>0&&(_e[ye]=-1);for(var st=0,Ze=0,ve=0;ve<4;++ve)st+=Math.pow(Y[4*Ae+ve],2),Ze+=Math.pow(Y[4*ye+ve],2);Se[Ae]/=Math.sqrt(st),_e[ye]/=Math.sqrt(Ze),K.axes[0]=Se,K.axes[1]=_e,K.fragClipBounds[0]=z(k,de[0],me,-1e8),K.fragClipBounds[1]=z(k,de[1],me,1e8),G.vao.bind(),G.vao.draw(ae.TRIANGLES,G.vertexCount),G.lineWidth>0&&(ae.lineWidth(G.lineWidth*H),G.vao.draw(ae.LINES,G
#define GLSLIFY 1
attribute vec2 vertex;
uniform vec2 cornerA, cornerB;
void main() {
gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);
}
`]),g.boxFragment=t([`precision mediump float;
#define GLSLIFY 1
uniform vec4 color;
void main() {
gl_FragColor = color;
}
`])},6623:function(d,g,r){var t=r(5158),s=r(5827),a=r(1884);d.exports=l;function c(y,h,T){this.plot=y,this.boxBuffer=h,this.boxShader=T,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}var u=c.prototype;u.draw=function(){if(this.enabled){var y=this.plot,h=this.selectBox,T=this.borderWidth;this.innerFill;var f=this.innerColor;this.outerFill;var n=this.outerColor,v=this.borderColor,m=y.box,b=y.screenBox,E=y.dataBox,p=y.viewBox,S=y.pixelRatio,w=(h[0]-E[0])*(p[2]-p[0])/(E[2]-E[0])+p[0],i=(h[1]-E[1])*(p[3]-p[1])/(E[3]-E[1])+p[1],C=(h[2]-E[0])*(p[2]-p[0])/(E[2]-E[0])+p[0],x=(h[3]-E[1])*(p[3]-p[1])/(E[3]-E[1])+p[1];if(w=Math.max(w,p[0]),i=Math.max(i,p[1]),C=Math.min(C,p[2]),x=Math.min(x,p[3]),!(C<w||x<i)){m.bind();var k=b[2]-b[0],I=b[3]-b[1];if(this.outerFill&&(m.drawBox(0,0,k,i,n),m.drawBox(0,i,w,x,n),m.drawBox(0,x,k,I,n),m.drawBox(C,i,k,x,n)),this.innerFill&&m.drawBox(w,i,C,x,f),T>0){var B=T*S;m.drawBox(w-B,i-B,C+B,i+B,v),m.drawBox(w-B,x-B,C+B,x+B,v),m.drawBox(w-B,i-B,w+B,x+B,v),m.drawBox(C-B,i-B,C+B,x+B,v)}}}},u.update=function(y){y=y||{},this.innerFill=!!y.innerFill,this.outerFill=!!y.outerFill,this.innerColor=(y.innerColor||[0,0,0,.5]).slice(),this.outerColor=(y.outerColor||[0,0,0,.5]).slice(),this.borderColor=(y.borderColor||[0,0,0,1]).slice(),this.borderWidth=y.borderWidth||0,this.selectBox=(y.selectBox||this.selectBox).slice()},u.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)};function l(y,h){var T=y.gl,f=s(T,[0,0,0,1,1,0,1,1]),n=t(T,a.boxVertex,a.boxFragment),v=new c(y,f,n);return v.update(h),y.addOverlay(v),v}},2611:function(d,g,r){d.exports=T;var t=r(4234),s=r(5306),a=r(5050),c=r(2288).nextPow2,u=function(f,n,v){for(var m=1e8,b=-1,E=-1,p=f.shape[0],S=f.shape[1],w=0;w<p;w++)for(var i=0;i<S;i++){var C=f.get(w,i,0),x=f.get(w,i,1),k=f.get(w,i,2),I=f.get(w,i,3);if(C<255||x<255||k<255||I<255){var B=n-w,_=v-i,z=B*B+_*_;z<m&&(m=z,b=w,E=i)}}return[b,E,m]};function l(f,n,v,m,b){this.coord=[f,n],this.id=v,this.value=m,this.distance=b}function y(f,n,v){this.gl=f,this.fbo=n,this.buffer=v,this._readTimeout=null;var m=this;this._readCallback=function(){m.gl&&(n.bind(),f.readPixels(0,0,n.shape[0],n.shape[1],f.RGBA,f.UNSIGNED_BYTE,m.buffer),m._readTimeout=null)}}var h=y.prototype;Object.defineProperty(h,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(f){if(this.gl){this.fbo.shape=f;var n=this.fbo.shape[0],v=this.fbo.shape[1];if(v*n*4>this.buffer.length){s.free(this.buffer);for(var m=this.buffer=s.mallocUint8(c(v*n*4)),b=0;b<v*n*4;++b)m[b]=255}return f}}}),h.begin=function(){var f=this.gl;this.shape,f&&(this.fbo.bind(),f.clearColor(1,1,1,1),f.clear(f.COLOR_BUFFER_BIT|f.DEPTH_BUFFER_BIT))},h.end=function(){var f=this.gl;f&&(f.bindFramebuffer(f.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},h.query=function(f,n,v){if(!this.gl)return null;var m=this.fbo.shape.slice();f=f|0,n=n|0,typeof v!="number"&&(v=1);var b=Math.min(Math.max(f-v,0),m[0])|0,E=Math.min(Math.max(f+v,0),m[0])|0,p=Math.min(Math.max(n-v,0),m[1])|0,S=Math.min(Math.max(n+v,0),m[1])|0;if(E<=b||S<=p)return null;var w=[E-b,S-p],i=a(this.buffer,[w[0],w[1],4],[4,m[0]*4,1],4*(b+m[0]*p)),C=u(i.hi(w[0],w[1],1),v,v),x=C[0],k=C[1];if(x<0||Math.pow(this.radius,2)<C[2])return null;var I=i.get(x,k,0),B=i.get(x,k,1),_=i.get(x,k,2),z=i.get(x,k,3);return new l(x+b|0,k+p|0,I,[B,_,z],Math.sqrt(C[2]))},h.dispose=function(){this.gl&&(this.fbo.dispose(),s.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))};function T(f,n){var v=n[0],m=n[1],b={},E=t(f,v,m,b),p=s.mallocUint8(v*m*4);return new y(f,E,p)}},5158:function(d,g,r){var t=r(9016),s=r(4280),a=r(3984),c=r(1628),u=r(2631),l=r(9068);function y(n){this.gl=n,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var h=y.pro
`+s:""),this.stack=new Error().stack}g.prototype=new Error,g.prototype.name="GLError",g.prototype.constructor=g,d.exports=g},4280:function(d,g,r){d.exports=y;var t=r(9068);function s(h,T,f,n,v,m){this._gl=h,this._wrapper=T,this._index=f,this._locations=n,this._dimension=v,this._constFunc=m}var a=s.prototype;a.pointer=function(T,f,n,v){var m=this,b=m._gl,E=m._locations[m._index];b.vertexAttribPointer(E,m._dimension,T||b.FLOAT,!!f,n||0,v||0),b.enableVertexAttribArray(E)},a.set=function(h,T,f,n){return this._constFunc(this._locations[this._index],h,T,f,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(h){return h!==this._locations[this._index]&&(this._locations[this._index]=h|0,this._wrapper.program=null),h|0}});var c=[function(h,T,f){return f.length===void 0?h.vertexAttrib1f(T,f):h.vertexAttrib1fv(T,f)},function(h,T,f,n){return f.length===void 0?h.vertexAttrib2f(T,f,n):h.vertexAttrib2fv(T,f)},function(h,T,f,n,v){return f.length===void 0?h.vertexAttrib3f(T,f,n,v):h.vertexAttrib3fv(T,f)},function(h,T,f,n,v,m){return f.length===void 0?h.vertexAttrib4f(T,f,n,v,m):h.vertexAttrib4fv(T,f)}];function u(h,T,f,n,v,m,b){var E=c[v],p=new s(h,T,f,n,v,E);Object.defineProperty(m,b,{set:function(S){return h.disableVertexAttribArray(n[f]),E(h,n[f],S),S},get:function(){return p},enumerable:!0})}function l(h,T,f,n,v,m,b){for(var E=new Array(v),p=new Array(v),S=0;S<v;++S)u(h,T,f[S],n,v,E,S),p[S]=E[S];Object.defineProperty(E,"location",{set:function(C){if(Array.isArray(C))for(var x=0;x<v;++x)p[x].location=C[x];else for(var x=0;x<v;++x)p[x].location=C+x;return C},get:function(){for(var C=new Array(v),x=0;x<v;++x)C[x]=n[f[x]];return C},enumerable:!0}),E.pointer=function(C,x,k,I){C=C||h.FLOAT,x=!!x,k=k||v*v,I=I||0;for(var B=0;B<v;++B){var _=n[f[B]];h.vertexAttribPointer(_,v,C,x,k,I+B*v),h.enableVertexAttribArray(_)}};var w=new Array(v),i=h["vertexAttrib"+v+"fv"];Object.defineProperty(m,b,{set:function(C){for(var x=0;x<v;++x){var k=n[f[x]];if(h.disableVertexAttribArray(k),Array.isArray(C[0]))i.call(h,k,C[x]);else{for(var I=0;I<v;++I)w[I]=C[v*x+I];i.call(h,k,w)}}return C},get:function(){return E},enumerable:!0})}function y(h,T,f,n){for(var v={},m=0,b=f.length;m<b;++m){var E=f[m],p=E.name,S=E.type,w=E.locations;switch(S){case"bool":case"int":case"float":u(h,T,w[0],n,1,v,p);break;default:if(S.indexOf("vec")>=0){var i=S.charCodeAt(S.length-1)-48;if(i<2||i>4)throw new t("","Invalid data type for attribute "+p+": "+S);u(h,T,w[0],n,i,v,p)}else if(S.indexOf("mat")>=0){var i=S.charCodeAt(S.length-1)-48;if(i<2||i>4)throw new t("","Invalid data type for attribute "+p+": "+S);l(h,T,w,n,i,v,p)}else throw new t("","Unknown data type for attribute "+p+": "+S);break}}return v}},9016:function(d,g,r){var t=r(3984),s=r(9068);d.exports=u;function a(l){return function(){return l}}function c(l,y){for(var h=new Array(l),T=0;T<l;++T)h[T]=y;return h}function u(l,y,h,T){function f(S){return function(w,i,C){return w.getUniform(i.program,C[S])}}function n(S){return function(i){for(var C=v("",S),x=0;x<C.length;++x){var k=C[x],I=k[0],B=k[1];if(T[B]){var _=i;if(typeof I=="string"&&(I.indexOf(".")===0||I.indexOf("[")===0)){var z=I;if(I.indexOf(".")===0&&(z=I.slice(1)),z.indexOf("]")===z.length-1){var O=z.indexOf("["),F=z.slice(0,O),N=z.slice(O+1,z.length-1);_=F?i[F][N]:i[N]}else _=i[z]}var V=h[B].type,j;switch(V){case"bool":case"int":case"sampler2D":case"samplerCube":l.uniform1i(T[B],_);break;case"float":l.uniform1f(T[B],_);break;default:var $=V.indexOf("vec");if(0<=$&&$<=1&&V.length===4+$){if(j=V.charCodeAt(V.length-1)-48,j<2||j>4)throw new s("","Invalid data type");switch(V.charAt(0)){case"b":case"i":l["uniform"+j+"iv"](T[B],_);break;case"v":l["uniform"+j+"fv"](T[B],_);break;default:throw new s("","Unrecognized data type for vector "+name+": "+V)}}else if(V.indexOf("mat")===0&&V.length===4){if(j=V.charCodeAt(V.length-1)-48,j<2||j>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+V);l["uniformMatrix"+j+"fv"](T[B],!1,_);break}else throw new s("","Unknown uniform data type for "+name+": "+V)}}}}}functio
`+w)}throw new t(w,i.short,i.long)}return S}h.getShaderReference=function(b,E){var p=this.gl,S=this.shaders[b===p.FRAGMENT_SHADER|0],w=S[E];if(!w||!p.isShader(w.shader)){var i=T(p,b,E);w=S[E]=new l(u++,E,b,i,[],1,this)}else w.count+=1;return w};function f(b,E,p,S,w){var i=b.createProgram();b.attachShader(i,E),b.attachShader(i,p);for(var C=0;C<S.length;++C)b.bindAttribLocation(i,w[C],S[C]);if(b.linkProgram(i),!b.getProgramParameter(i,b.LINK_STATUS)){var x=b.getProgramInfoLog(i);throw new t(x,"Error linking program: "+x)}return i}h.getProgram=function(b,E,p,S){var w=[b.id,E.id,p.join(":"),S.join(":")].join("@"),i=this.programs[w];return(!i||!this.gl.isProgram(i))&&(this.programs[w]=i=f(this.gl,b.shader,E.shader,p,S),b.programs.push(w),E.programs.push(w)),i};function n(b){var E=c.get(b);return E||(E=new y(b),c.set(b,E)),E}function v(b,E,p){return n(b).getShaderReference(E,p)}function m(b,E,p,S,w){return n(b).getProgram(E,p,S,w)}},3050:function(d){d.exports=t;function g(s){this.plot=s,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}var r=g.prototype;r.update=function(s){s=s||{},this.enable=(s.enable||[!0,!0,!1,!1]).slice(),this.width=(s.width||[1,1,1,1]).slice(),this.color=(s.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(a){return a.slice()}),this.center=(s.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},r.draw=function(){var s=this.enable,a=this.width,c=this.color,u=this.center,l=this.plot,y=l.line,h=l.dataBox,T=l.viewBox;if(y.bind(),h[0]<=u[0]&&u[0]<=h[2]&&h[1]<=u[1]&&u[1]<=h[3]){var f=T[0]+(u[0]-h[0])/(h[2]-h[0])*(T[2]-T[0]),n=T[1]+(u[1]-h[1])/(h[3]-h[1])*(T[3]-T[1]);s[0]&&y.drawLine(f,n,T[0],n,a[0],c[0]),s[1]&&y.drawLine(f,n,f,T[1],a[1],c[1]),s[2]&&y.drawLine(f,n,T[2],n,a[2],c[2]),s[3]&&y.drawLine(f,n,f,T[3],a[3],c[3])}},r.dispose=function(){this.plot.removeOverlay(this)};function t(s,a){var c=new g(s);return c.update(a),s.addOverlay(c),c}},3540:function(d,g,r){var t=r(6832),s=r(5158),a=t([`precision mediump float;
#define GLSLIFY 1
attribute vec3 position, color;
attribute float weight;
uniform mat4 model, view, projection;
uniform vec3 coordinates[3];
uniform vec4 colors[3];
uniform vec2 screenShape;
uniform float lineWidth;
varying vec4 fragColor;
void main() {
vec3 vertexPosition = mix(coordinates[0],
mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));
vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);
vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;
vec2 delta = weight * clipOffset * screenShape;
vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;
gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);
fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];
}
`]),c=t([`precision mediump float;
#define GLSLIFY 1
varying vec4 fragColor;
void main() {
gl_FragColor = fragColor;
}`]);d.exports=function(u){return s(u,a,c,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},6496:function(d,g,r){var t=r(5827),s=r(2944),a=r(3540);d.exports=f;var c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function u(n,v,m,b){this.gl=n,this.buffer=v,this.vao=m,this.shader=b,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var l=u.prototype,y=[0,0,0],h=[0,0,0],T=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(n){},l.draw=function(n){var v=this.gl,m=this.vao,b=this.shader;m.bind(),b.bind();var E=n.model||c,p=n.view||c,S=n.projection||c,w;this.axes&&(w=this.axes.lastCubeProps.axis);for(var i=y,C=h,x=0;x<3;++x)w&&w[x]<0?(i[x]=this.bounds[0][x],C[x]=this.bounds[1][x]):(i[x]=this.bounds[1][x],C[x]=this.bounds[0][x]);T[0]=v.drawingBufferWidth,T[1]=v.drawingBufferHeight,b.uniforms.model=E,b.uniforms.view=p,b.uniforms.projection=S,b.uniforms.coordinates=[this.position,i,C],b.uniforms.colors=this.colors,b.uniforms.screenShape=T;for(var x=0;x<3;++x)b.uniforms.lineWidth=this.lineWidth[x]*this.pixelRatio,this.enabled[x]&&(m.draw(v.TRIANGLES,6,6*x),this.drawSides[x]&&m.draw(v.TRIANGLES,12,18+12*x));m.unbind()},l.update=function(n){n&&("bounds"in n&&(this.bounds=n.bounds),"position"in n&&(this.position=n.position),"lineWidth"in n&&(this.lineWidth=n.lineWidth),"colors"in n&&(this.colors=n.colors),"enabled"in n&&(this.enabled=n.enabled),"drawSides"in n&&(this.drawSides=n.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function f(n,v){var m=[];function b(i,C,x,k,I,B){var _=[i,C,x,0,0,0,1];_[k+3]=1,_[k]=I,m.push.apply(m,_),_[6]=-1,m.push.apply(m,_),_[k]=B,m.push.apply(m,_),m.push.apply(m,_),_[6]=1,m.push.apply(m,_),_[k]=I,m.push.apply(m,_)}b(0,0,0,0,0,1),b(0,0,0,1,0,1),b(0,0,0,2,0,1),b(1,0,0,1,-1,1),b(1,0,0,2,-1,1),b(0,1,0,0,-1,1),b(0,1,0,2,-1,1),b(0,0,1,0,-1,1),b(0,0,1,1,-1,1);var E=t(n,m),p=s(n,[{type:n.FLOAT,buffer:E,size:3,offset:0,stride:28},{type:n.FLOAT,buffer:E,size:3,offset:12,stride:28},{type:n.FLOAT,buffer:E,size:1,offset:24,stride:28}]),S=a(n);S.attributes.position.location=0,S.attributes.color.location=1,S.attributes.weight.location=2;var w=new u(n,E,p,S);return w.update(v),w}},9578:function(d,g,r){var t=r(6832),s=t([`precision highp float;
precision highp float;
#define GLSLIFY 1
vec3 getOrthogonalVector(vec3 v) {
// Return up-vector for only-z vector.
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
// Assign z = 0, x = -b, y = a:
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
return normalize(vec3(-v.y, v.x, 0.0));
} else {
return normalize(vec3(0.0, v.z, -v.y));
}
}
// Calculate the tube vertex and normal at the given index.
//
// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.
//
// Each tube segment is made up of a ring of vertices.
// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.
// The indexes of tube segments run from 0 to 8.
//
vec3 getTubePosition(vec3 d, float index, out vec3 normal) {
float segmentCount = 8.0;
float angle = 2.0 * 3.14159 * (index / segmentCount);
vec3 u = getOrthogonalVector(d);
vec3 v = normalize(cross(u, d));
vec3 x = u * cos(angle) * length(d);
vec3 y = v * sin(angle) * length(d);
vec3 v3 = x + y;
normal = normalize(v3);
return v3;
}
attribute vec4 vector;
attribute vec4 color, position;
attribute vec2 uv;
uniform float vectorScale, tubeScale;
uniform mat4 model, view, projection, inverseModel;
uniform vec3 eyePosition, lightPosition;
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
varying vec4 f_color;
varying vec2 f_uv;
void main() {
// Scale the vector magnitude to stay constant with
// model & view changes.
vec3 normal;
vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);
vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
//Lighting geometry parameters
vec4 cameraCoordinate = view * tubePosition;
cameraCoordinate.xyz /= cameraCoordinate.w;
f_lightDirection = lightPosition - cameraCoordinate.xyz;
f_eyeDirection = eyePosition - cameraCoordinate.xyz;
f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
// vec4 m_position = model * vec4(tubePosition, 1.0);
vec4 t_position = view * tubePosition;
gl_Position = projection * t_position;
f_color = color;
f_data = tubePosition.xyz;
f_position = position.xyz;
f_uv = uv;
}
`]),a=t([`#extension GL_OES_standard_derivatives : enable
precision highp float;
#define GLSLIFY 1
float beckmannDistribution(float x, float roughness) {
float NdotH = max(x, 0.0001);
float cos2Alpha = NdotH * NdotH;
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
float roughness2 = roughness * roughness;
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
return exp(tan2Alpha / roughness2) / denom;
}
float cookTorranceSpecular(
vec3 lightDirection,
vec3 viewDirection,
vec3 surfaceNormal,
float roughness,
float fresnel) {
float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
//Half angle vector
vec3 H = normalize(lightDirection + viewDirection);
//Geometric term
float NdotH = max(dot(surfaceNormal, H), 0.0);
float VdotH = max(dot(viewDirection, H), 0.000001);
float LdotH = max(dot(lightDirection, H), 0.000001);
float G1 = (2.0 * NdotH * VdotN) / VdotH;
float G2 = (2.0 * NdotH * LdotN) / LdotH;
float G = min(1.0, min(G1, G2));
//Distribution term
float D = beckmannDistribution(NdotH, roughness);
//Fresnel term
float F = pow(1.0 - VdotN, fresnel);
//Multiply terms and done
return G * F * D / max(3.14159265 * VdotN, 0.000001);
}
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 clipBounds[2];
uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
uniform sampler2D texture;
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
varying vec4 f_color;
varying vec2 f_uv;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
vec3 N = normalize(f_normal);
vec3 L = normalize(f_lightDirection);
vec3 V = normalize(f_eyeDirection);
if(gl_FrontFacing) {
N = -N;
}
float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
vec4 surfaceColor = f_color * texture2D(texture, f_uv);
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
gl_FragColor = litColor * opacity;
}
`]),c=t([`precision highp float;
precision highp float;
#define GLSLIFY 1
vec3 getOrthogonalVector(vec3 v) {
// Return up-vector for only-z vector.
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
// Assign z = 0, x = -b, y = a:
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
return normalize(vec3(-v.y, v.x, 0.0));
} else {
return normalize(vec3(0.0, v.z, -v.y));
}
}
// Calculate the tube vertex and normal at the given index.
//
// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.
//
// Each tube segment is made up of a ring of vertices.
// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.
// The indexes of tube segments run from 0 to 8.
//
vec3 getTubePosition(vec3 d, float index, out vec3 normal) {
float segmentCount = 8.0;
float angle = 2.0 * 3.14159 * (index / segmentCount);
vec3 u = getOrthogonalVector(d);
vec3 v = normalize(cross(u, d));
vec3 x = u * cos(angle) * length(d);
vec3 y = v * sin(angle) * length(d);
vec3 v3 = x + y;
normal = normalize(v3);
return v3;
}
attribute vec4 vector;
attribute vec4 position;
attribute vec4 id;
uniform mat4 model, view, projection;
uniform float tubeScale;
varying vec3 f_position;
varying vec4 f_id;
void main() {
vec3 normal;
vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);
vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
gl_Position = projection * view * tubePosition;
f_id = id;
f_position = position.xyz;
}
`]),u=t([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 clipBounds[2];
uniform float pickId;
varying vec3 f_position;
varying vec4 f_id;
void main() {
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
gl_FragColor = vec4(pickId, f_id.xyz);
}`]);g.meshShader={vertex:s,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},g.pickShader={vertex:c,fragment:u,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7307:function(d,g,r){var t=r(2858),s=r(4020),a=["xyz","xzy","yxz","yzx","zxy","zyx"],c=function(m,b,E,p){for(var S=m.points,w=m.velocities,i=m.divergences,C=[],x=[],k=[],I=[],B=[],_=[],z=0,O=0,F=s.create(),N=s.create(),V=8,j=0;j<S.length;j++){var $=S[j],q=w[j],oe=i[j];b===0&&(oe=E*.05),O=t.length(q)/p,F=s.create(),t.copy(F,q),F[3]=oe;for(var Z=0;Z<V;Z++)B[Z]=[$[0],$[1],$[2],Z];if(I.length>0)for(var Z=0;Z<V;Z++){var G=(Z+1)%V;C.push(I[Z],B[Z],B[G],B[G],I[G],I[Z]),k.push(N,F,F,F,N,N),_.push(z,O,O,O,z,z);var re=C.length;x.push([re-6,re-5,re-4],[re-3,re-2,re-1])}var H=I;I=B,B=H;var J=N;N=F,F=J;var ae=z;z=O,O=ae}return{positions:C,cells:x,vectors:k,vertexIntensity:_}},u=function(m,b,E,p){for(var S=0,w=0;w<m.length;w++)for(var i=m[w].velocities,C=0;C<i.length;C++)S=Math.max(S,t.length(i[C]));for(var x=m.map(function(j){return c(j,E,p,S)}),k=[],I=[],B=[],_=[],w=0;w<x.length;w++){var z=x[w],O=k.length;k=k.concat(z.positions),B=B.concat(z.vectors),_=_.concat(z.vertexIntensity);for(var C=0;C<z.cells.length;C++){var F=z.cells[C],N=[];I.push(N);for(var V=0;V<F.length;V++)N.push(F[V]+O)}}return{positions:k,cells:I,vectors:B,vertexIntensity:_,colormap:b}},l=function(m,b){var E=m.length,p;for(p=0;p<E;p++){var S=m[p];if(S===b)return p;if(S>b)return p-1}return p},y=function(m,b,E){return m<b?b:m>E?E:m},h=function(m,b,E){var p=b.vectors,S=b.meshgrid,w=m[0],i=m[1],C=m[2],x=S[0].length,k=S[1].length,I=S[2].length,B=l(S[0],w),_=l(S[1],i),z=l(S[2],C),O=B+1,F=_+1,N=z+1;if(B=y(B,0,x-1),O=y(O,0,x-1),_=y(_,0,k-1),F=y(F,0,k-1),z=y(z,0,I-1),N=y(N,0,I-1),B<0||_<0||z<0||O>x-1||F>k-1||N>I-1)return t.create();var V=S[0][B],j=S[0][O],$=S[1][_],q=S[1][F],oe=S[2][z],Z=S[2][N],G=(w-V)/(j-V),re=(i-$)/(q-$),H=(C-oe)/(Z-oe);isFinite(G)||(G=.5),isFinite(re)||(re=.5),isFinite(H)||(H=.5);var J,ae,K,Y,ie,ne;switch(E.reversedX&&(B=x-1-B,O=x-1-O),E.reversedY&&(_=k-1-_,F=k-1-F),E.reversedZ&&(z=I-1-z,N=I-1-N),E.filled){case 5:ie=z,ne=N,K=_*I,Y=F*I,J=B*I*k,ae=O*I*k;break;case 4:ie=z,ne=N,J=B*I,ae=O*I,K=_*I*x,Y=F*I*x;break;case 3:K=_,Y=F,ie=z*k,ne=N*k,J=B*k*I,ae=O*k*I;break;case 2:K=_,Y=F,J=B*k,ae=O*k,ie=z*k*x,ne=N*k*x;break;case 1:J=B,ae=O,ie=z*x,ne=N*x,K=_*x*I,Y=F*x*I;break;default:J=B,ae=O,K=_*x,Y=F*x,ie=z*x*k,ne=N*x*k;break}var le=p[J+K+ie],de=p[J+K+ne],we=p[J+Y+ie],me=p[J+Y+ne],Le=p[ae+K+ie],ve=p[ae+K+ne],Ae=p[ae+Y+ie],ye=p[ae+Y+ne],Se=t.create(),_e=t.create(),ze=t.create(),Ie=t.create();t.lerp(Se,le,Le,G),t.lerp(_e,de,ve,G),t.lerp(ze,we,Ae,G),t.lerp(Ie,me,ye,G);var Ne=t.create(),et=t.create();t.lerp(Ne,Se,ze,re),t.lerp(et,_e,Ie,re);var st=t.create();return t.lerp(st,Ne,et,H),st},T=function(m){var b=1/0;m.sort(function(w,i){return w-i});for(var E=m.length,p=1;p<E;p++){var S=Math.abs(m[p]-m[p-1]);S<b&&(b=S)}return b},f=function(m){for(var b=[],E=[],p=[],S={},w={},i={},C=m.length,x=0;x<C;x++){var k=m[x],I=k[0],B=k[1],_=k[2];S[I]||(b.push(I),S[I]=!0),w[B]||(E.push(B),w[B]=!0),i[_]||(p.push(_),i[_]=!0)}var z=T(b),O=T(E),F=T(p),N=Math.min(z,O,F);return isFinite(N)?N:1};d.exports=function(m,b){var E=m.startingPositions,p=m.maxLength||1e3,S=m.tubeSize||1,w=m.absoluteTubeSize,i=m.gridFill||"+x+y+z",C={};i.indexOf("-x")!==-1&&(C.reversedX=!0),i.indexOf("-y")!==-1&&(C.reversedY=!0),i.indexOf("-z")!==-1&&(C.reversedZ=!0),C.filled=a.indexOf(i.replace(/-/g,"").replace(/\+/g,""));var x=m.getVelocity||function(ve){return h(ve,m,C)},k=m.getDivergence||function(ve,Ae){var ye=t.create(),Se=1e-4;t.add(ye,ve,[Se,0,0]);var _e=x(ye);t.subtract(_e,_e,Ae),t.scale(_e,_e,1/Se),t.add(ye,ve,[0,Se,0]);var ze=x(ye);t.subtract(ze,ze,Ae),t.scale(ze,ze,1/Se),t.add(ye,ve,[0,0,Se]);var Ie=x(ye);return t.subtract(Ie,Ie,Ae),t.scale(Ie,Ie,1/Se),t.add(ye,_e,ze),t.add(ye,ye,Ie),ye},I=[],B=b[0][0],_=b[0][1],z=b[0][2],O=b[1][0],F=b[1][1],N=b[1][2],V=function(ve){var Ae=ve[0],ye=ve[1],Se=ve[2];return!(Ae<B||Ae>O||ye<_
#define GLSLIFY 1
attribute vec4 uv;
attribute vec3 f;
attribute vec3 normal;
uniform vec3 objectOffset;
uniform mat4 model, view, projection, inverseModel;
uniform vec3 lightPosition, eyePosition;
uniform sampler2D colormap;
varying float value, kill;
varying vec3 worldCoordinate;
varying vec2 planeCoordinate;
varying vec3 lightDirection, eyeDirection, surfaceNormal;
varying vec4 vColor;
void main() {
vec3 localCoordinate = vec3(uv.zw, f.x);
worldCoordinate = objectOffset + localCoordinate;
vec4 worldPosition = model * vec4(worldCoordinate, 1.0);
vec4 clipPosition = projection * view * worldPosition;
gl_Position = clipPosition;
kill = f.y;
value = f.z;
planeCoordinate = uv.xy;
vColor = texture2D(colormap, vec2(value, value));
//Lighting geometry parameters
vec4 cameraCoordinate = view * worldPosition;
cameraCoordinate.xyz /= cameraCoordinate.w;
lightDirection = lightPosition - cameraCoordinate.xyz;
eyeDirection = eyePosition - cameraCoordinate.xyz;
surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);
}
`]),c=s([`precision highp float;
#define GLSLIFY 1
float beckmannDistribution(float x, float roughness) {
float NdotH = max(x, 0.0001);
float cos2Alpha = NdotH * NdotH;
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
float roughness2 = roughness * roughness;
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
return exp(tan2Alpha / roughness2) / denom;
}
float beckmannSpecular(
vec3 lightDirection,
vec3 viewDirection,
vec3 surfaceNormal,
float roughness) {
return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);
}
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec3 lowerBound, upperBound;
uniform float contourTint;
uniform vec4 contourColor;
uniform sampler2D colormap;
uniform vec3 clipBounds[2];
uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
uniform float vertexColor;
varying float value, kill;
varying vec3 worldCoordinate;
varying vec3 lightDirection, eyeDirection, surfaceNormal;
varying vec4 vColor;
void main() {
if (
kill > 0.0 ||
vColor.a == 0.0 ||
outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)
) discard;
vec3 N = normalize(surfaceNormal);
vec3 V = normalize(eyeDirection);
vec3 L = normalize(lightDirection);
if(gl_FrontFacing) {
N = -N;
}
float specular = max(beckmannSpecular(L, V, N, roughness), 0.);
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
//decide how to interpolate color — in vertex or in fragment
vec4 surfaceColor =
step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +
step(.5, vertexColor) * vColor;
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;
}
`]),u=s([`precision highp float;
#define GLSLIFY 1
attribute vec4 uv;
attribute float f;
uniform vec3 objectOffset;
uniform mat3 permutation;
uniform mat4 model, view, projection;
uniform float height, zOffset;
uniform sampler2D colormap;
varying float value, kill;
varying vec3 worldCoordinate;
varying vec2 planeCoordinate;
varying vec3 lightDirection, eyeDirection, surfaceNormal;
varying vec4 vColor;
void main() {
vec3 dataCoordinate = permutation * vec3(uv.xy, height);
worldCoordinate = objectOffset + dataCoordinate;
vec4 worldPosition = model * vec4(worldCoordinate, 1.0);
vec4 clipPosition = projection * view * worldPosition;
clipPosition.z += zOffset;
gl_Position = clipPosition;
value = f + objectOffset.z;
kill = -1.0;
planeCoordinate = uv.zw;
vColor = texture2D(colormap, vec2(value, value));
//Don't do lighting for contours
surfaceNormal = vec3(1,0,0);
eyeDirection = vec3(0,1,0);
lightDirection = vec3(0,0,1);
}
`]),l=s([`precision highp float;
#define GLSLIFY 1
bool outOfRange(float a, float b, float p) {
return ((p > max(a, b)) ||
(p < min(a, b)));
}
bool outOfRange(vec2 a, vec2 b, vec2 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y));
}
bool outOfRange(vec3 a, vec3 b, vec3 p) {
return (outOfRange(a.x, b.x, p.x) ||
outOfRange(a.y, b.y, p.y) ||
outOfRange(a.z, b.z, p.z));
}
bool outOfRange(vec4 a, vec4 b, vec4 p) {
return outOfRange(a.xyz, b.xyz, p.xyz);
}
uniform vec2 shape;
uniform vec3 clipBounds[2];
uniform float pickId;
varying float value, kill;
varying vec3 worldCoordinate;
varying vec2 planeCoordinate;
varying vec3 surfaceNormal;
vec2 splitFloat(float v) {
float vh = 255.0 * v;
float upper = floor(vh);
float lower = fract(vh);
return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);
}
void main() {
if ((kill > 0.0) ||
(outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;
vec2 ux = splitFloat(planeCoordinate.x / shape.x);
vec2 uy = splitFloat(planeCoordinate.y / shape.y);
gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));
}
`]);g.createShader=function(y){var h=t(y,a,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return h.attributes.uv.location=0,h.attributes.f.location=1,h.attributes.normal.location=2,h},g.createPickShader=function(y){var h=t(y,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return h.attributes.uv.location=0,h.attributes.f.location=1,h.attributes.normal.location=2,h},g.createContourShader=function(y){var h=t(y,u,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return h.attributes.uv.location=0,h.attributes.f.location=1,h},g.createPickContourShader=function(y){var h=t(y,u,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return h.attributes.uv.location=0,h.attributes.f.location=1,h}},3754:function(d,g,r){d.exports=ae;var t=r(2288),s=r(5827),a=r(2944),c=r(8931),u=r(5306),l=r(9156),y=r(7498),h=r(7382),T=r(5050),f=r(4162),n=r(104),v=r(7437),m=r(5070),b=r(9144),E=r(9054),p=E.createShader,S=E.createContourShader,w=E.createPickShader,i=E.createPickContourShader,C=4*10,x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],I=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];(function(){for(var K=0;K<3;++K){var Y=I[K],ie=(K+1)%3,ne=(K+2)%3;Y[ie+0]=1,Y[ne+3]=1,Y[K+6]=1}})();function B(K,Y,ie,ne,le){this.position=K,this.index=Y,this.uv=ie,this.level=ne,this.dataCoordinate=le}var _=256;function z(K,Y,ie,ne,le,de,we,me,Le,ve,Ae,ye,Se,_e,ze){this.gl=K,this.shape=Y,this.bounds=ie,this.objectOffset=ze,this.intensityBounds=[],this._shader=ne,this._pickShader=le,this._coordinateBuffer=de,this._vao=we,this._colorMap=me,this._contourShader=Le,this._contourPickShader=ve,this._contourBuffer=Ae,this._contourVAO=ye,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new B([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=Se,this._dynamicVAO=_e,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[T(u.mallocFloat(1024),[0,0]),T(u.mallocFloat(1024),[0,0]),T(u.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var O=z.prototype;O.genColormap=function(K,Y){var ie=!1,ne=h([l({colormap:K,nshades:_,format:"rgba"}).map(function(le,de){var we=Y?F(de/255,Y):le[3];return we<1&&(ie=!0),[le[0],le[1],le[2],255*we]})]);return y.divseq(ne,255),this.hasAlphaScale=ie,ne},O.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},O.isOpaque=function(){return!this.isTransparent()},O.pickSlots=1,O.setPickBase=function(K){this.pickId=K};function F(K,Y){if(!Y||!Y.length)return 1;for(var ie=0;ie<Y.length;++ie){if(Y.length<2)return 1;if(Y[ie][0]===K)return Y[ie][1];if(Y[ie][0]>K&&ie>0){var ne=(Y[ie][0]-K)/(Y[ie][0]-Y[ie-1][0]);return Y[ie][1]*(1-ne)+ne*Y[ie-1][1]}}return 1}var N=[0,0,0],V={showSurface:!1,showContour:!1,projections:[x.slice(),x.slice(),x.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function j(K,Y){var ie,ne,le,de=Y.axes&&Y.axes.lastCubeProps.axis||N,we=Y.showSurface,me=Y.showContour;for(ie=0;ie<3;++ie)for(we=we||Y.surfaceProject[ie],ne=0;ne<3;++ne)me=me||Y.contourProject[ie][ne];for(ie=0;ie<3;++ie){var Le=V.projections[ie];for(ne=0;ne<16
`),G=Z.length;for(var Ie;z=Z[I],I<G;){switch(Ie=I,_){case h:I=me();break;case T:I=we();break;case f:I=de();break;case n:I=Le();break;case v:I=ye();break;case i:I=Ae();break;case m:I=Se();break;case y:I=_e();break;case S:I=le();break;case l:I=ne();break}if(Ie!==I)switch(Z[Ie]){case`
`:j=0,++V;break;default:++j;break}}return B+=I,Z=Z.slice(I),N}function ie(ze){return F.length&&K(F.join("")),_=w,K("(eof)"),N}function ne(){return F=F.length?[]:F,O==="/"&&z==="*"?($=B+I-1,_=h,O=z,I+1):O==="/"&&z==="/"?($=B+I-1,_=T,O=z,I+1):z==="#"?(_=f,$=B+I,I):/\s/.test(z)?(_=S,$=B+I,I):(q=/\d/.test(z),oe=/[^\w_]/.test(z),$=B+I,_=q?v:oe?n:y,I)}function le(){return/[^\s]/g.test(z)?(K(F.join("")),_=l,I):(F.push(z),O=z,I+1)}function de(){return(z==="\r"||z===`
`)&&O!=="\\"?(K(F.join("")),_=l,I):(F.push(z),O=z,I+1)}function we(){return de()}function me(){return z==="/"&&O==="*"?(F.push(z),K(F.join("")),_=l,I+1):(F.push(z),O=z,I+1)}function Le(){if(O==="."&&/\d/.test(z))return _=m,I;if(O==="/"&&z==="*")return _=h,I;if(O==="/"&&z==="/")return _=T,I;if(z==="."&&F.length){for(;ve(F););return _=m,I}if(z===";"||z===")"||z==="("){if(F.length)for(;ve(F););return K(z),_=l,I+1}var ze=F.length===2&&z!=="=";if(/[\w_\d\s]/.test(z)||ze){for(;ve(F););return _=l,I}return F.push(z),O=z,I+1}function ve(ze){var Ie=0,Ne,et;do{if(Ne=s.indexOf(ze.slice(0,ze.length+Ie).join("")),et=s[Ne],Ne===-1){if(Ie--+ze.length>0)continue;et=ze.slice(0,1).join("")}return K(et),$+=et.length,F=F.slice(et.length),F.length}while(!0)}function Ae(){return/[^a-fA-F0-9]/.test(z)?(K(F.join("")),_=l,I):(F.push(z),O=z,I+1)}function ye(){return z==="."||/[eE]/.test(z)?(F.push(z),_=m,O=z,I+1):z==="x"&&F.length===1&&F[0]==="0"?(_=i,F.push(z),O=z,I+1):/[^\d]/.test(z)?(K(F.join("")),_=l,I):(F.push(z),O=z,I+1)}function Se(){return z==="f"&&(F.push(z),O=z,I+=1),/[eE]/.test(z)||(z==="-"||z==="+")&&/[eE]/.test(O)?(F.push(z),O=z,I+1):/[^\d]/.test(z)?(K(F.join("")),_=l,I):(F.push(z),O=z,I+1)}function _e(){if(/[^\d\w_]/.test(z)){var ze=F.join("");return ae[ze]?_=p:J[ze]?_=E:_=b,K(F.join("")),_=l,I}return F.push(z),O=z,I+1}}},3585:function(d,g,r){var t=r(9525);t=t.slice().filter(function(s){return!/^(gl\_|texture)/.test(s)}),d.exports=t.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},9525:function(d){d.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ",
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/d.exports=function(t){return t!=null&&(g(t)||r(t)||!!t._isBuffer)};function g(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function r(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&g(t.slice(0,0))}},3596:function(d){d.exports=function(g){for(var r=g.length,t,s=0;s<r;s++)if(t=g.charCodeAt(s),(t<9||t>13)&&t!==32&&t!==133&&t!==160&&t!==5760&&t!==6158&&(t<8192||t>8205)&&t!==8232&&t!==8233&&t!==8239&&t!==8287&&t!==8288&&t!==12288&&t!==65279)return!1;return!0}},3578:function(d){function g(r,t,s){return r*(1-s)+t*s}d.exports=g},7191:function(d,g,r){var t=r(4690),s=r(9823),a=r(7332),c=r(7787),u=r(7437),l=r(2142),y={length:r(4693),normalize:r(899),dot:r(9305),cross:r(903)},h=s(),T=s(),f=[0,0,0,0],n=[[0,0,0],[0,0,0],[0,0,0]],v=[0,0,0];d.exports=function(S,w,i,C,x,k){if(w||(w=[0,0,0]),i||(i=[0,0,0]),C||(C=[0,0,0]),x||(x=[0,0,0,1]),k||(k=[0,0,0,1]),!t(h,S)||(a(T,h),T[3]=0,T[7]=0,T[11]=0,T[15]=1,Math.abs(c(T)<1e-8)))return!1;var I=h[3],B=h[7],_=h[11],z=h[12],O=h[13],F=h[14],N=h[15];if(I!==0||B!==0||_!==0){f[0]=I,f[1]=B,f[2]=_,f[3]=N;var V=u(T,T);if(!V)return!1;l(T,T),m(x,f,T)}else x[0]=x[1]=x[2]=0,x[3]=1;if(w[0]=z,w[1]=O,w[2]=F,b(n,h),i[0]=y.length(n[0]),y.normalize(n[0],n[0]),C[0]=y.dot(n[0],n[1]),E(n[1],n[1],n[0],1,-C[0]),i[1]=y.length(n[1]),y.normalize(n[1],n[1]),C[0]/=i[1],C[1]=y.dot(n[0],n[2]),E(n[2],n[2],n[0],1,-C[1]),C[2]=y.dot(n[1],n[2]),E(n[2],n[2],n[1],1,-C[2]),i[2]=y.length(n[2]),y.normalize(n[2],n[2]),C[1]/=i[2],C[2]/=i[2],y.cross(v,n[1],n[2]),y.dot(n[0],v)<0)for(var j=0;j<3;j++)i[j]*=-1,n[j][0]*=-1,n[j][1]*=-1,n[j][2]*=-1;return k[0]=.5*Math.sqrt(Math.max(1+n[0][0]-n[1][1]-n[2][2],0)),k[1]=.5*Math.sqrt(Math.max(1-n[0][0]+n[1][1]-n[2][2],0)),k[2]=.5*Math.sqrt(Math.max(1-n[0][0]-n[1][1]+n[2][2],0)),k[3]=.5*Math.sqrt(Math.max(1+n[0][0]+n[1][1]+n[2][2],0)),n[2][1]>n[1][2]&&(k[0]=-k[0]),n[0][2]>n[2][0]&&(k[1]=-k[1]),n[1][0]>n[0][1]&&(k[2]=-k[2]),!0};function m(p,S,w){var i=S[0],C=S[1],x=S[2],k=S[3];return p[0]=w[0]*i+w[4]*C+w[8]*x+w[12]*k,p[1]=w[1]*i+w[5]*C+w[9]*x+w[13]*k,p[2]=w[2]*i+w[6]*C+w[10]*x+w[14]*k,p[3]=w[3]*i+w[7]*C+w[11]*x+w[15]*k,p}function b(p,S){p[0][0]=S[0],p[0][1]=S[1],p[0][2]=S[2],p[1][0]=S[4],p[1][1]=S[5],p[1][2]=S[6],p[2][0]=S[8],p[2][1]=S[9],p[2][2]=S[10]}function E(p,S,w,i,C){p[0]=S[0]*i+w[0]*C,p[1]=S[1]*i+w[1]*C,p[2]=S[2]*i+w[2]*C}},4690:function(d){d.exports=function(r,t){var s=t[15];if(s===0)return!1;for(var a=1/s,c=0;c<16;c++)r[c]=t[c]*a;return!0}},7649:function(d,g,r){var t=r(1868),s=r(1102),a=r(7191),c=r(7787),u=r(1116),l=f(),y=f(),h=f();d.exports=T;function T(m,b,E,p){if(c(b)===0||c(E)===0)return!1;var S=a(b,l.translate,l.scale,l.skew,l.perspective,l.quaternion),w=a(E,y.translate,y.scale,y.skew,y.perspective,y.quaternion);return!S||!w?!1:(t(h.translate,l.translate,y.translate,p),t(h.skew,l.skew,y.skew,p),t(h.scale,l.scale,y.scale,p),t(h.perspective,l.perspective,y.perspective,p),u(h.quaternion,l.quaternion,y.quaternion,p),s(m,h.translate,h.scale,h.skew,h.perspective,h.quaternion),!0)}function f(){return{translate:n(),scale:n(1),skew:n(),perspective:v(),quaternion:v()}}function n(m){return[m||0,m||0,m||0]}function v(){return[0,0,0,1]}},1102:function(d,g,r){var t={identity:r(9947),translate:r(998),multiply:r(104),create:r(9823),scale:r(3668),fromRotationTranslation:r(7280)};t.create();var s=t.create();d.exports=function(c,u,l,y,h,T){return t.identity(c),t.fromRotationTranslation(c,T,u),c[3]=h[0],c[7]=h[1],c[11]=h[2],c[15]=h[3],t.identity(s),y[2]!==0&&(s[9]=y[2],t.multiply(c,c,s)),y[1]!==0&&(s[9]=0,s[8]=y[1],t.multiply(c,c,s)),y[0]!==0&&(s[8]=0,s[4]=y[0],t.multiply(c,c,s)),t.scale(c,c,l),c}},9298:function(d,g,r){var t=r(5070),s=r(7649),a=r(7437),c=r(6109),u=r(7115),l=r(5240),y=r(3012),h=r(998);r(3668);var T=r(899),f=[0,0,0];d.exports=b;function n(E){this._components=E.slice(),this._time=[0],this.prevMatrix=E.slice(),this.nextMatrix=E.slice(),this.computedMatrix=E.slice(),this.computedInverse=E.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}v
* pad-left <https://github.com/jonschlinkert/pad-left>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT license.
*/var t=r(6184);d.exports=function(a,c,u){return u=typeof u<"u"?u+"":" ",t(u,c)+a}},4405:function(d){d.exports=function(r,t){t||(t=[0,""]),r=String(r);var s=parseFloat(r,10);return t[0]=s,t[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},4166:function(d,g,r){d.exports=s;var t=r(9398);function s(a,c){for(var u=c.length|0,l=a.length,y=[new Array(u),new Array(u)],h=0;h<u;++h)y[0][h]=[],y[1][h]=[];for(var h=0;h<l;++h){var T=a[h];y[0][T[0]].push(T),y[1][T[1]].push(T)}for(var f=[],h=0;h<u;++h)y[0][h].length+y[1][h].length===0&&f.push([h]);function n(w,i){var C=y[i][w[i]];C.splice(C.indexOf(w),1)}function v(w,i,C){for(var x,k,I,B=0;B<2;++B)if(y[B][i].length>0){x=y[B][i][0],I=B;break}k=x[I^1];for(var _=0;_<2;++_)for(var z=y[_][i],O=0;O<z.length;++O){var F=z[O],N=F[_^1],V=t(c[w],c[i],c[k],c[N]);V>0&&(x=F,k=N,I=_)}return C||x&&n(x,I),k}function m(w,i){var C=y[i][w][0],x=[w];n(C,i);for(var k=C[i^1];;){for(;k!==w;)x.push(k),k=v(x[x.length-2],k,!1);if(y[0][w].length+y[1][w].length===0)break;var I=x[x.length-1],B=w,_=x[1],z=v(I,B,!0);if(t(c[I],c[B],c[_],c[z])<0)break;x.push(w),k=v(I,B)}return x}function b(w,i){return i[1]===i[i.length-1]}for(var h=0;h<u;++h)for(var E=0;E<2;++E){for(var p=[];y[E][h].length>0;){y[0][h].length;var S=m(h,E);b(p,S)?p.push.apply(p,S):(p.length>0&&f.push(p),p=S)}p.length>0&&f.push(p)}return f}},3959:function(d,g,r){d.exports=s;var t=r(8348);function s(a,c){for(var u=t(a,c.length),l=new Array(c.length),y=new Array(c.length),h=[],T=0;T<c.length;++T){var f=u[T].length;y[T]=f,l[T]=!0,f<=1&&h.push(T)}for(;h.length>0;){var n=h.pop();l[n]=!1;for(var v=u[n],T=0;T<v.length;++T){var m=v[T];--y[m]===0&&h.push(m)}}for(var b=new Array(c.length),E=[],T=0;T<c.length;++T)if(l[T]){var n=E.length;b[T]=n,E.push(c[T])}else b[T]=-1;for(var p=[],T=0;T<a.length;++T){var S=a[T];l[S[0]]&&l[S[1]]&&p.push([b[S[0]],b[S[1]]])}return[p,E]}},8040:function(d,g,r){d.exports=f;var t=r(8348),s=r(4166),a=r(211),c=r(9660),u=r(9662),l=r(1215),y=r(3959);function h(n,v){for(var m=new Array(n),b=0;b<n;++b)m[b]=v;return m}function T(n){for(var v=new Array(n),m=0;m<n;++m)v[m]=[];return v}function f(n,v){var Y=y(n,v);n=Y[0],v=Y[1];var m=v.length;n.length;for(var b=t(n,v.length),E=0;E<m;++E)if(b[E].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var p=s(n,v);function S(Le){for(var ve=Le.length,Ae=[0],ye=0;ye<ve;++ye){var Se=v[Le[ye]],_e=v[Le[(ye+1)%ve]],ze=c(-Se[0],Se[1]),Ie=c(-Se[0],_e[1]),Ne=c(_e[0],Se[1]),et=c(_e[0],_e[1]);Ae=u(Ae,u(u(ze,Ie),u(Ne,et)))}return Ae[Ae.length-1]>0}p=p.filter(S);for(var w=p.length,i=new Array(w),C=new Array(w),E=0;E<w;++E){i[E]=E;var x=new Array(w),k=p[E].map(function(ve){return v[ve]}),I=a([k]),B=0;e:for(var _=0;_<w;++_)if(x[_]=0,E!==_){for(var z=p[_],O=z.length,F=0;F<O;++F){var N=I(v[z[F]]);if(N!==0){N<0&&(x[_]=1,B+=1);continue e}}x[_]=1,B+=1}C[E]=[B,E,x]}C.sort(function(Le,ve){return ve[0]-Le[0]});for(var E=0;E<w;++E)for(var x=C[E],V=x[1],j=x[2],_=0;_<w;++_)j[_]&&(i[_]=V);for(var $=T(w),E=0;E<w;++E)$[E].push(i[E]),$[i[E]].push(E);for(var q={},oe=h(m,!1),E=0;E<w;++E)for(var z=p[E],O=z.length,_=0;_<O;++_){var Z=z[_],G=z[(_+1)%O],re=Math.min(Z,G)+":"+Math.max(Z,G);if(re in q){var H=q[re];$[H].push(E),$[E].push(H),oe[Z]=oe[G]=!0}else q[re]=E}function J(Le){for(var ve=Le.length,Ae=0;Ae<ve;++Ae)if(!oe[Le[Ae]])return!1;return!0}for(var ae=[],K=h(w,-1),E=0;E<w;++E)i[E]===E&&!J(p[E])?(ae.push(E),K[E]=0):K[E]=-1;for(var Y=[];ae.length>0;){var ie=ae.pop(),ne=$[ie];l(ne,function(Le,ve){return Le-ve});var le=ne.length,de=K[ie],we;if(de===0){var z=p[ie];we=[z]}for(var E=0;E<le;++E){var me=ne[E];if(!(K[me]>=0)&&(K[me]=de^1,ae.push(me),de===0)){var z=p[me];J(z)||(z.reverse(),we.push(z))}}de===0&&Y.push(we)}return Y}},211:function(d,g,r){d.exports=v;var t=r(417)[3],s=r(4385),a=r(9014),c=r(5070);function u(){return!0}function l(m){return function(b,E){var p=m[b];return p?!!p.queryPoint(E,u):!1}}function y(m){for(var b={},E=0;E<m.length;++E){var p=m[E],S=p[0][0],w=p[0][1],i=p[1][1],C=[Math.min(w,i),Math.max(w,i)];S in b?b[S].push(C):b[S]=[C]}for(var x={},k=Object.keys(b),E=0;E<k.length;++E){var I=b[k[E]];x[k
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/var g="",r;d.exports=t;function t(s,a){if(typeof s!="string")throw new TypeError("expected a string");if(a===1)return s;if(a===2)return s+s;var c=s.length*a;if(r!==s||typeof r>"u")r=s,g="";else if(g.length>=c)return g.substr(0,c);for(;c>g.length&&a>1;)a&1&&(g+=s),a>>=1,s+=s;return g+=s,g=g.substr(0,c),g}},8161:function(d,g,r){d.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},402:function(d){d.exports=g;function g(r){for(var t=r.length,s=r[r.length-1],a=t,c=t-2;c>=0;--c){var u=s,l=r[c];s=u+l;var y=s-u,h=l-y;h&&(r[--a]=s,s=h)}for(var T=0,c=a;c<t;++c){var u=r[c],l=s;s=u+l;var y=s-u,h=l-y;h&&(r[T++]=h)}return r[T++]=s,r.length=T,r}},8167:function(d,g,r){var t=r(9660),s=r(9662),a=r(8289),c=r(402),u=6;function l(b,E,p,S){return function(i){return S(b(p(i[0][0],i[1][1]),p(-i[0][1],i[1][0])))}}function y(b,E,p,S){return function(i){return S(b(E(b(p(i[1][1],i[2][2]),p(-i[1][2],i[2][1])),i[0][0]),b(E(b(p(i[1][0],i[2][2]),p(-i[1][2],i[2][0])),-i[0][1]),E(b(p(i[1][0],i[2][1]),p(-i[1][1],i[2][0])),i[0][2]))))}}function h(b,E,p,S){return function(i){return S(b(b(E(b(E(b(p(i[2][2],i[3][3]),p(-i[2][3],i[3][2])),i[1][1]),b(E(b(p(i[2][1],i[3][3]),p(-i[2][3],i[3][1])),-i[1][2]),E(b(p(i[2][1],i[3][2]),p(-i[2][2],i[3][1])),i[1][3]))),i[0][0]),E(b(E(b(p(i[2][2],i[3][3]),p(-i[2][3],i[3][2])),i[1][0]),b(E(b(p(i[2][0],i[3][3]),p(-i[2][3],i[3][0])),-i[1][2]),E(b(p(i[2][0],i[3][2]),p(-i[2][2],i[3][0])),i[1][3]))),-i[0][1])),b(E(b(E(b(p(i[2][1],i[3][3]),p(-i[2][3],i[3][1])),i[1][0]),b(E(b(p(i[2][0],i[3][3]),p(-i[2][3],i[3][0])),-i[1][1]),E(b(p(i[2][0],i[3][1]),p(-i[2][1],i[3][0])),i[1][3]))),i[0][2]),E(b(E(b(p(i[2][1],i[3][2]),p(-i[2][2],i[3][1])),i[1][0]),b(E(b(p(i[2][0],i[3][2]),p(-i[2][2],i[3][0])),-i[1][1]),E(b(p(i[2][0],i[3][1]),p(-i[2][1],i[3][0])),i[1][2]))),-i[0][3]))))}}function T(b,E,p,S){return function(i){return S(b(b(E(b(b(E(b(E(b(p(i[3][3],i[4][4]),p(-i[3][4],i[4][3])),i[2][2]),b(E(b(p(i[3][2],i[4][4]),p(-i[3][4],i[4][2])),-i[2][3]),E(b(p(i[3][2],i[4][3]),p(-i[3][3],i[4][2])),i[2][4]))),i[1][1]),E(b(E(b(p(i[3][3],i[4][4]),p(-i[3][4],i[4][3])),i[2][1]),b(E(b(p(i[3][1],i[4][4]),p(-i[3][4],i[4][1])),-i[2][3]),E(b(p(i[3][1],i[4][3]),p(-i[3][3],i[4][1])),i[2][4]))),-i[1][2])),b(E(b(E(b(p(i[3][2],i[4][4]),p(-i[3][4],i[4][2])),i[2][1]),b(E(b(p(i[3][1],i[4][4]),p(-i[3][4],i[4][1])),-i[2][2]),E(b(p(i[3][1],i[4][2]),p(-i[3][2],i[4][1])),i[2][4]))),i[1][3]),E(b(E(b(p(i[3][2],i[4][3]),p(-i[3][3],i[4][2])),i[2][1]),b(E(b(p(i[3][1],i[4][3]),p(-i[3][3],i[4][1])),-i[2][2]),E(b(p(i[3][1],i[4][2]),p(-i[3][2],i[4][1])),i[2][3]))),-i[1][4]))),i[0][0]),E(b(b(E(b(E(b(p(i[3][3],i[4][4]),p(-i[3][4],i[4][3])),i[2][2]),b(E(b(p(i[3][2],i[4][4]),p(-i[3][4],i[4][2])),-i[2][3]),E(b(p(i[3][2],i[4][3]),p(-i[3][3],i[4][2])),i[2][4]))),i[1][0]),E(b(E(b(p(i[3][3],i[4][4]),p(-i[3][4],i[4][3])),i[2][0]),b(E(b(p(i[3][0],i[4][4]),p(-i[3][4],i[4][0])),-i[2][3]),E(b(p(i[3][0],i[4][3]),p(-i[3][3],i[4][0])),i[2][4]))),-i[1][2])),b(E(b(E(b(p(i[3][2],i[4][4]),p(-i[3][4],i[4][2])),i[2][0]),b(E(b(p(i[3][0],i[4][4]),p(-i[3][4],i[4][0])),-i[2][2]),E(b(p(i[3][0],i[4][2]),p(-i[3][2],i[4][0])),i[2][4]))),i[1][3]),E(b(E(b(p(i[3][2],i[4][3]),p(-i[3][3],i[4][2])),i[2][0]),b(E(b(p(i[3][0],i[4][3]),p(-i[3][3],i[4][0])),-i[2][2]),E(b(p(i[3][0],i[4][2]),p(-i[3][2],i[4][0])),i[2][3]))),-i[1][4]))),-i[0][1])),b(E(b(b(E(b(E(b(p(i[3][3],i[4][4]),p(-i[3][4],i[4][3])),i[2][1]),b(E(b(p(i[3][1],i[4][4]),p(-i[3][4],i[4][1])),-i[2][3]),E(b(p(i[3][1],i[4][3]),p(-i[3][3],i[4][1])),i[2][4]))),i[1][0]),E(b(E(b(p(i[3][3],i[4][4]),p(-i[3][4],i[4][3])),i[2][0]),b(E(b(p(i[3][0],i[4][4]),p(-i[3][4],i[4][0])),-i[2][3]),E(b(p(i[3][0],i[4][3]),p(-i[3][3],i[4][0])),i[2][4]))),-i[1][1])),b(E(b(E(b(p(i[3][1],i[4][4]),p(-i[3][4],i[4][1])),i[2][0]),b(E(b(p(i[3][0],i[4][4]),p(-i[3][4],i[4][0])),-i[2][1]),E(b(p(i[3][0],i[4][1]),p(-i[3][1],i[4][0])),i[2][4]))),i[1][3]),E(b(E(b(p(i[3][1],i[4][3]),p(-i[3][3],i[4][1])),i[2][0]),b(E(b(p(i[3][0],i[4][3]),p(-i[3][3],i[4][0])),-i[2][1]),E(b(p(i[3][0],i[4][1]),p(-i[3][1],i[4][0])),i[2][3]))),-i[1][4]))),i
`):z=z.replace(/\<br\>/g," ");var V="",j=[];for(Y=0;Y<z.length;++Y)j[Y]=V;N.bolds===!0&&(j=S(y,h,z,j)),N.italics===!0&&(j=S(T,f,z,j)),N.superscripts===!0&&(j=S(n,m,z,j)),N.subscripts===!0&&(j=S(b,p,z,j));var $=[],q="";for(Y=0;Y<z.length;++Y)j[Y]!==null&&(q+=z[Y],$.push(j[Y]));var oe=q.split(`
`),Z=oe.length,G=Math.round(F*O),re=O,H=O*2,J=0,ae=Z*G+H;B.height<ae&&(B.height=ae),_.fillStyle="#000",_.fillRect(0,0,B.width,B.height),_.fillStyle="#fff";var K,Y,ie,ne,le,de=0,we="";function me(){if(we!==""){var Ne=_.measureText(we).width;_.fillText(we,re+ie,H+ne),ie+=Ne}}function Le(){return""+Math.round(le)+"px "}function ve(Ne,et){var st=""+_.font;if(N.subscripts===!0){var Ze=Ne.indexOf(E),Ke=et.indexOf(E),nt=Ze>-1?parseInt(Ne[1+Ze]):0,it=Ke>-1?parseInt(et[1+Ke]):0;nt!==it&&(st=st.replace(Le(),"?px "),le*=Math.pow(.75,it-nt),st=st.replace("?px ",Le())),ne+=.25*G*(it-nt)}if(N.superscripts===!0){var lt=Ne.indexOf(v),vt=et.indexOf(v),xt=lt>-1?parseInt(Ne[1+lt]):0,Je=vt>-1?parseInt(et[1+vt]):0;xt!==Je&&(st=st.replace(Le(),"?px "),le*=Math.pow(.75,Je-xt),st=st.replace("?px ",Le())),ne-=.25*G*(Je-xt)}if(N.bolds===!0){var Pe=Ne.indexOf(h)>-1,Ue=et.indexOf(h)>-1;!Pe&&Ue&&(He?st=st.replace("italic ","italic bold "):st="bold "+st),Pe&&!Ue&&(st=st.replace("bold ",""))}if(N.italics===!0){var He=Ne.indexOf(f)>-1,Oe=et.indexOf(f)>-1;!He&&Oe&&(st="italic "+st),He&&!Oe&&(st=st.replace("italic ",""))}_.font=st}for(K=0;K<Z;++K){var Ae=oe[K]+`
`;for(ie=0,ne=K*G,le=O,we="",Y=0;Y<Ae.length;++Y){var ye=Y+de<$.length?$[Y+de]:$[$.length-1];V===ye?we+=Ae[Y]:(me(),we=Ae[Y],ye!==void 0&&(ve(V,ye),V=ye))}me(),de+=Ae.length;var Se=Math.round(ie+2*re)|0;J<Se&&(J=Se)}var _e=J,ze=H+G*Z,Ie=s(_.getImageData(0,0,_e,ze).data,[ze,_e,4]);return Ie.pick(-1,-1,0).transpose(1,0)}function C(B,_){var z=t(B,128);return _?a(z.cells,z.positions,.25):{edges:z.cells,positions:z.positions}}function x(B,_,z,O){var F=C(B,O),N=w(F.positions,_,z),V=F.edges,j=_.orientation==="ccw";if(c(N,V),_.polygons||_.polygon||_.polyline){for(var $=l(V,N),q=new Array($.length),oe=0;oe<$.length;++oe){for(var Z=$[oe],G=new Array(Z.length),re=0;re<Z.length;++re){for(var H=Z[re],J=new Array(H.length),ae=0;ae<H.length;++ae)J[ae]=N[H[ae]].slice();j&&J.reverse(),G[re]=J}q[oe]=G}return q}else return _.triangles||_.triangulate||_.triangle?{cells:u(N,V,{delaunay:!1,exterior:!1,interior:!0}),positions:N}:{edges:V,positions:N}}function k(B,_,z){try{return x(B,_,z,!0)}catch{}try{return x(B,_,z,!1)}catch{}return _.polygons||_.polyline||_.polygon?[]:_.triangles||_.triangulate||_.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function I(B,_,z,O){var F=64,N=1.25,V={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};O&&(O.size&&O.size>0&&(F=O.size),O.lineSpacing&&O.lineSpacing>0&&(N=O.lineSpacing),O.styletags&&O.styletags.breaklines&&(V.breaklines=!!O.styletags.breaklines),O.styletags&&O.styletags.bolds&&(V.bolds=!!O.styletags.bolds),O.styletags&&O.styletags.italics&&(V.italics=!!O.styletags.italics),O.styletags&&O.styletags.subscripts&&(V.subscripts=!!O.styletags.subscripts),O.styletags&&O.styletags.superscripts&&(V.superscripts=!!O.styletags.superscripts)),z.font=[O.fontStyle,O.fontVariant,O.fontWeight,F+"px",O.font].filter(function($){return $}).join(" "),z.textAlign="start",z.textBaseline="alphabetic",z.direction="ltr";var j=i(_,z,B,F,N,V);return k(j,O,F)}},5346:function(d){(function(){if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function r(C){C.permitHostObjects___&&C.permitHostObjects___(r)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=r);var t=!1;if(typeof WeakMap=="function"){var s=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var a=new s,c=Object.freeze({});if(a.set(c,1),a.get(c)!==1)t=!0;else{d.exports=WeakMap;return}}}var u=Object.getOwnPropertyNames,l=Object.defineProperty,y=Object.isExtensible,h="weakmap:",T=h+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var f=new ArrayBuffer(25),n=new Uint8Array(f);crypto.getRandomValues(n),T=h+"rand:"+Array.prototype.map.call(n,function(C){return(C%36).toString(36)}).join("")+"___"}function v(C){return!(C.substr(0,h.length)==h&&C.substr(C.length-3)==="___")}if(l(Object,"getOwnPropertyNames",{value:function(x){return u(x).filter(v)}}),"getPropertyNames"in Object){var m=Object.getPropertyNames;l(Object,"getPropertyNames",{value:function(x){return m(x).filter(v)}})}function b(C){if(C!==Object(C))throw new TypeError("Not an object: "+C);var x=C[T];if(x&&x.key===C)return x;if(y(C)){x={key:C};try{return l(C,T,{value:x,writable:!1,enumerable:!1,configurable:!1}),x}catch{return}}}(function(){var C=Object.freeze;l(Object,"freeze",{value:function(B){return b(B),C(B)}});var x=Object.seal;l(Object,"seal",{value:function(B){return b(B),x(B)}});var k=Object.preventExtensions;l(Object,"preventExtensions",{value:function(B){return b(B),k(B)}})})();function E(C){return C.prototype=null,Object.freeze(C)}var p=!1;function S(){!p&&typeof console<"u"&&(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var w=0,i=function(){this instanceof i||S();var C=[],x=[],k=w++;function I(O,F){var N,V=b(O);return V?k in V?V[k]:F:(N=C.indexOf(O),N>=0?x[N]:F)}function B(O){var F=b(O);return F?k in F:C.indexOf(O)>=0}function _(O,F){var N,V=b(O);return V?V[k]=F:(N=C.indexOf(O),N>=0?x[N]=F:(N=C.length,x[N]=F,C[N]=O)),this}function z(O){var F=b(O),N,V;return F?k in F&&delete F[k]:(N=C.indexO
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/function A(Je,Pe){if(!(Je instanceof Pe))throw new TypeError("Cannot call a class as a function")}function P(Je,Pe){for(var Ue=0;Ue<Pe.length;Ue++){var He=Pe[Ue];He.enumerable=He.enumerable||!1,He.configurable=!0,"value"in He&&(He.writable=!0),Object.defineProperty(Je,L(He.key),He)}}function o(Je,Pe,Ue){return P(Je.prototype,Pe),Object.defineProperty(Je,"prototype",{writable:!1}),Je}function L(Je){var Pe=M(Je,"string");return c(Pe)==="symbol"?Pe:String(Pe)}function M(Je,Pe){if(c(Je)!=="object"||Je===null)return Je;var Ue=Je[Symbol.toPrimitive];if(Ue!==void 0){var He=Ue.call(Je,Pe);if(c(He)!=="object")return He;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Je)}function d(Je,Pe,Ue){function He(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{return!1}}return Pe=r(Pe),g(Je,He()?Reflect.construct(Pe,[],r(Je).constructor):Pe.apply(Je,Ue))}function g(Je,Pe){if(Pe&&(c(Pe)==="object"||typeof Pe=="function"))return Pe;if(Pe!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return t(Je)}function r(Je){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Ue){return Ue.__proto__||Object.getPrototypeOf(Ue)},r(Je)}function t(Je){if(Je===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Je}function s(Je,Pe){if(typeof Pe!="function"&&Pe!==null)throw new TypeError("Super expression must either be null or a function");Je.prototype=Object.create(Pe&&Pe.prototype,{constructor:{value:Je,writable:!0,configurable:!0}}),Object.defineProperty(Je,"prototype",{writable:!1}),Pe&&a(Je,Pe)}function a(Je,Pe){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(He,Oe){return He.__proto__=Oe,He},a(Je,Pe)}function c(Je){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},c(Je)}var u=e(59968),l=e(35984),y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;X.Buffer=n,X.SlowBuffer=k,X.INSPECT_MAX_BYTES=50;var h=2147483647;X.kMaxLength=h,n.TYPED_ARRAY_SUPPORT=T(),!n.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function T(){try{var Je=new Uint8Array(1),Pe={foo:function(){return 42}};return Object.setPrototypeOf(Pe,Uint8Array.prototype),Object.setPrototypeOf(Je,Pe),Je.foo()===42}catch{return!1}}Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.buffer}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.byteOffset}});function f(Je){if(Je>h)throw new RangeError('The value "'+Je+'" is invalid for option "size"');var Pe=new Uint8Array(Je);return Object.setPrototypeOf(Pe,n.prototype),Pe}function n(Je,Pe,Ue){if(typeof Je=="number"){if(typeof Pe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(Je)}return v(Je,Pe,Ue)}n.poolSize=8192;function v(Je,Pe,Ue){if(typeof Je=="string")return p(Je,Pe);if(ArrayBuffer.isView(Je))return w(Je);if(Je==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(Je));if(nt(Je,ArrayBuffer)||Je&&nt(Je.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(nt(Je,SharedArrayBuffer)||Je&&nt(Je.buffer,SharedArrayBuffer)))return i(Je,Pe,Ue);if(typeof Je=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var He=Je.valueOf&&Je.valueOf();if(He!=null&&He!==Je)return n.from(He,Pe,Ue);var Oe=C(Je);if(Oe)return Oe;if(
]`),Xe=se.charCodeAt(0);function Qe(Ot,jt,wr){arguments.length<3&&(wr=jt,jt=null);var Tr=xn(Ot,Me,jt==null?rt:Tt(jt),wr);return Tr.row=function(Wr){return arguments.length?Tr.response((jt=Wr)==null?rt:Tt(Wr)):jt},Tr}function rt(Ot){return Qe.parse(Ot.responseText)}function Tt(Ot){return function(jt){return Qe.parse(jt.responseText,Ot)}}Qe.parse=function(Ot,jt){var wr;return Qe.parseRows(Ot,function(Tr,Wr){if(wr)return wr(Tr,Wr-1);var qr=function(Mr){for(var kr={},Hr=Tr.length,rn=0;rn<Hr;++rn)kr[Tr[rn]]=Mr[rn];return kr};wr=jt?function(Mr,kr){return jt(qr(Mr),kr)}:qr})},Qe.parseRows=function(Ot,jt){var wr={},Tr={},Wr=[],qr=Ot.length,Mr=0,kr=0,Hr,rn;function on(){if(Mr>=qr)return Tr;if(rn)return rn=!1,wr;var _n=Mr;if(Ot.charCodeAt(_n)===34){for(var Xn=_n;Xn++<qr;)if(Ot.charCodeAt(Xn)===34){if(Ot.charCodeAt(Xn+1)!==34)break;++Xn}Mr=Xn+2;var ta=Ot.charCodeAt(Xn+1);return ta===13?(rn=!0,Ot.charCodeAt(Xn+2)===10&&++Mr):ta===10&&(rn=!0),Ot.slice(_n+1,Xn).replace(/""/g,'"')}for(;Mr<qr;){var ta=Ot.charCodeAt(Mr++),Wn=1;if(ta===10)rn=!0;else if(ta===13)rn=!0,Ot.charCodeAt(Mr)===10&&(++Mr,++Wn);else if(ta!==Xe)continue;return Ot.slice(_n,Mr-Wn)}return Ot.slice(_n)}for(;(Hr=on())!==Tr;){for(var Zr=[];Hr!==wr&&Hr!==Tr;)Zr.push(Hr),Hr=on();jt&&(Zr=jt(Zr,kr++))==null||Wr.push(Zr)}return Wr},Qe.format=function(Ot){if(Array.isArray(Ot[0]))return Qe.formatRows(Ot);var jt=new _,wr=[];return Ot.forEach(function(Tr){for(var Wr in Tr)jt.has(Wr)||wr.push(jt.add(Wr))}),[wr.map(Ft).join(se)].concat(Ot.map(function(Tr){return wr.map(function(Wr){return Ft(Tr[Wr])}).join(se)})).join(`
`)},Qe.formatRows=function(Ot){return Ot.map(yt).join(`
`)};function yt(Ot){return Ot.map(Ft).join(se)}function Ft(Ot){return De.test(Ot)?'"'+Ot.replace(/\"/g,'""')+'"':Ot}return Qe},o.csv=o.dsv(",","text/csv"),o.tsv=o.dsv(" ","text/tab-separated-values");var Br,_r,Qr,un,ln=this[F(this,"requestAnimationFrame")]||function(se){setTimeout(se,17)};o.timer=function(){Mn.apply(this,arguments)};function Mn(se,Me,De){var Xe=arguments.length;Xe<2&&(Me=0),Xe<3&&(De=Date.now());var Qe=De+Me,rt={c:se,t:Qe,n:null};return _r?_r.n=rt:Br=rt,_r=rt,Qr||(un=clearTimeout(un),Qr=1,ln(Dn)),rt}function Dn(){var se=Kn(),Me=sa()-se;Me>24?(isFinite(Me)&&(clearTimeout(un),un=setTimeout(Dn,Me)),Qr=0):(Qr=1,ln(Dn))}o.timer.flush=function(){Kn(),sa()};function Kn(){for(var se=Date.now(),Me=Br;Me;)se>=Me.t&&Me.c(se-Me.t)&&(Me.c=null),Me=Me.n;return se}function sa(){for(var se,Me=Br,De=1/0;Me;)Me.c?(Me.t<De&&(De=Me.t),Me=(se=Me).n):Me=se?se.n=Me.n:Br=Me.n;return _r=se,De}o.round=function(se,Me){return Me?Math.round(se*(Me=Math.pow(10,Me)))/Me:Math.round(se)},o.geom={};function na(se){return se[0]}function Jn(se){return se[1]}o.geom.hull=function(se){var Me=na,De=Jn;if(arguments.length)return Xe(se);function Xe(Qe){if(Qe.length<3)return[];var rt=Jr(Me),Tt=Jr(De),yt,Ft=Qe.length,Ot=[],jt=[];for(yt=0;yt<Ft;yt++)Ot.push([+rt.call(this,Qe[yt],yt),+Tt.call(this,Qe[yt],yt),yt]);for(Ot.sort(pr),yt=0;yt<Ft;yt++)jt.push([Ot[yt][0],-Ot[yt][1]]);var wr=aa(Ot),Tr=aa(jt),Wr=Tr[0]===wr[0],qr=Tr[Tr.length-1]===wr[wr.length-1],Mr=[];for(yt=wr.length-1;yt>=0;--yt)Mr.push(Qe[Ot[wr[yt]][2]]);for(yt=+Wr;yt<Tr.length-qr;++yt)Mr.push(Qe[Ot[Tr[yt]][2]]);return Mr}return Xe.x=function(Qe){return arguments.length?(Me=Qe,Xe):Me},Xe.y=function(Qe){return arguments.length?(De=Qe,Xe):De},Xe};function aa(se){for(var Me=se.length,De=[0,1],Xe=2,Qe=2;Qe<Me;Qe++){for(;Xe>1&&Nt(se[De[Xe-2]],se[De[Xe-1]],se[Qe])<=0;)--Xe;De[Xe++]=Qe}return De.slice(0,Xe)}function pr(se,Me){return se[0]-Me[0]||se[1]-Me[1]}o.geom.polygon=function(se){return re(se,$r),se};var $r=o.geom.polygon.prototype=[];$r.area=function(){for(var se=-1,Me=this.length,De,Xe=this[Me-1],Qe=0;++se<Me;)De=Xe,Xe=this[se],Qe+=De[1]*Xe[0]-De[0]*Xe[1];return Qe*.5},$r.centroid=function(se){var Me=-1,De=this.length,Xe=0,Qe=0,rt,Tt=this[De-1],yt;for(arguments.length||(se=-1/(6*this.area()));++Me<De;)rt=Tt,Tt=this[Me],yt=rt[0]*Tt[1]-Tt[0]*rt[1],Xe+=(rt[0]+Tt[0])*yt,Qe+=(rt[1]+Tt[1])*yt;return[Xe*se,Qe*se]},$r.clip=function(se){for(var Me,De=zn(se),Xe=-1,Qe=this.length-zn(this),rt,Tt,yt=this[Qe-1],Ft,Ot,jt;++Xe<Qe;){for(Me=se.slice(),se.length=0,Ft=this[Xe],Ot=Me[(Tt=Me.length-De)-1],rt=-1;++rt<Tt;)jt=Me[rt],Xr(jt,yt,Ft)?(Xr(Ot,yt,Ft)||se.push(fn(Ot,jt,yt,Ft)),se.push(jt)):Xr(Ot,yt,Ft)&&se.push(fn(Ot,jt,yt,Ft)),Ot=jt;De&&se.push(se[0]),yt=Ft}return se};function Xr(se,Me,De){return(De[0]-Me[0])*(se[1]-Me[1])<(De[1]-Me[1])*(se[0]-Me[0])}function fn(se,Me,De,Xe){var Qe=se[0],rt=De[0],Tt=Me[0]-Qe,yt=Xe[0]-rt,Ft=se[1],Ot=De[1],jt=Me[1]-Ft,wr=Xe[1]-Ot,Tr=(yt*(Ft-Ot)-wr*(Qe-rt))/(wr*Tt-yt*jt);return[Qe+Tr*Tt,Ft+Tr*jt]}function zn(se){var Me=se[0],De=se[se.length-1];return!(Me[0]-De[0]||Me[1]-De[1])}var pn,gn,In,Gn=[],ua,Ma,xr=[];function Rr(){uo(this),this.edge=this.site=this.circle=null}function yr(se){var Me=Gn.pop()||new Rr;return Me.site=se,Me}function Dr(se){wn(se),In.remove(se),Gn.push(se),uo(se)}function vn(se){var Me=se.circle,De=Me.x,Xe=Me.cy,Qe={x:De,y:Xe},rt=se.P,Tt=se.N,yt=[se];Dr(se);for(var Ft=rt;Ft.circle&&v(De-Ft.circle.x)<pe&&v(Xe-Ft.circle.cy)<pe;)rt=Ft.P,yt.unshift(Ft),Dr(Ft),Ft=rt;yt.unshift(Ft),wn(Ft);for(var Ot=Tt;Ot.circle&&v(De-Ot.circle.x)<pe&&v(Xe-Ot.circle.cy)<pe;)Tt=Ot.N,yt.push(Ot),Dr(Ot),Ot=Tt;yt.push(Ot),wn(Ot);var jt=yt.length,wr;for(wr=1;wr<jt;++wr)Ot=yt[wr],Ft=yt[wr-1],ba(Ot.edge,Ft.site,Ot.site,Qe);Ft=yt[0],Ot=yt[jt-1],Ot.edge=$n(Ft.site,Ot.site,null,Qe),dn(Ft),dn(Ot)}function En(se){for(var Me=se.x,De=se.y,Xe,Qe,rt,Tt,yt=In._;yt;)if(rt=an(yt,De)-Me,rt>pe)yt=yt.L;else if(Tt=Me-en(yt,De),Tt>pe){if(!yt.R){Xe=yt;break}yt=yt.R}else{rt>-1e-6?(Xe=yt.P,Qe=yt):Tt>-1e-6?(Xe=yt,Qe=yt.N):Xe=Qe=yt;break}var Ft=yr(se);if(In.insert(Xe,Ft),!(!Xe&&!Qe)){if(Xe===Qe){wn(Xe),Qe=y
precision mediump float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif`,Ls=`#ifdef GL_ES
precision highp float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`,jl=`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,bu="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",Ga=`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,qs="uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}",Kl=`varying vec3 v_data;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,Ii=`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main(void) {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`,$i="void main() {gl_FragColor=vec4(1.0);}",Ps="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",Ll=`uniform highp float u_intensity;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#define GAUSS_COEF 0.3989422804014327
void main() {
#pragma mapbox: initialize highp float weight
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,xi=`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#pragma mapbox: define mediump float radius
const highp float ZERO=1.0/255.0/16.0;
#define GAUSS_COEF 0.3989422804014327
void main(void) {
#pragma mapbox: initialize highp float weight
#pragma mapbox: initialize mediump float radius
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`,Rs=`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(0.0);
#endif
}`,Ti="uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}",Ci="varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}",Ds="attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}",Bi="varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}",Ni="attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}",fo="uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}",wu="attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}",io=`#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_FragColor=color*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,nf=`attribute vec2 a_pos;uniform mat4 u_matrix;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);}`,_o=`varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,ki=`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`,Jl=`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,es=`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`,zo=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,Ql=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`,Tu=`varying vec4 v_color;void main() {gl_FragColor=v_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,af=`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;
#pragma mapbox: define highp float base
#pragma mapbox: define highp float height
#pragma mapbox: define highp vec4 color
void main() {
#pragma mapbox: initialize highp float base
#pragma mapbox: initialize highp float height
#pragma mapbox: initialize highp vec4 color
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`,Pl=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,of=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
? a_pos
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,sf=`#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,lf="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",$l=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
#define PI 3.141592653589793
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,uf="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",ff=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,Au=`
#define scale 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Mu=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,ds=`
#define scale 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Is=`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,el=`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`,tl=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,Su=`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`,Wo=`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,cf="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",Rl=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,Eu=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,Cu=`#define SDF_PX 8.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,Dl=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`,bo=`#define SDF_PX 8.0
#define SDF 1.0
#define ICON 0.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,ks=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,ps=ai(Oi,Ls),rl=ai(jl,bu),ts=ai(Ga,qs),Fo=ai(Kl,Ii),ql=ai($i,Ps),_s=ai(Ll,xi),wo=ai(Rs,Ti),yi=ai(Ci,Ds),eu=ai(Bi,Ni),hf=ai(fo,wu),Il=ai(io,nf),zs=ai(_o,ki),Fs=ai(Jl,es),vo=ai(zo,Ql),kl=ai(Tu,af),Os=ai(Pl,of),_l=ai(sf,lf),vf=ai($l,uf),Lu=ai(ff,Au),tu=ai(Mu,ds),ru=ai(Is,el),nu=ai(tl,Su),Bs=ai(Wo,cf),zl=ai(Rl,Eu),nl=ai(Cu,Dl),Fl=ai(bo,ks);function ai(ce,W){var fe=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Q=W.match(/attribute ([\w]+) ([\w]+)/g),he=ce.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Re=W.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ge=Re?Re.concat(he):he,tt={};return ce=ce.replace(fe,function(wt,zt,Xt,tr,qt){return tt[qt]=!0,zt==="define"?`
#ifndef HAS_UNIFORM_u_`+qt+`
varying `+Xt+" "+tr+" "+qt+`;
#else
uniform `+Xt+" "+tr+" u_"+qt+`;
#endif
`:`
#ifdef HAS_UNIFORM_u_`+qt+`
`+Xt+" "+tr+" "+qt+" = u_"+qt+`;
#endif
`}),W=W.replace(fe,function(wt,zt,Xt,tr,qt){var Cr=tr==="float"?"vec2":"vec4",Ur=qt.match(/color/)?"color":Cr;return tt[qt]?zt==="define"?`
#ifndef HAS_UNIFORM_u_`+qt+`
uniform lowp float u_`+qt+`_t;
attribute `+Xt+" "+Cr+" a_"+qt+`;
varying `+Xt+" "+tr+" "+qt+`;
#else
uniform `+Xt+" "+tr+" u_"+qt+`;
#endif
`:Ur==="vec4"?`
#ifndef HAS_UNIFORM_u_`+qt+`
`+qt+" = a_"+qt+`;
#else
`+Xt+" "+tr+" "+qt+" = u_"+qt+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+qt+`
`+qt+" = unpack_mix_"+Ur+"(a_"+qt+", u_"+qt+`_t);
#else
`+Xt+" "+tr+" "+qt+" = u_"+qt+`;
#endif
`:zt==="define"?`
#ifndef HAS_UNIFORM_u_`+qt+`
uniform lowp float u_`+qt+`_t;
attribute `+Xt+" "+Cr+" a_"+qt+`;
#else
uniform `+Xt+" "+tr+" u_"+qt+`;
#endif
`:Ur==="vec4"?`
#ifndef HAS_UNIFORM_u_`+qt+`
`+Xt+" "+tr+" "+qt+" = a_"+qt+`;
#else
`+Xt+" "+tr+" "+qt+" = u_"+qt+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+qt+`
`+Xt+" "+tr+" "+qt+" = unpack_mix_"+Ur+"(a_"+qt+", u_"+qt+`_t);
#else
`+Xt+" "+tr+" "+qt+" = u_"+qt+`;
#endif
`}),{fragmentSource:ce,vertexSource:W,staticAttributes:Q,staticUniforms:Ge}}var Pu=Object.freeze({__proto__:null,prelude:ps,background:rl,backgroundPattern:ts,circle:Fo,clippingMask:ql,heatmap:_s,heatmapTexture:wo,collisionBox:yi,collisionCircle:eu,debug:hf,fill:Il,fillOutline:zs,fillOutlinePattern:Fs,fillPattern:vo,fillExtrusion:kl,fillExtrusionPattern:Os,hillshadePrepare:_l,hillshade:vf,line:Lu,lineGradient:tu,linePattern:ru,lineSDF:nu,raster:Bs,symbolIcon:zl,symbolSDF:nl,symbolTextAndIcon:Fl}),To=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};To.prototype.bind=function(W,fe,Q,he,Re,Ge,tt,wt){this.context=W;for(var zt=this.boundPaintVertexBuffers.length!==he.length,Xt=0;!zt&&Xt<he.length;Xt++)this.boundPaintVertexBuffers[Xt]!==he[Xt]&&(zt=!0);var tr=!this.vao||this.boundProgram!==fe||this.boundLayoutVertexBuffer!==Q||zt||this.boundIndexBuffer!==Re||this.boundVertexOffset!==Ge||this.boundDynamicVertexBuffer!==tt||this.boundDynamicVertexBuffer2!==wt;!W.extVertexArrayObject||tr?this.freshBind(fe,Q,he,Re,Ge,tt,wt):(W.bindVertexArrayOES.set(this.vao),tt&&tt.bind(),Re&&Re.dynamicDraw&&Re.bind(),wt&&wt.bind())},To.prototype.freshBind=function(W,fe,Q,he,Re,Ge,tt){var wt,zt=W.numAttributes,Xt=this.context,tr=Xt.gl;if(Xt.extVertexArrayObject)this.vao&&this.destroy(),this.vao=Xt.extVertexArrayObject.createVertexArrayOES(),Xt.bindVertexArrayOES.set(this.vao),wt=0,this.boundProgram=W,this.boundLayoutVertexBuffer=fe,this.boundPaintVertexBuffers=Q,this.boundIndexBuffer=he,this.boundVertexOffset=Re,this.boundDynamicVertexBuffer=Ge,this.boundDynamicVertexBuffer2=tt;else{wt=Xt.currentNumAttributes||0;for(var qt=zt;qt<wt;qt++)tr.disableVertexAttribArray(qt)}fe.enableAttributes(tr,W);for(var Cr=0,Ur=Q;Cr<Ur.length;Cr+=1){var Nr=Ur[Cr];Nr.enableAttributes(tr,W)}Ge&&Ge.enableAttributes(tr,W),tt&&tt.enableAttributes(tr,W),fe.bind(),fe.setVertexAttribPointers(tr,W,Re);for(var Fr=0,Gr=Q;Fr<Gr.length;Fr+=1){var nn=Gr[Fr];nn.bind(),nn.setVertexAttribPointers(tr,W,Re)}Ge&&(Ge.bind(),Ge.setVertexAttribPointers(tr,W,Re)),he&&he.bind(),tt&&(tt.bind(),tt.setVertexAttribPointers(tr,W,Re)),Xt.currentNumAttributes=zt},To.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};function Ru(ce){for(var W=[],fe=0;fe<ce.length;fe++)if(ce[fe]!==null){var Q=ce[fe].split(" ");W.push(Q.pop())}return W}var au=function(W,fe,Q,he,Re,Ge){var tt=W.gl;this.program=tt.createProgram();for(var wt=Ru(Q.staticAttributes),zt=he?he.getBinderAttributes():[],Xt=wt.concat(zt),tr=Q.staticUniforms?Ru(Q.staticUniforms):[],qt=he?he.getBinderUniforms():[],Cr=tr.concat(qt),Ur=[],Nr=0,Fr=Cr;Nr<Fr.length;Nr+=1){var Gr=Fr[Nr];Ur.indexOf(Gr)<0&&Ur.push(Gr)}var nn=he?he.defines():[];Ge&&nn.push("#define OVERDRAW_INSPECTOR;");var Cn=nn.concat(ps.fragmentSource,Q.fragmentSource).join(`
`),Rn=nn.concat(ps.vertexSource,Q.vertexSource).join(`
`),Bn=tt.createShader(tt.FRAGMENT_SHADER);if(tt.isContextLost()){this.failedToCreate=!0;return}tt.shaderSource(Bn,Cn),tt.compileShader(Bn),tt.attachShader(this.program,Bn);var Nn=tt.createShader(tt.VERTEX_SHADER);if(tt.isContextLost()){this.failedToCreate=!0;return}tt.shaderSource(Nn,Rn),tt.compileShader(Nn),tt.attachShader(this.program,Nn),this.attributes={};var Fn={};this.numAttributes=Xt.length;for(var Vn=0;Vn<this.numAttributes;Vn++)Xt[Vn]&&(tt.bindAttribLocation(this.program,Vn,Xt[Vn]),this.attributes[Xt[Vn]]=Vn);tt.linkProgram(this.program),tt.deleteShader(Nn),tt.deleteShader(Bn);for(var Zn=0;Zn<Ur.length;Zn++){var ea=Ur[Zn];if(ea&&!Fn[ea]){var ca=tt.getUniformLocation(this.program,ea);ca&&(Fn[ea]=ca)}}this.fixedUniforms=Re(W,Fn),this.binderUniforms=he?he.getUniforms(W,Fn):[]};au.prototype.draw=function(W,fe,Q,he,Re,Ge,tt,wt,zt,Xt,tr,qt,Cr,Ur,Nr,Fr){var Gr,nn=W.gl;if(!this.failedToCreate){W.program.set(this.program),W.setDepthMode(Q),W.setStencilMode(he),W.setColorMode(Re),W.setCullFace(Ge);for(var Cn in this.fixedUniforms)this.fixedUniforms[Cn].set(tt[Cn]);Ur&&Ur.setUniforms(W,this.binderUniforms,qt,{zoom:Cr});for(var Rn=(Gr={},Gr[nn.LINES]=2,Gr[nn.TRIANGLES]=3,Gr[nn.LINE_STRIP]=1,Gr)[fe],Bn=0,Nn=tr.get();Bn<Nn.length;Bn+=1){var Fn=Nn[Bn],Vn=Fn.vaos||(Fn.vaos={}),Zn=Vn[wt]||(Vn[wt]=new To);Zn.bind(W,this,zt,Ur?Ur.getPaintVertexBuffers():[],Xt,Fn.vertexOffset,Nr,Fr),nn.drawElements(fe,Fn.primitiveLength*Rn,nn.UNSIGNED_SHORT,Fn.primitiveOffset*Rn*2)}}};function gs(ce,W,fe){var Q=1/fn(fe,1,W.transform.tileZoom),he=Math.pow(2,fe.tileID.overscaledZ),Re=fe.tileSize*Math.pow(2,W.transform.tileZoom)/he,Ge=Re*(fe.tileID.canonical.x+fe.tileID.wrap*he),tt=Re*fe.tileID.canonical.y;return{u_image:0,u_texsize:fe.imageAtlasTexture.size,u_scale:[Q,ce.fromScale,ce.toScale],u_fade:ce.t,u_pixel_coord_upper:[Ge>>16,tt>>16],u_pixel_coord_lower:[Ge&65535,tt&65535]}}function rs(ce,W,fe,Q){var he=fe.imageManager.getPattern(ce.from.toString()),Re=fe.imageManager.getPattern(ce.to.toString()),Ge=fe.imageManager.getPixelSize(),tt=Ge.width,wt=Ge.height,zt=Math.pow(2,Q.tileID.overscaledZ),Xt=Q.tileSize*Math.pow(2,fe.transform.tileZoom)/zt,tr=Xt*(Q.tileID.canonical.x+Q.tileID.wrap*zt),qt=Xt*Q.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:he.tl,u_pattern_br_a:he.br,u_pattern_tl_b:Re.tl,u_pattern_br_b:Re.br,u_texsize:[tt,wt],u_mix:W.t,u_pattern_size_a:he.displaySize,u_pattern_size_b:Re.displaySize,u_scale_a:W.fromScale,u_scale_b:W.toScale,u_tile_units_to_pixels:1/fn(Q,1,fe.transform.tileZoom),u_pixel_coord_upper:[tr>>16,qt>>16],u_pixel_coord_lower:[tr&65535,qt&65535]}}var Ol=function(ce,W){return{u_matrix:new o.UniformMatrix4f(ce,W.u_matrix),u_lightpos:new o.Uniform3f(ce,W.u_lightpos),u_lightintensity:new o.Uniform1f(ce,W.u_lightintensity),u_lightcolor:new o.Uniform3f(ce,W.u_lightcolor),u_vertical_gradient:new o.Uniform1f(ce,W.u_vertical_gradient),u_opacity:new o.Uniform1f(ce,W.u_opacity)}},bi=function(ce,W){return{u_matrix:new o.UniformMatrix4f(ce,W.u_matrix),u_lightpos:new o.Uniform3f(ce,W.u_lightpos),u_lightintensity:new o.Uniform1f(ce,W.u_lightintensity),u_lightcolor:new o.Uniform3f(ce,W.u_lightcolor),u_vertical_gradient:new o.Uniform1f(ce,W.u_vertical_gradient),u_height_factor:new o.Uniform1f(ce,W.u_height_factor),u_image:new o.Uniform1i(ce,W.u_image),u_texsize:new o.Uniform2f(ce,W.u_texsize),u_pixel_coord_upper:new o.Uniform2f(ce,W.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(ce,W.u_pixel_coord_lower),u_scale:new o.Uniform3f(ce,W.u_scale),u_fade:new o.Uniform1f(ce,W.u_fade),u_opacity:new o.Uniform1f(ce,W.u_opacity)}},al=function(ce,W,fe,Q){var he=W.style.light,Re=he.properties.get("position"),Ge=[Re.x,Re.y,Re.z],tt=o.create$1();he.properties.get("anchor")==="viewport"&&o.fromRotation(tt,-W.transform.angle),o.transformMat3(Ge,Ge,tt);var wt=he.properties.get("color");return{u_matrix:ce,u_lightpos:Ge,u_lightintensity:he.properties.get("intensity"),u_lightcolor:[wt.r,wt.g,wt.b],u_vertical_gradient:+fe,u_opacity:Q}},Ao=function(ce,W,fe,Q,he,Re,Ge){return o.extend(al(ce,W,fe,Q),gs(Re,W,Ge),{u_height_factor:-Math.pow(2,he.oversca
`)+'Actual message: "'.concat($&&$.message,'"'),stackStartFn:j})}throw $}}E.throws=function j($){for(var q=arguments.length,oe=new Array(q>1?q-1:0),Z=1;Z<q;Z++)oe[Z-1]=arguments[Z];F.apply(void 0,[j,_($)].concat(oe))},E.rejects=function j($){for(var q=arguments.length,oe=new Array(q>1?q-1:0),Z=1;Z<q;Z++)oe[Z-1]=arguments[Z];return O($).then(function(G){return F.apply(void 0,[j,G].concat(oe))})},E.doesNotThrow=function j($){for(var q=arguments.length,oe=new Array(q>1?q-1:0),Z=1;Z<q;Z++)oe[Z-1]=arguments[Z];N.apply(void 0,[j,_($)].concat(oe))},E.doesNotReject=function j($){for(var q=arguments.length,oe=new Array(q>1?q-1:0),Z=1;Z<q;Z++)oe[Z-1]=arguments[Z];return O($).then(function(G){return N.apply(void 0,[j,G].concat(oe))})},E.ifError=function j($){if($!=null){var q="ifError got unwanted exception: ";P($)==="object"&&typeof $.message=="string"?$.message.length===0&&$.constructor?q+=$.constructor.name:q+=$.message:q+=u($);var oe=new a({actual:$,expected:null,operator:"ifError",message:q,stackStartFn:j}),Z=$.stack;if(typeof Z=="string"){var G=Z.split(`
`);G.shift();for(var re=oe.stack.split(`
`),H=0;H<G.length;H++){var J=re.indexOf(G[H]);if(J!==-1){re=re.slice(0,J);break}}oe.stack="".concat(re.join(`
`),`
`).concat(G.join(`
`))}throw oe}};function V(){for(var j=arguments.length,$=new Array(j),q=0;q<j;q++)$[q]=arguments[q];i.apply(void 0,[V,$.length].concat($))}E.strict=T(V,E,{equal:E.strictEqual,deepEqual:E.deepStrictEqual,notEqual:E.notStrictEqual,notDeepEqual:E.notDeepStrictEqual}),E.strict.strict=E.strict},26144:function(te,X,e){var A=e(4168);function P(_){for(var z=1;z<arguments.length;z++){var O=arguments[z]!=null?arguments[z]:{},F=Object.keys(O);typeof Object.getOwnPropertySymbols=="function"&&(F=F.concat(Object.getOwnPropertySymbols(O).filter(function(N){return Object.getOwnPropertyDescriptor(O,N).enumerable}))),F.forEach(function(N){o(_,N,O[N])})}return _}function o(_,z,O){return z in _?Object.defineProperty(_,z,{value:O,enumerable:!0,configurable:!0,writable:!0}):_[z]=O,_}function L(_,z){if(!(_ instanceof z))throw new TypeError("Cannot call a class as a function")}function M(_,z){for(var O=0;O<z.length;O++){var F=z[O];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(_,F.key,F)}}function d(_,z,O){return M(_.prototype,z),_}function g(_,z){return z&&(h(z)==="object"||typeof z=="function")?z:r(_)}function r(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function t(_,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(z&&z.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),z&&l(_,z)}function s(_){var z=typeof Map=="function"?new Map:void 0;return s=function(F){if(F===null||!u(F))return F;if(typeof F!="function")throw new TypeError("Super expression must either be null or a function");if(typeof z<"u"){if(z.has(F))return z.get(F);z.set(F,N)}function N(){return c(F,arguments,y(this).constructor)}return N.prototype=Object.create(F.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),l(N,F)},s(_)}function a(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function c(_,z,O){return a()?c=Reflect.construct:c=function(N,V,j){var $=[null];$.push.apply($,V);var q=Function.bind.apply(N,$),oe=new q;return j&&l(oe,j.prototype),oe},c.apply(null,arguments)}function u(_){return Function.toString.call(_).indexOf("[native code]")!==-1}function l(_,z){return l=Object.setPrototypeOf||function(F,N){return F.__proto__=N,F},l(_,z)}function y(_){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(O){return O.__proto__||Object.getPrototypeOf(O)},y(_)}function h(_){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(O){return typeof O}:h=function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},h(_)}var T=e(35840),f=T.inspect,n=e(86832),v=n.codes.ERR_INVALID_ARG_TYPE;function m(_,z,O){return(O===void 0||O>_.length)&&(O=_.length),_.substring(O-z.length,O)===z}function b(_,z){if(z=Math.floor(z),_.length==0||z==0)return"";var O=_.length*z;for(z=Math.floor(Math.log(z)/Math.log(2));z;)_+=_,z--;return _+=_.substring(0,O-_.length),_}var E="",p="",S="",w="",i={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},C=10;function x(_){var z=Object.keys(_),O=Object.create(Object.getPrototypeOf(_));return z.forEach(function(F){O[F]=_[F]}),Object.defineProperty(O,"message",{va
`),Z=k(z).split(`
`),G=0,re="";if(O==="strictEqual"&&h(_)==="object"&&h(z)==="object"&&_!==null&&z!==null&&(O="strictEqualObject"),oe.length===1&&Z.length===1&&oe[0]!==Z[0]){var H=oe[0].length+Z[0].length;if(H<=C){if((h(_)!=="object"||_===null)&&(h(z)!=="object"||z===null)&&(_!==0||z!==0))return"".concat(i[O],`
`)+"".concat(oe[0]," !== ").concat(Z[0],`
`)}else if(O!=="strictEqualObject"){var J=A.stderr&&A.stderr.isTTY?A.stderr.columns:80;if(H<J){for(;oe[0][G]===Z[0][G];)G++;G>2&&(re=`
`.concat(b(" ",G),"^"),G=0)}}}for(var ae=oe[oe.length-1],K=Z[Z.length-1];ae===K&&(G++<2?j=`
`.concat(ae).concat(j):F=ae,oe.pop(),Z.pop(),!(oe.length===0||Z.length===0));)ae=oe[oe.length-1],K=Z[Z.length-1];var Y=Math.max(oe.length,Z.length);if(Y===0){var ie=q.split(`
`);if(ie.length>30)for(ie[26]="".concat(E,"...").concat(w);ie.length>27;)ie.pop();return"".concat(i.notIdentical,`
`).concat(ie.join(`
`),`
`)}G>3&&(j=`
`.concat(E,"...").concat(w).concat(j),$=!0),F!==""&&(j=`
`.concat(F).concat(j),F="");var ne=0,le=i[O]+`
`.concat(p,"+ actual").concat(w," ").concat(S,"- expected").concat(w),de=" ".concat(E,"...").concat(w," Lines skipped");for(G=0;G<Y;G++){var we=G-V;if(oe.length<G+1)we>1&&G>2&&(we>4?(N+=`
`.concat(E,"...").concat(w),$=!0):we>3&&(N+=`
`.concat(Z[G-2]),ne++),N+=`
`.concat(Z[G-1]),ne++),V=G,F+=`
`.concat(S,"-").concat(w," ").concat(Z[G]),ne++;else if(Z.length<G+1)we>1&&G>2&&(we>4?(N+=`
`.concat(E,"...").concat(w),$=!0):we>3&&(N+=`
`.concat(oe[G-2]),ne++),N+=`
`.concat(oe[G-1]),ne++),V=G,N+=`
`.concat(p,"+").concat(w," ").concat(oe[G]),ne++;else{var me=Z[G],Le=oe[G],ve=Le!==me&&(!m(Le,",")||Le.slice(0,-1)!==me);ve&&m(me,",")&&me.slice(0,-1)===Le&&(ve=!1,Le+=","),ve?(we>1&&G>2&&(we>4?(N+=`
`.concat(E,"...").concat(w),$=!0):we>3&&(N+=`
`.concat(oe[G-2]),ne++),N+=`
`.concat(oe[G-1]),ne++),V=G,N+=`
`.concat(p,"+").concat(w," ").concat(Le),F+=`
`.concat(S,"-").concat(w," ").concat(me),ne+=2):(N+=F,F="",(we===1||G===0)&&(N+=`
`.concat(Le),ne++))}if(ne>20&&G<Y-2)return"".concat(le).concat(de,`
`).concat(N,`
`).concat(E,"...").concat(w).concat(F,`
`)+"".concat(E,"...").concat(w)}return"".concat(le).concat($?de:"",`
`).concat(N).concat(F).concat(j).concat(re)}var B=function(_){t(z,_);function z(O){var F;if(L(this,z),h(O)!=="object"||O===null)throw new v("options","Object",O);var N=O.message,V=O.operator,j=O.stackStartFn,$=O.actual,q=O.expected,oe=Error.stackTraceLimit;if(Error.stackTraceLimit=0,N!=null)F=g(this,y(z).call(this,String(N)));else if(A.stderr&&A.stderr.isTTY&&(A.stderr&&A.stderr.getColorDepth&&A.stderr.getColorDepth()!==1?(E="\x1B[34m",p="\x1B[32m",w="\x1B[39m",S="\x1B[31m"):(E="",p="",w="",S="")),h($)==="object"&&$!==null&&h(q)==="object"&&q!==null&&"stack"in $&&$ instanceof Error&&"stack"in q&&q instanceof Error&&($=x($),q=x(q)),V==="deepStrictEqual"||V==="strictEqual")F=g(this,y(z).call(this,I($,q,V)));else if(V==="notDeepStrictEqual"||V==="notStrictEqual"){var Z=i[V],G=k($).split(`
`);if(V==="notStrictEqual"&&h($)==="object"&&$!==null&&(Z=i.notStrictEqualObject),G.length>30)for(G[26]="".concat(E,"...").concat(w);G.length>27;)G.pop();G.length===1?F=g(this,y(z).call(this,"".concat(Z," ").concat(G[0]))):F=g(this,y(z).call(this,"".concat(Z,`
`).concat(G.join(`
`),`
`)))}else{var re=k($),H="",J=i[V];V==="notDeepEqual"||V==="notEqual"?(re="".concat(i[V],`
`).concat(re),re.length>1024&&(re="".concat(re.slice(0,1021),"..."))):(H="".concat(k(q)),re.length>512&&(re="".concat(re.slice(0,509),"...")),H.length>512&&(H="".concat(H.slice(0,509),"...")),V==="deepEqual"||V==="equal"?re="".concat(J,`
`).concat(re,`
should equal
`):H=" ".concat(V," ").concat(H)),F=g(this,y(z).call(this,"".concat(re).concat(H)))}return Error.stackTraceLimit=oe,F.generatedMessage=!N,Object.defineProperty(r(F),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),F.code="ERR_ASSERTION",F.actual=$,F.expected=q,F.operator=V,Error.captureStackTrace&&Error.captureStackTrace(r(F),j),F.stack,F.name="AssertionError",g(F)}return d(z,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(F,N){return f(this,P({},N,{customInspect:!1,depth:0}))}}]),z}(s(Error));te.exports=B},86832:function(te,X,e){function A(h){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(f){return typeof f}:A=function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},A(h)}function P(h,T){if(!(h instanceof T))throw new TypeError("Cannot call a class as a function")}function o(h,T){return T&&(A(T)==="object"||typeof T=="function")?T:L(h)}function L(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function M(h){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},M(h)}function d(h,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(T&&T.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),T&&g(h,T)}function g(h,T){return g=Object.setPrototypeOf||function(n,v){return n.__proto__=v,n},g(h,T)}var r={},t,s;function a(h,T,f){f||(f=Error);function n(m,b,E){return typeof T=="string"?T:T(m,b,E)}var v=function(m){d(b,m);function b(E,p,S){var w;return P(this,b),w=o(this,M(b).call(this,n(E,p,S))),w.code=h,w}return b}(f);r[h]=v}function c(h,T){if(Array.isArray(h)){var f=h.length;return h=h.map(function(n){return String(n)}),f>2?"one of ".concat(T," ").concat(h.slice(0,f-1).join(", "),", or ")+h[f-1]:f===2?"one of ".concat(T," ").concat(h[0]," or ").concat(h[1]):"of ".concat(T," ").concat(h[0])}else return"of ".concat(T," ").concat(String(h))}function u(h,T,f){return h.substr(0,T.length)===T}function l(h,T,f){return(f===void 0||f>h.length)&&(f=h.length),h.substring(f-T.length,f)===T}function y(h,T,f){return typeof f!="number"&&(f=0),f+T.length>h.length?!1:h.indexOf(T,f)!==-1}a("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),a("ERR_INVALID_ARG_TYPE",function(h,T,f){t===void 0&&(t=e(45408)),t(typeof h=="string","'name' must be a string");var n;typeof T=="string"&&u(T,"not ")?(n="must not be",T=T.replace(/^not /,"")):n="must be";var v;if(l(h," argument"))v="The ".concat(h," ").concat(n," ").concat(c(T,"type"));else{var m=y(h,".")?"property":"argument";v='The "'.concat(h,'" ').concat(m," ").concat(n," ").concat(c(T,"type"))}return v+=". Received type ".concat(A(f)),v},TypeError),a("ERR_INVALID_ARG_VALUE",function(h,T){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";s===void 0&&(s=e(35840));var n=s.inspect(T);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(h,"' ").concat(f,". Received ").concat(n)},TypeError),a("ERR_INVALID_RETURN_VALUE",function(h,T,f){var n;return f&&f.constructor&&f.constructor.name?n="instance of ".concat(f.constructor.name):n="type ".concat(A(f)),"Expected ".concat(h,' to be returned from the "').concat(T,'"')+" function but got ".concat(n,".")},TypeError),a("ERR_MISSING_ARGS",function(){for(var h=arguments.length,T=new Array(h),f=0;f<h;f++)T[f]=arguments[f];t===void 0&&(t=e(45408)),t(T.length>0,"At least one arg needs to be specified");var n="The ",v=T.length;switch(T=T.map(function(m){return'"'.concat(m,'"')}),v){case 1:n+="".concat(T[0]," argument");break;case 2:n+="".concat(T[0]," and ").concat(T[1]," arguments");break;default:n+=T.slice(0,v-1).join(", "),n+=", and ".concat(T[v-1]," arguments");break}return"".concat(n," must be specified")},TypeError),te.exports.codes=r},25116:function(te,X,e){function
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/function _(ve,Ae){if(ve===Ae)return 0;for(var ye=ve.length,Se=Ae.length,_e=0,ze=Math.min(ye,Se);_e<ze;++_e)if(ve[_e]!==Ae[_e]){ye=ve[_e],Se=Ae[_e];break}return ye<Se?-1:Se<ye?1:0}var z=!0,O=!1,F=0,N=1,V=2,j=3;function $(ve,Ae){return M?ve.source===Ae.source&&ve.flags===Ae.flags:RegExp.prototype.toString.call(ve)===RegExp.prototype.toString.call(Ae)}function q(ve,Ae){if(ve.byteLength!==Ae.byteLength)return!1;for(var ye=0;ye<ve.byteLength;ye++)if(ve[ye]!==Ae[ye])return!1;return!0}function oe(ve,Ae){return ve.byteLength!==Ae.byteLength?!1:_(new Uint8Array(ve.buffer,ve.byteOffset,ve.byteLength),new Uint8Array(Ae.buffer,Ae.byteOffset,Ae.byteLength))===0}function Z(ve,Ae){return ve.byteLength===Ae.byteLength&&_(new Uint8Array(ve),new Uint8Array(Ae))===0}function G(ve,Ae){return p(ve)?p(Ae)&&r(Number.prototype.valueOf.call(ve),Number.prototype.valueOf.call(Ae)):S(ve)?S(Ae)&&String.prototype.valueOf.call(ve)===String.prototype.valueOf.call(Ae):w(ve)?w(Ae)&&Boolean.prototype.valueOf.call(ve)===Boolean.prototype.valueOf.call(Ae):i(ve)?i(Ae)&&BigInt.prototype.valueOf.call(ve)===BigInt.prototype.valueOf.call(Ae):C(Ae)&&Symbol.prototype.valueOf.call(ve)===Symbol.prototype.valueOf.call(Ae)}function re(ve,Ae,ye,Se){if(ve===Ae)return ve!==0?!0:ye?r(ve,Ae):!0;if(ye){if(L(ve)!=="object")return typeof ve=="number"&&s(ve)&&s(Ae);if(L(Ae)!=="object"||ve===null||Ae===null||Object.getPrototypeOf(ve)!==Object.getPrototypeOf(Ae))return!1}else{if(ve===null||L(ve)!=="object")return Ae===null||L(Ae)!=="object"?ve==Ae:!1;if(Ae===null||L(Ae)!=="object")return!1}var _e=l(ve),ze=l(Ae);if(_e!==ze)return!1;if(Array.isArray(ve)){if(ve.length!==Ae.length)return!1;var Ie=B(ve),Ne=B(Ae);return Ie.length!==Ne.length?!1:J(ve,Ae,ye,Se,N,Ie)}if(_e==="[object Object]"&&(!n(ve)&&n(Ae)||!m(ve)&&m(Ae)))return!1;if(f(ve)){if(!f(Ae)||Date.prototype.getTime.call(ve)!==Date.prototype.getTime.call(Ae))return!1}else if(v(ve)){if(!v(Ae)||!$(ve,Ae))return!1}else if(b(ve)||ve instanceof Error){if(ve.message!==Ae.message||ve.name!==Ae.name)return!1}else if(T(ve)){if(!ye&&(x(ve)||k(ve))){if(!q(ve,Ae))return!1}else if(!oe(ve,Ae))return!1;var et=B(ve),st=B(Ae);return et.length!==st.length?!1:J(ve,Ae,ye,Se,F,et)}else{if(m(ve))return!m(Ae)||ve.size!==Ae.size?!1:J(ve,Ae,ye,Se,V);if(n(ve))return!n(Ae)||ve.size!==Ae.size?!1:J(ve,Ae,ye,Se,j);if(h(ve)){if(!Z(ve,Ae))return!1}else if(E(ve)&&!G(ve,Ae))return!1}return J(ve,Ae,ye,Se,F)}function H(ve,Ae){return Ae.filter(function(ye){return u(ve,ye)})}function J(ve,Ae,ye,Se,_e,ze){if(arguments.length===5){ze=Object.keys(ve);var Ie=Object.keys(Ae);if(ze.length!==Ie.length)return!1}for(var Ne=0;Ne<ze.length;Ne++)if(!c(Ae,ze[Ne]))return!1;if(ye&&arguments.length===5){var et=t(ve);if(et.length!==0){var st=0;for(Ne=0;Ne<et.length;Ne++){var Ze=et[Ne];if(u(ve,Ze)){if(!u(Ae,Ze))return!1;ze.push(Ze),st++}else if(u(Ae,Ze))return!1}var Ke=t(Ae);if(et.length!==Ke.length&&H(Ae,Ke).length!==st)return!1}else{var nt=t(Ae);if(nt.length!==0&&H(Ae,nt).length!==0)return!1}}if(ze.length===0&&(_e===F||_e===N&&ve.length===0||ve.size===0))return!0;if(Se===void 0)Se={val1:new Map,val2:new Map,position:0};else{var it=Se.val1.get(ve);if(it!==void 0){var lt=Se.val2.get(Ae);if(lt!==void 0)return it===lt}Se.position++}Se.val1.set(ve,Se.position),Se.val2.set(Ae,Se.position);var vt=we(ve,Ae,ye,ze,Se,_e);return Se.val1.delete(ve),Se.val2.delete(Ae),vt}function ae(ve,Ae,ye,Se){for(var _e=d(ve),ze=0;ze<_e.length;ze++){var Ie=_e[ze];if(re(Ae,Ie,ye,Se))return ve.delete(Ie),!0}return!1}function K(ve){switch(L(ve)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":ve=+ve;case"number":if(s(ve))return!1}return!0}function Y(ve,Ae,ye){var Se=K(ye);return Se??(Ae.has(Se)&&!ve.has(Se))}function ie(ve,Ae,ye,Se,_e){var ze=K(ye);if(ze!=null)return ze;var Ie=Ae.get(ze);return Ie===void 0&&!Ae.has(ze)||!re(Se,Ie,!1,_e)?!1:!ve.has(ze)&&re(Se,Ie,!1,_e)}function ne(ve,Ae,ye,Se){for(var _e=null,ze=d(ve),Ie=0;Ie<ze.length;Ie++){var Ne=ze[Ie];if(L(Ne)==="object"&&Ne!==null)_e===null&&(_e=new Set),_e.add(Ne);else if(!Ae.has(Ne)){if(ye||!Y(ve,Ae,Ne))return!1;_e=
precision highp float;
attribute float width, charOffset, char;
attribute vec2 position;
uniform float fontSize, charStep, em, align, baseline;
uniform vec4 viewport;
uniform vec4 color;
uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;
varying vec2 charCoord, charId;
varying float charWidth;
varying vec4 fontColor;
void main () {
vec2 offset = floor(em * (vec2(align + charOffset, baseline)
+ vec2(positionOffset.x, -positionOffset.y)))
/ (viewport.zw * scale.xy);
vec2 position = (position + translate) * scale;
position += offset * scale;
charCoord = position * viewport.zw + viewport.xy;
gl_Position = vec4(position * 2. - 1., 0, 1);
gl_PointSize = charStep;
charId.x = mod(char, atlasDim.x);
charId.y = floor(char / atlasDim.x);
charWidth = width * em;
fontColor = color / 255.;
}`,frag:`
precision highp float;
uniform float fontSize, charStep, opacity;
uniform vec2 atlasSize;
uniform vec4 viewport;
uniform sampler2D atlas;
varying vec4 fontColor;
varying vec2 charCoord, charId;
varying float charWidth;
float lightness(vec4 color) {
return color.r * 0.299 + color.g * 0.587 + color.b * 0.114;
}
void main () {
vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;
float halfCharStep = floor(charStep * .5 + .5);
// invert y and shift by 1px (FF expecially needs that)
uv.y = charStep - uv.y;
// ignore points outside of character bounding box
float halfCharWidth = ceil(charWidth * .5);
if (floor(uv.x) > halfCharStep + halfCharWidth ||
floor(uv.x) < halfCharStep - halfCharWidth) return;
uv += charId * charStep;
uv = uv / atlasSize;
vec4 color = fontColor;
vec4 mask = texture2D(atlas, uv);
float maskY = lightness(mask);
// float colorY = lightness(color);
color.a *= maskY;
color.a *= opacity;
// color.a += .1;
// antialiasing, see yiq color space y-channel formula
// color.rgb += (1. - color.rgb) * (1. - mask.rgb);
gl_FragColor = color;
}`}),i={};return{regl:S,draw:w,atlas:i}},b.prototype.update=function(S){var w=this;if(typeof S=="string")S={text:S};else if(!S)return;S=P(S,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),S.opacity!=null&&(Array.isArray(S.opacity)?this.opacity=S.opacity.map(function(Ie){return parseFloat(Ie)}):this.opacity=parseFloat(S.opacity)),S.viewport!=null&&(this.viewport=t(S.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),S.kerning!=null&&(this.kerning=S.kerning),S.offset!=null&&(typeof S.offset=="number"&&(S.offset=[S.offset,0]),this.positionOffset=h(S.offset)),S.direction&&(this.direction=S.direction),S.range&&(this.range=S.range,this.scale=[1/(S.range[2]-S.range[0]),1/(S.range[3]-S.range[1])],this.translate=[-S.range[0],-S.range[1]]),S.scale&&(this.scale=S.scale),S.translate&&(this.translate=S.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!S.font&&(S.font=b.baseFontSize+"px sans-serif");var i=!1,C=!1;if(S.font&&(Array.isArray(S.font)?S.font:[S.font]).forEach(function(Ie,Ne){if(typeof Ie=="string")try{Ie=A.parse(Ie)}catch{Ie=A.parse(b.baseFontSize+"px "+Ie)}else Ie=A.parse(A.stringify(Ie));var et=A.stringify({size:b.baseFontSize,family:Ie.family,stretch:v?Ie.stretch:void 0,variant:Ie.variant,weight:Ie.weight,style:Ie.style}),st=a(Ie.size),Ze=Math.round(st[0]*c(st[1]));if(Ze!==w.fontSize[Ne]&&(C=!0,w.fontSize[Ne]=Ze),(!w.font[Ne]||et!=w.font[Ne].baseString)&&(i=!0,w.font[Ne]=b.fonts[et],!w.font[Ne])){var Ke=Ie.family.join(", "),nt=[Ie.style];Ie.style!=Ie.variant&&nt.push(Ie.variant),Ie.variant!=Ie.weight&&nt.push(Ie.weight),v&&Ie.weight!=Ie.stretch&&nt.push(Ie.stretch),w.font[Ne]={baseString:et,family:Ke,weight:Ie.weight,stretch:Ie.stretch,style:Ie.style,variant:Ie.variant,width:{},kerning:{},metrics:y(Ke,{origin:"top",fontSize:b.baseFontSize,fontStyle:nt.join(" ")})},b.fonts[et]=w.font[Ne]}}),(i||C)&&this.font.forEach(function(Ie,Ne){var et=A.stringify({size:w.fontSize[Ne],family:Ie.family,stretch:v?Ie.stretch:void 0,variant:Ie.variant,weight:Ie.weight,style:Ie.style});if(w.fontAtlas[Ne]=w.shader.atlas[et],!w.fontAtlas[Ne]){var st=Ie.metrics;w.shader.atlas[et]=w.fontAtlas[Ne]={fontString:et,step:Math.ceil(w.fontSize[Ne]*st.bottom*.5)*2,em:w.fontSize[Ne],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:w.regl.texture()}}S.text==null&&(S.text=w.text)}),typeof S.text=="string"&&S.position&&S.position.length>2){for(var x=Array(S.position.length*.5),k=0;k<x.length;k++)x[k]=S.text;S.text=x}var I;if(S.text!=null||i){if(this.textOffsets=[0],Array.isArray(S.text)){this.count=S.text[0].length,this.counts=[this.count];for(var B=1;B<S.text.length;B++)this.textOffsets[B]=this.textOffsets[B-1]+S.text[B-1].length,this.count+=S.text[B].length,this.counts.push(S.text[B].length);this.text=S.text.join("")}else this.text=S.text,this.count=this.text.length,this.counts=[this.count];I=[],this.font.forEach(function(Ie,Ne){b.atlasContext.font=Ie.baseString;for(var et=w.fontAtlas[Ne],st=0;st<w.text.length;st++){var Ze=w.text.charAt(st);if(et.ids[Ze]==null&&(et.ids[Ze]=et.chars.length,et.chars.push(Ze),I.push(Ze)),Ie.width[Ze]==null&&(Ie.width[Ze]=b.atlasContext.measureText(Ze).width/b.baseFontSi
v0.8.1 (c) Kyle Simpson
MIT License: http://getify.mit-license.org
*/(function(o,L,M){L[o]=L[o]||M(),te.exports?te.exports=L[o]:(A=(function(){return L[o]}).call(X,e,X,te),A!==void 0&&(te.exports=A))})("Promise",typeof e.g<"u"?e.g:this,function(){var o,L,M,d=Object.prototype.toString,g=typeof setImmediate<"u"?function(v){return setImmediate(v)}:setTimeout;try{Object.defineProperty({},"x",{}),o=function(v,m,b,E){return Object.defineProperty(v,m,{value:b,writable:!0,configurable:E!==!1})}}catch{o=function(m,b,E){return m[b]=E,m}}M=function(){var v,m,b;function E(p,S){this.fn=p,this.self=S,this.next=void 0}return{add:function(S,w){b=new E(S,w),m?m.next=b:v=b,m=b,b=void 0},drain:function(){var S=v;for(v=m=L=void 0;S;)S.fn.call(S.self),S=S.next}}}();function r(n,v){M.add(n,v),L||(L=g(M.drain))}function t(n){var v,m=typeof n;return n!=null&&(m=="object"||m=="function")&&(v=n.then),typeof v=="function"?v:!1}function s(){for(var n=0;n<this.chain.length;n++)a(this,this.state===1?this.chain[n].success:this.chain[n].failure,this.chain[n]);this.chain.length=0}function a(n,v,m){var b,E;try{v===!1?m.reject(n.msg):(v===!0?b=n.msg:b=v.call(void 0,n.msg),b===m.promise?m.reject(TypeError("Promise-chain cycle")):(E=t(b))?E.call(b,m.resolve,m.reject):m.resolve(b))}catch(p){m.reject(p)}}function c(n){var v,m=this;if(!m.triggered){m.triggered=!0,m.def&&(m=m.def);try{(v=t(n))?r(function(){var b=new y(m);try{v.call(n,function(){c.apply(b,arguments)},function(){u.apply(b,arguments)})}catch(E){u.call(b,E)}}):(m.msg=n,m.state=1,m.chain.length>0&&r(s,m))}catch(b){u.call(new y(m),b)}}}function u(n){var v=this;v.triggered||(v.triggered=!0,v.def&&(v=v.def),v.msg=n,v.state=2,v.chain.length>0&&r(s,v))}function l(n,v,m,b){for(var E=0;E<v.length;E++)(function(S){n.resolve(v[S]).then(function(i){m(S,i)},b)})(E)}function y(n){this.def=n,this.triggered=!1}function h(n){this.promise=n,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function T(n){if(typeof n!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var v=new h(this);this.then=function(b,E){var p={success:typeof b=="function"?b:!0,failure:typeof E=="function"?E:!1};return p.promise=new this.constructor(function(w,i){if(typeof w!="function"||typeof i!="function")throw TypeError("Not a function");p.resolve=w,p.reject=i}),v.chain.push(p),v.state!==0&&r(s,v),p.promise},this.catch=function(b){return this.then(void 0,b)};try{n.call(void 0,function(b){c.call(v,b)},function(b){u.call(v,b)})}catch(m){u.call(v,m)}}var f=o({},"constructor",T,!1);return T.prototype=f,o(f,"__NPO__",0,!1),o(T,"resolve",function(v){var m=this;return v&&typeof v=="object"&&v.__NPO__===1?v:new m(function(E,p){if(typeof E!="function"||typeof p!="function")throw TypeError("Not a function");E(v)})}),o(T,"reject",function(v){return new this(function(b,E){if(typeof b!="function"||typeof E!="function")throw TypeError("Not a function");E(v)})}),o(T,"all",function(v){var m=this;return d.call(v)!="[object Array]"?m.reject(TypeError("Not an array")):v.length===0?m.resolve([]):new m(function(E,p){if(typeof E!="function"||typeof p!="function")throw TypeError("Not a function");var S=v.length,w=Array(S),i=0;l(m,v,function(x,k){w[x]=k,++i===S&&E(w)},p)})}),o(T,"race",function(v){var m=this;return d.call(v)!="[object Array]"?m.reject(TypeError("Not an array")):new m(function(E,p){if(typeof E!="function"||typeof p!="function")throw TypeError("Not a function");l(m,v,function(w,i){E(i)},p)})}),T})},48816:function(te){var X=Math.PI,e=d(120);te.exports=A;function A(g){for(var r,t=[],s=0,a=0,c=0,u=0,l=null,y=null,h=0,T=0,f=0,n=g.length;f<n;f++){var v=g[f],m=v[0];switch(m){case"M":c=v[1],u=v[2];break;case"A":v=L(h,T,v[1],v[2],d(v[3]),v[4],v[5],v[6],v[7]),v.unshift("C"),v.length>7&&(t.push(v.splice(0,7)),v.unshift("C"));break;case"S":var b=h,E=T;(r=="C"||r=="S")&&(b+=b-s,E+=E-a),v=["C",b,E,v[1],v[2],v[3],v[4]];break;case"T":r=="Q"||r=="T"?(l=h*2-l,y=T*2-y):(l=h,y=T),v=o(h,T,l,y,v[1],v[2]);break;case"Q":l=v[1],y=v[2],v=o(h,T,v[1],v[2],v[3],v[4]);break;case"L":v=P(h,T,v[1],v[2]);break;case"H":v=P(h,T,v[1],T);break;case"V":v=P(h,T,h,v[1]);break;case"Z
object-assign
(c) Sindre Sorhus
@license MIT
*/var X=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;function P(L){if(L==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(L)}function o(){try{if(!Object.assign)return!1;var L=new String("abc");if(L[5]="de",Object.getOwnPropertyNames(L)[0]==="5")return!1;for(var M={},d=0;d<10;d++)M["_"+String.fromCharCode(d)]=d;var g=Object.getOwnPropertyNames(M).map(function(t){return M[t]});if(g.join("")!=="0123456789")return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}te.exports=o()?Object.assign:function(L,M){for(var d,g=P(L),r,t=1;t<arguments.length;t++){d=Object(arguments[t]);for(var s in d)e.call(d,s)&&(g[s]=d[s]);if(X){r=X(d);for(var a=0;a<r.length;a++)A.call(d,r[a])&&(g[r[a]]=d[r[a]])}}return g}},76835:function(te){var X=function(e){return e!==e};te.exports=function(A,P){return A===0&&P===0?1/A===1/P:!!(A===P||X(A)&&X(P))}},39896:function(te,X,e){var A=e(81288),P=e(57916),o=e(76835),L=e(66148),M=e(16408),d=P(L(),Object);A(d,{getPolyfill:L,implementation:o,shim:M}),te.exports=d},66148:function(te,X,e){var A=e(76835);te.exports=function(){return typeof Object.is=="function"?Object.is:A}},16408:function(te,X,e){var A=e(66148),P=e(81288);te.exports=function(){var L=A();return P(Object,{is:L},{is:function(){return Object.is!==L}}),L}},32764:function(te,X,e){var A;if(!Object.keys){var P=Object.prototype.hasOwnProperty,o=Object.prototype.toString,L=e(97344),M=Object.prototype.propertyIsEnumerable,d=!M.call({toString:null},"toString"),g=M.call(function(){},"prototype"),r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],t=function(u){var l=u.constructor;return l&&l.prototype===u},s={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},a=function(){if(typeof window>"u")return!1;for(var u in window)try{if(!s["$"+u]&&P.call(window,u)&&window[u]!==null&&typeof window[u]=="object")try{t(window[u])}catch{return!0}}catch{return!0}return!1}(),c=function(u){if(typeof window>"u"||!a)return t(u);try{return t(u)}catch{return!1}};A=function(l){var y=l!==null&&typeof l=="object",h=o.call(l)==="[object Function]",T=L(l),f=y&&o.call(l)==="[object String]",n=[];if(!y&&!h&&!T)throw new TypeError("Object.keys called on a non-object");var v=g&&h;if(f&&l.length>0&&!P.call(l,0))for(var m=0;m<l.length;++m)n.push(String(m));if(T&&l.length>0)for(var b=0;b<l.length;++b)n.push(String(b));else for(var E in l)!(v&&E==="prototype")&&P.call(l,E)&&n.push(String(E));if(d)for(var p=c(l),S=0;S<r.length;++S)!(p&&r[S]==="constructor")&&P.call(l,r[S])&&n.push(r[S]);return n}}te.exports=A},41820:function(te,X,e){var A=Array.prototype.slice,P=e(97344),o=Object.keys,L=o?function(g){return o(g)}:e(32764),M=Object.keys;L.shim=function(){if(Object.keys){var g=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);g||(Object.keys=function(t){return P(t)?M(A.call(t)):M(t)})}else Object.keys=L;return Object.keys||L},te.exports=L},97344:function(te){var X=Object.prototype.toString;te.exports=function(A){var P=X.call(A),o=P==="[object Arguments]";return o||(o=P!=="[object Array]"&&A!==null&&typeof A=="object"&&typeof A.length=="number"&&A.length>=0&&X.call(A.callee)==="[object Function]"),o}},32868:function(te){function X(P,o){if(typeof P!="string")return[P];var L=[P];typeof o=="string"||Array.isArray(o)?o={brackets:o}:o||(o={});var M=o.brackets?Array.isArray(o.brackets)?o.brackets:[o.brackets]:["{}","[]","()"],d=o.escape||"___",g=!!o.flat;M.forEach(function(s){var a=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),c=[];function u(l,y,h){var T=L.push(l.slice(s[0].
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
* @license MIT
* @preserve Project Home: https://github.com/voidqk/polybooljs
*/var A=e(7688),P=e(28648),o=e(72200),L=e(11403),M=e(82368),d=e(17792),g=!1,r=P(),t;t={buildLog:function(a){return a===!0?g=A():a===!1&&(g=!1),g===!1?!1:g.list},epsilon:function(a){return r.epsilon(a)},segments:function(a){var c=o(!0,r,g);return a.regions.forEach(c.addRegion),{segments:c.calculate(a.inverted),inverted:a.inverted}},combine:function(a,c){var u=o(!1,r,g);return{combined:u.calculate(a.segments,a.inverted,c.segments,c.inverted),inverted1:a.inverted,inverted2:c.inverted}},selectUnion:function(a){return{segments:M.union(a.combined,g),inverted:a.inverted1||a.inverted2}},selectIntersect:function(a){return{segments:M.intersect(a.combined,g),inverted:a.inverted1&&a.inverted2}},selectDifference:function(a){return{segments:M.difference(a.combined,g),inverted:a.inverted1&&!a.inverted2}},selectDifferenceRev:function(a){return{segments:M.differenceRev(a.combined,g),inverted:!a.inverted1&&a.inverted2}},selectXor:function(a){return{segments:M.xor(a.combined,g),inverted:a.inverted1!==a.inverted2}},polygon:function(a){return{regions:L(a.segments,r,g),inverted:a.inverted}},polygonFromGeoJSON:function(a){return d.toPolygon(t,a)},polygonToGeoJSON:function(a){return d.fromPolygon(t,r,a)},union:function(a,c){return s(a,c,t.selectUnion)},intersect:function(a,c){return s(a,c,t.selectIntersect)},difference:function(a,c){return s(a,c,t.selectDifference)},differenceRev:function(a,c){return s(a,c,t.selectDifferenceRev)},xor:function(a,c){return s(a,c,t.selectXor)}};function s(a,c,u){var l=t.segments(a),y=t.segments(c),h=t.combine(l,y),T=u(h);return t.polygon(T)}typeof window=="object"&&(window.PolyBool=t),te.exports=t},7688:function(te){function X(){var e,A=0,P=!1;function o(L,M){return e.list.push({type:L,data:M?JSON.parse(JSON.stringify(M)):void 0}),e}return e={list:[],segmentId:function(){return A++},checkIntersection:function(L,M){return o("check",{seg1:L,seg2:M})},segmentChop:function(L,M){return o("div_seg",{seg:L,pt:M}),o("chop",{seg:L,pt:M})},statusRemove:function(L){return o("pop_seg",{seg:L})},segmentUpdate:function(L){return o("seg_update",{seg:L})},segmentNew:function(L,M){return o("new_seg",{seg:L,primary:M})},segmentRemove:function(L){return o("rem_seg",{seg:L})},tempStatus:function(L,M,d){return o("temp_status",{seg:L,above:M,below:d})},rewind:function(L){return o("rewind",{seg:L})},status:function(L,M,d){return o("status",{seg:L,above:M,below:d})},vert:function(L){return L===P?e:(P=L,o("vert",{x:L}))},log:function(L){return typeof L!="string"&&(L=JSON.stringify(L,!1," ")),o("log",{txt:L})},reset:function(){return o("reset")},selected:function(L){return o("selected",{segs:L})},chainStart:function(L){return o("chain_start",{seg:L})},chainRemoveHead:function(L,M){return o("chain_rem_head",{index:L,pt:M})},chainRemoveTail:function(L,M){return o("chain_rem_tail",{index:L,pt:M})},chainNew:function(L,M){return o("chain_new",{pt1:L,pt2:M})},chainMatch:function(L){return o("chain_match",{index:L})},chainClose:function(L){return o("chain_close",{index:L})},chainAddHead:function(L,M){return o("chain_add_head",{index:L,pt:M})},chainAddTail:function(L,M){return o("chain_add_tail",{index:L,pt:M})},chainConnect:function(L,M){return o("chain_con",{index1:L,index2:M})},chainReverse:function(L){return o("chain_rev",{index:L})},chainJoin:function(L,M){return o("chain_join",{index1:L,index2:M})},done:function(){return o("done")}},e}te.exports=X},28648:function(te){function X(e){typeof e!="number"&&(e=1e-10);var A={epsilon:function(P){return typeof P=="number"&&(e=P),e},pointAboveOrOnLine:function(P,o,L){var M=o[0],d=o[1],g=L[0],r=L[1],t=P[0],s=P[1];return(g-M)*(s-d)-(r-d)*(t-M)>=-e},pointBetween:function(P,o,L){var M=P[1]-o[1],d=L[0]-o[0],g=P[0]-o[0],r=L[1]-o[1],t=g*d+M*r;if(t<e)return!1;var s=d*d+r*r;return!(t-s>-e)},pointsSameX:function(P,o){return Math.abs(P[0]-o[0])<e},pointsSameY:function(P,o){return Math.abs(P[1]-o[1])<e},pointsSame:function(P,o){return A.pointsSameX(P,o)&&A.pointsSameY(P,o)},pointsCompare:function(P,o){return A.pointsSameX(P,o)?A.pointsSameY(P,o)?0:P[1]<o[1]?-1:1:P[0]<o[0]?-1:1},pointsCollinear:function(P,o,L){v

`),M=A("IHDR");te.exports=function(d){if(!(d.length<24)&&P(d,0,L)&&P(d,12,M))return{width:o(d,16),height:o(d,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},90328:function(te,X,e){var A=e(9696).wR,P=e(9696).gS,o=e(9696).eI,L=A("8BPS\0");te.exports=function(M){if(!(M.length<22)&&P(M,0,L))return{width:o(M,18),height:o(M,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},16024:function(te){function X(s){return s===32||s===9||s===13||s===10}function e(s){return typeof s=="number"&&isFinite(s)&&s>0}function A(s){var a=0,c=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(a=3);a<c&&X(s[a]);)a++;return a===c?!1:s[a]===60}var P=/<[-_.:a-zA-Z0-9][^>]*>/,o=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,L=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,M=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,d=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,g=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function r(s){var a=s.match(L),c=s.match(M),u=s.match(d);return{width:a&&(a[1]||a[2]),height:c&&(c[1]||c[2]),viewbox:u&&(u[1]||u[2])}}function t(s){return g.test(s)?s.match(g)[0]:"px"}te.exports=function(s){if(A(s)){for(var a="",c=0;c<s.length;c++)a+=String.fromCharCode(s[c]);var u=(a.match(P)||[""])[0];if(o.test(u)){var l=r(u),y=parseFloat(l.width),h=parseFloat(l.height);if(l.width&&l.height)return!e(y)||!e(h)?void 0:{width:y,height:h,type:"svg",mime:"image/svg+xml",wUnits:t(l.width),hUnits:t(l.height)};var T=(l.viewbox||"").split(" "),f={width:T[2],height:T[3]},n=parseFloat(f.width),v=parseFloat(f.height);if(!(!e(n)||!e(v))&&t(f.width)===t(f.height)){var m=n/v;return l.width?e(y)?{width:y,height:y/m,type:"svg",mime:"image/svg+xml",wUnits:t(l.width),hUnits:t(l.width)}:void 0:l.height?e(h)?{width:h*m,height:h,type:"svg",mime:"image/svg+xml",wUnits:t(l.height),hUnits:t(l.height)}:void 0:{width:n,height:v,type:"svg",mime:"image/svg+xml",wUnits:t(f.width),hUnits:t(f.height)}}}}}},98792:function(te,X,e){var A=e(9696).wR,P=e(9696).gS,o=e(9696).Bz,L=e(9696).eW,M=e(9696).st,d=e(9696).eI,g=A("II*\0"),r=A("MM\0*");function t(c,u,l){return l?L(c,u):o(c,u)}function s(c,u,l){return l?d(c,u):M(c,u)}function a(c,u,l){var y=t(c,u+2,l),h=s(c,u+4,l);return h!==1||y!==3&&y!==4?null:y===3?t(c,u+8,l):s(c,u+8,l)}te.exports=function(c){if(!(c.length<8)&&!(!P(c,0,g)&&!P(c,0,r))){var u=c[0]===77,l=s(c,4,u)-8;if(!(l<0)){var y=l+8;if(!(c.length-y<2)){var h=t(c,y+0,u)*12;if(!(h<=0)&&(y+=2,!(c.length-y<h))){var T,f,n,v;for(T=0;T<h;T+=12)v=t(c,y+T,u),v===256?f=a(c,y+T,u):v===257&&(n=a(c,y+T,u));if(f&&n)return{width:f,height:n,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}},20704:function(te,X,e){var A=e(9696).wR,P=e(9696).gS,o=e(9696).Bz,L=e(9696).st,M=e(11688),d=A("RIFF"),g=A("WEBP");function r(a,c){if(!(a[c+3]!==157||a[c+4]!==1||a[c+5]!==42))return{width:o(a,c+6)&16383,height:o(a,c+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function t(a,c){if(a[c]===47){var u=L(a,c+1);return{width:(u&16383)+1,height:(u>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function s(a,c){return{width:(a[c+6]<<16|a[c+5]<<8|a[c+4])+1,height:(a[c+9]<<c|a[c+8]<<8|a[c+7])+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}te.exports=function(a){if(!(a.length<16)&&!(!P(a,0,d)&&!P(a,8,g))){var c=12,u=null,l=0,y=L(a,4)+8;if(!(y>a.length)){for(;c+8<y;){if(a[c]===0){c++;continue}var h=String.fromCharCode.apply(null,a.slice(c,c+4)),T=L(a,c+4);h==="VP8 "&&T>=10?u=u||r(a,c+8):h==="VP8L"&&T>=9?u=u||t(a,c+8):h==="VP8X"&&T>=10?u=u||s(a,c+8):h==="EXIF"&&(l=M.get_orientation(a.slice(c+8,c+8+T)),c=1/0),c+=8+T}if(u)return l>0&&(u.orientation=l),u}}}},87480:function(te,X,e){te.exports={avif:e(40528),bmp:e(38728),gif:e(5588),ico:e(41924),jpeg:e(87968),png:e(37276),psd:e(90328),svg:e(16024),tiff:e(98792),webp:e(20704)}},19480:function(te,X,e){var A=e(87480);function P(o){for(var L=Object.keys(A),M=0;M<L.length;M++){var d=A[L[M]](o);if(d)return d}return null}te.exports=function(L){return P(L)},te.exports.parsers=A},4168:function(te){var X=te.exports={},e,A;function P(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clea
precision highp float;
attribute vec2 position, positionFract;
attribute vec4 error;
attribute vec4 color;
attribute vec2 direction, lineOffset, capOffset;
uniform vec4 viewport;
uniform float lineWidth, capSize;
uniform vec2 scale, scaleFract, translate, translateFract;
varying vec4 fragColor;
void main() {
fragColor = color / 255.;
vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;
vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;
vec2 position = position + dxy;
vec2 pos = (position + translate) * scale
+ (positionFract + translateFract) * scale
+ (position + translate) * scaleFract
+ (positionFract + translateFract) * scaleFract;
pos += pixelOffset / viewport.zw;
gl_Position = vec4(pos * 2. - 1., 0, 1);
}
`,frag:`
precision highp float;
varying vec4 fragColor;
uniform float opacity;
void main() {
gl_FragColor = fragColor;
gl_FragColor.a *= opacity;
}
`,uniforms:{range:c.prop("range"),lineWidth:c.prop("lineWidth"),capSize:c.prop("capSize"),opacity:c.prop("opacity"),scale:c.prop("scale"),translate:c.prop("translate"),scaleFract:c.prop("scaleFract"),translateFract:c.prop("translateFract"),viewport:function(C,x){return[x.viewport.x,x.viewport.y,C.viewportWidth,C.viewportHeight]}},attributes:{color:{buffer:f,offset:function(C,x){return x.offset*4},divisor:1},position:{buffer:h,offset:function(C,x){return x.offset*8},divisor:1},positionFract:{buffer:T,offset:function(C,x){return x.offset*8},divisor:1},error:{buffer:n,offset:function(C,x){return x.offset*16},divisor:1},direction:{buffer:v,stride:24,offset:0},lineOffset:{buffer:v,stride:24,offset:8},capOffset:{buffer:v,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:c.prop("viewport")},viewport:c.prop("viewport"),stencil:!1,instances:c.prop("count"),count:s.length}),M(E,{update:w,draw:p,destroy:i,regl:c,gl:l,canvas:l.canvas,groups:b}),E;function E(C){C?w(C):C===null&&i(),p()}function p(C){if(typeof C=="number")return S(C);C&&!Array.isArray(C)&&(C=[C]),c._refresh(),b.forEach(function(x,k){if(x){if(C&&(C[k]?x.draw=!0:x.draw=!1),!x.draw){x.draw=!0;return}S(k)}})}function S(C){typeof C=="number"&&(C=b[C]),C!=null&&C&&C.count&&C.color&&C.opacity&&C.positions&&C.positions.length>1&&(C.scaleRatio=[C.scale[0]*C.viewport.width,C.scale[1]*C.viewport.height],y(C),C.after&&C.after(C))}function w(C){if(C){C.length!=null?typeof C[0]=="number"&&(C=[{positions:C}]):Array.isArray(C)||(C=[C]);var x=0,k=0;if(E.groups=b=C.map(function(N,V){var j=b[V];if(N)typeof N=="function"?N={after:N}:typeof N[0]=="number"&&(N={positions:N});else return j;return N=L(N,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),j||(b[V]=j={id:V,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},N=M({},m,N)),o(j,N,[{lineWidth:function($){return+$*.5},capSize:function($){return+$*.5},opacity:parseFloat,errors:function($){return $=d($),k+=$.length,$},positions:function($,q){return $=d($,"float64"),q.count=Math.floor($.length/2),q.bounds=A($,2),q.offset=x,x+=q.count,$}},{color:function($,q){var oe=q.count;if($||($="transparent"),!Array.isArray($)||typeof $[0]=="number"){var Z=$;$=Array(oe);for(var G=0;G<oe;G++)$[G]=Z}if($.length<oe)throw Error("Not enough colors");for(var re=new Uint8Array(oe*4),H=0;H<oe;H++){var J=P($[H],"uint8");re.set(J,H*4)}return re},range:function($,q,oe){var Z=q.bounds;return $||($=Z),q.scale=[1/($[2]-$[0]),1/($[3]-$[1])],q.translate=[-$[0],-$[1]],q.scaleFract=t(q.scale),q.translateFract=t(q.translate),$},viewport:function($){var q;return Array.isArray($)?q={x:$[0],y:$[1],width:$[2]-$[0],height:$[3]-$[1]}:$?(q={x:$.x||$.left||0,y:$.y||$.top||0},$.right?q.width=$.right-q.x:q.width=$.w||$.width||0,$.bottom?q.height=$.bottom-q.y:q.height=$.h||$.height||0):q={x:0,y:0,width:l.drawingBufferWidth,height:l.drawingBufferHeight},q}}]),j}),x||k){var I=b.reduce(function(N,V,j){return N+(V?V.count:0)},0),B=new Float64Array(I*2),_=new Uint8Array(I*4),z=new Float32Array(I*4);b.forEach(function(N,V){if(N){var j=N.positions,$=N.count,q=N.offset,oe=N.color,Z=N.errors;$&&(_.set(oe,q*4),z.set(Z,q*4),B.set(j,q*2))}});var O=r(B);h(O);var F=t(B,O);T(F),f(_),n(z)}}}function i(){h.destroy(),T.destroy(),f.destroy(),n.destroy(),v.destroy()}}},13472:function(te,X,e){var A=e(72160),P=e(76752),o=e(50896),L=e(55616),M=e(47520),d=e(28912),g=e(71152),r=e(37816),t=r.float32,s=r.fract32,a=e(60463),c=e(51160),u=e(10272),l=`
precision highp float;
attribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;
attribute vec4 color;
attribute float lineEnd, lineTop;
uniform vec2 scale, scaleFract, translate, translateFract;
uniform float thickness, pixelRatio, id, depth;
uniform vec4 viewport;
varying vec4 fragColor;
varying vec2 tangent;
vec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {
// the order is important
return position * scale + translate
+ positionFract * scale + translateFract
+ position * scaleFract
+ positionFract * scaleFract;
}
void main() {
float lineStart = 1. - lineEnd;
float lineOffset = lineTop * 2. - 1.;
vec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);
tangent = normalize(diff * scale * viewport.zw);
vec2 normal = vec2(-tangent.y, tangent.x);
vec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart
+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd
+ thickness * normal * .5 * lineOffset / viewport.zw;
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
fragColor = color / 255.;
}
`,y=`
precision highp float;
uniform float dashLength, pixelRatio, thickness, opacity, id;
uniform sampler2D dashTexture;
varying vec4 fragColor;
varying vec2 tangent;
void main() {
float alpha = 1.;
float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;
float dash = texture2D(dashTexture, vec2(t, .5)).r;
gl_FragColor = fragColor;
gl_FragColor.a *= alpha * opacity * dash;
}
`,h=`
precision highp float;
attribute vec2 position, positionFract;
uniform vec4 color;
uniform vec2 scale, scaleFract, translate, translateFract;
uniform float pixelRatio, id;
uniform vec4 viewport;
uniform float opacity;
varying vec4 fragColor;
const float MAX_LINES = 256.;
void main() {
float depth = (MAX_LINES - 4. - id) / (MAX_LINES);
vec2 position = position * scale + translate
+ positionFract * scale + translateFract
+ position * scaleFract
+ positionFract * scaleFract;
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
fragColor = color / 255.;
fragColor.a *= opacity;
}
`,T=`
precision highp float;
varying vec4 fragColor;
void main() {
gl_FragColor = fragColor;
}
`,f=`
precision highp float;
attribute vec2 aCoord, bCoord, nextCoord, prevCoord;
attribute vec4 aColor, bColor;
attribute float lineEnd, lineTop;
uniform vec2 scale, translate;
uniform float thickness, pixelRatio, id, depth;
uniform vec4 viewport;
uniform float miterLimit, miterMode;
varying vec4 fragColor;
varying vec4 startCutoff, endCutoff;
varying vec2 tangent;
varying vec2 startCoord, endCoord;
varying float enableStartMiter, enableEndMiter;
const float REVERSE_THRESHOLD = -.875;
const float MIN_DIFF = 1e-6;
// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead
// TODO: precalculate dot products, normalize things beforehead etc.
// TODO: refactor to rectangular algorithm
float distToLine(vec2 p, vec2 a, vec2 b) {
vec2 diff = b - a;
vec2 perp = normalize(vec2(-diff.y, diff.x));
return dot(p - a, perp);
}
bool isNaN( float val ){
return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;
}
void main() {
vec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;
vec2 adjustedScale;
adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;
adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;
vec2 scaleRatio = adjustedScale * viewport.zw;
vec2 normalWidth = thickness / scaleRatio;
float lineStart = 1. - lineEnd;
float lineBot = 1. - lineTop;
fragColor = (lineStart * aColor + lineEnd * bColor) / 255.;
if (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;
if (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);
if (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);
vec2 prevDiff = aCoord - prevCoord;
vec2 currDiff = bCoord - aCoord;
vec2 nextDiff = nextCoord - bCoord;
vec2 prevTangent = normalize(prevDiff * scaleRatio);
vec2 currTangent = normalize(currDiff * scaleRatio);
vec2 nextTangent = normalize(nextDiff * scaleRatio);
vec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);
vec2 currNormal = vec2(-currTangent.y, currTangent.x);
vec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);
vec2 startJoinDirection = normalize(prevTangent - currTangent);
vec2 endJoinDirection = normalize(currTangent - nextTangent);
// collapsed/unidirectional segment cases
// FIXME: there should be more elegant solution
vec2 prevTanDiff = abs(prevTangent - currTangent);
vec2 nextTanDiff = abs(nextTangent - currTangent);
if (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {
startJoinDirection = currNormal;
}
if (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {
endJoinDirection = currNormal;
}
if (aCoord == bCoord) {
endJoinDirection = startJoinDirection;
currNormal = prevNormal;
currTangent = prevTangent;
}
tangent = currTangent;
//calculate join shifts relative to normals
float startJoinShift = dot(currNormal, startJoinDirection);
float endJoinShift = dot(currNormal, endJoinDirection);
float startMiterRatio = abs(1. / startJoinShift);
float endMiterRatio = abs(1. / endJoinShift);
vec2 startJoin = startJoinDirection * startMiterRatio;
vec2 endJoin = endJoinDirection * endMiterRatio;
vec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;
startTopJoin = sign(startJoinShift) * startJoin * .5;
startBotJoin = -startTopJoin;
endTopJoin = sign(endJoinShift) * endJoin * .5;
endBotJoin = -endTopJoin;
vec2 aTopCoord = aCoord + normalWidth * startTopJoin;
vec2 bTopCoord = bCoord + normalWidth * endTopJoin;
vec2 aBotCoord = aCoord + normalWidth * startBotJoin;
vec2 bBotCoord = bCoord + normalWidth * endBotJoin;
//miter anti-clipping
float baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));
float abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));
//prevent close to reverse direction switch
bool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);
bool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);
if (prevReverse) {
//make join rectangular
vec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;
float normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);
aBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;
aTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;
}
else if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {
//handle miter clipping
bTopCoord -= normalWidth * endTopJoin;
bTopCoord += normalize(endTopJoin * normalWidth) * baClipping;
}
if (nextReverse) {
//make join rectangular
vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;
float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);
bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;
bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;
}
else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {
//handle miter clipping
aBotCoord -= normalWidth * startBotJoin;
aBotCoord += normalize(startBotJoin * normalWidth) * abClipping;
}
vec2 aTopPosition = (aTopCoord) * adjustedScale + translate;
vec2 aBotPosition = (aBotCoord) * adjustedScale + translate;
vec2 bTopPosition = (bTopCoord) * adjustedScale + translate;
vec2 bBotPosition = (bBotCoord) * adjustedScale + translate;
//position is normalized 0..1 coord on the screen
vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;
startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;
endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
enableStartMiter = step(dot(currTangent, prevTangent), .5);
enableEndMiter = step(dot(currTangent, nextTangent), .5);
//bevel miter cutoffs
if (miterMode == 1.) {
if (enableStartMiter == 1.) {
vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;
startCutoff = vec4(aCoord, aCoord);
startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;
startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
startCutoff += viewport.xyxy;
startCutoff += startMiterWidth.xyxy;
}
if (enableEndMiter == 1.) {
vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;
endCutoff = vec4(bCoord, bCoord);
endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;
endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
endCutoff += viewport.xyxy;
endCutoff += endMiterWidth.xyxy;
}
}
//round miter cutoffs
else if (miterMode == 2.) {
if (enableStartMiter == 1.) {
vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;
startCutoff = vec4(aCoord, aCoord);
startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;
startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
startCutoff += viewport.xyxy;
startCutoff += startMiterWidth.xyxy;
}
if (enableEndMiter == 1.) {
vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;
endCutoff = vec4(bCoord, bCoord);
endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;
endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
endCutoff += viewport.xyxy;
endCutoff += endMiterWidth.xyxy;
}
}
}
`,n=`
precision highp float;
uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;
uniform sampler2D dashTexture;
varying vec4 fragColor;
varying vec2 tangent;
varying vec4 startCutoff, endCutoff;
varying vec2 startCoord, endCoord;
varying float enableStartMiter, enableEndMiter;
float distToLine(vec2 p, vec2 a, vec2 b) {
vec2 diff = b - a;
vec2 perp = normalize(vec2(-diff.y, diff.x));
return dot(p - a, perp);
}
void main() {
float alpha = 1., distToStart, distToEnd;
float cutoff = thickness * .5;
//bevel miter
if (miterMode == 1.) {
if (enableStartMiter == 1.) {
distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);
if (distToStart < -1.) {
discard;
return;
}
alpha *= min(max(distToStart + 1., 0.), 1.);
}
if (enableEndMiter == 1.) {
distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);
if (distToEnd < -1.) {
discard;
return;
}
alpha *= min(max(distToEnd + 1., 0.), 1.);
}
}
// round miter
else if (miterMode == 2.) {
if (enableStartMiter == 1.) {
distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);
if (distToStart < 0.) {
float radius = length(gl_FragCoord.xy - startCoord);
if(radius > cutoff + .5) {
discard;
return;
}
alpha -= smoothstep(cutoff - .5, cutoff + .5, radius);
}
}
if (enableEndMiter == 1.) {
distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);
if (distToEnd < 0.) {
float radius = length(gl_FragCoord.xy - endCoord);
if(radius > cutoff + .5) {
discard;
return;
}
alpha -= smoothstep(cutoff - .5, cutoff + .5, radius);
}
}
}
float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;
float dash = texture2D(dashTexture, vec2(t, .5)).r;
gl_FragColor = fragColor;
gl_FragColor.a *= alpha * opacity * dash;
}
`;te.exports=v;function v(m,b){if(!(this instanceof v))return new v(m,b);if(typeof m=="function"?(b||(b={}),b.regl=m):b=m,b.length&&(b.positions=b),m=b.regl,!m.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=m._gl,this.regl=m,this.passes=[],this.shaders=v.shaders.has(m)?v.shaders.get(m):v.shaders.set(m,v.createShaders(m)).get(m),this.update(b)}v.dashMult=2,v.maxPatternLength=256,v.precisionThreshold=3e6,v.maxPoints=1e4,v.maxLines=2048,v.shaders=new a,v.createShaders=function(m){var b=m.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),E={primitive:"triangle strip",instances:m.prop("count"),count:4,offset:0,uniforms:{miterMode:function(i,C){return C.join==="round"?2:1},miterLimit:m.prop("miterLimit"),scale:m.prop("scale"),scaleFract:m.prop("scaleFract"),translateFract:m.prop("translateFract"),translate:m.prop("translate"),thickness:m.prop("thickness"),dashTexture:m.prop("dashTexture"),opacity:m.prop("opacity"),pixelRatio:m.context("pixelRatio"),id:m.prop("id"),dashLength:m.prop("dashLength"),viewport:function(i,C){return[C.viewport.x,C.viewport.y,i.viewportWidth,i.viewportHeight]},depth:m.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:function(i,C){return!C.overlay}},stencil:{enable:!1},scissor:{enable:!0,box:m.prop("viewport")},viewport:m.prop("viewport")},p=m(o({vert:l,frag:y,attributes:{lineEnd:{buffer:b,divisor:0,stride:8,offset:0},lineTop:{buffer:b,divisor:0,stride:8,offset:4},aCoord:{buffer:m.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:m.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:m.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:m.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:m.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},E)),S;try{S=m(o({cull:{enable:!0,face:"back"},vert:f,frag:n,attributes:{lineEnd:{buffer:b,divisor:0,stride:8,offset:0},lineTop:{buffer:b,divisor:0,stride:8,offset:4},aColor:{buffer:m.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:m.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:m.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:m.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:m.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:m.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},E))}catch{S=p}var w=m({primitive:"triangle",elements:function(i,C){return C.triangles},offset:0,vert:h,frag:T,uniforms:{scale:m.prop("scale"),color:m.prop("fill"),scaleFract:m.prop("scaleFract"),translateFract:m.prop("translateFract"),translate:m.prop("translate"),opacity:m.prop("opacity"),pixelRatio:m.context("pixelRatio"),id:m.prop("id"),viewport:function(i,C){return[C.viewport.x,C.viewport.y,i.viewportWidth,i.viewportHeight]}},attributes:{position:{buffer:m.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:m.prop("positionFractBuffer"),stride:8,offset:8}},blend:E.blend,depth:{enable:!1},scissor:E.scissor,stencil:E.stencil,viewport:E.viewport});return{fill:w,rect:p,miter:S}},v.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},v.prototype.render=function(){for(var m,b=[],E=arguments.length;E--;)b[E]=arguments[E];b.length&&(m=this).update.apply(m,b),this.draw()},v.prototype.draw=function(){for(var m=this,b=[],E=arguments.length;E--;)b[E]=arguments[E];return(b.length?b:this.passes).forEach(function(p,S){var w;if(p&&Array.isArray(p))return(w=m).draw.apply(w,p);typeof p=="number"&&(p=m.passes[p]),p&&p.count>1&&p.opacity&&(m.regl._refresh(),p.fill&&p.triangles&&p.triangles.length>2&&m.shaders.fill(p),p.thickness&&(p.scale[0]*p.viewport.width>v.precisionThreshold||p.scale[1]*p.viewport.height>v.precisionThreshold||p.join==="rect"||!p.join&&(p.thickness<=2||p.count>
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=e(72160),c=e(76752),u=e(3808),l=e(3108),y=e(50896),h=e(26444),T=e(55616),f=e(45223),n=e(47520),v=e(96604),m=e(37816),b=e(51160),E=p;function p(i,C){var x=this;if(!(this instanceof p))return new p(i,C);typeof i=="function"?(C||(C={}),C.regl=i):(C=i,i=null),C&&C.length&&(C.positions=C),i=C.regl;var k=i._gl,I,B=[],_={},z=[],O=[null],F=[null],N=255,V=100;this.tooManyColors=v,I=i.texture({data:new Uint8Array(N*4),width:N,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),y(this,{regl:i,gl:k,groups:z,markerCache:F,markerTextures:O,palette:B,paletteIds:_,paletteTexture:I,maxColors:N,maxSize:V,canvas:k.canvas}),this.update(C);var j={uniforms:{constPointSize:!!C.constPointSize,opacity:i.prop("opacity"),paletteSize:function(Z,G){return[x.tooManyColors?0:N,I.height]},pixelRatio:i.context("pixelRatio"),scale:i.prop("scale"),scaleFract:i.prop("scaleFract"),translate:i.prop("translate"),translateFract:i.prop("translateFract"),markerTexture:i.prop("markerTexture"),paletteTexture:I},attributes:{x:function(Z,G){return G.xAttr||{buffer:G.positionBuffer,stride:8,offset:0}},y:function(Z,G){return G.yAttr||{buffer:G.positionBuffer,stride:8,offset:4}},xFract:function(Z,G){return G.xAttr?{constant:[0,0]}:{buffer:G.positionFractBuffer,stride:8,offset:0}},yFract:function(Z,G){return G.yAttr?{constant:[0,0]}:{buffer:G.positionFractBuffer,stride:8,offset:4}},size:function(Z,G){return G.size.length?{buffer:G.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(G.size*255/x.maxSize)]}},borderSize:function(Z,G){return G.borderSize.length?{buffer:G.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(G.borderSize*255/x.maxSize)]}},colorId:function(Z,G){return G.color.length?{buffer:G.colorBuffer,stride:x.tooManyColors?8:4,offset:0}:{constant:x.tooManyColors?B.slice(G.color*4,G.color*4+4):[G.color]}},borderColorId:function(Z,G){return G.borderColor.length?{buffer:G.colorBuffer,stride:x.tooManyColors?8:4,offset:x.tooManyColors?4:2}:{constant:x.tooManyColors?B.slice(G.borderColor*4,G.borderColor*4+4):[G.borderColor]}},isActive:function(Z,G){return G.activation===!0?{constant:[1]}:G.activation?G.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:i.prop("viewport")},viewport:i.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:i.prop("elements"),count:i.prop("count"),offset:i.prop("offset"),primitive:"points"},$=y({},j);$.frag=h([`precision highp float;
#define GLSLIFY 1
uniform float opacity;
uniform sampler2D markerTexture;
varying vec4 fragColor, fragBorderColor;
varying float fragWidth, fragBorderColorLevel, fragColorLevel;
float smoothStep(float x, float y) {
return 1.0 / (1.0 + exp(50.0*(x - y)));
}
void main() {
float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth;
// max-distance alpha
if (dist < 0.003) discard;
// null-border case
if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {
float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);
gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);
}
else {
float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);
float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);
vec4 color = fragBorderColor;
color.a *= borderColorAmt;
color = mix(color, fragColor, colorAmt);
color.a *= opacity;
gl_FragColor = color;
}
}
`]),$.vert=h([`precision highp float;
#define GLSLIFY 1
attribute float x, y, xFract, yFract;
attribute float size, borderSize;
attribute vec4 colorId, borderColorId;
attribute float isActive;
// \`invariant\` effectively turns off optimizations for the position.
// We need this because -fast-math on M1 Macs is re-ordering
// floating point operations in a way that causes floating point
// precision limits to put points in the wrong locations.
invariant gl_Position;
uniform bool constPointSize;
uniform float pixelRatio;
uniform vec2 scale, scaleFract, translate, translateFract, paletteSize;
uniform sampler2D paletteTexture;
const float maxSize = 100.;
const float borderLevel = .5;
varying vec4 fragColor, fragBorderColor;
varying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;
float pointSizeScale = (constPointSize) ? 2. : pixelRatio;
bool isDirect = (paletteSize.x < 1.);
vec4 getColor(vec4 id) {
return isDirect ? id / 255. : texture2D(paletteTexture,
vec2(
(id.x + .5) / paletteSize.x,
(id.y + .5) / paletteSize.y
)
);
}
void main() {
// ignore inactive points
if (isActive == 0.) return;
vec2 position = vec2(x, y);
vec2 positionFract = vec2(xFract, yFract);
vec4 color = getColor(colorId);
vec4 borderColor = getColor(borderColorId);
float size = size * maxSize / 255.;
float borderSize = borderSize * maxSize / 255.;
gl_PointSize = 2. * size * pointSizeScale;
fragPointSize = size * pixelRatio;
vec2 pos = (position + translate) * scale
+ (positionFract + translateFract) * scale
+ (position + translate) * scaleFract
+ (positionFract + translateFract) * scaleFract;
gl_Position = vec4(pos * 2. - 1., 0., 1.);
fragColor = color;
fragBorderColor = borderColor;
fragWidth = 1. / gl_PointSize;
fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);
fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);
}
`]),this.drawMarker=i($);var q=y({},j);q.frag=h([`precision highp float;
#define GLSLIFY 1
varying vec4 fragColor, fragBorderColor;
varying float fragBorderRadius, fragWidth;
uniform float opacity;
float smoothStep(float edge0, float edge1, float x) {
float t;
t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return t * t * (3.0 - 2.0 * t);
}
void main() {
float radius, alpha = 1.0, delta = fragWidth;
radius = length(2.0 * gl_PointCoord.xy - 1.0);
if (radius > 1.0 + delta) {
discard;
}
alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);
float borderRadius = fragBorderRadius;
float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);
vec4 color = mix(fragColor, fragBorderColor, ratio);
color.a *= alpha * opacity;
gl_FragColor = color;
}
`]),q.vert=h([`precision highp float;
#define GLSLIFY 1
attribute float x, y, xFract, yFract;
attribute float size, borderSize;
attribute vec4 colorId, borderColorId;
attribute float isActive;
// \`invariant\` effectively turns off optimizations for the position.
// We need this because -fast-math on M1 Macs is re-ordering
// floating point operations in a way that causes floating point
// precision limits to put points in the wrong locations.
invariant gl_Position;
uniform bool constPointSize;
uniform float pixelRatio;
uniform vec2 paletteSize, scale, scaleFract, translate, translateFract;
uniform sampler2D paletteTexture;
const float maxSize = 100.;
varying vec4 fragColor, fragBorderColor;
varying float fragBorderRadius, fragWidth;
float pointSizeScale = (constPointSize) ? 2. : pixelRatio;
bool isDirect = (paletteSize.x < 1.);
vec4 getColor(vec4 id) {
return isDirect ? id / 255. : texture2D(paletteTexture,
vec2(
(id.x + .5) / paletteSize.x,
(id.y + .5) / paletteSize.y
)
);
}
void main() {
// ignore inactive points
if (isActive == 0.) return;
vec2 position = vec2(x, y);
vec2 positionFract = vec2(xFract, yFract);
vec4 color = getColor(colorId);
vec4 borderColor = getColor(borderColorId);
float size = size * maxSize / 255.;
float borderSize = borderSize * maxSize / 255.;
gl_PointSize = (size + borderSize) * pointSizeScale;
vec2 pos = (position + translate) * scale
+ (positionFract + translateFract) * scale
+ (position + translate) * scaleFract
+ (positionFract + translateFract) * scaleFract;
gl_Position = vec4(pos * 2. - 1., 0., 1.);
fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);
fragColor = color;
fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;
fragWidth = 1. / gl_PointSize;
}
`]),v&&(q.frag=q.frag.replace("smoothstep","smoothStep"),$.frag=$.frag.replace("smoothstep","smoothStep")),this.drawCircle=i(q)}p.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},p.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},p.prototype.draw=function(){for(var i=this,C=arguments.length,x=new Array(C),k=0;k<C;k++)x[k]=arguments[k];var I=this.groups;if(x.length===1&&Array.isArray(x[0])&&(x[0][0]===null||Array.isArray(x[0][0]))&&(x=x[0]),this.regl._refresh(),x.length)for(var B=0;B<x.length;B++)this.drawItem(B,x[B]);else I.forEach(function(_,z){i.drawItem(z)});return this},p.prototype.drawItem=function(i,C){var x=this.groups,k=x[i];if(typeof C=="number"&&(i=C,k=x[C],C=null),!!(k&&k.count&&k.opacity)){k.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,k,C));for(var I=[],B=1;B<k.activation.length;B++)!k.activation[B]||k.activation[B]!==!0&&!k.activation[B].data.length||I.push.apply(I,o(this.getMarkerDrawOptions(B,k,C)));I.length&&this.drawMarker(I)}},p.prototype.getMarkerDrawOptions=function(i,C,x){var k=C.range,I=C.tree,B=C.viewport,_=C.activation,z=C.selectionBuffer,O=C.count;if(this.regl,!I)return x?[y({},C,{markerTexture:this.markerTextures[i],activation:_[i],count:x.length,elements:x,offset:0})]:[y({},C,{markerTexture:this.markerTextures[i],activation:_[i],offset:0})];var F=[],N=I.range(k,{lod:!0,px:[(k[2]-k[0])/B.width,(k[3]-k[1])/B.height]});if(x){for(var V=_[i],j=V.data,$=new Uint8Array(O),q=0;q<x.length;q++){var oe=x[q];$[oe]=j?j[oe]:1}z.subdata($)}for(var Z=N.length;Z--;){var G=P(N[Z],2),re=G[0],H=G[1];F.push(y({},C,{markerTexture:this.markerTextures[i],activation:x?z:_[i],offset:re,count:H-re}))}return F},p.prototype.update=function(){for(var i=this,C=arguments.length,x=new Array(C),k=0;k<C;k++)x[k]=arguments[k];if(x.length){x.length===1&&Array.isArray(x[0])&&(x=x[0]);var I=this.groups,B=this.gl,_=this.regl,z=this.maxSize,O=this.maxColors,F=this.palette;this.groups=I=x.map(function(N,V){var j=I[V];if(N===void 0)return j;N===null?N={positions:null}:typeof N=="function"?N={ondraw:N}:typeof N[0]=="number"&&(N={positions:N}),N=T(N,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"}),N.positions===null&&(N.positions=[]),N.tooManyColors!=null&&(i.tooManyColors=N.tooManyColors),j||(I[V]=j={id:V,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:_.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:_.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:_.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:_.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:_.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},N=y({},p.defaults,N)),N.positions&&!("marker"in N)&&(N.marker=j.marker,delete j.marker),N.marker&&!("positions"in N)&&(N.positions=j.positions,delete j.positions);var $=0,q=0;if(f(j,N,[{snap:!0,size:function(ye,Se){return ye==null&&(ye=p.defaults.size),$+=ye&&ye.length?1:0,ye},borderSize:function(ye,Se){return ye==null&&(ye=p.defaults.borderSize),$+=ye&&ye.length?1:0,ye},opacity:parseFloat,color:function(ye,Se){return ye==null&&(ye=p.defaults.color),ye=i.updateColor(ye),q++,ye},borderColor:function(ye,Se){return ye==null&&(ye=p.defaults.borderColor),ye=i.updateColor(ye),q++,ye},bounds:function(ye,Se,_e){r
`).replace(/}/g,`}
`).replace(/{/g,`{
`),It;return cr&&(It=N(F(V(_t))),cr[It])?cr[It].apply(null,qe):(_t=Function.apply(null,ct.concat(_t)),cr&&(cr[It]=_t),_t.apply(null,qe))}}}function G(ht){return Array.isArray(ht)||Ae(ht)||u(ht)}function re(ht){return ht.sort(function(Ht,Wt){return Ht==="viewport"?-1:Wt==="viewport"?1:Ht<Wt?-1:1})}function H(ht,Ht,Wt,cr){this.thisDep=ht,this.contextDep=Ht,this.propDep=Wt,this.append=cr}function J(ht){return ht&&!(ht.thisDep||ht.contextDep||ht.propDep)}function ae(ht){return new H(!1,!1,!1,ht)}function K(ht,Ht){var Wt=ht.type;if(Wt===0)return Wt=ht.data.length,new H(!0,1<=Wt,2<=Wt,Ht);if(Wt===4)return Wt=ht.data,new H(Wt.thisDep,Wt.contextDep,Wt.propDep,Ht);if(Wt===5)return new H(!1,!1,!1,Ht);if(Wt===6){for(var cr=Wt=!1,er=!1,ct=0;ct<ht.data.length;++ct){var qe=ht.data[ct];qe.type===1?er=!0:qe.type===2?cr=!0:qe.type===3?Wt=!0:qe.type===0?(Wt=!0,qe=qe.data,1<=qe&&(cr=!0),2<=qe&&(er=!0)):qe.type===4&&(Wt=Wt||qe.data.thisDep,cr=cr||qe.data.contextDep,er=er||qe.data.propDep)}return new H(Wt,cr,er,Ht)}return new H(Wt===3,Wt===2,Wt===1,Ht)}function Y(ht,Ht,Wt,cr,er,ct,qe,dt,bt,Et,Mt,_t,It,Gt,nr,ar){function ir(xr){return xr.replace(".","_")}function Be(xr,Rr,yr){var Dr=ir(xr);pn.push(xr),zn[Dr]=fn[Dr]=!!yr,gn[Dr]=Rr}function Fe(xr,Rr,yr){var Dr=ir(xr);pn.push(xr),Array.isArray(yr)?(fn[Dr]=yr.slice(),zn[Dr]=yr.slice()):fn[Dr]=zn[Dr]=yr,In[Dr]=Rr}function Rt(){var xr=Z({cache:nr}),Rr=xr.link,yr=xr.global;xr.id=Ma++,xr.batchId="0";var Dr=Rr(Gn),vn=xr.shared={props:"a0"};Object.keys(Gn).forEach(function(Vr){vn[Vr]=yr.def(Dr,".",Vr)});var En=xr.next={},an=xr.current={};Object.keys(In).forEach(function(Vr){Array.isArray(fn[Vr])&&(En[Vr]=yr.def(vn.next,".",Vr),an[Vr]=yr.def(vn.current,".",Vr))});var en=xr.constants={};Object.keys(ua).forEach(function(Vr){en[Vr]=yr.def(JSON.stringify(ua[Vr]))}),xr.invoke=function(Vr,zr){switch(zr.type){case 0:var Yr=["this",vn.context,vn.props,xr.batchId];return Vr.def(Rr(zr.data),".call(",Yr.slice(0,Math.max(zr.data.length+1,4)),")");case 1:return Vr.def(vn.props,zr.data);case 2:return Vr.def(vn.context,zr.data);case 3:return Vr.def("this",zr.data);case 4:return zr.data.append(xr,Vr),zr.data.ref;case 5:return zr.data.toString();case 6:return zr.data.map(function(dn){return xr.invoke(Vr,dn)})}},xr.attribCache={};var br={};return xr.scopeAttrib=function(Vr){if(Vr=Ht.id(Vr),Vr in br)return br[Vr];var zr=Et.scope[Vr];return zr||(zr=Et.scope[Vr]=new Jn),br[Vr]=Rr(zr)},xr}function Lt(xr){var Rr=xr.static;xr=xr.dynamic;var yr;if("profile"in Rr){var Dr=!!Rr.profile;yr=ae(function(En,an){return Dr}),yr.enable=Dr}else if("profile"in xr){var vn=xr.profile;yr=K(vn,function(En,an){return En.invoke(an,vn)})}return yr}function Ut(xr,Rr){var yr=xr.static,Dr=xr.dynamic;if("framebuffer"in yr){var vn=yr.framebuffer;return vn?(vn=dt.getFramebuffer(vn),ae(function(an,en){var br=an.link(vn),Vr=an.shared;return en.set(Vr.framebuffer,".next",br),Vr=Vr.context,en.set(Vr,".framebufferWidth",br+".width"),en.set(Vr,".framebufferHeight",br+".height"),br})):ae(function(an,en){var br=an.shared;return en.set(br.framebuffer,".next","null"),br=br.context,en.set(br,".framebufferWidth",br+".drawingBufferWidth"),en.set(br,".framebufferHeight",br+".drawingBufferHeight"),"null"})}if("framebuffer"in Dr){var En=Dr.framebuffer;return K(En,function(an,en){var zr=an.invoke(en,En),br=an.shared,Vr=br.framebuffer,zr=en.def(Vr,".getFramebuffer(",zr,")");return en.set(Vr,".next",zr),br=br.context,en.set(br,".framebufferWidth",zr+"?"+zr+".width:"+br+".drawingBufferWidth"),en.set(br,".framebufferHeight",zr+"?"+zr+".height:"+br+".drawingBufferHeight"),zr})}return null}function Qt(xr,Rr,yr){function Dr(en){if(en in vn){var br=vn[en];en=!0;var Vr=br.x|0,zr=br.y|0,Yr,dn;return"width"in br?Yr=br.width|0:en=!1,"height"in br?dn=br.height|0:en=!1,new H(!en&&Rr&&Rr.thisDep,!en&&Rr&&Rr.contextDep,!en&&Rr&&Rr.propDep,function(Tn,kn){var Pn=Tn.shared.context,fa=Yr;"width"in br||(fa=kn.def(Pn,".","framebufferWidth","-",Vr));var $n=dn;return"height"in br||($n=kn.def(Pn,".","framebufferHeight","-",zr)),[Vr,zr,fa,$n]})}if(en in En){var wn=En[en];return en=K(wn,functi
`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),L)}},7328:function(te,X,e){var A=e(81680),P={object:!0,function:!0,undefined:!0};te.exports=function(o){return A(o)?hasOwnProperty.call(P,typeof o):!1}},87396:function(te,X,e){var A=e(57980),P=e(85488);te.exports=function(o){return P(o)?o:A(o,"%v is not a plain function",arguments[1])}},85488:function(te,X,e){var A=e(73384),P=/^\s*class[\s{/}]/,o=Function.prototype.toString;te.exports=function(L){return!(!A(L)||P.test(o.call(L)))}},54612:function(te,X,e){var A=e(7328);te.exports=function(P){if(!A(P))return!1;try{return P.constructor?P.constructor.prototype===P:!1}catch{return!1}}},33940:function(te,X,e){var A=e(81680),P=e(7328),o=Object.prototype.toString;te.exports=function(L){if(!A(L))return null;if(P(L)){var M=L.toString;if(typeof M!="function"||M===o)return null}try{return""+L}catch{return null}}},18496:function(te,X,e){var A=e(57980),P=e(81680);te.exports=function(o){return P(o)?o:A(o,"Cannot use %v",arguments[1])}},81680:function(te){var X=void 0;te.exports=function(e){return e!==X&&e!==null}},14144:function(te,X,e){var A=e(308),P=e(10352),o=e(33576).Buffer;e.g.__TYPEDARRAY_POOL||(e.g.__TYPEDARRAY_POOL={UINT8:P([32,0]),UINT16:P([32,0]),UINT32:P([32,0]),BIGUINT64:P([32,0]),INT8:P([32,0]),INT16:P([32,0]),INT32:P([32,0]),BIGINT64:P([32,0]),FLOAT:P([32,0]),DOUBLE:P([32,0]),DATA:P([32,0]),UINT8C:P([32,0]),BUFFER:P([32,0])});var L=typeof Uint8ClampedArray<"u",M=typeof BigUint64Array<"u",d=typeof BigInt64Array<"u",g=e.g.__TYPEDARRAY_POOL;g.UINT8C||(g.UINT8C=P([32,0])),g.BIGUINT64||(g.BIGUINT64=P([32,0])),g.BIGINT64||(g.BIGINT64=P([32,0])),g.BUFFER||(g.BUFFER=P([32,0]));var r=g.DATA,t=g.BUFFER;X.free=function(i){if(o.isBuffer(i))t[A.log2(i.length)].push(i);else{if(Object.prototype.toString.call(i)!=="[object ArrayBuffer]"&&(i=i.buffer),!i)return;var C=i.length||i.byteLength,x=A.log2(C)|0;r[x].push(i)}};function s(w){if(w){var i=w.length||w.byteLength,C=A.log2(i);r[C].push(w)}}function a(w){s(w.buffer)}X.freeUint8=X.freeUint16=X.freeUint32=X.freeBigUint64=X.freeInt8=X.freeInt16=X.freeInt32=X.freeBigInt64=X.freeFloat32=X.freeFloat=X.freeFloat64=X.freeDouble=X.freeUint8Clamped=X.freeDataView=a,X.freeArrayBuffer=s,X.freeBuffer=function(i){t[A.log2(i.length)].push(i)},X.malloc=function(i,C){if(C===void 0||C==="arraybuffer")return c(i);switch(C){case"uint8":return u(i);case"uint16":return l(i);case"uint32":return y(i);case"int8":return h(i);case"int16":return T(i);case"int32":return f(i);case"float":case"float32":return n(i);case"double":case"float64":return v(i);case"uint8_clamped":return m(i);case"bigint64":return E(i);case"biguint64":return b(i);case"buffer":return S(i);case"data":case"dataview":return p(i);default:return null}return null};function c(i){var i=A.nextPow2(i),C=A.log2(i),x=r[C];return x.length>0?x.pop():new ArrayBuffer(i)}X.mallocArrayBuffer=c;function u(w){return new Uint8Array(c(w),0,w)}X.mallocUint8=u;function l(w){return new Uint16Array(c(2*w),0,w)}X.mallocUint16=l;function y(w){return new Uint32Array(c(4*w),0,w)}X.mallocUint32=y;function h(w){return new Int8Array(c(w),0,w)}X.mallocInt8=h;function T(w){return new Int16Array(c(2*w),0,w)}X.mallocInt16=T;function f(w){return new Int32Array(c(4*w),0,w)}X.mallocInt32=f;function n(w){return new Float32Array(c(4*w),0,w)}X.mallocFloat32=X.mallocFloat=n;function v(w){return new Float64Array(c(8*w),0,w)}X.mallocFloat64=X.mallocDouble=v;function m(w){return L?new Uint8ClampedArray(c(w),0,w):u(w)}X.mallocUint8Clamped=m;function b(w){return M?new BigUint64Array(c(8*w),0,w):null}X.mallocBigUint64=b;function E(w){return d?new BigInt64Array(c(8*w),0,w):null}X.mallocBigInt64=E;function p(w){return new DataView(c(w),0,w)}X.mallocDataView=p;function S(w){w=A.nextPow2(w);var i=A.log2(w),C=t[i];return C.length>0?C.pop():new o(w)}X.mallocBuffer=S,X.clearCache=function(){for(var i=0;i<32;++i)g.UINT8[i].length=0,g.UINT16[i].length=0,g.UINT32[i].length=0,g.INT8[i].length=0,g.INT16[i].length=0,g.INT32[i].length=0,g.FLOAT[i].length=0,g.DOUBLE
`)>-1&&(G?H=H.split(`
`).map(function(ae){return" "+ae}).join(`
`).slice(2):H=`
`+H.split(`
`).map(function(ae){return" "+ae}).join(`
`))):H=j.stylize("[Circular]","special")),p(re)){if(G&&Z.match(/^\d+$/))return H;re=JSON.stringify(""+Z),re.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(re=re.slice(1,-1),re=j.stylize(re,"name")):(re=re.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),re=j.stylize(re,"string"))}return re+": "+H}function h(j,$,q){var oe=j.reduce(function(Z,G){return G.indexOf(`
`)>=0,Z+G.replace(/\u001b\[\d\d?m/g,"").length+1},0);return oe>60?q[0]+($===""?"":$+`
`)+" "+j.join(`,
`)+" "+q[1]:q[0]+$+" "+j.join(", ")+" "+q[1]}X.types=e(41088);function T(j){return Array.isArray(j)}X.isArray=T;function f(j){return typeof j=="boolean"}X.isBoolean=f;function n(j){return j===null}X.isNull=n;function v(j){return j==null}X.isNullOrUndefined=v;function m(j){return typeof j=="number"}X.isNumber=m;function b(j){return typeof j=="string"}X.isString=b;function E(j){return typeof j=="symbol"}X.isSymbol=E;function p(j){return j===void 0}X.isUndefined=p;function S(j){return w(j)&&I(j)==="[object RegExp]"}X.isRegExp=S,X.types.isRegExp=S;function w(j){return typeof j=="object"&&j!==null}X.isObject=w;function i(j){return w(j)&&I(j)==="[object Date]"}X.isDate=i,X.types.isDate=i;function C(j){return w(j)&&(I(j)==="[object Error]"||j instanceof Error)}X.isError=C,X.types.isNativeError=C;function x(j){return typeof j=="function"}X.isFunction=x;function k(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}X.isPrimitive=k,X.isBuffer=e(75272);function I(j){return Object.prototype.toString.call(j)}function B(j){return j<10?"0"+j.toString(10):j.toString(10)}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function z(){var j=new Date,$=[B(j.getHours()),B(j.getMinutes()),B(j.getSeconds())].join(":");return[j.getDate(),_[j.getMonth()],$].join(" ")}X.log=function(){console.log("%s - %s",z(),X.format.apply(X,arguments))},X.inherits=e(6768),X._extend=function(j,$){if(!$||!w($))return j;for(var q=Object.keys($),oe=q.length;oe--;)j[q[oe]]=$[q[oe]];return j};function O(j,$){return Object.prototype.hasOwnProperty.call(j,$)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;X.promisify=function($){if(typeof $!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&$[F]){var q=$[F];if(typeof q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(q,F,{value:q,enumerable:!1,writable:!1,configurable:!0}),q}function q(){for(var oe,Z,G=new Promise(function(J,ae){oe=J,Z=ae}),re=[],H=0;H<arguments.length;H++)re.push(arguments[H]);re.push(function(J,ae){J?Z(J):oe(ae)});try{$.apply(this,re)}catch(J){Z(J)}return G}return Object.setPrototypeOf(q,Object.getPrototypeOf($)),F&&Object.defineProperty(q,F,{value:q,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(q,P($))},X.promisify.custom=F;function N(j,$){if(!j){var q=new Error("Promise was rejected with a falsy value");q.reason=j,j=q}return $(j)}function V(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');function $(){for(var q=[],oe=0;oe<arguments.length;oe++)q.push(arguments[oe]);var Z=q.pop();if(typeof Z!="function")throw new TypeError("The last argument must be of type Function");var G=this,re=function(){return Z.apply(G,arguments)};j.apply(this,q).then(function(H){A.nextTick(re.bind(null,null,H))},function(H){A.nextTick(N.bind(null,H,re))})}return Object.setPrototypeOf($,Object.getPrototypeOf(j)),Object.defineProperties($,P(j)),$}X.callbackify=V},5408:function(te,X,e){var A=e(13380);te.exports=function(o){return A("webgl",o)}},96632:function(te,X,e){var A=e(46492),P=e(63436),o=e(57916),L=e(99676),M=e(2304),d=L("Object.prototype.toString"),g=e(46672)(),r=typeof globalThis>"u"?e.g:globalThis,t=P(),s=L("String.prototype.slice"),a=Object.getPrototypeOf,c=L("Array.prototype.indexOf",!0)||function(T,f){for(var n=0;n<T.length;n+=1)if(T[n]===f)return n;return-1},u={__proto__:null};g&&M&&a?A(t,function(h){var T=new r[h];if(Symbol.toStringTag in T){var f=a(T),n=M(f,Symbol.toStringTag);if(!n){var v=a(f);n=M(v,Symbol.toStringTag)}u["$"+h]=o(n.get)}}):A(t,function(h){var T=new r[h],f=T.slice||T.set;f&&(u["$"+h]=o(f))});var l=function(T){var f=!1;return A(u,function(n,v){if(!f)try{"$"+n(T)===v&&(f=s(v,1))}catch{}}),f},y=function(T){var f=!1;return A(u,function(n,v){if(!f)try{n(T),f=s(v,1)}catch{}}),f};te.exports=function(T){if(!T||typeof T!="object")return!1;if(!g){var f=s(d(T),8,-1);return c(t,f)>-1?f:f!=="Object"?!1:y(T)}return
//# sourceMappingURL=react-plotly-X7Qwg0tb.js.map